diff --git a/.hgtags b/.hgtags index 1e246bd5193..0c0073065b8 100644 --- a/.hgtags +++ b/.hgtags @@ -460,7 +460,8 @@ a2008587c13fa05fa2dbfcb09fe987576fbedfd1 jdk-10+32 bbd692ad4fa300ecca7939ffbe3b1d5e52a28cc6 jdk-10+33 89deac44e51517841491ba86ff44aa82a5ca96b3 jdk-10+34 d8c634b016c628622c9abbdc6bf50509e5dedbec jdk-10+35 -cb54a299aa91419cb7caef3992592e7b22488163 jdk-10+36 +0ee20aad71c4f33c426372b4c8bcc1235ce2ec08 jdk-11+0 +959f2f7cbaa6d2ee45d50029744efb219721576c jdk-10+36 4f830b447edf04fb4a52151a5ad44d9bb60723cd jdk-10+37 e569e83139fdfbecfeb3cd9014d560917787f158 jdk-10+38 5b834ec962366e00d4445352a999a3ac14e26f64 jdk-10+39 diff --git a/bin/idea.sh b/bin/idea.sh index 13c47490292..03b9eee13da 100644 --- a/bin/idea.sh +++ b/bin/idea.sh @@ -30,9 +30,10 @@ usage() { } SCRIPT_DIR=`dirname $0` -PWD=`pwd` +#assume TOP is the dir from which the script has been called +TOP=`pwd` cd $SCRIPT_DIR; SCRIPT_DIR=`pwd` -cd ../; TOP=`pwd`; cd $PWD +cd $TOP; IDEA_OUTPUT=$TOP/.idea VERBOSE="false" @@ -66,30 +67,42 @@ done mkdir $IDEA_OUTPUT || exit 1 cd $IDEA_OUTPUT; IDEA_OUTPUT=`pwd` -IDEA_MAKE="$TOP/make/idea" +MAKE_DIR="$SCRIPT_DIR/../make" +IDEA_MAKE="$MAKE_DIR/idea" IDEA_TEMPLATE="$IDEA_MAKE/template" -IML_TEMPLATE="$IDEA_TEMPLATE/jdk.iml" -ANT_TEMPLATE="$IDEA_TEMPLATE/ant.xml" -MISC_TEMPLATE="$IDEA_TEMPLATE/misc.xml" -IDEA_IML="$IDEA_OUTPUT/jdk.iml" -IDEA_ANT="$IDEA_OUTPUT/ant.xml" -IDEA_MISC="$IDEA_OUTPUT/misc.xml" + +cp -r "$IDEA_TEMPLATE"/* "$IDEA_OUTPUT" + +#init template variables +for file in `ls -p $IDEA_TEMPLATE | grep -v /`; do + VAR_SUFFIX=`echo $file | cut -d'.' -f1 | tr [:lower:] [:upper:]` + eval "$VAR_SUFFIX"_TEMPLATE="$IDEA_TEMPLATE"/$file + eval IDEA_"$VAR_SUFFIX"="$IDEA_OUTPUT"/$file +done + +#override template variables +if [ -d "$TEMPLATES_OVERRIDE" ] ; then + for file in `ls -p "$TEMPLATES_OVERRIDE" | grep -v /`; do + cp "$TEMPLATES_OVERRIDE"/$file "$IDEA_OUTPUT"/ + VAR_SUFFIX=`echo $file | cut -d'.' -f1 | tr [:lower:] [:upper:]` + eval "$VAR_SUFFIX"_TEMPLATE="$TEMPLATES_OVERRIDE"/$file + done +fi if [ "$VERBOSE" = "true" ] ; then echo "output dir: $IDEA_OUTPUT" echo "idea template dir: $IDEA_TEMPLATE" fi -if [ ! -f "$IML_TEMPLATE" ] ; then - echo "FATAL: cannot find $IML_TEMPLATE" >&2; exit 1 +if [ ! -f "$JDK_TEMPLATE" ] ; then + echo "FATAL: cannot find $JDK_TEMPLATE" >&2; exit 1 fi if [ ! -f "$ANT_TEMPLATE" ] ; then echo "FATAL: cannot find $ANT_TEMPLATE" >&2; exit 1 fi -cp -r "$IDEA_TEMPLATE"/* "$IDEA_OUTPUT" -cd $TOP ; make -f "$IDEA_MAKE/idea.gmk" -I make/common idea MAKEOVERRIDES= OUT=$IDEA_OUTPUT/env.cfg MODULES="$*" || exit 1 +cd $TOP ; make -f "$IDEA_MAKE/idea.gmk" -I $MAKE_DIR/.. idea MAKEOVERRIDES= OUT=$IDEA_OUTPUT/env.cfg MODULES="$*" || exit 1 cd $SCRIPT_DIR . $IDEA_OUTPUT/env.cfg @@ -118,11 +131,12 @@ addSourceFolder() { root=$@ relativePath="`echo "$root" | sed -e s@"$TOP/\(.*$\)"@"\1"@`" folder="`echo "$SOURCE_FOLDER" | sed -e s@"\(.*/\)####\(.*\)"@"\1$relativePath\2"@`" - printf "%s\n" "$folder" >> $IDEA_IML + printf "%s\n" "$folder" >> $IDEA_JDK } ### Generate project iml -rm -f $IDEA_IML + +rm -f $IDEA_JDK while IFS= read -r line do if echo "$line" | egrep "^ .* /dev/null ; then @@ -133,9 +147,9 @@ do done fi else - printf "%s\n" "$line" >> $IDEA_IML + printf "%s\n" "$line" >> $IDEA_JDK fi -done < "$IML_TEMPLATE" +done < "$JDK_TEMPLATE" MODULE_NAME=" " diff --git a/doc/building.html b/doc/building.html index bd4c1d80ddd..3a70914e233 100644 --- a/doc/building.html +++ b/doc/building.html @@ -56,10 +56,10 @@
  • ALSA
  • libffi
  • -
  • Other Tooling Requirements
      +
    • Build Tools Requirements
    • Running Configure
      • Common Configure Arguments
      • @@ -116,10 +116,10 @@

        If you are eager to try out building OpenJDK, these simple steps works most of the time. They assume that you have installed Mercurial (and Cygwin if running on Windows) and cloned the top-level OpenJDK repository that you want to build.

        1. Get the complete source code:
          -hg clone http://hg.openjdk.java.net/jdk10/master

        2. +hg clone http://hg.openjdk.java.net/jdk/jdk

        3. Run configure:
          bash configure

          -

          If configure fails due to missing dependencies (to either the toolchain, external libraries or the boot JDK), most of the time it prints a suggestion on how to resolve the situation on your platform. Follow the instructions, and try running bash configure again.

        4. +

          If configure fails due to missing dependencies (to either the toolchain, build tools, external libraries or the boot JDK), most of the time it prints a suggestion on how to resolve the situation on your platform. Follow the instructions, and try running bash configure again.

        5. Run make:
          make images

        6. Verify your newly built JDK:
          @@ -201,12 +201,13 @@

          OpenJDK requires GNU Make 4.0 or greater on Windows. This is usually not a problem, since Cygwin currently only distributes GNU Make at a version above 4.0.

          Apart from the basic Cygwin installation, the following packages must also be installed:

            +
          • autoconf
          • make
          • zip
          • unzip

          Often, you can install these packages using the following command line:

          -
          <path to Cygwin setup>/setup-x86_64 -q -P make -P unzip -P zip
          +
          <path to Cygwin setup>/setup-x86_64 -q -P autoconf -P make -P unzip -P zip

          Unfortunately, Cygwin can be unreliable in certain circumstances. If you experience build tool crashes or strange issues when building on Windows, please check the Cygwin FAQ on the "BLODA" list and the section on fork() failures.

          Solaris

          See make/devkit/solaris11.1-package-list.txt for a list of recommended packages to install when building on Solaris. The versions specified in this list is the versions used by the daily builds at Oracle, and is likely to work properly.

          @@ -424,7 +425,17 @@ tar -xzf freetype-2.5.3.tar.gz
        7. To install on an rpm-based Linux, try running sudo yum install libffi-devel.

      Use --with-libffi=<path> if configure does not properly locate your libffi files.

      -

      Other Tooling Requirements

      +

      Build Tools Requirements

      +

      Autoconf

      +

      OpenJDK requires Autoconf on all platforms. At least version 2.69 is required.

      +
        +
      • To install on an apt-based Linux, try running sudo apt-get install autoconf.
      • +
      • To install on an rpm-based Linux, try running sudo yum install autoconf.
      • +
      • To install on macOS, try running brew install autoconf.
      • +
      • To install on Windows, try running <path to Cygwin setup>/setup-x86_64 -q -P autoconf.
      • +
      +

      If configure has problems locating your installation of autoconf, you can specify it using the AUTOCONF environment variable, like this:

      +
      AUTOCONF=<path to autoconf> configure ...

      GNU Make

      OpenJDK requires GNU Make. No other flavors of make are supported.

      At least version 3.81 of GNU Make must be used. For distributions supporting GNU Make 4.0 or above, we strongly recommend it. GNU Make 4.0 contains useful functionality to handle parallel building (supported by --with-output-sync) and speed and stability improvements.

      @@ -434,10 +445,6 @@ tar -xzf freetype-2.5.3.tar.gz

      GNU Bash

      OpenJDK requires GNU Bash. No other shells are supported.

      At least version 3.2 of GNU Bash must be used.

      -

      Autoconf

      -

      If you want to modify the build system itself, you need to install Autoconf.

      -

      However, if you only need to build OpenJDK or if you only edit the actual OpenJDK source files, there is no dependency on autoconf, since the source distribution includes a pre-generated configure shell script.

      -

      See the section on Autoconf Details for details on how OpenJDK uses autoconf. This is especially important if you plan to contribute changes to OpenJDK that modifies the build system.

      Running Configure

      To build OpenJDK, you need a "configuration", which consists of a directory where to store the build output, coupled with information about the platform, the specific build machine, and choices that affect how OpenJDK is built.

      The configuration is created by the configure script. The basic invocation of the configure script looks like this:

      @@ -751,7 +758,12 @@ cannot create ... Permission denied spawn failed

      This can be a sign of a Cygwin problem. See the information about solving problems in the Cygwin section. Rebooting the computer might help temporarily.

      Getting Help

      -

      If none of the suggestions in this document helps you, or if you find what you believe is a bug in the build system, please contact the Build Group by sending a mail to build-dev@openjdk.java.net. Please include the relevant parts of the configure and/or build log.

      +

      If none of the suggestions in this document helps you, or if you find what you believe is a bug in the build system, please contact the Build Group by sending a mail to . Please include the relevant parts of the configure and/or build log.

      If you need general help or advice about developing for OpenJDK, you can also contact the Adoption Group. See the section on Contributing to OpenJDK for more information.

      Hints and Suggestions for Advanced Users

      Setting Up a Forest for Pushing Changes (defpath)

      @@ -871,15 +883,9 @@ test-support/

      When building for distribution, zipped is a good solution. Binaries built with internal is suitable for use by developers, since they facilitate debugging, but should be stripped before distributed to end users.

      Autoconf Details

      The configure script is based on the autoconf framework, but in some details deviate from a normal autoconf configure script.

      -

      The configure script in the top level directory of OpenJDK is just a thin wrapper that calls make/autoconf/configure. This in turn provides functionality that is not easily expressed in the normal Autoconf framework, and then calls into the core of the configure script, which is the make/autoconf/generated-configure.sh file.

      -

      As the name implies, this file is generated by Autoconf. It is checked in after regeneration, to alleviate the common user to have to install Autoconf.

      -

      The build system will detect if the Autoconf source files have changed, and will trigger a regeneration of make/autoconf/generated-configure.sh if needed. You can also manually request such an update by bash make/autoconf/autogen.sh.

      -

      If you make changes to the build system that requires a re-generation, note the following:

      -
        -
      • You must use exactly version 2.69 of autoconf for your patch to be accepted. This is to avoid spurious changes in the generated file. Note that Ubuntu 16.04 ships a patched version of autoconf which claims to be 2.69, but is not.

      • -
      • You do not need to include the generated file in reviews.

      • -
      • If the generated file needs updating, the Oracle JDK closed counter-part will also need to be updated. It is very much appreciated if you ask for an Oracle engineer to sponsor your push so this can be made in tandem.

      • -
      +

      The configure script in the top level directory of OpenJDK is just a thin wrapper that calls make/autoconf/configure. This in turn will run autoconf to create the runnable (generated) configure script, as .build/generated-configure.sh. Apart from being responsible for the generation of the runnable script, the configure script also provides functionality that is not easily expressed in the normal Autoconf framework. As part of this functionality, the generated script is called.

      +

      The build system will detect if the Autoconf source files have changed, and will trigger a regeneration of the generated script if needed. You can also manually request such an update by bash configure autogen.

      +

      In previous versions of the OpenJDK, the generated script was checked in at make/autoconf/generated-configure.sh. This is no longer the case.

      Developing the Build System Itself

      This section contains a few remarks about how to develop for the build system itself. It is not relevant if you are only making changes in the product source code.

      While technically using make, the make source files of the OpenJDK does not resemble most other Makefiles. Instead of listing specific targets and actions (perhaps using patterns), the basic modus operandi is to call a high-level function (or properly, macro) from the API in make/common. For instance, to compile all classes in the jdk.internal.foo package in the jdk.foo module, a call like this would be made:

      @@ -897,7 +903,7 @@ test-support/
      make COMPARE_BUILD=CONF=--enable-new-hotspot-feature:MAKE=hotspot

      See make/InitSupport.gmk for details on how to use COMPARE_BUILD.

      To analyze build performance, run with LOG=trace and check $BUILD/build-trace-time.log. Use JOBS=1 to avoid parallelism.

      -

      Please check that you adhere to the Code Conventions for the Build System before submitting patches. Also see the section in Autoconf Details about the generated configure script.

      +

      Please check that you adhere to the Code Conventions for the Build System before submitting patches.

      Contributing to OpenJDK

      So, now you've build your OpenJDK, and made your first patch, and want to contribute it back to the OpenJDK community.

      First of all: Thank you! We gladly welcome your contribution to the OpenJDK. However, please bear in mind that OpenJDK is a massive project, and we must ask you to follow our rules and guidelines to be able to accept your contribution.

      diff --git a/doc/building.md b/doc/building.md index 31f7d57578c..77731ac9c3c 100644 --- a/doc/building.md +++ b/doc/building.md @@ -7,13 +7,14 @@ the time. They assume that you have installed Mercurial (and Cygwin if running on Windows) and cloned the top-level OpenJDK repository that you want to build. 1. [Get the complete source code](#getting-the-source-code): \ - `hg clone http://hg.openjdk.java.net/jdk10/master` + `hg clone http://hg.openjdk.java.net/jdk/jdk` 2. [Run configure](#running-configure): \ `bash configure` If `configure` fails due to missing dependencies (to either the - [toolchain](#native-compiler-toolchain-requirements), [external libraries]( + [toolchain](#native-compiler-toolchain-requirements), [build tools]( + #build-tools-requirements), [external libraries]( #external-library-requirements) or the [boot JDK](#boot-jdk-requirements)), most of the time it prints a suggestion on how to resolve the situation on your platform. Follow the instructions, and try running `bash configure` @@ -195,13 +196,14 @@ problem, since Cygwin currently only distributes GNU Make at a version above Apart from the basic Cygwin installation, the following packages must also be installed: + * `autoconf` * `make` * `zip` * `unzip` Often, you can install these packages using the following command line: ``` -/setup-x86_64 -q -P make -P unzip -P zip +/setup-x86_64 -q -P autoconf -P make -P unzip -P zip ``` Unfortunately, Cygwin can be unreliable in certain circumstances. If you @@ -552,7 +554,27 @@ Hotspot. Use `--with-libffi=` if `configure` does not properly locate your libffi files. -## Other Tooling Requirements +## Build Tools Requirements + +### Autoconf + +OpenJDK requires [Autoconf](http://www.gnu.org/software/autoconf) on all +platforms. At least version 2.69 is required. + + * To install on an apt-based Linux, try running `sudo apt-get install + autoconf`. + * To install on an rpm-based Linux, try running `sudo yum install + autoconf`. + * To install on macOS, try running `brew install autoconf`. + * To install on Windows, try running `/setup-x86_64 -q + -P autoconf`. + +If `configure` has problems locating your installation of autoconf, you can +specify it using the `AUTOCONF` environment variable, like this: + +``` +AUTOCONF= configure ... +``` ### GNU Make @@ -585,19 +607,6 @@ are supported. At least version 3.2 of GNU Bash must be used. -### Autoconf - -If you want to modify the build system itself, you need to install [Autoconf]( -http://www.gnu.org/software/autoconf). - -However, if you only need to build OpenJDK or if you only edit the actual -OpenJDK source files, there is no dependency on autoconf, since the source -distribution includes a pre-generated `configure` shell script. - -See the section on [Autoconf Details](#autoconf-details) for details on how -OpenJDK uses autoconf. This is especially important if you plan to contribute -changes to OpenJDK that modifies the build system. - ## Running Configure To build OpenJDK, you need a "configuration", which consists of a directory @@ -1660,32 +1669,19 @@ The `configure` script is based on the autoconf framework, but in some details deviate from a normal autoconf `configure` script. The `configure` script in the top level directory of OpenJDK is just a thin -wrapper that calls `make/autoconf/configure`. This in turn provides -functionality that is not easily expressed in the normal Autoconf framework, -and then calls into the core of the `configure` script, which is the -`make/autoconf/generated-configure.sh` file. - -As the name implies, this file is generated by Autoconf. It is checked in after -regeneration, to alleviate the common user to have to install Autoconf. +wrapper that calls `make/autoconf/configure`. This in turn will run `autoconf` +to create the runnable (generated) configure script, as +`.build/generated-configure.sh`. Apart from being responsible for the +generation of the runnable script, the `configure` script also provides +functionality that is not easily expressed in the normal Autoconf framework. As +part of this functionality, the generated script is called. The build system will detect if the Autoconf source files have changed, and -will trigger a regeneration of `make/autoconf/generated-configure.sh` if -needed. You can also manually request such an update by `bash -make/autoconf/autogen.sh`. +will trigger a regeneration of the generated script if needed. You can also +manually request such an update by `bash configure autogen`. -If you make changes to the build system that requires a re-generation, note the -following: - - * You must use *exactly* version 2.69 of autoconf for your patch to be - accepted. This is to avoid spurious changes in the generated file. Note - that Ubuntu 16.04 ships a patched version of autoconf which claims to be - 2.69, but is not. - - * You do not need to include the generated file in reviews. - - * If the generated file needs updating, the Oracle JDK closed counter-part - will also need to be updated. It is very much appreciated if you ask for an - Oracle engineer to sponsor your push so this can be made in tandem. +In previous versions of the OpenJDK, the generated script was checked in at +`make/autoconf/generated-configure.sh`. This is no longer the case. ### Developing the Build System Itself @@ -1736,8 +1732,7 @@ Use `JOBS=1` to avoid parallelism. Please check that you adhere to the [Code Conventions for the Build System]( http://openjdk.java.net/groups/build/doc/code-conventions.html) before -submitting patches. Also see the section in [Autoconf Details]( -#autoconf-details) about the generated configure script. +submitting patches. ## Contributing to OpenJDK diff --git a/make/CompileInterimRmic.gmk b/make/CompileInterimRmic.gmk index 6127e930c09..3ef523836e4 100644 --- a/make/CompileInterimRmic.gmk +++ b/make/CompileInterimRmic.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -69,8 +69,6 @@ $(eval $(call SetupJavaCompilation, BUILD_jdk.rmic.interim, \ COPY := .properties, \ ADD_JAVAC_FLAGS := \ --module-path $(BUILDTOOLS_OUTPUTDIR)/interim_rmic_modules \ - --add-modules java.corba \ - --add-exports java.corba/com.sun.corba.se.impl.util=jdk.rmic.interim \ $(INTERIM_RMIC_ADD_EXPORTS), \ )) diff --git a/make/CompileJavaModules.gmk b/make/CompileJavaModules.gmk index f436b44a4c1..962d6b432ff 100644 --- a/make/CompileJavaModules.gmk +++ b/make/CompileJavaModules.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -38,10 +38,6 @@ $(eval $(call IncludeCustomExtension, CompileJavaModules.gmk)) ################################################################################ # Module specific build settings -java.activation_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS - -################################################################################ - java.base_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference '-Xdoclint/package:java.*,javax.*' -XDstringConcat=inline java.base_COPY += .icu .dat .spp content-types.properties hijrah-config-islamic-umalqura.properties java.base_CLEAN += intrinsic.properties @@ -256,10 +252,6 @@ java.prefs_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*, ################################################################################ -java.transaction_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*' - -################################################################################ - java.sql_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*' java.sql_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS @@ -279,27 +271,6 @@ java.rmi_CLEAN_FILES += $(wildcard \ ################################################################################ -java.corba_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS - -java.corba_COPY += .prp -java.corba_CLEAN += .properties - -java.corba_EXCLUDES += \ - com/sun/corba/se/PortableActivationIDL \ - com/sun/tools/corba/se/logutil \ - # -java.corba_EXCLUDE_FILES += \ - com/sun/corba/se/impl/presentation/rmi/JNDIStateFactoryImpl.java \ - com/sun/corba/se/spi/presentation/rmi/StubWrapper.java \ - com/sun/org/omg/CORBA/IDLTypeOperations.java \ - com/sun/org/omg/CORBA/IRObjectOperations.java \ - org/omg/PortableInterceptor/UNKNOWN.java \ - com/sun/tools/corba/se/idl/ResourceBundleUtil.java \ - com/sun/corba/se/impl/presentation/rmi/jndi.properties \ - # - -################################################################################ - java.xml_ADD_JAVAC_FLAGS += -Xdoclint:all/protected \ '-Xdoclint/package:$(call CommaList, javax.xml.catalog javax.xml.datatype \ javax.xml.transform javax.xml.validation javax.xml.xpath)' @@ -307,32 +278,11 @@ java.xml_CLEAN += .properties ################################################################################ -java.xml.bind_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS -java.xml.bind_CLEAN += .properties - -################################################################################ - -java.xml.soap_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS -java.xml.soap_CLEAN += .properties - -################################################################################ - -java.xml.ws_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS -java.xml.ws_COPY += .xml -java.xml.ws_CLEAN += .properties - -################################################################################ - java.naming_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*' -Xlint:-exports java.naming_CLEAN += jndiprovider.properties ################################################################################ -java.security.saaj_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*' -java.security.saaj_CLEAN += .properties - -################################################################################ - java.security.jgss_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*' ################################################################################ @@ -493,6 +443,7 @@ jdk.internal.vm.compiler_ADD_JAVAC_FLAGS += -parameters -XDstringConcat=inline \ # jdk.internal.vm.compiler_EXCLUDES += \ + org.graalvm.collections.test \ org.graalvm.compiler.core.match.processor \ org.graalvm.compiler.nodeinfo.processor \ org.graalvm.compiler.options.processor \ @@ -511,6 +462,7 @@ jdk.internal.vm.compiler_EXCLUDES += \ org.graalvm.compiler.graph.test \ org.graalvm.compiler.hotspot.amd64.test \ org.graalvm.compiler.hotspot.lir.test \ + org.graalvm.compiler.hotspot.sparc.test \ org.graalvm.compiler.hotspot.test \ org.graalvm.compiler.jtt \ org.graalvm.compiler.lir.jtt \ @@ -553,17 +505,6 @@ jdk.aot_ADD_JAVAC_FLAGS += -parameters -XDstringConcat=inline \ ################################################################################ -jdk.xml.bind_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS -jdk.xml.bind_CLEAN += .properties -jdk.xml.bind_COPY += .xsd JAXBContextFactory.java ZeroOneBooleanAdapter.java - -################################################################################ - -jdk.xml.ws_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS -jdk.xml.ws_CLEAN += .properties - -################################################################################ - sun.charsets_COPY += .dat ################################################################################ diff --git a/make/CompileToolsHotspot.gmk b/make/CompileToolsHotspot.gmk index 1ccc3e2a31b..54ab9ae0dfb 100644 --- a/make/CompileToolsHotspot.gmk +++ b/make/CompileToolsHotspot.gmk @@ -48,6 +48,7 @@ ifeq ($(INCLUDE_GRAAL), true) SETUP := GENERATE_OLDBYTECODE, \ SRC := \ $(SRC_DIR)/org.graalvm.word/src \ + $(SRC_DIR)/org.graalvm.collections/src \ $(SRC_DIR)/org.graalvm.compiler.core/src \ $(SRC_DIR)/org.graalvm.compiler.core.common/src \ $(SRC_DIR)/org.graalvm.compiler.core.match.processor/src \ @@ -101,6 +102,7 @@ ifeq ($(INCLUDE_GRAAL), true) $(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_OPTIONS_PROCESSOR, \ SETUP := GENERATE_OLDBYTECODE, \ SRC := \ + $(SRC_DIR)/org.graalvm.collections/src \ $(SRC_DIR)/org.graalvm.compiler.options/src \ $(SRC_DIR)/org.graalvm.compiler.options.processor/src \ $(SRC_DIR)/org.graalvm.util/src \ @@ -117,6 +119,7 @@ ifeq ($(INCLUDE_GRAAL), true) SETUP := GENERATE_OLDBYTECODE, \ SRC := \ $(SRC_DIR)/org.graalvm.word/src \ + $(SRC_DIR)/org.graalvm.collections/src \ $(SRC_DIR)/org.graalvm.compiler.replacements.verifier/src \ $(SRC_DIR)/org.graalvm.compiler.api.replacements/src \ $(SRC_DIR)/org.graalvm.compiler.code/src \ diff --git a/make/CompileToolsJdk.gmk b/make/CompileToolsJdk.gmk index 6d105617686..14966405ed1 100644 --- a/make/CompileToolsJdk.gmk +++ b/make/CompileToolsJdk.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -53,9 +53,7 @@ $(eval $(call SetupJavaCompilation,BUILD_TOOLS_JDK, \ , \ BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes, \ ADD_JAVAC_FLAGS := \ - --add-modules java.xml.bind \ --add-exports java.desktop/sun.awt=ALL-UNNAMED \ - --add-exports java.xml.bind/javax.xml.bind.annotation=ALL-UNNAMED \ --add-exports java.base/sun.text=ALL-UNNAMED \ , \ )) diff --git a/make/Docs.gmk b/make/Docs.gmk index f37b6ebf649..b3c6ba2fc59 100644 --- a/make/Docs.gmk +++ b/make/Docs.gmk @@ -1,4 +1,4 @@ -# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -44,7 +44,7 @@ $(eval $(call IncludeCustomExtension, Docs.gmk)) # # We will generate API documentation for two different selections of the source # code: "Java SE", which contains just the modules covered by the top-level -# module java.se.ee, and "JDK", which covers all of Java SE and also all +# module java.se and "JDK", which covers all of Java SE and also all # other available modules that should be documented, including imported modules, # if any. # @@ -200,7 +200,7 @@ JAVASE_LONG_NAME := Java® Platform, Standard Edition # define setup_gengraph_dot_to_png $1_$2_DOT_SRC := $$($1_GENGRAPHS_DIR)/$2.dot - $1_$2_PNG_TARGET := $$($1_TARGET_DIR)/$2-graph.png + $1_$2_PNG_TARGET := $$($1_TARGET_DIR)/$2/module-graph.png # For each module needing a graph, create a png file from the dot file # generated by the GenGraphs tool and store it in the target dir. @@ -396,8 +396,8 @@ endef # Define the groups of the JDK API documentation JavaSE_GROUP_NAME := Java SE -JavaSE_GROUP_MODULES := $(call ColonList, $(sort java.se.ee \ - $(call FindTransitiveIndirectDepsForModules, java.se.ee))) +JavaSE_GROUP_MODULES := $(call ColonList, $(sort java.se \ + $(call FindTransitiveIndirectDepsForModules, java.se))) JavaSE_GROUP_DESCRIPTION := \ The Java Platform, Standard Edition (Java SE) APIs define the core Java \ platform for general-purpose computing. These APIs are in modules whose \ @@ -445,9 +445,9 @@ $(eval $(call SetupApiDocsGeneration, JDK_API, \ ################################################################################ # Setup generation of the Java SE API documentation (javadoc + modulegraph) -# The Java SE module scope is just java.se.ee and its transitive indirect +# The Java SE module scope is just java.se and its transitive indirect # exports. -JAVASE_MODULES := java.se.ee +JAVASE_MODULES := java.se $(eval $(call SetupApiDocsGeneration, JAVASE_API, \ MODULES := $(JAVASE_MODULES), \ diff --git a/make/Images.gmk b/make/Images.gmk index 8a47ff55626..994a25fb088 100644 --- a/make/Images.gmk +++ b/make/Images.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -47,7 +47,7 @@ JRE_MODULES += $(filter $(ALL_MODULES), $(BOOT_MODULES) \ $(PLATFORM_MODULES) $(JRE_TOOL_MODULES)) JDK_MODULES += $(ALL_MODULES) -# Modules list for compact builds +# Modules list for compact builds JRE_COMPACT1_MODULES := \ java.logging \ java.scripting \ @@ -199,7 +199,6 @@ ifneq ($(OPENJDK_TARGET_OS), windows) rmid.1 \ rmiregistry.1 \ servertool.1 \ - tnameserv.1 \ unpack200.1 JDK_MAN_PAGES += \ @@ -223,11 +222,7 @@ ifneq ($(OPENJDK_TARGET_OS), windows) jstat.1 \ jstatd.1 \ rmic.1 \ - schemagen.1 \ - serialver.1 \ - wsgen.1 \ - wsimport.1 \ - xjc.1 + serialver.1 # This variable is potentially overridden in the closed makefile. MAN_SRC_BASEDIR ?= $(TOPDIR)/src diff --git a/make/Main.gmk b/make/Main.gmk index 9e4917b4553..2e0bee1af5c 100644 --- a/make/Main.gmk +++ b/make/Main.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -124,10 +124,9 @@ ifneq ($(CREATING_BUILDJDK), true) LANGTOOLS_GENSRC_TARGETS := $(filter $(addsuffix -%, $(LANGTOOLS_MODULES)), $(GENSRC_TARGETS)) INTERIM_LANGTOOLS_GENSRC_TARGETS := $(filter $(addsuffix -%, \ $(INTERIM_LANGTOOLS_BASE_MODULES)), $(GENSRC_TARGETS)) - CORBA_GENSRC_TARGETS := $(filter $(addsuffix -%, $(CORBA_MODULES)), $(GENSRC_TARGETS)) HOTSPOT_GENSRC_TARGETS := $(filter $(addsuffix -%, $(HOTSPOT_MODULES)), $(GENSRC_TARGETS)) JDK_GENSRC_TARGETS := $(filter-out $(LANGTOOLS_GENSRC_TARGETS) \ - $(CORBA_GENSRC_TARGETS) $(HOTSPOT_GENSRC_TARGETS), $(GENSRC_TARGETS)) + $(HOTSPOT_GENSRC_TARGETS), $(GENSRC_TARGETS)) GENSRC_MODULEINFO_MODULES := $(ALL_MODULES) GENSRC_MODULEINFO_TARGETS := $(addsuffix -gensrc-moduleinfo, \ @@ -618,8 +617,6 @@ else buildtools-modules: exploded-image-base - $(CORBA_GENSRC_TARGETS): interim-langtools - $(HOTSPOT_GENSRC_TARGETS): interim-langtools buildtools-hotspot $(JDK_GENSRC_TARGETS): interim-langtools buildtools-jdk @@ -637,7 +634,7 @@ else # Declare dependencies between hotspot-* targets $(foreach v, $(JVM_VARIANTS), \ $(eval hotspot-$v: hotspot-$v-gensrc hotspot-$v-libs) \ - $(eval hotspot-$v-libs: hotspot-$v-gensrc) \ + $(eval hotspot-$v-libs: hotspot-$v-gensrc java.base-copy) \ ) hotspot-ide-project: hotspot exploded-image @@ -691,8 +688,9 @@ else jdk.jdwp.agent-libs: jdk.jdwp.agent-gensrc # The swing beans need to have java base properly generated to avoid errors - # in javadoc. - java.desktop-gensrc-src: java.base-gensrc + # in javadoc. The X11 wrappers need the java.base include files to have been + # copied and processed. + java.desktop-gensrc-src: java.base-gensrc java.base-copy # The annotation processing for jdk.internal.vm.ci and jdk.internal.vm.compiler # needs classes from the current JDK. diff --git a/make/ToolsJdk.gmk b/make/ToolsJdk.gmk index 97f34797cb0..3dcafe1d77d 100644 --- a/make/ToolsJdk.gmk +++ b/make/ToolsJdk.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -92,7 +92,6 @@ TOOL_SPP = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes build.too # Nimbus is used somewhere in the swing build. TOOL_GENERATENIMBUS = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \ - --add-modules java.xml.bind \ build.tools.generatenimbus.Generator TOOL_WRAPPERGENERATOR = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \ diff --git a/make/autoconf/autogen.sh b/make/autoconf/autogen.sh deleted file mode 100644 index 464e585dca0..00000000000 --- a/make/autoconf/autogen.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -generate_configure_script() { - # First create a header - cat > $1 << EOT -#!/bin/bash -# -# ########################################################## -# ### THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. ### -# ########################################################## -# -EOT - # Then replace "magic" variables in configure.ac and append the output - # from autoconf. $2 is either cat (just a no-op) or a filter. - cat $script_dir/configure.ac | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | \ - eval $2 | ${AUTOCONF} -W all -I$script_dir - >> $1 - rm -rf autom4te.cache -} - -script_dir=`dirname $0` - -# Create a timestamp as seconds since epoch -if test "x`uname -s`" = "xSunOS"; then - TIMESTAMP=`date +%s` - if test "x$TIMESTAMP" = "x%s"; then - # date +%s not available on this Solaris, use workaround from nawk(1): - TIMESTAMP=`nawk 'BEGIN{print srand()}'` - fi -else - TIMESTAMP=`date +%s` -fi - -AUTOCONF="`which autoconf 2> /dev/null | grep -v '^no autoconf in'`" - -if test "x${AUTOCONF}" = x; then - echo "You need autoconf installed to be able to regenerate the configure script" - echo "Error: Cannot find autoconf" 1>&2 - exit 1 -fi - -autoconf_version=`$AUTOCONF --version | head -1` -echo "Using autoconf at ${AUTOCONF} [$autoconf_version]" - -echo "Generating generated-configure.sh" -generate_configure_script "$script_dir/generated-configure.sh" 'cat' - -if test "x$CUSTOM_CONFIG_DIR" != "x"; then - custom_hook=$CUSTOM_CONFIG_DIR/custom-hook.m4 - if test ! -e $custom_hook; then - echo "CUSTOM_CONFIG_DIR set but $CUSTOM_CONFIG_DIR/custom-hook.m4 not present" - echo "Error: Cannot continue" 1>&2 - exit 1 - fi - - # We have custom sources available; also generate configure script - # with custom hooks compiled in. - echo "Generating custom generated-configure.sh" - generate_configure_script "$CUSTOM_CONFIG_DIR/generated-configure.sh" 'sed -e "s|#CUSTOM_AUTOCONF_INCLUDE|m4_include([$custom_hook])|"' -fi diff --git a/make/autoconf/basics.m4 b/make/autoconf/basics.m4 index e30e596cbb5..cd8b8dfb861 100644 --- a/make/autoconf/basics.m4 +++ b/make/autoconf/basics.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -336,7 +336,6 @@ AC_DEFUN_ONCE([BASIC_INIT], DATE_WHEN_CONFIGURED=`LANG=C date` AC_SUBST(DATE_WHEN_CONFIGURED) AC_MSG_NOTICE([Configuration created at $DATE_WHEN_CONFIGURED.]) - AC_MSG_NOTICE([configure script generated at timestamp $DATE_WHEN_GENERATED.]) ]) # Test that variable $1 denoting a program is not empty. If empty, exit with an error. @@ -586,69 +585,71 @@ AC_DEFUN([BASIC_EVAL_DEVKIT_VARIABLE], AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT], [ AC_ARG_WITH([devkit], [AS_HELP_STRING([--with-devkit], - [use this devkit for compilers, tools and resources])], - [ - BASIC_FIXUP_PATH([with_devkit]) - DEVKIT_ROOT="$with_devkit" - # Check for a meta data info file in the root of the devkit - if test -f "$DEVKIT_ROOT/devkit.info"; then - . $DEVKIT_ROOT/devkit.info - # This potentially sets the following: - # A descriptive name of the devkit - BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_NAME]) - # Corresponds to --with-extra-path - BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_EXTRA_PATH]) - # Corresponds to --with-toolchain-path - BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_TOOLCHAIN_PATH]) - # Corresponds to --with-sysroot - BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_SYSROOT]) + [use this devkit for compilers, tools and resources])]) - # Identifies the Visual Studio version in the devkit - BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_VS_VERSION]) - # The Visual Studio include environment variable - BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_VS_INCLUDE]) - # The Visual Studio lib environment variable - BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_VS_LIB]) - # Corresponds to --with-msvcr-dll - BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_MSVCR_DLL]) - # Corresponds to --with-msvcp-dll - BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_MSVCP_DLL]) - fi + if test "x$with_devkit" = xyes; then + AC_MSG_ERROR([--with-devkit must have a value]) + elif test "x$with_devkit" != x && test "x$with_devkit" != xno; then + BASIC_FIXUP_PATH([with_devkit]) + DEVKIT_ROOT="$with_devkit" + # Check for a meta data info file in the root of the devkit + if test -f "$DEVKIT_ROOT/devkit.info"; then + . $DEVKIT_ROOT/devkit.info + # This potentially sets the following: + # A descriptive name of the devkit + BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_NAME]) + # Corresponds to --with-extra-path + BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_EXTRA_PATH]) + # Corresponds to --with-toolchain-path + BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_TOOLCHAIN_PATH]) + # Corresponds to --with-sysroot + BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_SYSROOT]) - AC_MSG_CHECKING([for devkit]) - if test "x$DEVKIT_NAME" != x; then - AC_MSG_RESULT([$DEVKIT_NAME in $DEVKIT_ROOT]) - else - AC_MSG_RESULT([$DEVKIT_ROOT]) - fi + # Identifies the Visual Studio version in the devkit + BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_VS_VERSION]) + # The Visual Studio include environment variable + BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_VS_INCLUDE]) + # The Visual Studio lib environment variable + BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_VS_LIB]) + # Corresponds to --with-msvcr-dll + BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_MSVCR_DLL]) + # Corresponds to --with-msvcp-dll + BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_MSVCP_DLL]) + fi - BASIC_PREPEND_TO_PATH([EXTRA_PATH],$DEVKIT_EXTRA_PATH) + AC_MSG_CHECKING([for devkit]) + if test "x$DEVKIT_NAME" != x; then + AC_MSG_RESULT([$DEVKIT_NAME in $DEVKIT_ROOT]) + else + AC_MSG_RESULT([$DEVKIT_ROOT]) + fi - # Fallback default of just /bin if DEVKIT_PATH is not defined - if test "x$DEVKIT_TOOLCHAIN_PATH" = x; then - DEVKIT_TOOLCHAIN_PATH="$DEVKIT_ROOT/bin" - fi - BASIC_PREPEND_TO_PATH([TOOLCHAIN_PATH],$DEVKIT_TOOLCHAIN_PATH) + BASIC_PREPEND_TO_PATH([EXTRA_PATH],$DEVKIT_EXTRA_PATH) - # If DEVKIT_SYSROOT is set, use that, otherwise try a couple of known - # places for backwards compatiblity. - if test "x$DEVKIT_SYSROOT" != x; then - SYSROOT="$DEVKIT_SYSROOT" - elif test -d "$DEVKIT_ROOT/$host_alias/libc"; then - SYSROOT="$DEVKIT_ROOT/$host_alias/libc" - elif test -d "$DEVKIT_ROOT/$host/sys-root"; then - SYSROOT="$DEVKIT_ROOT/$host/sys-root" - fi + # Fallback default of just /bin if DEVKIT_PATH is not defined + if test "x$DEVKIT_TOOLCHAIN_PATH" = x; then + DEVKIT_TOOLCHAIN_PATH="$DEVKIT_ROOT/bin" + fi + BASIC_PREPEND_TO_PATH([TOOLCHAIN_PATH],$DEVKIT_TOOLCHAIN_PATH) - if test "x$DEVKIT_ROOT" != x; then - DEVKIT_LIB_DIR="$DEVKIT_ROOT/lib" - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - DEVKIT_LIB_DIR="$DEVKIT_ROOT/lib64" - fi - AC_SUBST(DEVKIT_LIB_DIR) - fi - ] - ) + # If DEVKIT_SYSROOT is set, use that, otherwise try a couple of known + # places for backwards compatiblity. + if test "x$DEVKIT_SYSROOT" != x; then + SYSROOT="$DEVKIT_SYSROOT" + elif test -d "$DEVKIT_ROOT/$host_alias/libc"; then + SYSROOT="$DEVKIT_ROOT/$host_alias/libc" + elif test -d "$DEVKIT_ROOT/$host/sys-root"; then + SYSROOT="$DEVKIT_ROOT/$host/sys-root" + fi + + if test "x$DEVKIT_ROOT" != x; then + DEVKIT_LIB_DIR="$DEVKIT_ROOT/lib" + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + DEVKIT_LIB_DIR="$DEVKIT_ROOT/lib64" + fi + AC_SUBST(DEVKIT_LIB_DIR) + fi + fi # You can force the sysroot if the sysroot encoded into the compiler tools # is not correct. @@ -813,6 +814,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR], | $SED -e 's/config.log//g' \ -e 's/configure.log//g' \ -e 's/confdefs.h//g' \ + -e 's/configure-support//g' \ -e 's/ //g' \ | $TR -d '\n'` if test "x$filtered_files" != x; then @@ -1185,9 +1187,6 @@ AC_DEFUN_ONCE([BASIC_CHECK_SRC_PERMS], AC_DEFUN_ONCE([BASIC_TEST_USABILITY_ISSUES], [ - # Did user specify any unknown variables? - BASIC_CHECK_LEFTOVER_OVERRIDDEN - AC_MSG_CHECKING([if build directory is on local disk]) BASIC_CHECK_DIR_ON_LOCAL_DISK($OUTPUTDIR, [OUTPUT_DIR_IS_LOCAL="yes"], diff --git a/make/autoconf/boot-jdk.m4 b/make/autoconf/boot-jdk.m4 index e373091bd10..3e0ed35cbcf 100644 --- a/make/autoconf/boot-jdk.m4 +++ b/make/autoconf/boot-jdk.m4 @@ -102,8 +102,33 @@ AC_DEFUN([BOOTJDK_DO_CHECK], AC_DEFUN([BOOTJDK_CHECK_ARGUMENTS], [ if test "x$with_boot_jdk" != x; then - BOOT_JDK=$with_boot_jdk - BOOT_JDK_FOUND=maybe + if test -d "$with_boot_jdk"; then + BOOT_JDK=$with_boot_jdk + BOOT_JDK_FOUND=maybe + elif test -f "$with_boot_jdk"; then + case "$with_boot_jdk" in + *.tar.gz ) + BOOT_JDK_SUPPORT_DIR=$CONFIGURESUPPORT_OUTPUTDIR/boot-jdk + $RM -rf $BOOT_JDK_SUPPORT_DIR + $MKDIR -p $BOOT_JDK_SUPPORT_DIR + $GUNZIP -c $with_boot_jdk | $TAR xf - -C $BOOT_JDK_SUPPORT_DIR + + # Try to find javac to determine BOOT_JDK path + BOOT_JDK_JAVAC_PATH=`$FIND $BOOT_JDK_SUPPORT_DIR | $GREP "/bin/javac"` + if test "x$BOOT_JDK_JAVAC_PATH" != x; then + BOOT_JDK_FOUND=maybe + BOOT_JDK=$($DIRNAME $($DIRNAME $BOOT_JDK_JAVAC_PATH)) + else + BOOT_JDK_FOUND=no + fi + ;; + * ) + BOOT_JDK_FOUND=no + ;; + esac + else + BOOT_JDK_FOUND=no + fi AC_MSG_NOTICE([Found potential Boot JDK using configure arguments]) fi ]) diff --git a/make/autoconf/buildjdk-spec.gmk.in b/make/autoconf/buildjdk-spec.gmk.in index aceaef7c452..b01d00b7c35 100644 --- a/make/autoconf/buildjdk-spec.gmk.in +++ b/make/autoconf/buildjdk-spec.gmk.in @@ -55,6 +55,7 @@ OPENJDK_TARGET_CPU_ARCH := @OPENJDK_BUILD_CPU_ARCH@ OPENJDK_TARGET_CPU_BITS := @OPENJDK_BUILD_CPU_BITS@ OPENJDK_TARGET_CPU_ENDIAN := @OPENJDK_BUILD_CPU_ENDIAN@ OPENJDK_TARGET_CPU_LEGACY := @OPENJDK_BUILD_CPU_LEGACY@ +OPENJDK_TARGET_OS_INCLUDE_SUBDIR := @OPENJDK_BUILD_OS_INCLUDE_SUBDIR@ HOTSPOT_TARGET_OS := @HOTSPOT_BUILD_OS@ HOTSPOT_TARGET_OS_TYPE := @HOTSPOT_BUILD_OS_TYPE@ diff --git a/make/autoconf/configure b/make/autoconf/configure index 57a99852892..f1b7e637304 100644 --- a/make/autoconf/configure +++ b/make/autoconf/configure @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -43,82 +43,143 @@ fi export CONFIG_SHELL=$BASH export _as_can_reexec=no -conf_script_dir="$TOPDIR/make/autoconf" - if test "x$CUSTOM_CONFIG_DIR" != x; then - if test ! -e $CUSTOM_CONFIG_DIR/generated-configure.sh; then + custom_hook=$CUSTOM_CONFIG_DIR/custom-hook.m4 + if test ! -e $custom_hook; then echo "CUSTOM_CONFIG_DIR not pointing to a proper custom config dir." echo "Error: Cannot continue" 1>&2 exit 1 fi fi +CURRENT_DIR=`pwd` +if test "x$CURRENT_DIR" = "x$TOPDIR"; then + # We are running configure from the src root. + # Create '.configure-support' under $TOPDIR/build + build_support_dir="$TOPDIR/build/.configure-support" +elif test "x$CURRENT_DIR" = "x$CUSTOM_ROOT"; then + # We are running configure from the custom root. + # Create '.configure-support' under $CUSTOM_ROOT/build + build_support_dir="$CUSTOM_ROOT/build/.configure-support" +else + # We are running configure from outside of the src dir. + # Create 'build_support_dir' in the current directory. + build_support_dir="$CURRENT_DIR/configure-support" +fi + +conf_script_dir="$TOPDIR/make/autoconf" +generated_script="$build_support_dir/generated-configure.sh" + ### -### Test that the generated configure is up-to-date +### Use autoconf to create a runnable configure script, if needed ### -run_autogen_or_fail() { - if test "x`which autoconf 2> /dev/null | grep -v '^no autoconf in'`" = x; then - echo "Cannot locate autoconf, unable to correct situation." - echo "Please install autoconf and run 'bash autogen.sh' to update the generated files." - echo "Error: Cannot continue" 1>&2 - exit 1 - else - echo "Running autogen.sh to correct the situation" - bash $conf_script_dir/autogen.sh +autoconf_missing_help() { + APT_GET="`which apt-get 2> /dev/null | grep -v '^no apt-get in'`" + YUM="`which yum 2> /dev/null | grep -v '^no yum in'`" + BREW="`which brew 2> /dev/null | grep -v '^no brew in'`" + CYGWIN="`which cygpath 2> /dev/null | grep -v '^no cygpath in'`" + + if test "x$APT_GET" != x; then + PKGHANDLER_COMMAND="sudo apt-get install autoconf" + elif test "x$YUM" != x; then + PKGHANDLER_COMMAND="sudo yum install autoconf" + elif test "x$BREW" != x; then + PKGHANDLER_COMMAND="brew install autoconf" + elif test "x$CYGWIN" != x; then + PKGHANDLER_COMMAND="( cd && cmd /c setup -q -P autoconf )" + fi + + if test "x$PKGHANDLER_COMMAND" != x; then + echo "You might be able to fix this by running '$PKGHANDLER_COMMAND'." fi } -check_autoconf_timestamps() { - for file in $conf_script_dir/configure.ac $conf_script_dir/*.m4 ; do - if test $file -nt $conf_script_dir/generated-configure.sh; then - echo "Warning: The configure source files is newer than the generated files." - run_autogen_or_fail +generate_configure_script() { + if test "x$AUTOCONF" != x; then + if test ! -x "$AUTOCONF"; then + echo + echo "The specified AUTOCONF variable does not point to a valid autoconf executable:" + echo "AUTOCONF=$AUTOCONF" + echo "Error: Cannot continue" 1>&2 + exit 1 fi - done + else + AUTOCONF="`which autoconf 2> /dev/null | grep -v '^no autoconf in'`" + if test "x$AUTOCONF" = x; then + echo + echo "Autoconf is not found on the PATH, and AUTOCONF is not set." + echo "You need autoconf to be able to generate a runnable configure script." + autoconf_missing_help + echo "Error: Cannot find autoconf" 1>&2 + exit 1 + fi + fi + + autoconf_version=`$AUTOCONF --version | head -1` + echo "Using autoconf at ${AUTOCONF} [$autoconf_version]" if test "x$CUSTOM_CONFIG_DIR" != x; then - # If custom source configure is available, make sure it is up-to-date as well. - for file in $conf_script_dir/configure.ac $conf_script_dir/*.m4 $CUSTOM_CONFIG_DIR/*.m4; do - if test $file -nt $CUSTOM_CONFIG_DIR/generated-configure.sh; then - echo "Warning: The configure source files is newer than the custom generated files." - run_autogen_or_fail - fi - done + # Generate configure script with custom hooks compiled in. + custom_patcher='sed -e "s|#CUSTOM_AUTOCONF_INCLUDE|m4_include([$custom_hook])|"' + else + custom_patcher='cat' + fi + + mkdir -p $build_support_dir + # Call autoconf but replace the "magic" variable in configure.ac if requested. + cat $conf_script_dir/configure.ac | eval $custom_patcher | \ + ${AUTOCONF} -W all -I$conf_script_dir - > $generated_script + rm -rf autom4te.cache + + # Sanity check + if test ! -s $generated_script; then + echo "Error: Failed to generate runnable configure script" 1>&2 + rm -f $generated_script + exit 1 fi } -check_hg_updates() { - if test "x`which hg 2> /dev/null | grep -v '^no hg in'`" != x; then - conf_updated_autoconf_files=`cd $conf_script_dir && hg status -mard . 2> /dev/null` - if test "x$conf_updated_autoconf_files" != x; then - echo "Configure source code has been updated, checking time stamps" - check_autoconf_timestamps - elif test "x$CUSTOM_CONFIG_DIR" != x; then - # If custom source configure is available, make sure it is up-to-date as well. - conf_custom_updated_autoconf_files=`cd $CUSTOM_CONFIG_DIR && hg status -mard . 2> /dev/null` - if test "x$conf_custom_updated_autoconf_files" != x; then - echo "Configure custom source code has been updated, checking time stamps" - check_autoconf_timestamps - fi +test_generated_up_to_date() { + conf_source_files="$conf_script_dir/configure.ac $conf_script_dir/*.m4" + if test "x$CUSTOM_CONFIG_DIR" != x; then + conf_custom_source_files="$CUSTOM_CONFIG_DIR/*.m4" + else + conf_custom_source_files="" + fi + + for file in $conf_source_files $conf_custom_source_files ; do + if test $file -nt $generated_script; then + return 0 fi - fi + done + return 1 } -# Check for local changes -check_hg_updates +run_autoconf=false +if test "x$1" = xautogen; then + # User called us as "configure autogen", so force regeneration + run_autoconf=true + shift +fi -if test "x$CUSTOM_CONFIG_DIR" != x; then - # Test if open configure is newer than custom configure, if so, custom needs to - # be regenerated. This test is required to ensure consistency with custom source. - conf_open_configure_timestamp=`grep DATE_WHEN_GENERATED= $conf_script_dir/generated-configure.sh | cut -d"=" -f 2` - conf_custom_configure_timestamp=`grep DATE_WHEN_GENERATED= $CUSTOM_CONFIG_DIR/generated-configure.sh | cut -d"=" -f 2` - if test $conf_open_configure_timestamp -gt $conf_custom_configure_timestamp; then - echo "Warning: The generated configure file contains changes not present in the custom generated file." - run_autogen_or_fail +if test ! -s $generated_script; then + # Generated script is missing, so we need to create it + echo "Runnable configure script is not present" + run_autoconf=true +else + # File is present, but is it up to date? + if test_generated_up_to_date; then + echo "Runnable configure script is not up to date" + run_autoconf=true fi fi +if test "x$run_autoconf" = xtrue; then + echo "Generating runnable configure script at $generated_script" + generate_configure_script +fi + # Autoconf calls the configure script recursively sometimes. # Don't start logging twice in that case if test "x$conf_debug_configure" = xtrue; then @@ -240,15 +301,6 @@ conf_processed_arguments=("--enable-option-checking=fatal" "${conf_processed_arg ### ### Call the configure script ### -if test "x$CUSTOM_CONFIG_DIR" != x; then - # Custom source configure available; run that instead - echo "Running custom generated-configure.sh" - conf_script_to_run=$CUSTOM_CONFIG_DIR/generated-configure.sh -else - echo "Running generated-configure.sh" - conf_script_to_run=$conf_script_dir/generated-configure.sh -fi - if test "x$conf_debug_configure" != x; then # Turn on shell debug output if requested (initial or recursive) set -x @@ -259,7 +311,7 @@ fi RCDIR=`mktemp -dt jdk-build-configure.tmp.XXXXXX` || exit $? trap "rm -rf \"$RCDIR\"" EXIT conf_logfile=./configure.log -(exec 3>&1 ; ((. $conf_script_to_run "${conf_processed_arguments[@]}" 2>&1 1>&3 ) \ +(exec 3>&1 ; ((. $generated_script "${conf_processed_arguments[@]}" 2>&1 1>&3 ) \ ; echo $? > "$RCDIR/rc" ) \ | tee -a $conf_logfile 1>&2 ; exec 3>&-) | tee -a $conf_logfile @@ -284,7 +336,7 @@ EOT # Print additional help, e.g. a list of toolchains and JVM features. # This must be done by the autoconf script. - ( CONFIGURE_PRINT_ADDITIONAL_HELP=true . $conf_script_to_run PRINTF=printf ) + ( CONFIGURE_PRINT_ADDITIONAL_HELP=true . $generated_script PRINTF=printf ) cat <. -# -# -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -# -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# Use a proper internal environment variable to ensure we don't fall - # into an infinite loop, continuously re-executing ourselves. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 - fi - # We don't want this to propagate to other subprocesses. - { _as_can_reexec=; unset _as_can_reexec;} -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1 -test -x / || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - export CONFIG_SHELL - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org and -$0: build-dev@openjdk.java.net about your system, including -$0: any error possibly output before this message. Then -$0: install a modern shell, or manually run the script -$0: under such a shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -test -n "$DJDIR" || exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME='OpenJDK' -PACKAGE_TARNAME='openjdk' -PACKAGE_VERSION='jdk9' -PACKAGE_STRING='OpenJDK jdk9' -PACKAGE_BUGREPORT='build-dev@openjdk.java.net' -PACKAGE_URL='http://openjdk.java.net' - -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='LTLIBOBJS -LIBOBJS -CFLAGS_CCACHE -CCACHE -USE_PRECOMPILED_HEADER -BUILD_ICECC -ICECC -ICECC_WRAPPER -ICECC_CREATE_ENV -ICECC_CMD -ENABLE_JAVAC_SERVER -ENABLE_SJAVAC -SJAVAC_SERVER_JAVA_FLAGS -SJAVAC_SERVER_JAVA -JAVA_TOOL_FLAGS_SMALL -JAVA_FLAGS_SMALL -JAVA_FLAGS_JAVAC -BOOTCYCLE_JVM_ARGS_BIG -JAVA_FLAGS_BIG -JAVA_FLAGS -TEST_JOBS -JOBS -MEMORY_SIZE -NUM_CORES -ENABLE_GENERATE_CLASSLIST -BUILD_FAILURE_HANDLER -ENABLE_INTREE_EC -VALID_JVM_FEATURES -JVM_FEATURES_custom -JVM_FEATURES_zero -JVM_FEATURES_minimal -JVM_FEATURES_core -JVM_FEATURES_client -JVM_FEATURES_server -INCLUDE_GRAAL -STLPORT_LIB -LIBZIP_CAN_USE_MMAP -LIBDL -LIBM -USE_EXTERNAL_LCMS -LCMS_LIBS -LCMS_CFLAGS -USE_EXTERNAL_LIBZ -USE_EXTERNAL_LIBPNG -PNG_LIBS -PNG_CFLAGS -USE_EXTERNAL_LIBGIF -USE_EXTERNAL_LIBJPEG -LIBFFI_LIB_FILE -ENABLE_LIBFFI_BUNDLING -LIBFFI_LIBS -LIBFFI_CFLAGS -ALSA_LIBS -ALSA_CFLAGS -FREETYPE_LICENSE -FREETYPE_BUNDLE_LIB_PATH -FREETYPE_LIBS -FREETYPE_CFLAGS -FONTCONFIG_CFLAGS -CUPS_CFLAGS -X_EXTRA_LIBS -X_LIBS -X_PRE_LIBS -X_CFLAGS -XMKMF -MSVCP_DLL -MSVCR_DLL -LIBCXX -FIXPATH_DETACH_FLAG -FIXPATH -BUILD_GTEST -ENABLE_CDS -ENABLE_AOT -ASAN_ENABLED -GCOV_ENABLED -ZIP_EXTERNAL_DEBUG_SYMBOLS -COPY_DEBUG_SYMBOLS -COMPILE_WITH_DEBUG_SYMBOLS -CFLAGS_WARNINGS_ARE_ERRORS -BUILD_CC_DISABLE_WARNING_PREFIX -DISABLE_WARNING_PREFIX -WARNINGS_AS_ERRORS -COMPILER_SUPPORTS_TARGET_BITS_FLAG -LDFLAGS_TESTEXE -LDFLAGS_TESTLIB -CXXFLAGS_TESTEXE -CXXFLAGS_TESTLIB -CFLAGS_TESTEXE -CFLAGS_TESTLIB -OPENJDK_BUILD_JVM_LIBS -OPENJDK_BUILD_JVM_ASFLAGS -OPENJDK_BUILD_JVM_LDFLAGS -OPENJDK_BUILD_JVM_CFLAGS -OPENJDK_BUILD_LDFLAGS_NO_EXEC_STACK -OPENJDK_BUILD_LDFLAGS_HASH_STYLE -OPENJDK_BUILD_LDFLAGS_CXX_JDK -OPENJDK_BUILD_JDKEXE_LIBS -OPENJDK_BUILD_JDKLIB_LIBS -OPENJDK_BUILD_LDFLAGS_JDKEXE -OPENJDK_BUILD_LDFLAGS_JDKLIB -OPENJDK_BUILD_CXXFLAGS_JDKEXE -OPENJDK_BUILD_CXXFLAGS_JDKLIB -OPENJDK_BUILD_CFLAGS_JDKEXE -OPENJDK_BUILD_CFLAGS_JDKLIB -OPENJDK_BUILD_CXXSTD_CXXFLAG -JVM_LIBS -JVM_ASFLAGS -JVM_LDFLAGS -JVM_CFLAGS -LDFLAGS_NO_EXEC_STACK -LDFLAGS_HASH_STYLE -LDFLAGS_CXX_JDK -JDKEXE_LIBS -JDKLIB_LIBS -LDFLAGS_JDKEXE -LDFLAGS_JDKLIB -CXXFLAGS_JDKEXE -CXXFLAGS_JDKLIB -CFLAGS_JDKEXE -CFLAGS_JDKLIB -MACOSX_VERSION_MAX -MACOSX_VERSION_MIN -CXXSTD_CXXFLAG -JDK_ARCH_ABI_PROP_NAME -CXX_O_FLAG_SIZE -CXX_O_FLAG_NONE -CXX_O_FLAG_DEBUG -CXX_O_FLAG_NORM -CXX_O_FLAG_HI -CXX_O_FLAG_HIGHEST -CXX_O_FLAG_HIGHEST_JVM -C_O_FLAG_SIZE -C_O_FLAG_NONE -C_O_FLAG_DEBUG -C_O_FLAG_NORM -C_O_FLAG_HI -C_O_FLAG_HIGHEST -C_O_FLAG_HIGHEST_JVM -JVM_CFLAGS_SYMBOLS -CXXFLAGS_DEBUG_SYMBOLS -CFLAGS_DEBUG_SYMBOLS -CXX_FLAG_DEPS -C_FLAG_DEPS -SHARED_LIBRARY_FLAGS -SET_SHARED_LIBRARY_MAPFILE -SET_SHARED_LIBRARY_NAME -SET_SHARED_LIBRARY_ORIGIN -SET_EXECUTABLE_ORIGIN -CXX_FLAG_REORDER -C_FLAG_REORDER -JVM_RCFLAGS -RC_FLAGS -AR_OUT_OPTION -LD_OUT_OPTION -EXE_OUT_OPTION -CC_OUT_OPTION -STRIPFLAGS -ARFLAGS -COMPILER_BINDCMD_FILE_FLAG -COMPILER_COMMAND_FILE_FLAG -COMPILER_TARGET_BITS_FLAG -JIB_JAR -JT_HOME -JTREGEXE -HOTSPOT_TOOLCHAIN_TYPE -USING_BROKEN_SUSE_LD -PACKAGE_PATH -BUILD_AS -BUILD_LDCXX -BUILD_LD -BUILD_STRIP -BUILD_OBJCOPY -BUILD_AR -BUILD_NM -BUILD_CXX -BUILD_CC -BUILD_SYSROOT_LDFLAGS -BUILD_SYSROOT_CFLAGS -ac_ct_OBJDUMP -OBJDUMP -ac_ct_OBJCOPY -OBJCOPY -ac_ct_NM -ac_ct_STRIP -GNM -NM -STRIP -MSBUILD -DUMPBIN -RC -MT -INSTALL_NAME_TOOL -OTOOL -LIPO -ac_ct_AR -AR -AS -LDCXX -LD -CXXCPP -CPP -CXX_VERSION_NUMBER -CC_VERSION_NUMBER -ac_ct_CXX -CXXFLAGS -CXX -TOOLCHAIN_PATH_CXX -POTENTIAL_CXX -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -TOOLCHAIN_PATH_CC -POTENTIAL_CC -TOOLCHAIN_VERSION -VS_LIB -VS_INCLUDE -VS_PATH -CYGWIN_LINK -SYSROOT_LDFLAGS -SYSROOT_CFLAGS -EXTRA_LDFLAGS -EXTRA_CXXFLAGS -EXTRA_CFLAGS -EXE_SUFFIX -OBJ_SUFFIX -STATIC_LIBRARY -SHARED_LIBRARY -STATIC_LIBRARY_SUFFIX -SHARED_LIBRARY_SUFFIX -LIBRARY_PREFIX -TOOLCHAIN_TYPE -STATIC_BUILD -IMPORT_MODULES_MAKE -IMPORT_MODULES_SRC -IMPORT_MODULES_MAN -IMPORT_MODULES_LEGAL -IMPORT_MODULES_CONF -IMPORT_MODULES_LIBS -IMPORT_MODULES_CMDS -IMPORT_MODULES_CLASSES -EXTERNAL_BUILDJDK -BUILD_JDK -CREATE_BUILDJDK -JLINK -JMOD -JAVAC_FLAGS -BOOT_JDK_SOURCETARGET -JARSIGNER -JAR -JAVADOC -JAVAC -JAVA -BOOT_JDK -JAVA_CHECK -JAVAC_CHECK -VENDOR_VERSION_STRING -VERSION_DATE -VERSION_IS_GA -VERSION_SHORT -VERSION_STRING -VERSION_NUMBER_FOUR_POSITIONS -VERSION_NUMBER -VERSION_OPT -VERSION_BUILD -VERSION_PRE -VERSION_PATCH -VERSION_UPDATE -VERSION_INTERIM -VERSION_FEATURE -VENDOR_URL_VM_BUG -VENDOR_URL_BUG -VENDOR_URL -COMPANY_NAME -MACOSX_BUNDLE_ID_BASE -MACOSX_BUNDLE_NAME_BASE -HOTSPOT_VM_DISTRO -JDK_RC_PLATFORM_NAME -PRODUCT_SUFFIX -PRODUCT_NAME -LAUNCHER_NAME -JLINK_KEEP_PACKAGED_MODULES -COPYRIGHT_YEAR -COMPRESS_JARS -INCLUDE_SA -UNLIMITED_CRYPTO -CACERTS_FILE -ENABLE_FULL_DOCS -ENABLE_HEADLESS_ONLY -DEFAULT_MAKE_TARGET -OS_VERSION_MICRO -OS_VERSION_MINOR -OS_VERSION_MAJOR -PKG_CONFIG -BASH_ARGS -SETFILE -CODESIGN -XATTR -DSYMUTIL -IS_GNU_TIME -PATCH -DTRACE -FLOCK -TIME -STAT -HG -DOT -READELF -LDD -ZIPEXE -UNZIP -TAR_SUPPORTS_TRANSFORM -TAR_INCLUDE_PARAM -TAR_CREATE_EXTRA_PARAM -TAR_TYPE -FIND_DELETE -OUTPUT_SYNC -OUTPUT_SYNC_SUPPORTED -CHECK_TOOLSDIR_MAKE -CHECK_TOOLSDIR_GMAKE -CHECK_MAKE -CHECK_GMAKE -MAKE -PKGHANDLER -CONFIGURESUPPORT_OUTPUTDIR -OUTPUTDIR -CONF_NAME -SPEC -SDKROOT -XCODEBUILD -DEVKIT_LIB_DIR -JVM_VARIANT_MAIN -VALID_JVM_VARIANTS -JVM_VARIANTS -DEBUG_LEVEL -HOTSPOT_DEBUG_LEVEL -JDK_VARIANT -USERNAME -TOPDIR -PATH_SEP -HOTSPOT_BUILD_CPU_DEFINE -HOTSPOT_BUILD_CPU_ARCH -HOTSPOT_BUILD_CPU -HOTSPOT_BUILD_OS_TYPE -HOTSPOT_BUILD_OS -OPENJDK_BUILD_BUNDLE_PLATFORM -OPENJDK_BUILD_CPU_OSARCH -OPENJDK_BUILD_CPU_ISADIR -OPENJDK_BUILD_CPU_LEGACY_LIB -OPENJDK_BUILD_CPU_LEGACY -HOTSPOT_TARGET_CPU_DEFINE -HOTSPOT_TARGET_CPU_ARCH -HOTSPOT_TARGET_CPU -HOTSPOT_TARGET_OS_TYPE -HOTSPOT_TARGET_OS -DEFINE_CROSS_COMPILE_ARCH -OPENJDK_TARGET_BUNDLE_PLATFORM -OPENJDK_TARGET_CPU_OSARCH -OPENJDK_TARGET_CPU_ISADIR -OPENJDK_TARGET_CPU_LEGACY_LIB -OPENJDK_TARGET_CPU_LEGACY -RELEASE_FILE_OS_ARCH -RELEASE_FILE_OS_NAME -OPENJDK_MODULE_TARGET_PLATFORM -COMPILE_TYPE -OPENJDK_TARGET_CPU_ENDIAN -OPENJDK_TARGET_CPU_BITS -OPENJDK_TARGET_CPU_ARCH -OPENJDK_TARGET_CPU -OPENJDK_TARGET_OS_ENV -OPENJDK_TARGET_OS_TYPE -OPENJDK_TARGET_OS -OPENJDK_BUILD_CPU_ENDIAN -OPENJDK_BUILD_CPU_BITS -OPENJDK_BUILD_CPU_ARCH -OPENJDK_BUILD_CPU -OPENJDK_BUILD_OS_ENV -OPENJDK_BUILD_OS_TYPE -OPENJDK_BUILD_OS -OPENJDK_BUILD_AUTOCONF_NAME -OPENJDK_TARGET_AUTOCONF_NAME -target_os -target_vendor -target_cpu -target -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -PANDOC -NICE -CPIO -DF -READLINK -CYGPATH -SED -FGREP -EGREP -GREP -AWK -XARGS -WHICH -WC -UNIQ -UNAME -TR -TOUCH -TEE -TAR -TAIL -SORT -SH -RMDIR -RM -PRINTF -NAWK -MV -MKTEMP -MKDIR -LS -LN -GZIP -GUNZIP -HEAD -FIND -FILE -EXPR -ECHO -DIRNAME -DIFF -DATE -CUT -CP -COMM -CMP -CHMOD -CAT -BASH -BASENAME -DATE_WHEN_CONFIGURED -ORIGINAL_PATH -CONFIGURE_COMMAND_LINE -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -with_target_bits -enable_openjdk_only -with_custom_make_dir -with_jdk_variant -enable_debug -with_debug_level -with_jvm_variants -with_cpu_port -with_devkit -with_sys_root -with_sysroot -with_tools_dir -with_toolchain_path -with_extra_path -with_sdk_name -with_conf_name -with_output_sync -with_default_make_target -enable_headless_only -enable_full_docs -with_cacerts_file -enable_unlimited_crypto -with_copyright_year -enable_keep_packaged_modules -with_milestone -with_update_version -with_user_release_suffix -with_build_number -with_version_major -with_version_minor -with_version_security -with_vendor_name -with_vendor_url -with_vendor_bug_url -with_vendor_vm_bug_url -with_version_string -with_version_pre -with_version_opt -with_version_build -with_version_feature -with_version_interim -with_version_update -with_version_patch -with_version_date -with_vendor_version_string -with_boot_jdk -with_build_jdk -with_import_modules -enable_static_build -with_toolchain_type -with_extra_cflags -with_extra_cxxflags -with_extra_ldflags -with_toolchain_version -with_build_devkit -with_jtreg -with_jib -with_abi_profile -with_macosx_version_max -enable_warnings_as_errors -with_native_debug_symbols -enable_debug_symbols -enable_zip_debug_info -enable_native_coverage -enable_asan -enable_dtrace -enable_aot -enable_cds -enable_hotspot_gtest -with_stdc__lib -with_msvcr_dll -with_msvcp_dll -with_x -with_cups -with_cups_include -with_fontconfig -with_fontconfig_include -with_freetype -with_freetype_include -with_freetype_lib -with_freetype_src -enable_freetype_bundling -with_freetype_license -with_alsa -with_alsa_include -with_alsa_lib -with_libffi -with_libffi_include -with_libffi_lib -enable_libffi_bundling -with_libjpeg -with_giflib -with_libpng -with_zlib -with_lcms -with_dxsdk -with_dxsdk_lib -with_dxsdk_include -with_jvm_features -with_jvm_interpreter -enable_jtreg_failure_handler -enable_generate_classlist -with_num_cores -with_memory_size -with_jobs -with_test_jobs -with_boot_jdk_jvmargs -with_sjavac_server_java -enable_sjavac -enable_javac_server -enable_icecc -enable_precompiled_headers -enable_ccache -with_ccache_dir -' - ac_precious_vars='build_alias -host_alias -target_alias -BASENAME -BASH -CAT -CHMOD -CMP -COMM -CP -CUT -DATE -DIFF -DIRNAME -ECHO -EXPR -FILE -FIND -HEAD -GUNZIP -GZIP -LN -LS -MKDIR -MKTEMP -MV -NAWK -PRINTF -RM -RMDIR -SH -SORT -TAIL -TAR -TEE -TOUCH -TR -UNAME -UNIQ -WC -WHICH -XARGS -AWK -GREP -EGREP -FGREP -SED -CYGPATH -READLINK -DF -CPIO -NICE -PANDOC -MAKE -UNZIP -ZIPEXE -LDD -READELF -DOT -HG -STAT -TIME -FLOCK -DTRACE -PATCH -DSYMUTIL -XATTR -CODESIGN -SETFILE -PKG_CONFIG -JAVA -JAVAC -JAVADOC -JAR -JARSIGNER -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CXX -CXXFLAGS -CCC -CPP -CXXCPP -AS -AR -LIPO -OTOOL -INSTALL_NAME_TOOL -STRIP -NM -GNM -OBJCOPY -OBJDUMP -BUILD_CC -BUILD_CXX -BUILD_NM -BUILD_AR -BUILD_OBJCOPY -BUILD_STRIP -JTREGEXE -XMKMF -FREETYPE_CFLAGS -FREETYPE_LIBS -ALSA_CFLAGS -ALSA_LIBS -LIBFFI_CFLAGS -LIBFFI_LIBS -PNG_CFLAGS -PNG_LIBS -LCMS_CFLAGS -LCMS_LIBS -ICECC_CMD -ICECC_CREATE_ENV -ICECC_WRAPPER -CCACHE' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures OpenJDK jdk9 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/openjdk] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -X features: - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] - --target=TARGET configure for building compilers for TARGET [HOST] -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of OpenJDK jdk9:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-openjdk-only suppress building custom source even if present - [disabled] - --enable-debug set the debug level to fastdebug (shorthand for - --with-debug-level=fastdebug) [disabled] - --enable-headless-only only build headless (no GUI) support [disabled] - --enable-full-docs build complete documentation [enabled if all tools - found] - --disable-unlimited-crypto - Disable unlimited crypto policy [enabled] - --disable-keep-packaged-modules - Do not keep packaged modules in jdk image [enable] - --enable-static-build enable static library build [disabled] - --disable-warnings-as-errors - do not consider native warnings to be an error - [enabled] - --enable-debug-symbols Deprecated. Option is kept for backwards - compatibility and is ignored - --enable-zip-debug-info Deprecated. Option is kept for backwards - compatibility and is ignored - --enable-native-coverage - enable native compilation with code coverage - data[disabled] - --enable-asan enable AddressSanitizer if possible [disabled] - --enable-dtrace[=yes/no/auto] - enable dtrace. Default is auto, where dtrace is - enabled if all dependencies are present. - --enable-aot[=yes/no/auto] - enable ahead of time compilation feature. Default is - auto, where aot is enabled if all dependencies are - present. - --enable-cds[=yes/no] enable class data sharing feature in non-minimal VM. - Default is yes. - --disable-hotspot-gtest Disables building of the Hotspot unit tests - [enabled] - --disable-freetype-bundling - disable bundling of the freetype library with the - build result [enabled on Windows or when using - --with-freetype, disabled otherwise] - --enable-libffi-bundling - enable bundling of libffi.so to make the built JDK - runnable on more systems - --enable-jtreg-failure-handler - forces build of the jtreg failure handler to be - enabled, missing dependencies become fatal errors. - Default is auto, where the failure handler is built - if all dependencies are present and otherwise just - disabled. - --disable-generate-classlist - forces enabling or disabling of the generation of a - CDS classlist at build time. Default is to generate - it when either the server or client JVMs are built - and enable-cds is true. - --enable-sjavac use sjavac to do fast incremental compiles - [disabled] - --disable-javac-server disable javac server [enabled] - --enable-icecc enable distribted compilation of native code using - icecc/icecream [disabled] - --disable-precompiled-headers - disable using precompiled headers when compiling C++ - [enabled] - --enable-ccache enable using ccache to speed up recompilations - [disabled] - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-target-bits build 32-bit or 64-bit binaries (for platforms that - support it), e.g. --with-target-bits=32 [guessed] - --with-custom-make-dir Deprecated. Option is kept for backwards - compatibility and is ignored - --with-jdk-variant JDK variant to build (normal) [normal] - --with-debug-level set the debug level (release, fastdebug, slowdebug, - optimized) [release] - --with-jvm-variants JVM variants (separated by commas) to build - (server,client,minimal,core,zero,custom) [server] - --with-cpu-port specify sources to use for Hotspot 64-bit ARM port - (arm64,aarch64) [aarch64] - --with-devkit use this devkit for compilers, tools and resources - --with-sys-root alias for --with-sysroot for backwards compatability - --with-sysroot use this directory as sysroot - --with-tools-dir alias for --with-toolchain-path for backwards - compatibility - --with-toolchain-path prepend these directories when searching for - toolchain binaries (compilers etc) - --with-extra-path prepend these directories to the default path - --with-sdk-name use the platform SDK of the given name. [macosx] - --with-conf-name use this as the name of the configuration [generated - from important configuration options] - --with-output-sync set make output sync type if supported by make. - [recurse] - --with-default-make-target - set the default make target [exploded-image] - --with-cacerts-file specify alternative cacerts file - --with-copyright-year Set copyright year value for build [current year] - --with-milestone Deprecated. Option is kept for backwards - compatibility and is ignored - --with-update-version Deprecated. Option is kept for backwards - compatibility and is ignored - --with-user-release-suffix - Deprecated. Option is kept for backwards - compatibility and is ignored - --with-build-number Deprecated. Option is kept for backwards - compatibility and is ignored - --with-version-major Deprecated. Option is kept for backwards - compatibility and is ignored - --with-version-minor Deprecated. Option is kept for backwards - compatibility and is ignored - --with-version-security Deprecated. Option is kept for backwards - compatibility and is ignored - --with-vendor-name Set vendor name. Among others, used to set the - 'java.vendor' and 'java.vm.vendor' system - properties. [not specified] - --with-vendor-url Set the 'java.vendor.url' system property [not - specified] - --with-vendor-bug-url Set the 'java.vendor.url.bug' system property [not - specified] - --with-vendor-vm-bug-url - Sets the bug URL which will be displayed when the VM - crashes [not specified] - --with-version-string Set version string [calculated] - --with-version-pre Set the base part of the version 'PRE' field - (pre-release identifier) ['internal'] - --with-version-opt Set version 'OPT' field (build metadata) - [..] - --with-version-build Set version 'BUILD' field (build number) [not - specified] - --with-version-feature Set version 'FEATURE' field (first number) [current - source value] - --with-version-interim Set version 'INTERIM' field (second number) [current - source value] - --with-version-update Set version 'UPDATE' field (third number) [current - source value] - --with-version-patch Set version 'PATCH' field (fourth number) [not - specified] - --with-version-date Set version date [current source value] - --with-vendor-version-string - Set vendor version string [not specified] - --with-boot-jdk path to Boot JDK (used to bootstrap build) [probed] - --with-build-jdk path to JDK of same version as is being built[the - newly built JDK] - --with-import-modules import a set of prebuilt modules either as a zip - file or an exploded directory - --with-toolchain-type the toolchain type (or family) to use, use '--help' - to show possible values [platform dependent] - --with-extra-cflags extra flags to be used when compiling jdk c-files - --with-extra-cxxflags extra flags to be used when compiling jdk c++-files - --with-extra-ldflags extra flags to be used when linking jdk - --with-toolchain-version - the version of the toolchain to look for, use - '--help' to show possible values [platform - dependent] - --with-build-devkit Devkit to use for the build platform toolchain - --with-jtreg Regression Test Harness [probed] - --with-jib Jib dependency management tool [not used] - --with-abi-profile specify ABI profile for ARM builds - (arm-vfp-sflt,arm-vfp-hflt,arm-sflt, - armv5-vfp-sflt,armv6-vfp-hflt,arm64,aarch64) - [toolchain dependent] - --with-macosx-version-max - error on use of newer functionality. [macosx] - --with-native-debug-symbols - set the native debug symbol configuration (none, - internal, external, zipped) [varying] - --with-stdc++lib=,, - force linking of the C++ runtime on Linux to either - static or dynamic, default is static with dynamic as - fallback - --with-msvcr-dll path to microsoft C runtime dll (msvcr*.dll) - (Windows only) [probed] - --with-msvcp-dll path to microsoft C++ runtime dll (msvcp*.dll) - (Windows only) [probed] - --with-x use the X Window System - --with-cups specify prefix directory for the cups package - (expecting the headers under PATH/include) - --with-cups-include specify directory for the cups include files - --with-fontconfig specify prefix directory for the fontconfig package - (expecting the headers under PATH/include) - --with-fontconfig-include - specify directory for the fontconfig include files - --with-freetype specify prefix directory for the freetype package - (expecting the libraries under PATH/lib and the - headers under PATH/include) - --with-freetype-include specify directory for the freetype include files - --with-freetype-lib specify directory for the freetype library - --with-freetype-src specify directory with freetype sources to - automatically build the library (experimental, - Windows-only) - --with-freetype-license if bundling freetype, also bundle this license file - --with-alsa specify prefix directory for the alsa package - (expecting the libraries under PATH/lib and the - headers under PATH/include) - --with-alsa-include specify directory for the alsa include files - --with-alsa-lib specify directory for the alsa library - --with-libffi specify prefix directory for the libffi package - (expecting the libraries under PATH/lib and the - headers under PATH/include) - --with-libffi-include specify directory for the libffi include files - --with-libffi-lib specify directory for the libffi library - --with-libjpeg use libjpeg from build system or OpenJDK source - (system, bundled) [bundled] - --with-giflib use giflib from build system or OpenJDK source - (system, bundled) [bundled] - --with-libpng use libpng from build system or OpenJDK source - (system, bundled) [bundled] - --with-zlib use zlib from build system or OpenJDK source - (system, bundled) [bundled] - --with-lcms use lcms2 from build system or OpenJDK source - (system, bundled) [bundled] - --with-dxsdk Deprecated. Option is kept for backwards - compatibility and is ignored - --with-dxsdk-lib Deprecated. Option is kept for backwards - compatibility and is ignored - --with-dxsdk-include Deprecated. Option is kept for backwards - compatibility and is ignored - --with-jvm-features additional JVM features to enable (separated by - comma), use '--help' to show possible values [none] - --with-jvm-interpreter Deprecated. Option is kept for backwards - compatibility and is ignored - --with-num-cores number of cores in the build system, e.g. - --with-num-cores=8 [probed] - --with-memory-size memory (in MB) available in the build system, e.g. - --with-memory-size=1024 [probed] - --with-jobs number of parallel jobs to let make run [calculated - based on cores and memory] - --with-test-jobs number of parallel tests jobs to run [based on build - jobs] - --with-boot-jdk-jvmargs specify JVM arguments to be passed to all java - invocations of boot JDK, overriding the default - values, e.g --with-boot-jdk-jvmargs="-Xmx8G - -enableassertions" - --with-sjavac-server-java - use this java binary for running the sjavac - background server [Boot JDK java] - --with-ccache-dir where to store ccache files [~/.ccache] - -Some influential environment variables: - BASENAME Override default value for BASENAME - BASH Override default value for BASH - CAT Override default value for CAT - CHMOD Override default value for CHMOD - CMP Override default value for CMP - COMM Override default value for COMM - CP Override default value for CP - CUT Override default value for CUT - DATE Override default value for DATE - DIFF Override default value for DIFF - DIRNAME Override default value for DIRNAME - ECHO Override default value for ECHO - EXPR Override default value for EXPR - FILE Override default value for FILE - FIND Override default value for FIND - HEAD Override default value for HEAD - GUNZIP Override default value for GUNZIP - GZIP Override default value for GZIP - LN Override default value for LN - LS Override default value for LS - MKDIR Override default value for MKDIR - MKTEMP Override default value for MKTEMP - MV Override default value for MV - NAWK Override default value for NAWK - PRINTF Override default value for PRINTF - RM Override default value for RM - RMDIR Override default value for RMDIR - SH Override default value for SH - SORT Override default value for SORT - TAIL Override default value for TAIL - TAR Override default value for TAR - TEE Override default value for TEE - TOUCH Override default value for TOUCH - TR Override default value for TR - UNAME Override default value for UNAME - UNIQ Override default value for UNIQ - WC Override default value for WC - WHICH Override default value for WHICH - XARGS Override default value for XARGS - AWK Override default value for AWK - GREP Override default value for GREP - EGREP Override default value for EGREP - FGREP Override default value for FGREP - SED Override default value for SED - CYGPATH Override default value for CYGPATH - READLINK Override default value for READLINK - DF Override default value for DF - CPIO Override default value for CPIO - NICE Override default value for NICE - PANDOC Override default value for PANDOC - MAKE Override default value for MAKE - UNZIP Override default value for UNZIP - ZIPEXE Override default value for ZIPEXE - LDD Override default value for LDD - READELF Override default value for READELF - DOT Override default value for DOT - HG Override default value for HG - STAT Override default value for STAT - TIME Override default value for TIME - FLOCK Override default value for FLOCK - DTRACE Override default value for DTRACE - PATCH Override default value for PATCH - DSYMUTIL Override default value for DSYMUTIL - XATTR Override default value for XATTR - CODESIGN Override default value for CODESIGN - SETFILE Override default value for SETFILE - PKG_CONFIG path to pkg-config utility - JAVA Override default value for JAVA - JAVAC Override default value for JAVAC - JAVADOC Override default value for JAVADOC - JAR Override default value for JAR - JARSIGNER Override default value for JARSIGNER - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CXX C++ compiler command - CXXFLAGS C++ compiler flags - CPP C preprocessor - CXXCPP C++ preprocessor - AS Override default value for AS - AR Override default value for AR - LIPO Override default value for LIPO - OTOOL Override default value for OTOOL - INSTALL_NAME_TOOL - Override default value for INSTALL_NAME_TOOL - STRIP Override default value for STRIP - NM Override default value for NM - GNM Override default value for GNM - OBJCOPY Override default value for OBJCOPY - OBJDUMP Override default value for OBJDUMP - BUILD_CC Override default value for BUILD_CC - BUILD_CXX Override default value for BUILD_CXX - BUILD_NM Override default value for BUILD_NM - BUILD_AR Override default value for BUILD_AR - BUILD_OBJCOPY - Override default value for BUILD_OBJCOPY - BUILD_STRIP Override default value for BUILD_STRIP - JTREGEXE Override default value for JTREGEXE - XMKMF Path to xmkmf, Makefile generator for X Window System - FREETYPE_CFLAGS - C compiler flags for FREETYPE, overriding pkg-config - FREETYPE_LIBS - linker flags for FREETYPE, overriding pkg-config - ALSA_CFLAGS C compiler flags for ALSA, overriding pkg-config - ALSA_LIBS linker flags for ALSA, overriding pkg-config - LIBFFI_CFLAGS - C compiler flags for LIBFFI, overriding pkg-config - LIBFFI_LIBS linker flags for LIBFFI, overriding pkg-config - PNG_CFLAGS C compiler flags for PNG, overriding pkg-config - PNG_LIBS linker flags for PNG, overriding pkg-config - LCMS_CFLAGS C compiler flags for LCMS, overriding pkg-config - LCMS_LIBS linker flags for LCMS, overriding pkg-config - ICECC_CMD Override default value for ICECC_CMD - ICECC_CREATE_ENV - Override default value for ICECC_CREATE_ENV - ICECC_WRAPPER - Override default value for ICECC_WRAPPER - CCACHE Override default value for CCACHE - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to . -OpenJDK home page: . -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -OpenJDK configure jdk9 -generated by GNU Autoconf 2.69 - -Copyright (C) 2012 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_cxx_try_compile LINENO -# ---------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_compile - -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_cxx_try_cpp LINENO -# ------------------------ -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_cpp - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES -# --------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_cxx_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ----------------------------------------- ## -## Report this to build-dev@openjdk.java.net ## -## ----------------------------------------- ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_cxx_check_header_mongrel - -# ac_fn_cxx_try_run LINENO -# ------------------------ -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_cxx_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_run - -# ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES -# --------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_cxx_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_cxx_check_header_compile - -# ac_fn_cxx_compute_int LINENO EXPR VAR INCLUDES -# ---------------------------------------------- -# Tries to find the compile-time value of EXPR in a program that includes -# INCLUDES, setting VAR accordingly. Returns whether the value could be -# computed -ac_fn_cxx_compute_int () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_lo=0 ac_mid=0 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_hi=$ac_mid; break -else - as_fn_arith $ac_mid + 1 && ac_lo=$as_val - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_hi=-1 ac_mid=-1 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_lo=$ac_mid; break -else - as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - ac_lo= ac_hi= -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_hi=$ac_mid -else - as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in #(( -?*) eval "$3=\$ac_lo"; ac_retval=0 ;; -'') ac_retval=1 ;; -esac - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -static long int longval () { return $2; } -static unsigned long int ulongval () { return $2; } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (($2) < 0) - { - long int i = longval (); - if (i != ($2)) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ($2)) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_run "$LINENO"; then : - echo >>conftest.val; read $3 &5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_link - -# ac_fn_cxx_check_func LINENO FUNC VAR -# ------------------------------------ -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_cxx_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_cxx_check_func - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by OpenJDK $as_me jdk9, which was -generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - $as_echo "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - $as_echo "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - $as_echo "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -$as_echo "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -ac_aux_dir= -for ac_dir in $TOPDIR/make/autoconf/build-aux "$srcdir"/$TOPDIR/make/autoconf/build-aux; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in $TOPDIR/make/autoconf/build-aux \"$srcdir\"/$TOPDIR/make/autoconf/build-aux" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- - -# -# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# -# Copyright © 2004 Scott James Remnant . -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# PKG_PROG_PKG_CONFIG([MIN-VERSION]) -# ---------------------------------- -# PKG_PROG_PKG_CONFIG - -# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# Check to see whether a particular set of modules exists. Similar -# to PKG_CHECK_MODULES(), but does not set variables or print errors. -# -# -# Similar to PKG_CHECK_MODULES, make sure that the first instance of -# this or PKG_CHECK_MODULES is called, or make sure to call -# PKG_CHECK_EXISTS manually -# -------------------------------------------------------------- - - - -# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -# --------------------------------------------- -# _PKG_CONFIG - -# _PKG_SHORT_ERRORS_SUPPORTED -# ----------------------------- -# _PKG_SHORT_ERRORS_SUPPORTED - - -# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -# [ACTION-IF-NOT-FOUND]) -# -# -# Note that if there is a possibility the first call to -# PKG_CHECK_MODULES might not happen, you should be sure to include an -# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -# -# -# -------------------------------------------------------------- -# PKG_CHECK_MODULES - - -# Include these first... -# -# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# Create a function/macro that takes a series of named arguments. The call is -# similar to AC_DEFUN, but the setup of the function looks like this: -# BASIC_DEFUN_NAMED([MYFUNC], [FOO *BAR], [$@], [ -# ... do something -# AC_MSG_NOTICE([Value of BAR is ARG_BAR]) -# ]) -# A star (*) in front of a named argument means that it is required and it's -# presence will be verified. To pass e.g. the first value as a normal indexed -# argument, use [m4_shift($@)] as the third argument instead of [$@]. These -# arguments are referenced in the function by their name prefixed by ARG_, e.g. -# "ARG_FOO". -# -# The generated function can be called like this: -# MYFUNC(FOO: [foo-val], -# BAR: [ -# $ECHO hello world -# ]) -# Note that the argument value must start on the same line as the argument name. -# -# Argument 1: Name of the function to define -# Argument 2: List of legal named arguments, with a * prefix for required arguments -# Argument 3: Argument array to treat as named, typically $@ -# Argument 4: The main function body - - -# Test if $1 is a valid argument to $3 (often is $JAVA passed as $3) -# If so, then append $1 to $2 \ -# Also set JVM_ARG_OK to true/false depending on outcome. - - -# Appends a string to a path variable, only adding the : when needed. - - -# Prepends a string to a path variable, only adding the : when needed. - - -# This will make sure the given variable points to a full and proper -# path. This means: -# 1) There will be no spaces in the path. On unix platforms, -# spaces in the path will result in an error. On Windows, -# the path will be rewritten using short-style to be space-free. -# 2) The path will be absolute, and it will be in unix-style (on -# cygwin). -# $1: The name of the variable to fix - - -# This will make sure the given variable points to a executable -# with a full and proper path. This means: -# 1) There will be no spaces in the path. On unix platforms, -# spaces in the path will result in an error. On Windows, -# the path will be rewritten using short-style to be space-free. -# 2) The path will be absolute, and it will be in unix-style (on -# cygwin). -# Any arguments given to the executable is preserved. -# If the input variable does not have a directory specification, then -# it need to be in the PATH. -# $1: The name of the variable to fix - - - - -# Register a --with argument but mark it as deprecated -# $1: The name of the with argument to deprecate, not including --with- - - -# Register a --enable argument but mark it as deprecated -# $1: The name of the with argument to deprecate, not including --enable- -# $2: The name of the argument to deprecate, in shell variable style (i.e. with _ instead of -) -# $3: Messages to user. - - - - -# Test that variable $1 denoting a program is not empty. If empty, exit with an error. -# $1: variable to check - - -# Check that there are no unprocessed overridden variables left. -# If so, they are an incorrect argument and we will exit with an error. - - -# Setup a tool for the given variable. If correctly specified by the user, -# use that value, otherwise search for the tool using the supplied code snippet. -# $1: variable to set -# $2: code snippet to call to look for the tool -# $3: code snippet to call if variable was used to find tool - - -# Call BASIC_SETUP_TOOL with AC_PATH_PROGS to locate the tool -# $1: variable to set -# $2: executable name (or list of names) to look for -# $3: [path] - - -# Call BASIC_SETUP_TOOL with AC_CHECK_TOOLS to locate the tool -# $1: variable to set -# $2: executable name (or list of names) to look for - - -# Like BASIC_PATH_PROGS but fails if no tool was found. -# $1: variable to set -# $2: executable name (or list of names) to look for -# $3: [path] - - -# Like BASIC_SETUP_TOOL but fails if no tool was found. -# $1: variable to set -# $2: autoconf macro to call to look for the special tool - - -# Setup the most fundamental tools that relies on not much else to set up, -# but is used by much of the early bootstrap code. - - -# Setup basic configuration paths, and platform-specific stuff related to PATHs. - - -# Evaluates platform specific overrides for devkit variables. -# $1: Name of variable - - - - - - -#%%% Simple tools %%% - -# Check if we have found a usable version of make -# $1: the path to a potential make binary (or empty) -# $2: the description on how we found this - - - - -# Goes looking for a usable version of GNU make. - - - - - - - - - - -# Check if build directory is on local disk. If not possible to determine, -# we prefer to claim it's local. -# Argument 1: directory to test -# Argument 2: what to do if it is on local disk -# Argument 3: what to do otherwise (remote disk or failure) - - -# Check that source files have basic read permissions set. This might -# not be the case in cygwin in certain conditions. - - - - -# Check for support for specific options in bash - - -################################################################################ -# -# Default make target -# - - -# Code to run after AC_OUTPUT - - -# -# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - - - - - -# Helper function which possibly converts a path using DOS-style short mode. -# If so, the updated path is stored in $new_path. -# $1: The path to check - - -# Helper function which possibly converts a path using DOS-style short mode. -# If so, the updated path is stored in $new_path. -# $1: The path to check - - -# FIXME: The BASIC_FIXUP_*_CYGWIN/MSYS is most likely too convoluted -# and could probably be heavily simplified. However, all changes in this -# area tend to need lot of testing in different scenarios, and in lack of -# proper unit testing, cleaning this up has not been deemed worth the effort -# at the moment. - - - - - - - - - -# Setup basic configuration paths, and platform-specific stuff related to PATHs. - - - - -# ... then the rest -# -# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -######################################################################## -# This file handles detection of the Boot JDK. The Boot JDK detection -# process has been developed as a response to solve a complex real-world -# problem. Initially, it was simple, but it has grown as platform after -# platform, idiosyncracy after idiosyncracy has been supported. -# -# The basic idea is this: -# 1) You need an acceptable *) JDK to use as a Boot JDK -# 2) There are several ways to locate a JDK, that are mostly platform -# dependent **) -# 3) You can have multiple JDKs installed -# 4) If possible, configure should try to dig out an acceptable JDK -# automatically, without having to resort to command-line options -# -# *) acceptable means e.g. JDK7 for building JDK8, a complete JDK (with -# javac) and not a JRE, etc. -# -# **) On Windows we typically use a well-known path. -# On MacOSX we typically use the tool java_home. -# On Linux we typically find javac in the $PATH, and then follow a -# chain of symlinks that often ends up in a real JDK. -# -# This leads to the code where we check in different ways to locate a -# JDK, and if one is found, check if it is acceptable. If not, we print -# our reasons for rejecting it (useful when debugging non-working -# configure situations) and continue checking the next one. -######################################################################## - -# Execute the check given as argument, and verify the result -# If the Boot JDK was previously found, do nothing -# $1 A command line (typically autoconf macro) to execute - - -# Test: Is bootjdk explicitly set by command line arguments? - - -# Test: Is $JAVA_HOME set? - - -# Test: Is there a java or javac in the PATH, which is a symlink to the JDK? - - -# Test: Is there a /usr/libexec/java_home? (Typically on MacOSX) -# $1: Argument to the java_home binary (optional) - - -# Test: On MacOS X, can we find a boot jdk using /usr/libexec/java_home? - - -# Look for a jdk in the given path. If there are multiple, try to select the newest. -# If found, set BOOT_JDK and BOOT_JDK_FOUND. -# $1 = Path to directory containing jdk installations. -# $2 = String to append to the found JDK directory to get the proper JDK home - - -# Call BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY, but use the given -# environmental variable as base for where to look. -# $1 Name of an environmal variable, assumed to point to the Program Files directory. - - -# Test: Is there a JDK installed in default, well-known locations? - - -# Check that a command-line tool in the Boot JDK is correct -# $1 = name of variable to assign -# $2 = name of binary - - -############################################################################### -# -# We need a Boot JDK to bootstrap the build. -# - - - - - -# BUILD_JDK: the location of the latest JDK that can run -# on the host system and supports the target class file version -# generated in this JDK build. This variable should only be -# used after the launchers are built. -# - -# Execute the check given as argument, and verify the result. -# If the JDK was previously found, do nothing. -# $1 A command line (typically autoconf macro) to execute - - -# By default the BUILD_JDK is the JDK_OUTPUTDIR. If the target architecture -# is different than the host system doing the build (e.g. cross-compilation), -# a special BUILD_JDK is built as part of the build process. An external -# prebuilt BUILD_JDK can also be supplied. - - -# -# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - - - - - - - - - - - - - - - - - -################################################################################ -# -# Runs icecc-create-env once and prints the error if it fails -# -# $1: arguments to icecc-create-env -# $2: log file -# - - -################################################################################ -# -# Optionally enable distributed compilation of native code using icecc/icecream -# - - - - - - - -# -# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -################################################################################ -# -# Setup ABI profile (for arm) -# - - -# Reset the global CFLAGS/LDFLAGS variables and initialize them with the -# corresponding configure arguments instead - - -# Setup the sysroot flags and add them to global CFLAGS and LDFLAGS so -# that configure can use them while detecting compilers. -# TOOLCHAIN_TYPE is available here. -# Param 1 - Optional prefix to all variables. (e.g BUILD_) - - - - - - -# Documentation on common flags used for solstudio in HIGHEST. -# -# WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be -# done with care, there are some assumptions below that need to -# be understood about the use of pointers, and IEEE behavior. -# -# -fns: Use non-standard floating point mode (not IEEE 754) -# -fsimple: Do some simplification of floating point arithmetic (not IEEE 754) -# -fsingle: Use single precision floating point with 'float' -# -xalias_level=basic: Assume memory references via basic pointer types do not alias -# (Source with excessing pointer casting and data access with mixed -# pointer types are not recommended) -# -xbuiltin=%all: Use intrinsic or inline versions for math/std functions -# (If you expect perfect errno behavior, do not use this) -# -xdepend: Loop data dependency optimizations (need -xO3 or higher) -# -xrestrict: Pointer parameters to functions do not overlap -# (Similar to -xalias_level=basic usage, but less obvious sometimes. -# If you pass in multiple pointers to the same data, do not use this) -# -xlibmil: Inline some library routines -# (If you expect perfect errno behavior, do not use this) -# -xlibmopt: Use optimized math routines (CURRENTLY DISABLED) -# (If you expect perfect errno behavior, do not use this) -# Can cause undefined external on Solaris 8 X86 on __sincos, removing for now - - # FIXME: this will never happen since sparc != sparcv9, ie 32 bit, which we don't build anymore. - # Bug? - #if test "x$OPENJDK_TARGET_CPU" = xsparc; then - # CFLAGS_JDK="${CFLAGS_JDK} -xmemalign=4s" - # CXXFLAGS_JDK="${CXXFLAGS_JDK} -xmemalign=4s" - #fi - - - - - - -################################################################################ -# $1 - Either BUILD or TARGET to pick the correct OS/CPU variables to check -# conditionals against. -# $2 - Optional prefix for each variable defined. - - -# FLAGS_C_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE], -# IF_FALSE: [RUN-IF-FALSE]) -# ------------------------------------------------------------ -# Check that the C compiler supports an argument - - - - -# FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE], -# IF_FALSE: [RUN-IF-FALSE]) -# ------------------------------------------------------------ -# Check that the C++ compiler supports an argument - - - - -# FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE], -# IF_FALSE: [RUN-IF-FALSE]) -# ------------------------------------------------------------ -# Check that the C and C++ compilers support an argument - - - - -# FLAGS_LINKER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE], -# IF_FALSE: [RUN-IF-FALSE]) -# ------------------------------------------------------------ -# Check that the linker support an argument - - - - - - -# FLAGS_SETUP_GCC6_COMPILER_FLAGS([PREFIX]) -# Arguments: -# $1 - Optional prefix for each variable defined. - - -# -# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - - - - - -cygwin_help() { - case $1 in - unzip) - PKGHANDLER_COMMAND="( cd && cmd /c setup -q -P unzip )" - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." - ;; - zip) - PKGHANDLER_COMMAND="( cd && cmd /c setup -q -P zip )" - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." - ;; - make) - PKGHANDLER_COMMAND="( cd && cmd /c setup -q -P make )" - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." - ;; - freetype) - HELP_MSG=" -The freetype library can now be build during the configure process. -Download the freetype sources and unpack them into an arbitrary directory: - -wget http://download.savannah.gnu.org/releases/freetype/freetype-2.5.3.tar.gz -tar -xzf freetype-2.5.3.tar.gz - -Then run configure with '--with-freetype-src='. This will -automatically build the freetype library into '/lib64' for 64-bit -builds or into '/lib32' for 32-bit builds. -Afterwards you can always use '--with-freetype-include=/include' -and '--with-freetype-lib=/lib32|64' for other builds. - -Alternatively you can unpack the sources like this to use the default directory: - -tar --one-top-level=$HOME/freetype --strip-components=1 -xzf freetype-2.5.3.tar.gz" - ;; - esac -} - -msys_help() { - PKGHANDLER_COMMAND="" -} - -apt_help() { - case $1 in - reduced) - PKGHANDLER_COMMAND="sudo apt-get install gcc-multilib g++-multilib" ;; - devkit) - PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;; - openjdk) - PKGHANDLER_COMMAND="sudo apt-get install openjdk-8-jdk" ;; - alsa) - PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;; - cups) - PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;; - fontconfig) - PKGHANDLER_COMMAND="sudo apt-get install libfontconfig1-dev" ;; - freetype) - PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;; - ffi) - PKGHANDLER_COMMAND="sudo apt-get install libffi-dev" ;; - x11) - PKGHANDLER_COMMAND="sudo apt-get install libx11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev" ;; - ccache) - PKGHANDLER_COMMAND="sudo apt-get install ccache" ;; - dtrace) - PKGHANDLER_COMMAND="sudo apt-get install systemtap-sdt-dev" ;; - esac -} - -yum_help() { - case $1 in - devkit) - PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;; - openjdk) - PKGHANDLER_COMMAND="sudo yum install java-1.8.0-openjdk-devel" ;; - alsa) - PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;; - cups) - PKGHANDLER_COMMAND="sudo yum install cups-devel" ;; - fontconfig) - PKGHANDLER_COMMAND="sudo yum install fontconfig-devel" ;; - freetype) - PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;; - x11) - PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel libXi-devel" ;; - ccache) - PKGHANDLER_COMMAND="sudo yum install ccache" ;; - esac -} - -brew_help() { - case $1 in - openjdk) - PKGHANDLER_COMMAND="brew cask install java" ;; - freetype) - PKGHANDLER_COMMAND="brew install freetype" ;; - ccache) - PKGHANDLER_COMMAND="brew install ccache" ;; - esac -} - -port_help() { - PKGHANDLER_COMMAND="" -} - -pkgutil_help() { - PKGHANDLER_COMMAND="" -} - -pkgadd_help() { - PKGHANDLER_COMMAND="" -} - -# This function will check if we're called from the "configure" wrapper while -# printing --help. If so, we will print out additional information that can -# only be extracted within the autoconf script, and then exit. This must be -# called at the very beginning in configure.ac. - - - - - - -# -# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# All valid JVM features, regardless of platform -VALID_JVM_FEATURES="compiler1 compiler2 zero minimal dtrace jvmti jvmci \ - graal vm-structs jni-check services management all-gcs nmt cds \ - static-build link-time-opt aot" - -# All valid JVM variants -VALID_JVM_VARIANTS="server client minimal core zero custom" - -############################################################################### -# Check if the specified JVM variant should be built. To be used in shell if -# constructs, like this: -# if HOTSPOT_CHECK_JVM_VARIANT(server); then -# -# Only valid to use after HOTSPOT_SETUP_JVM_VARIANTS has setup variants. - -# Definition kept in one line to allow inlining in if statements. -# Additional [] needed to keep m4 from mangling shell constructs. - - -############################################################################### -# Check if the specified JVM features are explicitly enabled. To be used in -# shell if constructs, like this: -# if HOTSPOT_CHECK_JVM_FEATURE(jvmti); then -# -# Only valid to use after HOTSPOT_SETUP_JVM_FEATURES has setup features. - -# Definition kept in one line to allow inlining in if statements. -# Additional [] needed to keep m4 from mangling shell constructs. - - -############################################################################### -# Check which variants of the JVM that we want to build. Available variants are: -# server: normal interpreter, and a tiered C1/C2 compiler -# client: normal interpreter, and C1 (no C2 compiler) -# minimal: reduced form of client with optional features stripped out -# core: normal interpreter only, no compiler -# zero: C++ based interpreter only, no compiler -# custom: baseline JVM with no default features -# - - -############################################################################### -# Check if dtrace should be enabled and has all prerequisites present. -# - - -################################################################################ -# Check if AOT should be enabled -# - - -################################################################################ -# Allow to disable CDS -# - - -############################################################################### -# Set up all JVM features for each JVM variant. -# - - -############################################################################### -# Validate JVM features once all setup is complete, including custom setup. -# - - -################################################################################ -# -# Specify which sources will be used to build the 64-bit ARM port -# -# --with-cpu-port=arm64 will use hotspot/src/cpu/arm -# --with-cpu-port=aarch64 will use hotspot/src/cpu/aarch64 -# - - - -################################################################################ -# Check if gtest should be built -# - - -# -# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -############################################################################### -# Check which variant of the JDK that we want to build. -# Currently we have: -# normal: standard edition -# but the custom make system may add other variants -# -# Effectively the JDK variant gives a name to a specific set of -# modules to compile into the JDK. - - -############################################################################### -# Set the debug level -# release: no debug information, all optimizations, no asserts. -# optimized: no debug information, all optimizations, no asserts, HotSpot target is 'optimized'. -# fastdebug: debug information (-g), all optimizations, all asserts -# slowdebug: debug information (-g), no optimizations, all asserts - - -############################################################################### -# -# Should we build only OpenJDK even if closed sources are present? -# - - - - -############################################################################### -# -# Enable or disable the elliptic curve crypto implementation -# - - - - -################################################################################ -# -# Gcov coverage data for hotspot -# - - -############################################################################### -# -# AddressSanitizer -# - - -################################################################################ -# -# Static build support. When enabled will generate static -# libraries instead of shared libraries for all JDK libs. -# - - -################################################################################ -# -# jlink options. -# We always keep packaged modules in JDK image. -# - - -################################################################################ -# -# Check if building of the jtreg failure handler should be enabled. -# - - -################################################################################ -# -# Enable or disable generation of the classlist at build time -# - - -# -# Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -############################################################################### -# -# Setup version numbers -# - -# Verify that a given string represents a valid version number, and assign it -# to a variable. - -# Argument 1: the variable to assign to -# Argument 2: the value given by the user - - - - -# -# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# Major library component reside in separate files. -# -# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -################################################################################ -# Setup alsa (Advanced Linux Sound Architecture) -################################################################################ - - -# -# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -################################################################################ -# Setup bundled libraries. -# -# For libjpeg, giflib, libpng, lcms2 and zlib, the source is present in the -# OpenJDK repository. Default is to use these libraries as bundled, but they -# might be replaced by en external version by the user. -################################################################################ - - -################################################################################ -# Setup libjpeg -################################################################################ - - -################################################################################ -# Setup giflib -################################################################################ - - -################################################################################ -# Setup libpng -################################################################################ - - -################################################################################ -# Setup zlib -################################################################################ - - -################################################################################ -# Setup lcms (Little CMS) -################################################################################ - - -# -# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -################################################################################ -# Setup cups (Common Unix Printing System) -################################################################################ - - -# -# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -################################################################################ -# Setup libffi (Foreign Function Interface) -################################################################################ - - -# -# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -################################################################################ -# Build the freetype lib from source -################################################################################ - - -################################################################################ -# Check if a potential freeype library match is correct and usable -################################################################################ - - -################################################################################ -# Setup freetype (The FreeType2 font rendering library) -################################################################################ - - -# -# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -################################################################################ -# Setup the standard C/C++ runtime libraries. -# -# Most importantly, determine if stdc++ should be linked statically or -# dynamically. -################################################################################ - - -# -# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -################################################################################ -# Setup X11 Windows system -################################################################################ - - -# -# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -################################################################################ -# Setup fontconfig -################################################################################ - - - -################################################################################ -# Determine which libraries are needed for this configuration -################################################################################ - - -################################################################################ -# Parse library options, and setup needed libraries -################################################################################ - - -################################################################################ -# Setup various libraries, typically small system libraries -################################################################################ - - -################################################################################ -# libstlport.so.1 is needed for running gtest on Solaris. Find it to -# redistribute it in the test image. -################################################################################ - - - -# -# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD. -# Converts autoconf style CPU name to OpenJDK style, into -# VAR_CPU, VAR_CPU_ARCH, VAR_CPU_BITS and VAR_CPU_ENDIAN. - - -# Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD. -# Converts autoconf style OS name to OpenJDK style, into -# VAR_OS, VAR_OS_TYPE and VAR_OS_ENV. - - -# Expects $host_os $host_cpu $build_os and $build_cpu -# and $with_target_bits to have been setup! -# -# Translate the standard triplet(quadruplet) definition -# of the target/build system into OPENJDK_TARGET_OS, OPENJDK_TARGET_CPU, -# OPENJDK_BUILD_OS, etc. - - -# Check if a reduced build (32-bit on 64-bit platforms) is requested, and modify behaviour -# accordingly. Must be done after setting up build and target system, but before -# doing anything else with these values. - - -# Setup the legacy variables, for controlling the old makefiles. -# - - -# $1 - Either TARGET or BUILD to setup the variables for. - - - - - - -#%%% Build and target systems %%% - - - - -# Support macro for PLATFORM_SETUP_OPENJDK_TARGET_BITS. -# Add -mX to various FLAGS variables. - - - - - - -# -# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - - - -################################################################################ -# Define a mechanism for importing extra prebuilt modules -# - - - -# -# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -######################################################################## -# This file is responsible for detecting, verifying and setting up the -# toolchain, i.e. the compiler, linker and related utilities. It will setup -# proper paths to the binaries, but it will not setup any flags. -# -# The binaries used is determined by the toolchain type, which is the family of -# compilers and related tools that are used. -######################################################################## - - -# All valid toolchains, regardless of platform (used by help.m4) -VALID_TOOLCHAINS_all="gcc clang solstudio xlc microsoft" - -# These toolchains are valid on different platforms -VALID_TOOLCHAINS_linux="gcc clang" -VALID_TOOLCHAINS_solaris="solstudio" -VALID_TOOLCHAINS_macosx="gcc clang" -VALID_TOOLCHAINS_aix="xlc" -VALID_TOOLCHAINS_windows="microsoft" - -# Toolchain descriptions -TOOLCHAIN_DESCRIPTION_clang="clang/LLVM" -TOOLCHAIN_DESCRIPTION_gcc="GNU Compiler Collection" -TOOLCHAIN_DESCRIPTION_microsoft="Microsoft Visual Studio" -TOOLCHAIN_DESCRIPTION_solstudio="Oracle Solaris Studio" -TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++" - -# Minimum supported versions, empty means unspecified -TOOLCHAIN_MINIMUM_VERSION_clang="3.2" -TOOLCHAIN_MINIMUM_VERSION_gcc="4.7" -TOOLCHAIN_MINIMUM_VERSION_microsoft="16.00.30319.01" # VS2010 -TOOLCHAIN_MINIMUM_VERSION_solstudio="5.13" -TOOLCHAIN_MINIMUM_VERSION_xlc="" - -# Prepare the system so that TOOLCHAIN_CHECK_COMPILER_VERSION can be called. -# Must have CC_VERSION_NUMBER and CXX_VERSION_NUMBER. -# $1 - optional variable prefix for compiler and version variables (BUILD_) -# $2 - optional variable prefix for comparable variable (OPENJDK_BUILD_) - - -# Check if the configured compiler (C and C++) is of a specific version or -# newer. TOOLCHAIN_PREPARE_FOR_VERSION_COMPARISONS must have been called before. -# -# Arguments: -# VERSION: The version string to check against the found version -# IF_AT_LEAST: block to run if the compiler is at least this version (>=) -# IF_OLDER_THAN: block to run if the compiler is older than this version (<) -# PREFIX: Optional variable prefix for compiler to compare version for (OPENJDK_BUILD_) - - - - -# Setup a number of variables describing how native output files are -# named on this platform/toolchain. - - -# Determine which toolchain type to use, and make sure it is valid for this -# platform. Setup various information about the selected toolchain. - - -# Before we start detecting the toolchain executables, we might need some -# special setup, e.g. additional paths etc. - - -# Restore path, etc - - -# Check if a compiler is of the toolchain type we expect, and save the version -# information from it. If the compiler does not match the expected type, -# this function will abort using AC_MSG_ERROR. If it matches, the version will -# be stored in CC_VERSION_NUMBER/CXX_VERSION_NUMBER (as a dotted number), and -# the full version string in CC_VERSION_STRING/CXX_VERSION_STRING. -# -# $1 = compiler to test (CC or CXX) -# $2 = human readable name of compiler (C or C++) - - -# Try to locate the given C or C++ compiler in the path, or otherwise. -# -# $1 = compiler to test (CC or CXX) -# $2 = human readable name of compiler (C or C++) -# $3 = compiler name to search for - - -# Detect the core components of the toolchain, i.e. the compilers (CC and CXX), -# preprocessor (CPP and CXXCPP), the linker (LD), the assembler (AS) and the -# archiver (AR). Verify that the compilers are correct according to the -# toolchain type. - - -# Setup additional tools that is considered a part of the toolchain, but not the -# core part. Many of these are highly platform-specific and do not exist, -# and/or are not needed on all platforms. - - -# Setup the build tools (i.e, the compiler and linker used to build programs -# that should be run on the build platform, not the target platform, as a build -# helper). Since the non-cross-compile case uses the normal, target compilers -# for this, we can only do this after these have been setup. - - -# Do some additional checks on the detected tools. - - -# Setup the JTReg Regression Test Harness. - - -# Setup the JIB dependency resolver - - -# -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -################################################################################ -# The order of these defines the priority by which we try to find them. -VALID_VS_VERSIONS="2013 2012 2010" - -VS_DESCRIPTION_2010="Microsoft Visual Studio 2010" -VS_VERSION_INTERNAL_2010=100 -VS_MSVCR_2010=msvcr100.dll -# We don't use msvcp on Visual Studio 2010 -#VS_MSVCP_2010=msvcp100.dll -VS_ENVVAR_2010="VS100COMNTOOLS" -VS_VS_INSTALLDIR_2010="Microsoft Visual Studio 10.0" -VS_SDK_INSTALLDIR_2010="Microsoft SDKs/Windows/v7.1" -VS_VS_PLATFORM_NAME_2010="v100" -VS_SDK_PLATFORM_NAME_2010="Windows7.1SDK" - -VS_DESCRIPTION_2012="Microsoft Visual Studio 2012" -VS_VERSION_INTERNAL_2012=110 -VS_MSVCR_2012=msvcr110.dll -VS_MSVCP_2012=msvcp110.dll -VS_ENVVAR_2012="VS110COMNTOOLS" -VS_VS_INSTALLDIR_2012="Microsoft Visual Studio 11.0" -VS_SDK_INSTALLDIR_2012= -VS_VS_PLATFORM_NAME_2012="v110" -VS_SDK_PLATFORM_NAME_2012= - -VS_DESCRIPTION_2013="Microsoft Visual Studio 2013" -VS_VERSION_INTERNAL_2013=120 -VS_MSVCR_2013=msvcr120.dll -VS_MSVCP_2013=msvcp120.dll -VS_ENVVAR_2013="VS120COMNTOOLS" -VS_VS_INSTALLDIR_2013="Microsoft Visual Studio 12.0" -VS_SDK_INSTALLDIR_2013= -VS_VS_PLATFORM_NAME_2013="v120" -VS_SDK_PLATFORM_NAME_2013= - -################################################################################ - - - -################################################################################ - - - -################################################################################ -# Finds the bat or cmd file in Visual Studio or the SDK that sets up a proper -# build environment and assigns it to VS_ENV_CMD - - -################################################################################ - - - -################################################################################ -# Check if the VS env variables were setup prior to running configure. -# If not, then find vcvarsall.bat and run it automatically, and integrate -# the set env variables into the spec file. - - - - - - - - - - - - - - -# This line needs to be here, verbatim, after all includes and the dummy hook -# definitions. It is replaced with custom functionality when building -# custom sources. -#CUSTOM_AUTOCONF_INCLUDE - -# Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1516225089 - -############################################################################### -# -# Initialization / Boot-strapping -# -# The bootstrapping process needs to solve the "chicken or the egg" problem, -# thus it jumps back and forth, each time gaining something needed later on. -# -############################################################################### - -# If we are requested to print additional help, do that and then exit. -# This must be the very first call. - - if test "x$CONFIGURE_PRINT_ADDITIONAL_HELP" != x; then - - # Print available toolchains - $PRINTF "The following toolchains are available as arguments to --with-toolchain-type.\n" - $PRINTF "Which are valid to use depends on the build platform.\n" - for toolchain in $VALID_TOOLCHAINS_all; do - # Use indirect variable referencing - toolchain_var_name=TOOLCHAIN_DESCRIPTION_$toolchain - TOOLCHAIN_DESCRIPTION=${!toolchain_var_name} - $PRINTF " %-10s %s\n" $toolchain "$TOOLCHAIN_DESCRIPTION" - done - $PRINTF "\n" - - # Print available jvm features - $PRINTF "The following JVM features are available as arguments to --with-jvm-features.\n" - $PRINTF "Which are valid to use depends on the target platform.\n " - $PRINTF "%s " $VALID_JVM_FEATURES - $PRINTF "\n" - - # And now exit directly - exit 0 - fi - - -# Basic initialization that must happen first of all in the normal process. - - # Save the original command line. This is passed to us by the wrapper configure script. - - # Save the path variable before it gets changed - ORIGINAL_PATH="$PATH" - - DATE_WHEN_CONFIGURED=`LANG=C date` - - { $as_echo "$as_me:${as_lineno-$LINENO}: Configuration created at $DATE_WHEN_CONFIGURED." >&5 -$as_echo "$as_me: Configuration created at $DATE_WHEN_CONFIGURED." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: configure script generated at timestamp $DATE_WHEN_GENERATED." >&5 -$as_echo "$as_me: configure script generated at timestamp $DATE_WHEN_GENERATED." >&6;} - - - # Start with tools that do not need have cross compilation support - # and can be expected to be found in the default PATH. These tools are - # used by configure. - - # First are all the simple required tools. - - - - # Publish this variable in the help. - - - if [ -z "${BASENAME+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in basename -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BASENAME+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BASENAME in - [\\/]* | ?:[\\/]*) - ac_cv_path_BASENAME="$BASENAME" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BASENAME="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BASENAME=$ac_cv_path_BASENAME -if test -n "$BASENAME"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BASENAME" >&5 -$as_echo "$BASENAME" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$BASENAME" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !BASENAME! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!BASENAME!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xBASENAME" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of BASENAME from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of BASENAME from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in basename -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BASENAME+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BASENAME in - [\\/]* | ?:[\\/]*) - ac_cv_path_BASENAME="$BASENAME" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BASENAME="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BASENAME=$ac_cv_path_BASENAME -if test -n "$BASENAME"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BASENAME" >&5 -$as_echo "$BASENAME" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$BASENAME" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$BASENAME" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool BASENAME= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool BASENAME= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BASENAME" >&5 -$as_echo_n "checking for BASENAME... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$BASENAME" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool BASENAME=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool BASENAME=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BASENAME+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BASENAME in - [\\/]* | ?:[\\/]*) - ac_cv_path_BASENAME="$BASENAME" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BASENAME="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BASENAME=$ac_cv_path_BASENAME -if test -n "$BASENAME"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BASENAME" >&5 -$as_echo "$BASENAME" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$BASENAME" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool BASENAME=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool BASENAME=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BASENAME" >&5 -$as_echo_n "checking for BASENAME... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool BASENAME=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$BASENAME" = x; then - as_fn_error $? "Could not find required tool for BASENAME" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${BASH+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in bash -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BASH+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BASH in - [\\/]* | ?:[\\/]*) - ac_cv_path_BASH="$BASH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BASH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BASH=$ac_cv_path_BASH -if test -n "$BASH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BASH" >&5 -$as_echo "$BASH" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$BASH" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !BASH! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!BASH!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xBASH" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of BASH from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of BASH from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in bash -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BASH+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BASH in - [\\/]* | ?:[\\/]*) - ac_cv_path_BASH="$BASH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BASH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BASH=$ac_cv_path_BASH -if test -n "$BASH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BASH" >&5 -$as_echo "$BASH" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$BASH" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$BASH" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool BASH= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool BASH= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BASH" >&5 -$as_echo_n "checking for BASH... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$BASH" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool BASH=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool BASH=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BASH+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BASH in - [\\/]* | ?:[\\/]*) - ac_cv_path_BASH="$BASH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BASH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BASH=$ac_cv_path_BASH -if test -n "$BASH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BASH" >&5 -$as_echo "$BASH" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$BASH" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool BASH=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool BASH=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BASH" >&5 -$as_echo_n "checking for BASH... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool BASH=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$BASH" = x; then - as_fn_error $? "Could not find required tool for BASH" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${CAT+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in cat -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CAT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CAT in - [\\/]* | ?:[\\/]*) - ac_cv_path_CAT="$CAT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CAT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CAT=$ac_cv_path_CAT -if test -n "$CAT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CAT" >&5 -$as_echo "$CAT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CAT" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !CAT! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!CAT!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xCAT" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of CAT from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of CAT from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in cat -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CAT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CAT in - [\\/]* | ?:[\\/]*) - ac_cv_path_CAT="$CAT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CAT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CAT=$ac_cv_path_CAT -if test -n "$CAT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CAT" >&5 -$as_echo "$CAT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CAT" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$CAT" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool CAT= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool CAT= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CAT" >&5 -$as_echo_n "checking for CAT... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$CAT" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool CAT=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool CAT=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CAT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CAT in - [\\/]* | ?:[\\/]*) - ac_cv_path_CAT="$CAT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CAT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CAT=$ac_cv_path_CAT -if test -n "$CAT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CAT" >&5 -$as_echo "$CAT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$CAT" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool CAT=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool CAT=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CAT" >&5 -$as_echo_n "checking for CAT... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool CAT=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$CAT" = x; then - as_fn_error $? "Could not find required tool for CAT" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${CHMOD+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in chmod -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CHMOD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CHMOD in - [\\/]* | ?:[\\/]*) - ac_cv_path_CHMOD="$CHMOD" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CHMOD="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CHMOD=$ac_cv_path_CHMOD -if test -n "$CHMOD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHMOD" >&5 -$as_echo "$CHMOD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CHMOD" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !CHMOD! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!CHMOD!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xCHMOD" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of CHMOD from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of CHMOD from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in chmod -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CHMOD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CHMOD in - [\\/]* | ?:[\\/]*) - ac_cv_path_CHMOD="$CHMOD" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CHMOD="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CHMOD=$ac_cv_path_CHMOD -if test -n "$CHMOD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHMOD" >&5 -$as_echo "$CHMOD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CHMOD" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$CHMOD" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool CHMOD= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool CHMOD= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CHMOD" >&5 -$as_echo_n "checking for CHMOD... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$CHMOD" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool CHMOD=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool CHMOD=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CHMOD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CHMOD in - [\\/]* | ?:[\\/]*) - ac_cv_path_CHMOD="$CHMOD" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CHMOD="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CHMOD=$ac_cv_path_CHMOD -if test -n "$CHMOD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHMOD" >&5 -$as_echo "$CHMOD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$CHMOD" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool CHMOD=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool CHMOD=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CHMOD" >&5 -$as_echo_n "checking for CHMOD... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool CHMOD=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$CHMOD" = x; then - as_fn_error $? "Could not find required tool for CHMOD" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${CMP+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in cmp -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CMP in - [\\/]* | ?:[\\/]*) - ac_cv_path_CMP="$CMP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CMP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CMP=$ac_cv_path_CMP -if test -n "$CMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CMP" >&5 -$as_echo "$CMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CMP" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !CMP! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!CMP!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xCMP" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of CMP from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of CMP from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in cmp -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CMP in - [\\/]* | ?:[\\/]*) - ac_cv_path_CMP="$CMP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CMP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CMP=$ac_cv_path_CMP -if test -n "$CMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CMP" >&5 -$as_echo "$CMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CMP" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$CMP" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool CMP= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool CMP= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CMP" >&5 -$as_echo_n "checking for CMP... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$CMP" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool CMP=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool CMP=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CMP in - [\\/]* | ?:[\\/]*) - ac_cv_path_CMP="$CMP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CMP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CMP=$ac_cv_path_CMP -if test -n "$CMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CMP" >&5 -$as_echo "$CMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$CMP" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool CMP=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool CMP=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CMP" >&5 -$as_echo_n "checking for CMP... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool CMP=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$CMP" = x; then - as_fn_error $? "Could not find required tool for CMP" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${COMM+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in comm -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_COMM+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $COMM in - [\\/]* | ?:[\\/]*) - ac_cv_path_COMM="$COMM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_COMM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -COMM=$ac_cv_path_COMM -if test -n "$COMM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $COMM" >&5 -$as_echo "$COMM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$COMM" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !COMM! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!COMM!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xCOMM" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of COMM from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of COMM from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in comm -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_COMM+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $COMM in - [\\/]* | ?:[\\/]*) - ac_cv_path_COMM="$COMM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_COMM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -COMM=$ac_cv_path_COMM -if test -n "$COMM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $COMM" >&5 -$as_echo "$COMM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$COMM" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$COMM" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool COMM= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool COMM= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for COMM" >&5 -$as_echo_n "checking for COMM... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$COMM" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool COMM=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool COMM=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_COMM+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $COMM in - [\\/]* | ?:[\\/]*) - ac_cv_path_COMM="$COMM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_COMM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -COMM=$ac_cv_path_COMM -if test -n "$COMM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $COMM" >&5 -$as_echo "$COMM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$COMM" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool COMM=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool COMM=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for COMM" >&5 -$as_echo_n "checking for COMM... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool COMM=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$COMM" = x; then - as_fn_error $? "Could not find required tool for COMM" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${CP+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in cp -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CP in - [\\/]* | ?:[\\/]*) - ac_cv_path_CP="$CP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CP=$ac_cv_path_CP -if test -n "$CP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CP" >&5 -$as_echo "$CP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CP" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !CP! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!CP!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xCP" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of CP from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of CP from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in cp -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CP in - [\\/]* | ?:[\\/]*) - ac_cv_path_CP="$CP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CP=$ac_cv_path_CP -if test -n "$CP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CP" >&5 -$as_echo "$CP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CP" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$CP" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool CP= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool CP= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CP" >&5 -$as_echo_n "checking for CP... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$CP" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool CP=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool CP=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CP in - [\\/]* | ?:[\\/]*) - ac_cv_path_CP="$CP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CP=$ac_cv_path_CP -if test -n "$CP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CP" >&5 -$as_echo "$CP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$CP" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool CP=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool CP=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CP" >&5 -$as_echo_n "checking for CP... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool CP=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$CP" = x; then - as_fn_error $? "Could not find required tool for CP" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${CUT+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in cut -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CUT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CUT in - [\\/]* | ?:[\\/]*) - ac_cv_path_CUT="$CUT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CUT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CUT=$ac_cv_path_CUT -if test -n "$CUT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUT" >&5 -$as_echo "$CUT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CUT" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !CUT! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!CUT!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xCUT" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of CUT from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of CUT from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in cut -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CUT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CUT in - [\\/]* | ?:[\\/]*) - ac_cv_path_CUT="$CUT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CUT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CUT=$ac_cv_path_CUT -if test -n "$CUT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUT" >&5 -$as_echo "$CUT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CUT" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$CUT" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool CUT= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool CUT= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CUT" >&5 -$as_echo_n "checking for CUT... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$CUT" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool CUT=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool CUT=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CUT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CUT in - [\\/]* | ?:[\\/]*) - ac_cv_path_CUT="$CUT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CUT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CUT=$ac_cv_path_CUT -if test -n "$CUT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUT" >&5 -$as_echo "$CUT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$CUT" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool CUT=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool CUT=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CUT" >&5 -$as_echo_n "checking for CUT... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool CUT=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$CUT" = x; then - as_fn_error $? "Could not find required tool for CUT" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${DATE+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in date -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_DATE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DATE in - [\\/]* | ?:[\\/]*) - ac_cv_path_DATE="$DATE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DATE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DATE=$ac_cv_path_DATE -if test -n "$DATE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DATE" >&5 -$as_echo "$DATE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$DATE" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !DATE! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!DATE!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xDATE" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of DATE from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of DATE from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in date -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_DATE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DATE in - [\\/]* | ?:[\\/]*) - ac_cv_path_DATE="$DATE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DATE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DATE=$ac_cv_path_DATE -if test -n "$DATE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DATE" >&5 -$as_echo "$DATE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$DATE" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$DATE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool DATE= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool DATE= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DATE" >&5 -$as_echo_n "checking for DATE... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$DATE" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool DATE=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool DATE=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_DATE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DATE in - [\\/]* | ?:[\\/]*) - ac_cv_path_DATE="$DATE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DATE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DATE=$ac_cv_path_DATE -if test -n "$DATE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DATE" >&5 -$as_echo "$DATE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$DATE" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool DATE=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool DATE=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DATE" >&5 -$as_echo_n "checking for DATE... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool DATE=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$DATE" = x; then - as_fn_error $? "Could not find required tool for DATE" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${DIFF+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in gdiff diff -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_DIFF+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DIFF in - [\\/]* | ?:[\\/]*) - ac_cv_path_DIFF="$DIFF" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DIFF="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DIFF=$ac_cv_path_DIFF -if test -n "$DIFF"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DIFF" >&5 -$as_echo "$DIFF" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$DIFF" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !DIFF! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!DIFF!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xDIFF" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of DIFF from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of DIFF from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in gdiff diff -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_DIFF+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DIFF in - [\\/]* | ?:[\\/]*) - ac_cv_path_DIFF="$DIFF" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DIFF="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DIFF=$ac_cv_path_DIFF -if test -n "$DIFF"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DIFF" >&5 -$as_echo "$DIFF" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$DIFF" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$DIFF" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool DIFF= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool DIFF= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DIFF" >&5 -$as_echo_n "checking for DIFF... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$DIFF" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool DIFF=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool DIFF=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_DIFF+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DIFF in - [\\/]* | ?:[\\/]*) - ac_cv_path_DIFF="$DIFF" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DIFF="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DIFF=$ac_cv_path_DIFF -if test -n "$DIFF"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DIFF" >&5 -$as_echo "$DIFF" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$DIFF" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool DIFF=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool DIFF=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DIFF" >&5 -$as_echo_n "checking for DIFF... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool DIFF=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$DIFF" = x; then - as_fn_error $? "Could not find required tool for DIFF" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${DIRNAME+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in dirname -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_DIRNAME+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DIRNAME in - [\\/]* | ?:[\\/]*) - ac_cv_path_DIRNAME="$DIRNAME" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DIRNAME="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DIRNAME=$ac_cv_path_DIRNAME -if test -n "$DIRNAME"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DIRNAME" >&5 -$as_echo "$DIRNAME" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$DIRNAME" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !DIRNAME! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!DIRNAME!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xDIRNAME" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of DIRNAME from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of DIRNAME from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in dirname -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_DIRNAME+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DIRNAME in - [\\/]* | ?:[\\/]*) - ac_cv_path_DIRNAME="$DIRNAME" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DIRNAME="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DIRNAME=$ac_cv_path_DIRNAME -if test -n "$DIRNAME"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DIRNAME" >&5 -$as_echo "$DIRNAME" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$DIRNAME" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$DIRNAME" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool DIRNAME= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool DIRNAME= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DIRNAME" >&5 -$as_echo_n "checking for DIRNAME... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$DIRNAME" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool DIRNAME=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool DIRNAME=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_DIRNAME+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DIRNAME in - [\\/]* | ?:[\\/]*) - ac_cv_path_DIRNAME="$DIRNAME" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DIRNAME="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DIRNAME=$ac_cv_path_DIRNAME -if test -n "$DIRNAME"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DIRNAME" >&5 -$as_echo "$DIRNAME" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$DIRNAME" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool DIRNAME=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool DIRNAME=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DIRNAME" >&5 -$as_echo_n "checking for DIRNAME... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool DIRNAME=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$DIRNAME" = x; then - as_fn_error $? "Could not find required tool for DIRNAME" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${ECHO+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in echo -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ECHO+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ECHO in - [\\/]* | ?:[\\/]*) - ac_cv_path_ECHO="$ECHO" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ECHO="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ECHO=$ac_cv_path_ECHO -if test -n "$ECHO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ECHO" >&5 -$as_echo "$ECHO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ECHO" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !ECHO! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!ECHO!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xECHO" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of ECHO from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of ECHO from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in echo -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ECHO+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ECHO in - [\\/]* | ?:[\\/]*) - ac_cv_path_ECHO="$ECHO" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ECHO="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ECHO=$ac_cv_path_ECHO -if test -n "$ECHO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ECHO" >&5 -$as_echo "$ECHO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ECHO" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$ECHO" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool ECHO= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool ECHO= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ECHO" >&5 -$as_echo_n "checking for ECHO... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$ECHO" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool ECHO=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool ECHO=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ECHO+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ECHO in - [\\/]* | ?:[\\/]*) - ac_cv_path_ECHO="$ECHO" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ECHO="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ECHO=$ac_cv_path_ECHO -if test -n "$ECHO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ECHO" >&5 -$as_echo "$ECHO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$ECHO" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool ECHO=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool ECHO=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ECHO" >&5 -$as_echo_n "checking for ECHO... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool ECHO=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$ECHO" = x; then - as_fn_error $? "Could not find required tool for ECHO" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${EXPR+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in expr -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_EXPR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $EXPR in - [\\/]* | ?:[\\/]*) - ac_cv_path_EXPR="$EXPR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_EXPR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -EXPR=$ac_cv_path_EXPR -if test -n "$EXPR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $EXPR" >&5 -$as_echo "$EXPR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$EXPR" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !EXPR! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!EXPR!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xEXPR" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of EXPR from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of EXPR from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in expr -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_EXPR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $EXPR in - [\\/]* | ?:[\\/]*) - ac_cv_path_EXPR="$EXPR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_EXPR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -EXPR=$ac_cv_path_EXPR -if test -n "$EXPR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $EXPR" >&5 -$as_echo "$EXPR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$EXPR" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$EXPR" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool EXPR= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool EXPR= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EXPR" >&5 -$as_echo_n "checking for EXPR... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$EXPR" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool EXPR=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool EXPR=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_EXPR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $EXPR in - [\\/]* | ?:[\\/]*) - ac_cv_path_EXPR="$EXPR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_EXPR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -EXPR=$ac_cv_path_EXPR -if test -n "$EXPR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $EXPR" >&5 -$as_echo "$EXPR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$EXPR" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool EXPR=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool EXPR=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EXPR" >&5 -$as_echo_n "checking for EXPR... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool EXPR=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$EXPR" = x; then - as_fn_error $? "Could not find required tool for EXPR" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${FILE+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in file -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_FILE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $FILE in - [\\/]* | ?:[\\/]*) - ac_cv_path_FILE="$FILE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_FILE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -FILE=$ac_cv_path_FILE -if test -n "$FILE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FILE" >&5 -$as_echo "$FILE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$FILE" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !FILE! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!FILE!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xFILE" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of FILE from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of FILE from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in file -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_FILE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $FILE in - [\\/]* | ?:[\\/]*) - ac_cv_path_FILE="$FILE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_FILE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -FILE=$ac_cv_path_FILE -if test -n "$FILE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FILE" >&5 -$as_echo "$FILE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$FILE" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$FILE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool FILE= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool FILE= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FILE" >&5 -$as_echo_n "checking for FILE... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$FILE" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool FILE=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool FILE=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_FILE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $FILE in - [\\/]* | ?:[\\/]*) - ac_cv_path_FILE="$FILE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_FILE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -FILE=$ac_cv_path_FILE -if test -n "$FILE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FILE" >&5 -$as_echo "$FILE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$FILE" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool FILE=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool FILE=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FILE" >&5 -$as_echo_n "checking for FILE... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool FILE=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$FILE" = x; then - as_fn_error $? "Could not find required tool for FILE" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${FIND+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in find -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_FIND+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $FIND in - [\\/]* | ?:[\\/]*) - ac_cv_path_FIND="$FIND" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_FIND="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -FIND=$ac_cv_path_FIND -if test -n "$FIND"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FIND" >&5 -$as_echo "$FIND" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$FIND" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !FIND! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!FIND!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xFIND" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of FIND from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of FIND from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in find -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_FIND+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $FIND in - [\\/]* | ?:[\\/]*) - ac_cv_path_FIND="$FIND" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_FIND="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -FIND=$ac_cv_path_FIND -if test -n "$FIND"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FIND" >&5 -$as_echo "$FIND" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$FIND" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$FIND" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool FIND= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool FIND= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FIND" >&5 -$as_echo_n "checking for FIND... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$FIND" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool FIND=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool FIND=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_FIND+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $FIND in - [\\/]* | ?:[\\/]*) - ac_cv_path_FIND="$FIND" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_FIND="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -FIND=$ac_cv_path_FIND -if test -n "$FIND"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FIND" >&5 -$as_echo "$FIND" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$FIND" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool FIND=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool FIND=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FIND" >&5 -$as_echo_n "checking for FIND... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool FIND=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$FIND" = x; then - as_fn_error $? "Could not find required tool for FIND" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${HEAD+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in head -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_HEAD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $HEAD in - [\\/]* | ?:[\\/]*) - ac_cv_path_HEAD="$HEAD" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_HEAD="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -HEAD=$ac_cv_path_HEAD -if test -n "$HEAD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HEAD" >&5 -$as_echo "$HEAD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$HEAD" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !HEAD! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!HEAD!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xHEAD" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of HEAD from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of HEAD from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in head -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_HEAD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $HEAD in - [\\/]* | ?:[\\/]*) - ac_cv_path_HEAD="$HEAD" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_HEAD="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -HEAD=$ac_cv_path_HEAD -if test -n "$HEAD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HEAD" >&5 -$as_echo "$HEAD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$HEAD" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$HEAD" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool HEAD= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool HEAD= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HEAD" >&5 -$as_echo_n "checking for HEAD... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$HEAD" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool HEAD=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool HEAD=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_HEAD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $HEAD in - [\\/]* | ?:[\\/]*) - ac_cv_path_HEAD="$HEAD" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_HEAD="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -HEAD=$ac_cv_path_HEAD -if test -n "$HEAD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HEAD" >&5 -$as_echo "$HEAD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$HEAD" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool HEAD=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool HEAD=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HEAD" >&5 -$as_echo_n "checking for HEAD... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool HEAD=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$HEAD" = x; then - as_fn_error $? "Could not find required tool for HEAD" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${GUNZIP+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in gunzip -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GUNZIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $GUNZIP in - [\\/]* | ?:[\\/]*) - ac_cv_path_GUNZIP="$GUNZIP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GUNZIP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -GUNZIP=$ac_cv_path_GUNZIP -if test -n "$GUNZIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GUNZIP" >&5 -$as_echo "$GUNZIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$GUNZIP" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !GUNZIP! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!GUNZIP!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xGUNZIP" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of GUNZIP from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of GUNZIP from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in gunzip -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GUNZIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $GUNZIP in - [\\/]* | ?:[\\/]*) - ac_cv_path_GUNZIP="$GUNZIP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GUNZIP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -GUNZIP=$ac_cv_path_GUNZIP -if test -n "$GUNZIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GUNZIP" >&5 -$as_echo "$GUNZIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$GUNZIP" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$GUNZIP" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool GUNZIP= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool GUNZIP= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GUNZIP" >&5 -$as_echo_n "checking for GUNZIP... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$GUNZIP" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool GUNZIP=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool GUNZIP=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GUNZIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $GUNZIP in - [\\/]* | ?:[\\/]*) - ac_cv_path_GUNZIP="$GUNZIP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GUNZIP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -GUNZIP=$ac_cv_path_GUNZIP -if test -n "$GUNZIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GUNZIP" >&5 -$as_echo "$GUNZIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$GUNZIP" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool GUNZIP=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool GUNZIP=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GUNZIP" >&5 -$as_echo_n "checking for GUNZIP... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool GUNZIP=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$GUNZIP" = x; then - as_fn_error $? "Could not find required tool for GUNZIP" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${GZIP+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in pigz gzip -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GZIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $GZIP in - [\\/]* | ?:[\\/]*) - ac_cv_path_GZIP="$GZIP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GZIP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -GZIP=$ac_cv_path_GZIP -if test -n "$GZIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GZIP" >&5 -$as_echo "$GZIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$GZIP" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !GZIP! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!GZIP!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xGZIP" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of GZIP from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of GZIP from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in pigz gzip -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GZIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $GZIP in - [\\/]* | ?:[\\/]*) - ac_cv_path_GZIP="$GZIP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GZIP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -GZIP=$ac_cv_path_GZIP -if test -n "$GZIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GZIP" >&5 -$as_echo "$GZIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$GZIP" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$GZIP" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool GZIP= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool GZIP= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GZIP" >&5 -$as_echo_n "checking for GZIP... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$GZIP" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool GZIP=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool GZIP=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GZIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $GZIP in - [\\/]* | ?:[\\/]*) - ac_cv_path_GZIP="$GZIP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GZIP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -GZIP=$ac_cv_path_GZIP -if test -n "$GZIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GZIP" >&5 -$as_echo "$GZIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$GZIP" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool GZIP=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool GZIP=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GZIP" >&5 -$as_echo_n "checking for GZIP... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool GZIP=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$GZIP" = x; then - as_fn_error $? "Could not find required tool for GZIP" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${LN+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in ln -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_LN+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $LN in - [\\/]* | ?:[\\/]*) - ac_cv_path_LN="$LN" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_LN="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -LN=$ac_cv_path_LN -if test -n "$LN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LN" >&5 -$as_echo "$LN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$LN" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !LN! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!LN!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xLN" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of LN from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of LN from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in ln -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_LN+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $LN in - [\\/]* | ?:[\\/]*) - ac_cv_path_LN="$LN" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_LN="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -LN=$ac_cv_path_LN -if test -n "$LN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LN" >&5 -$as_echo "$LN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$LN" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$LN" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool LN= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool LN= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LN" >&5 -$as_echo_n "checking for LN... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$LN" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool LN=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool LN=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_LN+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $LN in - [\\/]* | ?:[\\/]*) - ac_cv_path_LN="$LN" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_LN="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -LN=$ac_cv_path_LN -if test -n "$LN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LN" >&5 -$as_echo "$LN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$LN" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool LN=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool LN=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LN" >&5 -$as_echo_n "checking for LN... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool LN=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$LN" = x; then - as_fn_error $? "Could not find required tool for LN" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${LS+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in ls -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_LS+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $LS in - [\\/]* | ?:[\\/]*) - ac_cv_path_LS="$LS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_LS="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -LS=$ac_cv_path_LS -if test -n "$LS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LS" >&5 -$as_echo "$LS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$LS" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !LS! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!LS!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xLS" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of LS from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of LS from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in ls -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_LS+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $LS in - [\\/]* | ?:[\\/]*) - ac_cv_path_LS="$LS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_LS="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -LS=$ac_cv_path_LS -if test -n "$LS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LS" >&5 -$as_echo "$LS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$LS" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$LS" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool LS= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool LS= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LS" >&5 -$as_echo_n "checking for LS... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$LS" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool LS=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool LS=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_LS+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $LS in - [\\/]* | ?:[\\/]*) - ac_cv_path_LS="$LS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_LS="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -LS=$ac_cv_path_LS -if test -n "$LS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LS" >&5 -$as_echo "$LS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$LS" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool LS=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool LS=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LS" >&5 -$as_echo_n "checking for LS... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool LS=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$LS" = x; then - as_fn_error $? "Could not find required tool for LS" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${MKDIR+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in mkdir -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MKDIR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MKDIR in - [\\/]* | ?:[\\/]*) - ac_cv_path_MKDIR="$MKDIR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_MKDIR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -MKDIR=$ac_cv_path_MKDIR -if test -n "$MKDIR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR" >&5 -$as_echo "$MKDIR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$MKDIR" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !MKDIR! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!MKDIR!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xMKDIR" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of MKDIR from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of MKDIR from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in mkdir -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MKDIR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MKDIR in - [\\/]* | ?:[\\/]*) - ac_cv_path_MKDIR="$MKDIR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_MKDIR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -MKDIR=$ac_cv_path_MKDIR -if test -n "$MKDIR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR" >&5 -$as_echo "$MKDIR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$MKDIR" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$MKDIR" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool MKDIR= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool MKDIR= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MKDIR" >&5 -$as_echo_n "checking for MKDIR... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$MKDIR" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool MKDIR=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool MKDIR=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MKDIR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MKDIR in - [\\/]* | ?:[\\/]*) - ac_cv_path_MKDIR="$MKDIR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_MKDIR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -MKDIR=$ac_cv_path_MKDIR -if test -n "$MKDIR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR" >&5 -$as_echo "$MKDIR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$MKDIR" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool MKDIR=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool MKDIR=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MKDIR" >&5 -$as_echo_n "checking for MKDIR... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool MKDIR=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$MKDIR" = x; then - as_fn_error $? "Could not find required tool for MKDIR" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${MKTEMP+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in mktemp -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MKTEMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MKTEMP in - [\\/]* | ?:[\\/]*) - ac_cv_path_MKTEMP="$MKTEMP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_MKTEMP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -MKTEMP=$ac_cv_path_MKTEMP -if test -n "$MKTEMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKTEMP" >&5 -$as_echo "$MKTEMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$MKTEMP" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !MKTEMP! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!MKTEMP!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xMKTEMP" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of MKTEMP from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of MKTEMP from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in mktemp -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MKTEMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MKTEMP in - [\\/]* | ?:[\\/]*) - ac_cv_path_MKTEMP="$MKTEMP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_MKTEMP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -MKTEMP=$ac_cv_path_MKTEMP -if test -n "$MKTEMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKTEMP" >&5 -$as_echo "$MKTEMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$MKTEMP" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$MKTEMP" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool MKTEMP= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool MKTEMP= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MKTEMP" >&5 -$as_echo_n "checking for MKTEMP... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$MKTEMP" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool MKTEMP=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool MKTEMP=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MKTEMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MKTEMP in - [\\/]* | ?:[\\/]*) - ac_cv_path_MKTEMP="$MKTEMP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_MKTEMP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -MKTEMP=$ac_cv_path_MKTEMP -if test -n "$MKTEMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKTEMP" >&5 -$as_echo "$MKTEMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$MKTEMP" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool MKTEMP=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool MKTEMP=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MKTEMP" >&5 -$as_echo_n "checking for MKTEMP... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool MKTEMP=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$MKTEMP" = x; then - as_fn_error $? "Could not find required tool for MKTEMP" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${MV+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in mv -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MV+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MV in - [\\/]* | ?:[\\/]*) - ac_cv_path_MV="$MV" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_MV="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -MV=$ac_cv_path_MV -if test -n "$MV"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MV" >&5 -$as_echo "$MV" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$MV" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !MV! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!MV!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xMV" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of MV from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of MV from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in mv -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MV+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MV in - [\\/]* | ?:[\\/]*) - ac_cv_path_MV="$MV" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_MV="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -MV=$ac_cv_path_MV -if test -n "$MV"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MV" >&5 -$as_echo "$MV" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$MV" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$MV" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool MV= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool MV= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MV" >&5 -$as_echo_n "checking for MV... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$MV" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool MV=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool MV=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MV+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MV in - [\\/]* | ?:[\\/]*) - ac_cv_path_MV="$MV" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_MV="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -MV=$ac_cv_path_MV -if test -n "$MV"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MV" >&5 -$as_echo "$MV" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$MV" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool MV=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool MV=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MV" >&5 -$as_echo_n "checking for MV... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool MV=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$MV" = x; then - as_fn_error $? "Could not find required tool for MV" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${NAWK+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in nawk gawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_NAWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $NAWK in - [\\/]* | ?:[\\/]*) - ac_cv_path_NAWK="$NAWK" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_NAWK="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -NAWK=$ac_cv_path_NAWK -if test -n "$NAWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NAWK" >&5 -$as_echo "$NAWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$NAWK" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !NAWK! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!NAWK!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xNAWK" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of NAWK from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of NAWK from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in nawk gawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_NAWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $NAWK in - [\\/]* | ?:[\\/]*) - ac_cv_path_NAWK="$NAWK" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_NAWK="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -NAWK=$ac_cv_path_NAWK -if test -n "$NAWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NAWK" >&5 -$as_echo "$NAWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$NAWK" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$NAWK" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool NAWK= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool NAWK= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NAWK" >&5 -$as_echo_n "checking for NAWK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$NAWK" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool NAWK=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool NAWK=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_NAWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $NAWK in - [\\/]* | ?:[\\/]*) - ac_cv_path_NAWK="$NAWK" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_NAWK="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -NAWK=$ac_cv_path_NAWK -if test -n "$NAWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NAWK" >&5 -$as_echo "$NAWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$NAWK" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool NAWK=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool NAWK=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NAWK" >&5 -$as_echo_n "checking for NAWK... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool NAWK=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$NAWK" = x; then - as_fn_error $? "Could not find required tool for NAWK" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${PRINTF+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in printf -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PRINTF+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PRINTF in - [\\/]* | ?:[\\/]*) - ac_cv_path_PRINTF="$PRINTF" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PRINTF="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PRINTF=$ac_cv_path_PRINTF -if test -n "$PRINTF"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PRINTF" >&5 -$as_echo "$PRINTF" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$PRINTF" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !PRINTF! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!PRINTF!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xPRINTF" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of PRINTF from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of PRINTF from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in printf -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PRINTF+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PRINTF in - [\\/]* | ?:[\\/]*) - ac_cv_path_PRINTF="$PRINTF" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PRINTF="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PRINTF=$ac_cv_path_PRINTF -if test -n "$PRINTF"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PRINTF" >&5 -$as_echo "$PRINTF" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$PRINTF" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$PRINTF" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool PRINTF= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool PRINTF= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PRINTF" >&5 -$as_echo_n "checking for PRINTF... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$PRINTF" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool PRINTF=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool PRINTF=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PRINTF+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PRINTF in - [\\/]* | ?:[\\/]*) - ac_cv_path_PRINTF="$PRINTF" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PRINTF="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PRINTF=$ac_cv_path_PRINTF -if test -n "$PRINTF"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PRINTF" >&5 -$as_echo "$PRINTF" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$PRINTF" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool PRINTF=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool PRINTF=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PRINTF" >&5 -$as_echo_n "checking for PRINTF... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool PRINTF=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$PRINTF" = x; then - as_fn_error $? "Could not find required tool for PRINTF" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${RM+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in rm -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_RM+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $RM in - [\\/]* | ?:[\\/]*) - ac_cv_path_RM="$RM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -RM=$ac_cv_path_RM -if test -n "$RM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RM" >&5 -$as_echo "$RM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$RM" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !RM! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!RM!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xRM" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of RM from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of RM from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in rm -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_RM+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $RM in - [\\/]* | ?:[\\/]*) - ac_cv_path_RM="$RM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -RM=$ac_cv_path_RM -if test -n "$RM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RM" >&5 -$as_echo "$RM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$RM" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$RM" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool RM= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool RM= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RM" >&5 -$as_echo_n "checking for RM... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$RM" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool RM=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool RM=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_RM+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $RM in - [\\/]* | ?:[\\/]*) - ac_cv_path_RM="$RM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -RM=$ac_cv_path_RM -if test -n "$RM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RM" >&5 -$as_echo "$RM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$RM" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool RM=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool RM=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RM" >&5 -$as_echo_n "checking for RM... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool RM=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$RM" = x; then - as_fn_error $? "Could not find required tool for RM" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${RMDIR+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in rmdir -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_RMDIR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $RMDIR in - [\\/]* | ?:[\\/]*) - ac_cv_path_RMDIR="$RMDIR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_RMDIR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -RMDIR=$ac_cv_path_RMDIR -if test -n "$RMDIR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RMDIR" >&5 -$as_echo "$RMDIR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$RMDIR" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !RMDIR! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!RMDIR!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xRMDIR" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of RMDIR from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of RMDIR from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in rmdir -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_RMDIR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $RMDIR in - [\\/]* | ?:[\\/]*) - ac_cv_path_RMDIR="$RMDIR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_RMDIR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -RMDIR=$ac_cv_path_RMDIR -if test -n "$RMDIR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RMDIR" >&5 -$as_echo "$RMDIR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$RMDIR" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$RMDIR" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool RMDIR= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool RMDIR= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RMDIR" >&5 -$as_echo_n "checking for RMDIR... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$RMDIR" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool RMDIR=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool RMDIR=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_RMDIR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $RMDIR in - [\\/]* | ?:[\\/]*) - ac_cv_path_RMDIR="$RMDIR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_RMDIR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -RMDIR=$ac_cv_path_RMDIR -if test -n "$RMDIR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RMDIR" >&5 -$as_echo "$RMDIR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$RMDIR" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool RMDIR=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool RMDIR=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RMDIR" >&5 -$as_echo_n "checking for RMDIR... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool RMDIR=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$RMDIR" = x; then - as_fn_error $? "Could not find required tool for RMDIR" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${SH+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in sh -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_SH+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $SH in - [\\/]* | ?:[\\/]*) - ac_cv_path_SH="$SH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -SH=$ac_cv_path_SH -if test -n "$SH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SH" >&5 -$as_echo "$SH" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$SH" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !SH! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!SH!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xSH" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of SH from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of SH from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in sh -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_SH+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $SH in - [\\/]* | ?:[\\/]*) - ac_cv_path_SH="$SH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -SH=$ac_cv_path_SH -if test -n "$SH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SH" >&5 -$as_echo "$SH" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$SH" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$SH" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool SH= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool SH= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SH" >&5 -$as_echo_n "checking for SH... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$SH" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool SH=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool SH=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_SH+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $SH in - [\\/]* | ?:[\\/]*) - ac_cv_path_SH="$SH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -SH=$ac_cv_path_SH -if test -n "$SH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SH" >&5 -$as_echo "$SH" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$SH" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool SH=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool SH=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SH" >&5 -$as_echo_n "checking for SH... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool SH=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$SH" = x; then - as_fn_error $? "Could not find required tool for SH" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${SORT+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in sort -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_SORT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $SORT in - [\\/]* | ?:[\\/]*) - ac_cv_path_SORT="$SORT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SORT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -SORT=$ac_cv_path_SORT -if test -n "$SORT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SORT" >&5 -$as_echo "$SORT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$SORT" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !SORT! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!SORT!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xSORT" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of SORT from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of SORT from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in sort -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_SORT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $SORT in - [\\/]* | ?:[\\/]*) - ac_cv_path_SORT="$SORT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SORT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -SORT=$ac_cv_path_SORT -if test -n "$SORT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SORT" >&5 -$as_echo "$SORT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$SORT" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$SORT" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool SORT= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool SORT= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SORT" >&5 -$as_echo_n "checking for SORT... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$SORT" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool SORT=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool SORT=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_SORT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $SORT in - [\\/]* | ?:[\\/]*) - ac_cv_path_SORT="$SORT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SORT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -SORT=$ac_cv_path_SORT -if test -n "$SORT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SORT" >&5 -$as_echo "$SORT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$SORT" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool SORT=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool SORT=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SORT" >&5 -$as_echo_n "checking for SORT... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool SORT=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$SORT" = x; then - as_fn_error $? "Could not find required tool for SORT" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${TAIL+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in tail -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TAIL+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $TAIL in - [\\/]* | ?:[\\/]*) - ac_cv_path_TAIL="$TAIL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_TAIL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -TAIL=$ac_cv_path_TAIL -if test -n "$TAIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAIL" >&5 -$as_echo "$TAIL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$TAIL" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !TAIL! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!TAIL!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xTAIL" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of TAIL from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of TAIL from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in tail -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TAIL+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $TAIL in - [\\/]* | ?:[\\/]*) - ac_cv_path_TAIL="$TAIL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_TAIL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -TAIL=$ac_cv_path_TAIL -if test -n "$TAIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAIL" >&5 -$as_echo "$TAIL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$TAIL" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$TAIL" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool TAIL= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool TAIL= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TAIL" >&5 -$as_echo_n "checking for TAIL... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$TAIL" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool TAIL=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool TAIL=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TAIL+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $TAIL in - [\\/]* | ?:[\\/]*) - ac_cv_path_TAIL="$TAIL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_TAIL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -TAIL=$ac_cv_path_TAIL -if test -n "$TAIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAIL" >&5 -$as_echo "$TAIL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$TAIL" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool TAIL=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool TAIL=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TAIL" >&5 -$as_echo_n "checking for TAIL... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool TAIL=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$TAIL" = x; then - as_fn_error $? "Could not find required tool for TAIL" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${TAR+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in gtar tar -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TAR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $TAR in - [\\/]* | ?:[\\/]*) - ac_cv_path_TAR="$TAR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -TAR=$ac_cv_path_TAR -if test -n "$TAR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5 -$as_echo "$TAR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$TAR" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !TAR! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!TAR!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xTAR" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of TAR from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of TAR from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in gtar tar -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TAR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $TAR in - [\\/]* | ?:[\\/]*) - ac_cv_path_TAR="$TAR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -TAR=$ac_cv_path_TAR -if test -n "$TAR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5 -$as_echo "$TAR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$TAR" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$TAR" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool TAR= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool TAR= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TAR" >&5 -$as_echo_n "checking for TAR... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$TAR" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool TAR=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool TAR=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TAR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $TAR in - [\\/]* | ?:[\\/]*) - ac_cv_path_TAR="$TAR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -TAR=$ac_cv_path_TAR -if test -n "$TAR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5 -$as_echo "$TAR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$TAR" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool TAR=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool TAR=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TAR" >&5 -$as_echo_n "checking for TAR... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool TAR=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$TAR" = x; then - as_fn_error $? "Could not find required tool for TAR" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${TEE+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in tee -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TEE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $TEE in - [\\/]* | ?:[\\/]*) - ac_cv_path_TEE="$TEE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_TEE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -TEE=$ac_cv_path_TEE -if test -n "$TEE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEE" >&5 -$as_echo "$TEE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$TEE" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !TEE! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!TEE!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xTEE" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of TEE from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of TEE from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in tee -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TEE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $TEE in - [\\/]* | ?:[\\/]*) - ac_cv_path_TEE="$TEE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_TEE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -TEE=$ac_cv_path_TEE -if test -n "$TEE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEE" >&5 -$as_echo "$TEE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$TEE" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$TEE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool TEE= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool TEE= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TEE" >&5 -$as_echo_n "checking for TEE... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$TEE" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool TEE=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool TEE=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TEE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $TEE in - [\\/]* | ?:[\\/]*) - ac_cv_path_TEE="$TEE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_TEE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -TEE=$ac_cv_path_TEE -if test -n "$TEE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEE" >&5 -$as_echo "$TEE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$TEE" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool TEE=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool TEE=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TEE" >&5 -$as_echo_n "checking for TEE... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool TEE=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$TEE" = x; then - as_fn_error $? "Could not find required tool for TEE" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${TOUCH+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in touch -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TOUCH+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $TOUCH in - [\\/]* | ?:[\\/]*) - ac_cv_path_TOUCH="$TOUCH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_TOUCH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -TOUCH=$ac_cv_path_TOUCH -if test -n "$TOUCH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TOUCH" >&5 -$as_echo "$TOUCH" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$TOUCH" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !TOUCH! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!TOUCH!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xTOUCH" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of TOUCH from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of TOUCH from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in touch -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TOUCH+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $TOUCH in - [\\/]* | ?:[\\/]*) - ac_cv_path_TOUCH="$TOUCH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_TOUCH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -TOUCH=$ac_cv_path_TOUCH -if test -n "$TOUCH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TOUCH" >&5 -$as_echo "$TOUCH" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$TOUCH" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$TOUCH" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool TOUCH= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool TOUCH= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TOUCH" >&5 -$as_echo_n "checking for TOUCH... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$TOUCH" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool TOUCH=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool TOUCH=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TOUCH+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $TOUCH in - [\\/]* | ?:[\\/]*) - ac_cv_path_TOUCH="$TOUCH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_TOUCH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -TOUCH=$ac_cv_path_TOUCH -if test -n "$TOUCH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TOUCH" >&5 -$as_echo "$TOUCH" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$TOUCH" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool TOUCH=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool TOUCH=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TOUCH" >&5 -$as_echo_n "checking for TOUCH... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool TOUCH=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$TOUCH" = x; then - as_fn_error $? "Could not find required tool for TOUCH" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${TR+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in tr -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $TR in - [\\/]* | ?:[\\/]*) - ac_cv_path_TR="$TR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_TR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -TR=$ac_cv_path_TR -if test -n "$TR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TR" >&5 -$as_echo "$TR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$TR" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !TR! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!TR!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xTR" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of TR from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of TR from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in tr -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $TR in - [\\/]* | ?:[\\/]*) - ac_cv_path_TR="$TR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_TR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -TR=$ac_cv_path_TR -if test -n "$TR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TR" >&5 -$as_echo "$TR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$TR" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$TR" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool TR= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool TR= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TR" >&5 -$as_echo_n "checking for TR... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$TR" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool TR=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool TR=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $TR in - [\\/]* | ?:[\\/]*) - ac_cv_path_TR="$TR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_TR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -TR=$ac_cv_path_TR -if test -n "$TR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TR" >&5 -$as_echo "$TR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$TR" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool TR=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool TR=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TR" >&5 -$as_echo_n "checking for TR... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool TR=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$TR" = x; then - as_fn_error $? "Could not find required tool for TR" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${UNAME+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in uname -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_UNAME+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $UNAME in - [\\/]* | ?:[\\/]*) - ac_cv_path_UNAME="$UNAME" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_UNAME="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -UNAME=$ac_cv_path_UNAME -if test -n "$UNAME"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNAME" >&5 -$as_echo "$UNAME" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$UNAME" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !UNAME! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!UNAME!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xUNAME" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of UNAME from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of UNAME from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in uname -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_UNAME+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $UNAME in - [\\/]* | ?:[\\/]*) - ac_cv_path_UNAME="$UNAME" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_UNAME="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -UNAME=$ac_cv_path_UNAME -if test -n "$UNAME"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNAME" >&5 -$as_echo "$UNAME" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$UNAME" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$UNAME" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool UNAME= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool UNAME= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for UNAME" >&5 -$as_echo_n "checking for UNAME... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$UNAME" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool UNAME=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool UNAME=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_UNAME+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $UNAME in - [\\/]* | ?:[\\/]*) - ac_cv_path_UNAME="$UNAME" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_UNAME="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -UNAME=$ac_cv_path_UNAME -if test -n "$UNAME"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNAME" >&5 -$as_echo "$UNAME" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$UNAME" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool UNAME=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool UNAME=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for UNAME" >&5 -$as_echo_n "checking for UNAME... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool UNAME=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$UNAME" = x; then - as_fn_error $? "Could not find required tool for UNAME" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${UNIQ+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in uniq -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_UNIQ+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $UNIQ in - [\\/]* | ?:[\\/]*) - ac_cv_path_UNIQ="$UNIQ" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_UNIQ="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -UNIQ=$ac_cv_path_UNIQ -if test -n "$UNIQ"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNIQ" >&5 -$as_echo "$UNIQ" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$UNIQ" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !UNIQ! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!UNIQ!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xUNIQ" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of UNIQ from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of UNIQ from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in uniq -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_UNIQ+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $UNIQ in - [\\/]* | ?:[\\/]*) - ac_cv_path_UNIQ="$UNIQ" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_UNIQ="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -UNIQ=$ac_cv_path_UNIQ -if test -n "$UNIQ"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNIQ" >&5 -$as_echo "$UNIQ" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$UNIQ" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$UNIQ" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool UNIQ= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool UNIQ= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for UNIQ" >&5 -$as_echo_n "checking for UNIQ... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$UNIQ" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool UNIQ=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool UNIQ=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_UNIQ+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $UNIQ in - [\\/]* | ?:[\\/]*) - ac_cv_path_UNIQ="$UNIQ" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_UNIQ="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -UNIQ=$ac_cv_path_UNIQ -if test -n "$UNIQ"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNIQ" >&5 -$as_echo "$UNIQ" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$UNIQ" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool UNIQ=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool UNIQ=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for UNIQ" >&5 -$as_echo_n "checking for UNIQ... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool UNIQ=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$UNIQ" = x; then - as_fn_error $? "Could not find required tool for UNIQ" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${WC+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in wc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_WC+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $WC in - [\\/]* | ?:[\\/]*) - ac_cv_path_WC="$WC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_WC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -WC=$ac_cv_path_WC -if test -n "$WC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WC" >&5 -$as_echo "$WC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$WC" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !WC! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!WC!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xWC" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of WC from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of WC from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in wc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_WC+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $WC in - [\\/]* | ?:[\\/]*) - ac_cv_path_WC="$WC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_WC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -WC=$ac_cv_path_WC -if test -n "$WC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WC" >&5 -$as_echo "$WC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$WC" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$WC" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool WC= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool WC= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WC" >&5 -$as_echo_n "checking for WC... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$WC" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool WC=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool WC=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_WC+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $WC in - [\\/]* | ?:[\\/]*) - ac_cv_path_WC="$WC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_WC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -WC=$ac_cv_path_WC -if test -n "$WC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WC" >&5 -$as_echo "$WC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$WC" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool WC=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool WC=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WC" >&5 -$as_echo_n "checking for WC... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool WC=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$WC" = x; then - as_fn_error $? "Could not find required tool for WC" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${WHICH+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in which -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_WHICH+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $WHICH in - [\\/]* | ?:[\\/]*) - ac_cv_path_WHICH="$WHICH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_WHICH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -WHICH=$ac_cv_path_WHICH -if test -n "$WHICH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WHICH" >&5 -$as_echo "$WHICH" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$WHICH" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !WHICH! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!WHICH!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xWHICH" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of WHICH from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of WHICH from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in which -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_WHICH+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $WHICH in - [\\/]* | ?:[\\/]*) - ac_cv_path_WHICH="$WHICH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_WHICH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -WHICH=$ac_cv_path_WHICH -if test -n "$WHICH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WHICH" >&5 -$as_echo "$WHICH" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$WHICH" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$WHICH" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool WHICH= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool WHICH= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WHICH" >&5 -$as_echo_n "checking for WHICH... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$WHICH" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool WHICH=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool WHICH=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_WHICH+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $WHICH in - [\\/]* | ?:[\\/]*) - ac_cv_path_WHICH="$WHICH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_WHICH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -WHICH=$ac_cv_path_WHICH -if test -n "$WHICH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WHICH" >&5 -$as_echo "$WHICH" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$WHICH" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool WHICH=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool WHICH=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WHICH" >&5 -$as_echo_n "checking for WHICH... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool WHICH=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$WHICH" = x; then - as_fn_error $? "Could not find required tool for WHICH" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${XARGS+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in xargs -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_XARGS+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $XARGS in - [\\/]* | ?:[\\/]*) - ac_cv_path_XARGS="$XARGS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_XARGS="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -XARGS=$ac_cv_path_XARGS -if test -n "$XARGS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XARGS" >&5 -$as_echo "$XARGS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$XARGS" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !XARGS! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!XARGS!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xXARGS" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of XARGS from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of XARGS from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in xargs -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_XARGS+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $XARGS in - [\\/]* | ?:[\\/]*) - ac_cv_path_XARGS="$XARGS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_XARGS="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -XARGS=$ac_cv_path_XARGS -if test -n "$XARGS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XARGS" >&5 -$as_echo "$XARGS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$XARGS" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$XARGS" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool XARGS= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool XARGS= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XARGS" >&5 -$as_echo_n "checking for XARGS... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$XARGS" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool XARGS=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool XARGS=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_XARGS+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $XARGS in - [\\/]* | ?:[\\/]*) - ac_cv_path_XARGS="$XARGS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_XARGS="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -XARGS=$ac_cv_path_XARGS -if test -n "$XARGS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XARGS" >&5 -$as_echo "$XARGS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$XARGS" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool XARGS=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool XARGS=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XARGS" >&5 -$as_echo_n "checking for XARGS... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool XARGS=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$XARGS" = x; then - as_fn_error $? "Could not find required tool for XARGS" "$LINENO" 5 - fi - - - - # Then required tools that require some special treatment. - - - # Publish this variable in the help. - - - if [ -z "${AWK+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !AWK! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!AWK!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xAWK" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of AWK from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of AWK from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$AWK" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool AWK= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool AWK= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AWK" >&5 -$as_echo_n "checking for AWK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$AWK" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool AWK=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool AWK=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $AWK in - [\\/]* | ?:[\\/]*) - ac_cv_path_AWK="$AWK" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_AWK="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -AWK=$ac_cv_path_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$AWK" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool AWK=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool AWK=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AWK" >&5 -$as_echo_n "checking for AWK... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool AWK=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - if test "x$AWK" = x; then - as_fn_error $? "Could not find required tool for AWK" "$LINENO" 5 - fi - - - - - # Publish this variable in the help. - - - if [ -z "${GREP+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !GREP! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!GREP!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xGREP" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of GREP from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of GREP from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$GREP" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool GREP= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool GREP= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GREP" >&5 -$as_echo_n "checking for GREP... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$GREP" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool GREP=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool GREP=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $GREP in - [\\/]* | ?:[\\/]*) - ac_cv_path_GREP="$GREP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -GREP=$ac_cv_path_GREP -if test -n "$GREP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GREP" >&5 -$as_echo "$GREP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$GREP" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool GREP=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool GREP=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GREP" >&5 -$as_echo_n "checking for GREP... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool GREP=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - if test "x$GREP" = x; then - as_fn_error $? "Could not find required tool for GREP" "$LINENO" 5 - fi - - - - - # Publish this variable in the help. - - - if [ -z "${EGREP+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !EGREP! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!EGREP!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xEGREP" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of EGREP from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of EGREP from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$EGREP" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool EGREP= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool EGREP= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EGREP" >&5 -$as_echo_n "checking for EGREP... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$EGREP" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool EGREP=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool EGREP=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $EGREP in - [\\/]* | ?:[\\/]*) - ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_EGREP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -EGREP=$ac_cv_path_EGREP -if test -n "$EGREP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $EGREP" >&5 -$as_echo "$EGREP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$EGREP" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool EGREP=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool EGREP=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EGREP" >&5 -$as_echo_n "checking for EGREP... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool EGREP=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - if test "x$EGREP" = x; then - as_fn_error $? "Could not find required tool for EGREP" "$LINENO" 5 - fi - - - - - # Publish this variable in the help. - - - if [ -z "${FGREP+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 -$as_echo_n "checking for fgrep... " >&6; } -if ${ac_cv_path_FGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 - then ac_cv_path_FGREP="$GREP -F" - else - if test -z "$FGREP"; then - ac_path_FGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_FGREP" || continue -# Check for GNU ac_path_FGREP and select it if it is found. - # Check for GNU $ac_path_FGREP -case `"$ac_path_FGREP" --version 2>&1` in -*GNU*) - ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'FGREP' >> "conftest.nl" - "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_FGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_FGREP="$ac_path_FGREP" - ac_path_FGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_FGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_FGREP"; then - as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_FGREP=$FGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 -$as_echo "$ac_cv_path_FGREP" >&6; } - FGREP="$ac_cv_path_FGREP" - - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !FGREP! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!FGREP!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xFGREP" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of FGREP from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of FGREP from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 -$as_echo_n "checking for fgrep... " >&6; } -if ${ac_cv_path_FGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 - then ac_cv_path_FGREP="$GREP -F" - else - if test -z "$FGREP"; then - ac_path_FGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_FGREP" || continue -# Check for GNU ac_path_FGREP and select it if it is found. - # Check for GNU $ac_path_FGREP -case `"$ac_path_FGREP" --version 2>&1` in -*GNU*) - ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'FGREP' >> "conftest.nl" - "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_FGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_FGREP="$ac_path_FGREP" - ac_path_FGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_FGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_FGREP"; then - as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_FGREP=$FGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 -$as_echo "$ac_cv_path_FGREP" >&6; } - FGREP="$ac_cv_path_FGREP" - - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$FGREP" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool FGREP= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool FGREP= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FGREP" >&5 -$as_echo_n "checking for FGREP... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$FGREP" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool FGREP=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool FGREP=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_FGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $FGREP in - [\\/]* | ?:[\\/]*) - ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_FGREP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -FGREP=$ac_cv_path_FGREP -if test -n "$FGREP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FGREP" >&5 -$as_echo "$FGREP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$FGREP" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool FGREP=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool FGREP=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FGREP" >&5 -$as_echo_n "checking for FGREP... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool FGREP=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - if test "x$FGREP" = x; then - as_fn_error $? "Could not find required tool for FGREP" "$LINENO" 5 - fi - - - - - # Publish this variable in the help. - - - if [ -z "${SED+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_SED" || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi -else - ac_cv_path_SED=$SED -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !SED! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!SED!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xSED" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of SED from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of SED from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_SED" || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi -else - ac_cv_path_SED=$SED -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$SED" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool SED= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool SED= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SED" >&5 -$as_echo_n "checking for SED... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$SED" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool SED=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool SED=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $SED in - [\\/]* | ?:[\\/]*) - ac_cv_path_SED="$SED" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -SED=$ac_cv_path_SED -if test -n "$SED"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SED" >&5 -$as_echo "$SED" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$SED" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool SED=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool SED=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SED" >&5 -$as_echo_n "checking for SED... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool SED=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - if test "x$SED" = x; then - as_fn_error $? "Could not find required tool for SED" "$LINENO" 5 - fi - - - - # Always force rm. - RM="$RM -f" - - # pwd behaves differently on various platforms and some don't support the -L flag. - # Always use the bash builtin pwd to get uniform behavior. - THEPWDCMD=pwd - - # These are not required on all platforms - - - # Publish this variable in the help. - - - if [ -z "${CYGPATH+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in cygpath -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CYGPATH+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CYGPATH in - [\\/]* | ?:[\\/]*) - ac_cv_path_CYGPATH="$CYGPATH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CYGPATH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CYGPATH=$ac_cv_path_CYGPATH -if test -n "$CYGPATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGPATH" >&5 -$as_echo "$CYGPATH" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CYGPATH" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !CYGPATH! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!CYGPATH!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xCYGPATH" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of CYGPATH from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of CYGPATH from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in cygpath -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CYGPATH+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CYGPATH in - [\\/]* | ?:[\\/]*) - ac_cv_path_CYGPATH="$CYGPATH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CYGPATH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CYGPATH=$ac_cv_path_CYGPATH -if test -n "$CYGPATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGPATH" >&5 -$as_echo "$CYGPATH" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CYGPATH" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$CYGPATH" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool CYGPATH= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool CYGPATH= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CYGPATH" >&5 -$as_echo_n "checking for CYGPATH... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$CYGPATH" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool CYGPATH=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool CYGPATH=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CYGPATH+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CYGPATH in - [\\/]* | ?:[\\/]*) - ac_cv_path_CYGPATH="$CYGPATH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CYGPATH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CYGPATH=$ac_cv_path_CYGPATH -if test -n "$CYGPATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGPATH" >&5 -$as_echo "$CYGPATH" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$CYGPATH" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool CYGPATH=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool CYGPATH=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CYGPATH" >&5 -$as_echo_n "checking for CYGPATH... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool CYGPATH=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - - # Publish this variable in the help. - - - if [ -z "${READLINK+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in greadlink readlink -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_READLINK+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $READLINK in - [\\/]* | ?:[\\/]*) - ac_cv_path_READLINK="$READLINK" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_READLINK="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -READLINK=$ac_cv_path_READLINK -if test -n "$READLINK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READLINK" >&5 -$as_echo "$READLINK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$READLINK" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !READLINK! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!READLINK!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xREADLINK" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of READLINK from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of READLINK from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in greadlink readlink -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_READLINK+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $READLINK in - [\\/]* | ?:[\\/]*) - ac_cv_path_READLINK="$READLINK" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_READLINK="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -READLINK=$ac_cv_path_READLINK -if test -n "$READLINK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READLINK" >&5 -$as_echo "$READLINK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$READLINK" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$READLINK" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool READLINK= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool READLINK= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for READLINK" >&5 -$as_echo_n "checking for READLINK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$READLINK" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool READLINK=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool READLINK=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_READLINK+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $READLINK in - [\\/]* | ?:[\\/]*) - ac_cv_path_READLINK="$READLINK" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_READLINK="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -READLINK=$ac_cv_path_READLINK -if test -n "$READLINK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READLINK" >&5 -$as_echo "$READLINK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$READLINK" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool READLINK=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool READLINK=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for READLINK" >&5 -$as_echo_n "checking for READLINK... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool READLINK=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - - # Publish this variable in the help. - - - if [ -z "${DF+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in df -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_DF+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DF in - [\\/]* | ?:[\\/]*) - ac_cv_path_DF="$DF" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DF="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DF=$ac_cv_path_DF -if test -n "$DF"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DF" >&5 -$as_echo "$DF" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$DF" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !DF! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!DF!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xDF" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of DF from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of DF from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in df -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_DF+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DF in - [\\/]* | ?:[\\/]*) - ac_cv_path_DF="$DF" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DF="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DF=$ac_cv_path_DF -if test -n "$DF"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DF" >&5 -$as_echo "$DF" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$DF" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$DF" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool DF= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool DF= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DF" >&5 -$as_echo_n "checking for DF... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$DF" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool DF=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool DF=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_DF+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DF in - [\\/]* | ?:[\\/]*) - ac_cv_path_DF="$DF" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DF="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DF=$ac_cv_path_DF -if test -n "$DF"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DF" >&5 -$as_echo "$DF" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$DF" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool DF=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool DF=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DF" >&5 -$as_echo_n "checking for DF... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool DF=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - - # Publish this variable in the help. - - - if [ -z "${CPIO+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in cpio bsdcpio -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CPIO+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CPIO in - [\\/]* | ?:[\\/]*) - ac_cv_path_CPIO="$CPIO" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CPIO="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CPIO=$ac_cv_path_CPIO -if test -n "$CPIO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPIO" >&5 -$as_echo "$CPIO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CPIO" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !CPIO! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!CPIO!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xCPIO" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of CPIO from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of CPIO from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in cpio bsdcpio -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CPIO+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CPIO in - [\\/]* | ?:[\\/]*) - ac_cv_path_CPIO="$CPIO" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CPIO="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CPIO=$ac_cv_path_CPIO -if test -n "$CPIO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPIO" >&5 -$as_echo "$CPIO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CPIO" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$CPIO" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool CPIO= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool CPIO= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CPIO" >&5 -$as_echo_n "checking for CPIO... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$CPIO" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool CPIO=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool CPIO=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CPIO+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CPIO in - [\\/]* | ?:[\\/]*) - ac_cv_path_CPIO="$CPIO" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CPIO="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CPIO=$ac_cv_path_CPIO -if test -n "$CPIO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPIO" >&5 -$as_echo "$CPIO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$CPIO" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool CPIO=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool CPIO=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CPIO" >&5 -$as_echo_n "checking for CPIO... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool CPIO=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - - # Publish this variable in the help. - - - if [ -z "${NICE+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in nice -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_NICE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $NICE in - [\\/]* | ?:[\\/]*) - ac_cv_path_NICE="$NICE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_NICE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -NICE=$ac_cv_path_NICE -if test -n "$NICE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NICE" >&5 -$as_echo "$NICE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$NICE" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !NICE! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!NICE!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xNICE" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of NICE from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of NICE from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in nice -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_NICE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $NICE in - [\\/]* | ?:[\\/]*) - ac_cv_path_NICE="$NICE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_NICE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -NICE=$ac_cv_path_NICE -if test -n "$NICE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NICE" >&5 -$as_echo "$NICE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$NICE" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$NICE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool NICE= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool NICE= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NICE" >&5 -$as_echo_n "checking for NICE... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$NICE" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool NICE=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool NICE=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_NICE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $NICE in - [\\/]* | ?:[\\/]*) - ac_cv_path_NICE="$NICE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_NICE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -NICE=$ac_cv_path_NICE -if test -n "$NICE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NICE" >&5 -$as_echo "$NICE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$NICE" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool NICE=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool NICE=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NICE" >&5 -$as_echo_n "checking for NICE... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool NICE=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - - # Publish this variable in the help. - - - if [ -z "${PANDOC+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in pandoc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PANDOC+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PANDOC in - [\\/]* | ?:[\\/]*) - ac_cv_path_PANDOC="$PANDOC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PANDOC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PANDOC=$ac_cv_path_PANDOC -if test -n "$PANDOC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PANDOC" >&5 -$as_echo "$PANDOC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$PANDOC" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !PANDOC! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!PANDOC!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xPANDOC" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of PANDOC from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of PANDOC from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in pandoc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PANDOC+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PANDOC in - [\\/]* | ?:[\\/]*) - ac_cv_path_PANDOC="$PANDOC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PANDOC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PANDOC=$ac_cv_path_PANDOC -if test -n "$PANDOC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PANDOC" >&5 -$as_echo "$PANDOC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$PANDOC" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$PANDOC" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool PANDOC= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool PANDOC= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PANDOC" >&5 -$as_echo_n "checking for PANDOC... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$PANDOC" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool PANDOC=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool PANDOC=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PANDOC+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PANDOC in - [\\/]* | ?:[\\/]*) - ac_cv_path_PANDOC="$PANDOC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PANDOC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PANDOC=$ac_cv_path_PANDOC -if test -n "$PANDOC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PANDOC" >&5 -$as_echo "$PANDOC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$PANDOC" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool PANDOC=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool PANDOC=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PANDOC" >&5 -$as_echo_n "checking for PANDOC... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool PANDOC=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - -# Now we can determine OpenJDK build and target platforms. This is required to -# have early on. -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 -$as_echo_n "checking target system type... " >&6; } -if ${ac_cv_target+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$target_alias" = x; then - ac_cv_target=$ac_cv_host -else - ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 -$as_echo "$ac_cv_target" >&6; } -case $ac_cv_target in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; -esac -target=$ac_cv_target -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_target -shift -target_cpu=$1 -target_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -target_os=$* -IFS=$ac_save_IFS -case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac - - -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -test -n "$target_alias" && - test "$program_prefix$program_suffix$program_transform_name" = \ - NONENONEs,x,x, && - program_prefix=${target_alias}- - - # Figure out the build and target systems. # Note that in autoconf terminology, "build" is obvious, but "target" - # is confusing; it assumes you are cross-compiling a cross-compiler (!) and "target" is thus the target of the - # product you're building. The target of this build is called "host". Since this is confusing to most people, we - # have not adopted that system, but use "target" as the platform we are building for. In some places though we need - # to use the configure naming style. - - - - - - # Copy the autoconf trip/quadruplet verbatim to OPENJDK_TARGET_AUTOCONF_NAME - # (from the autoconf "host") and OPENJDK_BUILD_AUTOCONF_NAME - # Note that we might later on rewrite e.g. OPENJDK_TARGET_CPU due to reduced build, - # but this will not change the value of OPENJDK_TARGET_AUTOCONF_NAME. - OPENJDK_TARGET_AUTOCONF_NAME="$host" - OPENJDK_BUILD_AUTOCONF_NAME="$build" - - - - # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. - - case "$build_os" in - *linux*) - VAR_OS=linux - VAR_OS_TYPE=unix - ;; - *solaris*) - VAR_OS=solaris - VAR_OS_TYPE=unix - ;; - *darwin*) - VAR_OS=macosx - VAR_OS_TYPE=unix - ;; - *bsd*) - VAR_OS=bsd - VAR_OS_TYPE=unix - ;; - *cygwin*) - VAR_OS=windows - VAR_OS_ENV=windows.cygwin - ;; - *mingw*) - VAR_OS=windows - VAR_OS_ENV=windows.msys - ;; - *aix*) - VAR_OS=aix - VAR_OS_TYPE=unix - ;; - *) - as_fn_error $? "unsupported operating system $build_os" "$LINENO" 5 - ;; - esac - - - # First argument is the cpu name from the trip/quad - case "$build_cpu" in - x86_64) - VAR_CPU=x86_64 - VAR_CPU_ARCH=x86 - VAR_CPU_BITS=64 - VAR_CPU_ENDIAN=little - ;; - i?86) - VAR_CPU=x86 - VAR_CPU_ARCH=x86 - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=little - ;; - alpha*) - VAR_CPU=alpha - VAR_CPU_ARCH=alpha - VAR_CPU_BITS=64 - VAR_CPU_ENDIAN=little - ;; - arm*) - VAR_CPU=arm - VAR_CPU_ARCH=arm - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=little - ;; - aarch64) - VAR_CPU=aarch64 - VAR_CPU_ARCH=aarch64 - VAR_CPU_BITS=64 - VAR_CPU_ENDIAN=little - ;; - m68k) - VAR_CPU=m68k - VAR_CPU_ARCH=m68k - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=big - ;; - mips) - VAR_CPU=mips - VAR_CPU_ARCH=mips - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=big - ;; - mipsel) - VAR_CPU=mipsel - VAR_CPU_ARCH=mipsel - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=little - ;; - mips64) - VAR_CPU=mips64 - VAR_CPU_ARCH=mips64 - VAR_CPU_BITS=64 - VAR_CPU_ENDIAN=big - ;; - mips64el) - VAR_CPU=mips64el - VAR_CPU_ARCH=mips64el - VAR_CPU_BITS=64 - VAR_CPU_ENDIAN=little - ;; - powerpc) - VAR_CPU=ppc - VAR_CPU_ARCH=ppc - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=big - ;; - powerpc64) - VAR_CPU=ppc64 - VAR_CPU_ARCH=ppc - VAR_CPU_BITS=64 - VAR_CPU_ENDIAN=big - ;; - powerpc64le) - VAR_CPU=ppc64le - VAR_CPU_ARCH=ppc - VAR_CPU_BITS=64 - VAR_CPU_ENDIAN=little - ;; - s390) - VAR_CPU=s390 - VAR_CPU_ARCH=s390 - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=big - ;; - s390x) - VAR_CPU=s390x - VAR_CPU_ARCH=s390 - VAR_CPU_BITS=64 - VAR_CPU_ENDIAN=big - ;; - sh*eb) - VAR_CPU=sh - VAR_CPU_ARCH=sh - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=big - ;; - sh*) - VAR_CPU=sh - VAR_CPU_ARCH=sh - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=little - ;; - sparc) - VAR_CPU=sparc - VAR_CPU_ARCH=sparc - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=big - ;; - sparcv9|sparc64) - VAR_CPU=sparcv9 - VAR_CPU_ARCH=sparc - VAR_CPU_BITS=64 - VAR_CPU_ENDIAN=big - ;; - *) - as_fn_error $? "unsupported cpu $build_cpu" "$LINENO" 5 - ;; - esac - - # ..and setup our own variables. (Do this explicitly to facilitate searching) - OPENJDK_BUILD_OS="$VAR_OS" - if test "x$VAR_OS_TYPE" != x; then - OPENJDK_BUILD_OS_TYPE="$VAR_OS_TYPE" - else - OPENJDK_BUILD_OS_TYPE="$VAR_OS" - fi - if test "x$VAR_OS_ENV" != x; then - OPENJDK_BUILD_OS_ENV="$VAR_OS_ENV" - else - OPENJDK_BUILD_OS_ENV="$VAR_OS" - fi - OPENJDK_BUILD_CPU="$VAR_CPU" - OPENJDK_BUILD_CPU_ARCH="$VAR_CPU_ARCH" - OPENJDK_BUILD_CPU_BITS="$VAR_CPU_BITS" - OPENJDK_BUILD_CPU_ENDIAN="$VAR_CPU_ENDIAN" - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking openjdk-build os-cpu" >&5 -$as_echo_n "checking openjdk-build os-cpu... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" >&5 -$as_echo "$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" >&6; } - - # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. - - case "$host_os" in - *linux*) - VAR_OS=linux - VAR_OS_TYPE=unix - ;; - *solaris*) - VAR_OS=solaris - VAR_OS_TYPE=unix - ;; - *darwin*) - VAR_OS=macosx - VAR_OS_TYPE=unix - ;; - *bsd*) - VAR_OS=bsd - VAR_OS_TYPE=unix - ;; - *cygwin*) - VAR_OS=windows - VAR_OS_ENV=windows.cygwin - ;; - *mingw*) - VAR_OS=windows - VAR_OS_ENV=windows.msys - ;; - *aix*) - VAR_OS=aix - VAR_OS_TYPE=unix - ;; - *) - as_fn_error $? "unsupported operating system $host_os" "$LINENO" 5 - ;; - esac - - - # First argument is the cpu name from the trip/quad - case "$host_cpu" in - x86_64) - VAR_CPU=x86_64 - VAR_CPU_ARCH=x86 - VAR_CPU_BITS=64 - VAR_CPU_ENDIAN=little - ;; - i?86) - VAR_CPU=x86 - VAR_CPU_ARCH=x86 - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=little - ;; - alpha*) - VAR_CPU=alpha - VAR_CPU_ARCH=alpha - VAR_CPU_BITS=64 - VAR_CPU_ENDIAN=little - ;; - arm*) - VAR_CPU=arm - VAR_CPU_ARCH=arm - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=little - ;; - aarch64) - VAR_CPU=aarch64 - VAR_CPU_ARCH=aarch64 - VAR_CPU_BITS=64 - VAR_CPU_ENDIAN=little - ;; - m68k) - VAR_CPU=m68k - VAR_CPU_ARCH=m68k - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=big - ;; - mips) - VAR_CPU=mips - VAR_CPU_ARCH=mips - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=big - ;; - mipsel) - VAR_CPU=mipsel - VAR_CPU_ARCH=mipsel - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=little - ;; - mips64) - VAR_CPU=mips64 - VAR_CPU_ARCH=mips64 - VAR_CPU_BITS=64 - VAR_CPU_ENDIAN=big - ;; - mips64el) - VAR_CPU=mips64el - VAR_CPU_ARCH=mips64el - VAR_CPU_BITS=64 - VAR_CPU_ENDIAN=little - ;; - powerpc) - VAR_CPU=ppc - VAR_CPU_ARCH=ppc - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=big - ;; - powerpc64) - VAR_CPU=ppc64 - VAR_CPU_ARCH=ppc - VAR_CPU_BITS=64 - VAR_CPU_ENDIAN=big - ;; - powerpc64le) - VAR_CPU=ppc64le - VAR_CPU_ARCH=ppc - VAR_CPU_BITS=64 - VAR_CPU_ENDIAN=little - ;; - s390) - VAR_CPU=s390 - VAR_CPU_ARCH=s390 - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=big - ;; - s390x) - VAR_CPU=s390x - VAR_CPU_ARCH=s390 - VAR_CPU_BITS=64 - VAR_CPU_ENDIAN=big - ;; - sh*eb) - VAR_CPU=sh - VAR_CPU_ARCH=sh - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=big - ;; - sh*) - VAR_CPU=sh - VAR_CPU_ARCH=sh - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=little - ;; - sparc) - VAR_CPU=sparc - VAR_CPU_ARCH=sparc - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=big - ;; - sparcv9|sparc64) - VAR_CPU=sparcv9 - VAR_CPU_ARCH=sparc - VAR_CPU_BITS=64 - VAR_CPU_ENDIAN=big - ;; - *) - as_fn_error $? "unsupported cpu $host_cpu" "$LINENO" 5 - ;; - esac - - # ... and setup our own variables. (Do this explicitly to facilitate searching) - OPENJDK_TARGET_OS="$VAR_OS" - if test "x$VAR_OS_TYPE" != x; then - OPENJDK_TARGET_OS_TYPE="$VAR_OS_TYPE" - else - OPENJDK_TARGET_OS_TYPE="$VAR_OS" - fi - if test "x$VAR_OS_ENV" != x; then - OPENJDK_TARGET_OS_ENV="$VAR_OS_ENV" - else - OPENJDK_TARGET_OS_ENV="$VAR_OS" - fi - OPENJDK_TARGET_CPU="$VAR_CPU" - OPENJDK_TARGET_CPU_ARCH="$VAR_CPU_ARCH" - OPENJDK_TARGET_CPU_BITS="$VAR_CPU_BITS" - OPENJDK_TARGET_CPU_ENDIAN="$VAR_CPU_ENDIAN" - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking openjdk-target os-cpu" >&5 -$as_echo_n "checking openjdk-target os-cpu... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" >&5 -$as_echo "$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" >&6; } - - - -# Check whether --with-target-bits was given. -if test "${with_target_bits+set}" = set; then : - withval=$with_target_bits; -fi - - - # We have three types of compiles: - # native == normal compilation, target system == build system - # cross == traditional cross compilation, target system != build system; special toolchain needed - # reduced == using native compilers, but with special flags (e.g. -m32) to produce 32-bit builds on 64-bit machines - # - if test "x$OPENJDK_BUILD_AUTOCONF_NAME" != "x$OPENJDK_TARGET_AUTOCONF_NAME"; then - # We're doing a proper cross-compilation - COMPILE_TYPE="cross" - else - COMPILE_TYPE="native" - fi - - if test "x$with_target_bits" != x; then - if test "x$COMPILE_TYPE" = "xcross"; then - as_fn_error $? "It is not possible to combine --with-target-bits=X and proper cross-compilation. Choose either." "$LINENO" 5 - fi - - if test "x$with_target_bits" = x32 && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - # A reduced build is requested - COMPILE_TYPE="reduced" - OPENJDK_TARGET_CPU_BITS=32 - if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86"; then - OPENJDK_TARGET_CPU=x86 - elif test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then - OPENJDK_TARGET_CPU=sparc - else - as_fn_error $? "Reduced build (--with-target-bits=32) is only supported on x86_64 and sparcv9" "$LINENO" 5 - fi - elif test "x$with_target_bits" = x64 && test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - as_fn_error $? "It is not possible to use --with-target-bits=64 on a 32 bit system. Use proper cross-compilation instead." "$LINENO" 5 - elif test "x$with_target_bits" = "x$OPENJDK_TARGET_CPU_BITS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: --with-target-bits are set to build platform address size; argument has no meaning" >&5 -$as_echo "$as_me: --with-target-bits are set to build platform address size; argument has no meaning" >&6;} - else - as_fn_error $? "--with-target-bits can only be 32 or 64, you specified $with_target_bits!" "$LINENO" 5 - fi - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking compilation type" >&5 -$as_echo_n "checking compilation type... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $COMPILE_TYPE" >&5 -$as_echo "$COMPILE_TYPE" >&6; } - - - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - OPENJDK_MODULE_TARGET_OS_NAME="macos" - else - OPENJDK_MODULE_TARGET_OS_NAME="$OPENJDK_TARGET_OS" - fi - - if test "x$OPENJDK_TARGET_CPU" = xx86_64; then - OPENJDK_MODULE_TARGET_OS_ARCH="amd64" - else - OPENJDK_MODULE_TARGET_OS_ARCH="$OPENJDK_TARGET_CPU" - fi - - OPENJDK_MODULE_TARGET_PLATFORM="${OPENJDK_MODULE_TARGET_OS_NAME}-${OPENJDK_MODULE_TARGET_OS_ARCH}" - - - - if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then - RELEASE_FILE_OS_NAME=SunOS - fi - if test "x$OPENJDK_TARGET_OS" = "xlinux"; then - RELEASE_FILE_OS_NAME=Linux - fi - if test "x$OPENJDK_TARGET_OS" = "xwindows"; then - RELEASE_FILE_OS_NAME=Windows - fi - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - RELEASE_FILE_OS_NAME="Darwin" - fi - if test "x$OPENJDK_TARGET_OS" = "xaix"; then - RELEASE_FILE_OS_NAME="AIX" - fi - RELEASE_FILE_OS_ARCH=${OPENJDK_TARGET_CPU} - - - - - - - # Also store the legacy naming of the cpu. - # Ie i586 and amd64 instead of x86 and x86_64 - OPENJDK_TARGET_CPU_LEGACY="$OPENJDK_TARGET_CPU" - if test "x$OPENJDK_TARGET_CPU" = xx86; then - OPENJDK_TARGET_CPU_LEGACY="i586" - elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then - # On all platforms except MacOSX replace x86_64 with amd64. - OPENJDK_TARGET_CPU_LEGACY="amd64" - elif test "x$OPENJDK_TARGET_CPU" = xalpha; then - # Avoid name collisions with variables named alpha - OPENJDK_TARGET_CPU_LEGACY="_alpha_" - elif test "x$OPENJDK_TARGET_CPU" = xsh; then - # Avoid name collisions with variables named sh - OPENJDK_TARGET_CPU_LEGACY="_sh_" - fi - - - # And the second legacy naming of the cpu. - # Ie i386 and amd64 instead of x86 and x86_64. - OPENJDK_TARGET_CPU_LEGACY_LIB="$OPENJDK_TARGET_CPU" - if test "x$OPENJDK_TARGET_CPU" = xx86; then - OPENJDK_TARGET_CPU_LEGACY_LIB="i386" - elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then - OPENJDK_TARGET_CPU_LEGACY_LIB="amd64" - fi - - - # OPENJDK_TARGET_CPU_ISADIR is normally empty. On 64-bit Solaris systems, it is set to - # /amd64 or /sparcv9. This string is appended to some library paths, like this: - # /usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libexample.so - OPENJDK_TARGET_CPU_ISADIR="" - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - if test "x$OPENJDK_TARGET_CPU" = xx86_64; then - OPENJDK_TARGET_CPU_ISADIR="/amd64" - elif test "x$OPENJDK_TARGET_CPU" = xsparcv9; then - OPENJDK_TARGET_CPU_ISADIR="/sparcv9" - fi - fi - - - # Setup OPENJDK_TARGET_CPU_OSARCH, which is used to set the os.arch Java system property - OPENJDK_TARGET_CPU_OSARCH="$OPENJDK_TARGET_CPU" - if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$OPENJDK_TARGET_CPU" = xx86; then - # On linux only, we replace x86 with i386. - OPENJDK_TARGET_CPU_OSARCH="i386" - elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then - # On all platforms except macosx, we replace x86_64 with amd64. - OPENJDK_TARGET_CPU_OSARCH="amd64" - fi - - - OPENJDK_TARGET_CPU_JLI="$OPENJDK_TARGET_CPU" - if test "x$OPENJDK_TARGET_CPU" = xx86; then - OPENJDK_TARGET_CPU_JLI="i386" - elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then - # On all platforms except macosx, we replace x86_64 with amd64. - OPENJDK_TARGET_CPU_JLI="amd64" - fi - - # The new version string in JDK 9 also defined new naming of OS and ARCH for bundles - # Macosx is osx and x86_64 is x64 - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - OPENJDK_TARGET_OS_BUNDLE="osx" - else - OPENJDK_TARGET_OS_BUNDLE="$OPENJDK_TARGET_OS" - fi - if test "x$OPENJDK_TARGET_CPU" = xx86_64; then - OPENJDK_TARGET_CPU_BUNDLE="x64" - else - OPENJDK_TARGET_CPU_BUNDLE="$OPENJDK_TARGET_CPU" - fi - OPENJDK_TARGET_BUNDLE_PLATFORM="${OPENJDK_TARGET_OS_BUNDLE}-${OPENJDK_TARGET_CPU_BUNDLE}" - - - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - # -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in - # unpack200.exe. This variable is used in - # FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER. - if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xmacosx; then - OPENJDK_TARGET_ADD_LP64="-D_LP64=1" - fi - fi - - if test "x$COMPILE_TYPE" = "xcross"; then - # FIXME: ... or should this include reduced builds..? - DEFINE_CROSS_COMPILE_ARCH="CROSS_COMPILE_ARCH:=$OPENJDK_TARGET_CPU_LEGACY" - else - DEFINE_CROSS_COMPILE_ARCH="" - fi - - - # Convert openjdk platform names to hotspot names - - HOTSPOT_TARGET_OS=${OPENJDK_TARGET_OS} - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - HOTSPOT_TARGET_OS=bsd - fi - - - HOTSPOT_TARGET_OS_TYPE=${OPENJDK_TARGET_OS_TYPE} - if test "x$OPENJDK_TARGET_OS_TYPE" = xunix; then - HOTSPOT_TARGET_OS_TYPE=posix - fi - - - HOTSPOT_TARGET_CPU=${OPENJDK_TARGET_CPU} - if test "x$OPENJDK_TARGET_CPU" = xx86; then - HOTSPOT_TARGET_CPU=x86_32 - elif test "x$OPENJDK_TARGET_CPU" = xsparcv9; then - HOTSPOT_TARGET_CPU=sparc - elif test "x$OPENJDK_TARGET_CPU" = xppc64; then - HOTSPOT_TARGET_CPU=ppc_64 - elif test "x$OPENJDK_TARGET_CPU" = xppc64le; then - HOTSPOT_TARGET_CPU=ppc_64 - fi - - - # This is identical with OPENJDK_*, but define anyway for consistency. - HOTSPOT_TARGET_CPU_ARCH=${OPENJDK_TARGET_CPU_ARCH} - - - # Setup HOTSPOT_TARGET_CPU_DEFINE - if test "x$OPENJDK_TARGET_CPU" = xx86; then - HOTSPOT_TARGET_CPU_DEFINE=IA32 - elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then - HOTSPOT_TARGET_CPU_DEFINE=AMD64 - elif test "x$OPENJDK_TARGET_CPU" = xsparcv9; then - HOTSPOT_TARGET_CPU_DEFINE=SPARC - elif test "x$OPENJDK_TARGET_CPU" = xaarch64; then - HOTSPOT_TARGET_CPU_DEFINE=AARCH64 - elif test "x$OPENJDK_TARGET_CPU" = xppc64; then - HOTSPOT_TARGET_CPU_DEFINE=PPC64 - elif test "x$OPENJDK_TARGET_CPU" = xppc64le; then - HOTSPOT_TARGET_CPU_DEFINE=PPC64 - - # The cpu defines below are for zero, we don't support them directly. - elif test "x$OPENJDK_TARGET_CPU" = xsparc; then - HOTSPOT_TARGET_CPU_DEFINE=SPARC - elif test "x$OPENJDK_TARGET_CPU" = xppc; then - HOTSPOT_TARGET_CPU_DEFINE=PPC32 - elif test "x$OPENJDK_TARGET_CPU" = xs390; then - HOTSPOT_TARGET_CPU_DEFINE=S390 - elif test "x$OPENJDK_TARGET_CPU" = xs390x; then - HOTSPOT_TARGET_CPU_DEFINE=S390 - elif test "x$OPENJDK_TARGET_CPU" != x; then - HOTSPOT_TARGET_CPU_DEFINE=$(echo $OPENJDK_TARGET_CPU | tr a-z A-Z) - fi - - - - - # Also store the legacy naming of the cpu. - # Ie i586 and amd64 instead of x86 and x86_64 - OPENJDK_BUILD_CPU_LEGACY="$OPENJDK_BUILD_CPU" - if test "x$OPENJDK_BUILD_CPU" = xx86; then - OPENJDK_BUILD_CPU_LEGACY="i586" - elif test "x$OPENJDK_BUILD_OS" != xmacosx && test "x$OPENJDK_BUILD_CPU" = xx86_64; then - # On all platforms except MacOSX replace x86_64 with amd64. - OPENJDK_BUILD_CPU_LEGACY="amd64" - elif test "x$OPENJDK_BUILD_CPU" = xalpha; then - # Avoid name collisions with variables named alpha - OPENJDK_BUILD_CPU_LEGACY="_alpha_" - elif test "x$OPENJDK_BUILD_CPU" = xsh; then - # Avoid name collisions with variables named sh - OPENJDK_BUILD_CPU_LEGACY="_sh_" - fi - - - # And the second legacy naming of the cpu. - # Ie i386 and amd64 instead of x86 and x86_64. - OPENJDK_BUILD_CPU_LEGACY_LIB="$OPENJDK_BUILD_CPU" - if test "x$OPENJDK_BUILD_CPU" = xx86; then - OPENJDK_BUILD_CPU_LEGACY_LIB="i386" - elif test "x$OPENJDK_BUILD_CPU" = xx86_64; then - OPENJDK_BUILD_CPU_LEGACY_LIB="amd64" - fi - - - # OPENJDK_BUILD_CPU_ISADIR is normally empty. On 64-bit Solaris systems, it is set to - # /amd64 or /sparcv9. This string is appended to some library paths, like this: - # /usr/lib${OPENJDK_BUILD_CPU_ISADIR}/libexample.so - OPENJDK_BUILD_CPU_ISADIR="" - if test "x$OPENJDK_BUILD_OS" = xsolaris; then - if test "x$OPENJDK_BUILD_CPU" = xx86_64; then - OPENJDK_BUILD_CPU_ISADIR="/amd64" - elif test "x$OPENJDK_BUILD_CPU" = xsparcv9; then - OPENJDK_BUILD_CPU_ISADIR="/sparcv9" - fi - fi - - - # Setup OPENJDK_BUILD_CPU_OSARCH, which is used to set the os.arch Java system property - OPENJDK_BUILD_CPU_OSARCH="$OPENJDK_BUILD_CPU" - if test "x$OPENJDK_BUILD_OS" = xlinux && test "x$OPENJDK_BUILD_CPU" = xx86; then - # On linux only, we replace x86 with i386. - OPENJDK_BUILD_CPU_OSARCH="i386" - elif test "x$OPENJDK_BUILD_OS" != xmacosx && test "x$OPENJDK_BUILD_CPU" = xx86_64; then - # On all platforms except macosx, we replace x86_64 with amd64. - OPENJDK_BUILD_CPU_OSARCH="amd64" - fi - - - OPENJDK_BUILD_CPU_JLI="$OPENJDK_BUILD_CPU" - if test "x$OPENJDK_BUILD_CPU" = xx86; then - OPENJDK_BUILD_CPU_JLI="i386" - elif test "x$OPENJDK_BUILD_OS" != xmacosx && test "x$OPENJDK_BUILD_CPU" = xx86_64; then - # On all platforms except macosx, we replace x86_64 with amd64. - OPENJDK_BUILD_CPU_JLI="amd64" - fi - - # The new version string in JDK 9 also defined new naming of OS and ARCH for bundles - # Macosx is osx and x86_64 is x64 - if test "x$OPENJDK_BUILD_OS" = xmacosx; then - OPENJDK_BUILD_OS_BUNDLE="osx" - else - OPENJDK_BUILD_OS_BUNDLE="$OPENJDK_TARGET_OS" - fi - if test "x$OPENJDK_BUILD_CPU" = xx86_64; then - OPENJDK_BUILD_CPU_BUNDLE="x64" - else - OPENJDK_BUILD_CPU_BUNDLE="$OPENJDK_BUILD_CPU" - fi - OPENJDK_BUILD_BUNDLE_PLATFORM="${OPENJDK_BUILD_OS_BUNDLE}-${OPENJDK_BUILD_CPU_BUNDLE}" - - - if test "x$OPENJDK_BUILD_CPU_BITS" = x64; then - # -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in - # unpack200.exe. This variable is used in - # FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER. - if test "x$OPENJDK_BUILD_OS" = xlinux || test "x$OPENJDK_BUILD_OS" = xmacosx; then - OPENJDK_BUILD_ADD_LP64="-D_LP64=1" - fi - fi - - if test "x$COMPILE_TYPE" = "xcross"; then - # FIXME: ... or should this include reduced builds..? - DEFINE_CROSS_COMPILE_ARCH="CROSS_COMPILE_ARCH:=$OPENJDK_BUILD_CPU_LEGACY" - else - DEFINE_CROSS_COMPILE_ARCH="" - fi - - - # Convert openjdk platform names to hotspot names - - HOTSPOT_BUILD_OS=${OPENJDK_BUILD_OS} - if test "x$OPENJDK_BUILD_OS" = xmacosx; then - HOTSPOT_BUILD_OS=bsd - fi - - - HOTSPOT_BUILD_OS_TYPE=${OPENJDK_BUILD_OS_TYPE} - if test "x$OPENJDK_BUILD_OS_TYPE" = xunix; then - HOTSPOT_BUILD_OS_TYPE=posix - fi - - - HOTSPOT_BUILD_CPU=${OPENJDK_BUILD_CPU} - if test "x$OPENJDK_BUILD_CPU" = xx86; then - HOTSPOT_BUILD_CPU=x86_32 - elif test "x$OPENJDK_BUILD_CPU" = xsparcv9; then - HOTSPOT_BUILD_CPU=sparc - elif test "x$OPENJDK_BUILD_CPU" = xppc64; then - HOTSPOT_BUILD_CPU=ppc_64 - elif test "x$OPENJDK_BUILD_CPU" = xppc64le; then - HOTSPOT_BUILD_CPU=ppc_64 - fi - - - # This is identical with OPENJDK_*, but define anyway for consistency. - HOTSPOT_BUILD_CPU_ARCH=${OPENJDK_BUILD_CPU_ARCH} - - - # Setup HOTSPOT_BUILD_CPU_DEFINE - if test "x$OPENJDK_BUILD_CPU" = xx86; then - HOTSPOT_BUILD_CPU_DEFINE=IA32 - elif test "x$OPENJDK_BUILD_CPU" = xx86_64; then - HOTSPOT_BUILD_CPU_DEFINE=AMD64 - elif test "x$OPENJDK_BUILD_CPU" = xsparcv9; then - HOTSPOT_BUILD_CPU_DEFINE=SPARC - elif test "x$OPENJDK_BUILD_CPU" = xaarch64; then - HOTSPOT_BUILD_CPU_DEFINE=AARCH64 - elif test "x$OPENJDK_BUILD_CPU" = xppc64; then - HOTSPOT_BUILD_CPU_DEFINE=PPC64 - elif test "x$OPENJDK_BUILD_CPU" = xppc64le; then - HOTSPOT_BUILD_CPU_DEFINE=PPC64 - - # The cpu defines below are for zero, we don't support them directly. - elif test "x$OPENJDK_BUILD_CPU" = xsparc; then - HOTSPOT_BUILD_CPU_DEFINE=SPARC - elif test "x$OPENJDK_BUILD_CPU" = xppc; then - HOTSPOT_BUILD_CPU_DEFINE=PPC32 - elif test "x$OPENJDK_BUILD_CPU" = xs390; then - HOTSPOT_BUILD_CPU_DEFINE=S390 - elif test "x$OPENJDK_BUILD_CPU" = xs390x; then - HOTSPOT_BUILD_CPU_DEFINE=S390 - elif test "x$OPENJDK_BUILD_CPU" != x; then - HOTSPOT_BUILD_CPU_DEFINE=$(echo $OPENJDK_BUILD_CPU | tr a-z A-Z) - fi - - - - - - -# Continue setting up basic stuff. Most remaining code require fundamental tools. - - # Save the current directory this script was started from - CURDIR="$PWD" - - # We might need to rewrite ORIGINAL_PATH, if it includes "#", to quote them - # for make. We couldn't do this when we retrieved ORIGINAL_PATH, since SED - # was not available at that time. - REWRITTEN_PATH=`$ECHO "$ORIGINAL_PATH" | $SED -e 's/#/\\\\#/g'` - if test "x$REWRITTEN_PATH" != "x$ORIGINAL_PATH"; then - ORIGINAL_PATH="$REWRITTEN_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting ORIGINAL_PATH to $REWRITTEN_PATH" >&5 -$as_echo "$as_me: Rewriting ORIGINAL_PATH to $REWRITTEN_PATH" >&6;} - fi - - if test "x$OPENJDK_TARGET_OS" = "xwindows"; then - PATH_SEP=";" - - SRC_ROOT_LENGTH=`$THEPWDCMD -L|$WC -m` - if test $SRC_ROOT_LENGTH -gt 100; then - as_fn_error $? "Your base path is too long. It is $SRC_ROOT_LENGTH characters long, but only 100 is supported" "$LINENO" 5 - fi - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking cygwin release" >&5 -$as_echo_n "checking cygwin release... " >&6; } - CYGWIN_VERSION=`$UNAME -r` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGWIN_VERSION" >&5 -$as_echo "$CYGWIN_VERSION" >&6; } - WINDOWS_ENV_VENDOR='cygwin' - WINDOWS_ENV_VERSION="$CYGWIN_VERSION" - - CYGWIN_VERSION_OLD=`$ECHO $CYGWIN_VERSION | $GREP -e '^1\.0-6'` - if test "x$CYGWIN_VERSION_OLD" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Your cygwin is too old. You are running $CYGWIN_VERSION, but at least cygwin 1.7 is required. Please upgrade." >&5 -$as_echo "$as_me: Your cygwin is too old. You are running $CYGWIN_VERSION, but at least cygwin 1.7 is required. Please upgrade." >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 - fi - if test "x$CYGPATH" = x; then - as_fn_error $? "Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking cygwin root directory as unix-style path" >&5 -$as_echo_n "checking cygwin root directory as unix-style path... " >&6; } - # The cmd output ends with Windows line endings (CR/LF) - cygwin_winpath_root=`cd / ; cmd /c cd | $TR -d '\r\n'` - # Force cygpath to report the proper root by including a trailing space, and then stripping it off again. - CYGWIN_ROOT_PATH=`$CYGPATH -u "$cygwin_winpath_root " | $CUT -f 1 -d " "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGWIN_ROOT_PATH" >&5 -$as_echo "$CYGWIN_ROOT_PATH" >&6; } - WINDOWS_ENV_ROOT_PATH="$CYGWIN_ROOT_PATH" - test_cygdrive_prefix=`$ECHO $CYGWIN_ROOT_PATH | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - as_fn_error $? "Your cygdrive prefix is not /cygdrive. This is currently not supported. Change with mount -c." "$LINENO" 5 - fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking msys release" >&5 -$as_echo_n "checking msys release... " >&6; } - MSYS_VERSION=`$UNAME -r` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSYS_VERSION" >&5 -$as_echo "$MSYS_VERSION" >&6; } - - WINDOWS_ENV_VENDOR='msys' - WINDOWS_ENV_VERSION="$MSYS_VERSION" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking msys root directory as unix-style path" >&5 -$as_echo_n "checking msys root directory as unix-style path... " >&6; } - # The cmd output ends with Windows line endings (CR/LF), the grep command will strip that away - MSYS_ROOT_PATH=`cd / ; cmd /c cd | $GREP ".*"` - - windows_path="$MSYS_ROOT_PATH" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - MSYS_ROOT_PATH="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - MSYS_ROOT_PATH="$unix_path" - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSYS_ROOT_PATH" >&5 -$as_echo "$MSYS_ROOT_PATH" >&6; } - WINDOWS_ENV_ROOT_PATH="$MSYS_ROOT_PATH" - else - as_fn_error $? "Unknown Windows environment. Neither cygwin nor msys was detected." "$LINENO" 5 - fi - - # Test if windows or unix (cygwin/msys) find is first in path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking what kind of 'find' is first on the PATH" >&5 -$as_echo_n "checking what kind of 'find' is first on the PATH... " >&6; } - FIND_BINARY_OUTPUT=`find --version 2>&1` - if test "x`echo $FIND_BINARY_OUTPUT | $GREP GNU`" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unix style" >&5 -$as_echo "unix style" >&6; } - elif test "x`echo $FIND_BINARY_OUTPUT | $GREP FIND`" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Windows" >&5 -$as_echo "Windows" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: Your path contains Windows tools (C:\Windows\system32) before your unix (cygwin or msys) tools." >&5 -$as_echo "$as_me: Your path contains Windows tools (C:\Windows\system32) before your unix (cygwin or msys) tools." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: This will not work. Please correct and make sure /usr/bin (or similar) is first in path." >&5 -$as_echo "$as_me: This will not work. Please correct and make sure /usr/bin (or similar) is first in path." >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5 -$as_echo "unknown" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: It seems that your find utility is non-standard." >&5 -$as_echo "$as_me: WARNING: It seems that your find utility is non-standard." >&2;} - fi - - else - PATH_SEP=":" - fi - - - # We get the top-level directory from the supporting wrappers. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for top-level directory" >&5 -$as_echo_n "checking for top-level directory... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TOPDIR" >&5 -$as_echo "$TOPDIR" >&6; } - - - # We can only call BASIC_FIXUP_PATH after BASIC_CHECK_PATHS_WINDOWS. - - # Only process if variable expands to non-empty - - if test "x$CURDIR" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$CURDIR" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CURDIR, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of CURDIR, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of CURDIR" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - CURDIR="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CURDIR to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting CURDIR to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$CURDIR" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - CURDIR="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CURDIR to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting CURDIR to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$CURDIR" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CURDIR, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of CURDIR, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of CURDIR, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - CURDIR="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - CURDIR="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - # Only process if variable expands to non-empty - - if test "x$TOPDIR" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$TOPDIR" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of TOPDIR, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of TOPDIR, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of TOPDIR" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - TOPDIR="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting TOPDIR to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting TOPDIR to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$TOPDIR" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - TOPDIR="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting TOPDIR to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting TOPDIR to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$TOPDIR" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of TOPDIR, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of TOPDIR, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of TOPDIR, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - TOPDIR="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - TOPDIR="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - # Locate the directory of this script. - AUTOCONF_DIR=$TOPDIR/make/autoconf - - # Setup username (for use in adhoc version strings etc) - # Outer [ ] to quote m4. - USERNAME=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'` - - - -# Check if it's a pure open build or if custom sources are to be used. - - # Check whether --enable-openjdk-only was given. -if test "${enable_openjdk_only+set}" = set; then : - enableval=$enable_openjdk_only; -else - enable_openjdk_only="no" -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if custom source is suppressed (openjdk-only)" >&5 -$as_echo_n "checking if custom source is suppressed (openjdk-only)... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_openjdk_only" >&5 -$as_echo "$enable_openjdk_only" >&6; } - if test "x$enable_openjdk_only" = "xyes"; then - SUPPRESS_CUSTOM_EXTENSIONS="true" - elif test "x$enable_openjdk_only" = "xno"; then - SUPPRESS_CUSTOM_EXTENSIONS="false" - else - as_fn_error $? "Invalid value for --enable-openjdk-only: $enable_openjdk_only" "$LINENO" 5 - fi - - # custom-make-dir is deprecated. Please use your custom-hook.m4 to override - # the IncludeCustomExtension macro. - - -# Check whether --with-custom-make-dir was given. -if test "${with_custom_make_dir+set}" = set; then : - withval=$with_custom_make_dir; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --with-custom-make-dir is deprecated and will be ignored." >&5 -$as_echo "$as_me: WARNING: Option --with-custom-make-dir is deprecated and will be ignored." >&2;} -fi - - - - -# These are needed to be able to create a configuration name (and thus the output directory) - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of the JDK to build" >&5 -$as_echo_n "checking which variant of the JDK to build... " >&6; } - -# Check whether --with-jdk-variant was given. -if test "${with_jdk_variant+set}" = set; then : - withval=$with_jdk_variant; -fi - - - if test "x$with_jdk_variant" = xnormal || test "x$with_jdk_variant" = x; then - JDK_VARIANT="normal" - else - as_fn_error $? "The available JDK variants are: normal" "$LINENO" 5 - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JDK_VARIANT" >&5 -$as_echo "$JDK_VARIANT" >&6; } - - - DEBUG_LEVEL="release" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which debug level to use" >&5 -$as_echo_n "checking which debug level to use... " >&6; } - # Check whether --enable-debug was given. -if test "${enable_debug+set}" = set; then : - enableval=$enable_debug; - ENABLE_DEBUG="${enableval}" - DEBUG_LEVEL="fastdebug" - -else - ENABLE_DEBUG="no" -fi - - - -# Check whether --with-debug-level was given. -if test "${with_debug_level+set}" = set; then : - withval=$with_debug_level; - DEBUG_LEVEL="${withval}" - if test "x$ENABLE_DEBUG" = xyes; then - as_fn_error $? "You cannot use both --enable-debug and --with-debug-level at the same time." "$LINENO" 5 - fi - -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEBUG_LEVEL" >&5 -$as_echo "$DEBUG_LEVEL" >&6; } - - if test "x$DEBUG_LEVEL" != xrelease && \ - test "x$DEBUG_LEVEL" != xoptimized && \ - test "x$DEBUG_LEVEL" != xfastdebug && \ - test "x$DEBUG_LEVEL" != xslowdebug; then - as_fn_error $? "Allowed debug levels are: release, fastdebug, slowdebug and optimized" "$LINENO" 5 - fi - - # Translate DEBUG_LEVEL to debug level used by Hotspot - HOTSPOT_DEBUG_LEVEL="$DEBUG_LEVEL" - if test "x$DEBUG_LEVEL" = xrelease; then - HOTSPOT_DEBUG_LEVEL="product" - elif test "x$DEBUG_LEVEL" = xslowdebug; then - HOTSPOT_DEBUG_LEVEL="debug" - fi - - if test "x$DEBUG_LEVEL" = xoptimized; then - # The debug level 'optimized' is a little special because it is currently only - # applicable to the HotSpot build where it means to build a completely - # optimized version of the VM without any debugging code (like for the - # 'release' debug level which is called 'product' in the HotSpot build) but - # with the exception that it can contain additional code which is otherwise - # protected by '#ifndef PRODUCT' macros. These 'optimized' builds are used to - # test new and/or experimental features which are not intended for customer - # shipment. Because these new features need to be tested and benchmarked in - # real world scenarios, we want to build the containing JDK at the 'release' - # debug level. - DEBUG_LEVEL="release" - fi - - - - - - -# Check whether --with-jvm-variants was given. -if test "${with_jvm_variants+set}" = set; then : - withval=$with_jvm_variants; -fi - - - - -# Check whether --with-cpu-port was given. -if test "${with_cpu_port+set}" = set; then : - withval=$with_cpu_port; -fi - - - if test "x$with_cpu_port" != x; then - if test "x$OPENJDK_TARGET_CPU" != xaarch64; then - as_fn_error $? "--with-cpu-port only available on aarch64" "$LINENO" 5 - fi - if test "x$with_cpu_port" != xarm64 && \ - test "x$with_cpu_port" != xaarch64; then - as_fn_error $? "--with-cpu-port must specify arm64 or aarch64" "$LINENO" 5 - fi - HOTSPOT_TARGET_CPU_PORT="$with_cpu_port" - fi - - - if test "x$with_jvm_variants" = x; then - with_jvm_variants="server" - fi - JVM_VARIANTS_OPT="$with_jvm_variants" - - # Has the user listed more than one variant? - # Additional [] needed to keep m4 from mangling shell constructs. - if [[ "$JVM_VARIANTS_OPT" =~ "," ]] ; then - BUILDING_MULTIPLE_JVM_VARIANTS=true - else - BUILDING_MULTIPLE_JVM_VARIANTS=false - fi - # Replace the commas with AND for use in the build directory name. - JVM_VARIANTS_WITH_AND=`$ECHO "$JVM_VARIANTS_OPT" | $SED -e 's/,/AND/g'` - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variants of the JVM to build" >&5 -$as_echo_n "checking which variants of the JVM to build... " >&6; } - # JVM_VARIANTS is a space-separated list. - # Also use minimal, not minimal1 (which is kept for backwards compatibility). - JVM_VARIANTS=`$ECHO $JVM_VARIANTS_OPT | $SED -e 's/,/ /g' -e 's/minimal1/minimal/'` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JVM_VARIANTS" >&5 -$as_echo "$JVM_VARIANTS" >&6; } - - # Check that the selected variants are valid - - # grep filter function inspired by a comment to http://stackoverflow.com/a/1617326 - # Notice that the original variant failes on SLES 10 and 11 - NEEDLE=${VALID_JVM_VARIANTS// /$'\n'} - STACK=${JVM_VARIANTS// /$'\n'} - INVALID_VARIANTS=`$GREP -Fvx "${NEEDLE}" <<< "${STACK}"` - if test "x$INVALID_VARIANTS" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Unknown variant(s) specified: $INVALID_VARIANTS" >&5 -$as_echo "$as_me: Unknown variant(s) specified: $INVALID_VARIANTS" >&6;} - as_fn_error $? "The available JVM variants are: $VALID_JVM_VARIANTS" "$LINENO" 5 - fi - - # All "special" variants share the same output directory ("server") - VALID_MULTIPLE_JVM_VARIANTS="server client minimal" - NEEDLE=${VALID_MULTIPLE_JVM_VARIANTS// /$'\n'} - STACK=${JVM_VARIANTS// /$'\n'} - INVALID_MULTIPLE_VARIANTS=`$GREP -Fvx "${NEEDLE}" <<< "${STACK}"` - if test "x$INVALID_MULTIPLE_VARIANTS" != x && test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = xtrue; then - as_fn_error $? "You cannot build multiple variants with anything else than $VALID_MULTIPLE_JVM_VARIANTS." "$LINENO" 5 - fi - - # The "main" variant is the one used by other libs to link against during the - # build. - if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xtrue"; then - MAIN_VARIANT_PRIO_ORDER="server client minimal" - for variant in $MAIN_VARIANT_PRIO_ORDER; do - if [[ " $JVM_VARIANTS " =~ " $variant " ]] ; then - JVM_VARIANT_MAIN="$variant" - break - fi - done - else - JVM_VARIANT_MAIN="$JVM_VARIANTS" - fi - - - - - - if [[ " $JVM_VARIANTS " =~ " zero " ]] ; then - # zero behaves as a platform and rewrites these values. This is really weird. :( - # We are guaranteed that we do not build any other variants when building zero. - HOTSPOT_TARGET_CPU=zero - HOTSPOT_TARGET_CPU_ARCH=zero - fi - - -# With basic setup done, call the custom early hook. - - -# Check if we have devkits, extra paths or sysroot set. - - -# Check whether --with-devkit was given. -if test "${with_devkit+set}" = set; then : - withval=$with_devkit; - - # Only process if variable expands to non-empty - - if test "x$with_devkit" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$with_devkit" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_devkit, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of with_devkit, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of with_devkit" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - with_devkit="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting with_devkit to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting with_devkit to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$with_devkit" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - with_devkit="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting with_devkit to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting with_devkit to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$with_devkit" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_devkit, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of with_devkit, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of with_devkit, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - with_devkit="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - with_devkit="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - DEVKIT_ROOT="$with_devkit" - # Check for a meta data info file in the root of the devkit - if test -f "$DEVKIT_ROOT/devkit.info"; then - . $DEVKIT_ROOT/devkit.info - # This potentially sets the following: - # A descriptive name of the devkit - - if test "x$DEVKIT_NAME" = x; then - eval DEVKIT_NAME="\${DEVKIT_NAME_${OPENJDK_TARGET_CPU}}" - fi - - # Corresponds to --with-extra-path - - if test "x$DEVKIT_EXTRA_PATH" = x; then - eval DEVKIT_EXTRA_PATH="\${DEVKIT_EXTRA_PATH_${OPENJDK_TARGET_CPU}}" - fi - - # Corresponds to --with-toolchain-path - - if test "x$DEVKIT_TOOLCHAIN_PATH" = x; then - eval DEVKIT_TOOLCHAIN_PATH="\${DEVKIT_TOOLCHAIN_PATH_${OPENJDK_TARGET_CPU}}" - fi - - # Corresponds to --with-sysroot - - if test "x$DEVKIT_SYSROOT" = x; then - eval DEVKIT_SYSROOT="\${DEVKIT_SYSROOT_${OPENJDK_TARGET_CPU}}" - fi - - - # Identifies the Visual Studio version in the devkit - - if test "x$DEVKIT_VS_VERSION" = x; then - eval DEVKIT_VS_VERSION="\${DEVKIT_VS_VERSION_${OPENJDK_TARGET_CPU}}" - fi - - # The Visual Studio include environment variable - - if test "x$DEVKIT_VS_INCLUDE" = x; then - eval DEVKIT_VS_INCLUDE="\${DEVKIT_VS_INCLUDE_${OPENJDK_TARGET_CPU}}" - fi - - # The Visual Studio lib environment variable - - if test "x$DEVKIT_VS_LIB" = x; then - eval DEVKIT_VS_LIB="\${DEVKIT_VS_LIB_${OPENJDK_TARGET_CPU}}" - fi - - # Corresponds to --with-msvcr-dll - - if test "x$DEVKIT_MSVCR_DLL" = x; then - eval DEVKIT_MSVCR_DLL="\${DEVKIT_MSVCR_DLL_${OPENJDK_TARGET_CPU}}" - fi - - # Corresponds to --with-msvcp-dll - - if test "x$DEVKIT_MSVCP_DLL" = x; then - eval DEVKIT_MSVCP_DLL="\${DEVKIT_MSVCP_DLL_${OPENJDK_TARGET_CPU}}" - fi - - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for devkit" >&5 -$as_echo_n "checking for devkit... " >&6; } - if test "x$DEVKIT_NAME" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEVKIT_NAME in $DEVKIT_ROOT" >&5 -$as_echo "$DEVKIT_NAME in $DEVKIT_ROOT" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEVKIT_ROOT" >&5 -$as_echo "$DEVKIT_ROOT" >&6; } - fi - - - if test "x$DEVKIT_EXTRA_PATH" != x; then - if test "x$EXTRA_PATH" = x; then - EXTRA_PATH="$DEVKIT_EXTRA_PATH" - else - EXTRA_PATH="$DEVKIT_EXTRA_PATH:$EXTRA_PATH" - fi - fi - - - # Fallback default of just /bin if DEVKIT_PATH is not defined - if test "x$DEVKIT_TOOLCHAIN_PATH" = x; then - DEVKIT_TOOLCHAIN_PATH="$DEVKIT_ROOT/bin" - fi - - if test "x$DEVKIT_TOOLCHAIN_PATH" != x; then - if test "x$TOOLCHAIN_PATH" = x; then - TOOLCHAIN_PATH="$DEVKIT_TOOLCHAIN_PATH" - else - TOOLCHAIN_PATH="$DEVKIT_TOOLCHAIN_PATH:$TOOLCHAIN_PATH" - fi - fi - - - # If DEVKIT_SYSROOT is set, use that, otherwise try a couple of known - # places for backwards compatiblity. - if test "x$DEVKIT_SYSROOT" != x; then - SYSROOT="$DEVKIT_SYSROOT" - elif test -d "$DEVKIT_ROOT/$host_alias/libc"; then - SYSROOT="$DEVKIT_ROOT/$host_alias/libc" - elif test -d "$DEVKIT_ROOT/$host/sys-root"; then - SYSROOT="$DEVKIT_ROOT/$host/sys-root" - fi - - if test "x$DEVKIT_ROOT" != x; then - DEVKIT_LIB_DIR="$DEVKIT_ROOT/lib" - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - DEVKIT_LIB_DIR="$DEVKIT_ROOT/lib64" - fi - - fi - - -fi - - - # You can force the sysroot if the sysroot encoded into the compiler tools - # is not correct. - -# Check whether --with-sys-root was given. -if test "${with_sys_root+set}" = set; then : - withval=$with_sys_root; SYSROOT=$with_sys_root - -fi - - - -# Check whether --with-sysroot was given. -if test "${with_sysroot+set}" = set; then : - withval=$with_sysroot; SYSROOT=$with_sysroot - -fi - - - -# Check whether --with-tools-dir was given. -if test "${with_tools_dir+set}" = set; then : - withval=$with_tools_dir; - if test "x$with_tools_dir" != x; then - if test "x$TOOLCHAIN_PATH" = x; then - TOOLCHAIN_PATH="$with_tools_dir" - else - TOOLCHAIN_PATH="$with_tools_dir:$TOOLCHAIN_PATH" - fi - fi - - -fi - - - -# Check whether --with-toolchain-path was given. -if test "${with_toolchain_path+set}" = set; then : - withval=$with_toolchain_path; - if test "x$with_toolchain_path" != x; then - if test "x$TOOLCHAIN_PATH" = x; then - TOOLCHAIN_PATH="$with_toolchain_path" - else - TOOLCHAIN_PATH="$with_toolchain_path:$TOOLCHAIN_PATH" - fi - fi - - -fi - - - -# Check whether --with-extra-path was given. -if test "${with_extra_path+set}" = set; then : - withval=$with_extra_path; - if test "x$with_extra_path" != x; then - if test "x$EXTRA_PATH" = x; then - EXTRA_PATH="$with_extra_path" - else - EXTRA_PATH="$with_extra_path:$EXTRA_PATH" - fi - fi - - -fi - - - if test "x$OPENJDK_BUILD_OS" = "xmacosx"; then - # If a devkit has been supplied, find xcodebuild in the toolchain_path. - # If not, detect if Xcode is installed by running xcodebuild -version - # if no Xcode installed, xcodebuild exits with 1 - # if Xcode is installed, even if xcode-select is misconfigured, then it exits with 0 - if test "x$DEVKIT_ROOT" != x || /usr/bin/xcodebuild -version >/dev/null 2>&1; then - # We need to use xcodebuild in the toolchain dir provided by the user, this will - # fall back on the stub binary in /usr/bin/xcodebuild - # Extract the first word of "xcodebuild", so it can be a program name with args. -set dummy xcodebuild; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_XCODEBUILD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $XCODEBUILD in - [\\/]* | ?:[\\/]*) - ac_cv_path_XCODEBUILD="$XCODEBUILD" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $TOOLCHAIN_PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_XCODEBUILD="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_XCODEBUILD" && ac_cv_path_XCODEBUILD="/usr/bin/xcodebuild" - ;; -esac -fi -XCODEBUILD=$ac_cv_path_XCODEBUILD -if test -n "$XCODEBUILD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XCODEBUILD" >&5 -$as_echo "$XCODEBUILD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - else - # this should result in SYSROOT being empty, unless --with-sysroot is provided - # when only the command line tools are installed there are no SDKs, so headers - # are copied into the system frameworks - XCODEBUILD= - - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sdk name" >&5 -$as_echo_n "checking for sdk name... " >&6; } - -# Check whether --with-sdk-name was given. -if test "${with_sdk_name+set}" = set; then : - withval=$with_sdk_name; SDKNAME=$with_sdk_name - -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SDKNAME" >&5 -$as_echo "$SDKNAME" >&6; } - - # if toolchain path is specified then don't rely on system headers, they may not compile - HAVE_SYSTEM_FRAMEWORK_HEADERS=0 - test -z "$TOOLCHAIN_PATH" && \ - HAVE_SYSTEM_FRAMEWORK_HEADERS=`test ! -f /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h; echo $?` - - if test -z "$SYSROOT"; then - if test -n "$XCODEBUILD"; then - # if we don't have system headers, use default SDK name (last resort) - if test -z "$SDKNAME" -a $HAVE_SYSTEM_FRAMEWORK_HEADERS -eq 0; then - SDKNAME=${SDKNAME:-macosx} - fi - - if test -n "$SDKNAME"; then - # Call xcodebuild to determine SYSROOT - SYSROOT=`"$XCODEBUILD" -sdk $SDKNAME -version | $GREP '^Path: ' | $SED 's/Path: //'` - fi - else - if test $HAVE_SYSTEM_FRAMEWORK_HEADERS -eq 0; then - as_fn_error $? "No xcodebuild tool and no system framework headers found, use --with-sysroot or --with-sdk-name to provide a path to a valid SDK" "$LINENO" 5 - fi - fi - else - # warn user if --with-sdk-name was also set - if test -n "$with_sdk_name"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Both SYSROOT and --with-sdk-name are set, only SYSROOT will be used" >&5 -$as_echo "$as_me: WARNING: Both SYSROOT and --with-sdk-name are set, only SYSROOT will be used" >&2;} - fi - fi - - if test $HAVE_SYSTEM_FRAMEWORK_HEADERS -eq 0 -a -z "$SYSROOT"; then - # If no system framework headers, then SYSROOT must be set, or we won't build - as_fn_error $? "Unable to determine SYSROOT and no headers found in /System/Library/Frameworks. Check Xcode configuration, --with-sysroot or --with-sdk-name arguments." "$LINENO" 5 - fi - - # Perform a basic sanity test - if test ! -f "$SYSROOT/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h"; then - if test -z "$SYSROOT"; then - as_fn_error $? "Unable to find required framework headers, provide a path to an SDK via --with-sysroot or --with-sdk-name and be sure Xcode is installed properly" "$LINENO" 5 - else - as_fn_error $? "Invalid SDK or SYSROOT path, dependent framework headers not found" "$LINENO" 5 - fi - fi - - # set SDKROOT too, Xcode tools will pick it up - SDKROOT="$SYSROOT" - - fi - - # Prepend the extra path to the global path - - if test "x$EXTRA_PATH" != x; then - if test "x$PATH" = x; then - PATH="$EXTRA_PATH" - else - PATH="$EXTRA_PATH:$PATH" - fi - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 -$as_echo_n "checking for sysroot... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SYSROOT" >&5 -$as_echo "$SYSROOT" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for toolchain path" >&5 -$as_echo_n "checking for toolchain path... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TOOLCHAIN_PATH" >&5 -$as_echo "$TOOLCHAIN_PATH" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for extra path" >&5 -$as_echo_n "checking for extra path... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $EXTRA_PATH" >&5 -$as_echo "$EXTRA_PATH" >&6; } - - -# To properly create a configuration name, we need to have the OpenJDK target -# and options (variants and debug level) parsed. - - - -# Check whether --with-conf-name was given. -if test "${with_conf_name+set}" = set; then : - withval=$with_conf_name; CONF_NAME=${with_conf_name} -fi - - - # Test from where we are running configure, in or outside of src root. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to store configuration" >&5 -$as_echo_n "checking where to store configuration... " >&6; } - if test "x$CURDIR" = "x$TOPDIR" || test "x$CURDIR" = "x$CUSTOM_ROOT" \ - || test "x$CURDIR" = "x$TOPDIR/make/autoconf" \ - || test "x$CURDIR" = "x$TOPDIR/make" ; then - # We are running configure from the src root. - # Create a default ./build/target-variant-debuglevel output root. - if test "x${CONF_NAME}" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: in default location" >&5 -$as_echo "in default location" >&6; } - CONF_NAME="${OPENJDK_TARGET_OS}-${OPENJDK_TARGET_CPU}-${JDK_VARIANT}-${JVM_VARIANTS_WITH_AND}-${DEBUG_LEVEL}" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: in build directory with custom name" >&5 -$as_echo "in build directory with custom name" >&6; } - fi - - if test "x$CUSTOM_ROOT" != x; then - OUTPUTDIR="${CUSTOM_ROOT}/build/${CONF_NAME}" - else - OUTPUTDIR="${TOPDIR}/build/${CONF_NAME}" - fi - $MKDIR -p "$OUTPUTDIR" - if test ! -d "$OUTPUTDIR"; then - as_fn_error $? "Could not create build directory $OUTPUTDIR" "$LINENO" 5 - fi - else - # We are running configure from outside of the src dir. - # Then use the current directory as output dir! - # If configuration is situated in normal build directory, just use the build - # directory name as configuration name, otherwise use the complete path. - if test "x${CONF_NAME}" = x; then - CONF_NAME=`$ECHO $CURDIR | $SED -e "s!^${TOPDIR}/build/!!"` - fi - OUTPUTDIR="$CURDIR" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: in current directory" >&5 -$as_echo "in current directory" >&6; } - - # WARNING: This might be a bad thing to do. You need to be sure you want to - # have a configuration in this directory. Do some sanity checks! - - if test ! -e "$OUTPUTDIR/spec.gmk"; then - # If we have a spec.gmk, we have run here before and we are OK. Otherwise, check for - # other files - files_present=`$LS $OUTPUTDIR` - # Configure has already touched config.log and confdefs.h in the current dir when this check - # is performed. - filtered_files=`$ECHO "$files_present" \ - | $SED -e 's/config.log//g' \ - -e 's/configure.log//g' \ - -e 's/confdefs.h//g' \ - -e 's/ //g' \ - | $TR -d '\n'` - if test "x$filtered_files" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Current directory is $CURDIR." >&5 -$as_echo "$as_me: Current directory is $CURDIR." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Since this is not the source root, configure will output the configuration here" >&5 -$as_echo "$as_me: Since this is not the source root, configure will output the configuration here" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (as opposed to creating a configuration in /build/)." >&5 -$as_echo "$as_me: (as opposed to creating a configuration in /build/)." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: However, this directory is not empty. This is not allowed, since it could" >&5 -$as_echo "$as_me: However, this directory is not empty. This is not allowed, since it could" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: seriously mess up just about everything." >&5 -$as_echo "$as_me: seriously mess up just about everything." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Try 'cd $TOPDIR' and restart configure" >&5 -$as_echo "$as_me: Try 'cd $TOPDIR' and restart configure" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (or create a new empty directory and cd to it)." >&5 -$as_echo "$as_me: (or create a new empty directory and cd to it)." >&6;} - as_fn_error $? "Will not continue creating configuration in $CURDIR" "$LINENO" 5 - fi - fi - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking what configuration name to use" >&5 -$as_echo_n "checking what configuration name to use... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CONF_NAME" >&5 -$as_echo "$CONF_NAME" >&6; } - - - # Only process if variable expands to non-empty - - if test "x$OUTPUTDIR" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$OUTPUTDIR" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OUTPUTDIR, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of OUTPUTDIR, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of OUTPUTDIR" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - OUTPUTDIR="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OUTPUTDIR to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting OUTPUTDIR to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$OUTPUTDIR" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - OUTPUTDIR="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OUTPUTDIR to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting OUTPUTDIR to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$OUTPUTDIR" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OUTPUTDIR, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of OUTPUTDIR, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of OUTPUTDIR, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - OUTPUTDIR="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - OUTPUTDIR="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - CONFIGURESUPPORT_OUTPUTDIR="$OUTPUTDIR/configure-support" - $MKDIR -p "$CONFIGURESUPPORT_OUTPUTDIR" - - SPEC="$OUTPUTDIR/spec.gmk" - - - - - - # The spec.gmk file contains all variables for the make system. - ac_config_files="$ac_config_files $OUTPUTDIR/spec.gmk:$AUTOCONF_DIR/spec.gmk.in" - - # The bootcycle-spec.gmk file contains support for boot cycle builds. - ac_config_files="$ac_config_files $OUTPUTDIR/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in" - - # The buildjdk-spec.gmk file contains support for building a buildjdk when cross compiling. - ac_config_files="$ac_config_files $OUTPUTDIR/buildjdk-spec.gmk:$AUTOCONF_DIR/buildjdk-spec.gmk.in" - - # The compare.sh is used to compare the build output to other builds. - ac_config_files="$ac_config_files $OUTPUTDIR/compare.sh:$AUTOCONF_DIR/compare.sh.in" - - # The generated Makefile knows where the spec.gmk is and where the source is. - # You can run make from the OUTPUTDIR, or from the top-level Makefile - # which will look for generated configurations - ac_config_files="$ac_config_files $OUTPUTDIR/Makefile:$AUTOCONF_DIR/Makefile.in" - - - -# Must be done before we can call HELP_MSG_MISSING_DEPENDENCY. - - for ac_prog in apt-get yum brew port pkgutil pkgadd -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_PKGHANDLER+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$PKGHANDLER"; then - ac_cv_prog_PKGHANDLER="$PKGHANDLER" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_PKGHANDLER="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -PKGHANDLER=$ac_cv_prog_PKGHANDLER -if test -n "$PKGHANDLER"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGHANDLER" >&5 -$as_echo "$PKGHANDLER" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$PKGHANDLER" && break -done - - - -# Setup tools that requires more complex handling, or that is not needed by the configure script. - - - - # Publish this variable in the help. - - - if [ -z "${MAKE+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - - # Try our hardest to locate a correct version of GNU make - for ac_prog in gmake -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CHECK_GMAKE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CHECK_GMAKE in - [\\/]* | ?:[\\/]*) - ac_cv_path_CHECK_GMAKE="$CHECK_GMAKE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CHECK_GMAKE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CHECK_GMAKE=$ac_cv_path_CHECK_GMAKE -if test -n "$CHECK_GMAKE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHECK_GMAKE" >&5 -$as_echo "$CHECK_GMAKE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CHECK_GMAKE" && break -done - - - MAKE_CANDIDATE=""$CHECK_GMAKE"" - DESCRIPTION="gmake in PATH" - - # On Cygwin, we require a newer version of make than on other platforms - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - MAKE_VERSION_EXPR="-e 4\." - MAKE_REQUIRED_VERSION="4.0" - else - MAKE_VERSION_EXPR="-e 3\.8[12] -e 4\." - MAKE_REQUIRED_VERSION="3.81" - fi - - if test "x$MAKE_CANDIDATE" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5 -$as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&6;} - MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1` - IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'` - if test "x$IS_GNU_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 -$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} - else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP $MAKE_VERSION_EXPR` - if test "x$IS_MODERN_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version $MAKE_REQUIRED_VERSION or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 -$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version $MAKE_REQUIRED_VERSION or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} - else - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - MAKE_EXPECTED_ENV='cygwin' - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - MAKE_EXPECTED_ENV='msys' - else - as_fn_error $? "Unknown Windows environment" "$LINENO" 5 - fi - MAKE_BUILT_FOR=`$MAKE_CANDIDATE --version | $GREP -i 'built for'` - IS_MAKE_CORRECT_ENV=`$ECHO $MAKE_BUILT_FOR | $GREP $MAKE_EXPECTED_ENV` - else - # Not relevant for non-Windows - IS_MAKE_CORRECT_ENV=true - fi - if test "x$IS_MAKE_CORRECT_ENV" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&5 -$as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&6;} - else - FOUND_MAKE=$MAKE_CANDIDATE - - # Only process if variable expands to non-empty - - if test "x$FOUND_MAKE" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - FOUND_MAKE="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;} - fi - fi - - fi - fi - fi - fi - - - if test "x$FOUND_MAKE" = x; then - for ac_prog in make -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CHECK_MAKE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CHECK_MAKE in - [\\/]* | ?:[\\/]*) - ac_cv_path_CHECK_MAKE="$CHECK_MAKE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CHECK_MAKE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CHECK_MAKE=$ac_cv_path_CHECK_MAKE -if test -n "$CHECK_MAKE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHECK_MAKE" >&5 -$as_echo "$CHECK_MAKE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CHECK_MAKE" && break -done - - - MAKE_CANDIDATE=""$CHECK_MAKE"" - DESCRIPTION="make in PATH" - - # On Cygwin, we require a newer version of make than on other platforms - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - MAKE_VERSION_EXPR="-e 4\." - MAKE_REQUIRED_VERSION="4.0" - else - MAKE_VERSION_EXPR="-e 3\.8[12] -e 4\." - MAKE_REQUIRED_VERSION="3.81" - fi - - if test "x$MAKE_CANDIDATE" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5 -$as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&6;} - MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1` - IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'` - if test "x$IS_GNU_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 -$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} - else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP $MAKE_VERSION_EXPR` - if test "x$IS_MODERN_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version $MAKE_REQUIRED_VERSION or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 -$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version $MAKE_REQUIRED_VERSION or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} - else - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - MAKE_EXPECTED_ENV='cygwin' - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - MAKE_EXPECTED_ENV='msys' - else - as_fn_error $? "Unknown Windows environment" "$LINENO" 5 - fi - MAKE_BUILT_FOR=`$MAKE_CANDIDATE --version | $GREP -i 'built for'` - IS_MAKE_CORRECT_ENV=`$ECHO $MAKE_BUILT_FOR | $GREP $MAKE_EXPECTED_ENV` - else - # Not relevant for non-Windows - IS_MAKE_CORRECT_ENV=true - fi - if test "x$IS_MAKE_CORRECT_ENV" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&5 -$as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&6;} - else - FOUND_MAKE=$MAKE_CANDIDATE - - # Only process if variable expands to non-empty - - if test "x$FOUND_MAKE" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - FOUND_MAKE="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;} - fi - fi - - fi - fi - fi - fi - - fi - - if test "x$FOUND_MAKE" = x; then - if test "x$TOOLCHAIN_PATH" != x; then - # We have a toolchain path, check that as well before giving up. - OLD_PATH=$PATH - PATH=$TOOLCHAIN_PATH:$PATH - for ac_prog in gmake -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CHECK_TOOLSDIR_GMAKE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CHECK_TOOLSDIR_GMAKE in - [\\/]* | ?:[\\/]*) - ac_cv_path_CHECK_TOOLSDIR_GMAKE="$CHECK_TOOLSDIR_GMAKE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CHECK_TOOLSDIR_GMAKE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CHECK_TOOLSDIR_GMAKE=$ac_cv_path_CHECK_TOOLSDIR_GMAKE -if test -n "$CHECK_TOOLSDIR_GMAKE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHECK_TOOLSDIR_GMAKE" >&5 -$as_echo "$CHECK_TOOLSDIR_GMAKE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CHECK_TOOLSDIR_GMAKE" && break -done - - - MAKE_CANDIDATE=""$CHECK_TOOLSDIR_GMAKE"" - DESCRIPTION="gmake in tools-dir" - - # On Cygwin, we require a newer version of make than on other platforms - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - MAKE_VERSION_EXPR="-e 4\." - MAKE_REQUIRED_VERSION="4.0" - else - MAKE_VERSION_EXPR="-e 3\.8[12] -e 4\." - MAKE_REQUIRED_VERSION="3.81" - fi - - if test "x$MAKE_CANDIDATE" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5 -$as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&6;} - MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1` - IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'` - if test "x$IS_GNU_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 -$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} - else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP $MAKE_VERSION_EXPR` - if test "x$IS_MODERN_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version $MAKE_REQUIRED_VERSION or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 -$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version $MAKE_REQUIRED_VERSION or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} - else - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - MAKE_EXPECTED_ENV='cygwin' - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - MAKE_EXPECTED_ENV='msys' - else - as_fn_error $? "Unknown Windows environment" "$LINENO" 5 - fi - MAKE_BUILT_FOR=`$MAKE_CANDIDATE --version | $GREP -i 'built for'` - IS_MAKE_CORRECT_ENV=`$ECHO $MAKE_BUILT_FOR | $GREP $MAKE_EXPECTED_ENV` - else - # Not relevant for non-Windows - IS_MAKE_CORRECT_ENV=true - fi - if test "x$IS_MAKE_CORRECT_ENV" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&5 -$as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&6;} - else - FOUND_MAKE=$MAKE_CANDIDATE - - # Only process if variable expands to non-empty - - if test "x$FOUND_MAKE" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - FOUND_MAKE="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;} - fi - fi - - fi - fi - fi - fi - - if test "x$FOUND_MAKE" = x; then - for ac_prog in make -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CHECK_TOOLSDIR_MAKE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CHECK_TOOLSDIR_MAKE in - [\\/]* | ?:[\\/]*) - ac_cv_path_CHECK_TOOLSDIR_MAKE="$CHECK_TOOLSDIR_MAKE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CHECK_TOOLSDIR_MAKE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CHECK_TOOLSDIR_MAKE=$ac_cv_path_CHECK_TOOLSDIR_MAKE -if test -n "$CHECK_TOOLSDIR_MAKE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHECK_TOOLSDIR_MAKE" >&5 -$as_echo "$CHECK_TOOLSDIR_MAKE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CHECK_TOOLSDIR_MAKE" && break -done - - - MAKE_CANDIDATE=""$CHECK_TOOLSDIR_MAKE"" - DESCRIPTION="make in tools-dir" - - # On Cygwin, we require a newer version of make than on other platforms - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - MAKE_VERSION_EXPR="-e 4\." - MAKE_REQUIRED_VERSION="4.0" - else - MAKE_VERSION_EXPR="-e 3\.8[12] -e 4\." - MAKE_REQUIRED_VERSION="3.81" - fi - - if test "x$MAKE_CANDIDATE" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5 -$as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&6;} - MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1` - IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'` - if test "x$IS_GNU_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 -$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} - else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP $MAKE_VERSION_EXPR` - if test "x$IS_MODERN_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version $MAKE_REQUIRED_VERSION or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 -$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version $MAKE_REQUIRED_VERSION or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} - else - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - MAKE_EXPECTED_ENV='cygwin' - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - MAKE_EXPECTED_ENV='msys' - else - as_fn_error $? "Unknown Windows environment" "$LINENO" 5 - fi - MAKE_BUILT_FOR=`$MAKE_CANDIDATE --version | $GREP -i 'built for'` - IS_MAKE_CORRECT_ENV=`$ECHO $MAKE_BUILT_FOR | $GREP $MAKE_EXPECTED_ENV` - else - # Not relevant for non-Windows - IS_MAKE_CORRECT_ENV=true - fi - if test "x$IS_MAKE_CORRECT_ENV" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&5 -$as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&6;} - else - FOUND_MAKE=$MAKE_CANDIDATE - - # Only process if variable expands to non-empty - - if test "x$FOUND_MAKE" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - FOUND_MAKE="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;} - fi - fi - - fi - fi - fi - fi - - fi - PATH=$OLD_PATH - fi - fi - - if test "x$FOUND_MAKE" = x; then - as_fn_error $? "Cannot find GNU make $MAKE_REQUIRED_VERSION or newer! Please put it in the path, or add e.g. MAKE=/opt/gmake3.81/make as argument to configure." "$LINENO" 5 - fi - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !MAKE! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!MAKE!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xMAKE" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of MAKE from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of MAKE from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - - # Try our hardest to locate a correct version of GNU make - for ac_prog in gmake -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CHECK_GMAKE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CHECK_GMAKE in - [\\/]* | ?:[\\/]*) - ac_cv_path_CHECK_GMAKE="$CHECK_GMAKE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CHECK_GMAKE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CHECK_GMAKE=$ac_cv_path_CHECK_GMAKE -if test -n "$CHECK_GMAKE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHECK_GMAKE" >&5 -$as_echo "$CHECK_GMAKE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CHECK_GMAKE" && break -done - - - MAKE_CANDIDATE=""$CHECK_GMAKE"" - DESCRIPTION="gmake in PATH" - - # On Cygwin, we require a newer version of make than on other platforms - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - MAKE_VERSION_EXPR="-e 4\." - MAKE_REQUIRED_VERSION="4.0" - else - MAKE_VERSION_EXPR="-e 3\.8[12] -e 4\." - MAKE_REQUIRED_VERSION="3.81" - fi - - if test "x$MAKE_CANDIDATE" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5 -$as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&6;} - MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1` - IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'` - if test "x$IS_GNU_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 -$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} - else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP $MAKE_VERSION_EXPR` - if test "x$IS_MODERN_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version $MAKE_REQUIRED_VERSION or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 -$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version $MAKE_REQUIRED_VERSION or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} - else - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - MAKE_EXPECTED_ENV='cygwin' - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - MAKE_EXPECTED_ENV='msys' - else - as_fn_error $? "Unknown Windows environment" "$LINENO" 5 - fi - MAKE_BUILT_FOR=`$MAKE_CANDIDATE --version | $GREP -i 'built for'` - IS_MAKE_CORRECT_ENV=`$ECHO $MAKE_BUILT_FOR | $GREP $MAKE_EXPECTED_ENV` - else - # Not relevant for non-Windows - IS_MAKE_CORRECT_ENV=true - fi - if test "x$IS_MAKE_CORRECT_ENV" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&5 -$as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&6;} - else - FOUND_MAKE=$MAKE_CANDIDATE - - # Only process if variable expands to non-empty - - if test "x$FOUND_MAKE" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - FOUND_MAKE="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;} - fi - fi - - fi - fi - fi - fi - - - if test "x$FOUND_MAKE" = x; then - for ac_prog in make -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CHECK_MAKE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CHECK_MAKE in - [\\/]* | ?:[\\/]*) - ac_cv_path_CHECK_MAKE="$CHECK_MAKE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CHECK_MAKE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CHECK_MAKE=$ac_cv_path_CHECK_MAKE -if test -n "$CHECK_MAKE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHECK_MAKE" >&5 -$as_echo "$CHECK_MAKE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CHECK_MAKE" && break -done - - - MAKE_CANDIDATE=""$CHECK_MAKE"" - DESCRIPTION="make in PATH" - - # On Cygwin, we require a newer version of make than on other platforms - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - MAKE_VERSION_EXPR="-e 4\." - MAKE_REQUIRED_VERSION="4.0" - else - MAKE_VERSION_EXPR="-e 3\.8[12] -e 4\." - MAKE_REQUIRED_VERSION="3.81" - fi - - if test "x$MAKE_CANDIDATE" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5 -$as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&6;} - MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1` - IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'` - if test "x$IS_GNU_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 -$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} - else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP $MAKE_VERSION_EXPR` - if test "x$IS_MODERN_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version $MAKE_REQUIRED_VERSION or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 -$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version $MAKE_REQUIRED_VERSION or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} - else - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - MAKE_EXPECTED_ENV='cygwin' - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - MAKE_EXPECTED_ENV='msys' - else - as_fn_error $? "Unknown Windows environment" "$LINENO" 5 - fi - MAKE_BUILT_FOR=`$MAKE_CANDIDATE --version | $GREP -i 'built for'` - IS_MAKE_CORRECT_ENV=`$ECHO $MAKE_BUILT_FOR | $GREP $MAKE_EXPECTED_ENV` - else - # Not relevant for non-Windows - IS_MAKE_CORRECT_ENV=true - fi - if test "x$IS_MAKE_CORRECT_ENV" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&5 -$as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&6;} - else - FOUND_MAKE=$MAKE_CANDIDATE - - # Only process if variable expands to non-empty - - if test "x$FOUND_MAKE" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - FOUND_MAKE="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;} - fi - fi - - fi - fi - fi - fi - - fi - - if test "x$FOUND_MAKE" = x; then - if test "x$TOOLCHAIN_PATH" != x; then - # We have a toolchain path, check that as well before giving up. - OLD_PATH=$PATH - PATH=$TOOLCHAIN_PATH:$PATH - for ac_prog in gmake -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CHECK_TOOLSDIR_GMAKE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CHECK_TOOLSDIR_GMAKE in - [\\/]* | ?:[\\/]*) - ac_cv_path_CHECK_TOOLSDIR_GMAKE="$CHECK_TOOLSDIR_GMAKE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CHECK_TOOLSDIR_GMAKE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CHECK_TOOLSDIR_GMAKE=$ac_cv_path_CHECK_TOOLSDIR_GMAKE -if test -n "$CHECK_TOOLSDIR_GMAKE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHECK_TOOLSDIR_GMAKE" >&5 -$as_echo "$CHECK_TOOLSDIR_GMAKE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CHECK_TOOLSDIR_GMAKE" && break -done - - - MAKE_CANDIDATE=""$CHECK_TOOLSDIR_GMAKE"" - DESCRIPTION="gmake in tools-dir" - - # On Cygwin, we require a newer version of make than on other platforms - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - MAKE_VERSION_EXPR="-e 4\." - MAKE_REQUIRED_VERSION="4.0" - else - MAKE_VERSION_EXPR="-e 3\.8[12] -e 4\." - MAKE_REQUIRED_VERSION="3.81" - fi - - if test "x$MAKE_CANDIDATE" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5 -$as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&6;} - MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1` - IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'` - if test "x$IS_GNU_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 -$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} - else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP $MAKE_VERSION_EXPR` - if test "x$IS_MODERN_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version $MAKE_REQUIRED_VERSION or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 -$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version $MAKE_REQUIRED_VERSION or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} - else - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - MAKE_EXPECTED_ENV='cygwin' - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - MAKE_EXPECTED_ENV='msys' - else - as_fn_error $? "Unknown Windows environment" "$LINENO" 5 - fi - MAKE_BUILT_FOR=`$MAKE_CANDIDATE --version | $GREP -i 'built for'` - IS_MAKE_CORRECT_ENV=`$ECHO $MAKE_BUILT_FOR | $GREP $MAKE_EXPECTED_ENV` - else - # Not relevant for non-Windows - IS_MAKE_CORRECT_ENV=true - fi - if test "x$IS_MAKE_CORRECT_ENV" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&5 -$as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&6;} - else - FOUND_MAKE=$MAKE_CANDIDATE - - # Only process if variable expands to non-empty - - if test "x$FOUND_MAKE" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - FOUND_MAKE="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;} - fi - fi - - fi - fi - fi - fi - - if test "x$FOUND_MAKE" = x; then - for ac_prog in make -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CHECK_TOOLSDIR_MAKE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CHECK_TOOLSDIR_MAKE in - [\\/]* | ?:[\\/]*) - ac_cv_path_CHECK_TOOLSDIR_MAKE="$CHECK_TOOLSDIR_MAKE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CHECK_TOOLSDIR_MAKE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CHECK_TOOLSDIR_MAKE=$ac_cv_path_CHECK_TOOLSDIR_MAKE -if test -n "$CHECK_TOOLSDIR_MAKE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHECK_TOOLSDIR_MAKE" >&5 -$as_echo "$CHECK_TOOLSDIR_MAKE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CHECK_TOOLSDIR_MAKE" && break -done - - - MAKE_CANDIDATE=""$CHECK_TOOLSDIR_MAKE"" - DESCRIPTION="make in tools-dir" - - # On Cygwin, we require a newer version of make than on other platforms - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - MAKE_VERSION_EXPR="-e 4\." - MAKE_REQUIRED_VERSION="4.0" - else - MAKE_VERSION_EXPR="-e 3\.8[12] -e 4\." - MAKE_REQUIRED_VERSION="3.81" - fi - - if test "x$MAKE_CANDIDATE" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5 -$as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&6;} - MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1` - IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'` - if test "x$IS_GNU_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 -$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} - else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP $MAKE_VERSION_EXPR` - if test "x$IS_MODERN_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version $MAKE_REQUIRED_VERSION or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 -$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version $MAKE_REQUIRED_VERSION or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} - else - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - MAKE_EXPECTED_ENV='cygwin' - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - MAKE_EXPECTED_ENV='msys' - else - as_fn_error $? "Unknown Windows environment" "$LINENO" 5 - fi - MAKE_BUILT_FOR=`$MAKE_CANDIDATE --version | $GREP -i 'built for'` - IS_MAKE_CORRECT_ENV=`$ECHO $MAKE_BUILT_FOR | $GREP $MAKE_EXPECTED_ENV` - else - # Not relevant for non-Windows - IS_MAKE_CORRECT_ENV=true - fi - if test "x$IS_MAKE_CORRECT_ENV" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&5 -$as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&6;} - else - FOUND_MAKE=$MAKE_CANDIDATE - - # Only process if variable expands to non-empty - - if test "x$FOUND_MAKE" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - FOUND_MAKE="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;} - fi - fi - - fi - fi - fi - fi - - fi - PATH=$OLD_PATH - fi - fi - - if test "x$FOUND_MAKE" = x; then - as_fn_error $? "Cannot find GNU make $MAKE_REQUIRED_VERSION or newer! Please put it in the path, or add e.g. MAKE=/opt/gmake3.81/make as argument to configure." "$LINENO" 5 - fi - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool MAKE= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool MAKE= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAKE" >&5 -$as_echo_n "checking for MAKE... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$MAKE" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool MAKE=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool MAKE=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MAKE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MAKE in - [\\/]* | ?:[\\/]*) - ac_cv_path_MAKE="$MAKE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_MAKE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -MAKE=$ac_cv_path_MAKE -if test -n "$MAKE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5 -$as_echo "$MAKE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$MAKE" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool MAKE=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool MAKE=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAKE" >&5 -$as_echo_n "checking for MAKE... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool MAKE=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - # If MAKE was set by user, verify the version - - MAKE_CANDIDATE=""$MAKE"" - DESCRIPTION="user supplied MAKE=$MAKE" - - # On Cygwin, we require a newer version of make than on other platforms - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - MAKE_VERSION_EXPR="-e 4\." - MAKE_REQUIRED_VERSION="4.0" - else - MAKE_VERSION_EXPR="-e 3\.8[12] -e 4\." - MAKE_REQUIRED_VERSION="3.81" - fi - - if test "x$MAKE_CANDIDATE" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5 -$as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&6;} - MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1` - IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'` - if test "x$IS_GNU_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 -$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} - else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP $MAKE_VERSION_EXPR` - if test "x$IS_MODERN_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version $MAKE_REQUIRED_VERSION or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 -$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version $MAKE_REQUIRED_VERSION or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} - else - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - MAKE_EXPECTED_ENV='cygwin' - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - MAKE_EXPECTED_ENV='msys' - else - as_fn_error $? "Unknown Windows environment" "$LINENO" 5 - fi - MAKE_BUILT_FOR=`$MAKE_CANDIDATE --version | $GREP -i 'built for'` - IS_MAKE_CORRECT_ENV=`$ECHO $MAKE_BUILT_FOR | $GREP $MAKE_EXPECTED_ENV` - else - # Not relevant for non-Windows - IS_MAKE_CORRECT_ENV=true - fi - if test "x$IS_MAKE_CORRECT_ENV" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&5 -$as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&6;} - else - FOUND_MAKE=$MAKE_CANDIDATE - - # Only process if variable expands to non-empty - - if test "x$FOUND_MAKE" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$FOUND_MAKE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - FOUND_MAKE="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;} - fi - fi - - fi - fi - fi - fi - - if test "x$FOUND_MAKE" = x; then - as_fn_error $? "The specified make (by MAKE=$MAKE) is not GNU make $MAKE_REQUIRED_VERSION or newer." "$LINENO" 5 - fi - - fi - - - MAKE=$FOUND_MAKE - - { $as_echo "$as_me:${as_lineno-$LINENO}: Using GNU make at $FOUND_MAKE (version: $MAKE_VERSION_STRING)" >&5 -$as_echo "$as_me: Using GNU make at $FOUND_MAKE (version: $MAKE_VERSION_STRING)" >&6;} - - - # Check if make supports the output sync option and if so, setup using it. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if make --output-sync is supported" >&5 -$as_echo_n "checking if make --output-sync is supported... " >&6; } - if $MAKE --version -O > /dev/null 2>&1; then - OUTPUT_SYNC_SUPPORTED=true - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for output-sync value" >&5 -$as_echo_n "checking for output-sync value... " >&6; } - -# Check whether --with-output-sync was given. -if test "${with_output_sync+set}" = set; then : - withval=$with_output_sync; OUTPUT_SYNC=$with_output_sync -fi - - if test "x$OUTPUT_SYNC" = "x"; then - OUTPUT_SYNC=none - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OUTPUT_SYNC" >&5 -$as_echo "$OUTPUT_SYNC" >&6; } - if ! $MAKE --version -O$OUTPUT_SYNC > /dev/null 2>&1; then - as_fn_error $? "Make did not the support the value $OUTPUT_SYNC as output sync type." "$LINENO" 5 - fi - else - OUTPUT_SYNC_SUPPORTED=false - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - - - - - - - # Test if find supports -delete - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if find supports -delete" >&5 -$as_echo_n "checking if find supports -delete... " >&6; } - FIND_DELETE="-delete" - - DELETEDIR=`$MKTEMP -d tmp.XXXXXXXXXX` || (echo Could not create temporary directory!; exit $?) - - echo Hejsan > $DELETEDIR/TestIfFindSupportsDelete - - TEST_DELETE=`$FIND "$DELETEDIR" -name TestIfFindSupportsDelete $FIND_DELETE 2>&1` - if test -f $DELETEDIR/TestIfFindSupportsDelete; then - # No, it does not. - $RM $DELETEDIR/TestIfFindSupportsDelete - if test "x$OPENJDK_TARGET_OS" = "xaix"; then - # AIX 'find' is buggy if called with '-exec {} \+' and an empty file list - FIND_DELETE="-print | $XARGS $RM" - else - FIND_DELETE="-exec $RM \{\} \+" - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - fi - $RMDIR $DELETEDIR - - - - # Test which kind of tar was found - if test "x$($TAR --version | $GREP "GNU tar")" != "x"; then - TAR_TYPE="gnu" - elif test "x$($TAR --version | $GREP "bsdtar")" != "x"; then - TAR_TYPE="bsd" - elif test "x$($TAR -v | $GREP "bsdtar")" != "x"; then - TAR_TYPE="bsd" - elif test "x$OPENJDK_BUILD_OS" = "xsolaris"; then - TAR_TYPE="solaris" - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking what type of tar was found" >&5 -$as_echo_n "checking what type of tar was found... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR_TYPE" >&5 -$as_echo "$TAR_TYPE" >&6; } - - TAR_CREATE_FILE_PARAM="" - - if test "x$TAR_TYPE" = "xgnu"; then - TAR_INCLUDE_PARAM="T" - TAR_SUPPORTS_TRANSFORM="true" - if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then - # When using gnu tar for Solaris targets, need to use compatibility mode - TAR_CREATE_EXTRA_PARAM="--format=ustar" - fi - else - TAR_INCLUDE_PARAM="I" - TAR_SUPPORTS_TRANSFORM="false" - fi - - - - - - - # Test that grep supports -Fx with a list of pattern which includes null pattern. - # This is a problem for the grep resident on AIX. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking that grep ($GREP) -Fx handles empty lines in the pattern list correctly" >&5 -$as_echo_n "checking that grep ($GREP) -Fx handles empty lines in the pattern list correctly... " >&6; } - # Multiple subsequent spaces.. - STACK_SPACES='aaa bbb ccc' - # ..converted to subsequent newlines, causes STACK_LIST to be a list with some empty - # patterns in it. - STACK_LIST=${STACK_SPACES// /$'\n'} - NEEDLE_SPACES='ccc bbb aaa' - NEEDLE_LIST=${NEEDLE_SPACES// /$'\n'} - RESULT="$($GREP -Fvx "$STACK_LIST" <<< "$NEEDLE_LIST")" - if test "x$RESULT" == "x"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - if test "x$OPENJDK_TARGET_OS" = "xaix"; then - ADDINFO="Please make sure you use GNU grep, usually found at /opt/freeware/bin." - fi - as_fn_error $? "grep does not handle -Fx correctly. ${ADDINFO}" "$LINENO" 5 - fi - - - # These tools might not be installed by default, - # need hint on how to install them. - - - - # Publish this variable in the help. - - - if [ -z "${UNZIP+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in unzip -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_UNZIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $UNZIP in - [\\/]* | ?:[\\/]*) - ac_cv_path_UNZIP="$UNZIP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_UNZIP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -UNZIP=$ac_cv_path_UNZIP -if test -n "$UNZIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNZIP" >&5 -$as_echo "$UNZIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$UNZIP" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !UNZIP! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!UNZIP!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xUNZIP" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of UNZIP from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of UNZIP from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in unzip -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_UNZIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $UNZIP in - [\\/]* | ?:[\\/]*) - ac_cv_path_UNZIP="$UNZIP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_UNZIP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -UNZIP=$ac_cv_path_UNZIP -if test -n "$UNZIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNZIP" >&5 -$as_echo "$UNZIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$UNZIP" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$UNZIP" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool UNZIP= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool UNZIP= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for UNZIP" >&5 -$as_echo_n "checking for UNZIP... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$UNZIP" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool UNZIP=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool UNZIP=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_UNZIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $UNZIP in - [\\/]* | ?:[\\/]*) - ac_cv_path_UNZIP="$UNZIP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_UNZIP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -UNZIP=$ac_cv_path_UNZIP -if test -n "$UNZIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNZIP" >&5 -$as_echo "$UNZIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$UNZIP" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool UNZIP=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool UNZIP=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for UNZIP" >&5 -$as_echo_n "checking for UNZIP... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool UNZIP=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$UNZIP" = x; then - as_fn_error $? "Could not find required tool for UNZIP" "$LINENO" 5 - fi - - - # Since zip uses "ZIP" as a environment variable for passing options, we need - # to name our variable differently, hence ZIPEXE. - - - - # Publish this variable in the help. - - - if [ -z "${ZIPEXE+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in zip -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ZIPEXE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ZIPEXE in - [\\/]* | ?:[\\/]*) - ac_cv_path_ZIPEXE="$ZIPEXE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ZIPEXE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ZIPEXE=$ac_cv_path_ZIPEXE -if test -n "$ZIPEXE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIPEXE" >&5 -$as_echo "$ZIPEXE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ZIPEXE" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !ZIPEXE! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!ZIPEXE!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xZIPEXE" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of ZIPEXE from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of ZIPEXE from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in zip -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ZIPEXE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ZIPEXE in - [\\/]* | ?:[\\/]*) - ac_cv_path_ZIPEXE="$ZIPEXE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ZIPEXE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ZIPEXE=$ac_cv_path_ZIPEXE -if test -n "$ZIPEXE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIPEXE" >&5 -$as_echo "$ZIPEXE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ZIPEXE" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$ZIPEXE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool ZIPEXE= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool ZIPEXE= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZIPEXE" >&5 -$as_echo_n "checking for ZIPEXE... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$ZIPEXE" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool ZIPEXE=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool ZIPEXE=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ZIPEXE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ZIPEXE in - [\\/]* | ?:[\\/]*) - ac_cv_path_ZIPEXE="$ZIPEXE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ZIPEXE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ZIPEXE=$ac_cv_path_ZIPEXE -if test -n "$ZIPEXE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIPEXE" >&5 -$as_echo "$ZIPEXE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$ZIPEXE" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool ZIPEXE=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool ZIPEXE=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZIPEXE" >&5 -$as_echo_n "checking for ZIPEXE... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool ZIPEXE=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$ZIPEXE" = x; then - as_fn_error $? "Could not find required tool for ZIPEXE" "$LINENO" 5 - fi - - - - # Non-required basic tools - - - - # Publish this variable in the help. - - - if [ -z "${LDD+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in ldd -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_LDD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $LDD in - [\\/]* | ?:[\\/]*) - ac_cv_path_LDD="$LDD" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_LDD="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -LDD=$ac_cv_path_LDD -if test -n "$LDD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDD" >&5 -$as_echo "$LDD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$LDD" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !LDD! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!LDD!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xLDD" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of LDD from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of LDD from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in ldd -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_LDD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $LDD in - [\\/]* | ?:[\\/]*) - ac_cv_path_LDD="$LDD" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_LDD="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -LDD=$ac_cv_path_LDD -if test -n "$LDD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDD" >&5 -$as_echo "$LDD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$LDD" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$LDD" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool LDD= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool LDD= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LDD" >&5 -$as_echo_n "checking for LDD... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$LDD" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool LDD=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool LDD=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_LDD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $LDD in - [\\/]* | ?:[\\/]*) - ac_cv_path_LDD="$LDD" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_LDD="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -LDD=$ac_cv_path_LDD -if test -n "$LDD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDD" >&5 -$as_echo "$LDD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$LDD" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool LDD=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool LDD=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LDD" >&5 -$as_echo_n "checking for LDD... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool LDD=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - if test "x$LDD" = "x"; then - # List shared lib dependencies is used for - # debug output and checking for forbidden dependencies. - # We can build without it. - LDD="true" - fi - - - # Publish this variable in the help. - - - if [ -z "${READELF+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in greadelf readelf -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_READELF+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $READELF in - [\\/]* | ?:[\\/]*) - ac_cv_path_READELF="$READELF" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_READELF="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -READELF=$ac_cv_path_READELF -if test -n "$READELF"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5 -$as_echo "$READELF" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$READELF" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !READELF! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!READELF!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xREADELF" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of READELF from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of READELF from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in greadelf readelf -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_READELF+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $READELF in - [\\/]* | ?:[\\/]*) - ac_cv_path_READELF="$READELF" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_READELF="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -READELF=$ac_cv_path_READELF -if test -n "$READELF"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5 -$as_echo "$READELF" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$READELF" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$READELF" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool READELF= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool READELF= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for READELF" >&5 -$as_echo_n "checking for READELF... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$READELF" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool READELF=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool READELF=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_READELF+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $READELF in - [\\/]* | ?:[\\/]*) - ac_cv_path_READELF="$READELF" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_READELF="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -READELF=$ac_cv_path_READELF -if test -n "$READELF"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5 -$as_echo "$READELF" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$READELF" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool READELF=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool READELF=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for READELF" >&5 -$as_echo_n "checking for READELF... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool READELF=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - - # Publish this variable in the help. - - - if [ -z "${DOT+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in dot -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_DOT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DOT in - [\\/]* | ?:[\\/]*) - ac_cv_path_DOT="$DOT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DOT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DOT=$ac_cv_path_DOT -if test -n "$DOT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOT" >&5 -$as_echo "$DOT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$DOT" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !DOT! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!DOT!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xDOT" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of DOT from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of DOT from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in dot -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_DOT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DOT in - [\\/]* | ?:[\\/]*) - ac_cv_path_DOT="$DOT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DOT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DOT=$ac_cv_path_DOT -if test -n "$DOT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOT" >&5 -$as_echo "$DOT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$DOT" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$DOT" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool DOT= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool DOT= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DOT" >&5 -$as_echo_n "checking for DOT... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$DOT" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool DOT=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool DOT=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_DOT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DOT in - [\\/]* | ?:[\\/]*) - ac_cv_path_DOT="$DOT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DOT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DOT=$ac_cv_path_DOT -if test -n "$DOT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOT" >&5 -$as_echo "$DOT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$DOT" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool DOT=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool DOT=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DOT" >&5 -$as_echo_n "checking for DOT... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool DOT=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - - # Publish this variable in the help. - - - if [ -z "${HG+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in hg -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_HG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $HG in - [\\/]* | ?:[\\/]*) - ac_cv_path_HG="$HG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_HG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -HG=$ac_cv_path_HG -if test -n "$HG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HG" >&5 -$as_echo "$HG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$HG" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !HG! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!HG!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xHG" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of HG from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of HG from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in hg -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_HG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $HG in - [\\/]* | ?:[\\/]*) - ac_cv_path_HG="$HG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_HG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -HG=$ac_cv_path_HG -if test -n "$HG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HG" >&5 -$as_echo "$HG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$HG" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$HG" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool HG= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool HG= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HG" >&5 -$as_echo_n "checking for HG... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$HG" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool HG=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool HG=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_HG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $HG in - [\\/]* | ?:[\\/]*) - ac_cv_path_HG="$HG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_HG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -HG=$ac_cv_path_HG -if test -n "$HG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HG" >&5 -$as_echo "$HG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$HG" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool HG=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool HG=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HG" >&5 -$as_echo_n "checking for HG... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool HG=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - - # Publish this variable in the help. - - - if [ -z "${STAT+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in stat -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_STAT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $STAT in - [\\/]* | ?:[\\/]*) - ac_cv_path_STAT="$STAT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_STAT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -STAT=$ac_cv_path_STAT -if test -n "$STAT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STAT" >&5 -$as_echo "$STAT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$STAT" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !STAT! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!STAT!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xSTAT" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of STAT from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of STAT from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in stat -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_STAT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $STAT in - [\\/]* | ?:[\\/]*) - ac_cv_path_STAT="$STAT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_STAT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -STAT=$ac_cv_path_STAT -if test -n "$STAT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STAT" >&5 -$as_echo "$STAT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$STAT" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$STAT" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool STAT= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool STAT= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for STAT" >&5 -$as_echo_n "checking for STAT... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$STAT" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool STAT=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool STAT=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_STAT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $STAT in - [\\/]* | ?:[\\/]*) - ac_cv_path_STAT="$STAT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_STAT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -STAT=$ac_cv_path_STAT -if test -n "$STAT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STAT" >&5 -$as_echo "$STAT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$STAT" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool STAT=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool STAT=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for STAT" >&5 -$as_echo_n "checking for STAT... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool STAT=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - - # Publish this variable in the help. - - - if [ -z "${TIME+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in time -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TIME+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $TIME in - [\\/]* | ?:[\\/]*) - ac_cv_path_TIME="$TIME" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_TIME="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -TIME=$ac_cv_path_TIME -if test -n "$TIME"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TIME" >&5 -$as_echo "$TIME" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$TIME" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !TIME! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!TIME!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xTIME" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of TIME from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of TIME from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in time -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TIME+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $TIME in - [\\/]* | ?:[\\/]*) - ac_cv_path_TIME="$TIME" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_TIME="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -TIME=$ac_cv_path_TIME -if test -n "$TIME"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TIME" >&5 -$as_echo "$TIME" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$TIME" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$TIME" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool TIME= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool TIME= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIME" >&5 -$as_echo_n "checking for TIME... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$TIME" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool TIME=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool TIME=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TIME+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $TIME in - [\\/]* | ?:[\\/]*) - ac_cv_path_TIME="$TIME" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_TIME="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -TIME=$ac_cv_path_TIME -if test -n "$TIME"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TIME" >&5 -$as_echo "$TIME" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$TIME" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool TIME=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool TIME=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIME" >&5 -$as_echo_n "checking for TIME... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool TIME=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - - # Publish this variable in the help. - - - if [ -z "${FLOCK+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in flock -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_FLOCK+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $FLOCK in - [\\/]* | ?:[\\/]*) - ac_cv_path_FLOCK="$FLOCK" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_FLOCK="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -FLOCK=$ac_cv_path_FLOCK -if test -n "$FLOCK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FLOCK" >&5 -$as_echo "$FLOCK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$FLOCK" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !FLOCK! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!FLOCK!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xFLOCK" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of FLOCK from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of FLOCK from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in flock -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_FLOCK+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $FLOCK in - [\\/]* | ?:[\\/]*) - ac_cv_path_FLOCK="$FLOCK" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_FLOCK="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -FLOCK=$ac_cv_path_FLOCK -if test -n "$FLOCK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FLOCK" >&5 -$as_echo "$FLOCK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$FLOCK" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$FLOCK" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool FLOCK= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool FLOCK= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FLOCK" >&5 -$as_echo_n "checking for FLOCK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$FLOCK" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool FLOCK=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool FLOCK=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_FLOCK+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $FLOCK in - [\\/]* | ?:[\\/]*) - ac_cv_path_FLOCK="$FLOCK" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_FLOCK="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -FLOCK=$ac_cv_path_FLOCK -if test -n "$FLOCK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FLOCK" >&5 -$as_echo "$FLOCK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$FLOCK" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool FLOCK=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool FLOCK=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FLOCK" >&5 -$as_echo_n "checking for FLOCK... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool FLOCK=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - # Dtrace is usually found in /usr/sbin on Solaris, but that directory may not - # be in the user path. - - - # Publish this variable in the help. - - - if [ -z "${DTRACE+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in dtrace -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_DTRACE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DTRACE in - [\\/]* | ?:[\\/]*) - ac_cv_path_DTRACE="$DTRACE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$PATH:/usr/sbin" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DTRACE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DTRACE=$ac_cv_path_DTRACE -if test -n "$DTRACE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DTRACE" >&5 -$as_echo "$DTRACE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$DTRACE" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !DTRACE! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!DTRACE!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xDTRACE" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of DTRACE from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of DTRACE from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in dtrace -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_DTRACE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DTRACE in - [\\/]* | ?:[\\/]*) - ac_cv_path_DTRACE="$DTRACE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$PATH:/usr/sbin" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DTRACE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DTRACE=$ac_cv_path_DTRACE -if test -n "$DTRACE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DTRACE" >&5 -$as_echo "$DTRACE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$DTRACE" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$DTRACE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool DTRACE= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool DTRACE= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DTRACE" >&5 -$as_echo_n "checking for DTRACE... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$DTRACE" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool DTRACE=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool DTRACE=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_DTRACE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DTRACE in - [\\/]* | ?:[\\/]*) - ac_cv_path_DTRACE="$DTRACE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DTRACE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DTRACE=$ac_cv_path_DTRACE -if test -n "$DTRACE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DTRACE" >&5 -$as_echo "$DTRACE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$DTRACE" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool DTRACE=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool DTRACE=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DTRACE" >&5 -$as_echo_n "checking for DTRACE... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool DTRACE=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - - # Publish this variable in the help. - - - if [ -z "${PATCH+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in gpatch patch -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PATCH+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PATCH in - [\\/]* | ?:[\\/]*) - ac_cv_path_PATCH="$PATCH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PATCH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PATCH=$ac_cv_path_PATCH -if test -n "$PATCH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATCH" >&5 -$as_echo "$PATCH" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$PATCH" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !PATCH! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!PATCH!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xPATCH" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of PATCH from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of PATCH from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in gpatch patch -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PATCH+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PATCH in - [\\/]* | ?:[\\/]*) - ac_cv_path_PATCH="$PATCH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PATCH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PATCH=$ac_cv_path_PATCH -if test -n "$PATCH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATCH" >&5 -$as_echo "$PATCH" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$PATCH" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$PATCH" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool PATCH= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool PATCH= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PATCH" >&5 -$as_echo_n "checking for PATCH... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$PATCH" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool PATCH=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool PATCH=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PATCH+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PATCH in - [\\/]* | ?:[\\/]*) - ac_cv_path_PATCH="$PATCH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PATCH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PATCH=$ac_cv_path_PATCH -if test -n "$PATCH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATCH" >&5 -$as_echo "$PATCH" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$PATCH" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool PATCH=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool PATCH=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PATCH" >&5 -$as_echo_n "checking for PATCH... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool PATCH=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - # Check if it's GNU time - IS_GNU_TIME=`$TIME --version 2>&1 | $GREP 'GNU time'` - if test "x$IS_GNU_TIME" != x; then - IS_GNU_TIME=yes - else - IS_GNU_TIME=no - fi - - - if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then - - - - # Publish this variable in the help. - - - if [ -z "${DSYMUTIL+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in dsymutil -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DSYMUTIL in - [\\/]* | ?:[\\/]*) - ac_cv_path_DSYMUTIL="$DSYMUTIL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DSYMUTIL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DSYMUTIL=$ac_cv_path_DSYMUTIL -if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$DSYMUTIL" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !DSYMUTIL! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!DSYMUTIL!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xDSYMUTIL" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of DSYMUTIL from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of DSYMUTIL from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in dsymutil -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DSYMUTIL in - [\\/]* | ?:[\\/]*) - ac_cv_path_DSYMUTIL="$DSYMUTIL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DSYMUTIL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DSYMUTIL=$ac_cv_path_DSYMUTIL -if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$DSYMUTIL" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$DSYMUTIL" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool DSYMUTIL= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool DSYMUTIL= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DSYMUTIL" >&5 -$as_echo_n "checking for DSYMUTIL... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$DSYMUTIL" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool DSYMUTIL=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool DSYMUTIL=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DSYMUTIL in - [\\/]* | ?:[\\/]*) - ac_cv_path_DSYMUTIL="$DSYMUTIL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DSYMUTIL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DSYMUTIL=$ac_cv_path_DSYMUTIL -if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$DSYMUTIL" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool DSYMUTIL=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool DSYMUTIL=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DSYMUTIL" >&5 -$as_echo_n "checking for DSYMUTIL... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool DSYMUTIL=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$DSYMUTIL" = x; then - as_fn_error $? "Could not find required tool for DSYMUTIL" "$LINENO" 5 - fi - - - - - - # Publish this variable in the help. - - - if [ -z "${XATTR+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in xattr -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_XATTR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $XATTR in - [\\/]* | ?:[\\/]*) - ac_cv_path_XATTR="$XATTR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_XATTR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -XATTR=$ac_cv_path_XATTR -if test -n "$XATTR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XATTR" >&5 -$as_echo "$XATTR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$XATTR" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !XATTR! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!XATTR!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xXATTR" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of XATTR from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of XATTR from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in xattr -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_XATTR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $XATTR in - [\\/]* | ?:[\\/]*) - ac_cv_path_XATTR="$XATTR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_XATTR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -XATTR=$ac_cv_path_XATTR -if test -n "$XATTR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XATTR" >&5 -$as_echo "$XATTR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$XATTR" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$XATTR" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool XATTR= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool XATTR= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XATTR" >&5 -$as_echo_n "checking for XATTR... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$XATTR" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool XATTR=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool XATTR=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_XATTR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $XATTR in - [\\/]* | ?:[\\/]*) - ac_cv_path_XATTR="$XATTR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_XATTR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -XATTR=$ac_cv_path_XATTR -if test -n "$XATTR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XATTR" >&5 -$as_echo "$XATTR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$XATTR" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool XATTR=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool XATTR=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XATTR" >&5 -$as_echo_n "checking for XATTR... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool XATTR=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$XATTR" = x; then - as_fn_error $? "Could not find required tool for XATTR" "$LINENO" 5 - fi - - - - - # Publish this variable in the help. - - - if [ -z "${CODESIGN+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in codesign -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CODESIGN+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CODESIGN in - [\\/]* | ?:[\\/]*) - ac_cv_path_CODESIGN="$CODESIGN" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CODESIGN="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CODESIGN=$ac_cv_path_CODESIGN -if test -n "$CODESIGN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CODESIGN" >&5 -$as_echo "$CODESIGN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CODESIGN" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !CODESIGN! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!CODESIGN!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xCODESIGN" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of CODESIGN from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of CODESIGN from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in codesign -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CODESIGN+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CODESIGN in - [\\/]* | ?:[\\/]*) - ac_cv_path_CODESIGN="$CODESIGN" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CODESIGN="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CODESIGN=$ac_cv_path_CODESIGN -if test -n "$CODESIGN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CODESIGN" >&5 -$as_echo "$CODESIGN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CODESIGN" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$CODESIGN" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool CODESIGN= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool CODESIGN= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CODESIGN" >&5 -$as_echo_n "checking for CODESIGN... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$CODESIGN" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool CODESIGN=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool CODESIGN=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CODESIGN+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CODESIGN in - [\\/]* | ?:[\\/]*) - ac_cv_path_CODESIGN="$CODESIGN" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CODESIGN="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CODESIGN=$ac_cv_path_CODESIGN -if test -n "$CODESIGN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CODESIGN" >&5 -$as_echo "$CODESIGN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$CODESIGN" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool CODESIGN=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool CODESIGN=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CODESIGN" >&5 -$as_echo_n "checking for CODESIGN... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool CODESIGN=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - if test "x$CODESIGN" != "x"; then - # Verify that the openjdk_codesign certificate is present - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if openjdk_codesign certificate is present" >&5 -$as_echo_n "checking if openjdk_codesign certificate is present... " >&6; } - $RM codesign-testfile - $TOUCH codesign-testfile - $CODESIGN -s openjdk_codesign codesign-testfile 2>&5 >&5 || CODESIGN= - $RM codesign-testfile - if test "x$CODESIGN" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - fi - fi - - - - # Publish this variable in the help. - - - if [ -z "${SETFILE+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in SetFile -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_SETFILE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $SETFILE in - [\\/]* | ?:[\\/]*) - ac_cv_path_SETFILE="$SETFILE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SETFILE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -SETFILE=$ac_cv_path_SETFILE -if test -n "$SETFILE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SETFILE" >&5 -$as_echo "$SETFILE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$SETFILE" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !SETFILE! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!SETFILE!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xSETFILE" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of SETFILE from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of SETFILE from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in SetFile -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_SETFILE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $SETFILE in - [\\/]* | ?:[\\/]*) - ac_cv_path_SETFILE="$SETFILE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SETFILE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -SETFILE=$ac_cv_path_SETFILE -if test -n "$SETFILE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SETFILE" >&5 -$as_echo "$SETFILE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$SETFILE" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$SETFILE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool SETFILE= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool SETFILE= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SETFILE" >&5 -$as_echo_n "checking for SETFILE... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$SETFILE" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool SETFILE=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool SETFILE=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_SETFILE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $SETFILE in - [\\/]* | ?:[\\/]*) - ac_cv_path_SETFILE="$SETFILE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SETFILE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -SETFILE=$ac_cv_path_SETFILE -if test -n "$SETFILE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SETFILE" >&5 -$as_echo "$SETFILE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$SETFILE" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool SETFILE=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool SETFILE=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SETFILE" >&5 -$as_echo_n "checking for SETFILE... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool SETFILE=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$SETFILE" = x; then - as_fn_error $? "Could not find required tool for SETFILE" "$LINENO" 5 - fi - - - fi - - - # Check bash version - # Extra [ ] to stop m4 mangling - BASH_VER=`$BASH --version | $SED -n -e 's/^.*bash.*ersion *\([0-9.]*\).*$/\1/ p'` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking bash version" >&5 -$as_echo_n "checking bash version... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BASH_VER" >&5 -$as_echo "$BASH_VER" >&6; } - - BASH_MAJOR=`$ECHO $BASH_VER | $CUT -d . -f 1` - BASH_MINOR=`$ECHO $BASH_VER | $CUT -d . -f 2` - if test $BASH_MAJOR -lt 3 || (test $BASH_MAJOR -eq 3 && test $BASH_MINOR -lt 2); then - as_fn_error $? "bash version 3.2 or better is required" "$LINENO" 5 - fi - - # Test if bash supports pipefail. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if bash supports pipefail" >&5 -$as_echo_n "checking if bash supports pipefail... " >&6; } - if ${BASH} -c 'set -o pipefail'; then - BASH_ARGS="$BASH_ARGS -o pipefail" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if bash supports errexit (-e)" >&5 -$as_echo_n "checking if bash supports errexit (-e)... " >&6; } - if ${BASH} -e -c 'true'; then - BASH_ARGS="$BASH_ARGS -e" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - - - - -# Check if pkg-config is available. - - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_PKG_CONFIG"; then - ac_pt_PKG_CONFIG=$PKG_CONFIG - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG -if test -n "$ac_pt_PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 -$as_echo "$ac_pt_PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_PKG_CONFIG" = x; then - PKG_CONFIG="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - PKG_CONFIG=$ac_pt_PKG_CONFIG - fi -else - PKG_CONFIG="$ac_cv_path_PKG_CONFIG" -fi - -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=0.9.0 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 -$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - PKG_CONFIG="" - fi - -fi - -# After basic tools have been setup, we can check build os specific details. - - ############################################################################### - - # Note that this is the build platform OS version! - - OS_VERSION="`uname -r | ${SED} 's!\.! !g' | ${SED} 's!-! !g'`" - OS_VERSION_MAJOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 1 -d ' '`" - OS_VERSION_MINOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 2 -d ' '`" - OS_VERSION_MICRO="`${ECHO} ${OS_VERSION} | ${CUT} -f 3 -d ' '`" - - - - - -# Misc basic settings - - -# Check whether --with-default-make-target was given. -if test "${with_default_make_target+set}" = set; then : - withval=$with_default_make_target; -fi - - if test "x$with_default_make_target" = "x" \ - || test "x$with_default_make_target" = "xyes"; then - DEFAULT_MAKE_TARGET="exploded-image" - elif test "x$with_default_make_target" = "xno"; then - as_fn_error $? "--without-default-make-target is not a valid option" "$LINENO" 5 - else - DEFAULT_MAKE_TARGET="$with_default_make_target" - fi - - - - -############################################################################### -# -# Determine OpenJDK variants, options and version numbers. -# -############################################################################### - -# We need build & target for this. - - # Should we build a JDK without a graphical UI? - { $as_echo "$as_me:${as_lineno-$LINENO}: checking headless only" >&5 -$as_echo_n "checking headless only... " >&6; } - # Check whether --enable-headless-only was given. -if test "${enable_headless_only+set}" = set; then : - enableval=$enable_headless_only; -fi - - - if test "x$enable_headless_only" = "xyes"; then - ENABLE_HEADLESS_ONLY="true" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - elif test "x$enable_headless_only" = "xno"; then - ENABLE_HEADLESS_ONLY="false" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - elif test "x$enable_headless_only" = "x"; then - ENABLE_HEADLESS_ONLY="false" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - else - as_fn_error $? "--enable-headless-only can only take yes or no" "$LINENO" 5 - fi - - - - # Should we build the complete docs, or just a lightweight version? - # Check whether --enable-full-docs was given. -if test "${enable_full_docs+set}" = set; then : - enableval=$enable_full_docs; -fi - - - # Verify dependencies - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for graphviz dot" >&5 -$as_echo_n "checking for graphviz dot... " >&6; } - if test "x$DOT" != "x"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, cannot generate full docs" >&5 -$as_echo "no, cannot generate full docs" >&6; } - FULL_DOCS_DEP_MISSING=true - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pandoc" >&5 -$as_echo_n "checking for pandoc... " >&6; } - if test "x$PANDOC" != "x"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, cannot generate full docs" >&5 -$as_echo "no, cannot generate full docs" >&6; } - FULL_DOCS_DEP_MISSING=true - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking full docs" >&5 -$as_echo_n "checking full docs... " >&6; } - if test "x$enable_full_docs" = xyes; then - if test "x$FULL_DOCS_DEP_MISSING" = "xtrue"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, missing dependencies" >&5 -$as_echo "no, missing dependencies" >&6; } - - # Print a helpful message on how to acquire the necessary build dependency. - # dot is the help tag: freetype, cups, alsa etc - MISSING_DEPENDENCY=dot - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - cygwin_help $MISSING_DEPENDENCY - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - msys_help $MISSING_DEPENDENCY - else - PKGHANDLER_COMMAND= - - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - brew) - brew_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - esac - - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." - fi - fi - - as_fn_error $? "Cannot enable full docs with missing dependencies. See above. $HELP_MSG" "$LINENO" 5 - else - ENABLE_FULL_DOCS=true - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, forced" >&5 -$as_echo "yes, forced" >&6; } - fi - elif test "x$enable_full_docs" = xno; then - ENABLE_FULL_DOCS=false - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, forced" >&5 -$as_echo "no, forced" >&6; } - elif test "x$enable_full_docs" = x; then - # Check for prerequisites - if test "x$FULL_DOCS_DEP_MISSING" = xtrue; then - ENABLE_FULL_DOCS=false - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, missing dependencies" >&5 -$as_echo "no, missing dependencies" >&6; } - else - ENABLE_FULL_DOCS=true - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, dependencies present" >&5 -$as_echo "yes, dependencies present" >&6; } - fi - else - as_fn_error $? "--enable-full-docs can only take yes or no" "$LINENO" 5 - fi - - - - # Choose cacerts source file - -# Check whether --with-cacerts-file was given. -if test "${with_cacerts_file+set}" = set; then : - withval=$with_cacerts_file; -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cacerts file" >&5 -$as_echo_n "checking for cacerts file... " >&6; } - if test "x$with_cacerts_file" == x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: default" >&5 -$as_echo "default" >&6; } - else - CACERTS_FILE=$with_cacerts_file - if test ! -f "$CACERTS_FILE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: fail" >&5 -$as_echo "fail" >&6; } - as_fn_error $? "Specified cacerts file \"$CACERTS_FILE\" does not exist" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CACERTS_FILE" >&5 -$as_echo "$CACERTS_FILE" >&6; } - fi - - - # Enable or disable unlimited crypto - # Check whether --enable-unlimited-crypto was given. -if test "${enable_unlimited_crypto+set}" = set; then : - enableval=$enable_unlimited_crypto; -else - enable_unlimited_crypto=yes -fi - - if test "x$enable_unlimited_crypto" = "xyes"; then - UNLIMITED_CRYPTO=true - else - UNLIMITED_CRYPTO=false - fi - - - # Should we build the serviceability agent (SA)? - INCLUDE_SA=true - if [[ " $JVM_VARIANTS " =~ " zero " ]] ; then - INCLUDE_SA=false - fi - if test "x$OPENJDK_TARGET_OS" = xaix ; then - INCLUDE_SA=false - fi - - - # Compress jars - COMPRESS_JARS=false - - - - # Setup default copyright year. Mostly overridden when building close to a new year. - -# Check whether --with-copyright-year was given. -if test "${with_copyright_year+set}" = set; then : - withval=$with_copyright_year; -fi - - if test "x$with_copyright_year" = xyes; then - as_fn_error $? "Copyright year must have a value" "$LINENO" 5 - elif test "x$with_copyright_year" != x; then - COPYRIGHT_YEAR="$with_copyright_year" - else - COPYRIGHT_YEAR=`$DATE +'%Y'` - fi - - - - # Check whether --enable-keep-packaged-modules was given. -if test "${enable_keep_packaged_modules+set}" = set; then : - enableval=$enable_keep_packaged_modules; -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if packaged modules are kept" >&5 -$as_echo_n "checking if packaged modules are kept... " >&6; } - if test "x$enable_keep_packaged_modules" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - JLINK_KEEP_PACKAGED_MODULES=true - elif test "x$enable_keep_packaged_modules" = "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - JLINK_KEEP_PACKAGED_MODULES=false - elif test "x$enable_keep_packaged_modules" = "x"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 -$as_echo "yes (default)" >&6; } - JLINK_KEEP_PACKAGED_MODULES=true - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: error" >&5 -$as_echo "error" >&6; } - as_fn_error $? "--enable-keep-packaged-modules accepts no argument" "$LINENO" 5 - fi - - - - - # Warn user that old version arguments are deprecated. - - -# Check whether --with-milestone was given. -if test "${with_milestone+set}" = set; then : - withval=$with_milestone; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --with-milestone is deprecated and will be ignored." >&5 -$as_echo "$as_me: WARNING: Option --with-milestone is deprecated and will be ignored." >&2;} -fi - - - - -# Check whether --with-update-version was given. -if test "${with_update_version+set}" = set; then : - withval=$with_update_version; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --with-update-version is deprecated and will be ignored." >&5 -$as_echo "$as_me: WARNING: Option --with-update-version is deprecated and will be ignored." >&2;} -fi - - - - -# Check whether --with-user-release-suffix was given. -if test "${with_user_release_suffix+set}" = set; then : - withval=$with_user_release_suffix; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --with-user-release-suffix is deprecated and will be ignored." >&5 -$as_echo "$as_me: WARNING: Option --with-user-release-suffix is deprecated and will be ignored." >&2;} -fi - - - - -# Check whether --with-build-number was given. -if test "${with_build_number+set}" = set; then : - withval=$with_build_number; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --with-build-number is deprecated and will be ignored." >&5 -$as_echo "$as_me: WARNING: Option --with-build-number is deprecated and will be ignored." >&2;} -fi - - - - -# Check whether --with-version-major was given. -if test "${with_version_major+set}" = set; then : - withval=$with_version_major; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --with-version-major is deprecated and will be ignored." >&5 -$as_echo "$as_me: WARNING: Option --with-version-major is deprecated and will be ignored." >&2;} -fi - - - - -# Check whether --with-version-minor was given. -if test "${with_version_minor+set}" = set; then : - withval=$with_version_minor; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --with-version-minor is deprecated and will be ignored." >&5 -$as_echo "$as_me: WARNING: Option --with-version-minor is deprecated and will be ignored." >&2;} -fi - - - - -# Check whether --with-version-security was given. -if test "${with_version_security+set}" = set; then : - withval=$with_version_security; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --with-version-security is deprecated and will be ignored." >&5 -$as_echo "$as_me: WARNING: Option --with-version-security is deprecated and will be ignored." >&2;} -fi - - - - # Source the version numbers file - . $AUTOCONF_DIR/version-numbers - - # Some non-version number information is set in that file - - - - - - - - - # The vendor name, if any - -# Check whether --with-vendor-name was given. -if test "${with_vendor_name+set}" = set; then : - withval=$with_vendor_name; -fi - - if test "x$with_vendor_name" = xyes; then - as_fn_error $? "--with-vendor-name must have a value" "$LINENO" 5 - elif ! [[ $with_vendor_name =~ ^[[:print:]]*$ ]] ; then - as_fn_error $? "--with-vendor-name contains non-printing characters: $with_vendor_name" "$LINENO" 5 - elif test "x$with_vendor_name" != x; then - # Only set COMPANY_NAME if '--with-vendor-name' was used and is not empty. - # Otherwise we will use the value from "version-numbers" included above. - COMPANY_NAME="$with_vendor_name" - fi - - - # The vendor URL, if any - -# Check whether --with-vendor-url was given. -if test "${with_vendor_url+set}" = set; then : - withval=$with_vendor_url; -fi - - if test "x$with_vendor_url" = xyes; then - as_fn_error $? "--with-vendor-url must have a value" "$LINENO" 5 - elif ! [[ $with_vendor_url =~ ^[[:print:]]*$ ]] ; then - as_fn_error $? "--with-vendor-url contains non-printing characters: $with_vendor_url" "$LINENO" 5 - else - VENDOR_URL="$with_vendor_url" - fi - - - # The vendor bug URL, if any - -# Check whether --with-vendor-bug-url was given. -if test "${with_vendor_bug_url+set}" = set; then : - withval=$with_vendor_bug_url; -fi - - if test "x$with_vendor_bug_url" = xyes; then - as_fn_error $? "--with-vendor-bug-url must have a value" "$LINENO" 5 - elif ! [[ $with_vendor_bug_url =~ ^[[:print:]]*$ ]] ; then - as_fn_error $? "--with-vendor-bug-url contains non-printing characters: $with_vendor_bug_url" "$LINENO" 5 - else - VENDOR_URL_BUG="$with_vendor_bug_url" - fi - - - # The vendor VM bug URL, if any - -# Check whether --with-vendor-vm-bug-url was given. -if test "${with_vendor_vm_bug_url+set}" = set; then : - withval=$with_vendor_vm_bug_url; -fi - - if test "x$with_vendor_vm_bug_url" = xyes; then - as_fn_error $? "--with-vendor-vm-bug-url must have a value" "$LINENO" 5 - elif ! [[ $with_vendor_vm_bug_url =~ ^[[:print:]]*$ ]] ; then - as_fn_error $? "--with-vendor-vm-bug-url contains non-printing characters: $with_vendor_vm_bug_url" "$LINENO" 5 - else - VENDOR_URL_VM_BUG="$with_vendor_vm_bug_url" - fi - - - # Override version from arguments - - # If --with-version-string is set, process it first. It is possible to - # override parts with more specific flags, since these are processed later. - -# Check whether --with-version-string was given. -if test "${with_version_string+set}" = set; then : - withval=$with_version_string; -fi - - if test "x$with_version_string" = xyes; then - as_fn_error $? "--with-version-string must have a value" "$LINENO" 5 - elif test "x$with_version_string" != x; then - # Additional [] needed to keep m4 from mangling shell constructs. - if [[ $with_version_string =~ ^([0-9]+)(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(-([a-zA-Z]+))?((\+)([0-9]+)?(-([-a-zA-Z0-9.]+))?)?$ ]] ; then - VERSION_FEATURE=${BASH_REMATCH[1]} - VERSION_INTERIM=${BASH_REMATCH[3]} - VERSION_UPDATE=${BASH_REMATCH[5]} - VERSION_PATCH=${BASH_REMATCH[7]} - VERSION_PRE=${BASH_REMATCH[9]} - version_plus_separator=${BASH_REMATCH[11]} - VERSION_BUILD=${BASH_REMATCH[12]} - VERSION_OPT=${BASH_REMATCH[14]} - # Unspecified numerical fields are interpreted as 0. - if test "x$VERSION_INTERIM" = x; then - VERSION_INTERIM=0 - fi - if test "x$VERSION_UPDATE" = x; then - VERSION_UPDATE=0 - fi - if test "x$VERSION_PATCH" = x; then - VERSION_PATCH=0 - fi - if test "x$version_plus_separator" != x \ - && test "x$VERSION_BUILD$VERSION_OPT" = x; then - as_fn_error $? "Version string contains + but both 'BUILD' and 'OPT' are missing" "$LINENO" 5 - fi - # Stop the version part process from setting default values. - # We still allow them to explicitly override though. - NO_DEFAULT_VERSION_PARTS=true - else - as_fn_error $? "--with-version-string fails to parse as a valid version string: $with_version_string" "$LINENO" 5 - fi - fi - - -# Check whether --with-version-pre was given. -if test "${with_version_pre+set}" = set; then : - withval=$with_version_pre; with_version_pre_present=true -else - with_version_pre_present=false -fi - - - if test "x$with_version_pre_present" = xtrue; then - if test "x$with_version_pre" = xyes; then - as_fn_error $? "--with-version-pre must have a value" "$LINENO" 5 - elif test "x$with_version_pre" = xno; then - # Interpret --without-* as empty string instead of the literal "no" - VERSION_PRE= - else - # Only [a-zA-Z] is allowed in the VERSION_PRE. Outer [ ] to quote m4. - VERSION_PRE=`$ECHO "$with_version_pre" | $TR -c -d '[a-z][A-Z]'` - if test "x$VERSION_PRE" != "x$with_version_pre"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-version-pre value has been sanitized from '$with_version_pre' to '$VERSION_PRE'" >&5 -$as_echo "$as_me: WARNING: --with-version-pre value has been sanitized from '$with_version_pre' to '$VERSION_PRE'" >&2;} - fi - fi - else - if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then - # Default is to use "internal" as pre - VERSION_PRE="internal" - fi - fi - - -# Check whether --with-version-opt was given. -if test "${with_version_opt+set}" = set; then : - withval=$with_version_opt; with_version_opt_present=true -else - with_version_opt_present=false -fi - - - if test "x$with_version_opt_present" = xtrue; then - if test "x$with_version_opt" = xyes; then - as_fn_error $? "--with-version-opt must have a value" "$LINENO" 5 - elif test "x$with_version_opt" = xno; then - # Interpret --without-* as empty string instead of the literal "no" - VERSION_OPT= - else - # Only [-.a-zA-Z0-9] is allowed in the VERSION_OPT. Outer [ ] to quote m4. - VERSION_OPT=`$ECHO "$with_version_opt" | $TR -c -d '[a-z][A-Z][0-9].-'` - if test "x$VERSION_OPT" != "x$with_version_opt"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-version-opt value has been sanitized from '$with_version_opt' to '$VERSION_OPT'" >&5 -$as_echo "$as_me: WARNING: --with-version-opt value has been sanitized from '$with_version_opt' to '$VERSION_OPT'" >&2;} - fi - fi - else - if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then - # Default is to calculate a string like this 'adhoc..' - # Outer [ ] to quote m4. - basedirname=`$BASENAME "$TOPDIR" | $TR -d -c '[a-z][A-Z][0-9].-'` - VERSION_OPT="adhoc.$USERNAME.$basedirname" - fi - fi - - -# Check whether --with-version-build was given. -if test "${with_version_build+set}" = set; then : - withval=$with_version_build; with_version_build_present=true -else - with_version_build_present=false -fi - - - if test "x$with_version_build_present" = xtrue; then - if test "x$with_version_build" = xyes; then - as_fn_error $? "--with-version-build must have a value" "$LINENO" 5 - elif test "x$with_version_build" = xno; then - # Interpret --without-* as empty string instead of the literal "no" - VERSION_BUILD= - elif test "x$with_version_build" = x; then - VERSION_BUILD= - else - - # Additional [] needed to keep m4 from mangling shell constructs. - if ! [[ "$with_version_build" =~ ^0*([1-9][0-9]*)|(0)$ ]] ; then - as_fn_error $? "\"$with_version_build\" is not a valid numerical value for VERSION_BUILD" "$LINENO" 5 - fi - # Extract the version number without leading zeros. - cleaned_value=${BASH_REMATCH[1]} - if test "x$cleaned_value" = x; then - # Special case for zero - cleaned_value=${BASH_REMATCH[2]} - fi - - if test $cleaned_value -gt 255; then - as_fn_error $? "VERSION_BUILD is given as $with_version_build. This is greater than 255 which is not allowed." "$LINENO" 5 - fi - if test "x$cleaned_value" != "x$with_version_build"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Value for VERSION_BUILD has been sanitized from '$with_version_build' to '$cleaned_value'" >&5 -$as_echo "$as_me: WARNING: Value for VERSION_BUILD has been sanitized from '$with_version_build' to '$cleaned_value'" >&2;} - fi - VERSION_BUILD=$cleaned_value - - fi - else - if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then - # Default is to not have a build number. - VERSION_BUILD="" - # FIXME: Until all code can cope with an empty VERSION_BUILD, set it to 0. - VERSION_BUILD=0 - fi - fi - - -# Check whether --with-version-feature was given. -if test "${with_version_feature+set}" = set; then : - withval=$with_version_feature; with_version_feature_present=true -else - with_version_feature_present=false -fi - - - if test "x$with_version_feature_present" = xtrue; then - if test "x$with_version_feature" = xyes; then - as_fn_error $? "--with-version-feature must have a value" "$LINENO" 5 - else - - # Additional [] needed to keep m4 from mangling shell constructs. - if ! [[ "$with_version_feature" =~ ^0*([1-9][0-9]*)|(0)$ ]] ; then - as_fn_error $? "\"$with_version_feature\" is not a valid numerical value for VERSION_FEATURE" "$LINENO" 5 - fi - # Extract the version number without leading zeros. - cleaned_value=${BASH_REMATCH[1]} - if test "x$cleaned_value" = x; then - # Special case for zero - cleaned_value=${BASH_REMATCH[2]} - fi - - if test $cleaned_value -gt 255; then - as_fn_error $? "VERSION_FEATURE is given as $with_version_feature. This is greater than 255 which is not allowed." "$LINENO" 5 - fi - if test "x$cleaned_value" != "x$with_version_feature"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Value for VERSION_FEATURE has been sanitized from '$with_version_feature' to '$cleaned_value'" >&5 -$as_echo "$as_me: WARNING: Value for VERSION_FEATURE has been sanitized from '$with_version_feature' to '$cleaned_value'" >&2;} - fi - VERSION_FEATURE=$cleaned_value - - fi - else - if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then - # Default is to get value from version-numbers - VERSION_FEATURE="$DEFAULT_VERSION_FEATURE" - fi - fi - - -# Check whether --with-version-interim was given. -if test "${with_version_interim+set}" = set; then : - withval=$with_version_interim; with_version_interim_present=true -else - with_version_interim_present=false -fi - - - if test "x$with_version_interim_present" = xtrue; then - if test "x$with_version_interim" = xyes; then - as_fn_error $? "--with-version-interim must have a value" "$LINENO" 5 - elif test "x$with_version_interim" = xno; then - # Interpret --without-* as empty string (i.e. 0) instead of the literal "no" - VERSION_INTERIM=0 - elif test "x$with_version_interim" = x; then - VERSION_INTERIM=0 - else - - # Additional [] needed to keep m4 from mangling shell constructs. - if ! [[ "$with_version_interim" =~ ^0*([1-9][0-9]*)|(0)$ ]] ; then - as_fn_error $? "\"$with_version_interim\" is not a valid numerical value for VERSION_INTERIM" "$LINENO" 5 - fi - # Extract the version number without leading zeros. - cleaned_value=${BASH_REMATCH[1]} - if test "x$cleaned_value" = x; then - # Special case for zero - cleaned_value=${BASH_REMATCH[2]} - fi - - if test $cleaned_value -gt 255; then - as_fn_error $? "VERSION_INTERIM is given as $with_version_interim. This is greater than 255 which is not allowed." "$LINENO" 5 - fi - if test "x$cleaned_value" != "x$with_version_interim"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Value for VERSION_INTERIM has been sanitized from '$with_version_interim' to '$cleaned_value'" >&5 -$as_echo "$as_me: WARNING: Value for VERSION_INTERIM has been sanitized from '$with_version_interim' to '$cleaned_value'" >&2;} - fi - VERSION_INTERIM=$cleaned_value - - fi - else - if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then - # Default is 0, if unspecified - VERSION_INTERIM=$DEFAULT_VERSION_INTERIM - fi - fi - - -# Check whether --with-version-update was given. -if test "${with_version_update+set}" = set; then : - withval=$with_version_update; with_version_update_present=true -else - with_version_update_present=false -fi - - - if test "x$with_version_update_present" = xtrue; then - if test "x$with_version_update" = xyes; then - as_fn_error $? "--with-version-update must have a value" "$LINENO" 5 - elif test "x$with_version_update" = xno; then - # Interpret --without-* as empty string (i.e. 0) instead of the literal "no" - VERSION_UPDATE=0 - elif test "x$with_version_update" = x; then - VERSION_UPDATE=0 - else - - # Additional [] needed to keep m4 from mangling shell constructs. - if ! [[ "$with_version_update" =~ ^0*([1-9][0-9]*)|(0)$ ]] ; then - as_fn_error $? "\"$with_version_update\" is not a valid numerical value for VERSION_UPDATE" "$LINENO" 5 - fi - # Extract the version number without leading zeros. - cleaned_value=${BASH_REMATCH[1]} - if test "x$cleaned_value" = x; then - # Special case for zero - cleaned_value=${BASH_REMATCH[2]} - fi - - if test $cleaned_value -gt 255; then - as_fn_error $? "VERSION_UPDATE is given as $with_version_update. This is greater than 255 which is not allowed." "$LINENO" 5 - fi - if test "x$cleaned_value" != "x$with_version_update"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Value for VERSION_UPDATE has been sanitized from '$with_version_update' to '$cleaned_value'" >&5 -$as_echo "$as_me: WARNING: Value for VERSION_UPDATE has been sanitized from '$with_version_update' to '$cleaned_value'" >&2;} - fi - VERSION_UPDATE=$cleaned_value - - fi - else - if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then - # Default is 0, if unspecified - VERSION_UPDATE=$DEFAULT_VERSION_UPDATE - fi - fi - - -# Check whether --with-version-patch was given. -if test "${with_version_patch+set}" = set; then : - withval=$with_version_patch; with_version_patch_present=true -else - with_version_patch_present=false -fi - - - if test "x$with_version_patch_present" = xtrue; then - if test "x$with_version_patch" = xyes; then - as_fn_error $? "--with-version-patch must have a value" "$LINENO" 5 - elif test "x$with_version_patch" = xno; then - # Interpret --without-* as empty string (i.e. 0) instead of the literal "no" - VERSION_PATCH=0 - elif test "x$with_version_patch" = x; then - VERSION_PATCH=0 - else - - # Additional [] needed to keep m4 from mangling shell constructs. - if ! [[ "$with_version_patch" =~ ^0*([1-9][0-9]*)|(0)$ ]] ; then - as_fn_error $? "\"$with_version_patch\" is not a valid numerical value for VERSION_PATCH" "$LINENO" 5 - fi - # Extract the version number without leading zeros. - cleaned_value=${BASH_REMATCH[1]} - if test "x$cleaned_value" = x; then - # Special case for zero - cleaned_value=${BASH_REMATCH[2]} - fi - - if test $cleaned_value -gt 255; then - as_fn_error $? "VERSION_PATCH is given as $with_version_patch. This is greater than 255 which is not allowed." "$LINENO" 5 - fi - if test "x$cleaned_value" != "x$with_version_patch"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Value for VERSION_PATCH has been sanitized from '$with_version_patch' to '$cleaned_value'" >&5 -$as_echo "$as_me: WARNING: Value for VERSION_PATCH has been sanitized from '$with_version_patch' to '$cleaned_value'" >&2;} - fi - VERSION_PATCH=$cleaned_value - - fi - else - if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then - # Default is 0, if unspecified - VERSION_PATCH=$DEFAULT_VERSION_PATCH - fi - fi - - # Calculate derived version properties - - # Set VERSION_IS_GA based on if VERSION_PRE has a value - if test "x$VERSION_PRE" = x; then - VERSION_IS_GA=true - else - VERSION_IS_GA=false - fi - - # VERSION_NUMBER but always with exactly 4 positions, with 0 for empty positions. - VERSION_NUMBER_FOUR_POSITIONS=$VERSION_FEATURE.$VERSION_INTERIM.$VERSION_UPDATE.$VERSION_PATCH - - stripped_version_number=$VERSION_NUMBER_FOUR_POSITIONS - # Strip trailing zeroes from stripped_version_number - for i in 1 2 3 ; do stripped_version_number=${stripped_version_number%.0} ; done - VERSION_NUMBER=$stripped_version_number - - # The complete version string, with additional build information - if test "x$VERSION_BUILD$VERSION_OPT" = x; then - VERSION_STRING=$VERSION_NUMBER${VERSION_PRE:+-$VERSION_PRE} - else - # If either build or opt is set, we need a + separator - VERSION_STRING=$VERSION_NUMBER${VERSION_PRE:+-$VERSION_PRE}+$VERSION_BUILD${VERSION_OPT:+-$VERSION_OPT} - fi - - # The short version string, just VERSION_NUMBER and PRE, if present. - VERSION_SHORT=$VERSION_NUMBER${VERSION_PRE:+-$VERSION_PRE} - - # The version date - -# Check whether --with-version-date was given. -if test "${with_version_date+set}" = set; then : - withval=$with_version_date; -fi - - if test "x$with_version_date" = xyes; then - as_fn_error $? "--with-version-date must have a value" "$LINENO" 5 - elif test "x$with_version_date" != x; then - if ! [[ $with_version_date =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]] ; then - as_fn_error $? "\"$with_version_date\" is not a valid version date" "$LINENO" 5 - else - VERSION_DATE="$with_version_date" - fi - else - VERSION_DATE="$DEFAULT_VERSION_DATE" - fi - - # The vendor version string, if any - -# Check whether --with-vendor-version-string was given. -if test "${with_vendor_version_string+set}" = set; then : - withval=$with_vendor_version_string; -fi - - if test "x$with_vendor_version_string" = xyes; then - as_fn_error $? "--with-vendor-version-string must have a value" "$LINENO" 5 - elif ! [[ $with_vendor_version_string =~ ^[[:graph:]]*$ ]] ; then - as_fn_error $? "--with--vendor-version-string contains non-graphical characters: $with_vendor_version_string" "$LINENO" 5 - else - VENDOR_VERSION_STRING="$with_vendor_version_string" - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version string" >&5 -$as_echo_n "checking for version string... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $VERSION_STRING" >&5 -$as_echo "$VERSION_STRING" >&6; } - - - - - - - - - - - - - - - - - -############################################################################### -# -# Setup BootJDK, used to bootstrap the build. -# -############################################################################### - - - BOOT_JDK_FOUND=no - -# Check whether --with-boot-jdk was given. -if test "${with_boot_jdk+set}" = set; then : - withval=$with_boot_jdk; -fi - - - # We look for the Boot JDK through various means, going from more certain to - # more of a guess-work. After each test, BOOT_JDK_FOUND is set to "yes" if - # we detected something (if so, the path to the jdk is in BOOT_JDK). But we - # must check if this is indeed valid; otherwise we'll continue looking. - - # Test: Is bootjdk explicitly set by command line arguments? - - if test "x$BOOT_JDK_FOUND" = xno; then - # Now execute the test - - if test "x$with_boot_jdk" != x; then - BOOT_JDK=$with_boot_jdk - BOOT_JDK_FOUND=maybe - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using configure arguments" >&5 -$as_echo "$as_me: Found potential Boot JDK using configure arguments" >&6;} - fi - - - # If previous step claimed to have found a JDK, check it to see if it seems to be valid. - if test "x$BOOT_JDK_FOUND" = xmaybe; then - # Do we have a bin/java? - if test ! -x "$BOOT_JDK/bin/java"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} - BOOT_JDK_FOUND=no - else - # Do we have a bin/javac? - if test ! -x "$BOOT_JDK/bin/javac"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 -$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} - BOOT_JDK_FOUND=no - else - # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1` - - # Extra M4 quote needed to protect [] in grep expression. - FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'` - if test "x$FOUND_CORRECT_VERSION" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5 -$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;} - BOOT_JDK_FOUND=no - else - # We're done! :-) - BOOT_JDK_FOUND=yes - - # Only process if variable expands to non-empty - - if test "x$BOOT_JDK" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$BOOT_JDK" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$BOOT_JDK" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - BOOT_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 -$as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 -$as_echo "$BOOT_JDK" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 -$as_echo_n "checking Boot JDK version... " >&6; } - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 -$as_echo "$BOOT_JDK_VERSION" >&6; } - fi # end check jdk version - fi # end check javac - fi # end check java - fi # end check boot jdk found - fi - - if test "x$with_boot_jdk" != x && test "x$BOOT_JDK_FOUND" = xno; then - # Having specified an argument which is incorrect will produce an instant failure; - # we should not go on looking - as_fn_error $? "The path given by --with-boot-jdk does not contain a valid Boot JDK" "$LINENO" 5 - fi - - # Test: On MacOS X, can we find a boot jdk using /usr/libexec/java_home? - - if test "x$BOOT_JDK_FOUND" = xno; then - # Now execute the test - - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - # First check at user selected default - - if test "x$BOOT_JDK_FOUND" = xno; then - # Now execute the test - - if test -x /usr/libexec/java_home; then - BOOT_JDK=`/usr/libexec/java_home ` - BOOT_JDK_FOUND=maybe - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using /usr/libexec/java_home " >&5 -$as_echo "$as_me: Found potential Boot JDK using /usr/libexec/java_home " >&6;} - fi - - - # If previous step claimed to have found a JDK, check it to see if it seems to be valid. - if test "x$BOOT_JDK_FOUND" = xmaybe; then - # Do we have a bin/java? - if test ! -x "$BOOT_JDK/bin/java"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} - BOOT_JDK_FOUND=no - else - # Do we have a bin/javac? - if test ! -x "$BOOT_JDK/bin/javac"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 -$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} - BOOT_JDK_FOUND=no - else - # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1` - - # Extra M4 quote needed to protect [] in grep expression. - FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'` - if test "x$FOUND_CORRECT_VERSION" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5 -$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;} - BOOT_JDK_FOUND=no - else - # We're done! :-) - BOOT_JDK_FOUND=yes - - # Only process if variable expands to non-empty - - if test "x$BOOT_JDK" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$BOOT_JDK" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$BOOT_JDK" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - BOOT_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 -$as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 -$as_echo "$BOOT_JDK" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 -$as_echo_n "checking Boot JDK version... " >&6; } - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 -$as_echo "$BOOT_JDK_VERSION" >&6; } - fi # end check jdk version - fi # end check javac - fi # end check java - fi # end check boot jdk found - fi - - # If that did not work out (e.g. too old), try explicit versions instead - - if test "x$BOOT_JDK_FOUND" = xno; then - # Now execute the test - - if test -x /usr/libexec/java_home; then - BOOT_JDK=`/usr/libexec/java_home -v 1.9` - BOOT_JDK_FOUND=maybe - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using /usr/libexec/java_home -v 1.9" >&5 -$as_echo "$as_me: Found potential Boot JDK using /usr/libexec/java_home -v 1.9" >&6;} - fi - - - # If previous step claimed to have found a JDK, check it to see if it seems to be valid. - if test "x$BOOT_JDK_FOUND" = xmaybe; then - # Do we have a bin/java? - if test ! -x "$BOOT_JDK/bin/java"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} - BOOT_JDK_FOUND=no - else - # Do we have a bin/javac? - if test ! -x "$BOOT_JDK/bin/javac"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 -$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} - BOOT_JDK_FOUND=no - else - # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1` - - # Extra M4 quote needed to protect [] in grep expression. - FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'` - if test "x$FOUND_CORRECT_VERSION" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5 -$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;} - BOOT_JDK_FOUND=no - else - # We're done! :-) - BOOT_JDK_FOUND=yes - - # Only process if variable expands to non-empty - - if test "x$BOOT_JDK" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$BOOT_JDK" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$BOOT_JDK" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - BOOT_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 -$as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 -$as_echo "$BOOT_JDK" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 -$as_echo_n "checking Boot JDK version... " >&6; } - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 -$as_echo "$BOOT_JDK_VERSION" >&6; } - fi # end check jdk version - fi # end check javac - fi # end check java - fi # end check boot jdk found - fi - - - if test "x$BOOT_JDK_FOUND" = xno; then - # Now execute the test - - if test -x /usr/libexec/java_home; then - BOOT_JDK=`/usr/libexec/java_home -v 1.8` - BOOT_JDK_FOUND=maybe - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using /usr/libexec/java_home -v 1.8" >&5 -$as_echo "$as_me: Found potential Boot JDK using /usr/libexec/java_home -v 1.8" >&6;} - fi - - - # If previous step claimed to have found a JDK, check it to see if it seems to be valid. - if test "x$BOOT_JDK_FOUND" = xmaybe; then - # Do we have a bin/java? - if test ! -x "$BOOT_JDK/bin/java"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} - BOOT_JDK_FOUND=no - else - # Do we have a bin/javac? - if test ! -x "$BOOT_JDK/bin/javac"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 -$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} - BOOT_JDK_FOUND=no - else - # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1` - - # Extra M4 quote needed to protect [] in grep expression. - FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'` - if test "x$FOUND_CORRECT_VERSION" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5 -$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;} - BOOT_JDK_FOUND=no - else - # We're done! :-) - BOOT_JDK_FOUND=yes - - # Only process if variable expands to non-empty - - if test "x$BOOT_JDK" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$BOOT_JDK" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$BOOT_JDK" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - BOOT_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 -$as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 -$as_echo "$BOOT_JDK" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 -$as_echo_n "checking Boot JDK version... " >&6; } - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 -$as_echo "$BOOT_JDK_VERSION" >&6; } - fi # end check jdk version - fi # end check javac - fi # end check java - fi # end check boot jdk found - fi - - - if test "x$BOOT_JDK_FOUND" = xno; then - # Now execute the test - - if test -x /usr/libexec/java_home; then - BOOT_JDK=`/usr/libexec/java_home -v 1.7` - BOOT_JDK_FOUND=maybe - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using /usr/libexec/java_home -v 1.7" >&5 -$as_echo "$as_me: Found potential Boot JDK using /usr/libexec/java_home -v 1.7" >&6;} - fi - - - # If previous step claimed to have found a JDK, check it to see if it seems to be valid. - if test "x$BOOT_JDK_FOUND" = xmaybe; then - # Do we have a bin/java? - if test ! -x "$BOOT_JDK/bin/java"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} - BOOT_JDK_FOUND=no - else - # Do we have a bin/javac? - if test ! -x "$BOOT_JDK/bin/javac"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 -$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} - BOOT_JDK_FOUND=no - else - # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1` - - # Extra M4 quote needed to protect [] in grep expression. - FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'` - if test "x$FOUND_CORRECT_VERSION" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5 -$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;} - BOOT_JDK_FOUND=no - else - # We're done! :-) - BOOT_JDK_FOUND=yes - - # Only process if variable expands to non-empty - - if test "x$BOOT_JDK" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$BOOT_JDK" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$BOOT_JDK" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - BOOT_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 -$as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 -$as_echo "$BOOT_JDK" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 -$as_echo_n "checking Boot JDK version... " >&6; } - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 -$as_echo "$BOOT_JDK_VERSION" >&6; } - fi # end check jdk version - fi # end check javac - fi # end check java - fi # end check boot jdk found - fi - - fi - - - # If previous step claimed to have found a JDK, check it to see if it seems to be valid. - if test "x$BOOT_JDK_FOUND" = xmaybe; then - # Do we have a bin/java? - if test ! -x "$BOOT_JDK/bin/java"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} - BOOT_JDK_FOUND=no - else - # Do we have a bin/javac? - if test ! -x "$BOOT_JDK/bin/javac"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 -$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} - BOOT_JDK_FOUND=no - else - # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1` - - # Extra M4 quote needed to protect [] in grep expression. - FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'` - if test "x$FOUND_CORRECT_VERSION" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5 -$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;} - BOOT_JDK_FOUND=no - else - # We're done! :-) - BOOT_JDK_FOUND=yes - - # Only process if variable expands to non-empty - - if test "x$BOOT_JDK" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$BOOT_JDK" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$BOOT_JDK" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - BOOT_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 -$as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 -$as_echo "$BOOT_JDK" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 -$as_echo_n "checking Boot JDK version... " >&6; } - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 -$as_echo "$BOOT_JDK_VERSION" >&6; } - fi # end check jdk version - fi # end check javac - fi # end check java - fi # end check boot jdk found - fi - - - # Test: Is $JAVA_HOME set? - - if test "x$BOOT_JDK_FOUND" = xno; then - # Now execute the test - - if test "x$JAVA_HOME" != x; then - JAVA_HOME_PROCESSED="$JAVA_HOME" - - # Only process if variable expands to non-empty - - if test "x$JAVA_HOME_PROCESSED" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$JAVA_HOME_PROCESSED" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of JAVA_HOME_PROCESSED" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - JAVA_HOME_PROCESSED="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting JAVA_HOME_PROCESSED to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting JAVA_HOME_PROCESSED to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$JAVA_HOME_PROCESSED" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - JAVA_HOME_PROCESSED="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting JAVA_HOME_PROCESSED to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting JAVA_HOME_PROCESSED to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$JAVA_HOME_PROCESSED" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - JAVA_HOME_PROCESSED="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - JAVA_HOME_PROCESSED="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - if test ! -d "$JAVA_HOME_PROCESSED"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Your JAVA_HOME points to a non-existing directory!" >&5 -$as_echo "$as_me: Your JAVA_HOME points to a non-existing directory!" >&6;} - else - # Aha, the user has set a JAVA_HOME - # let us use that as the Boot JDK. - BOOT_JDK="$JAVA_HOME_PROCESSED" - BOOT_JDK_FOUND=maybe - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using JAVA_HOME" >&5 -$as_echo "$as_me: Found potential Boot JDK using JAVA_HOME" >&6;} - fi - fi - - - # If previous step claimed to have found a JDK, check it to see if it seems to be valid. - if test "x$BOOT_JDK_FOUND" = xmaybe; then - # Do we have a bin/java? - if test ! -x "$BOOT_JDK/bin/java"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} - BOOT_JDK_FOUND=no - else - # Do we have a bin/javac? - if test ! -x "$BOOT_JDK/bin/javac"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 -$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} - BOOT_JDK_FOUND=no - else - # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1` - - # Extra M4 quote needed to protect [] in grep expression. - FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'` - if test "x$FOUND_CORRECT_VERSION" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5 -$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;} - BOOT_JDK_FOUND=no - else - # We're done! :-) - BOOT_JDK_FOUND=yes - - # Only process if variable expands to non-empty - - if test "x$BOOT_JDK" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$BOOT_JDK" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$BOOT_JDK" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - BOOT_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 -$as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 -$as_echo "$BOOT_JDK" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 -$as_echo_n "checking Boot JDK version... " >&6; } - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 -$as_echo "$BOOT_JDK_VERSION" >&6; } - fi # end check jdk version - fi # end check javac - fi # end check java - fi # end check boot jdk found - fi - - - # Test: Is there a java or javac in the PATH, which is a symlink to the JDK? - - if test "x$BOOT_JDK_FOUND" = xno; then - # Now execute the test - - # Extract the first word of "javac", so it can be a program name with args. -set dummy javac; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JAVAC_CHECK+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $JAVAC_CHECK in - [\\/]* | ?:[\\/]*) - ac_cv_path_JAVAC_CHECK="$JAVAC_CHECK" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_JAVAC_CHECK="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -JAVAC_CHECK=$ac_cv_path_JAVAC_CHECK -if test -n "$JAVAC_CHECK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAC_CHECK" >&5 -$as_echo "$JAVAC_CHECK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - # Extract the first word of "java", so it can be a program name with args. -set dummy java; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JAVA_CHECK+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $JAVA_CHECK in - [\\/]* | ?:[\\/]*) - ac_cv_path_JAVA_CHECK="$JAVA_CHECK" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_JAVA_CHECK="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -JAVA_CHECK=$ac_cv_path_JAVA_CHECK -if test -n "$JAVA_CHECK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVA_CHECK" >&5 -$as_echo "$JAVA_CHECK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - BINARY="$JAVAC_CHECK" - if test "x$JAVAC_CHECK" = x; then - BINARY="$JAVA_CHECK" - fi - if test "x$BINARY" != x; then - # So there is a java(c) binary, it might be part of a JDK. - # Lets find the JDK/JRE directory by following symbolic links. - # Linux/GNU systems often have links from /usr/bin/java to - # /etc/alternatives/java to the real JDK binary. - - if test "x$OPENJDK_BUILD_OS" != xwindows; then - # Follow a chain of symbolic links. Use readlink - # where it exists, else fall back to horribly - # complicated shell code. - if test "x$READLINK_TESTED" != yes; then - # On MacOSX there is a readlink tool with a different - # purpose than the GNU readlink tool. Check the found readlink. - ISGNU=`$READLINK --version 2>&1 | $GREP GNU` - if test "x$ISGNU" = x; then - # A readlink that we do not know how to use. - # Are there other non-GNU readlinks out there? - READLINK_TESTED=yes - READLINK= - fi - fi - - if test "x$READLINK" != x; then - BINARY=`$READLINK -f $BINARY` - else - # Save the current directory for restoring afterwards - STARTDIR=$PWD - COUNTER=0 - sym_link_dir=`$DIRNAME $BINARY` - sym_link_file=`$BASENAME $BINARY` - cd $sym_link_dir - # Use -P flag to resolve symlinks in directories. - cd `$THEPWDCMD -P` - sym_link_dir=`$THEPWDCMD -P` - # Resolve file symlinks - while test $COUNTER -lt 20; do - ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` - if test "x$ISLINK" == x; then - # This is not a symbolic link! We are done! - break - fi - # Again resolve directory symlinks since the target of the just found - # link could be in a different directory - cd `$DIRNAME $ISLINK` - sym_link_dir=`$THEPWDCMD -P` - sym_link_file=`$BASENAME $ISLINK` - let COUNTER=COUNTER+1 - done - cd $STARTDIR - BINARY=$sym_link_dir/$sym_link_file - fi - fi - - BOOT_JDK=`dirname "$BINARY"` - BOOT_JDK=`cd "$BOOT_JDK/.."; pwd` - if test -x "$BOOT_JDK/bin/javac" && test -x "$BOOT_JDK/bin/java"; then - # Looks like we found ourselves an JDK - BOOT_JDK_FOUND=maybe - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using java(c) in PATH" >&5 -$as_echo "$as_me: Found potential Boot JDK using java(c) in PATH" >&6;} - fi - fi - - - # If previous step claimed to have found a JDK, check it to see if it seems to be valid. - if test "x$BOOT_JDK_FOUND" = xmaybe; then - # Do we have a bin/java? - if test ! -x "$BOOT_JDK/bin/java"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} - BOOT_JDK_FOUND=no - else - # Do we have a bin/javac? - if test ! -x "$BOOT_JDK/bin/javac"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 -$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} - BOOT_JDK_FOUND=no - else - # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1` - - # Extra M4 quote needed to protect [] in grep expression. - FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'` - if test "x$FOUND_CORRECT_VERSION" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5 -$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;} - BOOT_JDK_FOUND=no - else - # We're done! :-) - BOOT_JDK_FOUND=yes - - # Only process if variable expands to non-empty - - if test "x$BOOT_JDK" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$BOOT_JDK" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$BOOT_JDK" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - BOOT_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 -$as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 -$as_echo "$BOOT_JDK" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 -$as_echo_n "checking Boot JDK version... " >&6; } - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 -$as_echo "$BOOT_JDK_VERSION" >&6; } - fi # end check jdk version - fi # end check javac - fi # end check java - fi # end check boot jdk found - fi - - - # Test: Is there a JDK installed in default, well-known locations? - - if test "x$BOOT_JDK_FOUND" = xno; then - # Now execute the test - - if test "x$OPENJDK_TARGET_OS" = xwindows; then - - if test "x$BOOT_JDK_FOUND" = xno; then - # Now execute the test - - if test "x$ProgramW6432" != x; then - VIRTUAL_DIR="$ProgramW6432/Java" - - windows_path="$VIRTUAL_DIR" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - VIRTUAL_DIR="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - VIRTUAL_DIR="$unix_path" - fi - - - BOOT_JDK_PREFIX="$VIRTUAL_DIR" - BOOT_JDK_SUFFIX="" - ALL_JDKS_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $SORT -r` - if test "x$ALL_JDKS_FOUND" != x; then - for JDK_TO_TRY in $ALL_JDKS_FOUND ; do - - if test "x$BOOT_JDK_FOUND" = xno; then - # Now execute the test - - BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}" - if test -d "$BOOT_JDK"; then - BOOT_JDK_FOUND=maybe - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5 -$as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&6;} - fi - - - # If previous step claimed to have found a JDK, check it to see if it seems to be valid. - if test "x$BOOT_JDK_FOUND" = xmaybe; then - # Do we have a bin/java? - if test ! -x "$BOOT_JDK/bin/java"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} - BOOT_JDK_FOUND=no - else - # Do we have a bin/javac? - if test ! -x "$BOOT_JDK/bin/javac"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 -$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} - BOOT_JDK_FOUND=no - else - # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1` - - # Extra M4 quote needed to protect [] in grep expression. - FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'` - if test "x$FOUND_CORRECT_VERSION" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5 -$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;} - BOOT_JDK_FOUND=no - else - # We're done! :-) - BOOT_JDK_FOUND=yes - - # Only process if variable expands to non-empty - - if test "x$BOOT_JDK" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$BOOT_JDK" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$BOOT_JDK" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - BOOT_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 -$as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 -$as_echo "$BOOT_JDK" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 -$as_echo_n "checking Boot JDK version... " >&6; } - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 -$as_echo "$BOOT_JDK_VERSION" >&6; } - fi # end check jdk version - fi # end check javac - fi # end check java - fi # end check boot jdk found - fi - - done - fi - - fi - - - # If previous step claimed to have found a JDK, check it to see if it seems to be valid. - if test "x$BOOT_JDK_FOUND" = xmaybe; then - # Do we have a bin/java? - if test ! -x "$BOOT_JDK/bin/java"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} - BOOT_JDK_FOUND=no - else - # Do we have a bin/javac? - if test ! -x "$BOOT_JDK/bin/javac"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 -$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} - BOOT_JDK_FOUND=no - else - # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1` - - # Extra M4 quote needed to protect [] in grep expression. - FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'` - if test "x$FOUND_CORRECT_VERSION" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5 -$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;} - BOOT_JDK_FOUND=no - else - # We're done! :-) - BOOT_JDK_FOUND=yes - - # Only process if variable expands to non-empty - - if test "x$BOOT_JDK" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$BOOT_JDK" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$BOOT_JDK" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - BOOT_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 -$as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 -$as_echo "$BOOT_JDK" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 -$as_echo_n "checking Boot JDK version... " >&6; } - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 -$as_echo "$BOOT_JDK_VERSION" >&6; } - fi # end check jdk version - fi # end check javac - fi # end check java - fi # end check boot jdk found - fi - - - if test "x$BOOT_JDK_FOUND" = xno; then - # Now execute the test - - if test "x$PROGRAMW6432" != x; then - VIRTUAL_DIR="$PROGRAMW6432/Java" - - windows_path="$VIRTUAL_DIR" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - VIRTUAL_DIR="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - VIRTUAL_DIR="$unix_path" - fi - - - BOOT_JDK_PREFIX="$VIRTUAL_DIR" - BOOT_JDK_SUFFIX="" - ALL_JDKS_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $SORT -r` - if test "x$ALL_JDKS_FOUND" != x; then - for JDK_TO_TRY in $ALL_JDKS_FOUND ; do - - if test "x$BOOT_JDK_FOUND" = xno; then - # Now execute the test - - BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}" - if test -d "$BOOT_JDK"; then - BOOT_JDK_FOUND=maybe - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5 -$as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&6;} - fi - - - # If previous step claimed to have found a JDK, check it to see if it seems to be valid. - if test "x$BOOT_JDK_FOUND" = xmaybe; then - # Do we have a bin/java? - if test ! -x "$BOOT_JDK/bin/java"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} - BOOT_JDK_FOUND=no - else - # Do we have a bin/javac? - if test ! -x "$BOOT_JDK/bin/javac"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 -$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} - BOOT_JDK_FOUND=no - else - # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1` - - # Extra M4 quote needed to protect [] in grep expression. - FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'` - if test "x$FOUND_CORRECT_VERSION" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5 -$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;} - BOOT_JDK_FOUND=no - else - # We're done! :-) - BOOT_JDK_FOUND=yes - - # Only process if variable expands to non-empty - - if test "x$BOOT_JDK" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$BOOT_JDK" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$BOOT_JDK" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - BOOT_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 -$as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 -$as_echo "$BOOT_JDK" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 -$as_echo_n "checking Boot JDK version... " >&6; } - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 -$as_echo "$BOOT_JDK_VERSION" >&6; } - fi # end check jdk version - fi # end check javac - fi # end check java - fi # end check boot jdk found - fi - - done - fi - - fi - - - # If previous step claimed to have found a JDK, check it to see if it seems to be valid. - if test "x$BOOT_JDK_FOUND" = xmaybe; then - # Do we have a bin/java? - if test ! -x "$BOOT_JDK/bin/java"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} - BOOT_JDK_FOUND=no - else - # Do we have a bin/javac? - if test ! -x "$BOOT_JDK/bin/javac"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 -$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} - BOOT_JDK_FOUND=no - else - # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1` - - # Extra M4 quote needed to protect [] in grep expression. - FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'` - if test "x$FOUND_CORRECT_VERSION" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5 -$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;} - BOOT_JDK_FOUND=no - else - # We're done! :-) - BOOT_JDK_FOUND=yes - - # Only process if variable expands to non-empty - - if test "x$BOOT_JDK" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$BOOT_JDK" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$BOOT_JDK" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - BOOT_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 -$as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 -$as_echo "$BOOT_JDK" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 -$as_echo_n "checking Boot JDK version... " >&6; } - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 -$as_echo "$BOOT_JDK_VERSION" >&6; } - fi # end check jdk version - fi # end check javac - fi # end check java - fi # end check boot jdk found - fi - - - if test "x$BOOT_JDK_FOUND" = xno; then - # Now execute the test - - if test "x$PROGRAMFILES" != x; then - VIRTUAL_DIR="$PROGRAMFILES/Java" - - windows_path="$VIRTUAL_DIR" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - VIRTUAL_DIR="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - VIRTUAL_DIR="$unix_path" - fi - - - BOOT_JDK_PREFIX="$VIRTUAL_DIR" - BOOT_JDK_SUFFIX="" - ALL_JDKS_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $SORT -r` - if test "x$ALL_JDKS_FOUND" != x; then - for JDK_TO_TRY in $ALL_JDKS_FOUND ; do - - if test "x$BOOT_JDK_FOUND" = xno; then - # Now execute the test - - BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}" - if test -d "$BOOT_JDK"; then - BOOT_JDK_FOUND=maybe - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5 -$as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&6;} - fi - - - # If previous step claimed to have found a JDK, check it to see if it seems to be valid. - if test "x$BOOT_JDK_FOUND" = xmaybe; then - # Do we have a bin/java? - if test ! -x "$BOOT_JDK/bin/java"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} - BOOT_JDK_FOUND=no - else - # Do we have a bin/javac? - if test ! -x "$BOOT_JDK/bin/javac"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 -$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} - BOOT_JDK_FOUND=no - else - # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1` - - # Extra M4 quote needed to protect [] in grep expression. - FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'` - if test "x$FOUND_CORRECT_VERSION" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5 -$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;} - BOOT_JDK_FOUND=no - else - # We're done! :-) - BOOT_JDK_FOUND=yes - - # Only process if variable expands to non-empty - - if test "x$BOOT_JDK" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$BOOT_JDK" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$BOOT_JDK" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - BOOT_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 -$as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 -$as_echo "$BOOT_JDK" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 -$as_echo_n "checking Boot JDK version... " >&6; } - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 -$as_echo "$BOOT_JDK_VERSION" >&6; } - fi # end check jdk version - fi # end check javac - fi # end check java - fi # end check boot jdk found - fi - - done - fi - - fi - - - # If previous step claimed to have found a JDK, check it to see if it seems to be valid. - if test "x$BOOT_JDK_FOUND" = xmaybe; then - # Do we have a bin/java? - if test ! -x "$BOOT_JDK/bin/java"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} - BOOT_JDK_FOUND=no - else - # Do we have a bin/javac? - if test ! -x "$BOOT_JDK/bin/javac"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 -$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} - BOOT_JDK_FOUND=no - else - # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1` - - # Extra M4 quote needed to protect [] in grep expression. - FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'` - if test "x$FOUND_CORRECT_VERSION" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5 -$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;} - BOOT_JDK_FOUND=no - else - # We're done! :-) - BOOT_JDK_FOUND=yes - - # Only process if variable expands to non-empty - - if test "x$BOOT_JDK" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$BOOT_JDK" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$BOOT_JDK" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - BOOT_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 -$as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 -$as_echo "$BOOT_JDK" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 -$as_echo_n "checking Boot JDK version... " >&6; } - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 -$as_echo "$BOOT_JDK_VERSION" >&6; } - fi # end check jdk version - fi # end check javac - fi # end check java - fi # end check boot jdk found - fi - - - if test "x$BOOT_JDK_FOUND" = xno; then - # Now execute the test - - if test "x$ProgramFiles" != x; then - VIRTUAL_DIR="$ProgramFiles/Java" - - windows_path="$VIRTUAL_DIR" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - VIRTUAL_DIR="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - VIRTUAL_DIR="$unix_path" - fi - - - BOOT_JDK_PREFIX="$VIRTUAL_DIR" - BOOT_JDK_SUFFIX="" - ALL_JDKS_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $SORT -r` - if test "x$ALL_JDKS_FOUND" != x; then - for JDK_TO_TRY in $ALL_JDKS_FOUND ; do - - if test "x$BOOT_JDK_FOUND" = xno; then - # Now execute the test - - BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}" - if test -d "$BOOT_JDK"; then - BOOT_JDK_FOUND=maybe - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5 -$as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&6;} - fi - - - # If previous step claimed to have found a JDK, check it to see if it seems to be valid. - if test "x$BOOT_JDK_FOUND" = xmaybe; then - # Do we have a bin/java? - if test ! -x "$BOOT_JDK/bin/java"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} - BOOT_JDK_FOUND=no - else - # Do we have a bin/javac? - if test ! -x "$BOOT_JDK/bin/javac"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 -$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} - BOOT_JDK_FOUND=no - else - # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1` - - # Extra M4 quote needed to protect [] in grep expression. - FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'` - if test "x$FOUND_CORRECT_VERSION" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5 -$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;} - BOOT_JDK_FOUND=no - else - # We're done! :-) - BOOT_JDK_FOUND=yes - - # Only process if variable expands to non-empty - - if test "x$BOOT_JDK" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$BOOT_JDK" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$BOOT_JDK" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - BOOT_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 -$as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 -$as_echo "$BOOT_JDK" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 -$as_echo_n "checking Boot JDK version... " >&6; } - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 -$as_echo "$BOOT_JDK_VERSION" >&6; } - fi # end check jdk version - fi # end check javac - fi # end check java - fi # end check boot jdk found - fi - - done - fi - - fi - - - # If previous step claimed to have found a JDK, check it to see if it seems to be valid. - if test "x$BOOT_JDK_FOUND" = xmaybe; then - # Do we have a bin/java? - if test ! -x "$BOOT_JDK/bin/java"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} - BOOT_JDK_FOUND=no - else - # Do we have a bin/javac? - if test ! -x "$BOOT_JDK/bin/javac"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 -$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} - BOOT_JDK_FOUND=no - else - # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1` - - # Extra M4 quote needed to protect [] in grep expression. - FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'` - if test "x$FOUND_CORRECT_VERSION" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5 -$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;} - BOOT_JDK_FOUND=no - else - # We're done! :-) - BOOT_JDK_FOUND=yes - - # Only process if variable expands to non-empty - - if test "x$BOOT_JDK" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$BOOT_JDK" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$BOOT_JDK" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - BOOT_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 -$as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 -$as_echo "$BOOT_JDK" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 -$as_echo_n "checking Boot JDK version... " >&6; } - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 -$as_echo "$BOOT_JDK_VERSION" >&6; } - fi # end check jdk version - fi # end check javac - fi # end check java - fi # end check boot jdk found - fi - - - if test "x$BOOT_JDK_FOUND" = xno; then - # Now execute the test - - BOOT_JDK_PREFIX="/cygdrive/c/Program Files/Java" - BOOT_JDK_SUFFIX="" - ALL_JDKS_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $SORT -r` - if test "x$ALL_JDKS_FOUND" != x; then - for JDK_TO_TRY in $ALL_JDKS_FOUND ; do - - if test "x$BOOT_JDK_FOUND" = xno; then - # Now execute the test - - BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}" - if test -d "$BOOT_JDK"; then - BOOT_JDK_FOUND=maybe - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5 -$as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&6;} - fi - - - # If previous step claimed to have found a JDK, check it to see if it seems to be valid. - if test "x$BOOT_JDK_FOUND" = xmaybe; then - # Do we have a bin/java? - if test ! -x "$BOOT_JDK/bin/java"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} - BOOT_JDK_FOUND=no - else - # Do we have a bin/javac? - if test ! -x "$BOOT_JDK/bin/javac"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 -$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} - BOOT_JDK_FOUND=no - else - # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1` - - # Extra M4 quote needed to protect [] in grep expression. - FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'` - if test "x$FOUND_CORRECT_VERSION" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5 -$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;} - BOOT_JDK_FOUND=no - else - # We're done! :-) - BOOT_JDK_FOUND=yes - - # Only process if variable expands to non-empty - - if test "x$BOOT_JDK" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$BOOT_JDK" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$BOOT_JDK" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - BOOT_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 -$as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 -$as_echo "$BOOT_JDK" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 -$as_echo_n "checking Boot JDK version... " >&6; } - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 -$as_echo "$BOOT_JDK_VERSION" >&6; } - fi # end check jdk version - fi # end check javac - fi # end check java - fi # end check boot jdk found - fi - - done - fi - - - # If previous step claimed to have found a JDK, check it to see if it seems to be valid. - if test "x$BOOT_JDK_FOUND" = xmaybe; then - # Do we have a bin/java? - if test ! -x "$BOOT_JDK/bin/java"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} - BOOT_JDK_FOUND=no - else - # Do we have a bin/javac? - if test ! -x "$BOOT_JDK/bin/javac"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 -$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} - BOOT_JDK_FOUND=no - else - # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1` - - # Extra M4 quote needed to protect [] in grep expression. - FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'` - if test "x$FOUND_CORRECT_VERSION" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5 -$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;} - BOOT_JDK_FOUND=no - else - # We're done! :-) - BOOT_JDK_FOUND=yes - - # Only process if variable expands to non-empty - - if test "x$BOOT_JDK" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$BOOT_JDK" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$BOOT_JDK" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - BOOT_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 -$as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 -$as_echo "$BOOT_JDK" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 -$as_echo_n "checking Boot JDK version... " >&6; } - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 -$as_echo "$BOOT_JDK_VERSION" >&6; } - fi # end check jdk version - fi # end check javac - fi # end check java - fi # end check boot jdk found - fi - - elif test "x$OPENJDK_TARGET_OS" = xmacosx; then - - if test "x$BOOT_JDK_FOUND" = xno; then - # Now execute the test - - BOOT_JDK_PREFIX="/Library/Java/JavaVirtualMachines" - BOOT_JDK_SUFFIX="/Contents/Home" - ALL_JDKS_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $SORT -r` - if test "x$ALL_JDKS_FOUND" != x; then - for JDK_TO_TRY in $ALL_JDKS_FOUND ; do - - if test "x$BOOT_JDK_FOUND" = xno; then - # Now execute the test - - BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}" - if test -d "$BOOT_JDK"; then - BOOT_JDK_FOUND=maybe - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5 -$as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&6;} - fi - - - # If previous step claimed to have found a JDK, check it to see if it seems to be valid. - if test "x$BOOT_JDK_FOUND" = xmaybe; then - # Do we have a bin/java? - if test ! -x "$BOOT_JDK/bin/java"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} - BOOT_JDK_FOUND=no - else - # Do we have a bin/javac? - if test ! -x "$BOOT_JDK/bin/javac"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 -$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} - BOOT_JDK_FOUND=no - else - # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1` - - # Extra M4 quote needed to protect [] in grep expression. - FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'` - if test "x$FOUND_CORRECT_VERSION" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5 -$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;} - BOOT_JDK_FOUND=no - else - # We're done! :-) - BOOT_JDK_FOUND=yes - - # Only process if variable expands to non-empty - - if test "x$BOOT_JDK" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$BOOT_JDK" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$BOOT_JDK" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - BOOT_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 -$as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 -$as_echo "$BOOT_JDK" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 -$as_echo_n "checking Boot JDK version... " >&6; } - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 -$as_echo "$BOOT_JDK_VERSION" >&6; } - fi # end check jdk version - fi # end check javac - fi # end check java - fi # end check boot jdk found - fi - - done - fi - - - # If previous step claimed to have found a JDK, check it to see if it seems to be valid. - if test "x$BOOT_JDK_FOUND" = xmaybe; then - # Do we have a bin/java? - if test ! -x "$BOOT_JDK/bin/java"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} - BOOT_JDK_FOUND=no - else - # Do we have a bin/javac? - if test ! -x "$BOOT_JDK/bin/javac"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 -$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} - BOOT_JDK_FOUND=no - else - # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1` - - # Extra M4 quote needed to protect [] in grep expression. - FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'` - if test "x$FOUND_CORRECT_VERSION" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5 -$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;} - BOOT_JDK_FOUND=no - else - # We're done! :-) - BOOT_JDK_FOUND=yes - - # Only process if variable expands to non-empty - - if test "x$BOOT_JDK" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$BOOT_JDK" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$BOOT_JDK" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - BOOT_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 -$as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 -$as_echo "$BOOT_JDK" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 -$as_echo_n "checking Boot JDK version... " >&6; } - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 -$as_echo "$BOOT_JDK_VERSION" >&6; } - fi # end check jdk version - fi # end check javac - fi # end check java - fi # end check boot jdk found - fi - - - if test "x$BOOT_JDK_FOUND" = xno; then - # Now execute the test - - BOOT_JDK_PREFIX="/System/Library/Java/JavaVirtualMachines" - BOOT_JDK_SUFFIX="/Contents/Home" - ALL_JDKS_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $SORT -r` - if test "x$ALL_JDKS_FOUND" != x; then - for JDK_TO_TRY in $ALL_JDKS_FOUND ; do - - if test "x$BOOT_JDK_FOUND" = xno; then - # Now execute the test - - BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}" - if test -d "$BOOT_JDK"; then - BOOT_JDK_FOUND=maybe - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5 -$as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&6;} - fi - - - # If previous step claimed to have found a JDK, check it to see if it seems to be valid. - if test "x$BOOT_JDK_FOUND" = xmaybe; then - # Do we have a bin/java? - if test ! -x "$BOOT_JDK/bin/java"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} - BOOT_JDK_FOUND=no - else - # Do we have a bin/javac? - if test ! -x "$BOOT_JDK/bin/javac"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 -$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} - BOOT_JDK_FOUND=no - else - # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1` - - # Extra M4 quote needed to protect [] in grep expression. - FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'` - if test "x$FOUND_CORRECT_VERSION" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5 -$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;} - BOOT_JDK_FOUND=no - else - # We're done! :-) - BOOT_JDK_FOUND=yes - - # Only process if variable expands to non-empty - - if test "x$BOOT_JDK" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$BOOT_JDK" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$BOOT_JDK" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - BOOT_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 -$as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 -$as_echo "$BOOT_JDK" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 -$as_echo_n "checking Boot JDK version... " >&6; } - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 -$as_echo "$BOOT_JDK_VERSION" >&6; } - fi # end check jdk version - fi # end check javac - fi # end check java - fi # end check boot jdk found - fi - - done - fi - - - # If previous step claimed to have found a JDK, check it to see if it seems to be valid. - if test "x$BOOT_JDK_FOUND" = xmaybe; then - # Do we have a bin/java? - if test ! -x "$BOOT_JDK/bin/java"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} - BOOT_JDK_FOUND=no - else - # Do we have a bin/javac? - if test ! -x "$BOOT_JDK/bin/javac"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 -$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} - BOOT_JDK_FOUND=no - else - # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1` - - # Extra M4 quote needed to protect [] in grep expression. - FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'` - if test "x$FOUND_CORRECT_VERSION" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5 -$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;} - BOOT_JDK_FOUND=no - else - # We're done! :-) - BOOT_JDK_FOUND=yes - - # Only process if variable expands to non-empty - - if test "x$BOOT_JDK" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$BOOT_JDK" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$BOOT_JDK" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - BOOT_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 -$as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 -$as_echo "$BOOT_JDK" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 -$as_echo_n "checking Boot JDK version... " >&6; } - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 -$as_echo "$BOOT_JDK_VERSION" >&6; } - fi # end check jdk version - fi # end check javac - fi # end check java - fi # end check boot jdk found - fi - - elif test "x$OPENJDK_TARGET_OS" = xlinux; then - - if test "x$BOOT_JDK_FOUND" = xno; then - # Now execute the test - - BOOT_JDK_PREFIX="/usr/lib/jvm" - BOOT_JDK_SUFFIX="" - ALL_JDKS_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $SORT -r` - if test "x$ALL_JDKS_FOUND" != x; then - for JDK_TO_TRY in $ALL_JDKS_FOUND ; do - - if test "x$BOOT_JDK_FOUND" = xno; then - # Now execute the test - - BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}" - if test -d "$BOOT_JDK"; then - BOOT_JDK_FOUND=maybe - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5 -$as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&6;} - fi - - - # If previous step claimed to have found a JDK, check it to see if it seems to be valid. - if test "x$BOOT_JDK_FOUND" = xmaybe; then - # Do we have a bin/java? - if test ! -x "$BOOT_JDK/bin/java"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} - BOOT_JDK_FOUND=no - else - # Do we have a bin/javac? - if test ! -x "$BOOT_JDK/bin/javac"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 -$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} - BOOT_JDK_FOUND=no - else - # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1` - - # Extra M4 quote needed to protect [] in grep expression. - FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'` - if test "x$FOUND_CORRECT_VERSION" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5 -$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;} - BOOT_JDK_FOUND=no - else - # We're done! :-) - BOOT_JDK_FOUND=yes - - # Only process if variable expands to non-empty - - if test "x$BOOT_JDK" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$BOOT_JDK" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$BOOT_JDK" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - BOOT_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 -$as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 -$as_echo "$BOOT_JDK" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 -$as_echo_n "checking Boot JDK version... " >&6; } - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 -$as_echo "$BOOT_JDK_VERSION" >&6; } - fi # end check jdk version - fi # end check javac - fi # end check java - fi # end check boot jdk found - fi - - done - fi - - - # If previous step claimed to have found a JDK, check it to see if it seems to be valid. - if test "x$BOOT_JDK_FOUND" = xmaybe; then - # Do we have a bin/java? - if test ! -x "$BOOT_JDK/bin/java"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} - BOOT_JDK_FOUND=no - else - # Do we have a bin/javac? - if test ! -x "$BOOT_JDK/bin/javac"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 -$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} - BOOT_JDK_FOUND=no - else - # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1` - - # Extra M4 quote needed to protect [] in grep expression. - FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'` - if test "x$FOUND_CORRECT_VERSION" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5 -$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;} - BOOT_JDK_FOUND=no - else - # We're done! :-) - BOOT_JDK_FOUND=yes - - # Only process if variable expands to non-empty - - if test "x$BOOT_JDK" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$BOOT_JDK" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$BOOT_JDK" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - BOOT_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 -$as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 -$as_echo "$BOOT_JDK" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 -$as_echo_n "checking Boot JDK version... " >&6; } - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 -$as_echo "$BOOT_JDK_VERSION" >&6; } - fi # end check jdk version - fi # end check javac - fi # end check java - fi # end check boot jdk found - fi - - fi - - - # If previous step claimed to have found a JDK, check it to see if it seems to be valid. - if test "x$BOOT_JDK_FOUND" = xmaybe; then - # Do we have a bin/java? - if test ! -x "$BOOT_JDK/bin/java"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} - BOOT_JDK_FOUND=no - else - # Do we have a bin/javac? - if test ! -x "$BOOT_JDK/bin/javac"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 -$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} - BOOT_JDK_FOUND=no - else - # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1` - - # Extra M4 quote needed to protect [] in grep expression. - FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'` - if test "x$FOUND_CORRECT_VERSION" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 -$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5 -$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;} - BOOT_JDK_FOUND=no - else - # We're done! :-) - BOOT_JDK_FOUND=yes - - # Only process if variable expands to non-empty - - if test "x$BOOT_JDK" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$BOOT_JDK" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$BOOT_JDK" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - BOOT_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - BOOT_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 -$as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 -$as_echo "$BOOT_JDK" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 -$as_echo_n "checking Boot JDK version... " >&6; } - BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 -$as_echo "$BOOT_JDK_VERSION" >&6; } - fi # end check jdk version - fi # end check javac - fi # end check java - fi # end check boot jdk found - fi - - - # If we haven't found anything yet, we've truly lost. Give up. - if test "x$BOOT_JDK_FOUND" = xno; then - - # Print a helpful message on how to acquire the necessary build dependency. - # openjdk is the help tag: freetype, cups, alsa etc - MISSING_DEPENDENCY=openjdk - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - cygwin_help $MISSING_DEPENDENCY - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - msys_help $MISSING_DEPENDENCY - else - PKGHANDLER_COMMAND= - - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - brew) - brew_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - esac - - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find a valid Boot JDK. $HELP_MSG" >&5 -$as_echo "$as_me: Could not find a valid Boot JDK. $HELP_MSG" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be fixed by explicitly setting --with-boot-jdk" >&5 -$as_echo "$as_me: This might be fixed by explicitly setting --with-boot-jdk" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 - fi - - - - # Setup tools from the Boot JDK. - - # Use user overridden value if available, otherwise locate tool in the Boot JDK. - - # Publish this variable in the help. - - - if [ -z "${JAVA+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for java in Boot JDK" >&5 -$as_echo_n "checking for java in Boot JDK... " >&6; } - JAVA=$BOOT_JDK/bin/java - if test ! -x $JAVA; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitly setting --with-boot-jdk" >&5 -$as_echo "$as_me: Your Boot JDK seems broken. This might be fixed by explicitly setting --with-boot-jdk" >&6;} - as_fn_error $? "Could not find java in the Boot JDK" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !JAVA! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!JAVA!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xJAVA" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of JAVA from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of JAVA from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for java in Boot JDK" >&5 -$as_echo_n "checking for java in Boot JDK... " >&6; } - JAVA=$BOOT_JDK/bin/java - if test ! -x $JAVA; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitly setting --with-boot-jdk" >&5 -$as_echo "$as_me: Your Boot JDK seems broken. This might be fixed by explicitly setting --with-boot-jdk" >&6;} - as_fn_error $? "Could not find java in the Boot JDK" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$JAVA" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool JAVA= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool JAVA= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JAVA" >&5 -$as_echo_n "checking for JAVA... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$JAVA" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool JAVA=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool JAVA=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JAVA+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $JAVA in - [\\/]* | ?:[\\/]*) - ac_cv_path_JAVA="$JAVA" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_JAVA="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -JAVA=$ac_cv_path_JAVA -if test -n "$JAVA"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVA" >&5 -$as_echo "$JAVA" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$JAVA" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool JAVA=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool JAVA=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JAVA" >&5 -$as_echo_n "checking for JAVA... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool JAVA=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - # Use user overridden value if available, otherwise locate tool in the Boot JDK. - - # Publish this variable in the help. - - - if [ -z "${JAVAC+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for javac in Boot JDK" >&5 -$as_echo_n "checking for javac in Boot JDK... " >&6; } - JAVAC=$BOOT_JDK/bin/javac - if test ! -x $JAVAC; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitly setting --with-boot-jdk" >&5 -$as_echo "$as_me: Your Boot JDK seems broken. This might be fixed by explicitly setting --with-boot-jdk" >&6;} - as_fn_error $? "Could not find javac in the Boot JDK" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !JAVAC! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!JAVAC!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xJAVAC" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of JAVAC from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of JAVAC from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for javac in Boot JDK" >&5 -$as_echo_n "checking for javac in Boot JDK... " >&6; } - JAVAC=$BOOT_JDK/bin/javac - if test ! -x $JAVAC; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitly setting --with-boot-jdk" >&5 -$as_echo "$as_me: Your Boot JDK seems broken. This might be fixed by explicitly setting --with-boot-jdk" >&6;} - as_fn_error $? "Could not find javac in the Boot JDK" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$JAVAC" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool JAVAC= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool JAVAC= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JAVAC" >&5 -$as_echo_n "checking for JAVAC... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$JAVAC" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool JAVAC=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool JAVAC=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JAVAC+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $JAVAC in - [\\/]* | ?:[\\/]*) - ac_cv_path_JAVAC="$JAVAC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_JAVAC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -JAVAC=$ac_cv_path_JAVAC -if test -n "$JAVAC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAC" >&5 -$as_echo "$JAVAC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$JAVAC" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool JAVAC=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool JAVAC=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JAVAC" >&5 -$as_echo_n "checking for JAVAC... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool JAVAC=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - # Use user overridden value if available, otherwise locate tool in the Boot JDK. - - # Publish this variable in the help. - - - if [ -z "${JAVADOC+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for javadoc in Boot JDK" >&5 -$as_echo_n "checking for javadoc in Boot JDK... " >&6; } - JAVADOC=$BOOT_JDK/bin/javadoc - if test ! -x $JAVADOC; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitly setting --with-boot-jdk" >&5 -$as_echo "$as_me: Your Boot JDK seems broken. This might be fixed by explicitly setting --with-boot-jdk" >&6;} - as_fn_error $? "Could not find javadoc in the Boot JDK" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !JAVADOC! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!JAVADOC!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xJAVADOC" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of JAVADOC from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of JAVADOC from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for javadoc in Boot JDK" >&5 -$as_echo_n "checking for javadoc in Boot JDK... " >&6; } - JAVADOC=$BOOT_JDK/bin/javadoc - if test ! -x $JAVADOC; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitly setting --with-boot-jdk" >&5 -$as_echo "$as_me: Your Boot JDK seems broken. This might be fixed by explicitly setting --with-boot-jdk" >&6;} - as_fn_error $? "Could not find javadoc in the Boot JDK" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$JAVADOC" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool JAVADOC= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool JAVADOC= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JAVADOC" >&5 -$as_echo_n "checking for JAVADOC... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$JAVADOC" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool JAVADOC=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool JAVADOC=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JAVADOC+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $JAVADOC in - [\\/]* | ?:[\\/]*) - ac_cv_path_JAVADOC="$JAVADOC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_JAVADOC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -JAVADOC=$ac_cv_path_JAVADOC -if test -n "$JAVADOC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVADOC" >&5 -$as_echo "$JAVADOC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$JAVADOC" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool JAVADOC=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool JAVADOC=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JAVADOC" >&5 -$as_echo_n "checking for JAVADOC... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool JAVADOC=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - # Use user overridden value if available, otherwise locate tool in the Boot JDK. - - # Publish this variable in the help. - - - if [ -z "${JAR+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jar in Boot JDK" >&5 -$as_echo_n "checking for jar in Boot JDK... " >&6; } - JAR=$BOOT_JDK/bin/jar - if test ! -x $JAR; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitly setting --with-boot-jdk" >&5 -$as_echo "$as_me: Your Boot JDK seems broken. This might be fixed by explicitly setting --with-boot-jdk" >&6;} - as_fn_error $? "Could not find jar in the Boot JDK" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !JAR! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!JAR!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xJAR" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of JAR from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of JAR from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jar in Boot JDK" >&5 -$as_echo_n "checking for jar in Boot JDK... " >&6; } - JAR=$BOOT_JDK/bin/jar - if test ! -x $JAR; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitly setting --with-boot-jdk" >&5 -$as_echo "$as_me: Your Boot JDK seems broken. This might be fixed by explicitly setting --with-boot-jdk" >&6;} - as_fn_error $? "Could not find jar in the Boot JDK" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$JAR" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool JAR= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool JAR= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JAR" >&5 -$as_echo_n "checking for JAR... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$JAR" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool JAR=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool JAR=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JAR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $JAR in - [\\/]* | ?:[\\/]*) - ac_cv_path_JAR="$JAR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_JAR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -JAR=$ac_cv_path_JAR -if test -n "$JAR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAR" >&5 -$as_echo "$JAR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$JAR" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool JAR=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool JAR=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JAR" >&5 -$as_echo_n "checking for JAR... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool JAR=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - # Use user overridden value if available, otherwise locate tool in the Boot JDK. - - # Publish this variable in the help. - - - if [ -z "${JARSIGNER+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jarsigner in Boot JDK" >&5 -$as_echo_n "checking for jarsigner in Boot JDK... " >&6; } - JARSIGNER=$BOOT_JDK/bin/jarsigner - if test ! -x $JARSIGNER; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitly setting --with-boot-jdk" >&5 -$as_echo "$as_me: Your Boot JDK seems broken. This might be fixed by explicitly setting --with-boot-jdk" >&6;} - as_fn_error $? "Could not find jarsigner in the Boot JDK" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !JARSIGNER! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!JARSIGNER!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xJARSIGNER" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of JARSIGNER from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of JARSIGNER from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jarsigner in Boot JDK" >&5 -$as_echo_n "checking for jarsigner in Boot JDK... " >&6; } - JARSIGNER=$BOOT_JDK/bin/jarsigner - if test ! -x $JARSIGNER; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitly setting --with-boot-jdk" >&5 -$as_echo "$as_me: Your Boot JDK seems broken. This might be fixed by explicitly setting --with-boot-jdk" >&6;} - as_fn_error $? "Could not find jarsigner in the Boot JDK" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$JARSIGNER" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool JARSIGNER= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool JARSIGNER= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JARSIGNER" >&5 -$as_echo_n "checking for JARSIGNER... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$JARSIGNER" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool JARSIGNER=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool JARSIGNER=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JARSIGNER+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $JARSIGNER in - [\\/]* | ?:[\\/]*) - ac_cv_path_JARSIGNER="$JARSIGNER" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_JARSIGNER="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -JARSIGNER=$ac_cv_path_JARSIGNER -if test -n "$JARSIGNER"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JARSIGNER" >&5 -$as_echo "$JARSIGNER" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$JARSIGNER" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool JARSIGNER=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool JARSIGNER=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JARSIGNER" >&5 -$as_echo_n "checking for JARSIGNER... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool JARSIGNER=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - # Finally, set some other options... - - # When compiling code to be executed by the Boot JDK, force compatibility with the - # oldest supported bootjdk. - BOOT_JDK_SOURCETARGET="-source 9 -target 9" - - - - - # Check if the boot jdk is 32 or 64 bit - if "$JAVA" -version 2>&1 | $GREP -q "64-Bit"; then - BOOT_JDK_BITS="64" - else - BOOT_JDK_BITS="32" - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Boot JDK is 32 or 64 bits" >&5 -$as_echo_n "checking if Boot JDK is 32 or 64 bits... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_BITS" >&5 -$as_echo "$BOOT_JDK_BITS" >&6; } - - # Try to enable CDS - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for local Boot JDK Class Data Sharing (CDS)" >&5 -$as_echo_n "checking for local Boot JDK Class Data Sharing (CDS)... " >&6; } - BOOT_JDK_CDS_ARCHIVE=$CONFIGURESUPPORT_OUTPUTDIR/classes.jsa - - $ECHO "Check if jvm arg is ok: -XX:+UnlockDiagnosticVMOptions -XX:-VerifySharedSpaces -XX:SharedArchiveFile=$BOOT_JDK_CDS_ARCHIVE" >&5 - $ECHO "Command: $JAVA -XX:+UnlockDiagnosticVMOptions -XX:-VerifySharedSpaces -XX:SharedArchiveFile=$BOOT_JDK_CDS_ARCHIVE -version" >&5 - OUTPUT=`$JAVA -XX:+UnlockDiagnosticVMOptions -XX:-VerifySharedSpaces -XX:SharedArchiveFile=$BOOT_JDK_CDS_ARCHIVE -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | $GREP -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | $GREP " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - boot_jdk_cds_args="$boot_jdk_cds_args -XX:+UnlockDiagnosticVMOptions -XX:-VerifySharedSpaces -XX:SharedArchiveFile=$BOOT_JDK_CDS_ARCHIVE" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi - - - if test "x$boot_jdk_cds_args" != x; then - # Try creating a CDS archive - "$JAVA" $boot_jdk_cds_args -Xshare:dump > /dev/null 2>&1 - if test $? -eq 0; then - BOOTJDK_USE_LOCAL_CDS=true - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, created" >&5 -$as_echo "yes, created" >&6; } - else - # Generation failed, don't use CDS. - BOOTJDK_USE_LOCAL_CDS=false - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, creation failed" >&5 -$as_echo "no, creation failed" >&6; } - fi - else - BOOTJDK_USE_LOCAL_CDS=false - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, -XX:SharedArchiveFile not supported" >&5 -$as_echo "no, -XX:SharedArchiveFile not supported" >&6; } - fi - - - -# Check whether --with-build-jdk was given. -if test "${with_build_jdk+set}" = set; then : - withval=$with_build_jdk; -fi - - - CREATE_BUILDJDK=false - EXTERNAL_BUILDJDK=false - BUILD_JDK_FOUND="no" - if test "x$with_build_jdk" != "x"; then - - if test "x$BUILD_JDK_FOUND" = xno; then - # Execute the test - - if test "x$with_build_jdk" != x; then - BUILD_JDK=$with_build_jdk - BUILD_JDK_FOUND=maybe - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Build JDK using configure arguments" >&5 -$as_echo "$as_me: Found potential Build JDK using configure arguments" >&6;} - fi - - # If previous step claimed to have found a JDK, check it to see if it seems to be valid. - if test "x$BUILD_JDK_FOUND" = xmaybe; then - # Do we have a bin/java? - if test ! -x "$BUILD_JDK/bin/java"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Build JDK found at $BUILD_JDK did not contain bin/java; ignoring" >&5 -$as_echo "$as_me: Potential Build JDK found at $BUILD_JDK did not contain bin/java; ignoring" >&6;} - BUILD_JDK_FOUND=no - elif test ! -x "$BUILD_JDK/bin/jlink"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Build JDK found at $BUILD_JDK did not contain bin/jlink; ignoring" >&5 -$as_echo "$as_me: Potential Build JDK found at $BUILD_JDK did not contain bin/jlink; ignoring" >&6;} - BUILD_JDK_FOUND=no - elif test ! -x "$BUILD_JDK/bin/jmod"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Build JDK found at $BUILD_JDK did not contain bin/jmod; ignoring" >&5 -$as_echo "$as_me: Potential Build JDK found at $BUILD_JDK did not contain bin/jmod; ignoring" >&6;} - BUILD_JDK_FOUND=no - elif test ! -x "$BUILD_JDK/bin/javac"; then - # Do we have a bin/javac? - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Build JDK found at $BUILD_JDK did not contain bin/javac; ignoring" >&5 -$as_echo "$as_me: Potential Build JDK found at $BUILD_JDK did not contain bin/javac; ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be a JRE instead of an JDK)" >&5 -$as_echo "$as_me: (This might be a JRE instead of an JDK)" >&6;} - BUILD_JDK_FOUND=no - else - # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? - BUILD_JDK_VERSION=`"$BUILD_JDK/bin/java" -version 2>&1 | $HEAD -n 1` - - # Extra M4 quote needed to protect [] in grep expression. - FOUND_CORRECT_VERSION=`echo $BUILD_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"'` - if test "x$FOUND_CORRECT_VERSION" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Build JDK found at $BUILD_JDK is incorrect JDK version ($BUILD_JDK_VERSION); ignoring" >&5 -$as_echo "$as_me: Potential Build JDK found at $BUILD_JDK is incorrect JDK version ($BUILD_JDK_VERSION); ignoring" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Build JDK must be version 10)" >&5 -$as_echo "$as_me: (Your Build JDK must be version 10)" >&6;} - BUILD_JDK_FOUND=no - else - # We're done! - BUILD_JDK_FOUND=yes - - # Only process if variable expands to non-empty - - if test "x$BUILD_JDK" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$BUILD_JDK" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BUILD_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of BUILD_JDK" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - BUILD_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BUILD_JDK to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$BUILD_JDK" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - BUILD_JDK="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_JDK to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting BUILD_JDK to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$BUILD_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_JDK, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of BUILD_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BUILD_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - BUILD_JDK="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - BUILD_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Build JDK" >&5 -$as_echo_n "checking for Build JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_JDK" >&5 -$as_echo "$BUILD_JDK" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Build JDK version" >&5 -$as_echo_n "checking Build JDK version... " >&6; } - BUILD_JDK_VERSION=`"$BUILD_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_JDK_VERSION" >&5 -$as_echo "$BUILD_JDK_VERSION" >&6; } - fi # end check jdk version - fi # end check java - fi # end check build jdk found - fi - - EXTERNAL_BUILDJDK=true - else - if test "x$COMPILE_TYPE" = "xcross"; then - BUILD_JDK="\$(BUILDJDK_OUTPUTDIR)/jdk" - BUILD_JDK_FOUND=yes - CREATE_BUILDJDK=true - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Build JDK" >&5 -$as_echo_n "checking for Build JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, will build it for the host platform" >&5 -$as_echo "yes, will build it for the host platform" >&6; } - else - BUILD_JDK="\$(JDK_OUTPUTDIR)" - BUILD_JDK_FOUND=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Build JDK" >&5 -$as_echo_n "checking for Build JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, will use output dir" >&5 -$as_echo "yes, will use output dir" >&6; } - fi - fi - - JMOD="$BUILD_JDK/bin/jmod" - JLINK="$BUILD_JDK/bin/jlink" - - - - if test "x$BUILD_JDK_FOUND" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Build JDK" >&5 -$as_echo_n "checking for Build JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_fn_error $? "Could not find a suitable Build JDK" "$LINENO" 5 - fi - - - - - - -############################################################################### -# -# Configure the sources to use. We can add or override individual directories. -# -############################################################################### - - - OUTPUTDIR="$OUTPUTDIR" - - JDK_OUTPUTDIR="$OUTPUTDIR/jdk" - - # Where are the sources. - - - - -# Check whether --with-import-modules was given. -if test "${with_import_modules+set}" = set; then : - withval=$with_import_modules; -fi - - - if test "x$with_import_modules" != x \ - && test "x$with_import_modules" != "xno"; then - if test -d "$with_import_modules"; then - IMPORT_MODULES_TOPDIR="$with_import_modules" - - # Only process if variable expands to non-empty - - if test "x$IMPORT_MODULES_TOPDIR" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$IMPORT_MODULES_TOPDIR" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of IMPORT_MODULES_TOPDIR, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of IMPORT_MODULES_TOPDIR, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of IMPORT_MODULES_TOPDIR" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - IMPORT_MODULES_TOPDIR="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting IMPORT_MODULES_TOPDIR to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting IMPORT_MODULES_TOPDIR to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$IMPORT_MODULES_TOPDIR" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - IMPORT_MODULES_TOPDIR="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting IMPORT_MODULES_TOPDIR to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting IMPORT_MODULES_TOPDIR to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$IMPORT_MODULES_TOPDIR" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of IMPORT_MODULES_TOPDIR, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of IMPORT_MODULES_TOPDIR, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of IMPORT_MODULES_TOPDIR, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - IMPORT_MODULES_TOPDIR="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - IMPORT_MODULES_TOPDIR="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - elif test -e "$with_import_modules"; then - IMPORT_MODULES_TOPDIR="$CONFIGURESUPPORT_OUTPUTDIR/import-modules" - $RM -rf "$IMPORT_MODULES_TOPDIR" - $MKDIR -p "$IMPORT_MODULES_TOPDIR" - if ! $UNZIP -q "$with_import_modules" -d "$IMPORT_MODULES_TOPDIR"; then - as_fn_error $? "--with-import-modules=\"$with_import_modules\" must point to a dir or a zip file" "$LINENO" 5 - fi - else - as_fn_error $? "--with-import-modules=\"$with_import_modules\" must point to a dir or a zip file" "$LINENO" 5 - fi - fi - - if test -d "$IMPORT_MODULES_TOPDIR/modules"; then - IMPORT_MODULES_CLASSES="$IMPORT_MODULES_TOPDIR/modules" - fi - if test -d "$IMPORT_MODULES_TOPDIR/modules_cmds"; then - IMPORT_MODULES_CMDS="$IMPORT_MODULES_TOPDIR/modules_cmds" - fi - if test -d "$IMPORT_MODULES_TOPDIR/modules_libs"; then - IMPORT_MODULES_LIBS="$IMPORT_MODULES_TOPDIR/modules_libs" - fi - if test -d "$IMPORT_MODULES_TOPDIR/modules_conf"; then - IMPORT_MODULES_CONF="$IMPORT_MODULES_TOPDIR/modules_conf" - fi - if test -d "$IMPORT_MODULES_TOPDIR/modules_legal"; then - IMPORT_MODULES_LEGAL="$IMPORT_MODULES_TOPDIR/modules_legal" - fi - if test -d "$IMPORT_MODULES_TOPDIR/modules_man"; then - IMPORT_MODULES_MAN="$IMPORT_MODULES_TOPDIR/modules_man" - fi - if test -d "$IMPORT_MODULES_TOPDIR/modules_src"; then - IMPORT_MODULES_SRC="$IMPORT_MODULES_TOPDIR/modules_src" - fi - if test -d "$IMPORT_MODULES_TOPDIR/make"; then - IMPORT_MODULES_MAKE="$IMPORT_MODULES_TOPDIR/make" - fi - - - - - - - - - - - -############################################################################### -# -# Setup the toolchain (compilers etc), i.e. tools used to compile and process -# native code. -# -############################################################################### - -# See if we are doing a complete static build or not - - # Check whether --enable-static-build was given. -if test "${enable_static_build+set}" = set; then : - enableval=$enable_static_build; -fi - - STATIC_BUILD=false - if test "x$enable_static_build" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if static build is enabled" >&5 -$as_echo_n "checking if static build is enabled... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - if test "x$OPENJDK_TARGET_OS" != "xmacosx"; then - as_fn_error $? "--enable-static-build is only supported for macosx builds" "$LINENO" 5 - fi - STATIC_BUILD_CFLAGS="-DSTATIC_BUILD=1" - CFLAGS_JDKLIB_EXTRA="$CFLAGS_JDKLIB_EXTRA $STATIC_BUILD_CFLAGS" - CXXFLAGS_JDKLIB_EXTRA="$CXXFLAGS_JDKLIB_EXTRA $STATIC_BUILD_CFLAGS" - STATIC_BUILD=true - elif test "x$enable_static_build" = "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if static build is enabled" >&5 -$as_echo_n "checking if static build is enabled... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - elif test "x$enable_static_build" != "x"; then - as_fn_error $? "--enable-static-build can only be assigned \"yes\" or \"no\"" "$LINENO" 5 - fi - - - - -# First determine the toolchain type (compiler family) - - -# Check whether --with-toolchain-type was given. -if test "${with_toolchain_type+set}" = set; then : - withval=$with_toolchain_type; -fi - - - # Use indirect variable referencing - toolchain_var_name=VALID_TOOLCHAINS_$OPENJDK_BUILD_OS - VALID_TOOLCHAINS=${!toolchain_var_name} - - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - if test -n "$XCODEBUILD"; then - # On Mac OS X, default toolchain to clang after Xcode 5 - XCODE_VERSION_OUTPUT=`"$XCODEBUILD" -version 2>&1 | $HEAD -n 1` - $ECHO "$XCODE_VERSION_OUTPUT" | $GREP "Xcode " > /dev/null - if test $? -ne 0; then - as_fn_error $? "Failed to determine Xcode version." "$LINENO" 5 - fi - XCODE_MAJOR_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | \ - $SED -e 's/^Xcode \([1-9][0-9.]*\)/\1/' | \ - $CUT -f 1 -d .` - { $as_echo "$as_me:${as_lineno-$LINENO}: Xcode major version: $XCODE_MAJOR_VERSION" >&5 -$as_echo "$as_me: Xcode major version: $XCODE_MAJOR_VERSION" >&6;} - if test $XCODE_MAJOR_VERSION -ge 5; then - DEFAULT_TOOLCHAIN="clang" - else - DEFAULT_TOOLCHAIN="gcc" - fi - else - # If Xcode is not installed, but the command line tools are - # then we can't run xcodebuild. On these systems we should - # default to clang - DEFAULT_TOOLCHAIN="clang" - fi - else - # First toolchain type in the list is the default - DEFAULT_TOOLCHAIN=${VALID_TOOLCHAINS%% *} - fi - - if test "x$with_toolchain_type" = xlist; then - # List all toolchains - { $as_echo "$as_me:${as_lineno-$LINENO}: The following toolchains are valid on this platform:" >&5 -$as_echo "$as_me: The following toolchains are valid on this platform:" >&6;} - for toolchain in $VALID_TOOLCHAINS; do - toolchain_var_name=TOOLCHAIN_DESCRIPTION_$toolchain - TOOLCHAIN_DESCRIPTION=${!toolchain_var_name} - $PRINTF " %-10s %s\n" $toolchain "$TOOLCHAIN_DESCRIPTION" - done - - exit 0 - elif test "x$with_toolchain_type" != x; then - # User override; check that it is valid - if test "x${VALID_TOOLCHAINS/$with_toolchain_type/}" = "x${VALID_TOOLCHAINS}"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Toolchain type $with_toolchain_type is not valid on this platform." >&5 -$as_echo "$as_me: Toolchain type $with_toolchain_type is not valid on this platform." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Valid toolchains: $VALID_TOOLCHAINS." >&5 -$as_echo "$as_me: Valid toolchains: $VALID_TOOLCHAINS." >&6;} - as_fn_error $? "Cannot continue." "$LINENO" 5 - fi - TOOLCHAIN_TYPE=$with_toolchain_type - else - # No flag given, use default - TOOLCHAIN_TYPE=$DEFAULT_TOOLCHAIN - fi - - - TOOLCHAIN_CC_BINARY_clang="clang" - TOOLCHAIN_CC_BINARY_gcc="gcc" - TOOLCHAIN_CC_BINARY_microsoft="cl" - TOOLCHAIN_CC_BINARY_solstudio="cc" - TOOLCHAIN_CC_BINARY_xlc="xlc_r" - - TOOLCHAIN_CXX_BINARY_clang="clang++" - TOOLCHAIN_CXX_BINARY_gcc="g++" - TOOLCHAIN_CXX_BINARY_microsoft="cl" - TOOLCHAIN_CXX_BINARY_solstudio="CC" - TOOLCHAIN_CXX_BINARY_xlc="xlC_r" - - # Use indirect variable referencing - toolchain_var_name=TOOLCHAIN_DESCRIPTION_$TOOLCHAIN_TYPE - TOOLCHAIN_DESCRIPTION=${!toolchain_var_name} - toolchain_var_name=TOOLCHAIN_MINIMUM_VERSION_$TOOLCHAIN_TYPE - TOOLCHAIN_MINIMUM_VERSION=${!toolchain_var_name} - toolchain_var_name=TOOLCHAIN_CC_BINARY_$TOOLCHAIN_TYPE - TOOLCHAIN_CC_BINARY=${!toolchain_var_name} - toolchain_var_name=TOOLCHAIN_CXX_BINARY_$TOOLCHAIN_TYPE - TOOLCHAIN_CXX_BINARY=${!toolchain_var_name} - - - # Define filename patterns - if test "x$OPENJDK_TARGET_OS" = xwindows; then - LIBRARY_PREFIX= - SHARED_LIBRARY_SUFFIX='.dll' - STATIC_LIBRARY_SUFFIX='.lib' - SHARED_LIBRARY='$1.dll' - STATIC_LIBRARY='$1.lib' - OBJ_SUFFIX='.obj' - EXE_SUFFIX='.exe' - else - LIBRARY_PREFIX=lib - SHARED_LIBRARY_SUFFIX='.so' - STATIC_LIBRARY_SUFFIX='.a' - SHARED_LIBRARY='lib$1.so' - STATIC_LIBRARY='lib$1.a' - OBJ_SUFFIX='.o' - EXE_SUFFIX='' - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - # For full static builds, we're overloading the SHARED_LIBRARY - # variables in order to limit the amount of changes required. - # It would be better to remove SHARED and just use LIBRARY and - # LIBRARY_SUFFIX for libraries that can be built either - # shared or static and use STATIC_* for libraries that are - # always built statically. - if test "x$STATIC_BUILD" = xtrue; then - SHARED_LIBRARY='lib$1.a' - SHARED_LIBRARY_SUFFIX='.a' - else - SHARED_LIBRARY='lib$1.dylib' - SHARED_LIBRARY_SUFFIX='.dylib' - fi - fi - fi - - - - - - - - - - - if test "x$TOOLCHAIN_TYPE" = "x$DEFAULT_TOOLCHAIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Using default toolchain $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)" >&5 -$as_echo "$as_me: Using default toolchain $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)" >&6;} - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Using user selected toolchain $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION). Default toolchain is $DEFAULT_TOOLCHAIN." >&5 -$as_echo "$as_me: Using user selected toolchain $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION). Default toolchain is $DEFAULT_TOOLCHAIN." >&6;} - fi - - -# User supplied flags should be used when configure detects compilers - - if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags" >&5 -$as_echo "$as_me: WARNING: Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags" >&2;} - fi - - if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags" >&5 -$as_echo "$as_me: WARNING: Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags" >&2;} - fi - - if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags" >&5 -$as_echo "$as_me: WARNING: Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags" >&2;} - fi - - -# Check whether --with-extra-cflags was given. -if test "${with_extra_cflags+set}" = set; then : - withval=$with_extra_cflags; -fi - - - -# Check whether --with-extra-cxxflags was given. -if test "${with_extra_cxxflags+set}" = set; then : - withval=$with_extra_cxxflags; -fi - - - -# Check whether --with-extra-ldflags was given. -if test "${with_extra_ldflags+set}" = set; then : - withval=$with_extra_ldflags; -fi - - - EXTRA_CFLAGS="$with_extra_cflags" - EXTRA_CXXFLAGS="$with_extra_cxxflags" - EXTRA_LDFLAGS="$with_extra_ldflags" - - - - - - # The global CFLAGS and LDLAGS variables are used by configure tests and - # should include the extra parameters - CFLAGS="$EXTRA_CFLAGS" - CXXFLAGS="$EXTRA_CXXFLAGS" - LDFLAGS="$EXTRA_LDFLAGS" - CPPFLAGS="" - -# The sysroot cflags are needed for configure to be able to run the compilers - - if test "x$SYSROOT" != "x"; then - if test "x$TOOLCHAIN_TYPE" = xsolstudio; then - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - # Solaris Studio does not have a concept of sysroot. Instead we must - # make sure the default include and lib dirs are appended to each - # compile and link command line. Must also add -I-xbuiltin to enable - # inlining of system functions and intrinsics. - SYSROOT_CFLAGS="-I-xbuiltin -I$SYSROOT/usr/include" - SYSROOT_LDFLAGS="-L$SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \ - -L$SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR" - fi - elif test "x$TOOLCHAIN_TYPE" = xgcc; then - SYSROOT_CFLAGS="--sysroot=$SYSROOT" - SYSROOT_LDFLAGS="--sysroot=$SYSROOT" - elif test "x$TOOLCHAIN_TYPE" = xclang; then - SYSROOT_CFLAGS="-isysroot $SYSROOT" - SYSROOT_LDFLAGS="-isysroot $SYSROOT" - fi - # The global CFLAGS and LDFLAGS variables need these for configure to function - CFLAGS="$CFLAGS $SYSROOT_CFLAGS" - CPPFLAGS="$CPPFLAGS $SYSROOT_CFLAGS" - CXXFLAGS="$CXXFLAGS $SYSROOT_CFLAGS" - LDFLAGS="$LDFLAGS $SYSROOT_LDFLAGS" - fi - - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - # We also need -iframework/System/Library/Frameworks - SYSROOT_CFLAGS="$SYSROOT_CFLAGS -iframework $SYSROOT/System/Library/Frameworks" - SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -iframework $SYSROOT/System/Library/Frameworks" - # These always need to be set, or we can't find the frameworks embedded in JavaVM.framework - # set this here so it doesn't have to be peppered throughout the forest - SYSROOT_CFLAGS="$SYSROOT_CFLAGS -F $SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks" - SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -F $SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks" - fi - - - - - -# Then detect the actual binaries needed - - # FIXME: Is this needed? - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - # Store the CFLAGS etc passed to the configure script. - ORG_CFLAGS="$CFLAGS" - ORG_CXXFLAGS="$CXXFLAGS" - - # autoconf magic only relies on PATH, so update it if tools dir is specified - OLD_PATH="$PATH" - - # On Windows, we need to detect the visual studio installation first. - # This will change the PATH, but we need to keep that new PATH even - # after toolchain detection is done, since the compiler (on x86) uses - # it for DLL resolution in runtime. - if test "x$OPENJDK_BUILD_OS" = "xwindows" \ - && test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then - - # Store path to cygwin link.exe to help excluding it when searching for - # VS linker. This must be done before changing the PATH when looking for VS. - # Extract the first word of "link", so it can be a program name with args. -set dummy link; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CYGWIN_LINK+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CYGWIN_LINK in - [\\/]* | ?:[\\/]*) - ac_cv_path_CYGWIN_LINK="$CYGWIN_LINK" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CYGWIN_LINK="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CYGWIN_LINK=$ac_cv_path_CYGWIN_LINK -if test -n "$CYGWIN_LINK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGWIN_LINK" >&5 -$as_echo "$CYGWIN_LINK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$CYGWIN_LINK" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the first found link.exe is actually the Cygwin link tool" >&5 -$as_echo_n "checking if the first found link.exe is actually the Cygwin link tool... " >&6; } - "$CYGWIN_LINK" --version > /dev/null - if test $? -eq 0 ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - # This might be the VS linker. Don't exclude it later on. - CYGWIN_LINK="" - fi - fi - - # First-hand choice is to locate and run the vsvars bat file. - - -# Check whether --with-toolchain-version was given. -if test "${with_toolchain_version+set}" = set; then : - withval=$with_toolchain_version; -fi - - - if test "x$with_toolchain_version" = xlist; then - # List all toolchains - { $as_echo "$as_me:${as_lineno-$LINENO}: The following toolchain versions are valid on this platform:" >&5 -$as_echo "$as_me: The following toolchain versions are valid on this platform:" >&6;} - for version in $VALID_VS_VERSIONS; do - eval VS_DESCRIPTION=\${VS_DESCRIPTION_$version} - $PRINTF " %-10s %s\n" $version "$VS_DESCRIPTION" - done - - exit 0 - elif test "x$DEVKIT_VS_VERSION" != x; then - VS_VERSION=$DEVKIT_VS_VERSION - TOOLCHAIN_VERSION=$VS_VERSION - eval VS_DESCRIPTION="\${VS_DESCRIPTION_${VS_VERSION}}" - eval VS_VERSION_INTERNAL="\${VS_VERSION_INTERNAL_${VS_VERSION}}" - eval MSVCR_NAME="\${VS_MSVCR_${VS_VERSION}}" - eval MSVCP_NAME="\${VS_MSVCP_${VS_VERSION}}" - eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}" - VS_PATH="$TOOLCHAIN_PATH:$PATH" - - # Convert DEVKIT_VS_INCLUDE into windows style VS_INCLUDE so that it - # can still be exported as INCLUDE for compiler invocations without - # SYSROOT_CFLAGS - OLDIFS="$IFS" - IFS=";" - for i in $DEVKIT_VS_INCLUDE; do - ipath=$i - - unix_path="$ipath" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - windows_path=`$CYGPATH -m "$unix_path"` - ipath="$windows_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - windows_path=`cmd //c echo $unix_path` - ipath="$windows_path" - fi - - VS_INCLUDE="$VS_INCLUDE;$ipath" - done - # Convert DEVKIT_VS_LIB into VS_LIB so that it can still be exported - # as LIB for compiler invocations without SYSROOT_LDFLAGS - for i in $DEVKIT_VS_LIB; do - libpath=$i - - unix_path="$libpath" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - windows_path=`$CYGPATH -m "$unix_path"` - libpath="$windows_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - windows_path=`cmd //c echo $unix_path` - libpath="$windows_path" - fi - - VS_LIB="$VS_LIB;$libpath" - done - IFS="$OLDIFS" - - { $as_echo "$as_me:${as_lineno-$LINENO}: Found devkit $VS_DESCRIPTION" >&5 -$as_echo "$as_me: Found devkit $VS_DESCRIPTION" >&6;} - - elif test "x$with_toolchain_version" != x; then - # User override; check that it is valid - if test "x${VALID_VS_VERSIONS/$with_toolchain_version/}" = "x${VALID_VS_VERSIONS}"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Visual Studio version $with_toolchain_version is not valid." >&5 -$as_echo "$as_me: Visual Studio version $with_toolchain_version is not valid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Valid Visual Studio versions: $VALID_VS_VERSIONS." >&5 -$as_echo "$as_me: Valid Visual Studio versions: $VALID_VS_VERSIONS." >&6;} - as_fn_error $? "Cannot continue." "$LINENO" 5 - fi - VS_VERSIONS_PROBE_LIST="$with_toolchain_version" - else - # No flag given, use default - VS_VERSIONS_PROBE_LIST="$VALID_VS_VERSIONS" - fi - - for VS_VERSION in $VS_VERSIONS_PROBE_LIST; do - - VS_VERSION="$VS_VERSION" - eval VS_COMNTOOLS_VAR="\${VS_ENVVAR_${VS_VERSION}}" - eval VS_COMNTOOLS="\$${VS_COMNTOOLS_VAR}" - eval VS_INSTALL_DIR="\${VS_VS_INSTALLDIR_${VS_VERSION}}" - eval SDK_INSTALL_DIR="\${VS_SDK_INSTALLDIR_${VS_VERSION}}" - - # When using --with-tools-dir, assume it points to the correct and default - # version of Visual Studio or that --with-toolchain-version was also set. - if test "x$with_tools_dir" != x; then - - if test "x$VS_ENV_CMD" = x; then - VS_VERSION="${VS_VERSION}" - VS_BASE="$with_tools_dir/../.." - METHOD="--with-tools-dir" - - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - VCVARSFILE="vc/bin/vcvars32.bat" - else - VCVARSFILE="vc/bin/amd64/vcvars64.bat" - fi - - - windows_path="$VS_BASE" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - VS_BASE="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - VS_BASE="$unix_path" - fi - - if test -d "$VS_BASE"; then - if test -f "$VS_BASE/$VCVARSFILE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} - VS_ENV_CMD="$VS_BASE/$VCVARSFILE" - # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see - # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013 - eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5 -$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;} - fi - fi - fi - - - if test "x$VS_ENV_CMD" = x; then - VS_VERSION="${VS_VERSION}" - VS_BASE="$with_tools_dir/../../.." - METHOD="--with-tools-dir" - - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - VCVARSFILE="vc/bin/vcvars32.bat" - else - VCVARSFILE="vc/bin/amd64/vcvars64.bat" - fi - - - windows_path="$VS_BASE" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - VS_BASE="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - VS_BASE="$unix_path" - fi - - if test -d "$VS_BASE"; then - if test -f "$VS_BASE/$VCVARSFILE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} - VS_ENV_CMD="$VS_BASE/$VCVARSFILE" - # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see - # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013 - eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5 -$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;} - fi - fi - fi - - if test "x$VS_ENV_CMD" = x; then - # Having specified an argument which is incorrect will produce an instant failure; - # we should not go on looking - { $as_echo "$as_me:${as_lineno-$LINENO}: The path given by --with-tools-dir does not contain a valid" >&5 -$as_echo "$as_me: The path given by --with-tools-dir does not contain a valid" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Visual Studio installation. Please point to the VC/bin or VC/bin/amd64" >&5 -$as_echo "$as_me: Visual Studio installation. Please point to the VC/bin or VC/bin/amd64" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: directory within the Visual Studio installation" >&5 -$as_echo "$as_me: directory within the Visual Studio installation" >&6;} - as_fn_error $? "Cannot locate a valid Visual Studio installation" "$LINENO" 5 - fi - fi - - VS_ENV_CMD="" - VS_ENV_ARGS="" - - if test "x$VS_COMNTOOLS" != x; then - - if test "x$VS_ENV_CMD" = x; then - VS_VERSION="${VS_VERSION}" - VS_BASE="$VS_COMNTOOLS/../.." - METHOD="$VS_COMNTOOLS_VAR variable" - - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - VCVARSFILE="vc/bin/vcvars32.bat" - else - VCVARSFILE="vc/bin/amd64/vcvars64.bat" - fi - - - windows_path="$VS_BASE" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - VS_BASE="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - VS_BASE="$unix_path" - fi - - if test -d "$VS_BASE"; then - if test -f "$VS_BASE/$VCVARSFILE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} - VS_ENV_CMD="$VS_BASE/$VCVARSFILE" - # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see - # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013 - eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5 -$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;} - fi - fi - fi - - fi - if test "x$PROGRAMFILES" != x; then - - if test "x$VS_ENV_CMD" = x; then - VS_VERSION="${VS_VERSION}" - VS_BASE="$PROGRAMFILES/$VS_INSTALL_DIR" - METHOD="well-known name" - - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - VCVARSFILE="vc/bin/vcvars32.bat" - else - VCVARSFILE="vc/bin/amd64/vcvars64.bat" - fi - - - windows_path="$VS_BASE" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - VS_BASE="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - VS_BASE="$unix_path" - fi - - if test -d "$VS_BASE"; then - if test -f "$VS_BASE/$VCVARSFILE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} - VS_ENV_CMD="$VS_BASE/$VCVARSFILE" - # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see - # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013 - eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5 -$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;} - fi - fi - fi - - fi - # Work around the insanely named ProgramFiles(x86) env variable - PROGRAMFILES_X86="`env | $SED -n 's/^ProgramFiles(x86)=//p'`" - if test "x$PROGRAMFILES_X86" != x; then - - if test "x$VS_ENV_CMD" = x; then - VS_VERSION="${VS_VERSION}" - VS_BASE="$PROGRAMFILES_X86/$VS_INSTALL_DIR" - METHOD="well-known name" - - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - VCVARSFILE="vc/bin/vcvars32.bat" - else - VCVARSFILE="vc/bin/amd64/vcvars64.bat" - fi - - - windows_path="$VS_BASE" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - VS_BASE="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - VS_BASE="$unix_path" - fi - - if test -d "$VS_BASE"; then - if test -f "$VS_BASE/$VCVARSFILE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} - VS_ENV_CMD="$VS_BASE/$VCVARSFILE" - # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see - # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013 - eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5 -$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;} - fi - fi - fi - - fi - - if test "x$VS_ENV_CMD" = x; then - VS_VERSION="${VS_VERSION}" - VS_BASE="C:/Program Files/$VS_INSTALL_DIR" - METHOD="well-known name" - - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - VCVARSFILE="vc/bin/vcvars32.bat" - else - VCVARSFILE="vc/bin/amd64/vcvars64.bat" - fi - - - windows_path="$VS_BASE" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - VS_BASE="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - VS_BASE="$unix_path" - fi - - if test -d "$VS_BASE"; then - if test -f "$VS_BASE/$VCVARSFILE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} - VS_ENV_CMD="$VS_BASE/$VCVARSFILE" - # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see - # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013 - eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5 -$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;} - fi - fi - fi - - - if test "x$VS_ENV_CMD" = x; then - VS_VERSION="${VS_VERSION}" - VS_BASE="C:/Program Files (x86)/$VS_INSTALL_DIR" - METHOD="well-known name" - - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - VCVARSFILE="vc/bin/vcvars32.bat" - else - VCVARSFILE="vc/bin/amd64/vcvars64.bat" - fi - - - windows_path="$VS_BASE" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - VS_BASE="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - VS_BASE="$unix_path" - fi - - if test -d "$VS_BASE"; then - if test -f "$VS_BASE/$VCVARSFILE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} - VS_ENV_CMD="$VS_BASE/$VCVARSFILE" - # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see - # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013 - eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5 -$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;} - fi - fi - fi - - - if test "x$SDK_INSTALL_DIR" != x; then - if test "x$ProgramW6432" != x; then - - if test "x$VS_ENV_CMD" = x; then - VS_VERSION="${VS_VERSION}" - WIN_SDK_BASE="$ProgramW6432/$SDK_INSTALL_DIR" - METHOD="well-known name" - - windows_path="$WIN_SDK_BASE" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - WIN_SDK_BASE="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - WIN_SDK_BASE="$unix_path" - fi - - if test -d "$WIN_SDK_BASE"; then - # There have been cases of partial or broken SDK installations. A missing - # lib dir is not going to work. - if test ! -d "$WIN_SDK_BASE/lib"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, lib dir is missing. Ignoring" >&5 -$as_echo "$as_me: Warning: Installation is broken, lib dir is missing. Ignoring" >&6;} - elif test -f "$WIN_SDK_BASE/Bin/SetEnv.Cmd"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} - VS_ENV_CMD="$WIN_SDK_BASE/Bin/SetEnv.Cmd" - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - VS_ENV_ARGS="/x86" - else - VS_ENV_ARGS="/x64" - fi - # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see - # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK - # TODO: improve detection for other versions of SDK - eval PLATFORM_TOOLSET="\${VS_SDK_PLATFORM_NAME_${VS_VERSION}}" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&5 -$as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&6;} - fi - fi - fi - - fi - if test "x$PROGRAMW6432" != x; then - - if test "x$VS_ENV_CMD" = x; then - VS_VERSION="${VS_VERSION}" - WIN_SDK_BASE="$PROGRAMW6432/$SDK_INSTALL_DIR" - METHOD="well-known name" - - windows_path="$WIN_SDK_BASE" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - WIN_SDK_BASE="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - WIN_SDK_BASE="$unix_path" - fi - - if test -d "$WIN_SDK_BASE"; then - # There have been cases of partial or broken SDK installations. A missing - # lib dir is not going to work. - if test ! -d "$WIN_SDK_BASE/lib"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, lib dir is missing. Ignoring" >&5 -$as_echo "$as_me: Warning: Installation is broken, lib dir is missing. Ignoring" >&6;} - elif test -f "$WIN_SDK_BASE/Bin/SetEnv.Cmd"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} - VS_ENV_CMD="$WIN_SDK_BASE/Bin/SetEnv.Cmd" - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - VS_ENV_ARGS="/x86" - else - VS_ENV_ARGS="/x64" - fi - # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see - # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK - # TODO: improve detection for other versions of SDK - eval PLATFORM_TOOLSET="\${VS_SDK_PLATFORM_NAME_${VS_VERSION}}" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&5 -$as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&6;} - fi - fi - fi - - fi - if test "x$PROGRAMFILES" != x; then - - if test "x$VS_ENV_CMD" = x; then - VS_VERSION="${VS_VERSION}" - WIN_SDK_BASE="$PROGRAMFILES/$SDK_INSTALL_DIR" - METHOD="well-known name" - - windows_path="$WIN_SDK_BASE" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - WIN_SDK_BASE="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - WIN_SDK_BASE="$unix_path" - fi - - if test -d "$WIN_SDK_BASE"; then - # There have been cases of partial or broken SDK installations. A missing - # lib dir is not going to work. - if test ! -d "$WIN_SDK_BASE/lib"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, lib dir is missing. Ignoring" >&5 -$as_echo "$as_me: Warning: Installation is broken, lib dir is missing. Ignoring" >&6;} - elif test -f "$WIN_SDK_BASE/Bin/SetEnv.Cmd"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} - VS_ENV_CMD="$WIN_SDK_BASE/Bin/SetEnv.Cmd" - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - VS_ENV_ARGS="/x86" - else - VS_ENV_ARGS="/x64" - fi - # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see - # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK - # TODO: improve detection for other versions of SDK - eval PLATFORM_TOOLSET="\${VS_SDK_PLATFORM_NAME_${VS_VERSION}}" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&5 -$as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&6;} - fi - fi - fi - - fi - - if test "x$VS_ENV_CMD" = x; then - VS_VERSION="${VS_VERSION}" - WIN_SDK_BASE="C:/Program Files/$SDK_INSTALL_DIR" - METHOD="well-known name" - - windows_path="$WIN_SDK_BASE" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - WIN_SDK_BASE="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - WIN_SDK_BASE="$unix_path" - fi - - if test -d "$WIN_SDK_BASE"; then - # There have been cases of partial or broken SDK installations. A missing - # lib dir is not going to work. - if test ! -d "$WIN_SDK_BASE/lib"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, lib dir is missing. Ignoring" >&5 -$as_echo "$as_me: Warning: Installation is broken, lib dir is missing. Ignoring" >&6;} - elif test -f "$WIN_SDK_BASE/Bin/SetEnv.Cmd"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} - VS_ENV_CMD="$WIN_SDK_BASE/Bin/SetEnv.Cmd" - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - VS_ENV_ARGS="/x86" - else - VS_ENV_ARGS="/x64" - fi - # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see - # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK - # TODO: improve detection for other versions of SDK - eval PLATFORM_TOOLSET="\${VS_SDK_PLATFORM_NAME_${VS_VERSION}}" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&5 -$as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&6;} - fi - fi - fi - - - if test "x$VS_ENV_CMD" = x; then - VS_VERSION="${VS_VERSION}" - WIN_SDK_BASE="C:/Program Files (x86)/$SDK_INSTALL_DIR" - METHOD="well-known name" - - windows_path="$WIN_SDK_BASE" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - WIN_SDK_BASE="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - WIN_SDK_BASE="$unix_path" - fi - - if test -d "$WIN_SDK_BASE"; then - # There have been cases of partial or broken SDK installations. A missing - # lib dir is not going to work. - if test ! -d "$WIN_SDK_BASE/lib"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, lib dir is missing. Ignoring" >&5 -$as_echo "$as_me: Warning: Installation is broken, lib dir is missing. Ignoring" >&6;} - elif test -f "$WIN_SDK_BASE/Bin/SetEnv.Cmd"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} - VS_ENV_CMD="$WIN_SDK_BASE/Bin/SetEnv.Cmd" - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - VS_ENV_ARGS="/x86" - else - VS_ENV_ARGS="/x64" - fi - # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see - # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK - # TODO: improve detection for other versions of SDK - eval PLATFORM_TOOLSET="\${VS_SDK_PLATFORM_NAME_${VS_VERSION}}" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 -$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&5 -$as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&6;} - fi - fi - fi - - fi - - if test "x$VS_ENV_CMD" != x; then - TOOLCHAIN_VERSION=$VS_VERSION - eval VS_DESCRIPTION="\${VS_DESCRIPTION_${VS_VERSION}}" - eval VS_VERSION_INTERNAL="\${VS_VERSION_INTERNAL_${VS_VERSION}}" - eval MSVCR_NAME="\${VS_MSVCR_${VS_VERSION}}" - eval MSVCP_NAME="\${VS_MSVCP_${VS_VERSION}}" - # The rest of the variables are already evaled while probing - { $as_echo "$as_me:${as_lineno-$LINENO}: Found $VS_DESCRIPTION" >&5 -$as_echo "$as_me: Found $VS_DESCRIPTION" >&6;} - break - fi - done - - - # If we have a devkit, skip all of the below. - if test "x$DEVKIT_VS_VERSION" = x; then - if test "x$VS_ENV_CMD" != x; then - # We have found a Visual Studio environment on disk, let's extract variables from the vsvars bat file. - - # Only process if variable expands to non-empty - - if test "x$VS_ENV_CMD" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$VS_ENV_CMD" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of VS_ENV_CMD" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of VS_ENV_CMD, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of VS_ENV_CMD, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of VS_ENV_CMD" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$VS_ENV_CMD" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of VS_ENV_CMD" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$VS_ENV_CMD" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of VS_ENV_CMD" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - VS_ENV_CMD="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting VS_ENV_CMD to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting VS_ENV_CMD to \"$new_complete\"" >&6;} - fi - fi - - - # Lets extract the variables that are set by vcvarsall.bat/vsvars32.bat/vsvars64.bat - { $as_echo "$as_me:${as_lineno-$LINENO}: Trying to extract Visual Studio environment variables" >&5 -$as_echo "$as_me: Trying to extract Visual Studio environment variables" >&6;} - - # We need to create a couple of temporary files. - VS_ENV_TMP_DIR="$CONFIGURESUPPORT_OUTPUTDIR/vs-env" - $MKDIR -p $VS_ENV_TMP_DIR - - # Cannot use the VS10 setup script directly (since it only updates the DOS subshell environment). - # Instead create a shell script which will set the relevant variables when run. - WINPATH_VS_ENV_CMD="$VS_ENV_CMD" - - unix_path="$WINPATH_VS_ENV_CMD" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - windows_path=`$CYGPATH -m "$unix_path"` - WINPATH_VS_ENV_CMD="$windows_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - windows_path=`cmd //c echo $unix_path` - WINPATH_VS_ENV_CMD="$windows_path" - fi - - WINPATH_BASH="$BASH" - - unix_path="$WINPATH_BASH" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - windows_path=`$CYGPATH -m "$unix_path"` - WINPATH_BASH="$windows_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - windows_path=`cmd //c echo $unix_path` - WINPATH_BASH="$windows_path" - fi - - - # Generate a DOS batch file which runs $VS_ENV_CMD, and then creates a shell - # script (executable by bash) that will setup the important variables. - EXTRACT_VC_ENV_BAT_FILE="$VS_ENV_TMP_DIR/extract-vs-env.bat" - $ECHO "@echo off" > $EXTRACT_VC_ENV_BAT_FILE - # This will end up something like: - # call C:/progra~2/micros~2.0/vc/bin/amd64/vcvars64.bat - $ECHO "call $WINPATH_VS_ENV_CMD $VS_ENV_ARGS" >> $EXTRACT_VC_ENV_BAT_FILE - # These will end up something like: - # C:/CygWin/bin/bash -c 'echo VS_PATH=\"$PATH\" > localdevenv.sh - # The trailing space for everyone except PATH is no typo, but is needed due - # to trailing \ in the Windows paths. These will be stripped later. - $ECHO "$WINPATH_BASH -c 'echo VS_PATH="'\"$PATH\" > set-vs-env.sh' \ - >> $EXTRACT_VC_ENV_BAT_FILE - $ECHO "$WINPATH_BASH -c 'echo VS_INCLUDE="'\"$INCLUDE\;$include \" >> set-vs-env.sh' \ - >> $EXTRACT_VC_ENV_BAT_FILE - $ECHO "$WINPATH_BASH -c 'echo VS_LIB="'\"$LIB\;$lib \" >> set-vs-env.sh' \ - >> $EXTRACT_VC_ENV_BAT_FILE - $ECHO "$WINPATH_BASH -c 'echo VCINSTALLDIR="'\"$VCINSTALLDIR \" >> set-vs-env.sh' \ - >> $EXTRACT_VC_ENV_BAT_FILE - $ECHO "$WINPATH_BASH -c 'echo WindowsSdkDir="'\"$WindowsSdkDir \" >> set-vs-env.sh' \ - >> $EXTRACT_VC_ENV_BAT_FILE - $ECHO "$WINPATH_BASH -c 'echo WINDOWSSDKDIR="'\"$WINDOWSSDKDIR \" >> set-vs-env.sh' \ - >> $EXTRACT_VC_ENV_BAT_FILE - - # Now execute the newly created bat file. - # The | cat is to stop SetEnv.Cmd to mess with system colors on msys. - # Change directory so we don't need to mess with Windows paths in redirects. - cd $VS_ENV_TMP_DIR - cmd /c extract-vs-env.bat | $CAT - cd $CURDIR - - if test ! -s $VS_ENV_TMP_DIR/set-vs-env.sh; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not succesfully extract the envionment variables needed for the VS setup." >&5 -$as_echo "$as_me: Could not succesfully extract the envionment variables needed for the VS setup." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Try setting --with-tools-dir to the VC/bin directory within the VS installation" >&5 -$as_echo "$as_me: Try setting --with-tools-dir to the VC/bin directory within the VS installation" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: or run \"bash.exe -l\" from a VS command prompt and then run configure from there." >&5 -$as_echo "$as_me: or run \"bash.exe -l\" from a VS command prompt and then run configure from there." >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 - fi - - # Now set all paths and other env variables. This will allow the rest of - # the configure script to find and run the compiler in the proper way. - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting extracted environment variables" >&5 -$as_echo "$as_me: Setting extracted environment variables" >&6;} - . $VS_ENV_TMP_DIR/set-vs-env.sh - # Now we have VS_PATH, VS_INCLUDE, VS_LIB. For further checking, we - # also define VCINSTALLDIR, WindowsSdkDir and WINDOWSSDKDIR. - else - # We did not find a vsvars bat file, let's hope we are run from a VS command prompt. - { $as_echo "$as_me:${as_lineno-$LINENO}: Cannot locate a valid Visual Studio installation, checking current environment" >&5 -$as_echo "$as_me: Cannot locate a valid Visual Studio installation, checking current environment" >&6;} - fi - fi - - # At this point, we should have correct variables in the environment, or we can't continue. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Visual Studio variables" >&5 -$as_echo_n "checking for Visual Studio variables... " >&6; } - - if test "x$VCINSTALLDIR" != x || test "x$WindowsSDKDir" != x \ - || test "x$WINDOWSSDKDIR" != x || test "x$DEVKIT_NAME" != x; then - if test "x$VS_INCLUDE" = x || test "x$VS_LIB" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: present but broken" >&5 -$as_echo "present but broken" >&6; } - as_fn_error $? "Your VC command prompt seems broken, INCLUDE and/or LIB is missing." "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - # Remove any trailing "\" ";" and " " from the variables. - VS_INCLUDE=`$ECHO "$VS_INCLUDE" | $SED -e 's/\\\\*;* *$//'` - VS_LIB=`$ECHO "$VS_LIB" | $SED 's/\\\\*;* *$//'` - VCINSTALLDIR=`$ECHO "$VCINSTALLDIR" | $SED 's/\\\\* *$//'` - WindowsSDKDir=`$ECHO "$WindowsSDKDir" | $SED 's/\\\\* *$//'` - WINDOWSSDKDIR=`$ECHO "$WINDOWSSDKDIR" | $SED 's/\\\\* *$//'` - # Remove any paths containing # (typically F#) as that messes up make. This - # is needed if visual studio was installed with F# support. - VS_PATH=`$ECHO "$VS_PATH" | $SED 's/[^:#]*#[^:]*://g'` - - - - - - # Convert VS_INCLUDE into SYSROOT_CFLAGS - OLDIFS="$IFS" - IFS=";" - for i in $VS_INCLUDE; do - ipath=$i - # Only process non-empty elements - if test "x$ipath" != x; then - IFS="$OLDIFS" - # Check that directory exists before calling fixup_path - testpath=$ipath - - windows_path="$testpath" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - testpath="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - testpath="$unix_path" - fi - - if test -d "$testpath"; then - - # Only process if variable expands to non-empty - - if test "x$ipath" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$ipath" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of ipath, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of ipath, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of ipath" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - ipath="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting ipath to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting ipath to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$ipath" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - ipath="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting ipath to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting ipath to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$ipath" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of ipath, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of ipath, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of ipath, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - ipath="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - ipath="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - SYSROOT_CFLAGS="$SYSROOT_CFLAGS -I$ipath" - fi - IFS=";" - fi - done - # Convert VS_LIB into SYSROOT_LDFLAGS - for i in $VS_LIB; do - libpath=$i - # Only process non-empty elements - if test "x$libpath" != x; then - IFS="$OLDIFS" - # Check that directory exists before calling fixup_path - testpath=$libpath - - windows_path="$testpath" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - testpath="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - testpath="$unix_path" - fi - - if test -d "$testpath"; then - - # Only process if variable expands to non-empty - - if test "x$libpath" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$libpath" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of libpath, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of libpath, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of libpath" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - libpath="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting libpath to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting libpath to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$libpath" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - libpath="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting libpath to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting libpath to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$libpath" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of libpath, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of libpath, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of libpath, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - libpath="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - libpath="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -libpath:$libpath" - fi - IFS=";" - fi - done - IFS="$OLDIFS" - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - - if test "x$VS_ENV_CMD" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Cannot locate a valid Visual Studio or Windows SDK installation on disk," >&5 -$as_echo "$as_me: Cannot locate a valid Visual Studio or Windows SDK installation on disk," >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: nor is this script run from a Visual Studio command prompt." >&5 -$as_echo "$as_me: nor is this script run from a Visual Studio command prompt." >&6;} - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Running the extraction script failed." >&5 -$as_echo "$as_me: Running the extraction script failed." >&6;} - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Try setting --with-tools-dir to the VC/bin directory within the VS installation" >&5 -$as_echo "$as_me: Try setting --with-tools-dir to the VC/bin directory within the VS installation" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: or run \"bash.exe -l\" from a VS command prompt and then run configure from there." >&5 -$as_echo "$as_me: or run \"bash.exe -l\" from a VS command prompt and then run configure from there." >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 - fi - - # Reset path to VS_PATH. It will include everything that was on PATH at the time we - # ran TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV. - PATH="$VS_PATH" - # The microsoft toolchain also requires INCLUDE and LIB to be set. - export INCLUDE="$VS_INCLUDE" - export LIB="$VS_LIB" - else - if test "x$XCODE_VERSION_OUTPUT" != x; then - # For Xcode, we set the Xcode version as TOOLCHAIN_VERSION - TOOLCHAIN_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | $CUT -f 2 -d ' '` - TOOLCHAIN_DESCRIPTION="$TOOLCHAIN_DESCRIPTION from Xcode" - else - # Currently we do not define this for other toolchains. This might change as the need arise. - TOOLCHAIN_VERSION= - fi - fi - - - # Finally add TOOLCHAIN_PATH at the beginning, to allow --with-tools-dir to - # override all other locations. - if test "x$TOOLCHAIN_PATH" != x; then - PATH=$TOOLCHAIN_PATH:$PATH - fi - - - # - # Setup the compilers (CC and CXX) - # - - COMPILER_NAME=C - SEARCH_LIST="$TOOLCHAIN_CC_BINARY" - - if test "x$CC" != x; then - # User has supplied compiler name already, always let that override. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied compiler CC=$CC" >&5 -$as_echo "$as_me: Will use user supplied compiler CC=$CC" >&6;} - if test "x`basename $CC`" = "x$CC"; then - # A command without a complete path is provided, search $PATH. - - for ac_prog in $CC -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_POTENTIAL_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $POTENTIAL_CC in - [\\/]* | ?:[\\/]*) - ac_cv_path_POTENTIAL_CC="$POTENTIAL_CC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_POTENTIAL_CC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -POTENTIAL_CC=$ac_cv_path_POTENTIAL_CC -if test -n "$POTENTIAL_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $POTENTIAL_CC" >&5 -$as_echo "$POTENTIAL_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$POTENTIAL_CC" && break -done - - if test "x$POTENTIAL_CC" != x; then - CC=$POTENTIAL_CC - else - as_fn_error $? "User supplied compiler CC=$CC could not be found" "$LINENO" 5 - fi - else - # Otherwise it might already be a complete path - if test ! -x "$CC"; then - as_fn_error $? "User supplied compiler CC=$CC does not exist" "$LINENO" 5 - fi - fi - else - # No user supplied value. Locate compiler ourselves. - - # If we are cross compiling, assume cross compilation tools follows the - # cross compilation standard where they are prefixed with the autoconf - # standard name for the target. For example the binary - # i686-sun-solaris2.10-gcc will cross compile for i686-sun-solaris2.10. - # If we are not cross compiling, then the default compiler name will be - # used. - - CC= - # If TOOLCHAIN_PATH is set, check for all compiler names in there first - # before checking the rest of the PATH. - # FIXME: Now that we prefix the TOOLS_DIR to the PATH in the PRE_DETECTION - # step, this should not be necessary. - if test -n "$TOOLCHAIN_PATH"; then - PATH_save="$PATH" - PATH="$TOOLCHAIN_PATH" - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}$SEARCH_LIST", so it can be a program name with args. -set dummy ${ac_tool_prefix}$SEARCH_LIST; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TOOLCHAIN_PATH_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $TOOLCHAIN_PATH_CC in - [\\/]* | ?:[\\/]*) - ac_cv_path_TOOLCHAIN_PATH_CC="$TOOLCHAIN_PATH_CC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_TOOLCHAIN_PATH_CC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -TOOLCHAIN_PATH_CC=$ac_cv_path_TOOLCHAIN_PATH_CC -if test -n "$TOOLCHAIN_PATH_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TOOLCHAIN_PATH_CC" >&5 -$as_echo "$TOOLCHAIN_PATH_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_TOOLCHAIN_PATH_CC"; then - ac_pt_TOOLCHAIN_PATH_CC=$TOOLCHAIN_PATH_CC - # Extract the first word of "$SEARCH_LIST", so it can be a program name with args. -set dummy $SEARCH_LIST; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_TOOLCHAIN_PATH_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_TOOLCHAIN_PATH_CC in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_TOOLCHAIN_PATH_CC="$ac_pt_TOOLCHAIN_PATH_CC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_TOOLCHAIN_PATH_CC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_TOOLCHAIN_PATH_CC=$ac_cv_path_ac_pt_TOOLCHAIN_PATH_CC -if test -n "$ac_pt_TOOLCHAIN_PATH_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_TOOLCHAIN_PATH_CC" >&5 -$as_echo "$ac_pt_TOOLCHAIN_PATH_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_TOOLCHAIN_PATH_CC" = x; then - TOOLCHAIN_PATH_CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - TOOLCHAIN_PATH_CC=$ac_pt_TOOLCHAIN_PATH_CC - fi -else - TOOLCHAIN_PATH_CC="$ac_cv_path_TOOLCHAIN_PATH_CC" -fi - - CC=$TOOLCHAIN_PATH_CC - PATH="$PATH_save" - fi - - # AC_PATH_TOOL can't be run multiple times with the same variable, - # so create a new name for this run. - if test "x$CC" = x; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}$SEARCH_LIST", so it can be a program name with args. -set dummy ${ac_tool_prefix}$SEARCH_LIST; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_POTENTIAL_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $POTENTIAL_CC in - [\\/]* | ?:[\\/]*) - ac_cv_path_POTENTIAL_CC="$POTENTIAL_CC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_POTENTIAL_CC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -POTENTIAL_CC=$ac_cv_path_POTENTIAL_CC -if test -n "$POTENTIAL_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $POTENTIAL_CC" >&5 -$as_echo "$POTENTIAL_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_POTENTIAL_CC"; then - ac_pt_POTENTIAL_CC=$POTENTIAL_CC - # Extract the first word of "$SEARCH_LIST", so it can be a program name with args. -set dummy $SEARCH_LIST; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_POTENTIAL_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_POTENTIAL_CC in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_POTENTIAL_CC="$ac_pt_POTENTIAL_CC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_POTENTIAL_CC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_POTENTIAL_CC=$ac_cv_path_ac_pt_POTENTIAL_CC -if test -n "$ac_pt_POTENTIAL_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_POTENTIAL_CC" >&5 -$as_echo "$ac_pt_POTENTIAL_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_POTENTIAL_CC" = x; then - POTENTIAL_CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - POTENTIAL_CC=$ac_pt_POTENTIAL_CC - fi -else - POTENTIAL_CC="$ac_cv_path_POTENTIAL_CC" -fi - - CC=$POTENTIAL_CC - fi - - if test "x$CC" = x; then - - # Print a helpful message on how to acquire the necessary build dependency. - # devkit is the help tag: freetype, cups, alsa etc - MISSING_DEPENDENCY=devkit - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - cygwin_help $MISSING_DEPENDENCY - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - msys_help $MISSING_DEPENDENCY - else - PKGHANDLER_COMMAND= - - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - brew) - brew_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - esac - - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." - fi - fi - - as_fn_error $? "Could not find a $COMPILER_NAME compiler. $HELP_MSG" "$LINENO" 5 - fi - fi - - # Now we have a compiler binary in CC. Make sure it's okay. - - # Only process if variable expands to non-empty - - if test "x$CC" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$CC" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CC, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CC, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of CC" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CC, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of CC, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of CC" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$CC" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CC, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CC, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of CC" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$CC" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CC, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CC, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of CC" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - CC="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CC to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting CC to \"$new_complete\"" >&6;} - fi - fi - - TEST_COMPILER="$CC" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking resolved symbolic links for CC" >&5 -$as_echo_n "checking resolved symbolic links for CC... " >&6; } - SYMLINK_ORIGINAL="$TEST_COMPILER" - - if test "x$OPENJDK_BUILD_OS" != xwindows; then - # Follow a chain of symbolic links. Use readlink - # where it exists, else fall back to horribly - # complicated shell code. - if test "x$READLINK_TESTED" != yes; then - # On MacOSX there is a readlink tool with a different - # purpose than the GNU readlink tool. Check the found readlink. - ISGNU=`$READLINK --version 2>&1 | $GREP GNU` - if test "x$ISGNU" = x; then - # A readlink that we do not know how to use. - # Are there other non-GNU readlinks out there? - READLINK_TESTED=yes - READLINK= - fi - fi - - if test "x$READLINK" != x; then - SYMLINK_ORIGINAL=`$READLINK -f $SYMLINK_ORIGINAL` - else - # Save the current directory for restoring afterwards - STARTDIR=$PWD - COUNTER=0 - sym_link_dir=`$DIRNAME $SYMLINK_ORIGINAL` - sym_link_file=`$BASENAME $SYMLINK_ORIGINAL` - cd $sym_link_dir - # Use -P flag to resolve symlinks in directories. - cd `$THEPWDCMD -P` - sym_link_dir=`$THEPWDCMD -P` - # Resolve file symlinks - while test $COUNTER -lt 20; do - ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` - if test "x$ISLINK" == x; then - # This is not a symbolic link! We are done! - break - fi - # Again resolve directory symlinks since the target of the just found - # link could be in a different directory - cd `$DIRNAME $ISLINK` - sym_link_dir=`$THEPWDCMD -P` - sym_link_file=`$BASENAME $ISLINK` - let COUNTER=COUNTER+1 - done - cd $STARTDIR - SYMLINK_ORIGINAL=$sym_link_dir/$sym_link_file - fi - fi - - if test "x$TEST_COMPILER" = "x$SYMLINK_ORIGINAL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no symlink" >&5 -$as_echo "no symlink" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SYMLINK_ORIGINAL" >&5 -$as_echo "$SYMLINK_ORIGINAL" >&6; } - - # We can't handle ccache by gcc wrappers, since we need to know if we're - # using ccache. Instead ccache usage must be controlled by a configure option. - COMPILER_BASENAME=`$BASENAME "$SYMLINK_ORIGINAL"` - if test "x$COMPILER_BASENAME" = "xccache"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Please use --enable-ccache instead of providing a wrapped compiler." >&5 -$as_echo "$as_me: Please use --enable-ccache instead of providing a wrapped compiler." >&6;} - as_fn_error $? "$TEST_COMPILER is a symbolic link to ccache. This is not supported." "$LINENO" 5 - fi - fi - - - COMPILER=$CC - COMPILER_NAME=$COMPILER_NAME - - if test "x$TOOLCHAIN_TYPE" = xsolstudio; then - # cc -V output typically looks like - # cc: Sun C 5.12 Linux_i386 2011/11/16 - # or - # cc: Studio 12.5 Sun C 5.14 SunOS_sparc 2016/05/31 - COMPILER_VERSION_OUTPUT=`$COMPILER -V 2>&1` - # Check that this is likely to be the Solaris Studio cc. - $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "^.* Sun $COMPILER_NAME" > /dev/null - if test $? -ne 0; then - ALT_VERSION_OUTPUT=`$COMPILER --version 2>&1` - { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 -$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with -V was: \"$COMPILER_VERSION_OUTPUT\"" >&5 -$as_echo "$as_me: The result from running with -V was: \"$COMPILER_VERSION_OUTPUT\"" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$ALT_VERSION_OUTPUT\"" >&5 -$as_echo "$as_me: The result from running with --version was: \"$ALT_VERSION_OUTPUT\"" >&6;} - as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 - fi - # Remove usage instructions (if present), and - # collapse compiler output into a single line - COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e 's/ *[Uu]sage:.*//'` - COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e "s/^.*[ ,\t]$COMPILER_NAME[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/"` - elif test "x$TOOLCHAIN_TYPE" = xxlc; then - # xlc -qversion output typically looks like - # IBM XL C/C++ for AIX, V11.1 (5724-X13) - # Version: 11.01.0000.0015 - COMPILER_VERSION_OUTPUT=`$COMPILER -qversion 2>&1` - # Check that this is likely to be the IBM XL C compiler. - $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "IBM XL C" > /dev/null - if test $? -ne 0; then - ALT_VERSION_OUTPUT=`$COMPILER --version 2>&1` - { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 -$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with -qversion was: \"$COMPILER_VERSION_OUTPUT\"" >&5 -$as_echo "$as_me: The result from running with -qversion was: \"$COMPILER_VERSION_OUTPUT\"" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$ALT_VERSION_OUTPUT\"" >&5 -$as_echo "$as_me: The result from running with --version was: \"$ALT_VERSION_OUTPUT\"" >&6;} - as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 - fi - # Collapse compiler output into a single line - COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` - COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e 's/^.*, V\([1-9][0-9.]*\).*$/\1/'` - elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - # There is no specific version flag, but all output starts with a version string. - # First line typically looks something like: - # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 - COMPILER_VERSION_OUTPUT=`$COMPILER 2>&1 | $HEAD -n 1 | $TR -d '\r'` - # Check that this is likely to be Microsoft CL.EXE. - $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Microsoft.*Compiler" > /dev/null - if test $? -ne 0; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 -$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running it was: \"$COMPILER_VERSION_OUTPUT\"" >&5 -$as_echo "$as_me: The result from running it was: \"$COMPILER_VERSION_OUTPUT\"" >&6;} - as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 - fi - # Collapse compiler output into a single line - COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` - COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e 's/^.*ersion.\([1-9][0-9.]*\) .*$/\1/'` - elif test "x$TOOLCHAIN_TYPE" = xgcc; then - # gcc --version output typically looks like - # gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1 - # Copyright (C) 2013 Free Software Foundation, Inc. - # This is free software; see the source for copying conditions. There is NO - # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1` - # Check that this is likely to be GCC. - $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Free Software Foundation" > /dev/null - if test $? -ne 0; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 -$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$COMPILER_VERSION\"" >&5 -$as_echo "$as_me: The result from running with --version was: \"$COMPILER_VERSION\"" >&6;} - as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 - fi - # Remove Copyright and legalese from version string, and - # collapse into a single line - COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e 's/ *Copyright .*//'` - COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e 's/^.* \([1-9]\.[0-9.]*\)[^0-9.].*$/\1/'` - elif test "x$TOOLCHAIN_TYPE" = xclang; then - # clang --version output typically looks like - # Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) - # clang version 3.3 (tags/RELEASE_33/final) - # or - # Debian clang version 3.2-7ubuntu1 (tags/RELEASE_32/final) (based on LLVM 3.2) - # Target: x86_64-pc-linux-gnu - # Thread model: posix - COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1` - # Check that this is likely to be clang - $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "clang" > /dev/null - if test $? -ne 0; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 -$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$COMPILER_VERSION_OUTPUT\"" >&5 -$as_echo "$as_me: The result from running with --version was: \"$COMPILER_VERSION_OUTPUT\"" >&6;} - as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 - fi - # Collapse compiler output into a single line - COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` - COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e 's/^.* version \([1-9][0-9.]*\).*$/\1/'` - else - as_fn_error $? "Unknown toolchain type $TOOLCHAIN_TYPE." "$LINENO" 5 - fi - # This sets CC_VERSION_NUMBER or CXX_VERSION_NUMBER. (This comment is a grep marker) - CC_VERSION_NUMBER="$COMPILER_VERSION_NUMBER" - # This sets CC_VERSION_STRING or CXX_VERSION_STRING. (This comment is a grep marker) - CC_VERSION_STRING="$COMPILER_VERSION_STRING" - - { $as_echo "$as_me:${as_lineno-$LINENO}: Using $TOOLCHAIN_TYPE $COMPILER_NAME compiler version $COMPILER_VERSION_NUMBER [$COMPILER_VERSION_STRING]" >&5 -$as_echo "$as_me: Using $TOOLCHAIN_TYPE $COMPILER_NAME compiler version $COMPILER_VERSION_NUMBER [$COMPILER_VERSION_STRING]" >&6;} - - - # Now that we have resolved CC ourself, let autoconf have its go at it - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in $CC - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in $CC -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - COMPILER_NAME=C++ - SEARCH_LIST="$TOOLCHAIN_CXX_BINARY" - - if test "x$CXX" != x; then - # User has supplied compiler name already, always let that override. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied compiler CXX=$CXX" >&5 -$as_echo "$as_me: Will use user supplied compiler CXX=$CXX" >&6;} - if test "x`basename $CXX`" = "x$CXX"; then - # A command without a complete path is provided, search $PATH. - - for ac_prog in $CXX -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_POTENTIAL_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $POTENTIAL_CXX in - [\\/]* | ?:[\\/]*) - ac_cv_path_POTENTIAL_CXX="$POTENTIAL_CXX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_POTENTIAL_CXX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -POTENTIAL_CXX=$ac_cv_path_POTENTIAL_CXX -if test -n "$POTENTIAL_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $POTENTIAL_CXX" >&5 -$as_echo "$POTENTIAL_CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$POTENTIAL_CXX" && break -done - - if test "x$POTENTIAL_CXX" != x; then - CXX=$POTENTIAL_CXX - else - as_fn_error $? "User supplied compiler CXX=$CXX could not be found" "$LINENO" 5 - fi - else - # Otherwise it might already be a complete path - if test ! -x "$CXX"; then - as_fn_error $? "User supplied compiler CXX=$CXX does not exist" "$LINENO" 5 - fi - fi - else - # No user supplied value. Locate compiler ourselves. - - # If we are cross compiling, assume cross compilation tools follows the - # cross compilation standard where they are prefixed with the autoconf - # standard name for the target. For example the binary - # i686-sun-solaris2.10-gcc will cross compile for i686-sun-solaris2.10. - # If we are not cross compiling, then the default compiler name will be - # used. - - CXX= - # If TOOLCHAIN_PATH is set, check for all compiler names in there first - # before checking the rest of the PATH. - # FIXME: Now that we prefix the TOOLS_DIR to the PATH in the PRE_DETECTION - # step, this should not be necessary. - if test -n "$TOOLCHAIN_PATH"; then - PATH_save="$PATH" - PATH="$TOOLCHAIN_PATH" - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}$SEARCH_LIST", so it can be a program name with args. -set dummy ${ac_tool_prefix}$SEARCH_LIST; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TOOLCHAIN_PATH_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $TOOLCHAIN_PATH_CXX in - [\\/]* | ?:[\\/]*) - ac_cv_path_TOOLCHAIN_PATH_CXX="$TOOLCHAIN_PATH_CXX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_TOOLCHAIN_PATH_CXX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -TOOLCHAIN_PATH_CXX=$ac_cv_path_TOOLCHAIN_PATH_CXX -if test -n "$TOOLCHAIN_PATH_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TOOLCHAIN_PATH_CXX" >&5 -$as_echo "$TOOLCHAIN_PATH_CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_TOOLCHAIN_PATH_CXX"; then - ac_pt_TOOLCHAIN_PATH_CXX=$TOOLCHAIN_PATH_CXX - # Extract the first word of "$SEARCH_LIST", so it can be a program name with args. -set dummy $SEARCH_LIST; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_TOOLCHAIN_PATH_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_TOOLCHAIN_PATH_CXX in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_TOOLCHAIN_PATH_CXX="$ac_pt_TOOLCHAIN_PATH_CXX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_TOOLCHAIN_PATH_CXX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_TOOLCHAIN_PATH_CXX=$ac_cv_path_ac_pt_TOOLCHAIN_PATH_CXX -if test -n "$ac_pt_TOOLCHAIN_PATH_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_TOOLCHAIN_PATH_CXX" >&5 -$as_echo "$ac_pt_TOOLCHAIN_PATH_CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_TOOLCHAIN_PATH_CXX" = x; then - TOOLCHAIN_PATH_CXX="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - TOOLCHAIN_PATH_CXX=$ac_pt_TOOLCHAIN_PATH_CXX - fi -else - TOOLCHAIN_PATH_CXX="$ac_cv_path_TOOLCHAIN_PATH_CXX" -fi - - CXX=$TOOLCHAIN_PATH_CXX - PATH="$PATH_save" - fi - - # AC_PATH_TOOL can't be run multiple times with the same variable, - # so create a new name for this run. - if test "x$CXX" = x; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}$SEARCH_LIST", so it can be a program name with args. -set dummy ${ac_tool_prefix}$SEARCH_LIST; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_POTENTIAL_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $POTENTIAL_CXX in - [\\/]* | ?:[\\/]*) - ac_cv_path_POTENTIAL_CXX="$POTENTIAL_CXX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_POTENTIAL_CXX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -POTENTIAL_CXX=$ac_cv_path_POTENTIAL_CXX -if test -n "$POTENTIAL_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $POTENTIAL_CXX" >&5 -$as_echo "$POTENTIAL_CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_POTENTIAL_CXX"; then - ac_pt_POTENTIAL_CXX=$POTENTIAL_CXX - # Extract the first word of "$SEARCH_LIST", so it can be a program name with args. -set dummy $SEARCH_LIST; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_POTENTIAL_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_POTENTIAL_CXX in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_POTENTIAL_CXX="$ac_pt_POTENTIAL_CXX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_POTENTIAL_CXX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_POTENTIAL_CXX=$ac_cv_path_ac_pt_POTENTIAL_CXX -if test -n "$ac_pt_POTENTIAL_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_POTENTIAL_CXX" >&5 -$as_echo "$ac_pt_POTENTIAL_CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_POTENTIAL_CXX" = x; then - POTENTIAL_CXX="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - POTENTIAL_CXX=$ac_pt_POTENTIAL_CXX - fi -else - POTENTIAL_CXX="$ac_cv_path_POTENTIAL_CXX" -fi - - CXX=$POTENTIAL_CXX - fi - - if test "x$CXX" = x; then - - # Print a helpful message on how to acquire the necessary build dependency. - # devkit is the help tag: freetype, cups, alsa etc - MISSING_DEPENDENCY=devkit - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - cygwin_help $MISSING_DEPENDENCY - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - msys_help $MISSING_DEPENDENCY - else - PKGHANDLER_COMMAND= - - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - brew) - brew_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - esac - - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." - fi - fi - - as_fn_error $? "Could not find a $COMPILER_NAME compiler. $HELP_MSG" "$LINENO" 5 - fi - fi - - # Now we have a compiler binary in CXX. Make sure it's okay. - - # Only process if variable expands to non-empty - - if test "x$CXX" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$CXX" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXX, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CXX, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of CXX" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXX, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of CXX, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of CXX" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$CXX" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXX, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CXX, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of CXX" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$CXX" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXX, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CXX, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of CXX" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - CXX="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CXX to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting CXX to \"$new_complete\"" >&6;} - fi - fi - - TEST_COMPILER="$CXX" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking resolved symbolic links for CXX" >&5 -$as_echo_n "checking resolved symbolic links for CXX... " >&6; } - SYMLINK_ORIGINAL="$TEST_COMPILER" - - if test "x$OPENJDK_BUILD_OS" != xwindows; then - # Follow a chain of symbolic links. Use readlink - # where it exists, else fall back to horribly - # complicated shell code. - if test "x$READLINK_TESTED" != yes; then - # On MacOSX there is a readlink tool with a different - # purpose than the GNU readlink tool. Check the found readlink. - ISGNU=`$READLINK --version 2>&1 | $GREP GNU` - if test "x$ISGNU" = x; then - # A readlink that we do not know how to use. - # Are there other non-GNU readlinks out there? - READLINK_TESTED=yes - READLINK= - fi - fi - - if test "x$READLINK" != x; then - SYMLINK_ORIGINAL=`$READLINK -f $SYMLINK_ORIGINAL` - else - # Save the current directory for restoring afterwards - STARTDIR=$PWD - COUNTER=0 - sym_link_dir=`$DIRNAME $SYMLINK_ORIGINAL` - sym_link_file=`$BASENAME $SYMLINK_ORIGINAL` - cd $sym_link_dir - # Use -P flag to resolve symlinks in directories. - cd `$THEPWDCMD -P` - sym_link_dir=`$THEPWDCMD -P` - # Resolve file symlinks - while test $COUNTER -lt 20; do - ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` - if test "x$ISLINK" == x; then - # This is not a symbolic link! We are done! - break - fi - # Again resolve directory symlinks since the target of the just found - # link could be in a different directory - cd `$DIRNAME $ISLINK` - sym_link_dir=`$THEPWDCMD -P` - sym_link_file=`$BASENAME $ISLINK` - let COUNTER=COUNTER+1 - done - cd $STARTDIR - SYMLINK_ORIGINAL=$sym_link_dir/$sym_link_file - fi - fi - - if test "x$TEST_COMPILER" = "x$SYMLINK_ORIGINAL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no symlink" >&5 -$as_echo "no symlink" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SYMLINK_ORIGINAL" >&5 -$as_echo "$SYMLINK_ORIGINAL" >&6; } - - # We can't handle ccache by gcc wrappers, since we need to know if we're - # using ccache. Instead ccache usage must be controlled by a configure option. - COMPILER_BASENAME=`$BASENAME "$SYMLINK_ORIGINAL"` - if test "x$COMPILER_BASENAME" = "xccache"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Please use --enable-ccache instead of providing a wrapped compiler." >&5 -$as_echo "$as_me: Please use --enable-ccache instead of providing a wrapped compiler." >&6;} - as_fn_error $? "$TEST_COMPILER is a symbolic link to ccache. This is not supported." "$LINENO" 5 - fi - fi - - - COMPILER=$CXX - COMPILER_NAME=$COMPILER_NAME - - if test "x$TOOLCHAIN_TYPE" = xsolstudio; then - # cc -V output typically looks like - # cc: Sun C 5.12 Linux_i386 2011/11/16 - # or - # cc: Studio 12.5 Sun C 5.14 SunOS_sparc 2016/05/31 - COMPILER_VERSION_OUTPUT=`$COMPILER -V 2>&1` - # Check that this is likely to be the Solaris Studio cc. - $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "^.* Sun $COMPILER_NAME" > /dev/null - if test $? -ne 0; then - ALT_VERSION_OUTPUT=`$COMPILER --version 2>&1` - { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 -$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with -V was: \"$COMPILER_VERSION_OUTPUT\"" >&5 -$as_echo "$as_me: The result from running with -V was: \"$COMPILER_VERSION_OUTPUT\"" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$ALT_VERSION_OUTPUT\"" >&5 -$as_echo "$as_me: The result from running with --version was: \"$ALT_VERSION_OUTPUT\"" >&6;} - as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 - fi - # Remove usage instructions (if present), and - # collapse compiler output into a single line - COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e 's/ *[Uu]sage:.*//'` - COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e "s/^.*[ ,\t]$COMPILER_NAME[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/"` - elif test "x$TOOLCHAIN_TYPE" = xxlc; then - # xlc -qversion output typically looks like - # IBM XL C/C++ for AIX, V11.1 (5724-X13) - # Version: 11.01.0000.0015 - COMPILER_VERSION_OUTPUT=`$COMPILER -qversion 2>&1` - # Check that this is likely to be the IBM XL C compiler. - $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "IBM XL C" > /dev/null - if test $? -ne 0; then - ALT_VERSION_OUTPUT=`$COMPILER --version 2>&1` - { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 -$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with -qversion was: \"$COMPILER_VERSION_OUTPUT\"" >&5 -$as_echo "$as_me: The result from running with -qversion was: \"$COMPILER_VERSION_OUTPUT\"" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$ALT_VERSION_OUTPUT\"" >&5 -$as_echo "$as_me: The result from running with --version was: \"$ALT_VERSION_OUTPUT\"" >&6;} - as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 - fi - # Collapse compiler output into a single line - COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` - COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e 's/^.*, V\([1-9][0-9.]*\).*$/\1/'` - elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - # There is no specific version flag, but all output starts with a version string. - # First line typically looks something like: - # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 - COMPILER_VERSION_OUTPUT=`$COMPILER 2>&1 | $HEAD -n 1 | $TR -d '\r'` - # Check that this is likely to be Microsoft CL.EXE. - $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Microsoft.*Compiler" > /dev/null - if test $? -ne 0; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 -$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running it was: \"$COMPILER_VERSION_OUTPUT\"" >&5 -$as_echo "$as_me: The result from running it was: \"$COMPILER_VERSION_OUTPUT\"" >&6;} - as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 - fi - # Collapse compiler output into a single line - COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` - COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e 's/^.*ersion.\([1-9][0-9.]*\) .*$/\1/'` - elif test "x$TOOLCHAIN_TYPE" = xgcc; then - # gcc --version output typically looks like - # gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1 - # Copyright (C) 2013 Free Software Foundation, Inc. - # This is free software; see the source for copying conditions. There is NO - # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1` - # Check that this is likely to be GCC. - $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Free Software Foundation" > /dev/null - if test $? -ne 0; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 -$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$COMPILER_VERSION\"" >&5 -$as_echo "$as_me: The result from running with --version was: \"$COMPILER_VERSION\"" >&6;} - as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 - fi - # Remove Copyright and legalese from version string, and - # collapse into a single line - COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e 's/ *Copyright .*//'` - COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e 's/^.* \([1-9]\.[0-9.]*\)[^0-9.].*$/\1/'` - elif test "x$TOOLCHAIN_TYPE" = xclang; then - # clang --version output typically looks like - # Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) - # clang version 3.3 (tags/RELEASE_33/final) - # or - # Debian clang version 3.2-7ubuntu1 (tags/RELEASE_32/final) (based on LLVM 3.2) - # Target: x86_64-pc-linux-gnu - # Thread model: posix - COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1` - # Check that this is likely to be clang - $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "clang" > /dev/null - if test $? -ne 0; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 -$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$COMPILER_VERSION_OUTPUT\"" >&5 -$as_echo "$as_me: The result from running with --version was: \"$COMPILER_VERSION_OUTPUT\"" >&6;} - as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 - fi - # Collapse compiler output into a single line - COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` - COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e 's/^.* version \([1-9][0-9.]*\).*$/\1/'` - else - as_fn_error $? "Unknown toolchain type $TOOLCHAIN_TYPE." "$LINENO" 5 - fi - # This sets CC_VERSION_NUMBER or CXX_VERSION_NUMBER. (This comment is a grep marker) - CXX_VERSION_NUMBER="$COMPILER_VERSION_NUMBER" - # This sets CC_VERSION_STRING or CXX_VERSION_STRING. (This comment is a grep marker) - CXX_VERSION_STRING="$COMPILER_VERSION_STRING" - - { $as_echo "$as_me:${as_lineno-$LINENO}: Using $TOOLCHAIN_TYPE $COMPILER_NAME compiler version $COMPILER_VERSION_NUMBER [$COMPILER_VERSION_STRING]" >&5 -$as_echo "$as_me: Using $TOOLCHAIN_TYPE $COMPILER_NAME compiler version $COMPILER_VERSION_NUMBER [$COMPILER_VERSION_STRING]" >&6;} - - - # Now that we have resolved CXX ourself, let autoconf have its go at it - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in $CXX - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CXX" && break - done -fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in $CXX -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CXX" && break -done - - if test "x$ac_ct_CXX" = x; then - CXX="g++" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CXX=$ac_ct_CXX - fi -fi - - fi -fi -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if ${ac_cv_cxx_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GXX=yes -else - GXX= -fi -ac_test_CXXFLAGS=${CXXFLAGS+set} -ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } -if ${ac_cv_prog_cxx_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -else - CXXFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - -else - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi -fi -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - # This is the compiler version number on the form X.Y[.Z] - - - - - if test "x$CC_VERSION_NUMBER" != "x$CXX_VERSION_NUMBER"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C and C++ compiler have different version numbers, $CC_VERSION_NUMBER vs $CXX_VERSION_NUMBER." >&5 -$as_echo "$as_me: WARNING: C and C++ compiler have different version numbers, $CC_VERSION_NUMBER vs $CXX_VERSION_NUMBER." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This typically indicates a broken setup, and is not supported" >&5 -$as_echo "$as_me: WARNING: This typically indicates a broken setup, and is not supported" >&2;} - fi - - # We only check CC_VERSION_NUMBER since we assume CXX_VERSION_NUMBER is equal. - if [[ "[$]CC_VERSION_NUMBER" =~ (.*\.){4} ]] ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C compiler version number has more than four parts (W.X.Y.Z): $CC_VERSION_NUMBER. Comparisons might be wrong." >&5 -$as_echo "$as_me: WARNING: C compiler version number has more than four parts (W.X.Y.Z): $CC_VERSION_NUMBER. Comparisons might be wrong." >&2;} - fi - - if [[ "[$]CC_VERSION_NUMBER" =~ [0-9]{6} ]] ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C compiler version number has a part larger than 99999: $CC_VERSION_NUMBER. Comparisons might be wrong." >&5 -$as_echo "$as_me: WARNING: C compiler version number has a part larger than 99999: $CC_VERSION_NUMBER. Comparisons might be wrong." >&2;} - fi - - COMPARABLE_ACTUAL_VERSION=`$AWK -F. '{ printf("%05d%05d%05d%05d\n", $1, $2, $3, $4) }' <<< "$CC_VERSION_NUMBER"` - - - if test "x$TOOLCHAIN_MINIMUM_VERSION" != x; then - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Execute function body - - # Need to assign to a variable since m4 is blocked from modifying parts in []. - REFERENCE_VERSION=$TOOLCHAIN_MINIMUM_VERSION - - if [[ "$REFERENCE_VERSION" =~ (.*\.){4} ]] ; then - as_fn_error $? "Internal error: Cannot compare to $TOOLCHAIN_MINIMUM_VERSION, only four parts (W.X.Y.Z) is supported" "$LINENO" 5 - fi - - if [[ "$REFERENCE_VERSION" =~ [0-9]{6} ]] ; then - as_fn_error $? "Internal error: Cannot compare to $TOOLCHAIN_MINIMUM_VERSION, only parts < 99999 is supported" "$LINENO" 5 - fi - - # Version comparison method inspired by http://stackoverflow.com/a/24067243 - COMPARABLE_REFERENCE_VERSION=`$AWK -F. '{ printf("%05d%05d%05d%05d\n", $1, $2, $3, $4) }' <<< "$REFERENCE_VERSION"` - - if test $COMPARABLE_ACTUAL_VERSION -ge $COMPARABLE_REFERENCE_VERSION ; then - : - - else - : - - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You are using $TOOLCHAIN_TYPE older than $TOOLCHAIN_MINIMUM_VERSION. This is not a supported configuration." >&5 -$as_echo "$as_me: WARNING: You are using $TOOLCHAIN_TYPE older than $TOOLCHAIN_MINIMUM_VERSION. This is not a supported configuration." >&2;} - - - fi - - - - - - - - - - - - - - - fi - - # - # Setup the preprocessor (CPP and CXXCPP) - # - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - # Only process if variable expands to non-empty - - if test "x$CPP" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$CPP" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CPP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CPP, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of CPP" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CPP, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of CPP, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of CPP" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$CPP" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CPP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CPP, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of CPP" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$CPP" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CPP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CPP, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of CPP" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - CPP="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CPP to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting CPP to \"$new_complete\"" >&6;} - fi - fi - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 -$as_echo_n "checking how to run the C++ preprocessor... " >&6; } -if test -z "$CXXCPP"; then - if ${ac_cv_prog_CXXCPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" - do - ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CXXCPP=$CXXCPP - -fi - CXXCPP=$ac_cv_prog_CXXCPP -else - ac_cv_prog_CXXCPP=$CXXCPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 -$as_echo "$CXXCPP" >&6; } -ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - # Only process if variable expands to non-empty - - if test "x$CXXCPP" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$CXXCPP" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXXCPP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CXXCPP, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of CXXCPP" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXXCPP, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of CXXCPP, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of CXXCPP" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$CXXCPP" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXXCPP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CXXCPP, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of CXXCPP" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$CXXCPP" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXXCPP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CXXCPP, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of CXXCPP" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - CXXCPP="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CXXCPP to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting CXXCPP to \"$new_complete\"" >&6;} - fi - fi - - - # - # Setup the linker (LD) - # - if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - # In the Microsoft toolchain we have a separate LD command "link". - # Make sure we reject /usr/bin/link (as determined in CYGWIN_LINK), which is - # a cygwin program for something completely different. - # Extract the first word of "link", so it can be a program name with args. -set dummy link; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$LD"; then - ac_cv_prog_LD="$LD" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "$CYGWIN_LINK"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_LD="link" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_LD - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set LD to just the basename; use the full file name. - shift - ac_cv_prog_LD="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -LD=$ac_cv_prog_LD -if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - - # Only process if variable expands to non-empty - - if test "x$LD" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$LD" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LD, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of LD, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of LD" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LD, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of LD, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of LD" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$LD" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LD, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of LD, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of LD" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$LD" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LD, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of LD, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of LD" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - LD="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting LD to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting LD to \"$new_complete\"" >&6;} - fi - fi - - # Verify that we indeed succeeded with this trick. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the found link.exe is actually the Visual Studio linker" >&5 -$as_echo_n "checking if the found link.exe is actually the Visual Studio linker... " >&6; } - "$LD" --version > /dev/null - if test $? -eq 0 ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_fn_error $? "This is the Cygwin link tool. Please check your PATH and rerun configure." "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - fi - LDCXX="$LD" - else - # All other toolchains use the compiler to link. - LD="$CC" - LDCXX="$CXX" - fi - - # FIXME: it should be CXXLD, according to standard (cf CXXCPP) - - - # - # Setup the assembler (AS) - # - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - - - # Publish this variable in the help. - - - if [ -z "${AS+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in as -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_AS+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $AS in - [\\/]* | ?:[\\/]*) - ac_cv_path_AS="$AS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_AS="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -AS=$ac_cv_path_AS -if test -n "$AS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 -$as_echo "$AS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AS" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !AS! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!AS!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xAS" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of AS from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of AS from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in as -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_AS+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $AS in - [\\/]* | ?:[\\/]*) - ac_cv_path_AS="$AS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_AS="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -AS=$ac_cv_path_AS -if test -n "$AS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 -$as_echo "$AS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AS" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$AS" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool AS= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool AS= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AS" >&5 -$as_echo_n "checking for AS... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$AS" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool AS=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool AS=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_AS+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $AS in - [\\/]* | ?:[\\/]*) - ac_cv_path_AS="$AS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_AS="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -AS=$ac_cv_path_AS -if test -n "$AS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 -$as_echo "$AS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$AS" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool AS=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool AS=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AS" >&5 -$as_echo_n "checking for AS... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool AS=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - # Only process if variable expands to non-empty - - if test "x$AS" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$AS" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AS, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of AS, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of AS" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AS, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of AS, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of AS" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$AS" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AS, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of AS, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of AS" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$AS" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AS, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of AS, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of AS" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - AS="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting AS to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting AS to \"$new_complete\"" >&6;} - fi - fi - - if test "x$AS" = x; then - as_fn_error $? "Solaris assembler (as) is required. Please install via \"pkg install pkg:/developer/assembler\"." "$LINENO" 5 - fi - else - # FIXME: is this correct for microsoft? - AS="$CC -c" - fi - - - # - # Setup the archiver (AR) - # - if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - # The corresponding ar tool is lib.exe (used to create static libraries) - # Extract the first word of "lib", so it can be a program name with args. -set dummy lib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="lib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - elif test "x$TOOLCHAIN_TYPE" = xgcc; then - - - # Publish this variable in the help. - - - if [ -z "${AR+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - if test -n "$ac_tool_prefix"; then - for ac_prog in ar gcc-ar - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AR" && break - done -fi -if test -z "$AR"; then - ac_ct_AR=$AR - for ac_prog in ar gcc-ar -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_AR" && break -done - - if test "x$ac_ct_AR" = x; then - AR="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -fi - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !AR! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!AR!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xAR" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of AR from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of AR from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - if test -n "$ac_tool_prefix"; then - for ac_prog in ar gcc-ar - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AR" && break - done -fi -if test -z "$AR"; then - ac_ct_AR=$AR - for ac_prog in ar gcc-ar -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_AR" && break -done - - if test "x$ac_ct_AR" = x; then - AR="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -fi - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$AR" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool AR= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool AR= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AR" >&5 -$as_echo_n "checking for AR... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$AR" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool AR=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool AR=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $AR in - [\\/]* | ?:[\\/]*) - ac_cv_path_AR="$AR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -AR=$ac_cv_path_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$AR" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool AR=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool AR=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AR" >&5 -$as_echo_n "checking for AR... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool AR=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - else - - - # Publish this variable in the help. - - - if [ -z "${AR+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - if test -n "$ac_tool_prefix"; then - for ac_prog in ar - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AR" && break - done -fi -if test -z "$AR"; then - ac_ct_AR=$AR - for ac_prog in ar -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_AR" && break -done - - if test "x$ac_ct_AR" = x; then - AR="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -fi - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !AR! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!AR!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xAR" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of AR from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of AR from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - if test -n "$ac_tool_prefix"; then - for ac_prog in ar - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AR" && break - done -fi -if test -z "$AR"; then - ac_ct_AR=$AR - for ac_prog in ar -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_AR" && break -done - - if test "x$ac_ct_AR" = x; then - AR="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -fi - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$AR" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool AR= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool AR= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AR" >&5 -$as_echo_n "checking for AR... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$AR" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool AR=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool AR=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $AR in - [\\/]* | ?:[\\/]*) - ac_cv_path_AR="$AR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -AR=$ac_cv_path_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$AR" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool AR=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool AR=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AR" >&5 -$as_echo_n "checking for AR... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool AR=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - fi - - # Only process if variable expands to non-empty - - if test "x$AR" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$AR" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AR, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of AR, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of AR" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AR, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of AR, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of AR" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$AR" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AR, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of AR, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of AR" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$AR" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AR, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of AR, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of AR" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - AR="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting AR to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting AR to \"$new_complete\"" >&6;} - fi - fi - - - - if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then - - - # Publish this variable in the help. - - - if [ -z "${LIPO+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in lipo -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $LIPO in - [\\/]* | ?:[\\/]*) - ac_cv_path_LIPO="$LIPO" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_LIPO="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -LIPO=$ac_cv_path_LIPO -if test -n "$LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -$as_echo "$LIPO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$LIPO" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !LIPO! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!LIPO!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xLIPO" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of LIPO from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of LIPO from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in lipo -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $LIPO in - [\\/]* | ?:[\\/]*) - ac_cv_path_LIPO="$LIPO" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_LIPO="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -LIPO=$ac_cv_path_LIPO -if test -n "$LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -$as_echo "$LIPO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$LIPO" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$LIPO" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool LIPO= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool LIPO= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIPO" >&5 -$as_echo_n "checking for LIPO... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$LIPO" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool LIPO=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool LIPO=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $LIPO in - [\\/]* | ?:[\\/]*) - ac_cv_path_LIPO="$LIPO" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_LIPO="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -LIPO=$ac_cv_path_LIPO -if test -n "$LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -$as_echo "$LIPO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$LIPO" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool LIPO=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool LIPO=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIPO" >&5 -$as_echo_n "checking for LIPO... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool LIPO=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - # Only process if variable expands to non-empty - - if test "x$LIPO" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$LIPO" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LIPO, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of LIPO, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of LIPO" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LIPO, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of LIPO, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of LIPO" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$LIPO" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LIPO, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of LIPO, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of LIPO" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$LIPO" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LIPO, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of LIPO, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of LIPO" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - LIPO="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting LIPO to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting LIPO to \"$new_complete\"" >&6;} - fi - fi - - - - - # Publish this variable in the help. - - - if [ -z "${OTOOL+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in otool -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $OTOOL in - [\\/]* | ?:[\\/]*) - ac_cv_path_OTOOL="$OTOOL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_OTOOL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -OTOOL=$ac_cv_path_OTOOL -if test -n "$OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$OTOOL" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !OTOOL! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!OTOOL!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xOTOOL" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of OTOOL from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of OTOOL from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in otool -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $OTOOL in - [\\/]* | ?:[\\/]*) - ac_cv_path_OTOOL="$OTOOL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_OTOOL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -OTOOL=$ac_cv_path_OTOOL -if test -n "$OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$OTOOL" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$OTOOL" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool OTOOL= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool OTOOL= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OTOOL" >&5 -$as_echo_n "checking for OTOOL... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$OTOOL" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool OTOOL=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool OTOOL=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $OTOOL in - [\\/]* | ?:[\\/]*) - ac_cv_path_OTOOL="$OTOOL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_OTOOL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -OTOOL=$ac_cv_path_OTOOL -if test -n "$OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$OTOOL" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool OTOOL=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool OTOOL=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OTOOL" >&5 -$as_echo_n "checking for OTOOL... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool OTOOL=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$OTOOL" = x; then - as_fn_error $? "Could not find required tool for OTOOL" "$LINENO" 5 - fi - - - - # Only process if variable expands to non-empty - - if test "x$OTOOL" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$OTOOL" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OTOOL, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of OTOOL, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of OTOOL" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OTOOL, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of OTOOL, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of OTOOL" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$OTOOL" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OTOOL, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of OTOOL, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of OTOOL" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$OTOOL" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OTOOL, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of OTOOL, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of OTOOL" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - OTOOL="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OTOOL to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting OTOOL to \"$new_complete\"" >&6;} - fi - fi - - - - - # Publish this variable in the help. - - - if [ -z "${INSTALL_NAME_TOOL+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in install_name_tool -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_INSTALL_NAME_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $INSTALL_NAME_TOOL in - [\\/]* | ?:[\\/]*) - ac_cv_path_INSTALL_NAME_TOOL="$INSTALL_NAME_TOOL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_INSTALL_NAME_TOOL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -INSTALL_NAME_TOOL=$ac_cv_path_INSTALL_NAME_TOOL -if test -n "$INSTALL_NAME_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL_NAME_TOOL" >&5 -$as_echo "$INSTALL_NAME_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$INSTALL_NAME_TOOL" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !INSTALL_NAME_TOOL! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!INSTALL_NAME_TOOL!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xINSTALL_NAME_TOOL" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of INSTALL_NAME_TOOL from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of INSTALL_NAME_TOOL from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in install_name_tool -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_INSTALL_NAME_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $INSTALL_NAME_TOOL in - [\\/]* | ?:[\\/]*) - ac_cv_path_INSTALL_NAME_TOOL="$INSTALL_NAME_TOOL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_INSTALL_NAME_TOOL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -INSTALL_NAME_TOOL=$ac_cv_path_INSTALL_NAME_TOOL -if test -n "$INSTALL_NAME_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL_NAME_TOOL" >&5 -$as_echo "$INSTALL_NAME_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$INSTALL_NAME_TOOL" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$INSTALL_NAME_TOOL" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool INSTALL_NAME_TOOL= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool INSTALL_NAME_TOOL= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for INSTALL_NAME_TOOL" >&5 -$as_echo_n "checking for INSTALL_NAME_TOOL... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$INSTALL_NAME_TOOL" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool INSTALL_NAME_TOOL=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool INSTALL_NAME_TOOL=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_INSTALL_NAME_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $INSTALL_NAME_TOOL in - [\\/]* | ?:[\\/]*) - ac_cv_path_INSTALL_NAME_TOOL="$INSTALL_NAME_TOOL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_INSTALL_NAME_TOOL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -INSTALL_NAME_TOOL=$ac_cv_path_INSTALL_NAME_TOOL -if test -n "$INSTALL_NAME_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL_NAME_TOOL" >&5 -$as_echo "$INSTALL_NAME_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$INSTALL_NAME_TOOL" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool INSTALL_NAME_TOOL=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool INSTALL_NAME_TOOL=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for INSTALL_NAME_TOOL" >&5 -$as_echo_n "checking for INSTALL_NAME_TOOL... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool INSTALL_NAME_TOOL=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$INSTALL_NAME_TOOL" = x; then - as_fn_error $? "Could not find required tool for INSTALL_NAME_TOOL" "$LINENO" 5 - fi - - - - # Only process if variable expands to non-empty - - if test "x$INSTALL_NAME_TOOL" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$INSTALL_NAME_TOOL" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of INSTALL_NAME_TOOL, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of INSTALL_NAME_TOOL, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of INSTALL_NAME_TOOL" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of INSTALL_NAME_TOOL, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of INSTALL_NAME_TOOL, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of INSTALL_NAME_TOOL" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$INSTALL_NAME_TOOL" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of INSTALL_NAME_TOOL, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of INSTALL_NAME_TOOL, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of INSTALL_NAME_TOOL" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$INSTALL_NAME_TOOL" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of INSTALL_NAME_TOOL, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of INSTALL_NAME_TOOL, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of INSTALL_NAME_TOOL" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - INSTALL_NAME_TOOL="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting INSTALL_NAME_TOOL to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting INSTALL_NAME_TOOL to \"$new_complete\"" >&6;} - fi - fi - - fi - - if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - # Extract the first word of "mt", so it can be a program name with args. -set dummy mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MT"; then - ac_cv_prog_MT="$MT" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/bin/mt"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_MT="mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_MT - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set MT to just the basename; use the full file name. - shift - ac_cv_prog_MT="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -MT=$ac_cv_prog_MT -if test -n "$MT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MT" >&5 -$as_echo "$MT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - - # Only process if variable expands to non-empty - - if test "x$MT" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$MT" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MT, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of MT, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of MT" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MT, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of MT, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of MT" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$MT" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MT, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of MT, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of MT" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$MT" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MT, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of MT, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of MT" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - MT="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MT to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting MT to \"$new_complete\"" >&6;} - fi - fi - - # Setup the resource compiler (RC) - # Extract the first word of "rc", so it can be a program name with args. -set dummy rc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$RC"; then - ac_cv_prog_RC="$RC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/bin/rc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_RC="rc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_RC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set RC to just the basename; use the full file name. - shift - ac_cv_prog_RC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -RC=$ac_cv_prog_RC -if test -n "$RC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RC" >&5 -$as_echo "$RC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - - # Only process if variable expands to non-empty - - if test "x$RC" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$RC" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of RC, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of RC, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of RC" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of RC, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of RC, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of RC" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$RC" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of RC, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of RC, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of RC" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$RC" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of RC, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of RC, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of RC" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - RC="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting RC to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting RC to \"$new_complete\"" >&6;} - fi - fi - - # Extract the first word of "dumpbin", so it can be a program name with args. -set dummy dumpbin; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DUMPBIN"; then - ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_DUMPBIN="dumpbin" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DUMPBIN=$ac_cv_prog_DUMPBIN -if test -n "$DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 -$as_echo "$DUMPBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - - # Only process if variable expands to non-empty - - if test "x$DUMPBIN" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$DUMPBIN" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of DUMPBIN" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DUMPBIN, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of DUMPBIN, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of DUMPBIN" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$DUMPBIN" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of DUMPBIN" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$DUMPBIN" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of DUMPBIN" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - DUMPBIN="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting DUMPBIN to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting DUMPBIN to \"$new_complete\"" >&6;} - fi - fi - - # We need to check for 'msbuild.exe' because at the place where we expect to - # find 'msbuild.exe' there's also a directory called 'msbuild' and configure - # won't find the 'msbuild.exe' executable in that case (and the - # 'ac_executable_extensions' is unusable due to performance reasons). - # Notice that we intentionally don't fix up the path to MSBUILD because we - # will call it in a DOS shell during freetype detection on Windows (see - # 'LIB_SETUP_FREETYPE' in "libraries.m4" - # Extract the first word of "msbuild.exe", so it can be a program name with args. -set dummy msbuild.exe; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MSBUILD+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MSBUILD"; then - ac_cv_prog_MSBUILD="$MSBUILD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_MSBUILD="msbuild.exe" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -MSBUILD=$ac_cv_prog_MSBUILD -if test -n "$MSBUILD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSBUILD" >&5 -$as_echo "$MSBUILD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi - - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - - - # Publish this variable in the help. - - - if [ -z "${STRIP+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in strip -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $STRIP in - [\\/]* | ?:[\\/]*) - ac_cv_path_STRIP="$STRIP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_STRIP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -STRIP=$ac_cv_path_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$STRIP" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !STRIP! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!STRIP!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xSTRIP" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of STRIP from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of STRIP from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in strip -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $STRIP in - [\\/]* | ?:[\\/]*) - ac_cv_path_STRIP="$STRIP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_STRIP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -STRIP=$ac_cv_path_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$STRIP" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$STRIP" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool STRIP= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool STRIP= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for STRIP" >&5 -$as_echo_n "checking for STRIP... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$STRIP" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool STRIP=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool STRIP=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $STRIP in - [\\/]* | ?:[\\/]*) - ac_cv_path_STRIP="$STRIP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_STRIP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -STRIP=$ac_cv_path_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$STRIP" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool STRIP=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool STRIP=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for STRIP" >&5 -$as_echo_n "checking for STRIP... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool STRIP=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - # Only process if variable expands to non-empty - - if test "x$STRIP" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$STRIP" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of STRIP, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$STRIP" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$STRIP" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - STRIP="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STRIP to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting STRIP to \"$new_complete\"" >&6;} - fi - fi - - - - # Publish this variable in the help. - - - if [ -z "${NM+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in nm -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $NM in - [\\/]* | ?:[\\/]*) - ac_cv_path_NM="$NM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_NM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -NM=$ac_cv_path_NM -if test -n "$NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 -$as_echo "$NM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$NM" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !NM! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!NM!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xNM" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of NM from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of NM from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in nm -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $NM in - [\\/]* | ?:[\\/]*) - ac_cv_path_NM="$NM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_NM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -NM=$ac_cv_path_NM -if test -n "$NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 -$as_echo "$NM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$NM" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$NM" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool NM= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool NM= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NM" >&5 -$as_echo_n "checking for NM... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$NM" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool NM=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool NM=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $NM in - [\\/]* | ?:[\\/]*) - ac_cv_path_NM="$NM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_NM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -NM=$ac_cv_path_NM -if test -n "$NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 -$as_echo "$NM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$NM" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool NM=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool NM=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NM" >&5 -$as_echo_n "checking for NM... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool NM=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - # Only process if variable expands to non-empty - - if test "x$NM" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$NM" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of NM, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$NM" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$NM" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - NM="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting NM to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting NM to \"$new_complete\"" >&6;} - fi - fi - - - - # Publish this variable in the help. - - - if [ -z "${GNM+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in gnm -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GNM+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $GNM in - [\\/]* | ?:[\\/]*) - ac_cv_path_GNM="$GNM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GNM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -GNM=$ac_cv_path_GNM -if test -n "$GNM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNM" >&5 -$as_echo "$GNM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$GNM" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !GNM! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!GNM!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xGNM" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of GNM from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of GNM from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in gnm -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GNM+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $GNM in - [\\/]* | ?:[\\/]*) - ac_cv_path_GNM="$GNM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GNM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -GNM=$ac_cv_path_GNM -if test -n "$GNM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNM" >&5 -$as_echo "$GNM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$GNM" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$GNM" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool GNM= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool GNM= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNM" >&5 -$as_echo_n "checking for GNM... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$GNM" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool GNM=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool GNM=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GNM+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $GNM in - [\\/]* | ?:[\\/]*) - ac_cv_path_GNM="$GNM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GNM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -GNM=$ac_cv_path_GNM -if test -n "$GNM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNM" >&5 -$as_echo "$GNM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$GNM" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool GNM=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool GNM=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNM" >&5 -$as_echo_n "checking for GNM... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool GNM=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - # Only process if variable expands to non-empty - - if test "x$GNM" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$GNM" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of GNM, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of GNM, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of GNM" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of GNM, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of GNM, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of GNM" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$GNM" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of GNM, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of GNM, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of GNM" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$GNM" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of GNM, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of GNM, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of GNM" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - GNM="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting GNM to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting GNM to \"$new_complete\"" >&6;} - fi - fi - - elif test "x$OPENJDK_TARGET_OS" != xwindows; then - # FIXME: we should unify this with the solaris case above. - - - # Publish this variable in the help. - - - if [ -z "${STRIP+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - if test -n "$ac_tool_prefix"; then - for ac_prog in strip - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$STRIP" && break - done -fi -if test -z "$STRIP"; then - ac_ct_STRIP=$STRIP - for ac_prog in strip -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_STRIP" && break -done - - if test "x$ac_ct_STRIP" = x; then - STRIP="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -fi - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !STRIP! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!STRIP!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xSTRIP" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of STRIP from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of STRIP from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - if test -n "$ac_tool_prefix"; then - for ac_prog in strip - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$STRIP" && break - done -fi -if test -z "$STRIP"; then - ac_ct_STRIP=$STRIP - for ac_prog in strip -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_STRIP" && break -done - - if test "x$ac_ct_STRIP" = x; then - STRIP="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -fi - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$STRIP" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool STRIP= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool STRIP= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for STRIP" >&5 -$as_echo_n "checking for STRIP... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$STRIP" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool STRIP=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool STRIP=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $STRIP in - [\\/]* | ?:[\\/]*) - ac_cv_path_STRIP="$STRIP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_STRIP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -STRIP=$ac_cv_path_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$STRIP" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool STRIP=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool STRIP=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for STRIP" >&5 -$as_echo_n "checking for STRIP... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool STRIP=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - # Only process if variable expands to non-empty - - if test "x$STRIP" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$STRIP" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of STRIP, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$STRIP" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$STRIP" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - STRIP="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STRIP to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting STRIP to \"$new_complete\"" >&6;} - fi - fi - - if test "x$TOOLCHAIN_TYPE" = xgcc; then - - - # Publish this variable in the help. - - - if [ -z "${NM+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - if test -n "$ac_tool_prefix"; then - for ac_prog in nm gcc-nm - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NM"; then - ac_cv_prog_NM="$NM" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_NM="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -NM=$ac_cv_prog_NM -if test -n "$NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 -$as_echo "$NM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$NM" && break - done -fi -if test -z "$NM"; then - ac_ct_NM=$NM - for ac_prog in nm gcc-nm -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_NM"; then - ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_NM="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_NM=$ac_cv_prog_ac_ct_NM -if test -n "$ac_ct_NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NM" >&5 -$as_echo "$ac_ct_NM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_NM" && break -done - - if test "x$ac_ct_NM" = x; then - NM="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - NM=$ac_ct_NM - fi -fi - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !NM! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!NM!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xNM" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of NM from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of NM from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - if test -n "$ac_tool_prefix"; then - for ac_prog in nm gcc-nm - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NM"; then - ac_cv_prog_NM="$NM" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_NM="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -NM=$ac_cv_prog_NM -if test -n "$NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 -$as_echo "$NM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$NM" && break - done -fi -if test -z "$NM"; then - ac_ct_NM=$NM - for ac_prog in nm gcc-nm -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_NM"; then - ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_NM="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_NM=$ac_cv_prog_ac_ct_NM -if test -n "$ac_ct_NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NM" >&5 -$as_echo "$ac_ct_NM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_NM" && break -done - - if test "x$ac_ct_NM" = x; then - NM="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - NM=$ac_ct_NM - fi -fi - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$NM" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool NM= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool NM= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NM" >&5 -$as_echo_n "checking for NM... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$NM" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool NM=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool NM=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $NM in - [\\/]* | ?:[\\/]*) - ac_cv_path_NM="$NM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_NM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -NM=$ac_cv_path_NM -if test -n "$NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 -$as_echo "$NM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$NM" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool NM=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool NM=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NM" >&5 -$as_echo_n "checking for NM... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool NM=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - else - - - # Publish this variable in the help. - - - if [ -z "${NM+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - if test -n "$ac_tool_prefix"; then - for ac_prog in nm - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NM"; then - ac_cv_prog_NM="$NM" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_NM="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -NM=$ac_cv_prog_NM -if test -n "$NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 -$as_echo "$NM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$NM" && break - done -fi -if test -z "$NM"; then - ac_ct_NM=$NM - for ac_prog in nm -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_NM"; then - ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_NM="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_NM=$ac_cv_prog_ac_ct_NM -if test -n "$ac_ct_NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NM" >&5 -$as_echo "$ac_ct_NM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_NM" && break -done - - if test "x$ac_ct_NM" = x; then - NM="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - NM=$ac_ct_NM - fi -fi - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !NM! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!NM!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xNM" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of NM from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of NM from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - if test -n "$ac_tool_prefix"; then - for ac_prog in nm - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NM"; then - ac_cv_prog_NM="$NM" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_NM="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -NM=$ac_cv_prog_NM -if test -n "$NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 -$as_echo "$NM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$NM" && break - done -fi -if test -z "$NM"; then - ac_ct_NM=$NM - for ac_prog in nm -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_NM"; then - ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_NM="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_NM=$ac_cv_prog_ac_ct_NM -if test -n "$ac_ct_NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NM" >&5 -$as_echo "$ac_ct_NM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_NM" && break -done - - if test "x$ac_ct_NM" = x; then - NM="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - NM=$ac_ct_NM - fi -fi - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$NM" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool NM= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool NM= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NM" >&5 -$as_echo_n "checking for NM... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$NM" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool NM=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool NM=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $NM in - [\\/]* | ?:[\\/]*) - ac_cv_path_NM="$NM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_NM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -NM=$ac_cv_path_NM -if test -n "$NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 -$as_echo "$NM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$NM" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool NM=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool NM=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NM" >&5 -$as_echo_n "checking for NM... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool NM=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - fi - - # Only process if variable expands to non-empty - - if test "x$NM" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$NM" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of NM, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$NM" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$NM" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - NM="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting NM to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting NM to \"$new_complete\"" >&6;} - fi - fi - - GNM="$NM" - - fi - - # objcopy is used for moving debug symbols to separate files when - # full debug symbols are enabled. - if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then - - - # Publish this variable in the help. - - - if [ -z "${OBJCOPY+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - if test -n "$ac_tool_prefix"; then - for ac_prog in gobjcopy objcopy - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJCOPY+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJCOPY"; then - ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OBJCOPY="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OBJCOPY=$ac_cv_prog_OBJCOPY -if test -n "$OBJCOPY"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY" >&5 -$as_echo "$OBJCOPY" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$OBJCOPY" && break - done -fi -if test -z "$OBJCOPY"; then - ac_ct_OBJCOPY=$OBJCOPY - for ac_prog in gobjcopy objcopy -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJCOPY+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OBJCOPY"; then - ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OBJCOPY="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY -if test -n "$ac_ct_OBJCOPY"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJCOPY" >&5 -$as_echo "$ac_ct_OBJCOPY" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_OBJCOPY" && break -done - - if test "x$ac_ct_OBJCOPY" = x; then - OBJCOPY="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJCOPY=$ac_ct_OBJCOPY - fi -fi - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !OBJCOPY! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!OBJCOPY!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xOBJCOPY" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of OBJCOPY from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of OBJCOPY from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - if test -n "$ac_tool_prefix"; then - for ac_prog in gobjcopy objcopy - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJCOPY+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJCOPY"; then - ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OBJCOPY="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OBJCOPY=$ac_cv_prog_OBJCOPY -if test -n "$OBJCOPY"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY" >&5 -$as_echo "$OBJCOPY" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$OBJCOPY" && break - done -fi -if test -z "$OBJCOPY"; then - ac_ct_OBJCOPY=$OBJCOPY - for ac_prog in gobjcopy objcopy -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJCOPY+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OBJCOPY"; then - ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OBJCOPY="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY -if test -n "$ac_ct_OBJCOPY"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJCOPY" >&5 -$as_echo "$ac_ct_OBJCOPY" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_OBJCOPY" && break -done - - if test "x$ac_ct_OBJCOPY" = x; then - OBJCOPY="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJCOPY=$ac_ct_OBJCOPY - fi -fi - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$OBJCOPY" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool OBJCOPY= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool OBJCOPY= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OBJCOPY" >&5 -$as_echo_n "checking for OBJCOPY... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$OBJCOPY" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool OBJCOPY=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool OBJCOPY=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_OBJCOPY+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $OBJCOPY in - [\\/]* | ?:[\\/]*) - ac_cv_path_OBJCOPY="$OBJCOPY" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_OBJCOPY="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -OBJCOPY=$ac_cv_path_OBJCOPY -if test -n "$OBJCOPY"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY" >&5 -$as_echo "$OBJCOPY" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$OBJCOPY" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool OBJCOPY=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool OBJCOPY=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OBJCOPY" >&5 -$as_echo_n "checking for OBJCOPY... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool OBJCOPY=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - # Only call fixup if objcopy was found. - if test -n "$OBJCOPY"; then - - # Only process if variable expands to non-empty - - if test "x$OBJCOPY" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$OBJCOPY" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of OBJCOPY" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJCOPY, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of OBJCOPY, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of OBJCOPY" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$OBJCOPY" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of OBJCOPY" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$OBJCOPY" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of OBJCOPY" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - OBJCOPY="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJCOPY to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting OBJCOPY to \"$new_complete\"" >&6;} - fi - fi - - if test "x$OPENJDK_BUILD_OS" = xsolaris; then - # objcopy prior to 2.21.1 on solaris is broken and is not usable. - # Rewrite objcopy version output to VALID_VERSION or BAD_VERSION. - # - version number is last blank separate word on first line - # - version number formats that have been seen: - # - . - # - .. - OBJCOPY_VERSION=`$OBJCOPY --version | $HEAD -n 1` - # The outer [ ] is to prevent m4 from eating the [] in the sed expression. - OBJCOPY_VERSION_CHECK=`$ECHO $OBJCOPY_VERSION | $SED -n \ - -e 's/.* //' \ - -e '/^[01]\./b bad' \ - -e '/^2\./{' \ - -e ' s/^2\.//' \ - -e ' /^[0-9]$/b bad' \ - -e ' /^[0-9]\./b bad' \ - -e ' /^1[0-9]$/b bad' \ - -e ' /^1[0-9]\./b bad' \ - -e ' /^20\./b bad' \ - -e ' /^21\.0$/b bad' \ - -e ' /^21\.0\./b bad' \ - -e '}' \ - -e ':good' \ - -e 's/.*/VALID_VERSION/p' \ - -e 'q' \ - -e ':bad' \ - -e 's/.*/BAD_VERSION/p' \ - -e 'q'` - if test "x$OBJCOPY_VERSION_CHECK" = xBAD_VERSION; then - OBJCOPY= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring found objcopy since it is broken (prior to 2.21.1). No debug symbols will be generated." >&5 -$as_echo "$as_me: WARNING: Ignoring found objcopy since it is broken (prior to 2.21.1). No debug symbols will be generated." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: objcopy reports version $OBJCOPY_VERSION" >&5 -$as_echo "$as_me: objcopy reports version $OBJCOPY_VERSION" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Note: patch 149063-01 or newer contains the correct Solaris 10 SPARC version" >&5 -$as_echo "$as_me: Note: patch 149063-01 or newer contains the correct Solaris 10 SPARC version" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Note: patch 149064-01 or newer contains the correct Solaris 10 X86 version" >&5 -$as_echo "$as_me: Note: patch 149064-01 or newer contains the correct Solaris 10 X86 version" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Note: Solaris 11 Update 1 contains the correct version" >&5 -$as_echo "$as_me: Note: Solaris 11 Update 1 contains the correct version" >&6;} - fi - fi - fi - fi - - - - # Publish this variable in the help. - - - if [ -z "${OBJDUMP+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - if test -n "$ac_tool_prefix"; then - for ac_prog in gobjdump objdump - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OBJDUMP="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$OBJDUMP" && break - done -fi -if test -z "$OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - for ac_prog in gobjdump objdump -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_OBJDUMP" && break -done - - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJDUMP=$ac_ct_OBJDUMP - fi -fi - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !OBJDUMP! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!OBJDUMP!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xOBJDUMP" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of OBJDUMP from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of OBJDUMP from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - if test -n "$ac_tool_prefix"; then - for ac_prog in gobjdump objdump - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OBJDUMP="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$OBJDUMP" && break - done -fi -if test -z "$OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - for ac_prog in gobjdump objdump -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_OBJDUMP" && break -done - - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJDUMP=$ac_ct_OBJDUMP - fi -fi - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$OBJDUMP" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool OBJDUMP= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool OBJDUMP= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OBJDUMP" >&5 -$as_echo_n "checking for OBJDUMP... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$OBJDUMP" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool OBJDUMP=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool OBJDUMP=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $OBJDUMP in - [\\/]* | ?:[\\/]*) - ac_cv_path_OBJDUMP="$OBJDUMP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_OBJDUMP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -OBJDUMP=$ac_cv_path_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$OBJDUMP" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool OBJDUMP=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool OBJDUMP=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OBJDUMP" >&5 -$as_echo_n "checking for OBJDUMP... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool OBJDUMP=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - if test "x$OBJDUMP" != x; then - # Only used for compare.sh; we can live without it. BASIC_FIXUP_EXECUTABLE - # bails if argument is missing. - - # Only process if variable expands to non-empty - - if test "x$OBJDUMP" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$OBJDUMP" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of OBJDUMP" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJDUMP, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of OBJDUMP, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of OBJDUMP" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$OBJDUMP" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of OBJDUMP" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$OBJDUMP" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of OBJDUMP" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - OBJDUMP="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJDUMP to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting OBJDUMP to \"$new_complete\"" >&6;} - fi - fi - - fi - - - # Restore old path, except for the microsoft toolchain, which requires VS_PATH - # to remain in place. Otherwise the compiler will not work in some siutations - # in later configure checks. - if test "x$TOOLCHAIN_TYPE" != "xmicrosoft"; then - PATH="$OLD_PATH" - fi - - # Restore the flags to the user specified values. - # This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2" - CFLAGS="$ORG_CFLAGS" - CXXFLAGS="$ORG_CXXFLAGS" - - -# Finally do some processing after the detection phase - - if test "x$COMPILE_TYPE" = "xcross"; then - # Now we need to find a C/C++ compiler that can build executables for the - # build platform. We can't use the AC_PROG_CC macro, since it can only be - # used once. Also, we need to do this without adding a tools dir to the - # path, otherwise we might pick up cross-compilers which don't use standard - # naming. - - OLDPATH="$PATH" - - -# Check whether --with-build-devkit was given. -if test "${with_build_devkit+set}" = set; then : - withval=$with_build_devkit; -fi - - if test "x$with_build_devkit" = "xyes"; then - as_fn_error $? "--with-build-devkit must have a value" "$LINENO" 5 - elif test -n "$with_build_devkit"; then - if test ! -d "$with_build_devkit"; then - as_fn_error $? "--with-build-devkit points to non existing dir: $with_build_devkit" "$LINENO" 5 - else - - # Only process if variable expands to non-empty - - if test "x$with_build_devkit" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$with_build_devkit" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_build_devkit, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of with_build_devkit, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of with_build_devkit" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - with_build_devkit="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting with_build_devkit to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting with_build_devkit to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$with_build_devkit" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - with_build_devkit="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting with_build_devkit to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting with_build_devkit to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$with_build_devkit" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_build_devkit, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of with_build_devkit, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of with_build_devkit, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - with_build_devkit="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - with_build_devkit="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - BUILD_DEVKIT_ROOT="$with_build_devkit" - # Check for a meta data info file in the root of the devkit - if test -f "$BUILD_DEVKIT_ROOT/devkit.info"; then - # Process devkit.info so that existing devkit variables are not - # modified by this - $SED -e "s/^DEVKIT_/BUILD_DEVKIT_/g" \ - -e "s/\$DEVKIT_ROOT/\$BUILD_DEVKIT_ROOT/g" \ - -e "s/\$host/\$build/g" \ - $BUILD_DEVKIT_ROOT/devkit.info \ - > $CONFIGURESUPPORT_OUTPUTDIR/build-devkit.info - . $CONFIGURESUPPORT_OUTPUTDIR/build-devkit.info - # This potentially sets the following: - # A descriptive name of the devkit - - if test "x$BUILD_DEVKIT_NAME" = x; then - eval BUILD_DEVKIT_NAME="\${BUILD_DEVKIT_NAME_${OPENJDK_TARGET_CPU}}" - fi - - # Corresponds to --with-extra-path - - if test "x$BUILD_DEVKIT_EXTRA_PATH" = x; then - eval BUILD_DEVKIT_EXTRA_PATH="\${BUILD_DEVKIT_EXTRA_PATH_${OPENJDK_TARGET_CPU}}" - fi - - # Corresponds to --with-toolchain-path - - if test "x$BUILD_DEVKIT_TOOLCHAIN_PATH" = x; then - eval BUILD_DEVKIT_TOOLCHAIN_PATH="\${BUILD_DEVKIT_TOOLCHAIN_PATH_${OPENJDK_TARGET_CPU}}" - fi - - # Corresponds to --with-sysroot - - if test "x$BUILD_DEVKIT_SYSROOT" = x; then - eval BUILD_DEVKIT_SYSROOT="\${BUILD_DEVKIT_SYSROOT_${OPENJDK_TARGET_CPU}}" - fi - - # Skip the Window specific parts - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for build platform devkit" >&5 -$as_echo_n "checking for build platform devkit... " >&6; } - if test "x$BUILD_DEVKIT_NAME" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_DEVKIT_NAME in $BUILD_DEVKIT_ROOT" >&5 -$as_echo "$BUILD_DEVKIT_NAME in $BUILD_DEVKIT_ROOT" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_DEVKIT_ROOT" >&5 -$as_echo "$BUILD_DEVKIT_ROOT" >&6; } - fi - - BUILD_SYSROOT="$BUILD_DEVKIT_SYSROOT" - - if test "x$BUILD_SYSROOT" != "x"; then - if test "x$TOOLCHAIN_TYPE" = xsolstudio; then - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - # Solaris Studio does not have a concept of sysroot. Instead we must - # make sure the default include and lib dirs are appended to each - # compile and link command line. Must also add -I-xbuiltin to enable - # inlining of system functions and intrinsics. - BUILD_SYSROOT_CFLAGS="-I-xbuiltin -I$BUILD_SYSROOT/usr/include" - BUILD_SYSROOT_LDFLAGS="-L$BUILD_SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \ - -L$BUILD_SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR" - fi - elif test "x$TOOLCHAIN_TYPE" = xgcc; then - BUILD_SYSROOT_CFLAGS="--sysroot=$BUILD_SYSROOT" - BUILD_SYSROOT_LDFLAGS="--sysroot=$BUILD_SYSROOT" - elif test "x$TOOLCHAIN_TYPE" = xclang; then - BUILD_SYSROOT_CFLAGS="-isysroot $BUILD_SYSROOT" - BUILD_SYSROOT_LDFLAGS="-isysroot $BUILD_SYSROOT" - fi - # The global CFLAGS and LDFLAGS variables need these for configure to function - BUILD_CFLAGS="$BUILD_CFLAGS $BUILD_SYSROOT_CFLAGS" - BUILD_CPPFLAGS="$BUILD_CPPFLAGS $BUILD_SYSROOT_CFLAGS" - BUILD_CXXFLAGS="$BUILD_CXXFLAGS $BUILD_SYSROOT_CFLAGS" - BUILD_LDFLAGS="$BUILD_LDFLAGS $BUILD_SYSROOT_LDFLAGS" - fi - - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - # We also need -iframework/System/Library/Frameworks - BUILD_SYSROOT_CFLAGS="$BUILD_SYSROOT_CFLAGS -iframework $BUILD_SYSROOT/System/Library/Frameworks" - BUILD_SYSROOT_LDFLAGS="$BUILD_SYSROOT_LDFLAGS -iframework $BUILD_SYSROOT/System/Library/Frameworks" - # These always need to be set, or we can't find the frameworks embedded in JavaVM.framework - # set this here so it doesn't have to be peppered throughout the forest - BUILD_SYSROOT_CFLAGS="$BUILD_SYSROOT_CFLAGS -F $BUILD_SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks" - BUILD_SYSROOT_LDFLAGS="$BUILD_SYSROOT_LDFLAGS -F $BUILD_SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks" - fi - - - - - - # Fallback default of just /bin if DEVKIT_PATH is not defined - if test "x$BUILD_DEVKIT_TOOLCHAIN_PATH" = x; then - BUILD_DEVKIT_TOOLCHAIN_PATH="$BUILD_DEVKIT_ROOT/bin" - fi - PATH="$BUILD_DEVKIT_TOOLCHAIN_PATH:$BUILD_DEVKIT_EXTRA_PATH" - fi - fi - - # FIXME: we should list the discovered compilers as an exclude pattern! - # If we do that, we can do this detection before POST_DETECTION, and still - # find the build compilers in the tools dir, if needed. - - - - # Publish this variable in the help. - - - if [ -z "${BUILD_CC+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in cl cc gcc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BUILD_CC in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_CC="$BUILD_CC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_CC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BUILD_CC=$ac_cv_path_BUILD_CC -if test -n "$BUILD_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CC" >&5 -$as_echo "$BUILD_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$BUILD_CC" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !BUILD_CC! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!BUILD_CC!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xBUILD_CC" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of BUILD_CC from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of BUILD_CC from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in cl cc gcc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BUILD_CC in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_CC="$BUILD_CC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_CC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BUILD_CC=$ac_cv_path_BUILD_CC -if test -n "$BUILD_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CC" >&5 -$as_echo "$BUILD_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$BUILD_CC" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$BUILD_CC" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool BUILD_CC= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool BUILD_CC= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BUILD_CC" >&5 -$as_echo_n "checking for BUILD_CC... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$BUILD_CC" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool BUILD_CC=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool BUILD_CC=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BUILD_CC in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_CC="$BUILD_CC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_CC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BUILD_CC=$ac_cv_path_BUILD_CC -if test -n "$BUILD_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CC" >&5 -$as_echo "$BUILD_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$BUILD_CC" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool BUILD_CC=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool BUILD_CC=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BUILD_CC" >&5 -$as_echo_n "checking for BUILD_CC... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool BUILD_CC=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$BUILD_CC" = x; then - as_fn_error $? "Could not find required tool for BUILD_CC" "$LINENO" 5 - fi - - - - # Only process if variable expands to non-empty - - if test "x$BUILD_CC" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$BUILD_CC" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of BUILD_CC" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CC, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of BUILD_CC, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of BUILD_CC" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$BUILD_CC" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of BUILD_CC" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$BUILD_CC" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of BUILD_CC" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - BUILD_CC="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_CC to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting BUILD_CC to \"$new_complete\"" >&6;} - fi - fi - - - - - # Publish this variable in the help. - - - if [ -z "${BUILD_CXX+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in cl CC g++ -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BUILD_CXX in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_CXX="$BUILD_CXX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_CXX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BUILD_CXX=$ac_cv_path_BUILD_CXX -if test -n "$BUILD_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CXX" >&5 -$as_echo "$BUILD_CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$BUILD_CXX" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !BUILD_CXX! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!BUILD_CXX!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xBUILD_CXX" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of BUILD_CXX from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of BUILD_CXX from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in cl CC g++ -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BUILD_CXX in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_CXX="$BUILD_CXX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_CXX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BUILD_CXX=$ac_cv_path_BUILD_CXX -if test -n "$BUILD_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CXX" >&5 -$as_echo "$BUILD_CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$BUILD_CXX" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$BUILD_CXX" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool BUILD_CXX= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool BUILD_CXX= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BUILD_CXX" >&5 -$as_echo_n "checking for BUILD_CXX... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$BUILD_CXX" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool BUILD_CXX=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool BUILD_CXX=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BUILD_CXX in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_CXX="$BUILD_CXX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_CXX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BUILD_CXX=$ac_cv_path_BUILD_CXX -if test -n "$BUILD_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CXX" >&5 -$as_echo "$BUILD_CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$BUILD_CXX" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool BUILD_CXX=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool BUILD_CXX=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BUILD_CXX" >&5 -$as_echo_n "checking for BUILD_CXX... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool BUILD_CXX=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$BUILD_CXX" = x; then - as_fn_error $? "Could not find required tool for BUILD_CXX" "$LINENO" 5 - fi - - - - # Only process if variable expands to non-empty - - if test "x$BUILD_CXX" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$BUILD_CXX" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CXX, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of BUILD_CXX, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$BUILD_CXX" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$BUILD_CXX" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - BUILD_CXX="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_CXX to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting BUILD_CXX to \"$new_complete\"" >&6;} - fi - fi - - - - # Publish this variable in the help. - - - if [ -z "${BUILD_NM+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in nm gcc-nm -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BUILD_NM in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_NM="$BUILD_NM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_NM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BUILD_NM=$ac_cv_path_BUILD_NM -if test -n "$BUILD_NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_NM" >&5 -$as_echo "$BUILD_NM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$BUILD_NM" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !BUILD_NM! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!BUILD_NM!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xBUILD_NM" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of BUILD_NM from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of BUILD_NM from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in nm gcc-nm -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BUILD_NM in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_NM="$BUILD_NM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_NM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BUILD_NM=$ac_cv_path_BUILD_NM -if test -n "$BUILD_NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_NM" >&5 -$as_echo "$BUILD_NM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$BUILD_NM" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$BUILD_NM" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool BUILD_NM= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool BUILD_NM= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BUILD_NM" >&5 -$as_echo_n "checking for BUILD_NM... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$BUILD_NM" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool BUILD_NM=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool BUILD_NM=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BUILD_NM in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_NM="$BUILD_NM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_NM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BUILD_NM=$ac_cv_path_BUILD_NM -if test -n "$BUILD_NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_NM" >&5 -$as_echo "$BUILD_NM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$BUILD_NM" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool BUILD_NM=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool BUILD_NM=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BUILD_NM" >&5 -$as_echo_n "checking for BUILD_NM... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool BUILD_NM=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - # Only process if variable expands to non-empty - - if test "x$BUILD_NM" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$BUILD_NM" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_NM, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_NM, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of BUILD_NM" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_NM, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of BUILD_NM, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of BUILD_NM" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$BUILD_NM" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_NM, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_NM, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of BUILD_NM" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$BUILD_NM" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_NM, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_NM, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of BUILD_NM" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - BUILD_NM="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_NM to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting BUILD_NM to \"$new_complete\"" >&6;} - fi - fi - - - - # Publish this variable in the help. - - - if [ -z "${BUILD_AR+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in ar gcc-ar -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BUILD_AR in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_AR="$BUILD_AR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_AR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BUILD_AR=$ac_cv_path_BUILD_AR -if test -n "$BUILD_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_AR" >&5 -$as_echo "$BUILD_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$BUILD_AR" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !BUILD_AR! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!BUILD_AR!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xBUILD_AR" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of BUILD_AR from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of BUILD_AR from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in ar gcc-ar -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BUILD_AR in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_AR="$BUILD_AR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_AR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BUILD_AR=$ac_cv_path_BUILD_AR -if test -n "$BUILD_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_AR" >&5 -$as_echo "$BUILD_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$BUILD_AR" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$BUILD_AR" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool BUILD_AR= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool BUILD_AR= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BUILD_AR" >&5 -$as_echo_n "checking for BUILD_AR... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$BUILD_AR" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool BUILD_AR=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool BUILD_AR=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BUILD_AR in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_AR="$BUILD_AR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_AR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BUILD_AR=$ac_cv_path_BUILD_AR -if test -n "$BUILD_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_AR" >&5 -$as_echo "$BUILD_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$BUILD_AR" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool BUILD_AR=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool BUILD_AR=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BUILD_AR" >&5 -$as_echo_n "checking for BUILD_AR... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool BUILD_AR=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - # Only process if variable expands to non-empty - - if test "x$BUILD_AR" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$BUILD_AR" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_AR, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_AR, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of BUILD_AR" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_AR, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of BUILD_AR, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of BUILD_AR" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$BUILD_AR" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_AR, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_AR, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of BUILD_AR" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$BUILD_AR" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_AR, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_AR, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of BUILD_AR" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - BUILD_AR="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_AR to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting BUILD_AR to \"$new_complete\"" >&6;} - fi - fi - - - - # Publish this variable in the help. - - - if [ -z "${BUILD_OBJCOPY+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in objcopy -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_OBJCOPY+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BUILD_OBJCOPY in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_OBJCOPY="$BUILD_OBJCOPY" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_OBJCOPY="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BUILD_OBJCOPY=$ac_cv_path_BUILD_OBJCOPY -if test -n "$BUILD_OBJCOPY"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_OBJCOPY" >&5 -$as_echo "$BUILD_OBJCOPY" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$BUILD_OBJCOPY" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !BUILD_OBJCOPY! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!BUILD_OBJCOPY!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xBUILD_OBJCOPY" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of BUILD_OBJCOPY from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of BUILD_OBJCOPY from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in objcopy -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_OBJCOPY+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BUILD_OBJCOPY in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_OBJCOPY="$BUILD_OBJCOPY" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_OBJCOPY="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BUILD_OBJCOPY=$ac_cv_path_BUILD_OBJCOPY -if test -n "$BUILD_OBJCOPY"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_OBJCOPY" >&5 -$as_echo "$BUILD_OBJCOPY" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$BUILD_OBJCOPY" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$BUILD_OBJCOPY" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool BUILD_OBJCOPY= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool BUILD_OBJCOPY= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BUILD_OBJCOPY" >&5 -$as_echo_n "checking for BUILD_OBJCOPY... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$BUILD_OBJCOPY" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool BUILD_OBJCOPY=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool BUILD_OBJCOPY=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_OBJCOPY+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BUILD_OBJCOPY in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_OBJCOPY="$BUILD_OBJCOPY" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_OBJCOPY="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BUILD_OBJCOPY=$ac_cv_path_BUILD_OBJCOPY -if test -n "$BUILD_OBJCOPY"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_OBJCOPY" >&5 -$as_echo "$BUILD_OBJCOPY" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$BUILD_OBJCOPY" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool BUILD_OBJCOPY=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool BUILD_OBJCOPY=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BUILD_OBJCOPY" >&5 -$as_echo_n "checking for BUILD_OBJCOPY... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool BUILD_OBJCOPY=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - # Only process if variable expands to non-empty - - if test "x$BUILD_OBJCOPY" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$BUILD_OBJCOPY" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_OBJCOPY, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_OBJCOPY, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of BUILD_OBJCOPY" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_OBJCOPY, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of BUILD_OBJCOPY, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of BUILD_OBJCOPY" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$BUILD_OBJCOPY" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_OBJCOPY, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_OBJCOPY, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of BUILD_OBJCOPY" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$BUILD_OBJCOPY" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_OBJCOPY, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_OBJCOPY, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of BUILD_OBJCOPY" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - BUILD_OBJCOPY="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_OBJCOPY to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting BUILD_OBJCOPY to \"$new_complete\"" >&6;} - fi - fi - - - - # Publish this variable in the help. - - - if [ -z "${BUILD_STRIP+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in strip -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BUILD_STRIP in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_STRIP="$BUILD_STRIP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_STRIP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BUILD_STRIP=$ac_cv_path_BUILD_STRIP -if test -n "$BUILD_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_STRIP" >&5 -$as_echo "$BUILD_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$BUILD_STRIP" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !BUILD_STRIP! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!BUILD_STRIP!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xBUILD_STRIP" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of BUILD_STRIP from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of BUILD_STRIP from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in strip -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BUILD_STRIP in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_STRIP="$BUILD_STRIP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_STRIP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BUILD_STRIP=$ac_cv_path_BUILD_STRIP -if test -n "$BUILD_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_STRIP" >&5 -$as_echo "$BUILD_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$BUILD_STRIP" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$BUILD_STRIP" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool BUILD_STRIP= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool BUILD_STRIP= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BUILD_STRIP" >&5 -$as_echo_n "checking for BUILD_STRIP... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$BUILD_STRIP" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool BUILD_STRIP=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool BUILD_STRIP=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BUILD_STRIP in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_STRIP="$BUILD_STRIP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_STRIP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BUILD_STRIP=$ac_cv_path_BUILD_STRIP -if test -n "$BUILD_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_STRIP" >&5 -$as_echo "$BUILD_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$BUILD_STRIP" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool BUILD_STRIP=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool BUILD_STRIP=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BUILD_STRIP" >&5 -$as_echo_n "checking for BUILD_STRIP... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool BUILD_STRIP=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - # Only process if variable expands to non-empty - - if test "x$BUILD_STRIP" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$BUILD_STRIP" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_STRIP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_STRIP, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of BUILD_STRIP" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_STRIP, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of BUILD_STRIP, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of BUILD_STRIP" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$BUILD_STRIP" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_STRIP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_STRIP, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of BUILD_STRIP" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$BUILD_STRIP" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_STRIP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_STRIP, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of BUILD_STRIP" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - BUILD_STRIP="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_STRIP to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting BUILD_STRIP to \"$new_complete\"" >&6;} - fi - fi - - # Assume the C compiler is the assembler - BUILD_AS="$BUILD_CC -c" - # Just like for the target compiler, use the compiler as linker - BUILD_LD="$BUILD_CC" - BUILD_LDCXX="$BUILD_CXX" - - PATH="$OLDPATH" - - - COMPILER=$BUILD_CC - COMPILER_NAME=BuildC - - if test "x$TOOLCHAIN_TYPE" = xsolstudio; then - # cc -V output typically looks like - # cc: Sun C 5.12 Linux_i386 2011/11/16 - # or - # cc: Studio 12.5 Sun C 5.14 SunOS_sparc 2016/05/31 - COMPILER_VERSION_OUTPUT=`$COMPILER -V 2>&1` - # Check that this is likely to be the Solaris Studio cc. - $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "^.* Sun $COMPILER_NAME" > /dev/null - if test $? -ne 0; then - ALT_VERSION_OUTPUT=`$COMPILER --version 2>&1` - { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 -$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with -V was: \"$COMPILER_VERSION_OUTPUT\"" >&5 -$as_echo "$as_me: The result from running with -V was: \"$COMPILER_VERSION_OUTPUT\"" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$ALT_VERSION_OUTPUT\"" >&5 -$as_echo "$as_me: The result from running with --version was: \"$ALT_VERSION_OUTPUT\"" >&6;} - as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 - fi - # Remove usage instructions (if present), and - # collapse compiler output into a single line - COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e 's/ *[Uu]sage:.*//'` - COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e "s/^.*[ ,\t]$COMPILER_NAME[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/"` - elif test "x$TOOLCHAIN_TYPE" = xxlc; then - # xlc -qversion output typically looks like - # IBM XL C/C++ for AIX, V11.1 (5724-X13) - # Version: 11.01.0000.0015 - COMPILER_VERSION_OUTPUT=`$COMPILER -qversion 2>&1` - # Check that this is likely to be the IBM XL C compiler. - $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "IBM XL C" > /dev/null - if test $? -ne 0; then - ALT_VERSION_OUTPUT=`$COMPILER --version 2>&1` - { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 -$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with -qversion was: \"$COMPILER_VERSION_OUTPUT\"" >&5 -$as_echo "$as_me: The result from running with -qversion was: \"$COMPILER_VERSION_OUTPUT\"" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$ALT_VERSION_OUTPUT\"" >&5 -$as_echo "$as_me: The result from running with --version was: \"$ALT_VERSION_OUTPUT\"" >&6;} - as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 - fi - # Collapse compiler output into a single line - COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` - COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e 's/^.*, V\([1-9][0-9.]*\).*$/\1/'` - elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - # There is no specific version flag, but all output starts with a version string. - # First line typically looks something like: - # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 - COMPILER_VERSION_OUTPUT=`$COMPILER 2>&1 | $HEAD -n 1 | $TR -d '\r'` - # Check that this is likely to be Microsoft CL.EXE. - $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Microsoft.*Compiler" > /dev/null - if test $? -ne 0; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 -$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running it was: \"$COMPILER_VERSION_OUTPUT\"" >&5 -$as_echo "$as_me: The result from running it was: \"$COMPILER_VERSION_OUTPUT\"" >&6;} - as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 - fi - # Collapse compiler output into a single line - COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` - COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e 's/^.*ersion.\([1-9][0-9.]*\) .*$/\1/'` - elif test "x$TOOLCHAIN_TYPE" = xgcc; then - # gcc --version output typically looks like - # gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1 - # Copyright (C) 2013 Free Software Foundation, Inc. - # This is free software; see the source for copying conditions. There is NO - # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1` - # Check that this is likely to be GCC. - $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Free Software Foundation" > /dev/null - if test $? -ne 0; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 -$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$COMPILER_VERSION\"" >&5 -$as_echo "$as_me: The result from running with --version was: \"$COMPILER_VERSION\"" >&6;} - as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 - fi - # Remove Copyright and legalese from version string, and - # collapse into a single line - COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e 's/ *Copyright .*//'` - COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e 's/^.* \([1-9]\.[0-9.]*\)[^0-9.].*$/\1/'` - elif test "x$TOOLCHAIN_TYPE" = xclang; then - # clang --version output typically looks like - # Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) - # clang version 3.3 (tags/RELEASE_33/final) - # or - # Debian clang version 3.2-7ubuntu1 (tags/RELEASE_32/final) (based on LLVM 3.2) - # Target: x86_64-pc-linux-gnu - # Thread model: posix - COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1` - # Check that this is likely to be clang - $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "clang" > /dev/null - if test $? -ne 0; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 -$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$COMPILER_VERSION_OUTPUT\"" >&5 -$as_echo "$as_me: The result from running with --version was: \"$COMPILER_VERSION_OUTPUT\"" >&6;} - as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 - fi - # Collapse compiler output into a single line - COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` - COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e 's/^.* version \([1-9][0-9.]*\).*$/\1/'` - else - as_fn_error $? "Unknown toolchain type $TOOLCHAIN_TYPE." "$LINENO" 5 - fi - # This sets CC_VERSION_NUMBER or CXX_VERSION_NUMBER. (This comment is a grep marker) - BUILD_CC_VERSION_NUMBER="$COMPILER_VERSION_NUMBER" - # This sets CC_VERSION_STRING or CXX_VERSION_STRING. (This comment is a grep marker) - BUILD_CC_VERSION_STRING="$COMPILER_VERSION_STRING" - - { $as_echo "$as_me:${as_lineno-$LINENO}: Using $TOOLCHAIN_TYPE $COMPILER_NAME compiler version $COMPILER_VERSION_NUMBER [$COMPILER_VERSION_STRING]" >&5 -$as_echo "$as_me: Using $TOOLCHAIN_TYPE $COMPILER_NAME compiler version $COMPILER_VERSION_NUMBER [$COMPILER_VERSION_STRING]" >&6;} - - - COMPILER=$BUILD_CXX - COMPILER_NAME=BuildC++ - - if test "x$TOOLCHAIN_TYPE" = xsolstudio; then - # cc -V output typically looks like - # cc: Sun C 5.12 Linux_i386 2011/11/16 - # or - # cc: Studio 12.5 Sun C 5.14 SunOS_sparc 2016/05/31 - COMPILER_VERSION_OUTPUT=`$COMPILER -V 2>&1` - # Check that this is likely to be the Solaris Studio cc. - $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "^.* Sun $COMPILER_NAME" > /dev/null - if test $? -ne 0; then - ALT_VERSION_OUTPUT=`$COMPILER --version 2>&1` - { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 -$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with -V was: \"$COMPILER_VERSION_OUTPUT\"" >&5 -$as_echo "$as_me: The result from running with -V was: \"$COMPILER_VERSION_OUTPUT\"" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$ALT_VERSION_OUTPUT\"" >&5 -$as_echo "$as_me: The result from running with --version was: \"$ALT_VERSION_OUTPUT\"" >&6;} - as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 - fi - # Remove usage instructions (if present), and - # collapse compiler output into a single line - COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e 's/ *[Uu]sage:.*//'` - COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e "s/^.*[ ,\t]$COMPILER_NAME[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/"` - elif test "x$TOOLCHAIN_TYPE" = xxlc; then - # xlc -qversion output typically looks like - # IBM XL C/C++ for AIX, V11.1 (5724-X13) - # Version: 11.01.0000.0015 - COMPILER_VERSION_OUTPUT=`$COMPILER -qversion 2>&1` - # Check that this is likely to be the IBM XL C compiler. - $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "IBM XL C" > /dev/null - if test $? -ne 0; then - ALT_VERSION_OUTPUT=`$COMPILER --version 2>&1` - { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 -$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with -qversion was: \"$COMPILER_VERSION_OUTPUT\"" >&5 -$as_echo "$as_me: The result from running with -qversion was: \"$COMPILER_VERSION_OUTPUT\"" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$ALT_VERSION_OUTPUT\"" >&5 -$as_echo "$as_me: The result from running with --version was: \"$ALT_VERSION_OUTPUT\"" >&6;} - as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 - fi - # Collapse compiler output into a single line - COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` - COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e 's/^.*, V\([1-9][0-9.]*\).*$/\1/'` - elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - # There is no specific version flag, but all output starts with a version string. - # First line typically looks something like: - # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 - COMPILER_VERSION_OUTPUT=`$COMPILER 2>&1 | $HEAD -n 1 | $TR -d '\r'` - # Check that this is likely to be Microsoft CL.EXE. - $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Microsoft.*Compiler" > /dev/null - if test $? -ne 0; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 -$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running it was: \"$COMPILER_VERSION_OUTPUT\"" >&5 -$as_echo "$as_me: The result from running it was: \"$COMPILER_VERSION_OUTPUT\"" >&6;} - as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 - fi - # Collapse compiler output into a single line - COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` - COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e 's/^.*ersion.\([1-9][0-9.]*\) .*$/\1/'` - elif test "x$TOOLCHAIN_TYPE" = xgcc; then - # gcc --version output typically looks like - # gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1 - # Copyright (C) 2013 Free Software Foundation, Inc. - # This is free software; see the source for copying conditions. There is NO - # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1` - # Check that this is likely to be GCC. - $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Free Software Foundation" > /dev/null - if test $? -ne 0; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 -$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$COMPILER_VERSION\"" >&5 -$as_echo "$as_me: The result from running with --version was: \"$COMPILER_VERSION\"" >&6;} - as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 - fi - # Remove Copyright and legalese from version string, and - # collapse into a single line - COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e 's/ *Copyright .*//'` - COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e 's/^.* \([1-9]\.[0-9.]*\)[^0-9.].*$/\1/'` - elif test "x$TOOLCHAIN_TYPE" = xclang; then - # clang --version output typically looks like - # Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) - # clang version 3.3 (tags/RELEASE_33/final) - # or - # Debian clang version 3.2-7ubuntu1 (tags/RELEASE_32/final) (based on LLVM 3.2) - # Target: x86_64-pc-linux-gnu - # Thread model: posix - COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1` - # Check that this is likely to be clang - $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "clang" > /dev/null - if test $? -ne 0; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 -$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$COMPILER_VERSION_OUTPUT\"" >&5 -$as_echo "$as_me: The result from running with --version was: \"$COMPILER_VERSION_OUTPUT\"" >&6;} - as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 - fi - # Collapse compiler output into a single line - COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` - COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e 's/^.* version \([1-9][0-9.]*\).*$/\1/'` - else - as_fn_error $? "Unknown toolchain type $TOOLCHAIN_TYPE." "$LINENO" 5 - fi - # This sets CC_VERSION_NUMBER or CXX_VERSION_NUMBER. (This comment is a grep marker) - BUILD_CXX_VERSION_NUMBER="$COMPILER_VERSION_NUMBER" - # This sets CC_VERSION_STRING or CXX_VERSION_STRING. (This comment is a grep marker) - BUILD_CXX_VERSION_STRING="$COMPILER_VERSION_STRING" - - { $as_echo "$as_me:${as_lineno-$LINENO}: Using $TOOLCHAIN_TYPE $COMPILER_NAME compiler version $COMPILER_VERSION_NUMBER [$COMPILER_VERSION_STRING]" >&5 -$as_echo "$as_me: Using $TOOLCHAIN_TYPE $COMPILER_NAME compiler version $COMPILER_VERSION_NUMBER [$COMPILER_VERSION_STRING]" >&6;} - - - if test "x$BUILD_CC_VERSION_NUMBER" != "x$BUILD_CXX_VERSION_NUMBER"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C and C++ compiler have different version numbers, $BUILD_CC_VERSION_NUMBER vs $BUILD_CXX_VERSION_NUMBER." >&5 -$as_echo "$as_me: WARNING: C and C++ compiler have different version numbers, $BUILD_CC_VERSION_NUMBER vs $BUILD_CXX_VERSION_NUMBER." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This typically indicates a broken setup, and is not supported" >&5 -$as_echo "$as_me: WARNING: This typically indicates a broken setup, and is not supported" >&2;} - fi - - # We only check CC_VERSION_NUMBER since we assume CXX_VERSION_NUMBER is equal. - if [[ "[$]BUILD_CC_VERSION_NUMBER" =~ (.*\.){4} ]] ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C compiler version number has more than four parts (W.X.Y.Z): $BUILD_CC_VERSION_NUMBER. Comparisons might be wrong." >&5 -$as_echo "$as_me: WARNING: C compiler version number has more than four parts (W.X.Y.Z): $BUILD_CC_VERSION_NUMBER. Comparisons might be wrong." >&2;} - fi - - if [[ "[$]BUILD_CC_VERSION_NUMBER" =~ [0-9]{6} ]] ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C compiler version number has a part larger than 99999: $BUILD_CC_VERSION_NUMBER. Comparisons might be wrong." >&5 -$as_echo "$as_me: WARNING: C compiler version number has a part larger than 99999: $BUILD_CC_VERSION_NUMBER. Comparisons might be wrong." >&2;} - fi - - OPENJDK_BUILD_COMPARABLE_ACTUAL_VERSION=`$AWK -F. '{ printf("%05d%05d%05d%05d\n", $1, $2, $3, $4) }' <<< "$BUILD_CC_VERSION_NUMBER"` - - else - # If we are not cross compiling, use the normal target compilers for - # building the build platform executables. - BUILD_CC="$CC" - BUILD_CXX="$CXX" - BUILD_LD="$LD" - BUILD_LDCXX="$LDCXX" - BUILD_NM="$NM" - BUILD_AS="$AS" - BUILD_OBJCOPY="$OBJCOPY" - BUILD_STRIP="$STRIP" - BUILD_SYSROOT_CFLAGS="$SYSROOT_CFLAGS" - BUILD_SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS" - BUILD_AR="$AR" - - - if test "x$CC_VERSION_NUMBER" != "x$CXX_VERSION_NUMBER"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C and C++ compiler have different version numbers, $CC_VERSION_NUMBER vs $CXX_VERSION_NUMBER." >&5 -$as_echo "$as_me: WARNING: C and C++ compiler have different version numbers, $CC_VERSION_NUMBER vs $CXX_VERSION_NUMBER." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This typically indicates a broken setup, and is not supported" >&5 -$as_echo "$as_me: WARNING: This typically indicates a broken setup, and is not supported" >&2;} - fi - - # We only check CC_VERSION_NUMBER since we assume CXX_VERSION_NUMBER is equal. - if [[ "[$]CC_VERSION_NUMBER" =~ (.*\.){4} ]] ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C compiler version number has more than four parts (W.X.Y.Z): $CC_VERSION_NUMBER. Comparisons might be wrong." >&5 -$as_echo "$as_me: WARNING: C compiler version number has more than four parts (W.X.Y.Z): $CC_VERSION_NUMBER. Comparisons might be wrong." >&2;} - fi - - if [[ "[$]CC_VERSION_NUMBER" =~ [0-9]{6} ]] ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C compiler version number has a part larger than 99999: $CC_VERSION_NUMBER. Comparisons might be wrong." >&5 -$as_echo "$as_me: WARNING: C compiler version number has a part larger than 99999: $CC_VERSION_NUMBER. Comparisons might be wrong." >&2;} - fi - - OPENJDK_BUILD_COMPARABLE_ACTUAL_VERSION=`$AWK -F. '{ printf("%05d%05d%05d%05d\n", $1, $2, $3, $4) }' <<< "$CC_VERSION_NUMBER"` - - fi - - - - - - - - - - - - - - - # The package path is used only on macosx? - # FIXME: clean this up, and/or move it elsewhere. - PACKAGE_PATH=/opt/local - - - # Check for extra potential brokenness. - if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - # On Windows, double-check that we got the right compiler. - CC_VERSION_OUTPUT=`$CC 2>&1 | $HEAD -n 1 | $TR -d '\r'` - COMPILER_CPU_TEST=`$ECHO $CC_VERSION_OUTPUT | $SED -n "s/^.* \(.*\)$/\1/p"` - if test "x$OPENJDK_TARGET_CPU" = "xx86"; then - if test "x$COMPILER_CPU_TEST" != "x80x86" -a "x$COMPILER_CPU_TEST" != "xx86"; then - as_fn_error $? "Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"80x86\" or \"x86\"." "$LINENO" 5 - fi - elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then - if test "x$COMPILER_CPU_TEST" != "xx64"; then - as_fn_error $? "Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"x64\"." "$LINENO" 5 - fi - fi - fi - - if test "x$TOOLCHAIN_TYPE" = xgcc; then - # If this is a --hash-style=gnu system, use --hash-style=both, why? - HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'` - # This is later checked when setting flags. - - # "-Og" suppported for GCC 4.8 and later - CFLAG_OPTIMIZE_DEBUG_FLAG="-Og" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Execute function body - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Execute function body - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C compiler supports \"$CFLAG_OPTIMIZE_DEBUG_FLAG\"" >&5 -$as_echo_n "checking if the C compiler supports \"$CFLAG_OPTIMIZE_DEBUG_FLAG\"... " >&6; } - supports=yes - - saved_cflags="$CFLAGS" - CFLAGS="$CFLAGS $CFLAG_OPTIMIZE_DEBUG_FLAG" - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int i; -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - supports=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - CFLAGS="$saved_cflags" - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5 -$as_echo "$supports" >&6; } - if test "x$supports" = "xyes" ; then - : - C_COMP_SUPPORTS="yes" - else - : - C_COMP_SUPPORTS="no" - fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Execute function body - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C++ compiler supports \"$CFLAG_OPTIMIZE_DEBUG_FLAG\"" >&5 -$as_echo_n "checking if the C++ compiler supports \"$CFLAG_OPTIMIZE_DEBUG_FLAG\"... " >&6; } - supports=yes - - saved_cxxflags="$CXXFLAGS" - CXXFLAGS="$CXXFLAG $CFLAG_OPTIMIZE_DEBUG_FLAG" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int i; -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - -else - supports=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - CXXFLAGS="$saved_cxxflags" - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5 -$as_echo "$supports" >&6; } - if test "x$supports" = "xyes" ; then - : - CXX_COMP_SUPPORTS="yes" - else - : - CXX_COMP_SUPPORTS="no" - fi - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if both compilers support \"$CFLAG_OPTIMIZE_DEBUG_FLAG\"" >&5 -$as_echo_n "checking if both compilers support \"$CFLAG_OPTIMIZE_DEBUG_FLAG\"... " >&6; } - supports=no - if test "x$C_COMP_SUPPORTS" = "xyes" -a "x$CXX_COMP_SUPPORTS" = "xyes"; then supports=yes; fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5 -$as_echo "$supports" >&6; } - if test "x$supports" = "xyes" ; then - : - HAS_CFLAG_OPTIMIZE_DEBUG=true - else - : - HAS_CFLAG_OPTIMIZE_DEBUG=false - fi - - - - - - - - # "-z relro" supported in GNU binutils 2.17 and later - LINKER_RELRO_FLAG="-Wl,-z,relro" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Execute function body - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linker supports \"$LINKER_RELRO_FLAG\"" >&5 -$as_echo_n "checking if linker supports \"$LINKER_RELRO_FLAG\"... " >&6; } - supports=yes - - saved_ldflags="$LDFLAGS" - LDFLAGS="$LDFLAGS $LINKER_RELRO_FLAG" - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - -else - supports=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - LDFLAGS="$saved_ldflags" - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5 -$as_echo "$supports" >&6; } - if test "x$supports" = "xyes" ; then - : - HAS_LINKER_RELRO=true - else - : - HAS_LINKER_RELRO=false - fi - - - - - - - - - - - - - - # "-z now" supported in GNU binutils 2.11 and later - LINKER_NOW_FLAG="-Wl,-z,now" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Execute function body - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linker supports \"$LINKER_NOW_FLAG\"" >&5 -$as_echo_n "checking if linker supports \"$LINKER_NOW_FLAG\"... " >&6; } - supports=yes - - saved_ldflags="$LDFLAGS" - LDFLAGS="$LDFLAGS $LINKER_NOW_FLAG" - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - -else - supports=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - LDFLAGS="$saved_ldflags" - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5 -$as_echo "$supports" >&6; } - if test "x$supports" = "xyes" ; then - : - HAS_LINKER_NOW=true - else - : - HAS_LINKER_NOW=false - fi - - - - - - - - - - - - - fi - - # Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed - # in executable.' - USING_BROKEN_SUSE_LD=no - if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$TOOLCHAIN_TYPE" = xgcc; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken SuSE 'ld' which only understands anonymous version tags in executables" >&5 -$as_echo_n "checking for broken SuSE 'ld' which only understands anonymous version tags in executables... " >&6; } - $ECHO "SUNWprivate_1.1 { local: *; };" > version-script.map - $ECHO "int main() { }" > main.c - if $CXX -Wl,-version-script=version-script.map main.c 2>&5 >&5; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - USING_BROKEN_SUSE_LD=no - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - USING_BROKEN_SUSE_LD=yes - fi - $RM version-script.map main.c a.out - fi - - - # Setup hotspot lecagy names for toolchains - HOTSPOT_TOOLCHAIN_TYPE=$TOOLCHAIN_TYPE - if test "x$TOOLCHAIN_TYPE" = xclang; then - HOTSPOT_TOOLCHAIN_TYPE=gcc - elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then - HOTSPOT_TOOLCHAIN_TYPE=sparcWorks - elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - HOTSPOT_TOOLCHAIN_TYPE=visCPP - fi - - - -# Setup the JTReg Regression Test Harness. - - -# Check whether --with-jtreg was given. -if test "${with_jtreg+set}" = set; then : - withval=$with_jtreg; -fi - - - if test "x$with_jtreg" = xno; then - # jtreg disabled - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jtreg test harness" >&5 -$as_echo_n "checking for jtreg test harness... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, disabled" >&5 -$as_echo "no, disabled" >&6; } - elif test "x$with_jtreg" != xyes && test "x$with_jtreg" != x; then - # An explicit path is specified, use it. - JT_HOME="$with_jtreg" - - # Only process if variable expands to non-empty - - if test "x$JT_HOME" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$JT_HOME" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JT_HOME, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of JT_HOME, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of JT_HOME" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - JT_HOME="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting JT_HOME to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting JT_HOME to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$JT_HOME" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - JT_HOME="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting JT_HOME to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting JT_HOME to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$JT_HOME" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JT_HOME, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of JT_HOME, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of JT_HOME, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - JT_HOME="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - JT_HOME="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - if test ! -d "$JT_HOME"; then - as_fn_error $? "jtreg home directory from --with-jtreg=$with_jtreg does not exist" "$LINENO" 5 - fi - - if test ! -e "$JT_HOME/lib/jtreg.jar"; then - as_fn_error $? "jtreg home directory from --with-jtreg=$with_jtreg is not a valid jtreg home" "$LINENO" 5 - fi - - JTREGEXE="$JT_HOME/bin/jtreg" - if test ! -x "$JTREGEXE"; then - as_fn_error $? "jtreg home directory from --with-jtreg=$with_jtreg does not contain valid jtreg executable" "$LINENO" 5 - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jtreg test harness" >&5 -$as_echo_n "checking for jtreg test harness... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JT_HOME" >&5 -$as_echo "$JT_HOME" >&6; } - else - # Try to locate jtreg - if test "x$JT_HOME" != x; then - # JT_HOME set in environment, use it - if test ! -d "$JT_HOME"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring JT_HOME pointing to invalid directory: $JT_HOME" >&5 -$as_echo "$as_me: WARNING: Ignoring JT_HOME pointing to invalid directory: $JT_HOME" >&2;} - JT_HOME= - else - if test ! -e "$JT_HOME/lib/jtreg.jar"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring JT_HOME which is not a valid jtreg home: $JT_HOME" >&5 -$as_echo "$as_me: WARNING: Ignoring JT_HOME which is not a valid jtreg home: $JT_HOME" >&2;} - JT_HOME= - elif test ! -x "$JT_HOME/bin/jtreg"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring JT_HOME which does not contain valid jtreg executable: $JT_HOME" >&5 -$as_echo "$as_me: WARNING: Ignoring JT_HOME which does not contain valid jtreg executable: $JT_HOME" >&2;} - JT_HOME= - else - JTREGEXE="$JT_HOME/bin/jtreg" - { $as_echo "$as_me:${as_lineno-$LINENO}: Located jtreg using JT_HOME from environment" >&5 -$as_echo "$as_me: Located jtreg using JT_HOME from environment" >&6;} - fi - fi - fi - - if test "x$JT_HOME" = x; then - # JT_HOME is not set in environment, or was deemed invalid. - # Try to find jtreg on path - - - # Publish this variable in the help. - - - if [ -z "${JTREGEXE+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in jtreg -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JTREGEXE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $JTREGEXE in - [\\/]* | ?:[\\/]*) - ac_cv_path_JTREGEXE="$JTREGEXE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_JTREGEXE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -JTREGEXE=$ac_cv_path_JTREGEXE -if test -n "$JTREGEXE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JTREGEXE" >&5 -$as_echo "$JTREGEXE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$JTREGEXE" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !JTREGEXE! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!JTREGEXE!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xJTREGEXE" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of JTREGEXE from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of JTREGEXE from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in jtreg -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JTREGEXE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $JTREGEXE in - [\\/]* | ?:[\\/]*) - ac_cv_path_JTREGEXE="$JTREGEXE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_JTREGEXE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -JTREGEXE=$ac_cv_path_JTREGEXE -if test -n "$JTREGEXE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JTREGEXE" >&5 -$as_echo "$JTREGEXE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$JTREGEXE" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$JTREGEXE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool JTREGEXE= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool JTREGEXE= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JTREGEXE" >&5 -$as_echo_n "checking for JTREGEXE... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$JTREGEXE" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool JTREGEXE=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool JTREGEXE=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JTREGEXE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $JTREGEXE in - [\\/]* | ?:[\\/]*) - ac_cv_path_JTREGEXE="$JTREGEXE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_JTREGEXE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -JTREGEXE=$ac_cv_path_JTREGEXE -if test -n "$JTREGEXE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JTREGEXE" >&5 -$as_echo "$JTREGEXE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$JTREGEXE" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool JTREGEXE=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool JTREGEXE=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JTREGEXE" >&5 -$as_echo_n "checking for JTREGEXE... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool JTREGEXE=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - if test "x$JTREGEXE" != x; then - # That's good, now try to derive JT_HOME - JT_HOME=`(cd $($DIRNAME $JTREGEXE)/.. && pwd)` - if test ! -e "$JT_HOME/lib/jtreg.jar"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring jtreg from path since a valid jtreg home cannot be found" >&5 -$as_echo "$as_me: WARNING: Ignoring jtreg from path since a valid jtreg home cannot be found" >&2;} - JT_HOME= - JTREGEXE= - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Located jtreg using jtreg executable in path" >&5 -$as_echo "$as_me: Located jtreg using jtreg executable in path" >&6;} - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jtreg test harness" >&5 -$as_echo_n "checking for jtreg test harness... " >&6; } - if test "x$JT_HOME" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JT_HOME" >&5 -$as_echo "$JT_HOME" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, not found" >&5 -$as_echo "no, not found" >&6; } - - if test "x$with_jtreg" = xyes; then - as_fn_error $? "--with-jtreg was specified, but no jtreg found." "$LINENO" 5 - fi - fi - fi - - - # Only process if variable expands to non-empty - - if test "x$JTREGEXE" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$JTREGEXE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JTREGEXE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of JTREGEXE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of JTREGEXE" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JTREGEXE, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of JTREGEXE, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of JTREGEXE" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$JTREGEXE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JTREGEXE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of JTREGEXE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of JTREGEXE" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$JTREGEXE" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JTREGEXE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of JTREGEXE, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of JTREGEXE" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - JTREGEXE="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting JTREGEXE to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting JTREGEXE to \"$new_complete\"" >&6;} - fi - fi - - - # Only process if variable expands to non-empty - - if test "x$JT_HOME" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$JT_HOME" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JT_HOME, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of JT_HOME, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of JT_HOME" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - JT_HOME="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting JT_HOME to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting JT_HOME to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$JT_HOME" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - JT_HOME="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting JT_HOME to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting JT_HOME to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$JT_HOME" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JT_HOME, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of JT_HOME, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of JT_HOME, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - JT_HOME="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - JT_HOME="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - - - -# Setup Jib dependency tool - - -# Check whether --with-jib was given. -if test "${with_jib+set}" = set; then : - withval=$with_jib; -fi - - - if test "x$with_jib" = xno || test "x$with_jib" = x; then - # jib disabled - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jib" >&5 -$as_echo_n "checking for jib... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - elif test "x$with_jib" = xyes; then - as_fn_error $? "Must supply a value to --with-jib" "$LINENO" 5 - else - JIB_HOME="${with_jib}" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jib" >&5 -$as_echo_n "checking for jib... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${JIB_HOME}" >&5 -$as_echo "${JIB_HOME}" >&6; } - if test ! -d "${JIB_HOME}"; then - as_fn_error $? "--with-jib must be a directory" "$LINENO" 5 - fi - JIB_JAR=$(ls ${JIB_HOME}/lib/jib-*.jar) - if test ! -f "${JIB_JAR}"; then - as_fn_error $? "Could not find jib jar file in ${JIB_HOME}" "$LINENO" 5 - fi - fi - - - - - - # COMPILER_TARGET_BITS_FLAG : option for selecting 32- or 64-bit output - # COMPILER_COMMAND_FILE_FLAG : option for passing a command file to the compiler - # COMPILER_BINDCMD_FILE_FLAG : option for specifying a file which saves the binder - # commands produced by the link step (currently AIX only) - if test "x$TOOLCHAIN_TYPE" = xxlc; then - COMPILER_TARGET_BITS_FLAG="-q" - COMPILER_COMMAND_FILE_FLAG="-f" - COMPILER_BINDCMD_FILE_FLAG="-bloadmap:" - else - COMPILER_TARGET_BITS_FLAG="-m" - COMPILER_COMMAND_FILE_FLAG="@" - COMPILER_BINDCMD_FILE_FLAG="" - - # The solstudio linker does not support @-files. - if test "x$TOOLCHAIN_TYPE" = xsolstudio; then - COMPILER_COMMAND_FILE_FLAG= - fi - - # Check if @file is supported by gcc - if test "x$TOOLCHAIN_TYPE" = xgcc; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if @file is supported by gcc" >&5 -$as_echo_n "checking if @file is supported by gcc... " >&6; } - # Extra emtpy "" to prevent ECHO from interpreting '--version' as argument - $ECHO "" "--version" > command.file - if $CXX @command.file 2>&5 >&5; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - COMPILER_COMMAND_FILE_FLAG="@" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - COMPILER_COMMAND_FILE_FLAG= - fi - $RM command.file - fi - fi - - - - - # FIXME: figure out if we should select AR flags depending on OS or toolchain. - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - ARFLAGS="-r" - elif test "x$OPENJDK_TARGET_OS" = xaix; then - ARFLAGS="-X64" - elif test "x$OPENJDK_TARGET_OS" = xwindows; then - # lib.exe is used as AR to create static libraries. - ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT" - else - ARFLAGS="" - fi - - - ## Setup strip. - # FIXME: should this really be per platform, or should it be per toolchain type? - # strip is not provided by clang or solstudio; so guessing platform makes most sense. - # FIXME: we should really only export STRIPFLAGS from here, not POST_STRIP_CMD. - if test "x$OPENJDK_TARGET_OS" = xlinux; then - STRIPFLAGS="-g" - elif test "x$OPENJDK_TARGET_OS" = xsolaris; then - STRIPFLAGS="-x" - elif test "x$OPENJDK_TARGET_OS" = xmacosx; then - STRIPFLAGS="-S" - elif test "x$OPENJDK_TARGET_OS" = xaix; then - STRIPFLAGS="-X32_64" - fi - - - - if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - CC_OUT_OPTION=-Fo - EXE_OUT_OPTION=-out: - LD_OUT_OPTION=-out: - AR_OUT_OPTION=-out: - else - # The option used to specify the target .o,.a or .so file. - # When compiling, how to specify the to be created object file. - CC_OUT_OPTION='-o$(SPACE)' - # When linking, how to specify the to be created executable. - EXE_OUT_OPTION='-o$(SPACE)' - # When linking, how to specify the to be created dynamically linkable library. - LD_OUT_OPTION='-o$(SPACE)' - # When archiving, how to specify the to be create static archive for object files. - AR_OUT_OPTION='rcs$(SPACE)' - fi - - - - - - # On Windows, we need to set RC flags. - if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - RC_FLAGS="-nologo -l0x409" - JVM_RCFLAGS="-nologo" - if test "x$DEBUG_LEVEL" = xrelease; then - RC_FLAGS="$RC_FLAGS -DNDEBUG" - JVM_RCFLAGS="$JVM_RCFLAGS -DNDEBUG" - fi - - # The version variables used to create RC_FLAGS may be overridden - # in a custom configure script, or possibly the command line. - # Let those variables be expanded at make time in spec.gmk. - # The \$ are escaped to the shell, and the $(...) variables - # are evaluated by make. - RC_FLAGS="$RC_FLAGS \ - -D\"JDK_VERSION_STRING=\$(VERSION_STRING)\" \ - -D\"JDK_COMPANY=\$(COMPANY_NAME)\" \ - -D\"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \ - -D\"JDK_VER=\$(VERSION_NUMBER)\" \ - -D\"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \ - -D\"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(VERSION_FEATURE)\" \ - -D\"JDK_FVER=\$(subst .,\$(COMMA),\$(VERSION_NUMBER_FOUR_POSITIONS))\"" - - JVM_RCFLAGS="$JVM_RCFLAGS \ - -D\"HS_BUILD_ID=\$(VERSION_STRING)\" \ - -D\"HS_COMPANY=\$(COMPANY_NAME)\" \ - -D\"JDK_DOTVER=\$(VERSION_NUMBER_FOUR_POSITIONS)\" \ - -D\"HS_COPYRIGHT=Copyright $COPYRIGHT_YEAR\" \ - -D\"HS_NAME=\$(PRODUCT_NAME) \$(VERSION_SHORT)\" \ - -D\"JDK_VER=\$(subst .,\$(COMMA),\$(VERSION_NUMBER_FOUR_POSITIONS))\" \ - -D\"HS_FNAME=jvm.dll\" \ - -D\"HS_INTERNAL_NAME=jvm\"" - fi - - - - if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - # silence copyright notice and other headers. - COMMON_CCXXFLAGS="$COMMON_CCXXFLAGS -nologo" - fi - - -# Now we can test some aspects on the target using configure macros. - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_cxx_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - ############################################################################### - # - # Now we check if libjvm.so will use 32 or 64 bit pointers for the C/C++ code. - # (The JVM can use 32 or 64 bit Java pointers but that decision - # is made at runtime.) - # - - if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xaix; then - # Always specify -m flag on Solaris - # And -q on AIX because otherwise the compiler produces 32-bit objects by default - - # When we add flags to the "official" CFLAGS etc, we need to - # keep track of these additions in ADDED_CFLAGS etc. These - # will later be checked to make sure only controlled additions - # have been made to CFLAGS etc. - ADDED_CFLAGS=" ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" - ADDED_CXXFLAGS=" ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" - ADDED_LDFLAGS=" ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" - - CFLAGS="${CFLAGS}${ADDED_CFLAGS}" - CXXFLAGS="${CXXFLAGS}${ADDED_CXXFLAGS}" - LDFLAGS="${LDFLAGS}${ADDED_LDFLAGS}" - - CFLAGS_JDK="${CFLAGS_JDK}${ADDED_CFLAGS}" - CXXFLAGS_JDK="${CXXFLAGS_JDK}${ADDED_CXXFLAGS}" - LDFLAGS_JDK="${LDFLAGS_JDK}${ADDED_LDFLAGS}" - - JVM_CFLAGS="$JVM_CFLAGS $ADDED_CFLAGS" - JVM_LDFLAGS="$JVM_LDFLAGS $ADDED_LDFLAGS" - JVM_ASFLAGS="$JVM_ASFLAGS $ADDED_CFLAGS" - - elif test "x$COMPILE_TYPE" = xreduced; then - if test "x$OPENJDK_TARGET_OS_TYPE" = xunix; then - # Specify -m if running reduced on unix platforms - - # When we add flags to the "official" CFLAGS etc, we need to - # keep track of these additions in ADDED_CFLAGS etc. These - # will later be checked to make sure only controlled additions - # have been made to CFLAGS etc. - ADDED_CFLAGS=" ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" - ADDED_CXXFLAGS=" ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" - ADDED_LDFLAGS=" ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" - - CFLAGS="${CFLAGS}${ADDED_CFLAGS}" - CXXFLAGS="${CXXFLAGS}${ADDED_CXXFLAGS}" - LDFLAGS="${LDFLAGS}${ADDED_LDFLAGS}" - - CFLAGS_JDK="${CFLAGS_JDK}${ADDED_CFLAGS}" - CXXFLAGS_JDK="${CXXFLAGS_JDK}${ADDED_CXXFLAGS}" - LDFLAGS_JDK="${LDFLAGS_JDK}${ADDED_LDFLAGS}" - - JVM_CFLAGS="$JVM_CFLAGS $ADDED_CFLAGS" - JVM_LDFLAGS="$JVM_LDFLAGS $ADDED_LDFLAGS" - JVM_ASFLAGS="$JVM_ASFLAGS $ADDED_CFLAGS" - - fi - fi - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - JVM_CFLAGS="$JVM_CFLAGS ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" - JVM_LDFLAGS="$JVM_LDFLAGS ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" - JVM_ASFLAGS="$JVM_ASFLAGS ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" - fi - - # Make compilation sanity check - for ac_header in stdio.h -do : - ac_fn_cxx_check_header_mongrel "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default" -if test "x$ac_cv_header_stdio_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STDIO_H 1 -_ACEOF - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: Failed to compile stdio.h. This likely implies missing compile dependencies." >&5 -$as_echo "$as_me: Failed to compile stdio.h. This likely implies missing compile dependencies." >&6;} - if test "x$COMPILE_TYPE" = xreduced; then - - # Print a helpful message on how to acquire the necessary build dependency. - # reduced is the help tag: freetype, cups, alsa etc - MISSING_DEPENDENCY=reduced - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - cygwin_help $MISSING_DEPENDENCY - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - msys_help $MISSING_DEPENDENCY - else - PKGHANDLER_COMMAND= - - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - brew) - brew_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - esac - - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: You are doing a reduced build. Check that you have 32-bit libraries installed. $HELP_MSG" >&5 -$as_echo "$as_me: You are doing a reduced build. Check that you have 32-bit libraries installed. $HELP_MSG" >&6;} - elif test "x$COMPILE_TYPE" = xcross; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You are doing a cross-compilation. Check that you have all target platform libraries installed." >&5 -$as_echo "$as_me: You are doing a cross-compilation. Check that you have all target platform libraries installed." >&6;} - fi - as_fn_error $? "Cannot continue." "$LINENO" 5 - -fi - -done - - - # The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int *" >&5 -$as_echo_n "checking size of int *... " >&6; } -if ${ac_cv_sizeof_int_p+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (int *))" "ac_cv_sizeof_int_p" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_int_p" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (int *) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_int_p=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int_p" >&5 -$as_echo "$ac_cv_sizeof_int_p" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT_P $ac_cv_sizeof_int_p -_ACEOF - - - - # AC_CHECK_SIZEOF defines 'ac_cv_sizeof_int_p' to hold the number of bytes used by an 'int*' - if test "x$ac_cv_sizeof_int_p" = x; then - # The test failed, lets stick to the assumed value. - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The number of bits in the target could not be determined, using $OPENJDK_TARGET_CPU_BITS." >&5 -$as_echo "$as_me: WARNING: The number of bits in the target could not be determined, using $OPENJDK_TARGET_CPU_BITS." >&2;} - else - TESTED_TARGET_CPU_BITS=`expr 8 \* $ac_cv_sizeof_int_p` - - if test "x$TESTED_TARGET_CPU_BITS" != "x$OPENJDK_TARGET_CPU_BITS"; then - # This situation may happen on 64-bit platforms where the compiler by default only generates 32-bit objects - # Let's try to implicitely set the compilers target architecture and retry the test - { $as_echo "$as_me:${as_lineno-$LINENO}: The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)." >&5 -$as_echo "$as_me: The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Retrying with platforms compiler target bits flag to ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" >&5 -$as_echo "$as_me: Retrying with platforms compiler target bits flag to ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" >&6;} - - # When we add flags to the "official" CFLAGS etc, we need to - # keep track of these additions in ADDED_CFLAGS etc. These - # will later be checked to make sure only controlled additions - # have been made to CFLAGS etc. - ADDED_CFLAGS=" ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" - ADDED_CXXFLAGS=" ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" - ADDED_LDFLAGS=" ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" - - CFLAGS="${CFLAGS}${ADDED_CFLAGS}" - CXXFLAGS="${CXXFLAGS}${ADDED_CXXFLAGS}" - LDFLAGS="${LDFLAGS}${ADDED_LDFLAGS}" - - CFLAGS_JDK="${CFLAGS_JDK}${ADDED_CFLAGS}" - CXXFLAGS_JDK="${CXXFLAGS_JDK}${ADDED_CXXFLAGS}" - LDFLAGS_JDK="${LDFLAGS_JDK}${ADDED_LDFLAGS}" - - JVM_CFLAGS="$JVM_CFLAGS $ADDED_CFLAGS" - JVM_LDFLAGS="$JVM_LDFLAGS $ADDED_LDFLAGS" - JVM_ASFLAGS="$JVM_ASFLAGS $ADDED_CFLAGS" - - - # We have to unset 'ac_cv_sizeof_int_p' first, otherwise AC_CHECK_SIZEOF will use the previously cached value! - unset ac_cv_sizeof_int_p - # And we have to undef the definition of SIZEOF_INT_P in confdefs.h by the previous invocation of AC_CHECK_SIZEOF - cat >>confdefs.h <<_ACEOF -#undef SIZEOF_INT_P -_ACEOF - - # The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int *" >&5 -$as_echo_n "checking size of int *... " >&6; } -if ${ac_cv_sizeof_int_p+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (int *))" "ac_cv_sizeof_int_p" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_int_p" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (int *) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_int_p=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int_p" >&5 -$as_echo "$ac_cv_sizeof_int_p" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT_P $ac_cv_sizeof_int_p -_ACEOF - - - - TESTED_TARGET_CPU_BITS=`expr 8 \* $ac_cv_sizeof_int_p` - - if test "x$TESTED_TARGET_CPU_BITS" != "x$OPENJDK_TARGET_CPU_BITS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)" >&5 -$as_echo "$as_me: The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)" >&6;} - if test "x$COMPILE_TYPE" = xreduced; then - - # Print a helpful message on how to acquire the necessary build dependency. - # reduced is the help tag: freetype, cups, alsa etc - MISSING_DEPENDENCY=reduced - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - cygwin_help $MISSING_DEPENDENCY - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - msys_help $MISSING_DEPENDENCY - else - PKGHANDLER_COMMAND= - - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - brew) - brew_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - esac - - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: You are doing a reduced build. Check that you have 32-bit libraries installed. $HELP_MSG" >&5 -$as_echo "$as_me: You are doing a reduced build. Check that you have 32-bit libraries installed. $HELP_MSG" >&6;} - elif test "x$COMPILE_TYPE" = xcross; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You are doing a cross-compilation. Check that you have all target platform libraries installed." >&5 -$as_echo "$as_me: You are doing a cross-compilation. Check that you have all target platform libraries installed." >&6;} - fi - as_fn_error $? "Cannot continue." "$LINENO" 5 - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for target address size" >&5 -$as_echo_n "checking for target address size... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPENJDK_TARGET_CPU_BITS bits" >&5 -$as_echo "$OPENJDK_TARGET_CPU_BITS bits" >&6; } - - - ############################################################################### - # - # Is the target little of big endian? - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if ${ac_cv_c_bigendian+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_c_bigendian=unknown - # See if we're dealing with a universal compiler. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __APPLE_CC__ - not a universal capable compiler - #endif - typedef int dummy; - -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - - # Check for potential -arch flags. It is not universal unless - # there are at least two -arch flags with different values. - ac_arch= - ac_prev= - for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do - if test -n "$ac_prev"; then - case $ac_word in - i?86 | x86_64 | ppc | ppc64) - if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then - ac_arch=$ac_word - else - ac_cv_c_bigendian=universal - break - fi - ;; - esac - ac_prev= - elif test "x$ac_word" = "x-arch"; then - ac_prev=arch - fi - done -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test $ac_cv_c_bigendian = unknown; then - # See if sys/param.h defines the BYTE_ORDER macro. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #include - -int -main () -{ -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ - && LITTLE_ENDIAN) - bogus endian macros - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - # It does; now see whether it defined to BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #include - -int -main () -{ -#if BYTE_ORDER != BIG_ENDIAN - not big endian - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_c_bigendian=yes -else - ac_cv_c_bigendian=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -int -main () -{ -#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) - bogus endian macros - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - # It does; now see whether it defined to _BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -int -main () -{ -#ifndef _BIG_ENDIAN - not big endian - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_c_bigendian=yes -else - ac_cv_c_bigendian=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # Compile a test program. - if test "$cross_compiling" = yes; then : - # Try to guess by grepping values from an object file. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -short int ascii_mm[] = - { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = - { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; - int use_ascii (int i) { - return ascii_mm[i] + ascii_ii[i]; - } - short int ebcdic_ii[] = - { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = - { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; - int use_ebcdic (int i) { - return ebcdic_mm[i] + ebcdic_ii[i]; - } - extern int foo; - -int -main () -{ -return use_ascii (foo) == use_ebcdic (foo); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then - ac_cv_c_bigendian=yes - fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi - fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ - - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_run "$LINENO"; then : - ac_cv_c_bigendian=no -else - ac_cv_c_bigendian=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } - case $ac_cv_c_bigendian in #( - yes) - ENDIAN="big";; #( - no) - ENDIAN="little" ;; #( - universal) - ENDIAN="universal_endianness" - ;; #( - *) - ENDIAN="unknown" ;; - esac - - - if test "x$ENDIAN" = xuniversal_endianness; then - as_fn_error $? "Building with both big and little endianness is not supported" "$LINENO" 5 - fi - if test "x$ENDIAN" != "x$OPENJDK_TARGET_CPU_ENDIAN"; then - as_fn_error $? "The tested endian in the target ($ENDIAN) differs from the endian expected to be found in the target ($OPENJDK_TARGET_CPU_ENDIAN)" "$LINENO" 5 - fi - - -# Configure flags for the tools - - ############################################################################### - # - # How to compile shared libraries. - # - - if test "x$TOOLCHAIN_TYPE" = xgcc; then - PICFLAG="-fPIC" - C_FLAG_REORDER='' - CXX_FLAG_REORDER='' - - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - # Linking is different on MacOSX - if test "x$STATIC_BUILD" = xtrue; then - SHARED_LIBRARY_FLAGS ='-undefined dynamic_lookup' - else - SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG" - JVM_CFLAGS="$JVM_CFLAGS $PICFLAG" - fi - SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path$(or $1,/.)' - SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN" - SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/$1' - SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,$1' - else - # Default works for linux, might work on other platforms as well. - SHARED_LIBRARY_FLAGS='-shared' - SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN$1' - SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN" - SET_SHARED_LIBRARY_NAME='-Wl,-soname=$1' - SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=$1' - fi - elif test "x$TOOLCHAIN_TYPE" = xclang; then - C_FLAG_REORDER='' - CXX_FLAG_REORDER='' - - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - # Linking is different on MacOSX - PICFLAG='' - SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG" - SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path$(or $1,/.)' - SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN" - SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/$1' - SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,$1' - - if test "x$STATIC_BUILD" = xfalse; then - JVM_CFLAGS="$JVM_CFLAGS -fPIC" - fi - else - # Default works for linux, might work on other platforms as well. - PICFLAG='-fPIC' - SHARED_LIBRARY_FLAGS='-shared' - SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN$1' - SET_SHARED_LIBRARY_NAME='-Wl,-soname=$1' - SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=$1' - - # arm specific settings - if test "x$OPENJDK_TARGET_CPU" = "xarm"; then - # '-Wl,-z,origin' isn't used on arm. - SET_SHARED_LIBRARY_ORIGIN='-Wl,-rpath,\$$$$ORIGIN$1' - else - SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN" - fi - - fi - elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then - if test "x$OPENJDK_TARGET_CPU" = xsparcv9; then - PICFLAG="-xcode=pic32" - else - PICFLAG="-KPIC" - fi - C_FLAG_REORDER='-xF' - CXX_FLAG_REORDER='-xF' - SHARED_LIBRARY_FLAGS="-G" - SET_EXECUTABLE_ORIGIN='-R\$$ORIGIN$1' - SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN" - SET_SHARED_LIBRARY_NAME='-h $1' - SET_SHARED_LIBRARY_MAPFILE='-M$1' - elif test "x$TOOLCHAIN_TYPE" = xxlc; then - # '-qpic' defaults to 'qpic=small'. This means that the compiler generates only - # one instruction for accessing the TOC. If the TOC grows larger than 64K, the linker - # will have to patch this single instruction with a call to some out-of-order code which - # does the load from the TOC. This is of course slow. But in that case we also would have - # to use '-bbigtoc' for linking anyway so we could also change the PICFLAG to 'qpic=large'. - # With 'qpic=large' the compiler will by default generate a two-instruction sequence which - # can be patched directly by the linker and does not require a jump to out-of-order code. - # Another alternative instead of using 'qpic=large -bbigtoc' may be to use '-qminimaltoc' - # instead. This creates a distinct TOC for every compilation unit (and thus requires two - # loads for accessing a global variable). But there are rumors that this may be seen as a - # 'performance feature' because of improved code locality of the symbols used in a - # compilation unit. - PICFLAG="-qpic" - JVM_CFLAGS="$JVM_CFLAGS $PICFLAG" - C_FLAG_REORDER='' - CXX_FLAG_REORDER='' - SHARED_LIBRARY_FLAGS="-qmkshrobj -bM:SRE -bnoentry" - SET_EXECUTABLE_ORIGIN="" - SET_SHARED_LIBRARY_ORIGIN='' - SET_SHARED_LIBRARY_NAME='' - SET_SHARED_LIBRARY_MAPFILE='' - elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - PICFLAG="" - C_FLAG_REORDER='' - CXX_FLAG_REORDER='' - SHARED_LIBRARY_FLAGS="-dll" - SET_EXECUTABLE_ORIGIN='' - SET_SHARED_LIBRARY_ORIGIN='' - SET_SHARED_LIBRARY_NAME='' - SET_SHARED_LIBRARY_MAPFILE='-def:$1' - fi - - - - - - - - - - # The (cross) compiler is now configured, we can now test capabilities - # of the target platform. - - - - ############################################################################### - # - # Setup the opt flags for different compilers - # and different operating systems. - # - - # FIXME: this was indirectly the old default, but just inherited. - # if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - # C_FLAG_DEPS="-MMD -MF" - # fi - - # Generate make dependency files - if test "x$TOOLCHAIN_TYPE" = xgcc; then - C_FLAG_DEPS="-MMD -MF" - elif test "x$TOOLCHAIN_TYPE" = xclang; then - C_FLAG_DEPS="-MMD -MF" - elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then - C_FLAG_DEPS="-xMMD -xMF" - elif test "x$TOOLCHAIN_TYPE" = xxlc; then - C_FLAG_DEPS="-qmakedep=gcc -MF" - fi - CXX_FLAG_DEPS="$C_FLAG_DEPS" - - - - # Debug symbols - if test "x$TOOLCHAIN_TYPE" = xgcc; then - if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then - # reduce from default "-g2" option to save space - CFLAGS_DEBUG_SYMBOLS="-g1" - CXXFLAGS_DEBUG_SYMBOLS="-g1" - else - CFLAGS_DEBUG_SYMBOLS="-g" - CXXFLAGS_DEBUG_SYMBOLS="-g" - fi - elif test "x$TOOLCHAIN_TYPE" = xclang; then - CFLAGS_DEBUG_SYMBOLS="-g" - CXXFLAGS_DEBUG_SYMBOLS="-g" - elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then - CFLAGS_DEBUG_SYMBOLS="-g -xs" - # -g0 enables debug symbols without disabling inlining. - CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs" - elif test "x$TOOLCHAIN_TYPE" = xxlc; then - CFLAGS_DEBUG_SYMBOLS="-g" - CXXFLAGS_DEBUG_SYMBOLS="-g" - elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - CFLAGS_DEBUG_SYMBOLS="-Zi" - CXXFLAGS_DEBUG_SYMBOLS="-Zi" - fi - - - - # Debug symbols for JVM_CFLAGS - if test "x$TOOLCHAIN_TYPE" = xsolstudio; then - JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -xs" - if test "x$DEBUG_LEVEL" = xslowdebug; then - JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -g" - else - # -g0 does not disable inlining, which -g does. - JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -g0" - fi - elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -Z7 -d2Zi+" - else - JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -g" - fi - - - # bounds, memory and behavior checking options - if test "x$TOOLCHAIN_TYPE" = xgcc; then - case $DEBUG_LEVEL in - release ) - # no adjustment - ;; - fastdebug ) - # no adjustment - ;; - slowdebug ) - # FIXME: By adding this to C(XX)FLAGS_DEBUG_OPTIONS/JVM_CFLAGS_SYMBOLS it - # get's added conditionally on whether we produce debug symbols or not. - # This is most likely not really correct. - - # Add runtime stack smashing and undefined behavior checks. - # Not all versions of gcc support -fstack-protector - STACK_PROTECTOR_CFLAG="-fstack-protector-all" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Execute function body - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Execute function body - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C compiler supports \"$STACK_PROTECTOR_CFLAG -Werror\"" >&5 -$as_echo_n "checking if the C compiler supports \"$STACK_PROTECTOR_CFLAG -Werror\"... " >&6; } - supports=yes - - saved_cflags="$CFLAGS" - CFLAGS="$CFLAGS $STACK_PROTECTOR_CFLAG -Werror" - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int i; -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - supports=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - CFLAGS="$saved_cflags" - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5 -$as_echo "$supports" >&6; } - if test "x$supports" = "xyes" ; then - : - C_COMP_SUPPORTS="yes" - else - : - C_COMP_SUPPORTS="no" - fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Execute function body - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C++ compiler supports \"$STACK_PROTECTOR_CFLAG -Werror\"" >&5 -$as_echo_n "checking if the C++ compiler supports \"$STACK_PROTECTOR_CFLAG -Werror\"... " >&6; } - supports=yes - - saved_cxxflags="$CXXFLAGS" - CXXFLAGS="$CXXFLAG $STACK_PROTECTOR_CFLAG -Werror" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int i; -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - -else - supports=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - CXXFLAGS="$saved_cxxflags" - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5 -$as_echo "$supports" >&6; } - if test "x$supports" = "xyes" ; then - : - CXX_COMP_SUPPORTS="yes" - else - : - CXX_COMP_SUPPORTS="no" - fi - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if both compilers support \"$STACK_PROTECTOR_CFLAG -Werror\"" >&5 -$as_echo_n "checking if both compilers support \"$STACK_PROTECTOR_CFLAG -Werror\"... " >&6; } - supports=no - if test "x$C_COMP_SUPPORTS" = "xyes" -a "x$CXX_COMP_SUPPORTS" = "xyes"; then supports=yes; fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5 -$as_echo "$supports" >&6; } - if test "x$supports" = "xyes" ; then - : - - else - : - STACK_PROTECTOR_CFLAG="" - fi - - - - - - - - CFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1" - CXXFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1" - if test "x$STACK_PROTECTOR_CFLAG" != x; then - JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS $STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1" - fi - ;; - esac - fi - - if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - if test "x$DEBUG_LEVEL" != xrelease; then - if test "x$OPENJDK_TARGET_CPU" = xx86_64; then - JVM_CFLAGS="$JVM_CFLAGS -homeparams" - fi - fi - fi - - # Optimization levels - if test "x$TOOLCHAIN_TYPE" = xsolstudio; then - CC_HIGHEST="$CC_HIGHEST -fns -fsimple -fsingle -xbuiltin=%all -xdepend -xrestrict -xlibmil" - - if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86"; then - # FIXME: seems we always set -xregs=no%frameptr; put it elsewhere more global? - C_O_FLAG_HIGHEST_JVM="-xO4" - C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xalias_level=basic -xregs=no%frameptr" - C_O_FLAG_HI="-xO4 -Wu,-O4~yz -xregs=no%frameptr" - C_O_FLAG_NORM="-xO2 -Wu,-O2~yz -xregs=no%frameptr" - C_O_FLAG_DEBUG="-xregs=no%frameptr" - C_O_FLAG_DEBUG_JVM="" - C_O_FLAG_NONE="-xregs=no%frameptr" - CXX_O_FLAG_HIGHEST_JVM="-xO4" - CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xregs=no%frameptr" - CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz -xregs=no%frameptr" - CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz -xregs=no%frameptr" - CXX_O_FLAG_DEBUG="-xregs=no%frameptr" - CXX_O_FLAG_DEBUG_JVM="" - CXX_O_FLAG_NONE="-xregs=no%frameptr" - if test "x$OPENJDK_TARGET_CPU_BITS" = "x32"; then - C_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST -xchip=pentium" - CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HIGHEST -xchip=pentium" - fi - elif test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then - C_O_FLAG_HIGHEST_JVM="-xO4" - C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xalias_level=basic -xprefetch=auto,explicit -xchip=ultra" - C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0" - C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0" - C_O_FLAG_DEBUG="" - C_O_FLAG_DEBUG_JVM="" - C_O_FLAG_NONE="" - CXX_O_FLAG_HIGHEST_JVM="-xO4" - CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra" - CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0" - CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0" - CXX_O_FLAG_DEBUG="" - CXX_O_FLAG_DEBUG_JVM="" - CXX_O_FLAG_NONE="" - fi - else - # The remaining toolchains share opt flags between CC and CXX; - # setup for C and duplicate afterwards. - if test "x$TOOLCHAIN_TYPE" = xgcc; then - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - # On MacOSX we optimize for size, something - # we should do for all platforms? - C_O_FLAG_HIGHEST_JVM="-Os" - C_O_FLAG_HIGHEST="-Os" - C_O_FLAG_HI="-Os" - C_O_FLAG_NORM="-Os" - C_O_FLAG_SIZE="-Os" - else - C_O_FLAG_HIGHEST_JVM="-O3" - C_O_FLAG_HIGHEST="-O3" - C_O_FLAG_HI="-O3" - C_O_FLAG_NORM="-O2" - C_O_FLAG_SIZE="-Os" - fi - C_O_FLAG_DEBUG="-O0" - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - C_O_FLAG_DEBUG_JVM="" - elif test "x$OPENJDK_TARGET_OS" = xlinux; then - C_O_FLAG_DEBUG_JVM="-O0" - fi - C_O_FLAG_NONE="-O0" - elif test "x$TOOLCHAIN_TYPE" = xclang; then - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - # On MacOSX we optimize for size, something - # we should do for all platforms? - C_O_FLAG_HIGHEST_JVM="-Os" - C_O_FLAG_HIGHEST="-Os" - C_O_FLAG_HI="-Os" - C_O_FLAG_NORM="-Os" - C_O_FLAG_SIZE="-Os" - else - C_O_FLAG_HIGHEST_JVM="-O3" - C_O_FLAG_HIGHEST="-O3" - C_O_FLAG_HI="-O3" - C_O_FLAG_NORM="-O2" - C_O_FLAG_SIZE="-Os" - fi - C_O_FLAG_DEBUG="-O0" - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - C_O_FLAG_DEBUG_JVM="" - elif test "x$OPENJDK_TARGET_OS" = xlinux; then - C_O_FLAG_DEBUG_JVM="-O0" - fi - C_O_FLAG_NONE="-O0" - elif test "x$TOOLCHAIN_TYPE" = xxlc; then - C_O_FLAG_HIGHEST_JVM="-O3 -qhot=level=1 -qinline -qinlglue" - C_O_FLAG_HIGHEST="-O3 -qhot=level=1 -qinline -qinlglue" - C_O_FLAG_HI="-O3 -qinline -qinlglue" - C_O_FLAG_NORM="-O2" - C_O_FLAG_DEBUG="-qnoopt" - # FIXME: Value below not verified. - C_O_FLAG_DEBUG_JVM="" - C_O_FLAG_NONE="-qnoopt" - elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - C_O_FLAG_HIGHEST_JVM="-O2 -Oy-" - C_O_FLAG_HIGHEST="-O2" - C_O_FLAG_HI="-O1" - C_O_FLAG_NORM="-O1" - C_O_FLAG_DEBUG="-Od" - C_O_FLAG_DEBUG_JVM="" - C_O_FLAG_NONE="-Od" - C_O_FLAG_SIZE="-Os" - fi - CXX_O_FLAG_HIGHEST_JVM="$C_O_FLAG_HIGHEST_JVM" - CXX_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST" - CXX_O_FLAG_HI="$C_O_FLAG_HI" - CXX_O_FLAG_NORM="$C_O_FLAG_NORM" - CXX_O_FLAG_DEBUG="$C_O_FLAG_DEBUG" - CXX_O_FLAG_DEBUG_JVM="$C_O_FLAG_DEBUG_JVM" - CXX_O_FLAG_NONE="$C_O_FLAG_NONE" - CXX_O_FLAG_SIZE="$C_O_FLAG_SIZE" - fi - - # Adjust optimization flags according to debug level. - case $DEBUG_LEVEL in - release ) - # no adjustment - ;; - fastdebug ) - # Not quite so much optimization - C_O_FLAG_HI="$C_O_FLAG_NORM" - CXX_O_FLAG_HI="$CXX_O_FLAG_NORM" - ;; - slowdebug ) - # Disable optimization - C_O_FLAG_HIGHEST_JVM="$C_O_FLAG_DEBUG_JVM" - C_O_FLAG_HIGHEST="$C_O_FLAG_DEBUG" - C_O_FLAG_HI="$C_O_FLAG_DEBUG" - C_O_FLAG_NORM="$C_O_FLAG_DEBUG" - C_O_FLAG_SIZE="$C_O_FLAG_DEBUG" - CXX_O_FLAG_HIGHEST_JVM="$CXX_O_FLAG_DEBUG_JVM" - CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_DEBUG" - CXX_O_FLAG_HI="$CXX_O_FLAG_DEBUG" - CXX_O_FLAG_NORM="$CXX_O_FLAG_DEBUG" - CXX_O_FLAG_SIZE="$CXX_O_FLAG_DEBUG" - ;; - esac - - - - - - - - - - - - - - - - - - - - -# Check whether --with-abi-profile was given. -if test "${with_abi_profile+set}" = set; then : - withval=$with_abi_profile; -fi - - - if test "x$with_abi_profile" != x; then - if test "x$OPENJDK_TARGET_CPU" != xarm && \ - test "x$OPENJDK_TARGET_CPU" != xaarch64; then - as_fn_error $? "--with-abi-profile only available on arm/aarch64" "$LINENO" 5 - fi - - OPENJDK_TARGET_ABI_PROFILE=$with_abi_profile - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ABI profle" >&5 -$as_echo_n "checking for ABI profle... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPENJDK_TARGET_ABI_PROFILE" >&5 -$as_echo "$OPENJDK_TARGET_ABI_PROFILE" >&6; } - - if test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-sflt; then - ARM_FLOAT_TYPE=vfp-sflt - ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb' - elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-hflt; then - ARM_FLOAT_TYPE=vfp-hflt - ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb' - elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-sflt; then - ARM_FLOAT_TYPE=sflt - ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm' - elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv5-vfp-sflt; then - ARM_FLOAT_TYPE=vfp-sflt - ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm' - elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv6-vfp-hflt; then - ARM_FLOAT_TYPE=vfp-hflt - ARM_ARCH_TYPE_FLAGS='-march=armv6 -marm' - elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm64; then - # No special flags, just need to trigger setting JDK_ARCH_ABI_PROP_NAME - ARM_FLOAT_TYPE= - ARM_ARCH_TYPE_FLAGS= - elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xaarch64; then - # No special flags, just need to trigger setting JDK_ARCH_ABI_PROP_NAME - ARM_FLOAT_TYPE= - ARM_ARCH_TYPE_FLAGS= - else - as_fn_error $? "Invalid ABI profile: \"$OPENJDK_TARGET_ABI_PROFILE\"" "$LINENO" 5 - fi - - if test "x$ARM_FLOAT_TYPE" = xvfp-sflt; then - ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=softfp -mfpu=vfp -DFLOAT_ARCH=-vfp-sflt' - elif test "x$ARM_FLOAT_TYPE" = xvfp-hflt; then - ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=hard -mfpu=vfp -DFLOAT_ARCH=-vfp-hflt' - elif test "x$ARM_FLOAT_TYPE" = xsflt; then - ARM_FLOAT_TYPE_FLAGS='-msoft-float -mfpu=vfp' - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ARM_FLOAT_TYPE floating point flags" >&5 -$as_echo_n "checking for $ARM_FLOAT_TYPE floating point flags... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ARM_FLOAT_TYPE_FLAGS" >&5 -$as_echo "$ARM_FLOAT_TYPE_FLAGS" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for arch type flags" >&5 -$as_echo_n "checking for arch type flags... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ARM_ARCH_TYPE_FLAGS" >&5 -$as_echo "$ARM_ARCH_TYPE_FLAGS" >&6; } - - # Now set JDK_ARCH_ABI_PROP_NAME. This is equivalent to the last part of the - # autoconf target triplet. - JDK_ARCH_ABI_PROP_NAME=`$ECHO $OPENJDK_TARGET_AUTOCONF_NAME | $SED -e 's/.*-\([^-]*\)$/\1/'` - # Sanity check that it is a known ABI. - if test "x$JDK_ARCH_ABI_PROP_NAME" != xgnu && \ - test "x$JDK_ARCH_ABI_PROP_NAME" != xgnueabi && \ - test "x$JDK_ARCH_ABI_PROP_NAME" != xgnueabihf; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unknown autoconf target triplet ABI: \"$JDK_ARCH_ABI_PROP_NAME\"" >&5 -$as_echo "$as_me: WARNING: Unknown autoconf target triplet ABI: \"$JDK_ARCH_ABI_PROP_NAME\"" >&2;} - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ABI property name" >&5 -$as_echo_n "checking for ABI property name... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JDK_ARCH_ABI_PROP_NAME" >&5 -$as_echo "$JDK_ARCH_ABI_PROP_NAME" >&6; } - - - # Pass these on to the open part of configure as if they were set using - # --with-extra-c[xx]flags. - EXTRA_CFLAGS="$EXTRA_CFLAGS $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS" - EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS" - # Get rid of annoying "note: the mangling of 'va_list' has changed in GCC 4.4" - # FIXME: This should not really be set using extra_cflags. - if test "x$OPENJDK_TARGET_CPU" = xarm; then - EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-psabi" - EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -Wno-psabi" - fi - # Also add JDK_ARCH_ABI_PROP_NAME define, but only to CFLAGS. - EXTRA_CFLAGS="$EXTRA_CFLAGS -DJDK_ARCH_ABI_PROP_NAME='\"\$(JDK_ARCH_ABI_PROP_NAME)\"'" - # And pass the architecture flags to the linker as well - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS" - fi - - # When building with an abi profile, the name of that profile is appended on the - # bundle platform, which is used in bundle names. - if test "x$OPENJDK_TARGET_ABI_PROFILE" != x; then - OPENJDK_TARGET_BUNDLE_PLATFORM="$OPENJDK_TARGET_OS_BUNDLE-$OPENJDK_TARGET_ABI_PROFILE" - fi - - - # Optional POSIX functionality needed by the JVM - # - # Check if clock_gettime is available and in which library. This indicates - # availability of CLOCK_MONOTONIC for hotspot. But we don't need to link, so - # don't let it update LIBS. - save_LIBS="$LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 -$as_echo_n "checking for library containing clock_gettime... " >&6; } -if ${ac_cv_search_clock_gettime+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char clock_gettime (); -int -main () -{ -return clock_gettime (); - ; - return 0; -} -_ACEOF -for ac_lib in '' rt; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_search_clock_gettime=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_clock_gettime+:} false; then : - break -fi -done -if ${ac_cv_search_clock_gettime+:} false; then : - -else - ac_cv_search_clock_gettime=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 -$as_echo "$ac_cv_search_clock_gettime" >&6; } -ac_res=$ac_cv_search_clock_gettime -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - HAS_CLOCK_GETTIME=true -fi - - if test "x$LIBS" = "x-lrt "; then - CLOCK_GETTIME_IN_LIBRT=true - fi - LIBS="$save_LIBS" - - - # Special extras... - if test "x$TOOLCHAIN_TYPE" = xsolstudio; then - if test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then - CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -xregs=no%appl" - CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -xregs=no%appl" - fi - CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -errtags=yes -errfmt" - CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -errtags=yes -errfmt" - elif test "x$TOOLCHAIN_TYPE" = xxlc; then - CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt" - CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt" - elif test "x$TOOLCHAIN_TYPE" = xgcc; then - CXXSTD_CXXFLAG="-std=gnu++98" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Execute function body - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C++ compiler supports \"$CXXSTD_CXXFLAG -Werror\"" >&5 -$as_echo_n "checking if the C++ compiler supports \"$CXXSTD_CXXFLAG -Werror\"... " >&6; } - supports=yes - - saved_cxxflags="$CXXFLAGS" - CXXFLAGS="$CXXFLAG $CXXSTD_CXXFLAG -Werror" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int i; -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - -else - supports=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - CXXFLAGS="$saved_cxxflags" - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5 -$as_echo "$supports" >&6; } - if test "x$supports" = "xyes" ; then - : - - else - : - CXXSTD_CXXFLAG="" - fi - - - - - - - - - - - - - CXXFLAGS_JDK="${CXXFLAGS_JDK} ${CXXSTD_CXXFLAG}" - JVM_CFLAGS="${JVM_CFLAGS} ${CXXSTD_CXXFLAG}" - - fi - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__" - CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__" - fi - - CFLAGS_JDK="${CFLAGS_JDK} ${EXTRA_CFLAGS}" - CXXFLAGS_JDK="${CXXFLAGS_JDK} ${EXTRA_CXXFLAGS}" - LDFLAGS_JDK="${LDFLAGS_JDK} ${EXTRA_LDFLAGS}" - - ############################################################################### - # - # Now setup the CFLAGS and LDFLAGS for the JDK build. - # Later we will also have CFLAGS and LDFLAGS for the hotspot subrepo build. - # - - # Setup compiler/platform specific flags into - # CFLAGS_JDK - C Compiler flags - # CXXFLAGS_JDK - C++ Compiler flags - # COMMON_CCXXFLAGS_JDK - common to C and C++ - if test "x$TOOLCHAIN_TYPE" = xgcc; then - JVM_CFLAGS="$JVM_CFLAGS -D_GNU_SOURCE" - JVM_CFLAGS="$JVM_CFLAGS -D_REENTRANT" - JVM_CFLAGS="$JVM_CFLAGS -fcheck-new" - if test "x$OPENJDK_TARGET_CPU" = xx86; then - # Force compatibility with i586 on 32 bit intel platforms. - COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586" - JVM_CFLAGS="$JVM_CFLAGS -march=i586" - fi - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \ - -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" - case $OPENJDK_TARGET_CPU_ARCH in - arm ) - # on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing - CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" - COMMON_CCXXFLAGS_JDK="${COMMON_CCXXFLAGS_JDK} -fsigned-char" - ;; - ppc ) - # on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing - CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" - ;; - s390 ) - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer -mbackchain -march=z10" - CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" - ;; - * ) - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer" - CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" - ;; - esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Execute function body - - # Need to assign to a variable since m4 is blocked from modifying parts in []. - REFERENCE_VERSION=6 - - if [[ "$REFERENCE_VERSION" =~ (.*\.){4} ]] ; then - as_fn_error $? "Internal error: Cannot compare to 6, only four parts (W.X.Y.Z) is supported" "$LINENO" 5 - fi - - if [[ "$REFERENCE_VERSION" =~ [0-9]{6} ]] ; then - as_fn_error $? "Internal error: Cannot compare to 6, only parts < 99999 is supported" "$LINENO" 5 - fi - - # Version comparison method inspired by http://stackoverflow.com/a/24067243 - COMPARABLE_REFERENCE_VERSION=`$AWK -F. '{ printf("%05d%05d%05d%05d\n", $1, $2, $3, $4) }' <<< "$REFERENCE_VERSION"` - - if test $COMPARABLE_ACTUAL_VERSION -ge $COMPARABLE_REFERENCE_VERSION ; then - : - - # These flags are required for GCC 6 builds as undefined behaviour in OpenJDK code - # runs afoul of the more aggressive versions of these optimisations. - # Notably, value range propagation now assumes that the this pointer of C++ - # member functions is non-null. - NO_DELETE_NULL_POINTER_CHECKS_CFLAG="-fno-delete-null-pointer-checks" - NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse" - { $as_echo "$as_me:${as_lineno-$LINENO}: GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} and ${NO_LIFETIME_DSE_CFLAG}" >&5 -$as_echo "$as_me: GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} and ${NO_LIFETIME_DSE_CFLAG}" >&6;} - CFLAGS_JDK="$CFLAGS_JDK ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}" - JVM_CFLAGS="$JVM_CFLAGS ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}" - - else - : - - fi - - - - - - - - - - - - - - - elif test "x$TOOLCHAIN_TYPE" = xclang; then - JVM_CFLAGS="$JVM_CFLAGS -D_GNU_SOURCE" - - # Restrict the debug information created by Clang to avoid - # too big object files and speed the build up a little bit - # (see http://llvm.org/bugs/show_bug.cgi?id=7554) - JVM_CFLAGS="$JVM_CFLAGS -flimit-debug-info" - if test "x$OPENJDK_TARGET_OS" = xlinux; then - if test "x$OPENJDK_TARGET_CPU" = xx86; then - # Force compatibility with i586 on 32 bit intel platforms. - COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586" - JVM_CFLAGS="$JVM_CFLAGS -march=i586" - fi - JVM_CFLAGS="$JVM_CFLAGS -Wno-sometimes-uninitialized" - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \ - -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" - case $OPENJDK_TARGET_CPU_ARCH in - ppc ) - # on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing - CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" - ;; - * ) - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer" - CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" - ;; - esac - fi - elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then - JVM_CFLAGS="$JVM_CFLAGS -DSPARC_WORKS" - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS" - if test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB" - fi - - CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal" - CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX -norunpath -xnolib" - elif test "x$TOOLCHAIN_TYPE" = xxlc; then - JVM_CFLAGS="$JVM_CFLAGS -D_REENTRANT" - CFLAGS_JDK="$CFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" - CXXFLAGS_JDK="$CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" - elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK \ - -MD -Zc:wchar_t- -W3 -wd4800 \ - -DWIN32_LEAN_AND_MEAN \ - -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \ - -D_WINSOCK_DEPRECATED_NO_WARNINGS \ - -DWIN32 -DIAL" - if test "x$OPENJDK_TARGET_CPU" = xx86_64; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_AMD64_ -Damd64" - else - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_X86_ -Dx86" - fi - # If building with Visual Studio 2010, we can still use _STATIC_CPPLIB to - # avoid bundling msvcpNNN.dll. Doesn't work with newer versions of visual - # studio. - if test "x$TOOLCHAIN_VERSION" = "x2010"; then - STATIC_CPPLIB_FLAGS="-D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB" - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK $STATIC_CPPLIB_FLAGS" - JVM_CFLAGS="$JVM_CFLAGS $STATIC_CPPLIB_FLAGS" - fi - fi - - ############################################################################### - - # Adjust flags according to debug level. - case $DEBUG_LEVEL in - fastdebug | slowdebug ) - CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS $CFLAGS_DEBUG_OPTIONS" - CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS $CXXFLAGS_DEBUG_OPTIONS" - ;; - release ) - ;; - * ) - as_fn_error $? "Unrecognized \$DEBUG_LEVEL: $DEBUG_LEVEL" "$LINENO" 5 - ;; - esac - - # Set some common defines. These works for all compilers, but assume - # -D is universally accepted. - - # Setup endianness - if test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then - # The macro _LITTLE_ENDIAN needs to be defined the same to avoid the - # Sun C compiler warning message: warning: macro redefined: _LITTLE_ENDIAN - # (The Solaris X86 system defines this in file /usr/include/sys/isa_defs.h). - # Note: -Dmacro is the same as #define macro 1 - # -Dmacro= is the same as #define macro - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_LITTLE_ENDIAN=" - else - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_LITTLE_ENDIAN" - fi - else - # Same goes for _BIG_ENDIAN. Do we really need to set *ENDIAN on Solaris if they - # are defined in the system? - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_BIG_ENDIAN=" - else - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_BIG_ENDIAN" - fi - fi - - # Always enable optional macros for VM. - JVM_CFLAGS="$JVM_CFLAGS -D__STDC_FORMAT_MACROS" - JVM_CFLAGS="$JVM_CFLAGS -D__STDC_LIMIT_MACROS" - JVM_CFLAGS="$JVM_CFLAGS -D__STDC_CONSTANT_MACROS" - - # Setup target OS define. Use OS target name but in upper case. - OPENJDK_TARGET_OS_UPPERCASE=`$ECHO $OPENJDK_TARGET_OS | $TR 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D$OPENJDK_TARGET_OS_UPPERCASE" - - # Setup target CPU - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK \ - $OPENJDK_TARGET_ADD_LP64 \ - -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY" - - # Setup debug/release defines - if test "x$DEBUG_LEVEL" = xrelease; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DNDEBUG" - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DTRIMMED" - fi - else - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DDEBUG" - fi - - # Optional POSIX functionality needed by the VM - - if test "x$HAS_CLOCK_GETTIME" = "xtrue"; then - JVM_CFLAGS="$JVM_CFLAGS -DSUPPORTS_CLOCK_MONOTONIC" - if test "x$CLOCK_GETTIME_IN_LIBRT" = "xtrue"; then - JVM_CFLAGS="$JVM_CFLAGS -DNEEDS_LIBRT" - fi - fi - - - # Set some additional per-OS defines. - if test "x$OPENJDK_TARGET_OS" = xlinux; then - JVM_CFLAGS="$JVM_CFLAGS -DLINUX" - JVM_CFLAGS="$JVM_CFLAGS -pipe $PICFLAG -fno-rtti -fno-exceptions \ - -fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer" - elif test "x$OPENJDK_TARGET_OS" = xsolaris; then - JVM_CFLAGS="$JVM_CFLAGS -DSOLARIS" - JVM_CFLAGS="$JVM_CFLAGS -template=no%extdef -features=no%split_init \ - -D_Crun_inline_placement -library=stlport4 $PICFLAG -mt -features=no%except" - elif test "x$OPENJDK_TARGET_OS" = xmacosx; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT" - JVM_CFLAGS="$JVM_CFLAGS -D_ALLBSD_SOURCE" - JVM_CFLAGS="$JVM_CFLAGS -D_DARWIN_C_SOURCE -D_XOPEN_SOURCE" - JVM_CFLAGS="$JVM_CFLAGS -fno-rtti -fno-exceptions -fvisibility=hidden \ - -mno-omit-leaf-frame-pointer -mstack-alignment=16 -pipe -fno-strict-aliasing \ - -fno-omit-frame-pointer" - elif test "x$OPENJDK_TARGET_OS" = xaix; then - JVM_CFLAGS="$JVM_CFLAGS -DAIX" - JVM_CFLAGS="$JVM_CFLAGS -qtune=balanced \ - -qalias=noansi -qstrict -qtls=default -qlanglvl=c99vla \ - -qlanglvl=noredefmac -qnortti -qnoeh -qignerrno" - # We need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows. - # Hotspot now overflows its 64K TOC (currently only for slowdebug), - # so for slowdebug we build with '-qpic=large -bbigtoc'. - if test "x$DEBUG_LEVEL" = xslowdebug; then - JVM_CFLAGS="$JVM_CFLAGS -qpic=large" - fi - elif test "x$OPENJDK_TARGET_OS" = xbsd; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE" - elif test "x$OPENJDK_TARGET_OS" = xwindows; then - JVM_CFLAGS="$JVM_CFLAGS -D_WINDOWS -DWIN32 -D_JNI_IMPLEMENTATION_" - JVM_CFLAGS="$JVM_CFLAGS -nologo -W3 -MD -MP" - fi - - # Set some additional per-CPU defines. - if test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = xwindows-x86; then - JVM_CFLAGS="$JVM_CFLAGS -arch:IA32" - elif test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = xsolaris-sparcv9; then - JVM_CFLAGS="$JVM_CFLAGS -xarch=sparc" - elif test "x$OPENJDK_TARGET_CPU" = xppc64; then - if test "x$OPENJDK_TARGET_OS" = xlinux; then - JVM_CFLAGS="$JVM_CFLAGS -minsert-sched-nops=regroup_exact -mno-multiple -mno-string" - # fixes `relocation truncated to fit' error for gcc 4.1. - JVM_CFLAGS="$JVM_CFLAGS -mminimal-toc" - # Use ppc64 instructions, but schedule for power5 - JVM_CFLAGS="$JVM_CFLAGS -mcpu=powerpc64 -mtune=power5" - elif test "x$OPENJDK_TARGET_OS" = xaix; then - JVM_CFLAGS="$JVM_CFLAGS -qarch=ppc64" - fi - elif test "x$OPENJDK_TARGET_CPU" = xppc64le; then - if test "x$OPENJDK_TARGET_OS" = xlinux; then - JVM_CFLAGS="$JVM_CFLAGS -minsert-sched-nops=regroup_exact -mno-multiple -mno-string" - # Little endian machine uses ELFv2 ABI. - JVM_CFLAGS="$JVM_CFLAGS -DABI_ELFv2" - # Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI. - JVM_CFLAGS="$JVM_CFLAGS -mcpu=power8 -mtune=power8" - fi - elif test "x$OPENJDK_TARGET_CPU" = xs390x; then - if test "x$OPENJDK_TARGET_OS" = xlinux; then - JVM_CFLAGS="$JVM_CFLAGS -mbackchain -march=z10" - fi - fi - - if test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then - JVM_CFLAGS="$JVM_CFLAGS -DVM_LITTLE_ENDIAN" - fi - - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - if test "x$OPENJDK_TARGET_OS" != xsolaris && test "x$OPENJDK_TARGET_OS" != xaix; then - # Solaris does not have _LP64=1 in the old build. - # xlc on AIX defines _LP64=1 by default and issues a warning if we redefine it. - JVM_CFLAGS="$JVM_CFLAGS -D_LP64=1" - fi - fi - - # Set JVM_CFLAGS warning handling - if test "x$OPENJDK_TARGET_OS" = xlinux; then - JVM_CFLAGS="$JVM_CFLAGS -Wpointer-arith -Wsign-compare -Wunused-function \ - -Wunused-value -Woverloaded-virtual" - - if test "x$TOOLCHAIN_TYPE" = xgcc; then - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Execute function body - - # Need to assign to a variable since m4 is blocked from modifying parts in []. - REFERENCE_VERSION=4.8 - - if [[ "$REFERENCE_VERSION" =~ (.*\.){4} ]] ; then - as_fn_error $? "Internal error: Cannot compare to 4.8, only four parts (W.X.Y.Z) is supported" "$LINENO" 5 - fi - - if [[ "$REFERENCE_VERSION" =~ [0-9]{6} ]] ; then - as_fn_error $? "Internal error: Cannot compare to 4.8, only parts < 99999 is supported" "$LINENO" 5 - fi - - # Version comparison method inspired by http://stackoverflow.com/a/24067243 - COMPARABLE_REFERENCE_VERSION=`$AWK -F. '{ printf("%05d%05d%05d%05d\n", $1, $2, $3, $4) }' <<< "$REFERENCE_VERSION"` - - if test $COMPARABLE_ACTUAL_VERSION -ge $COMPARABLE_REFERENCE_VERSION ; then - : - - # These flags either do not work or give spurious warnings prior to gcc 4.8. - JVM_CFLAGS="$JVM_CFLAGS -Wno-format-zero-length -Wtype-limits -Wuninitialized" - - - else - : - - fi - - - - - - - - - - - - - - - fi - if ! [[ " $JVM_VARIANTS " =~ " zero " ]] ; then - # Non-zero builds have stricter warnings - JVM_CFLAGS="$JVM_CFLAGS -Wreturn-type -Wundef -Wformat=2" - else - if test "x$TOOLCHAIN_TYPE" = xclang; then - # Some versions of llvm do not like -Wundef - JVM_CFLAGS="$JVM_CFLAGS -Wno-undef" - fi - fi - elif test "x$OPENJDK_TARGET_OS" = xmacosx; then - JVM_CFLAGS="$JVM_CFLAGS -Wno-deprecated -Wpointer-arith \ - -Wsign-compare -Wundef -Wunused-function -Wformat=2" - fi - - # Additional macosx handling - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - # MACOSX_VERSION_MIN is the c++ and ld is -mmacosx-version-min argument. The expected - # format is X.Y.Z. It's hard-coded to the minimum OSX version on which the - # JDK can be built and makes the linked binaries compatible even if built on - # a newer version of the OS. - MACOSX_VERSION_MIN=10.7.0 - - - # Setting --with-macosx-version-max= makes it an error to build or - # link to macosx APIs that are newer than the given OS version. The expected - # format for is either nn.n.n or nn.nn.nn. See /usr/include/AvailabilityMacros.h. - -# Check whether --with-macosx-version-max was given. -if test "${with_macosx_version_max+set}" = set; then : - withval=$with_macosx_version_max; - if echo "$with_macosx_version_max" | $GREP -q "^[0-9][0-9]\.[0-9]\.[0-9]\$"; then - MACOSX_VERSION_MAX=$with_macosx_version_max - elif echo "$with_macosx_version_max" | $GREP -q "^[0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]\$"; then - MACOSX_VERSION_MAX=$with_macosx_version_max - elif test "x$with_macosx_version_max" = "xno"; then - # Use build system default - MACOSX_VERSION_MAX= - else - as_fn_error $? "osx version format must be nn.n.n or nn.nn.nn" "$LINENO" 5 - fi - -else - MACOSX_VERSION_MAX= - -fi - - - - # Let the flags variables get resolved in make for easier override on make - # command line. AvailabilityMacros.h versions have no dots, ex: 1070. - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK \ - -DMAC_OS_X_VERSION_MIN_REQUIRED=\$(subst .,,\$(MACOSX_VERSION_MIN)) \ - -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" - LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" - JVM_CFLAGS="$JVM_CFLAGS \ - -DMAC_OS_X_VERSION_MIN_REQUIRED=\$(subst .,,\$(MACOSX_VERSION_MIN)) \ - -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" - - if test -n "$MACOSX_VERSION_MAX"; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK \ - -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MAX))" - JVM_CFLAGS="$JVM_CFLAGS \ - -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MAX))" - fi - fi - - # Setup some hard coded includes - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK \ - -I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base \ - -I${TOPDIR}/src/java.base/share/native/include \ - -I${TOPDIR}/src/java.base/$OPENJDK_TARGET_OS/native/include \ - -I${TOPDIR}/src/java.base/$OPENJDK_TARGET_OS_TYPE/native/include \ - -I${TOPDIR}/src/java.base/share/native/libjava \ - -I${TOPDIR}/src/java.base/$OPENJDK_TARGET_OS_TYPE/native/libjava \ - -I${TOPDIR}/src/hotspot/share/include \ - -I${TOPDIR}/src/hotspot/os/${HOTSPOT_TARGET_OS_TYPE}/include" - - # The shared libraries are compiled using the picflag. - CFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK \ - $CFLAGS_JDK $EXTRA_CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA" - CXXFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK \ - $CXXFLAGS_JDK $EXTRA_CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA" - - # Executable flags - CFLAGS_JDKEXE="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK $EXTRA_CFLAGS_JDK" - CXXFLAGS_JDKEXE="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK $EXTRA_CXXFLAGS_JDK" - - - - - - - # Setup LDFLAGS et al. - # - - if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - LDFLAGS_MICROSOFT="-nologo -opt:ref" - LDFLAGS_JDK="$LDFLAGS_JDK $LDFLAGS_MICROSOFT -incremental:no" - JVM_LDFLAGS="$JVM_LDFLAGS $LDFLAGS_MICROSOFT -opt:icf,8 -subsystem:windows -base:0x8000000" - if test "x$OPENJDK_TARGET_CPU_BITS" = "x32"; then - LDFLAGS_SAFESH="-safeseh" - LDFLAGS_JDK="$LDFLAGS_JDK $LDFLAGS_SAFESH" - JVM_LDFLAGS="$JVM_LDFLAGS $LDFLAGS_SAFESH" - # NOTE: Old build added -machine. Probably not needed. - JVM_LDFLAGS="$JVM_LDFLAGS -machine:I386" - else - JVM_LDFLAGS="$JVM_LDFLAGS -machine:AMD64" - fi - elif test "x$TOOLCHAIN_TYPE" = xclang; then - JVM_LDFLAGS="$JVM_LDFLAGS -mno-omit-leaf-frame-pointer -mstack-alignment=16 -stdlib=libstdc++ -fPIC" - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - # FIXME: We should really generalize SET_SHARED_LIBRARY_ORIGIN instead. - JVM_LDFLAGS="$JVM_LDFLAGS -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/.." - fi - elif test "x$TOOLCHAIN_TYPE" = xgcc; then - # If this is a --hash-style=gnu system, use --hash-style=both, why? - # We have previously set HAS_GNU_HASH if this is the case - if test -n "$HAS_GNU_HASH"; then - LDFLAGS_HASH_STYLE="-Wl,--hash-style=both" - LDFLAGS_JDK="${LDFLAGS_JDK} $LDFLAGS_HASH_STYLE" - JVM_LDFLAGS="$JVM_LDFLAGS $LDFLAGS_HASH_STYLE" - fi - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - JVM_LDFLAGS="$JVM_LDFLAGS -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/.." - fi - if test "x$OPENJDK_TARGET_OS" = xlinux; then - # And since we now know that the linker is gnu, then add -z defs, to forbid - # undefined symbols in object files. - LDFLAGS_NO_UNDEF_SYM="-Wl,-z,defs" - LDFLAGS_JDK="${LDFLAGS_JDK} $LDFLAGS_NO_UNDEF_SYM" - JVM_LDFLAGS="$JVM_LDFLAGS $LDFLAGS_NO_UNDEF_SYM" - LDFLAGS_NO_EXEC_STACK="-Wl,-z,noexecstack" - JVM_LDFLAGS="$JVM_LDFLAGS $LDFLAGS_NO_EXEC_STACK" - if test "x$OPENJDK_TARGET_CPU" = xx86; then - JVM_LDFLAGS="$JVM_LDFLAGS -march=i586" - fi - case $DEBUG_LEVEL in - release ) - # tell linker to optimize libraries. - # Should this be supplied to the OSS linker as well? - LDFLAGS_DEBUGLEVEL_release="-Wl,-O1" - LDFLAGS_JDK="${LDFLAGS_JDK} $LDFLAGS_DEBUGLEVEL_release" - JVM_LDFLAGS="$JVM_LDFLAGS $LDFLAGS_DEBUGLEVEL_release" - if test "x$HAS_LINKER_RELRO" = "xtrue"; then - JVM_LDFLAGS="$JVM_LDFLAGS $LINKER_RELRO_FLAG" - fi - ;; - slowdebug ) - # Hotspot always let the linker optimize - JVM_LDFLAGS="$JVM_LDFLAGS -Wl,-O1" - if test "x$HAS_LINKER_NOW" = "xtrue"; then - # do relocations at load - LDFLAGS_JDK="$LDFLAGS_JDK $LINKER_NOW_FLAG" - LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK $LINKER_NOW_FLAG" - JVM_LDFLAGS="$JVM_LDFLAGS $LINKER_NOW_FLAG" - fi - if test "x$HAS_LINKER_RELRO" = "xtrue"; then - # mark relocations read only - LDFLAGS_JDK="$LDFLAGS_JDK $LINKER_RELRO_FLAG" - LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK $LINKER_RELRO_FLAG" - JVM_LDFLAGS="$JVM_LDFLAGS $LINKER_RELRO_FLAG" - fi - ;; - fastdebug ) - # Hotspot always let the linker optimize - JVM_LDFLAGS="$JVM_LDFLAGS -Wl,-O1" - if test "x$HAS_LINKER_RELRO" = "xtrue"; then - # mark relocations read only - LDFLAGS_JDK="$LDFLAGS_JDK $LINKER_RELRO_FLAG" - LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK $LINKER_RELRO_FLAG" - JVM_LDFLAGS="$JVM_LDFLAGS $LINKER_RELRO_FLAG" - fi - ;; - * ) - as_fn_error $? "Unrecognized \$DEBUG_LEVEL: $DEBUG_LEVEL" "$LINENO" 5 - ;; - esac - fi - elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then - LDFLAGS_SOLSTUDIO="-Wl,-z,defs" - LDFLAGS_JDK="$LDFLAGS_JDK $LDFLAGS_SOLSTUDIO -ztext" - LDFLAGS_CXX_SOLSTUDIO="-norunpath" - LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK $LDFLAGS_CXX_SOLSTUDIO -xnolib" - JVM_LDFLAGS="$JVM_LDFLAGS $LDFLAGS_SOLSTUDIO -library=%none -mt $LDFLAGS_CXX_SOLSTUDIO -z noversion" - if test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then - JVM_LDFLAGS="$JVM_LDFLAGS -xarch=sparc" - fi - elif test "x$TOOLCHAIN_TYPE" = xxlc; then - LDFLAGS_XLC="-b64 -brtl -bnolibpath -bexpall -bernotok -btextpsize:64K -bdatapsize:64K -bstackpsize:64K" - LDFLAGS_JDK="${LDFLAGS_JDK} $LDFLAGS_XLC" - JVM_LDFLAGS="$JVM_LDFLAGS $LDFLAGS_XLC" - # We need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows. - # Hotspot now overflows its 64K TOC (currently only for slowdebug), - # so for slowdebug we build with '-qpic=large -bbigtoc'. - if test "x$DEBUG_LEVEL" = xslowdebug; then - JVM_LDFLAGS="$JVM_LDFLAGS -bbigtoc" - fi - fi - - # Customize LDFLAGS for executables - - LDFLAGS_JDKEXE="${LDFLAGS_JDK}" - - if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then - LDFLAGS_STACK_SIZE=1048576 - else - LDFLAGS_STACK_SIZE=327680 - fi - LDFLAGS_JDKEXE="${LDFLAGS_JDKEXE} /STACK:$LDFLAGS_STACK_SIZE" - elif test "x$OPENJDK_TARGET_OS" = xlinux; then - LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Wl,--allow-shlib-undefined" - fi - - LDFLAGS_JDKEXE="${LDFLAGS_JDKEXE} ${EXTRA_LDFLAGS_JDK}" - - # Customize LDFLAGS for libs - LDFLAGS_JDKLIB="${LDFLAGS_JDK}" - - LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} ${SHARED_LIBRARY_FLAGS}" - LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} ${LDFLAGS_NO_EXEC_STACK}" - if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} \ - -libpath:${OUTPUTDIR}/support/modules_libs/java.base" - JDKLIB_LIBS="" - else - JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} \ - -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base" - - if test "xTARGET" = "xTARGET"; then - # On some platforms (mac) the linker warns about non existing -L dirs. - # For any of the variants server, client or minimal, the dir matches the - # variant name. The "main" variant should be used for linking. For the - # rest, the dir is just server. - if [[ " $JVM_VARIANTS " =~ " server " ]] || [[ " $JVM_VARIANTS " =~ " client " ]] \ - || [[ " $JVM_VARIANTS " =~ " minimal " ]] ; then - JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} \ - -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$JVM_VARIANT_MAIN" - else - JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} \ - -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/server" - fi - elif test "xTARGET" = "xBUILD"; then - # When building a buildjdk, it's always only the server variant - JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} \ - -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/server" - fi - - JDKLIB_LIBS="-ljava -ljvm" - if test "x$TOOLCHAIN_TYPE" = xsolstudio; then - JDKLIB_LIBS="$JDKLIB_LIBS -lc" - fi - - fi - -LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} ${JAVA_BASE_LDFLAGS}" - - # Set JVM_LIBS (per os) - if test "x$OPENJDK_TARGET_OS" = xlinux; then - JVM_LIBS="$JVM_LIBS -lm -ldl -lpthread" - elif test "x$OPENJDK_TARGET_OS" = xsolaris; then - # FIXME: This hard-coded path is not really proper. - if test "x$OPENJDK_TARGET_CPU" = xx86_64; then - SOLARIS_LIBM_LIBS="/usr/lib/amd64/libm.so.1" - elif test "x$OPENJDK_TARGET_CPU" = xsparcv9; then - SOLARIS_LIBM_LIBS="/usr/lib/sparcv9/libm.so.1" - fi - JVM_LIBS="$JVM_LIBS -lsocket -lsched -ldl $SOLARIS_LIBM_LIBS -lCrun \ - -lthread -ldoor -lc -ldemangle -lnsl -lrt" - elif test "x$OPENJDK_TARGET_OS" = xmacosx; then - JVM_LIBS="$JVM_LIBS -lm" - elif test "x$OPENJDK_TARGET_OS" = xaix; then - JVM_LIBS="$JVM_LIBS -Wl,-lC_r -lm -ldl -lpthread" - elif test "x$OPENJDK_TARGET_OS" = xbsd; then - JVM_LIBS="$JVM_LIBS -lm" - elif test "x$OPENJDK_TARGET_OS" = xwindows; then - JVM_LIBS="$JVM_LIBS kernel32.lib user32.lib gdi32.lib winspool.lib \ - comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib \ - wsock32.lib winmm.lib version.lib psapi.lib" - fi - - # Set JVM_ASFLAGS - if test "x$OPENJDK_TARGET_OS" = xlinux; then - if test "x$OPENJDK_TARGET_CPU" = xx86; then - JVM_ASFLAGS="$JVM_ASFLAGS -march=i586" - fi - elif test "x$OPENJDK_TARGET_OS" = xmacosx; then - JVM_ASFLAGS="$JVM_ASFLAGS -x assembler-with-cpp -mno-omit-leaf-frame-pointer -mstack-alignment=16" - fi - - LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} ${EXTRA_LDFLAGS_JDK}" - - - - - - - - - - - - - - - - - # Special extras... - if test "x$TOOLCHAIN_TYPE" = xsolstudio; then - if test "x$OPENJDK_BUILD_CPU_ARCH" = "xsparc"; then - OPENJDK_BUILD_CFLAGS_JDKLIB_EXTRA="${OPENJDK_BUILD_CFLAGS_JDKLIB_EXTRA} -xregs=no%appl" - OPENJDK_BUILD_CXXFLAGS_JDKLIB_EXTRA="${OPENJDK_BUILD_CXXFLAGS_JDKLIB_EXTRA} -xregs=no%appl" - fi - OPENJDK_BUILD_CFLAGS_JDKLIB_EXTRA="${OPENJDK_BUILD_CFLAGS_JDKLIB_EXTRA} -errtags=yes -errfmt" - OPENJDK_BUILD_CXXFLAGS_JDKLIB_EXTRA="${OPENJDK_BUILD_CXXFLAGS_JDKLIB_EXTRA} -errtags=yes -errfmt" - elif test "x$TOOLCHAIN_TYPE" = xxlc; then - OPENJDK_BUILD_CFLAGS_JDK="${OPENJDK_BUILD_CFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt" - OPENJDK_BUILD_CXXFLAGS_JDK="${OPENJDK_BUILD_CXXFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt" - elif test "x$TOOLCHAIN_TYPE" = xgcc; then - OPENJDK_BUILD_CXXSTD_CXXFLAG="-std=gnu++98" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Execute function body - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C++ compiler supports \"$OPENJDK_BUILD_CXXSTD_CXXFLAG -Werror\"" >&5 -$as_echo_n "checking if the C++ compiler supports \"$OPENJDK_BUILD_CXXSTD_CXXFLAG -Werror\"... " >&6; } - supports=yes - - saved_cxxflags="$CXXFLAGS" - CXXFLAGS="$CXXFLAG $OPENJDK_BUILD_CXXSTD_CXXFLAG -Werror" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int i; -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - -else - supports=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - CXXFLAGS="$saved_cxxflags" - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5 -$as_echo "$supports" >&6; } - if test "x$supports" = "xyes" ; then - : - - else - : - OPENJDK_BUILD_CXXSTD_CXXFLAG="" - fi - - - - - - - - - - - - - OPENJDK_BUILD_CXXFLAGS_JDK="${OPENJDK_BUILD_CXXFLAGS_JDK} ${OPENJDK_BUILD_CXXSTD_CXXFLAG}" - OPENJDK_BUILD_JVM_CFLAGS="${OPENJDK_BUILD_JVM_CFLAGS} ${OPENJDK_BUILD_CXXSTD_CXXFLAG}" - - fi - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - OPENJDK_BUILD_CFLAGS_JDK="${OPENJDK_BUILD_CFLAGS_JDK} -D__solaris__" - OPENJDK_BUILD_CXXFLAGS_JDK="${OPENJDK_BUILD_CXXFLAGS_JDK} -D__solaris__" - fi - - OPENJDK_BUILD_CFLAGS_JDK="${OPENJDK_BUILD_CFLAGS_JDK} ${OPENJDK_BUILD_EXTRA_CFLAGS}" - OPENJDK_BUILD_CXXFLAGS_JDK="${OPENJDK_BUILD_CXXFLAGS_JDK} ${OPENJDK_BUILD_EXTRA_CXXFLAGS}" - OPENJDK_BUILD_LDFLAGS_JDK="${OPENJDK_BUILD_LDFLAGS_JDK} ${OPENJDK_BUILD_EXTRA_LDFLAGS}" - - ############################################################################### - # - # Now setup the CFLAGS and LDFLAGS for the JDK build. - # Later we will also have CFLAGS and LDFLAGS for the hotspot subrepo build. - # - - # Setup compiler/platform specific flags into - # OPENJDK_BUILD_CFLAGS_JDK - C Compiler flags - # OPENJDK_BUILD_CXXFLAGS_JDK - C++ Compiler flags - # OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK - common to C and C++ - if test "x$TOOLCHAIN_TYPE" = xgcc; then - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -D_GNU_SOURCE" - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -D_REENTRANT" - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -fcheck-new" - if test "x$OPENJDK_BUILD_CPU" = xx86; then - # Force compatibility with i586 on 32 bit intel platforms. - OPENJDK_BUILD_COMMON_CCXXFLAGS="${OPENJDK_BUILD_COMMON_CCXXFLAGS} -march=i586" - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -march=i586" - fi - OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS $OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \ - -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" - case $OPENJDK_BUILD_CPU_ARCH in - arm ) - # on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing - OPENJDK_BUILD_CFLAGS_JDK="${OPENJDK_BUILD_CFLAGS_JDK} -fno-strict-aliasing" - OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="${OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK} -fsigned-char" - ;; - ppc ) - # on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing - OPENJDK_BUILD_CFLAGS_JDK="${OPENJDK_BUILD_CFLAGS_JDK} -fno-strict-aliasing" - ;; - s390 ) - OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer -mbackchain -march=z10" - OPENJDK_BUILD_CFLAGS_JDK="${OPENJDK_BUILD_CFLAGS_JDK} -fno-strict-aliasing" - ;; - * ) - OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer" - OPENJDK_BUILD_CFLAGS_JDK="${OPENJDK_BUILD_CFLAGS_JDK} -fno-strict-aliasing" - ;; - esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Execute function body - - # Need to assign to a variable since m4 is blocked from modifying parts in []. - REFERENCE_VERSION=6 - - if [[ "$REFERENCE_VERSION" =~ (.*\.){4} ]] ; then - as_fn_error $? "Internal error: Cannot compare to 6, only four parts (W.X.Y.Z) is supported" "$LINENO" 5 - fi - - if [[ "$REFERENCE_VERSION" =~ [0-9]{6} ]] ; then - as_fn_error $? "Internal error: Cannot compare to 6, only parts < 99999 is supported" "$LINENO" 5 - fi - - # Version comparison method inspired by http://stackoverflow.com/a/24067243 - COMPARABLE_REFERENCE_VERSION=`$AWK -F. '{ printf("%05d%05d%05d%05d\n", $1, $2, $3, $4) }' <<< "$REFERENCE_VERSION"` - - if test $OPENJDK_BUILD_COMPARABLE_ACTUAL_VERSION -ge $COMPARABLE_REFERENCE_VERSION ; then - : - - # These flags are required for GCC 6 builds as undefined behaviour in OpenJDK code - # runs afoul of the more aggressive versions of these optimisations. - # Notably, value range propagation now assumes that the this pointer of C++ - # member functions is non-null. - NO_DELETE_NULL_POINTER_CHECKS_CFLAG="-fno-delete-null-pointer-checks" - NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse" - { $as_echo "$as_me:${as_lineno-$LINENO}: GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} and ${NO_LIFETIME_DSE_CFLAG}" >&5 -$as_echo "$as_me: GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} and ${NO_LIFETIME_DSE_CFLAG}" >&6;} - OPENJDK_BUILD_CFLAGS_JDK="$OPENJDK_BUILD_CFLAGS_JDK ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}" - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}" - - else - : - - fi - - - - - - - - - - - - - - - elif test "x$TOOLCHAIN_TYPE" = xclang; then - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -D_GNU_SOURCE" - - # Restrict the debug information created by Clang to avoid - # too big object files and speed the build up a little bit - # (see http://llvm.org/bugs/show_bug.cgi?id=7554) - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -flimit-debug-info" - if test "x$OPENJDK_BUILD_OS" = xlinux; then - if test "x$OPENJDK_BUILD_CPU" = xx86; then - # Force compatibility with i586 on 32 bit intel platforms. - OPENJDK_BUILD_COMMON_CCXXFLAGS="${OPENJDK_BUILD_COMMON_CCXXFLAGS} -march=i586" - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -march=i586" - fi - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -Wno-sometimes-uninitialized" - OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS $OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \ - -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" - case $OPENJDK_BUILD_CPU_ARCH in - ppc ) - # on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing - OPENJDK_BUILD_CFLAGS_JDK="${OPENJDK_BUILD_CFLAGS_JDK} -fno-strict-aliasing" - ;; - * ) - OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer" - OPENJDK_BUILD_CFLAGS_JDK="${OPENJDK_BUILD_CFLAGS_JDK} -fno-strict-aliasing" - ;; - esac - fi - elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -DSPARC_WORKS" - OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS $OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS" - if test "x$OPENJDK_BUILD_CPU_ARCH" = xx86; then - OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_BUILD_CPU_LEGACY_LIB" - fi - - OPENJDK_BUILD_CFLAGS_JDK="$OPENJDK_BUILD_CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal" - OPENJDK_BUILD_CXXFLAGS_JDK="$OPENJDK_BUILD_CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX -norunpath -xnolib" - elif test "x$TOOLCHAIN_TYPE" = xxlc; then - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -D_REENTRANT" - OPENJDK_BUILD_CFLAGS_JDK="$OPENJDK_BUILD_CFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" - OPENJDK_BUILD_CXXFLAGS_JDK="$OPENJDK_BUILD_CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" - elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS $OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK \ - -MD -Zc:wchar_t- -W3 -wd4800 \ - -DWIN32_LEAN_AND_MEAN \ - -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \ - -D_WINSOCK_DEPRECATED_NO_WARNINGS \ - -DWIN32 -DIAL" - if test "x$OPENJDK_BUILD_CPU" = xx86_64; then - OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK -D_AMD64_ -Damd64" - else - OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK -D_X86_ -Dx86" - fi - # If building with Visual Studio 2010, we can still use _STATIC_CPPLIB to - # avoid bundling msvcpNNN.dll. Doesn't work with newer versions of visual - # studio. - if test "x$TOOLCHAIN_VERSION" = "x2010"; then - STATIC_CPPLIB_FLAGS="-D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB" - OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK $STATIC_CPPLIB_FLAGS" - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS $STATIC_CPPLIB_FLAGS" - fi - fi - - ############################################################################### - - # Adjust flags according to debug level. - case $DEBUG_LEVEL in - fastdebug | slowdebug ) - OPENJDK_BUILD_CFLAGS_JDK="$OPENJDK_BUILD_CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS $CFLAGS_DEBUG_OPTIONS" - OPENJDK_BUILD_CXXFLAGS_JDK="$OPENJDK_BUILD_CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS $CXXFLAGS_DEBUG_OPTIONS" - ;; - release ) - ;; - * ) - as_fn_error $? "Unrecognized \$DEBUG_LEVEL: $DEBUG_LEVEL" "$LINENO" 5 - ;; - esac - - # Set some common defines. These works for all compilers, but assume - # -D is universally accepted. - - # Setup endianness - if test "x$OPENJDK_BUILD_CPU_ENDIAN" = xlittle; then - # The macro _LITTLE_ENDIAN needs to be defined the same to avoid the - # Sun C compiler warning message: warning: macro redefined: _LITTLE_ENDIAN - # (The Solaris X86 system defines this in file /usr/include/sys/isa_defs.h). - # Note: -Dmacro is the same as #define macro 1 - # -Dmacro= is the same as #define macro - if test "x$OPENJDK_BUILD_OS" = xsolaris; then - OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK -D_LITTLE_ENDIAN=" - else - OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK -D_LITTLE_ENDIAN" - fi - else - # Same goes for _BIG_ENDIAN. Do we really need to set *ENDIAN on Solaris if they - # are defined in the system? - if test "x$OPENJDK_BUILD_OS" = xsolaris; then - OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK -D_BIG_ENDIAN=" - else - OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK -D_BIG_ENDIAN" - fi - fi - - # Always enable optional macros for VM. - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -D__STDC_FORMAT_MACROS" - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -D__STDC_LIMIT_MACROS" - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -D__STDC_CONSTANT_MACROS" - - # Setup target OS define. Use OS target name but in upper case. - OPENJDK_BUILD_OS_UPPERCASE=`$ECHO $OPENJDK_BUILD_OS | $TR 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK -D$OPENJDK_BUILD_OS_UPPERCASE" - - # Setup target CPU - OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK \ - $OPENJDK_BUILD_ADD_LP64 \ - -DARCH='\"$OPENJDK_BUILD_CPU_LEGACY\"' -D$OPENJDK_BUILD_CPU_LEGACY" - - # Setup debug/release defines - if test "x$DEBUG_LEVEL" = xrelease; then - OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK -DNDEBUG" - if test "x$OPENJDK_BUILD_OS" = xsolaris; then - OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK -DTRIMMED" - fi - else - OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK -DDEBUG" - fi - - # Optional POSIX functionality needed by the VM - - if test "x$HAS_CLOCK_GETTIME" = "xtrue"; then - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -DSUPPORTS_CLOCK_MONOTONIC" - if test "x$CLOCK_GETTIME_IN_LIBRT" = "xtrue"; then - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -DNEEDS_LIBRT" - fi - fi - - - # Set some additional per-OS defines. - if test "x$OPENJDK_BUILD_OS" = xlinux; then - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -DLINUX" - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -pipe $PICFLAG -fno-rtti -fno-exceptions \ - -fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer" - elif test "x$OPENJDK_BUILD_OS" = xsolaris; then - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -DSOLARIS" - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -template=no%extdef -features=no%split_init \ - -D_Crun_inline_placement -library=stlport4 $PICFLAG -mt -features=no%except" - elif test "x$OPENJDK_BUILD_OS" = xmacosx; then - OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT" - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -D_ALLBSD_SOURCE" - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -D_DARWIN_C_SOURCE -D_XOPEN_SOURCE" - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -fno-rtti -fno-exceptions -fvisibility=hidden \ - -mno-omit-leaf-frame-pointer -mstack-alignment=16 -pipe -fno-strict-aliasing \ - -fno-omit-frame-pointer" - elif test "x$OPENJDK_BUILD_OS" = xaix; then - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -DAIX" - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -qtune=balanced \ - -qalias=noansi -qstrict -qtls=default -qlanglvl=c99vla \ - -qlanglvl=noredefmac -qnortti -qnoeh -qignerrno" - # We need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows. - # Hotspot now overflows its 64K TOC (currently only for slowdebug), - # so for slowdebug we build with '-qpic=large -bbigtoc'. - if test "x$DEBUG_LEVEL" = xslowdebug; then - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -qpic=large" - fi - elif test "x$OPENJDK_BUILD_OS" = xbsd; then - OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE" - elif test "x$OPENJDK_BUILD_OS" = xwindows; then - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -D_WINDOWS -DWIN32 -D_JNI_IMPLEMENTATION_" - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -nologo -W3 -MD -MP" - fi - - # Set some additional per-CPU defines. - if test "x$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" = xwindows-x86; then - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -arch:IA32" - elif test "x$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" = xsolaris-sparcv9; then - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -xarch=sparc" - elif test "x$OPENJDK_BUILD_CPU" = xppc64; then - if test "x$OPENJDK_BUILD_OS" = xlinux; then - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -minsert-sched-nops=regroup_exact -mno-multiple -mno-string" - # fixes `relocation truncated to fit' error for gcc 4.1. - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -mminimal-toc" - # Use ppc64 instructions, but schedule for power5 - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -mcpu=powerpc64 -mtune=power5" - elif test "x$OPENJDK_BUILD_OS" = xaix; then - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -qarch=ppc64" - fi - elif test "x$OPENJDK_BUILD_CPU" = xppc64le; then - if test "x$OPENJDK_BUILD_OS" = xlinux; then - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -minsert-sched-nops=regroup_exact -mno-multiple -mno-string" - # Little endian machine uses ELFv2 ABI. - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -DABI_ELFv2" - # Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI. - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -mcpu=power8 -mtune=power8" - fi - elif test "x$OPENJDK_BUILD_CPU" = xs390x; then - if test "x$OPENJDK_BUILD_OS" = xlinux; then - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -mbackchain -march=z10" - fi - fi - - if test "x$OPENJDK_BUILD_CPU_ENDIAN" = xlittle; then - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -DVM_LITTLE_ENDIAN" - fi - - if test "x$OPENJDK_BUILD_CPU_BITS" = x64; then - if test "x$OPENJDK_BUILD_OS" != xsolaris && test "x$OPENJDK_BUILD_OS" != xaix; then - # Solaris does not have _LP64=1 in the old build. - # xlc on AIX defines _LP64=1 by default and issues a warning if we redefine it. - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -D_LP64=1" - fi - fi - - # Set OPENJDK_BUILD_JVM_CFLAGS warning handling - if test "x$OPENJDK_BUILD_OS" = xlinux; then - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -Wpointer-arith -Wsign-compare -Wunused-function \ - -Wunused-value -Woverloaded-virtual" - - if test "x$TOOLCHAIN_TYPE" = xgcc; then - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Execute function body - - # Need to assign to a variable since m4 is blocked from modifying parts in []. - REFERENCE_VERSION=4.8 - - if [[ "$REFERENCE_VERSION" =~ (.*\.){4} ]] ; then - as_fn_error $? "Internal error: Cannot compare to 4.8, only four parts (W.X.Y.Z) is supported" "$LINENO" 5 - fi - - if [[ "$REFERENCE_VERSION" =~ [0-9]{6} ]] ; then - as_fn_error $? "Internal error: Cannot compare to 4.8, only parts < 99999 is supported" "$LINENO" 5 - fi - - # Version comparison method inspired by http://stackoverflow.com/a/24067243 - COMPARABLE_REFERENCE_VERSION=`$AWK -F. '{ printf("%05d%05d%05d%05d\n", $1, $2, $3, $4) }' <<< "$REFERENCE_VERSION"` - - if test $OPENJDK_BUILD_COMPARABLE_ACTUAL_VERSION -ge $COMPARABLE_REFERENCE_VERSION ; then - : - - # These flags either do not work or give spurious warnings prior to gcc 4.8. - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -Wno-format-zero-length -Wtype-limits -Wuninitialized" - - - else - : - - fi - - - - - - - - - - - - - - - fi - if ! [[ " $JVM_VARIANTS " =~ " zero " ]] ; then - # Non-zero builds have stricter warnings - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -Wreturn-type -Wundef -Wformat=2" - else - if test "x$TOOLCHAIN_TYPE" = xclang; then - # Some versions of llvm do not like -Wundef - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -Wno-undef" - fi - fi - elif test "x$OPENJDK_BUILD_OS" = xmacosx; then - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -Wno-deprecated -Wpointer-arith \ - -Wsign-compare -Wundef -Wunused-function -Wformat=2" - fi - - # Additional macosx handling - if test "x$OPENJDK_BUILD_OS" = xmacosx; then - # MACOSX_VERSION_MIN is the c++ and ld is -mmacosx-version-min argument. The expected - # format is X.Y.Z. It's hard-coded to the minimum OSX version on which the - # JDK can be built and makes the linked binaries compatible even if built on - # a newer version of the OS. - MACOSX_VERSION_MIN=10.7.0 - - - # Setting --with-macosx-version-max= makes it an error to build or - # link to macosx APIs that are newer than the given OS version. The expected - # format for is either nn.n.n or nn.nn.nn. See /usr/include/AvailabilityMacros.h. - -# Check whether --with-macosx-version-max was given. -if test "${with_macosx_version_max+set}" = set; then : - withval=$with_macosx_version_max; - if echo "$with_macosx_version_max" | $GREP -q "^[0-9][0-9]\.[0-9]\.[0-9]\$"; then - MACOSX_VERSION_MAX=$with_macosx_version_max - elif echo "$with_macosx_version_max" | $GREP -q "^[0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]\$"; then - MACOSX_VERSION_MAX=$with_macosx_version_max - elif test "x$with_macosx_version_max" = "xno"; then - # Use build system default - MACOSX_VERSION_MAX= - else - as_fn_error $? "osx version format must be nn.n.n or nn.nn.nn" "$LINENO" 5 - fi - -else - MACOSX_VERSION_MAX= - -fi - - - - # Let the flags variables get resolved in make for easier override on make - # command line. AvailabilityMacros.h versions have no dots, ex: 1070. - OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK \ - -DMAC_OS_X_VERSION_MIN_REQUIRED=\$(subst .,,\$(MACOSX_VERSION_MIN)) \ - -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" - OPENJDK_BUILD_LDFLAGS_JDK="$OPENJDK_BUILD_LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS \ - -DMAC_OS_X_VERSION_MIN_REQUIRED=\$(subst .,,\$(MACOSX_VERSION_MIN)) \ - -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" - - if test -n "$MACOSX_VERSION_MAX"; then - OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK \ - -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MAX))" - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS \ - -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MAX))" - fi - fi - - # Setup some hard coded includes - OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK \ - -I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base \ - -I${TOPDIR}/src/java.base/share/native/include \ - -I${TOPDIR}/src/java.base/$OPENJDK_BUILD_OS/native/include \ - -I${TOPDIR}/src/java.base/$OPENJDK_BUILD_OS_TYPE/native/include \ - -I${TOPDIR}/src/java.base/share/native/libjava \ - -I${TOPDIR}/src/java.base/$OPENJDK_BUILD_OS_TYPE/native/libjava \ - -I${TOPDIR}/src/hotspot/share/include \ - -I${TOPDIR}/src/hotspot/os/${HOTSPOT_BUILD_OS_TYPE}/include" - - # The shared libraries are compiled using the picflag. - OPENJDK_BUILD_CFLAGS_JDKLIB="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK \ - $OPENJDK_BUILD_CFLAGS_JDK $OPENJDK_BUILD_EXTRA_CFLAGS_JDK $PICFLAG $OPENJDK_BUILD_CFLAGS_JDKLIB_EXTRA" - OPENJDK_BUILD_CXXFLAGS_JDKLIB="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK \ - $OPENJDK_BUILD_CXXFLAGS_JDK $OPENJDK_BUILD_EXTRA_CXXFLAGS_JDK $PICFLAG $OPENJDK_BUILD_CXXFLAGS_JDKLIB_EXTRA" - - # Executable flags - OPENJDK_BUILD_CFLAGS_JDKEXE="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK $OPENJDK_BUILD_CFLAGS_JDK $OPENJDK_BUILD_EXTRA_CFLAGS_JDK" - OPENJDK_BUILD_CXXFLAGS_JDKEXE="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK $OPENJDK_BUILD_CXXFLAGS_JDK $OPENJDK_BUILD_EXTRA_CXXFLAGS_JDK" - - - - - - - # Setup LDFLAGS et al. - # - - if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - LDFLAGS_MICROSOFT="-nologo -opt:ref" - OPENJDK_BUILD_LDFLAGS_JDK="$OPENJDK_BUILD_LDFLAGS_JDK $LDFLAGS_MICROSOFT -incremental:no" - OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS $LDFLAGS_MICROSOFT -opt:icf,8 -subsystem:windows -base:0x8000000" - if test "x$OPENJDK_BUILD_CPU_BITS" = "x32"; then - LDFLAGS_SAFESH="-safeseh" - OPENJDK_BUILD_LDFLAGS_JDK="$OPENJDK_BUILD_LDFLAGS_JDK $LDFLAGS_SAFESH" - OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS $LDFLAGS_SAFESH" - # NOTE: Old build added -machine. Probably not needed. - OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS -machine:I386" - else - OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS -machine:AMD64" - fi - elif test "x$TOOLCHAIN_TYPE" = xclang; then - OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS -mno-omit-leaf-frame-pointer -mstack-alignment=16 -stdlib=libstdc++ -fPIC" - if test "x$OPENJDK_BUILD_OS" = xmacosx; then - # FIXME: We should really generalize SET_SHARED_LIBRARY_ORIGIN instead. - OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/.." - fi - elif test "x$TOOLCHAIN_TYPE" = xgcc; then - # If this is a --hash-style=gnu system, use --hash-style=both, why? - # We have previously set HAS_GNU_HASH if this is the case - if test -n "$HAS_GNU_HASH"; then - OPENJDK_BUILD_LDFLAGS_HASH_STYLE="-Wl,--hash-style=both" - OPENJDK_BUILD_LDFLAGS_JDK="${OPENJDK_BUILD_LDFLAGS_JDK} $OPENJDK_BUILD_LDFLAGS_HASH_STYLE" - OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS $OPENJDK_BUILD_LDFLAGS_HASH_STYLE" - fi - if test "x$OPENJDK_BUILD_OS" = xmacosx; then - OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/.." - fi - if test "x$OPENJDK_BUILD_OS" = xlinux; then - # And since we now know that the linker is gnu, then add -z defs, to forbid - # undefined symbols in object files. - LDFLAGS_NO_UNDEF_SYM="-Wl,-z,defs" - OPENJDK_BUILD_LDFLAGS_JDK="${OPENJDK_BUILD_LDFLAGS_JDK} $LDFLAGS_NO_UNDEF_SYM" - OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS $LDFLAGS_NO_UNDEF_SYM" - LDFLAGS_NO_EXEC_STACK="-Wl,-z,noexecstack" - OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS $LDFLAGS_NO_EXEC_STACK" - if test "x$OPENJDK_BUILD_CPU" = xx86; then - OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS -march=i586" - fi - case $DEBUG_LEVEL in - release ) - # tell linker to optimize libraries. - # Should this be supplied to the OSS linker as well? - LDFLAGS_DEBUGLEVEL_release="-Wl,-O1" - OPENJDK_BUILD_LDFLAGS_JDK="${OPENJDK_BUILD_LDFLAGS_JDK} $LDFLAGS_DEBUGLEVEL_release" - OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS $LDFLAGS_DEBUGLEVEL_release" - if test "x$HAS_LINKER_RELRO" = "xtrue"; then - OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS $LINKER_RELRO_FLAG" - fi - ;; - slowdebug ) - # Hotspot always let the linker optimize - OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS -Wl,-O1" - if test "x$HAS_LINKER_NOW" = "xtrue"; then - # do relocations at load - OPENJDK_BUILD_LDFLAGS_JDK="$OPENJDK_BUILD_LDFLAGS_JDK $LINKER_NOW_FLAG" - OPENJDK_BUILD_LDFLAGS_CXX_JDK="$OPENJDK_BUILD_LDFLAGS_CXX_JDK $LINKER_NOW_FLAG" - OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS $LINKER_NOW_FLAG" - fi - if test "x$HAS_LINKER_RELRO" = "xtrue"; then - # mark relocations read only - OPENJDK_BUILD_LDFLAGS_JDK="$OPENJDK_BUILD_LDFLAGS_JDK $LINKER_RELRO_FLAG" - OPENJDK_BUILD_LDFLAGS_CXX_JDK="$OPENJDK_BUILD_LDFLAGS_CXX_JDK $LINKER_RELRO_FLAG" - OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS $LINKER_RELRO_FLAG" - fi - ;; - fastdebug ) - # Hotspot always let the linker optimize - OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS -Wl,-O1" - if test "x$HAS_LINKER_RELRO" = "xtrue"; then - # mark relocations read only - OPENJDK_BUILD_LDFLAGS_JDK="$OPENJDK_BUILD_LDFLAGS_JDK $LINKER_RELRO_FLAG" - OPENJDK_BUILD_LDFLAGS_CXX_JDK="$OPENJDK_BUILD_LDFLAGS_CXX_JDK $LINKER_RELRO_FLAG" - OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS $LINKER_RELRO_FLAG" - fi - ;; - * ) - as_fn_error $? "Unrecognized \$DEBUG_LEVEL: $DEBUG_LEVEL" "$LINENO" 5 - ;; - esac - fi - elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then - LDFLAGS_SOLSTUDIO="-Wl,-z,defs" - OPENJDK_BUILD_LDFLAGS_JDK="$OPENJDK_BUILD_LDFLAGS_JDK $LDFLAGS_SOLSTUDIO -ztext" - LDFLAGS_CXX_SOLSTUDIO="-norunpath" - OPENJDK_BUILD_LDFLAGS_CXX_JDK="$OPENJDK_BUILD_LDFLAGS_CXX_JDK $LDFLAGS_CXX_SOLSTUDIO -xnolib" - OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS $LDFLAGS_SOLSTUDIO -library=%none -mt $LDFLAGS_CXX_SOLSTUDIO -z noversion" - if test "x$OPENJDK_BUILD_CPU_ARCH" = "xsparc"; then - OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS -xarch=sparc" - fi - elif test "x$TOOLCHAIN_TYPE" = xxlc; then - LDFLAGS_XLC="-b64 -brtl -bnolibpath -bexpall -bernotok -btextpsize:64K -bdatapsize:64K -bstackpsize:64K" - OPENJDK_BUILD_LDFLAGS_JDK="${OPENJDK_BUILD_LDFLAGS_JDK} $LDFLAGS_XLC" - OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS $LDFLAGS_XLC" - # We need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows. - # Hotspot now overflows its 64K TOC (currently only for slowdebug), - # so for slowdebug we build with '-qpic=large -bbigtoc'. - if test "x$DEBUG_LEVEL" = xslowdebug; then - OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS -bbigtoc" - fi - fi - - # Customize LDFLAGS for executables - - OPENJDK_BUILD_LDFLAGS_JDKEXE="${OPENJDK_BUILD_LDFLAGS_JDK}" - - if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - if test "x$OPENJDK_BUILD_CPU_BITS" = "x64"; then - LDFLAGS_STACK_SIZE=1048576 - else - LDFLAGS_STACK_SIZE=327680 - fi - OPENJDK_BUILD_LDFLAGS_JDKEXE="${OPENJDK_BUILD_LDFLAGS_JDKEXE} /STACK:$LDFLAGS_STACK_SIZE" - elif test "x$OPENJDK_BUILD_OS" = xlinux; then - OPENJDK_BUILD_LDFLAGS_JDKEXE="$OPENJDK_BUILD_LDFLAGS_JDKEXE -Wl,--allow-shlib-undefined" - fi - - OPENJDK_BUILD_LDFLAGS_JDKEXE="${OPENJDK_BUILD_LDFLAGS_JDKEXE} ${OPENJDK_BUILD_EXTRA_LDFLAGS_JDK}" - - # Customize LDFLAGS for libs - OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDK}" - - OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} ${SHARED_LIBRARY_FLAGS}" - OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} ${LDFLAGS_NO_EXEC_STACK}" - if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} \ - -libpath:${OUTPUTDIR}/support/modules_libs/java.base" - OPENJDK_BUILD_JDKLIB_LIBS="" - else - OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} \ - -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base" - - if test "xBUILD" = "xTARGET"; then - # On some platforms (mac) the linker warns about non existing -L dirs. - # For any of the variants server, client or minimal, the dir matches the - # variant name. The "main" variant should be used for linking. For the - # rest, the dir is just server. - if [[ " $JVM_VARIANTS " =~ " server " ]] || [[ " $JVM_VARIANTS " =~ " client " ]] \ - || [[ " $JVM_VARIANTS " =~ " minimal " ]] ; then - OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} \ - -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$JVM_VARIANT_MAIN" - else - OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} \ - -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/server" - fi - elif test "xBUILD" = "xBUILD"; then - # When building a buildjdk, it's always only the server variant - OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} \ - -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/server" - fi - - OPENJDK_BUILD_JDKLIB_LIBS="-ljava -ljvm" - if test "x$TOOLCHAIN_TYPE" = xsolstudio; then - OPENJDK_BUILD_JDKLIB_LIBS="$OPENJDK_BUILD_JDKLIB_LIBS -lc" - fi - - fi - -OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} ${OPENJDK_BUILD_JAVA_BASE_LDFLAGS}" - - # Set OPENJDK_BUILD_JVM_LIBS (per os) - if test "x$OPENJDK_BUILD_OS" = xlinux; then - OPENJDK_BUILD_JVM_LIBS="$OPENJDK_BUILD_JVM_LIBS -lm -ldl -lpthread" - elif test "x$OPENJDK_BUILD_OS" = xsolaris; then - # FIXME: This hard-coded path is not really proper. - if test "x$OPENJDK_BUILD_CPU" = xx86_64; then - OPENJDK_BUILD_SOLARIS_LIBM_LIBS="/usr/lib/amd64/libm.so.1" - elif test "x$OPENJDK_BUILD_CPU" = xsparcv9; then - OPENJDK_BUILD_SOLARIS_LIBM_LIBS="/usr/lib/sparcv9/libm.so.1" - fi - OPENJDK_BUILD_JVM_LIBS="$OPENJDK_BUILD_JVM_LIBS -lsocket -lsched -ldl $SOLARIS_LIBM_LIBS -lCrun \ - -lthread -ldoor -lc -ldemangle -lnsl -lrt" - elif test "x$OPENJDK_BUILD_OS" = xmacosx; then - OPENJDK_BUILD_JVM_LIBS="$OPENJDK_BUILD_JVM_LIBS -lm" - elif test "x$OPENJDK_BUILD_OS" = xaix; then - OPENJDK_BUILD_JVM_LIBS="$OPENJDK_BUILD_JVM_LIBS -Wl,-lC_r -lm -ldl -lpthread" - elif test "x$OPENJDK_BUILD_OS" = xbsd; then - OPENJDK_BUILD_JVM_LIBS="$OPENJDK_BUILD_JVM_LIBS -lm" - elif test "x$OPENJDK_BUILD_OS" = xwindows; then - OPENJDK_BUILD_JVM_LIBS="$OPENJDK_BUILD_JVM_LIBS kernel32.lib user32.lib gdi32.lib winspool.lib \ - comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib \ - wsock32.lib winmm.lib version.lib psapi.lib" - fi - - # Set OPENJDK_BUILD_JVM_ASFLAGS - if test "x$OPENJDK_BUILD_OS" = xlinux; then - if test "x$OPENJDK_BUILD_CPU" = xx86; then - OPENJDK_BUILD_JVM_ASFLAGS="$OPENJDK_BUILD_JVM_ASFLAGS -march=i586" - fi - elif test "x$OPENJDK_BUILD_OS" = xmacosx; then - OPENJDK_BUILD_JVM_ASFLAGS="$OPENJDK_BUILD_JVM_ASFLAGS -x assembler-with-cpp -mno-omit-leaf-frame-pointer -mstack-alignment=16" - fi - - OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} ${OPENJDK_BUILD_EXTRA_LDFLAGS_JDK}" - - - - - - - - - - - - - - - - - # Tests are only ever compiled for TARGET - # Flags for compiling test libraries - CFLAGS_TESTLIB="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA" - CXXFLAGS_TESTLIB="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA" - - # Flags for compiling test executables - CFLAGS_TESTEXE="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK" - CXXFLAGS_TESTEXE="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK" - - - - - - - LDFLAGS_TESTLIB="$LDFLAGS_JDKLIB" - LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE $JAVA_BASE_LDFLAGS" - - - - - - - # Check that the compiler supports -mX (or -qX on AIX) flags - # Set COMPILER_SUPPORTS_TARGET_BITS_FLAG to 'true' if it does - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Execute function body - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Execute function body - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C compiler supports \"${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}\"" >&5 -$as_echo_n "checking if the C compiler supports \"${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}\"... " >&6; } - supports=yes - - saved_cflags="$CFLAGS" - CFLAGS="$CFLAGS ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int i; -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - supports=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - CFLAGS="$saved_cflags" - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5 -$as_echo "$supports" >&6; } - if test "x$supports" = "xyes" ; then - : - C_COMP_SUPPORTS="yes" - else - : - C_COMP_SUPPORTS="no" - fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Execute function body - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C++ compiler supports \"${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}\"" >&5 -$as_echo_n "checking if the C++ compiler supports \"${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}\"... " >&6; } - supports=yes - - saved_cxxflags="$CXXFLAGS" - CXXFLAGS="$CXXFLAG ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int i; -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - -else - supports=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - CXXFLAGS="$saved_cxxflags" - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5 -$as_echo "$supports" >&6; } - if test "x$supports" = "xyes" ; then - : - CXX_COMP_SUPPORTS="yes" - else - : - CXX_COMP_SUPPORTS="no" - fi - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if both compilers support \"${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}\"" >&5 -$as_echo_n "checking if both compilers support \"${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}\"... " >&6; } - supports=no - if test "x$C_COMP_SUPPORTS" = "xyes" -a "x$CXX_COMP_SUPPORTS" = "xyes"; then supports=yes; fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5 -$as_echo "$supports" >&6; } - if test "x$supports" = "xyes" ; then - : - COMPILER_SUPPORTS_TARGET_BITS_FLAG=true - else - : - COMPILER_SUPPORTS_TARGET_BITS_FLAG=false - fi - - - - - - - - - # Check whether --enable-warnings-as-errors was given. -if test "${enable_warnings_as_errors+set}" = set; then : - enableval=$enable_warnings_as_errors; -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if native warnings are errors" >&5 -$as_echo_n "checking if native warnings are errors... " >&6; } - if test "x$enable_warnings_as_errors" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (explicitly set)" >&5 -$as_echo "yes (explicitly set)" >&6; } - WARNINGS_AS_ERRORS=true - elif test "x$enable_warnings_as_errors" = "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - WARNINGS_AS_ERRORS=false - elif test "x$enable_warnings_as_errors" = "x"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 -$as_echo "yes (default)" >&6; } - WARNINGS_AS_ERRORS=true - else - as_fn_error $? "--enable-warnings-as-errors accepts no argument" "$LINENO" 5 - fi - - - - case "${TOOLCHAIN_TYPE}" in - microsoft) - DISABLE_WARNING_PREFIX="-wd" - CFLAGS_WARNINGS_ARE_ERRORS="-WX" - ;; - solstudio) - DISABLE_WARNING_PREFIX="-erroff=" - CFLAGS_WARNINGS_ARE_ERRORS="-errtags -errwarn=%all" - ;; - gcc) - # Prior to gcc 4.4, a -Wno-X where X is unknown for that version of gcc will cause an error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Execute function body - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Execute function body - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C compiler supports \"-Wno-this-is-a-warning-that-do-not-exist\"" >&5 -$as_echo_n "checking if the C compiler supports \"-Wno-this-is-a-warning-that-do-not-exist\"... " >&6; } - supports=yes - - saved_cflags="$CFLAGS" - CFLAGS="$CFLAGS -Wno-this-is-a-warning-that-do-not-exist" - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int i; -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - supports=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - CFLAGS="$saved_cflags" - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5 -$as_echo "$supports" >&6; } - if test "x$supports" = "xyes" ; then - : - C_COMP_SUPPORTS="yes" - else - : - C_COMP_SUPPORTS="no" - fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Execute function body - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C++ compiler supports \"-Wno-this-is-a-warning-that-do-not-exist\"" >&5 -$as_echo_n "checking if the C++ compiler supports \"-Wno-this-is-a-warning-that-do-not-exist\"... " >&6; } - supports=yes - - saved_cxxflags="$CXXFLAGS" - CXXFLAGS="$CXXFLAG -Wno-this-is-a-warning-that-do-not-exist" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int i; -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - -else - supports=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - CXXFLAGS="$saved_cxxflags" - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5 -$as_echo "$supports" >&6; } - if test "x$supports" = "xyes" ; then - : - CXX_COMP_SUPPORTS="yes" - else - : - CXX_COMP_SUPPORTS="no" - fi - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if both compilers support \"-Wno-this-is-a-warning-that-do-not-exist\"" >&5 -$as_echo_n "checking if both compilers support \"-Wno-this-is-a-warning-that-do-not-exist\"... " >&6; } - supports=no - if test "x$C_COMP_SUPPORTS" = "xyes" -a "x$CXX_COMP_SUPPORTS" = "xyes"; then supports=yes; fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5 -$as_echo "$supports" >&6; } - if test "x$supports" = "xyes" ; then - : - GCC_CAN_DISABLE_WARNINGS=true - else - : - GCC_CAN_DISABLE_WARNINGS=false - - fi - - - - - - - if test "x$GCC_CAN_DISABLE_WARNINGS" = "xtrue"; then - DISABLE_WARNING_PREFIX="-Wno-" - else - DISABLE_WARNING_PREFIX= - fi - CFLAGS_WARNINGS_ARE_ERRORS="-Werror" - # Repeate the check for the BUILD_CC and BUILD_CXX. Need to also reset - # CFLAGS since any target specific flags will likely not work with the - # build compiler - CC_OLD="$CC" - CXX_OLD="$CXX" - CC="$BUILD_CC" - CXX="$BUILD_CXX" - CFLAGS_OLD="$CFLAGS" - CFLAGS="" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Execute function body - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Execute function body - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C compiler supports \"-Wno-this-is-a-warning-that-do-not-exist\"" >&5 -$as_echo_n "checking if the C compiler supports \"-Wno-this-is-a-warning-that-do-not-exist\"... " >&6; } - supports=yes - - saved_cflags="$CFLAGS" - CFLAGS="$CFLAGS -Wno-this-is-a-warning-that-do-not-exist" - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int i; -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - supports=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - CFLAGS="$saved_cflags" - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5 -$as_echo "$supports" >&6; } - if test "x$supports" = "xyes" ; then - : - C_COMP_SUPPORTS="yes" - else - : - C_COMP_SUPPORTS="no" - fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Execute function body - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C++ compiler supports \"-Wno-this-is-a-warning-that-do-not-exist\"" >&5 -$as_echo_n "checking if the C++ compiler supports \"-Wno-this-is-a-warning-that-do-not-exist\"... " >&6; } - supports=yes - - saved_cxxflags="$CXXFLAGS" - CXXFLAGS="$CXXFLAG -Wno-this-is-a-warning-that-do-not-exist" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int i; -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - -else - supports=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - CXXFLAGS="$saved_cxxflags" - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5 -$as_echo "$supports" >&6; } - if test "x$supports" = "xyes" ; then - : - CXX_COMP_SUPPORTS="yes" - else - : - CXX_COMP_SUPPORTS="no" - fi - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if both compilers support \"-Wno-this-is-a-warning-that-do-not-exist\"" >&5 -$as_echo_n "checking if both compilers support \"-Wno-this-is-a-warning-that-do-not-exist\"... " >&6; } - supports=no - if test "x$C_COMP_SUPPORTS" = "xyes" -a "x$CXX_COMP_SUPPORTS" = "xyes"; then supports=yes; fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5 -$as_echo "$supports" >&6; } - if test "x$supports" = "xyes" ; then - : - BUILD_CC_CAN_DISABLE_WARNINGS=true - else - : - BUILD_CC_CAN_DISABLE_WARNINGS=false - - fi - - - - - - - if test "x$BUILD_CC_CAN_DISABLE_WARNINGS" = "xtrue"; then - BUILD_CC_DISABLE_WARNING_PREFIX="-Wno-" - else - BUILD_CC_DISABLE_WARNING_PREFIX= - fi - CC="$CC_OLD" - CXX="$CXX_OLD" - CFLAGS="$CFLAGS_OLD" - ;; - clang) - DISABLE_WARNING_PREFIX="-Wno-" - CFLAGS_WARNINGS_ARE_ERRORS="-Werror" - ;; - xlc) - DISABLE_WARNING_PREFIX="-qsuppress=" - CFLAGS_WARNINGS_ARE_ERRORS="-qhalt=w" - ;; - esac - - - - - -# Setup debug symbols (need objcopy from the toolchain for that) - - # - # NATIVE_DEBUG_SYMBOLS - # This must be done after the toolchain is setup, since we're looking at objcopy. - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking what type of native debug symbols to use" >&5 -$as_echo_n "checking what type of native debug symbols to use... " >&6; } - -# Check whether --with-native-debug-symbols was given. -if test "${with_native_debug_symbols+set}" = set; then : - withval=$with_native_debug_symbols; - if test "x$OPENJDK_TARGET_OS" = xaix; then - if test "x$withval" = xexternal || test "x$withval" = xzipped; then - as_fn_error $? "AIX only supports the parameters 'none' and 'internal' for --with-native-debug-symbols" "$LINENO" 5 - fi - fi - -else - - if test "x$OPENJDK_TARGET_OS" = xaix; then - # AIX doesn't support 'external' so use 'internal' as default - with_native_debug_symbols="internal" - else - if test "x$STATIC_BUILD" = xtrue; then - with_native_debug_symbols="none" - else - with_native_debug_symbols="external" - fi - fi - -fi - - NATIVE_DEBUG_SYMBOLS=$with_native_debug_symbols - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NATIVE_DEBUG_SYMBOLS" >&5 -$as_echo "$NATIVE_DEBUG_SYMBOLS" >&6; } - - if test "x$NATIVE_DEBUG_SYMBOLS" = xzipped; then - - if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then - if test "x$OBJCOPY" = x; then - # enabling of enable-debug-symbols and can't find objcopy - # this is an error - as_fn_error $? "Unable to find objcopy, cannot enable native debug symbols" "$LINENO" 5 - fi - fi - - COMPILE_WITH_DEBUG_SYMBOLS=true - COPY_DEBUG_SYMBOLS=true - ZIP_EXTERNAL_DEBUG_SYMBOLS=true - elif test "x$NATIVE_DEBUG_SYMBOLS" = xnone; then - COMPILE_WITH_DEBUG_SYMBOLS=false - COPY_DEBUG_SYMBOLS=false - ZIP_EXTERNAL_DEBUG_SYMBOLS=false - elif test "x$NATIVE_DEBUG_SYMBOLS" = xinternal; then - COMPILE_WITH_DEBUG_SYMBOLS=true - COPY_DEBUG_SYMBOLS=false - ZIP_EXTERNAL_DEBUG_SYMBOLS=false - elif test "x$NATIVE_DEBUG_SYMBOLS" = xexternal; then - - if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then - if test "x$OBJCOPY" = x; then - # enabling of enable-debug-symbols and can't find objcopy - # this is an error - as_fn_error $? "Unable to find objcopy, cannot enable native debug symbols" "$LINENO" 5 - fi - fi - - COMPILE_WITH_DEBUG_SYMBOLS=true - COPY_DEBUG_SYMBOLS=true - ZIP_EXTERNAL_DEBUG_SYMBOLS=false - else - as_fn_error $? "Allowed native debug symbols are: none, internal, external, zipped" "$LINENO" 5 - fi - - # --enable-debug-symbols is deprecated. - # Please use --with-native-debug-symbols=[internal,external,zipped] . - - # Check whether --enable-debug-symbols was given. -if test "${enable_debug_symbols+set}" = set; then : - enableval=$enable_debug_symbols; -fi - - if test "x$enable_debug_symbols" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --enable-debug-symbols is deprecated and will be ignored." >&5 -$as_echo "$as_me: WARNING: Option --enable-debug-symbols is deprecated and will be ignored." >&2;} - - if test "xPlease use --with-native-debug-symbols=[internal,external,zipped] ." != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Please use --with-native-debug-symbols=[internal,external,zipped] ." >&5 -$as_echo "$as_me: WARNING: Please use --with-native-debug-symbols=[internal,external,zipped] ." >&2;} - fi - - fi - - - # --enable-zip-debug-info is deprecated. - # Please use --with-native-debug-symbols=zipped . - - # Check whether --enable-zip-debug-info was given. -if test "${enable_zip_debug_info+set}" = set; then : - enableval=$enable_zip_debug_info; -fi - - if test "x$enable_zip_debug_info" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --enable-zip-debug-info is deprecated and will be ignored." >&5 -$as_echo "$as_me: WARNING: Option --enable-zip-debug-info is deprecated and will be ignored." >&2;} - - if test "xPlease use --with-native-debug-symbols=zipped ." != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Please use --with-native-debug-symbols=zipped ." >&5 -$as_echo "$as_me: WARNING: Please use --with-native-debug-symbols=zipped ." >&2;} - fi - - fi - - - - - - - - # Check whether --enable-native-coverage was given. -if test "${enable_native_coverage+set}" = set; then : - enableval=$enable_native_coverage; -fi - - GCOV_ENABLED="false" - if test "x$enable_native_coverage" = "xyes"; then - if test "x$TOOLCHAIN_TYPE" = "xgcc"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if native coverage is enabled" >&5 -$as_echo_n "checking if native coverage is enabled... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - GCOV_CFLAGS="-fprofile-arcs -ftest-coverage -fno-inline" - GCOV_LDFLAGS="-fprofile-arcs" - JVM_CFLAGS="$JVM_CFLAGS $GCOV_CFLAGS" - JVM_LDFLAGS="$JVM_LDFLAGS $GCOV_LDFLAGS" - CFLAGS_JDKLIB="$CFLAGS_JDKLIB $GCOV_CFLAGS" - CFLAGS_JDKEXE="$CFLAGS_JDKEXE $GCOV_CFLAGS" - CXXFLAGS_JDKLIB="$CXXFLAGS_JDKLIB $GCOV_CFLAGS" - CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE $GCOV_CFLAGS" - LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $GCOV_LDFLAGS" - LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $GCOV_LDFLAGS" - GCOV_ENABLED="true" - else - as_fn_error $? "--enable-native-coverage only works with toolchain type gcc" "$LINENO" 5 - fi - elif test "x$enable_native_coverage" = "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if native coverage is enabled" >&5 -$as_echo_n "checking if native coverage is enabled... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - elif test "x$enable_native_coverage" != "x"; then - as_fn_error $? "--enable-native-coverage can only be assigned \"yes\" or \"no\"" "$LINENO" 5 - fi - - - - -# AddressSanitizer - - # Check whether --enable-asan was given. -if test "${enable_asan+set}" = set; then : - enableval=$enable_asan; -fi - - ASAN_ENABLED="no" - if test "x$enable_asan" = "xyes"; then - case $TOOLCHAIN_TYPE in - gcc | clang) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if asan is enabled" >&5 -$as_echo_n "checking if asan is enabled... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ASAN_CFLAGS="-fsanitize=address -fno-omit-frame-pointer" - ASAN_LDFLAGS="-fsanitize=address" - JVM_CFLAGS="$JVM_CFLAGS $ASAN_CFLAGS" - JVM_LDFLAGS="$JVM_LDFLAGS $ASAN_LDFLAGS" - CFLAGS_JDKLIB="$CFLAGS_JDKLIB $ASAN_CFLAGS" - CFLAGS_JDKEXE="$CFLAGS_JDKEXE $ASAN_CFLAGS" - CXXFLAGS_JDKLIB="$CXXFLAGS_JDKLIB $ASAN_CFLAGS" - CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE $ASAN_CFLAGS" - LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $ASAN_LDFLAGS" - LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $ASAN_LDFLAGS" - ASAN_ENABLED="yes" - ;; - *) - as_fn_error $? "--enable-asan only works with toolchain type gcc or clang" "$LINENO" 5 - ;; - esac - elif test "x$enable_asan" = "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if asan is enabled" >&5 -$as_echo_n "checking if asan is enabled... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - elif test "x$enable_asan" != "x"; then - as_fn_error $? "--enable-asan can only be assigned \"yes\" or \"no\"" "$LINENO" 5 - fi - - - - -# Need toolchain to setup dtrace - - # Test for dtrace dependencies - # Check whether --enable-dtrace was given. -if test "${enable_dtrace+set}" = set; then : - enableval=$enable_dtrace; -fi - - - DTRACE_DEP_MISSING=false - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dtrace tool" >&5 -$as_echo_n "checking for dtrace tool... " >&6; } - if test "x$DTRACE" != "x" && test -x "$DTRACE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DTRACE" >&5 -$as_echo "$DTRACE" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found, cannot build dtrace" >&5 -$as_echo "not found, cannot build dtrace" >&6; } - DTRACE_DEP_MISSING=true - fi - - for ac_header in sys/sdt.h -do : - ac_fn_cxx_check_header_mongrel "$LINENO" "sys/sdt.h" "ac_cv_header_sys_sdt_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_sdt_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_SDT_H 1 -_ACEOF - DTRACE_HEADERS_OK=yes -else - DTRACE_HEADERS_OK=no -fi - -done - - if test "x$DTRACE_HEADERS_OK" != "xyes"; then - DTRACE_DEP_MISSING=true - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if dtrace should be built" >&5 -$as_echo_n "checking if dtrace should be built... " >&6; } - if test "x$enable_dtrace" = "xyes"; then - if test "x$DTRACE_DEP_MISSING" = "xtrue"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, missing dependencies" >&5 -$as_echo "no, missing dependencies" >&6; } - - # Print a helpful message on how to acquire the necessary build dependency. - # dtrace is the help tag: freetype, cups, alsa etc - MISSING_DEPENDENCY=dtrace - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - cygwin_help $MISSING_DEPENDENCY - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - msys_help $MISSING_DEPENDENCY - else - PKGHANDLER_COMMAND= - - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - brew) - brew_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - esac - - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." - fi - fi - - as_fn_error $? "Cannot enable dtrace with missing dependencies. See above. $HELP_MSG" "$LINENO" 5 - else - INCLUDE_DTRACE=true - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, forced" >&5 -$as_echo "yes, forced" >&6; } - fi - elif test "x$enable_dtrace" = "xno"; then - INCLUDE_DTRACE=false - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, forced" >&5 -$as_echo "no, forced" >&6; } - elif test "x$enable_dtrace" = "xauto" || test "x$enable_dtrace" = "x"; then - if test "x$DTRACE_DEP_MISSING" = "xtrue"; then - INCLUDE_DTRACE=false - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, missing dependencies" >&5 -$as_echo "no, missing dependencies" >&6; } - else - INCLUDE_DTRACE=true - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, dependencies present" >&5 -$as_echo "yes, dependencies present" >&6; } - fi - else - as_fn_error $? "Invalid value for --enable-dtrace: $enable_dtrace" "$LINENO" 5 - fi - - - # Check whether --enable-aot was given. -if test "${enable_aot+set}" = set; then : - enableval=$enable_aot; -fi - - - if test "x$enable_aot" = "x" || test "x$enable_aot" = "xauto"; then - ENABLE_AOT="true" - elif test "x$enable_aot" = "xyes"; then - ENABLE_AOT="true" - elif test "x$enable_aot" = "xno"; then - ENABLE_AOT="false" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if aot should be enabled" >&5 -$as_echo_n "checking if aot should be enabled... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, forced" >&5 -$as_echo "no, forced" >&6; } - else - as_fn_error $? "Invalid value for --enable-aot: $enable_aot" "$LINENO" 5 - fi - - if test "x$ENABLE_AOT" = "xtrue"; then - # Only enable AOT on X64 platforms. - if test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then - if test -e "${TOPDIR}/src/jdk.aot"; then - if test -e "${TOPDIR}/src/jdk.internal.vm.compiler"; then - ENABLE_AOT="true" - else - ENABLE_AOT="false" - if test "x$enable_aot" = "xyes"; then - as_fn_error $? "Cannot build AOT without src/jdk.internal.vm.compiler sources. Remove --enable-aot." "$LINENO" 5 - fi - fi - else - ENABLE_AOT="false" - if test "x$enable_aot" = "xyes"; then - as_fn_error $? "Cannot build AOT without src/jdk.aot sources. Remove --enable-aot." "$LINENO" 5 - fi - fi - else - ENABLE_AOT="false" - if test "x$enable_aot" = "xyes"; then - as_fn_error $? "AOT is currently only supported on x86_64. Remove --enable-aot." "$LINENO" 5 - fi - fi - fi - - - - - # Check whether --enable-cds was given. -if test "${enable_cds+set}" = set; then : - enableval=$enable_cds; -fi - - - if test "x$enable_cds" = "x" || test "x$enable_cds" = "xyes"; then - ENABLE_CDS="true" - elif test "x$enable_cds" = "xno"; then - ENABLE_CDS="false" - else - as_fn_error $? "Invalid value for --enable-cds: $enable_cds" "$LINENO" 5 - fi - - - - - # Check whether --enable-hotspot-gtest was given. -if test "${enable_hotspot_gtest+set}" = set; then : - enableval=$enable_hotspot_gtest; -fi - - - if test -e "${TOPDIR}/test/hotspot/gtest"; then - GTEST_DIR_EXISTS="true" - else - GTEST_DIR_EXISTS="false" - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Hotspot gtest unit tests should be built" >&5 -$as_echo_n "checking if Hotspot gtest unit tests should be built... " >&6; } - if test "x$enable_hotspot_gtest" = "xyes"; then - if test "x$GTEST_DIR_EXISTS" = "xtrue"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, forced" >&5 -$as_echo "yes, forced" >&6; } - BUILD_GTEST="true" - else - as_fn_error $? "Cannot build gtest without the test source" "$LINENO" 5 - fi - elif test "x$enable_hotspot_gtest" = "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, forced" >&5 -$as_echo "no, forced" >&6; } - BUILD_GTEST="false" - elif test "x$enable_hotspot_gtest" = "x"; then - if test "x$GTEST_DIR_EXISTS" = "xtrue"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - BUILD_GTEST="true" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - BUILD_GTEST="false" - fi - else - as_fn_error $? "--enable-gtest must be either yes or no" "$LINENO" 5 - fi - - - - -############################################################################### -# -# Check dependencies for external and internal libraries. -# -############################################################################### - -# After we have toolchain, we can compile fixpath. It's needed by the lib checks. - - # When using cygwin or msys, we need a wrapper binary that renames - # /cygdrive/c/ arguments into c:/ arguments and peeks into - # @files and rewrites these too! This wrapper binary is - # called fixpath. - FIXPATH= - if test "x$OPENJDK_BUILD_OS" = xwindows; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fixpath can be created" >&5 -$as_echo_n "checking if fixpath can be created... " >&6; } - FIXPATH_SRC="$TOPDIR/make/src/native/fixpath.c" - FIXPATH_BIN="$CONFIGURESUPPORT_OUTPUTDIR/bin/fixpath.exe" - FIXPATH_DIR="$CONFIGURESUPPORT_OUTPUTDIR/fixpath" - if test "x$OPENJDK_BUILD_OS_ENV" = xwindows.cygwin; then - # Important to keep the .exe suffix on Cygwin for Hotspot makefiles - FIXPATH="$FIXPATH_BIN -c" - elif test "x$OPENJDK_BUILD_OS_ENV" = xwindows.msys; then - # Take all collected prefixes and turn them into a -m/c/foo@/c/bar@... command line - # @ was chosen as separator to minimize risk of other tools messing around with it - all_unique_prefixes=`echo "${all_fixpath_prefixes[@]}" \ - | tr ' ' '\n' | $GREP '^/./' | $SORT | $UNIQ` - fixpath_argument_list=`echo $all_unique_prefixes | tr ' ' '@'` - FIXPATH="$FIXPATH_BIN -m$fixpath_argument_list" - fi - FIXPATH_SRC_W="$FIXPATH_SRC" - FIXPATH_BIN_W="$FIXPATH_BIN" - - unix_path="$FIXPATH_SRC_W" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - windows_path=`$CYGPATH -m "$unix_path"` - FIXPATH_SRC_W="$windows_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - windows_path=`cmd //c echo $unix_path` - FIXPATH_SRC_W="$windows_path" - fi - - - unix_path="$FIXPATH_BIN_W" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - windows_path=`$CYGPATH -m "$unix_path"` - FIXPATH_BIN_W="$windows_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - windows_path=`cmd //c echo $unix_path` - FIXPATH_BIN_W="$windows_path" - fi - - $RM -rf $FIXPATH_BIN $FIXPATH_DIR - $MKDIR -p $FIXPATH_DIR $CONFIGURESUPPORT_OUTPUTDIR/bin - cd $FIXPATH_DIR - $CC $FIXPATH_SRC_W -Fe$FIXPATH_BIN_W > $FIXPATH_DIR/fixpath1.log 2>&1 - cd $CURDIR - - if test ! -x $FIXPATH_BIN; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - cat $FIXPATH_DIR/fixpath1.log - as_fn_error $? "Could not create $FIXPATH_BIN" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fixpath.exe works" >&5 -$as_echo_n "checking if fixpath.exe works... " >&6; } - cd $FIXPATH_DIR - $FIXPATH $CC $FIXPATH_SRC -Fe$FIXPATH_DIR/fixpath2.exe \ - > $FIXPATH_DIR/fixpath2.log 2>&1 - cd $CURDIR - if test ! -x $FIXPATH_DIR/fixpath2.exe; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - cat $FIXPATH_DIR/fixpath2.log - as_fn_error $? "fixpath did not work!" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - FIXPATH_DETACH_FLAG="--detach" - fi - - - - - - - # Check if X11 is needed - if test "x$OPENJDK_TARGET_OS" = xwindows || test "x$OPENJDK_TARGET_OS" = xmacosx; then - # No X11 support on windows or macosx - NEEDS_LIB_X11=false - else - # All other instances need X11, even if building headless only, libawt still - # needs X11 headers. - NEEDS_LIB_X11=true - fi - - # Check if fontconfig is needed - if test "x$OPENJDK_TARGET_OS" = xwindows || test "x$OPENJDK_TARGET_OS" = xmacosx; then - # No fontconfig support on windows or macosx - NEEDS_LIB_FONTCONFIG=false - else - # All other instances need fontconfig, even if building headless only, - # libawt still needs fontconfig headers. - NEEDS_LIB_FONTCONFIG=true - fi - - # Check if cups is needed - if test "x$OPENJDK_TARGET_OS" = xwindows; then - # Windows have a separate print system - NEEDS_LIB_CUPS=false - else - NEEDS_LIB_CUPS=true - fi - - # A custom hook may have set this already - if test "x$NEEDS_LIB_FREETYPE" = "x"; then - NEEDS_LIB_FREETYPE=true - fi - - # Check if alsa is needed - if test "x$OPENJDK_TARGET_OS" = xlinux; then - NEEDS_LIB_ALSA=true - else - NEEDS_LIB_ALSA=false - fi - - # Check if ffi is needed - if [[ " $JVM_VARIANTS " =~ " zero " ]] ; then - NEEDS_LIB_FFI=true - else - NEEDS_LIB_FFI=false - fi - - - # statically link libstdc++ before C++ ABI is stablized on Linux unless - # dynamic build is configured on command line. - -# Check whether --with-stdc++lib was given. -if test "${with_stdc__lib+set}" = set; then : - withval=$with_stdc__lib; - if test "x$with_stdc__lib" != xdynamic && test "x$with_stdc__lib" != xstatic \ - && test "x$with_stdc__lib" != xdefault; then - as_fn_error $? "Bad parameter value --with-stdc++lib=$with_stdc__lib!" "$LINENO" 5 - fi - -else - with_stdc__lib=default - -fi - - - if test "x$OPENJDK_TARGET_OS" = xlinux; then - # Test if stdc++ can be linked statically. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if static link of stdc++ is possible" >&5 -$as_echo_n "checking if static link of stdc++ is possible... " >&6; } - STATIC_STDCXX_FLAGS="-static-libstdc++ -static-libgcc" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - OLD_LIBS="$LIBS" - LIBS="$STATIC_STDCXX_FLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - has_static_libstdcxx=yes -else - has_static_libstdcxx=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$OLD_LIBS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $has_static_libstdcxx" >&5 -$as_echo "$has_static_libstdcxx" >&6; } - - if test "x$with_stdc__lib" = xstatic && test "x$has_static_libstdcxx" = xno; then - as_fn_error $? "Static linking of libstdc++ was not possible!" "$LINENO" 5 - fi - - # If dynamic was requested, it's available since it would fail above otherwise. - # If dynamic wasn't requested, go with static unless it isn't available. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libstdc++" >&5 -$as_echo_n "checking how to link with libstdc++... " >&6; } - if test "x$with_stdc__lib" = xdynamic || test "x$has_static_libstdcxx" = xno ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: dynamic" >&5 -$as_echo "dynamic" >&6; } - else - LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS" - JVM_LDFLAGS="$JVM_LDFLAGS $STATIC_STDCXX_FLAGS" - # Ideally, we should test stdc++ for the BUILD toolchain separately. For now - # just use the same setting as for the TARGET toolchain. - OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS $STATIC_STDCXX_FLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5 -$as_echo "static" >&6; } - fi - fi - - # libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so) - if test "x$TOOLCHAIN_TYPE" = xsolstudio && test "x$LIBCXX" = x; then - LIBCXX="${SYSROOT}/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1" - fi - - - - # Setup Windows runtime dlls - if test "x$OPENJDK_TARGET_OS" = "xwindows"; then - - -# Check whether --with-msvcr-dll was given. -if test "${with_msvcr_dll+set}" = set; then : - withval=$with_msvcr_dll; -fi - - - if test "x$with_msvcr_dll" != x; then - # If given explicitly by user, do not probe. If not present, fail directly. - - DLL_NAME="$MSVCR_NAME" - POSSIBLE_MSVC_DLL="$with_msvcr_dll" - METHOD="--with-msvcr-dll" - if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5 -$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;} - - # Need to check if the found msvcr is correct architecture - { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5 -$as_echo_n "checking found $DLL_NAME architecture... " >&6; } - MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" - # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH="PE32 executable" - else - CORRECT_MSVCR_ARCH="PE32+ executable" - fi - else - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH=386 - else - CORRECT_MSVCR_ARCH=x86-64 - fi - fi - if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - MSVC_DLL="$POSSIBLE_MSVC_DLL" - - # Only process if variable expands to non-empty - - if test "x$MSVC_DLL" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$MSVC_DLL" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of MSVC_DLL" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$MSVC_DLL" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$MSVC_DLL" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of MSVC_DLL, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - MSVC_DLL="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - MSVC_DLL="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 -$as_echo_n "checking for $DLL_NAME... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5 -$as_echo "$MSVC_DLL" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 -$as_echo "incorrect, ignoring" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5 -$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;} - fi - fi - - if test "x$MSVC_DLL" = x; then - as_fn_error $? "Could not find a proper $MSVCR_NAME as specified by --with-msvcr-dll" "$LINENO" 5 - fi - MSVCR_DLL="$MSVC_DLL" - elif test "x$DEVKIT_MSVCR_DLL" != x; then - - DLL_NAME="$MSVCR_NAME" - POSSIBLE_MSVC_DLL="$DEVKIT_MSVCR_DLL" - METHOD="devkit" - if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5 -$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;} - - # Need to check if the found msvcr is correct architecture - { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5 -$as_echo_n "checking found $DLL_NAME architecture... " >&6; } - MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" - # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH="PE32 executable" - else - CORRECT_MSVCR_ARCH="PE32+ executable" - fi - else - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH=386 - else - CORRECT_MSVCR_ARCH=x86-64 - fi - fi - if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - MSVC_DLL="$POSSIBLE_MSVC_DLL" - - # Only process if variable expands to non-empty - - if test "x$MSVC_DLL" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$MSVC_DLL" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of MSVC_DLL" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$MSVC_DLL" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$MSVC_DLL" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of MSVC_DLL, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - MSVC_DLL="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - MSVC_DLL="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 -$as_echo_n "checking for $DLL_NAME... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5 -$as_echo "$MSVC_DLL" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 -$as_echo "incorrect, ignoring" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5 -$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;} - fi - fi - - if test "x$MSVC_DLL" = x; then - as_fn_error $? "Could not find a proper $MSVCR_NAME as specified by devkit" "$LINENO" 5 - fi - MSVCR_DLL="$MSVC_DLL" - else - - DLL_NAME="${MSVCR_NAME}" - MSVC_DLL= - - if test "x$MSVC_DLL" = x; then - # Probe: Using well-known location from Visual Studio 10.0 - if test "x$VCINSTALLDIR" != x; then - CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR" - - windows_path="$CYGWIN_VC_INSTALL_DIR" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - CYGWIN_VC_INSTALL_DIR="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - CYGWIN_VC_INSTALL_DIR="$unix_path" - fi - - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME" - else - POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME" - fi - $ECHO "POSSIBLE_MSVC_DLL $POSSIBLEMSVC_DLL" - - DLL_NAME="$DLL_NAME" - POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL" - METHOD="well-known location in VCINSTALLDIR" - if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5 -$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;} - - # Need to check if the found msvcr is correct architecture - { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5 -$as_echo_n "checking found $DLL_NAME architecture... " >&6; } - MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" - # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH="PE32 executable" - else - CORRECT_MSVCR_ARCH="PE32+ executable" - fi - else - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH=386 - else - CORRECT_MSVCR_ARCH=x86-64 - fi - fi - if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - MSVC_DLL="$POSSIBLE_MSVC_DLL" - - # Only process if variable expands to non-empty - - if test "x$MSVC_DLL" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$MSVC_DLL" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of MSVC_DLL" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$MSVC_DLL" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$MSVC_DLL" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of MSVC_DLL, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - MSVC_DLL="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - MSVC_DLL="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 -$as_echo_n "checking for $DLL_NAME... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5 -$as_echo "$MSVC_DLL" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 -$as_echo "incorrect, ignoring" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5 -$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;} - fi - fi - - fi - fi - - if test "x$MSVC_DLL" = x; then - # Probe: Check in the Boot JDK directory. - POSSIBLE_MSVC_DLL="$BOOT_JDK/bin/$DLL_NAME" - - DLL_NAME="$DLL_NAME" - POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL" - METHOD="well-known location in Boot JDK" - if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5 -$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;} - - # Need to check if the found msvcr is correct architecture - { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5 -$as_echo_n "checking found $DLL_NAME architecture... " >&6; } - MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" - # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH="PE32 executable" - else - CORRECT_MSVCR_ARCH="PE32+ executable" - fi - else - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH=386 - else - CORRECT_MSVCR_ARCH=x86-64 - fi - fi - if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - MSVC_DLL="$POSSIBLE_MSVC_DLL" - - # Only process if variable expands to non-empty - - if test "x$MSVC_DLL" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$MSVC_DLL" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of MSVC_DLL" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$MSVC_DLL" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$MSVC_DLL" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of MSVC_DLL, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - MSVC_DLL="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - MSVC_DLL="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 -$as_echo_n "checking for $DLL_NAME... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5 -$as_echo "$MSVC_DLL" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 -$as_echo "incorrect, ignoring" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5 -$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;} - fi - fi - - fi - - if test "x$MSVC_DLL" = x; then - # Probe: Look in the Windows system32 directory - CYGWIN_SYSTEMROOT="$SYSTEMROOT" - - windows_path="$CYGWIN_SYSTEMROOT" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - CYGWIN_SYSTEMROOT="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - CYGWIN_SYSTEMROOT="$unix_path" - fi - - POSSIBLE_MSVC_DLL="$CYGWIN_SYSTEMROOT/system32/$DLL_NAME" - - DLL_NAME="$DLL_NAME" - POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL" - METHOD="well-known location in SYSTEMROOT" - if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5 -$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;} - - # Need to check if the found msvcr is correct architecture - { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5 -$as_echo_n "checking found $DLL_NAME architecture... " >&6; } - MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" - # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH="PE32 executable" - else - CORRECT_MSVCR_ARCH="PE32+ executable" - fi - else - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH=386 - else - CORRECT_MSVCR_ARCH=x86-64 - fi - fi - if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - MSVC_DLL="$POSSIBLE_MSVC_DLL" - - # Only process if variable expands to non-empty - - if test "x$MSVC_DLL" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$MSVC_DLL" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of MSVC_DLL" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$MSVC_DLL" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$MSVC_DLL" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of MSVC_DLL, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - MSVC_DLL="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - MSVC_DLL="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 -$as_echo_n "checking for $DLL_NAME... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5 -$as_echo "$MSVC_DLL" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 -$as_echo "incorrect, ignoring" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5 -$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;} - fi - fi - - fi - - if test "x$MSVC_DLL" = x; then - # Probe: If Visual Studio Express is installed, there is usually one with the debugger - if test "x$VS100COMNTOOLS" != x; then - CYGWIN_VS_TOOLS_DIR="$VS100COMNTOOLS/.." - - windows_path="$CYGWIN_VS_TOOLS_DIR" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - CYGWIN_VS_TOOLS_DIR="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - CYGWIN_VS_TOOLS_DIR="$unix_path" - fi - - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \ - | $GREP -i /x64/ | $HEAD --lines 1` - else - POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \ - | $GREP -i /x86/ | $HEAD --lines 1` - fi - - DLL_NAME="$DLL_NAME" - POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL" - METHOD="search of VS100COMNTOOLS" - if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5 -$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;} - - # Need to check if the found msvcr is correct architecture - { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5 -$as_echo_n "checking found $DLL_NAME architecture... " >&6; } - MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" - # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH="PE32 executable" - else - CORRECT_MSVCR_ARCH="PE32+ executable" - fi - else - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH=386 - else - CORRECT_MSVCR_ARCH=x86-64 - fi - fi - if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - MSVC_DLL="$POSSIBLE_MSVC_DLL" - - # Only process if variable expands to non-empty - - if test "x$MSVC_DLL" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$MSVC_DLL" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of MSVC_DLL" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$MSVC_DLL" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$MSVC_DLL" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of MSVC_DLL, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - MSVC_DLL="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - MSVC_DLL="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 -$as_echo_n "checking for $DLL_NAME... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5 -$as_echo "$MSVC_DLL" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 -$as_echo "incorrect, ignoring" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5 -$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;} - fi - fi - - fi - fi - - if test "x$MSVC_DLL" = x; then - # Probe: Search wildly in the VCINSTALLDIR. We've probably lost by now. - # (This was the original behaviour; kept since it might turn something up) - if test "x$CYGWIN_VC_INSTALL_DIR" != x; then - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \ - | $GREP x64 | $HEAD --lines 1` - else - POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \ - | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1` - if test "x$POSSIBLE_MSVC_DLL" = x; then - # We're grasping at straws now... - POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \ - | $HEAD --lines 1` - fi - fi - - - DLL_NAME="$DLL_NAME" - POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL" - METHOD="search of VCINSTALLDIR" - if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5 -$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;} - - # Need to check if the found msvcr is correct architecture - { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5 -$as_echo_n "checking found $DLL_NAME architecture... " >&6; } - MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" - # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH="PE32 executable" - else - CORRECT_MSVCR_ARCH="PE32+ executable" - fi - else - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH=386 - else - CORRECT_MSVCR_ARCH=x86-64 - fi - fi - if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - MSVC_DLL="$POSSIBLE_MSVC_DLL" - - # Only process if variable expands to non-empty - - if test "x$MSVC_DLL" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$MSVC_DLL" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of MSVC_DLL" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$MSVC_DLL" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$MSVC_DLL" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of MSVC_DLL, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - MSVC_DLL="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - MSVC_DLL="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 -$as_echo_n "checking for $DLL_NAME... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5 -$as_echo "$MSVC_DLL" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 -$as_echo "incorrect, ignoring" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5 -$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;} - fi - fi - - fi - fi - - if test "x$MSVC_DLL" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 -$as_echo_n "checking for $DLL_NAME... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_fn_error $? "Could not find $DLL_NAME. Please specify using --with-msvcr-dll." "$LINENO" 5 - fi - - MSVCR_DLL="$MSVC_DLL" - fi - - - -# Check whether --with-msvcp-dll was given. -if test "${with_msvcp_dll+set}" = set; then : - withval=$with_msvcp_dll; -fi - - - if test "x$MSVCP_NAME" != "x"; then - if test "x$with_msvcp_dll" != x; then - # If given explicitly by user, do not probe. If not present, fail directly. - - DLL_NAME="$MSVCP_NAME" - POSSIBLE_MSVC_DLL="$with_msvcp_dll" - METHOD="--with-msvcp-dll" - if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5 -$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;} - - # Need to check if the found msvcr is correct architecture - { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5 -$as_echo_n "checking found $DLL_NAME architecture... " >&6; } - MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" - # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH="PE32 executable" - else - CORRECT_MSVCR_ARCH="PE32+ executable" - fi - else - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH=386 - else - CORRECT_MSVCR_ARCH=x86-64 - fi - fi - if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - MSVC_DLL="$POSSIBLE_MSVC_DLL" - - # Only process if variable expands to non-empty - - if test "x$MSVC_DLL" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$MSVC_DLL" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of MSVC_DLL" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$MSVC_DLL" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$MSVC_DLL" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of MSVC_DLL, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - MSVC_DLL="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - MSVC_DLL="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 -$as_echo_n "checking for $DLL_NAME... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5 -$as_echo "$MSVC_DLL" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 -$as_echo "incorrect, ignoring" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5 -$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;} - fi - fi - - if test "x$MSVC_DLL" = x; then - as_fn_error $? "Could not find a proper $MSVCP_NAME as specified by --with-msvcp-dll" "$LINENO" 5 - fi - MSVCP_DLL="$MSVC_DLL" - elif test "x$DEVKIT_MSVCP_DLL" != x; then - - DLL_NAME="$MSVCP_NAME" - POSSIBLE_MSVC_DLL="$DEVKIT_MSVCP_DLL" - METHOD="devkit" - if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5 -$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;} - - # Need to check if the found msvcr is correct architecture - { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5 -$as_echo_n "checking found $DLL_NAME architecture... " >&6; } - MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" - # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH="PE32 executable" - else - CORRECT_MSVCR_ARCH="PE32+ executable" - fi - else - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH=386 - else - CORRECT_MSVCR_ARCH=x86-64 - fi - fi - if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - MSVC_DLL="$POSSIBLE_MSVC_DLL" - - # Only process if variable expands to non-empty - - if test "x$MSVC_DLL" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$MSVC_DLL" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of MSVC_DLL" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$MSVC_DLL" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$MSVC_DLL" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of MSVC_DLL, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - MSVC_DLL="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - MSVC_DLL="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 -$as_echo_n "checking for $DLL_NAME... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5 -$as_echo "$MSVC_DLL" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 -$as_echo "incorrect, ignoring" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5 -$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;} - fi - fi - - if test "x$MSVC_DLL" = x; then - as_fn_error $? "Could not find a proper $MSVCP_NAME as specified by devkit" "$LINENO" 5 - fi - MSVCP_DLL="$MSVC_DLL" - else - - DLL_NAME="${MSVCP_NAME}" - MSVC_DLL= - - if test "x$MSVC_DLL" = x; then - # Probe: Using well-known location from Visual Studio 10.0 - if test "x$VCINSTALLDIR" != x; then - CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR" - - windows_path="$CYGWIN_VC_INSTALL_DIR" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - CYGWIN_VC_INSTALL_DIR="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - CYGWIN_VC_INSTALL_DIR="$unix_path" - fi - - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME" - else - POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME" - fi - $ECHO "POSSIBLE_MSVC_DLL $POSSIBLEMSVC_DLL" - - DLL_NAME="$DLL_NAME" - POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL" - METHOD="well-known location in VCINSTALLDIR" - if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5 -$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;} - - # Need to check if the found msvcr is correct architecture - { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5 -$as_echo_n "checking found $DLL_NAME architecture... " >&6; } - MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" - # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH="PE32 executable" - else - CORRECT_MSVCR_ARCH="PE32+ executable" - fi - else - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH=386 - else - CORRECT_MSVCR_ARCH=x86-64 - fi - fi - if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - MSVC_DLL="$POSSIBLE_MSVC_DLL" - - # Only process if variable expands to non-empty - - if test "x$MSVC_DLL" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$MSVC_DLL" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of MSVC_DLL" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$MSVC_DLL" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$MSVC_DLL" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of MSVC_DLL, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - MSVC_DLL="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - MSVC_DLL="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 -$as_echo_n "checking for $DLL_NAME... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5 -$as_echo "$MSVC_DLL" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 -$as_echo "incorrect, ignoring" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5 -$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;} - fi - fi - - fi - fi - - if test "x$MSVC_DLL" = x; then - # Probe: Check in the Boot JDK directory. - POSSIBLE_MSVC_DLL="$BOOT_JDK/bin/$DLL_NAME" - - DLL_NAME="$DLL_NAME" - POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL" - METHOD="well-known location in Boot JDK" - if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5 -$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;} - - # Need to check if the found msvcr is correct architecture - { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5 -$as_echo_n "checking found $DLL_NAME architecture... " >&6; } - MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" - # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH="PE32 executable" - else - CORRECT_MSVCR_ARCH="PE32+ executable" - fi - else - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH=386 - else - CORRECT_MSVCR_ARCH=x86-64 - fi - fi - if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - MSVC_DLL="$POSSIBLE_MSVC_DLL" - - # Only process if variable expands to non-empty - - if test "x$MSVC_DLL" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$MSVC_DLL" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of MSVC_DLL" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$MSVC_DLL" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$MSVC_DLL" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of MSVC_DLL, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - MSVC_DLL="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - MSVC_DLL="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 -$as_echo_n "checking for $DLL_NAME... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5 -$as_echo "$MSVC_DLL" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 -$as_echo "incorrect, ignoring" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5 -$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;} - fi - fi - - fi - - if test "x$MSVC_DLL" = x; then - # Probe: Look in the Windows system32 directory - CYGWIN_SYSTEMROOT="$SYSTEMROOT" - - windows_path="$CYGWIN_SYSTEMROOT" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - CYGWIN_SYSTEMROOT="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - CYGWIN_SYSTEMROOT="$unix_path" - fi - - POSSIBLE_MSVC_DLL="$CYGWIN_SYSTEMROOT/system32/$DLL_NAME" - - DLL_NAME="$DLL_NAME" - POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL" - METHOD="well-known location in SYSTEMROOT" - if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5 -$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;} - - # Need to check if the found msvcr is correct architecture - { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5 -$as_echo_n "checking found $DLL_NAME architecture... " >&6; } - MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" - # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH="PE32 executable" - else - CORRECT_MSVCR_ARCH="PE32+ executable" - fi - else - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH=386 - else - CORRECT_MSVCR_ARCH=x86-64 - fi - fi - if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - MSVC_DLL="$POSSIBLE_MSVC_DLL" - - # Only process if variable expands to non-empty - - if test "x$MSVC_DLL" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$MSVC_DLL" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of MSVC_DLL" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$MSVC_DLL" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$MSVC_DLL" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of MSVC_DLL, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - MSVC_DLL="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - MSVC_DLL="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 -$as_echo_n "checking for $DLL_NAME... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5 -$as_echo "$MSVC_DLL" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 -$as_echo "incorrect, ignoring" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5 -$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;} - fi - fi - - fi - - if test "x$MSVC_DLL" = x; then - # Probe: If Visual Studio Express is installed, there is usually one with the debugger - if test "x$VS100COMNTOOLS" != x; then - CYGWIN_VS_TOOLS_DIR="$VS100COMNTOOLS/.." - - windows_path="$CYGWIN_VS_TOOLS_DIR" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - CYGWIN_VS_TOOLS_DIR="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - CYGWIN_VS_TOOLS_DIR="$unix_path" - fi - - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \ - | $GREP -i /x64/ | $HEAD --lines 1` - else - POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \ - | $GREP -i /x86/ | $HEAD --lines 1` - fi - - DLL_NAME="$DLL_NAME" - POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL" - METHOD="search of VS100COMNTOOLS" - if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5 -$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;} - - # Need to check if the found msvcr is correct architecture - { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5 -$as_echo_n "checking found $DLL_NAME architecture... " >&6; } - MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" - # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH="PE32 executable" - else - CORRECT_MSVCR_ARCH="PE32+ executable" - fi - else - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH=386 - else - CORRECT_MSVCR_ARCH=x86-64 - fi - fi - if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - MSVC_DLL="$POSSIBLE_MSVC_DLL" - - # Only process if variable expands to non-empty - - if test "x$MSVC_DLL" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$MSVC_DLL" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of MSVC_DLL" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$MSVC_DLL" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$MSVC_DLL" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of MSVC_DLL, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - MSVC_DLL="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - MSVC_DLL="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 -$as_echo_n "checking for $DLL_NAME... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5 -$as_echo "$MSVC_DLL" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 -$as_echo "incorrect, ignoring" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5 -$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;} - fi - fi - - fi - fi - - if test "x$MSVC_DLL" = x; then - # Probe: Search wildly in the VCINSTALLDIR. We've probably lost by now. - # (This was the original behaviour; kept since it might turn something up) - if test "x$CYGWIN_VC_INSTALL_DIR" != x; then - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \ - | $GREP x64 | $HEAD --lines 1` - else - POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \ - | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1` - if test "x$POSSIBLE_MSVC_DLL" = x; then - # We're grasping at straws now... - POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \ - | $HEAD --lines 1` - fi - fi - - - DLL_NAME="$DLL_NAME" - POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL" - METHOD="search of VCINSTALLDIR" - if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5 -$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;} - - # Need to check if the found msvcr is correct architecture - { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5 -$as_echo_n "checking found $DLL_NAME architecture... " >&6; } - MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" - # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH="PE32 executable" - else - CORRECT_MSVCR_ARCH="PE32+ executable" - fi - else - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH=386 - else - CORRECT_MSVCR_ARCH=x86-64 - fi - fi - if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - MSVC_DLL="$POSSIBLE_MSVC_DLL" - - # Only process if variable expands to non-empty - - if test "x$MSVC_DLL" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$MSVC_DLL" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of MSVC_DLL" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$MSVC_DLL" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - MSVC_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVC_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVC_DLL to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$MSVC_DLL" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVC_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of MSVC_DLL, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - MSVC_DLL="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - MSVC_DLL="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 -$as_echo_n "checking for $DLL_NAME... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5 -$as_echo "$MSVC_DLL" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 -$as_echo "incorrect, ignoring" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5 -$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;} - fi - fi - - fi - fi - - if test "x$MSVC_DLL" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 -$as_echo_n "checking for $DLL_NAME... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_fn_error $? "Could not find $DLL_NAME. Please specify using --with-msvcr-dll." "$LINENO" 5 - fi - - MSVCP_DLL="$MSVC_DLL" - fi - - fi - - fi - - - if test "x$NEEDS_LIB_X11" = xfalse; then - if (test "x${with_x}" != x && test "x${with_x}" != xno); then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: X11 is not used, so --with-x is ignored" >&5 -$as_echo "$as_me: WARNING: X11 is not used, so --with-x is ignored" >&2;} - fi - X_CFLAGS= - X_LIBS= - else - - if test "x${with_x}" = xno; then - as_fn_error $? "It is not possible to disable the use of X11. Remove the --without-x option." "$LINENO" 5 - fi - - if test "x${with_x}" != x && test "x${with_x}" != xyes; then - # The user has specified a X11 base directory. Use it for includes and - # libraries, unless explicitly overridden. - if test "x$x_includes" = xNONE; then - x_includes="${with_x}/include" - fi - if test "x$x_libraries" = xNONE; then - x_libraries="${with_x}/lib" - fi - else - # Check if the user has specified sysroot, but not --with-x, --x-includes or --x-libraries. - # Make a simple check for the libraries at the sysroot, and setup --x-includes and - # --x-libraries for the sysroot, if that seems to be correct. - if test "x$SYSROOT" != "x"; then - if test "x$x_includes" = xNONE; then - if test -f "$SYSROOT/usr/X11R6/include/X11/Xlib.h"; then - x_includes="$SYSROOT/usr/X11R6/include" - elif test -f "$SYSROOT/usr/include/X11/Xlib.h"; then - x_includes="$SYSROOT/usr/include" - fi - fi - if test "x$x_libraries" = xNONE; then - if test -f "$SYSROOT/usr/X11R6/lib/libX11.so"; then - x_libraries="$SYSROOT/usr/X11R6/lib" - elif test -f "$SYSROOT/usr/lib64/libX11.so" && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - x_libraries="$SYSROOT/usr/lib64" - elif test -f "$SYSROOT/usr/lib/libX11.so"; then - x_libraries="$SYSROOT/usr/lib" - fi - fi - fi - fi - - # Now let autoconf do it's magic - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 -$as_echo_n "checking for X... " >&6; } - - -# Check whether --with-x was given. -if test "${with_x+set}" = set; then : - withval=$with_x; -fi - -# $have_x is `yes', `no', `disabled', or empty when we do not yet know. -if test "x$with_x" = xno; then - # The user explicitly disabled X. - have_x=disabled -else - case $x_includes,$x_libraries in #( - *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( - *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : - $as_echo_n "(cached) " >&6 -else - # One or both of the vars are not set, and there is no cached value. -ac_x_includes=no ac_x_libraries=no -rm -f -r conftest.dir -if mkdir conftest.dir; then - cd conftest.dir - cat >Imakefile <<'_ACEOF' -incroot: - @echo incroot='${INCROOT}' -usrlibdir: - @echo usrlibdir='${USRLIBDIR}' -libdir: - @echo libdir='${LIBDIR}' -_ACEOF - if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then - # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. - for ac_var in incroot usrlibdir libdir; do - eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" - done - # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. - for ac_extension in a so sl dylib la dll; do - if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && - test -f "$ac_im_libdir/libX11.$ac_extension"; then - ac_im_usrlibdir=$ac_im_libdir; break - fi - done - # Screen out bogus values from the imake configuration. They are - # bogus both because they are the default anyway, and because - # using them would break gcc on systems where it needs fixed includes. - case $ac_im_incroot in - /usr/include) ac_x_includes= ;; - *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; - esac - case $ac_im_usrlibdir in - /usr/lib | /usr/lib64 | /lib | /lib64) ;; - *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; - esac - fi - cd .. - rm -f -r conftest.dir -fi - -# Standard set of common directories for X headers. -# Check X11 before X11Rn because it is often a symlink to the current release. -ac_x_header_dirs=' -/usr/X11/include -/usr/X11R7/include -/usr/X11R6/include -/usr/X11R5/include -/usr/X11R4/include - -/usr/include/X11 -/usr/include/X11R7 -/usr/include/X11R6 -/usr/include/X11R5 -/usr/include/X11R4 - -/usr/local/X11/include -/usr/local/X11R7/include -/usr/local/X11R6/include -/usr/local/X11R5/include -/usr/local/X11R4/include - -/usr/local/include/X11 -/usr/local/include/X11R7 -/usr/local/include/X11R6 -/usr/local/include/X11R5 -/usr/local/include/X11R4 - -/usr/X386/include -/usr/x386/include -/usr/XFree86/include/X11 - -/usr/include -/usr/local/include -/usr/unsupported/include -/usr/athena/include -/usr/local/x11r5/include -/usr/lpp/Xamples/include - -/usr/openwin/include -/usr/openwin/share/include' - -if test "$ac_x_includes" = no; then - # Guess where to find include files, by looking for Xlib.h. - # First, try using that file with no special directory specified. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # We can compile using X headers with no special include directory. -ac_x_includes= -else - for ac_dir in $ac_x_header_dirs; do - if test -r "$ac_dir/X11/Xlib.h"; then - ac_x_includes=$ac_dir - break - fi -done -fi -rm -f conftest.err conftest.i conftest.$ac_ext -fi # $ac_x_includes = no - -if test "$ac_x_libraries" = no; then - # Check for the libraries. - # See if we find them without any special options. - # Don't add to $LIBS permanently. - ac_save_LIBS=$LIBS - LIBS="-lX11 $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -XrmInitialize () - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - LIBS=$ac_save_LIBS -# We can link X programs with no special library path. -ac_x_libraries= -else - LIBS=$ac_save_LIBS -for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` -do - # Don't even attempt the hair of trying to link an X program! - for ac_extension in a so sl dylib la dll; do - if test -r "$ac_dir/libX11.$ac_extension"; then - ac_x_libraries=$ac_dir - break 2 - fi - done -done -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi # $ac_x_libraries = no - -case $ac_x_includes,$ac_x_libraries in #( - no,* | *,no | *\'*) - # Didn't find X, or a directory has "'" in its name. - ac_cv_have_x="have_x=no";; #( - *) - # Record where we found X for the cache. - ac_cv_have_x="have_x=yes\ - ac_x_includes='$ac_x_includes'\ - ac_x_libraries='$ac_x_libraries'" -esac -fi -;; #( - *) have_x=yes;; - esac - eval "$ac_cv_have_x" -fi # $with_x != no - -if test "$have_x" != yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 -$as_echo "$have_x" >&6; } - no_x=yes -else - # If each of the values was on the command line, it overrides each guess. - test "x$x_includes" = xNONE && x_includes=$ac_x_includes - test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries - # Update the cache value to reflect the command line values. - ac_cv_have_x="have_x=yes\ - ac_x_includes='$x_includes'\ - ac_x_libraries='$x_libraries'" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 -$as_echo "libraries $x_libraries, headers $x_includes" >&6; } -fi - - if test "$no_x" = yes; then - # Not all programs may use this symbol, but it does not hurt to define it. - -$as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h - - X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= -else - if test -n "$x_includes"; then - X_CFLAGS="$X_CFLAGS -I$x_includes" - fi - - # It would also be nice to do this for all -L options, not just this one. - if test -n "$x_libraries"; then - X_LIBS="$X_LIBS -L$x_libraries" - # For Solaris; some versions of Sun CC require a space after -R and - # others require no space. Words are not sufficient . . . . - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5 -$as_echo_n "checking whether -R must be followed by a space... " >&6; } - ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" - ac_xsave_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - X_LIBS="$X_LIBS -R$x_libraries" -else - LIBS="$ac_xsave_LIBS -R $x_libraries" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - X_LIBS="$X_LIBS -R $x_libraries" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 -$as_echo "neither works" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ac_cxx_werror_flag=$ac_xsave_cxx_werror_flag - LIBS=$ac_xsave_LIBS - fi - - # Check for system-dependent libraries X programs must link with. - # Do this before checking for the system-independent R6 libraries - # (-lICE), since we may need -lsocket or whatever for X linking. - - if test "$ISC" = yes; then - X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" - else - # Martyn Johnson says this is needed for Ultrix, if the X - # libraries were built with DECnet support. And Karl Berry says - # the Alpha needs dnet_stub (dnet does not exist). - ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char XOpenDisplay (); -int -main () -{ -return XOpenDisplay (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 -$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } -if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldnet $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dnet_ntoa (); -int -main () -{ -return dnet_ntoa (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_dnet_dnet_ntoa=yes -else - ac_cv_lib_dnet_dnet_ntoa=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 -$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } -if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then : - X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" -fi - - if test $ac_cv_lib_dnet_dnet_ntoa = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 -$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } -if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldnet_stub $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dnet_ntoa (); -int -main () -{ -return dnet_ntoa (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_dnet_stub_dnet_ntoa=yes -else - ac_cv_lib_dnet_stub_dnet_ntoa=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 -$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } -if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then : - X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" -fi - - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$ac_xsave_LIBS" - - # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, - # to get the SysV transport functions. - # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) - # needs -lnsl. - # The nsl library prevents programs from opening the X display - # on Irix 5.2, according to T.E. Dickey. - # The functions gethostbyname, getservbyname, and inet_addr are - # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. - ac_fn_cxx_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" -if test "x$ac_cv_func_gethostbyname" = xyes; then : - -fi - - if test $ac_cv_func_gethostbyname = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 -$as_echo_n "checking for gethostbyname in -lnsl... " >&6; } -if ${ac_cv_lib_nsl_gethostbyname+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnsl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gethostbyname (); -int -main () -{ -return gethostbyname (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_nsl_gethostbyname=yes -else - ac_cv_lib_nsl_gethostbyname=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 -$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } -if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : - X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" -fi - - if test $ac_cv_lib_nsl_gethostbyname = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 -$as_echo_n "checking for gethostbyname in -lbsd... " >&6; } -if ${ac_cv_lib_bsd_gethostbyname+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lbsd $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gethostbyname (); -int -main () -{ -return gethostbyname (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_bsd_gethostbyname=yes -else - ac_cv_lib_bsd_gethostbyname=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 -$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } -if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then : - X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" -fi - - fi - fi - - # lieder@skyler.mavd.honeywell.com says without -lsocket, - # socket/setsockopt and other routines are undefined under SCO ODT - # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary - # on later versions), says Simon Leinen: it contains gethostby* - # variants that don't use the name server (or something). -lsocket - # must be given before -lnsl if both are needed. We assume that - # if connect needs -lnsl, so does gethostbyname. - ac_fn_cxx_check_func "$LINENO" "connect" "ac_cv_func_connect" -if test "x$ac_cv_func_connect" = xyes; then : - -fi - - if test $ac_cv_func_connect = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 -$as_echo_n "checking for connect in -lsocket... " >&6; } -if ${ac_cv_lib_socket_connect+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsocket $X_EXTRA_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char connect (); -int -main () -{ -return connect (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_socket_connect=yes -else - ac_cv_lib_socket_connect=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 -$as_echo "$ac_cv_lib_socket_connect" >&6; } -if test "x$ac_cv_lib_socket_connect" = xyes; then : - X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" -fi - - fi - - # Guillermo Gomez says -lposix is necessary on A/UX. - ac_fn_cxx_check_func "$LINENO" "remove" "ac_cv_func_remove" -if test "x$ac_cv_func_remove" = xyes; then : - -fi - - if test $ac_cv_func_remove = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 -$as_echo_n "checking for remove in -lposix... " >&6; } -if ${ac_cv_lib_posix_remove+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lposix $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char remove (); -int -main () -{ -return remove (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_posix_remove=yes -else - ac_cv_lib_posix_remove=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 -$as_echo "$ac_cv_lib_posix_remove" >&6; } -if test "x$ac_cv_lib_posix_remove" = xyes; then : - X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" -fi - - fi - - # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. - ac_fn_cxx_check_func "$LINENO" "shmat" "ac_cv_func_shmat" -if test "x$ac_cv_func_shmat" = xyes; then : - -fi - - if test $ac_cv_func_shmat = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 -$as_echo_n "checking for shmat in -lipc... " >&6; } -if ${ac_cv_lib_ipc_shmat+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lipc $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shmat (); -int -main () -{ -return shmat (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_ipc_shmat=yes -else - ac_cv_lib_ipc_shmat=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 -$as_echo "$ac_cv_lib_ipc_shmat" >&6; } -if test "x$ac_cv_lib_ipc_shmat" = xyes; then : - X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" -fi - - fi - fi - - # Check for libraries that X11R6 Xt/Xaw programs need. - ac_save_LDFLAGS=$LDFLAGS - test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" - # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to - # check for ICE first), but we must link in the order -lSM -lICE or - # we get undefined symbols. So assume we have SM if we have ICE. - # These have to be linked with before -lX11, unlike the other - # libraries we check for below, so use a different variable. - # John Interrante, Karl Berry - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 -$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } -if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lICE $X_EXTRA_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char IceConnectionNumber (); -int -main () -{ -return IceConnectionNumber (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_ICE_IceConnectionNumber=yes -else - ac_cv_lib_ICE_IceConnectionNumber=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 -$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } -if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then : - X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" -fi - - LDFLAGS=$ac_save_LDFLAGS - -fi - - - # AC_PATH_XTRA creates X_LIBS and sometimes adds -R flags. When cross compiling - # this doesn't make sense so we remove it. - if test "x$COMPILE_TYPE" = xcross; then - X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[^ ]*//g'` - fi - - if test "x$no_x" = xyes; then - - # Print a helpful message on how to acquire the necessary build dependency. - # x11 is the help tag: freetype, cups, alsa etc - MISSING_DEPENDENCY=x11 - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - cygwin_help $MISSING_DEPENDENCY - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - msys_help $MISSING_DEPENDENCY - else - PKGHANDLER_COMMAND= - - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - brew) - brew_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - esac - - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." - fi - fi - - as_fn_error $? "Could not find X11 libraries. $HELP_MSG" "$LINENO" 5 - fi - - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - OPENWIN_HOME="/usr/openwin" - X_CFLAGS="-I$SYSROOT$OPENWIN_HOME/include -I$SYSROOT$OPENWIN_HOME/include/X11/extensions" - X_LIBS="-L$SYSROOT$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR \ - -R$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR" - fi - - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - OLD_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $SYSROOT_CFLAGS $X_CFLAGS" - - # Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10 - for ac_header in X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h X11/Intrinsic.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " - # include - # include - - -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - X11_HEADERS_OK=yes -else - X11_HEADERS_OK=no; break -fi - -done - - - if test "x$X11_HEADERS_OK" = xno; then - - # Print a helpful message on how to acquire the necessary build dependency. - # x11 is the help tag: freetype, cups, alsa etc - MISSING_DEPENDENCY=x11 - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - cygwin_help $MISSING_DEPENDENCY - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - msys_help $MISSING_DEPENDENCY - else - PKGHANDLER_COMMAND= - - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - brew) - brew_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - esac - - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." - fi - fi - - as_fn_error $? "Could not find all X11 headers (shape.h Xrender.h XTest.h Intrinsic.h). $HELP_MSG" "$LINENO" 5 - fi - - # If XLinearGradient isn't available in Xrender.h, signal that it needs to be - # defined in libawt_xawt. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if XlinearGradient is defined in Xrender.h" >&5 -$as_echo_n "checking if XlinearGradient is defined in Xrender.h... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -XLinearGradient x; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - X_CFLAGS="$X_CFLAGS -DSOLARIS10_NO_XRENDER_STRUCTS" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - CFLAGS="$OLD_CFLAGS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - fi # NEEDS_LIB_X11 - - - - - - -# Check whether --with-cups was given. -if test "${with_cups+set}" = set; then : - withval=$with_cups; -fi - - -# Check whether --with-cups-include was given. -if test "${with_cups_include+set}" = set; then : - withval=$with_cups_include; -fi - - - if test "x$NEEDS_LIB_CUPS" = xfalse; then - if (test "x${with_cups}" != x && test "x${with_cups}" != xno) || \ - (test "x${with_cups_include}" != x && test "x${with_cups_include}" != xno); then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cups not used, so --with-cups[-*] is ignored" >&5 -$as_echo "$as_me: WARNING: cups not used, so --with-cups[-*] is ignored" >&2;} - fi - CUPS_CFLAGS= - else - CUPS_FOUND=no - - if test "x${with_cups}" = xno || test "x${with_cups_include}" = xno; then - as_fn_error $? "It is not possible to disable the use of cups. Remove the --without-cups option." "$LINENO" 5 - fi - - if test "x${with_cups}" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cups headers" >&5 -$as_echo_n "checking for cups headers... " >&6; } - if test -s "${with_cups}/include/cups/cups.h"; then - CUPS_CFLAGS="-I${with_cups}/include" - CUPS_FOUND=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUPS_FOUND" >&5 -$as_echo "$CUPS_FOUND" >&6; } - else - as_fn_error $? "Can't find 'include/cups/cups.h' under ${with_cups} given with the --with-cups option." "$LINENO" 5 - fi - fi - if test "x${with_cups_include}" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cups headers" >&5 -$as_echo_n "checking for cups headers... " >&6; } - if test -s "${with_cups_include}/cups/cups.h"; then - CUPS_CFLAGS="-I${with_cups_include}" - CUPS_FOUND=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUPS_FOUND" >&5 -$as_echo "$CUPS_FOUND" >&6; } - else - as_fn_error $? "Can't find 'cups/cups.h' under ${with_cups_include} given with the --with-cups-include option." "$LINENO" 5 - fi - fi - if test "x$CUPS_FOUND" = xno; then - # Are the cups headers installed in the default /usr/include location? - for ac_header in cups/cups.h cups/ppd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - - CUPS_FOUND=yes - CUPS_CFLAGS= - DEFAULT_CUPS=yes - -fi - -done - - fi - if test "x$CUPS_FOUND" = xno; then - - # Print a helpful message on how to acquire the necessary build dependency. - # cups is the help tag: freetype, cups, alsa etc - MISSING_DEPENDENCY=cups - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - cygwin_help $MISSING_DEPENDENCY - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - msys_help $MISSING_DEPENDENCY - else - PKGHANDLER_COMMAND= - - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - brew) - brew_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - esac - - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." - fi - fi - - as_fn_error $? "Could not find cups! $HELP_MSG " "$LINENO" 5 - fi - fi - - - - - -# Check whether --with-fontconfig was given. -if test "${with_fontconfig+set}" = set; then : - withval=$with_fontconfig; -fi - - -# Check whether --with-fontconfig-include was given. -if test "${with_fontconfig_include+set}" = set; then : - withval=$with_fontconfig_include; -fi - - - if test "x$NEEDS_LIB_FONTCONFIG" = xfalse; then - if (test "x${with_fontconfig}" != x && test "x${with_fontconfig}" != xno) || \ - (test "x${with_fontconfig_include}" != x && test "x${with_fontconfig_include}" != xno); then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: fontconfig not used, so --with-fontconfig[-*] is ignored" >&5 -$as_echo "$as_me: WARNING: fontconfig not used, so --with-fontconfig[-*] is ignored" >&2;} - fi - FONTCONFIG_CFLAGS= - else - FONTCONFIG_FOUND=no - - if test "x${with_fontconfig}" = xno || test "x${with_fontconfig_include}" = xno; then - as_fn_error $? "It is not possible to disable the use of fontconfig. Remove the --without-fontconfig option." "$LINENO" 5 - fi - - if test "x${with_fontconfig}" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fontconfig headers" >&5 -$as_echo_n "checking for fontconfig headers... " >&6; } - if test -s "${with_fontconfig}/include/fontconfig/fontconfig.h"; then - FONTCONFIG_CFLAGS="-I${with_fontconfig}/include" - FONTCONFIG_FOUND=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FONTCONFIG_FOUND" >&5 -$as_echo "$FONTCONFIG_FOUND" >&6; } - else - as_fn_error $? "Can't find 'include/fontconfig/fontconfig.h' under ${with_fontconfig} given with the --with-fontconfig option." "$LINENO" 5 - fi - fi - if test "x${with_fontconfig_include}" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fontconfig headers" >&5 -$as_echo_n "checking for fontconfig headers... " >&6; } - if test -s "${with_fontconfig_include}/fontconfig/fontconfig.h"; then - FONTCONFIG_CFLAGS="-I${with_fontconfig_include}" - FONTCONFIG_FOUND=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FONTCONFIG_FOUND" >&5 -$as_echo "$FONTCONFIG_FOUND" >&6; } - else - as_fn_error $? "Can't find 'fontconfig/fontconfig.h' under ${with_fontconfig_include} given with the --with-fontconfig-include option." "$LINENO" 5 - fi - fi - if test "x$FONTCONFIG_FOUND" = xno; then - # Are the fontconfig headers installed in the default /usr/include location? - for ac_header in fontconfig/fontconfig.h -do : - ac_fn_cxx_check_header_mongrel "$LINENO" "fontconfig/fontconfig.h" "ac_cv_header_fontconfig_fontconfig_h" "$ac_includes_default" -if test "x$ac_cv_header_fontconfig_fontconfig_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_FONTCONFIG_FONTCONFIG_H 1 -_ACEOF - - FONTCONFIG_FOUND=yes - FONTCONFIG_CFLAGS= - DEFAULT_FONTCONFIG=yes - -fi - -done - - fi - if test "x$FONTCONFIG_FOUND" = xno; then - - # Print a helpful message on how to acquire the necessary build dependency. - # fontconfig is the help tag: freetype, cups, alsa etc - MISSING_DEPENDENCY=fontconfig - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - cygwin_help $MISSING_DEPENDENCY - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - msys_help $MISSING_DEPENDENCY - else - PKGHANDLER_COMMAND= - - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - brew) - brew_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - esac - - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." - fi - fi - - as_fn_error $? "Could not find fontconfig! $HELP_MSG " "$LINENO" 5 - fi - fi - - - - - -# Check whether --with-freetype was given. -if test "${with_freetype+set}" = set; then : - withval=$with_freetype; -fi - - -# Check whether --with-freetype-include was given. -if test "${with_freetype_include+set}" = set; then : - withval=$with_freetype_include; -fi - - -# Check whether --with-freetype-lib was given. -if test "${with_freetype_lib+set}" = set; then : - withval=$with_freetype_lib; -fi - - -# Check whether --with-freetype-src was given. -if test "${with_freetype_src+set}" = set; then : - withval=$with_freetype_src; -fi - - # Check whether --enable-freetype-bundling was given. -if test "${enable_freetype_bundling+set}" = set; then : - enableval=$enable_freetype_bundling; -fi - - -# Check whether --with-freetype-license was given. -if test "${with_freetype_license+set}" = set; then : - withval=$with_freetype_license; -fi - - - # Need to specify explicitly since it needs to be overridden on some versions of macosx - FREETYPE_BASE_NAME=freetype - FREETYPE_CFLAGS= - FREETYPE_LIBS= - FREETYPE_BUNDLE_LIB_PATH= - - if test "x$NEEDS_LIB_FREETYPE" = xfalse; then - if (test "x$with_freetype" != x && test "x$with_freetype" != xno) || \ - (test "x$with_freetype_include" != x && test "x$with_freetype_include" != xno) || \ - (test "x$with_freetype_lib" != x && test "x$with_freetype_lib" != xno) || \ - (test "x$with_freetype_src" != x && test "x$with_freetype_src" != xno); then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: freetype not used, so --with-freetype[-*] is ignored" >&5 -$as_echo "$as_me: WARNING: freetype not used, so --with-freetype[-*] is ignored" >&2;} - fi - if (test "x$enable_freetype_bundling" != x && test "x$enable_freetype_bundling" != xno); then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: freetype not used, so --enable-freetype-bundling is ignored" >&5 -$as_echo "$as_me: WARNING: freetype not used, so --enable-freetype-bundling is ignored" >&2;} - fi - else - # freetype is needed to build; go get it! - - BUNDLE_FREETYPE="$enable_freetype_bundling" - - if test "x$with_freetype_src" != x; then - if test "x$OPENJDK_TARGET_OS" = xwindows; then - # Try to build freetype if --with-freetype-src was given on Windows - - FREETYPE_SRC_PATH="$with_freetype_src" - BUILD_FREETYPE=yes - - # Check if the freetype sources are acessible.. - if ! test -d $FREETYPE_SRC_PATH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-freetype-src specified, but can not find path \"$FREETYPE_SRC_PATH\" - ignoring --with-freetype-src" >&5 -$as_echo "$as_me: WARNING: --with-freetype-src specified, but can not find path \"$FREETYPE_SRC_PATH\" - ignoring --with-freetype-src" >&2;} - BUILD_FREETYPE=no - fi - # ..and contain a vc2010 project file - vcxproj_path="$FREETYPE_SRC_PATH/builds/windows/vc2010/freetype.vcxproj" - if test "x$BUILD_FREETYPE" = xyes && ! test -s $vcxproj_path; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can not find project file $vcxproj_path (you may try a newer freetype version) - ignoring --with-freetype-src" >&5 -$as_echo "$as_me: WARNING: Can not find project file $vcxproj_path (you may try a newer freetype version) - ignoring --with-freetype-src" >&2;} - BUILD_FREETYPE=no - fi - # Now check if configure found a version of 'msbuild.exe' - if test "x$BUILD_FREETYPE" = xyes && test "x$MSBUILD" == x ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can not find an msbuild.exe executable (you may try to install .NET 4.0) - ignoring --with-freetype-src" >&5 -$as_echo "$as_me: WARNING: Can not find an msbuild.exe executable (you may try to install .NET 4.0) - ignoring --with-freetype-src" >&2;} - BUILD_FREETYPE=no - fi - - # Ready to go.. - if test "x$BUILD_FREETYPE" = xyes; then - # msbuild requires trailing slashes for output directories - freetype_lib_path="$FREETYPE_SRC_PATH/lib$OPENJDK_TARGET_CPU_BITS/" - freetype_lib_path_unix="$freetype_lib_path" - freetype_obj_path="$FREETYPE_SRC_PATH/obj$OPENJDK_TARGET_CPU_BITS/" - - unix_path="$vcxproj_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - windows_path=`$CYGPATH -m "$unix_path"` - vcxproj_path="$windows_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - windows_path=`cmd //c echo $unix_path` - vcxproj_path="$windows_path" - fi - - - unix_path="$freetype_lib_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - windows_path=`$CYGPATH -m "$unix_path"` - freetype_lib_path="$windows_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - windows_path=`cmd //c echo $unix_path` - freetype_lib_path="$windows_path" - fi - - - unix_path="$freetype_obj_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - windows_path=`$CYGPATH -m "$unix_path"` - freetype_obj_path="$windows_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - windows_path=`cmd //c echo $unix_path` - freetype_obj_path="$windows_path" - fi - - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - freetype_platform=x64 - else - freetype_platform=win32 - fi - - # The original freetype project file is for VS 2010 (i.e. 'v100'), - # so we have to adapt the toolset if building with any other toolsed (i.e. SDK). - # Currently 'PLATFORM_TOOLSET' is set in 'TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT'/ - # 'TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT' in toolchain_windows.m4 - { $as_echo "$as_me:${as_lineno-$LINENO}: Trying to compile freetype sources with PlatformToolset=$PLATFORM_TOOLSET to $freetype_lib_path_unix ..." >&5 -$as_echo "$as_me: Trying to compile freetype sources with PlatformToolset=$PLATFORM_TOOLSET to $freetype_lib_path_unix ..." >&6;} - - # First we try to build the freetype.dll - $ECHO -e "@echo off\n"\ - "$MSBUILD $vcxproj_path "\ - "/p:PlatformToolset=$PLATFORM_TOOLSET "\ - "/p:Configuration=\"Release Multithreaded\" "\ - "/p:Platform=$freetype_platform "\ - "/p:ConfigurationType=DynamicLibrary "\ - "/p:TargetName=freetype "\ - "/p:OutDir=\"$freetype_lib_path\" "\ - "/p:IntDir=\"$freetype_obj_path\" > freetype.log" > freetype.bat - cmd /c freetype.bat - - if test -s "$freetype_lib_path_unix/freetype.dll"; then - # If that succeeds we also build freetype.lib - $ECHO -e "@echo off\n"\ - "$MSBUILD $vcxproj_path "\ - "/p:PlatformToolset=$PLATFORM_TOOLSET "\ - "/p:Configuration=\"Release Multithreaded\" "\ - "/p:Platform=$freetype_platform "\ - "/p:ConfigurationType=StaticLibrary "\ - "/p:TargetName=freetype "\ - "/p:OutDir=\"$freetype_lib_path\" "\ - "/p:IntDir=\"$freetype_obj_path\" >> freetype.log" > freetype.bat - cmd /c freetype.bat - - if test -s "$freetype_lib_path_unix/freetype.lib"; then - # Once we build both, lib and dll, set freetype lib and include path appropriately - POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_SRC_PATH/include" - POTENTIAL_FREETYPE_LIB_PATH="$freetype_lib_path_unix" - { $as_echo "$as_me:${as_lineno-$LINENO}: Compiling freetype sources succeeded! (see freetype.log for build results)" >&5 -$as_echo "$as_me: Compiling freetype sources succeeded! (see freetype.log for build results)" >&6;} - else - BUILD_FREETYPE=no - fi - else - BUILD_FREETYPE=no - fi - fi - - if test "x$BUILD_FREETYPE" = xyes; then - # Okay, we built it. Check that it works. - - POTENTIAL_FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" - POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" - METHOD="--with-freetype-src" - - # Let's start with an optimistic view of the world :-) - FOUND_FREETYPE=yes - - # First look for the canonical freetype main include file ft2build.h. - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Oh no! Let's try in the freetype2 directory. This is needed at least at Mac OS X Yosemite. - POTENTIAL_FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH/freetype2" - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Fail. - FOUND_FREETYPE=no - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - # Include file found, let's continue the sanity check. - { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 -$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} - - # Reset to default value - FREETYPE_BASE_NAME=freetype - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then - if test "x$OPENJDK_TARGET_OS" = xmacosx \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH/${LIBRARY_PREFIX}freetype.6${SHARED_LIBRARY_SUFFIX}"; then - # On Mac OS X Yosemite, the symlink from libfreetype.dylib to libfreetype.6.dylib disappeared. Check - # for the .6 version explicitly. - FREETYPE_BASE_NAME=freetype.6 - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - { $as_echo "$as_me:${as_lineno-$LINENO}: Compensating for missing symlink by using version 6 explicitly" >&5 -$as_echo "$as_me: Compensating for missing symlink by using version 6 explicitly" >&6;} - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - else - if test "x$OPENJDK_TARGET_OS" = xwindows; then - # On Windows, we will need both .lib and .dll file. - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - elif test "x$OPENJDK_TARGET_OS" = xsolaris \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then - # Found lib in isa dir, use that instead. - POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&5 -$as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;} - fi - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_LIB_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_LIB_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 -$as_echo_n "checking for freetype includes... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 -$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } - FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 -$as_echo_n "checking for freetype libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 -$as_echo "$FREETYPE_LIB_PATH" >&6; } - fi - - if test "x$FOUND_FREETYPE" != xyes; then - as_fn_error $? "Can not use the built freetype at location given by --with-freetype-src" "$LINENO" 5 - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: User specified --with-freetype-src but building freetype failed. (see freetype.log for build results)" >&5 -$as_echo "$as_me: User specified --with-freetype-src but building freetype failed. (see freetype.log for build results)" >&6;} - as_fn_error $? "Consider building freetype manually and using --with-freetype instead." "$LINENO" 5 - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-freetype-src is currently only supported on Windows - ignoring" >&5 -$as_echo "$as_me: WARNING: --with-freetype-src is currently only supported on Windows - ignoring" >&2;} - fi - fi - - if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then - # User has specified settings - - if test "x$BUNDLE_FREETYPE" = x; then - # If not specified, default is to bundle freetype - BUNDLE_FREETYPE=yes - fi - - if test "x$with_freetype" != x; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype/include" - POTENTIAL_FREETYPE_LIB_PATH="$with_freetype/lib" - fi - - # Allow --with-freetype-lib and --with-freetype-include to override - if test "x$with_freetype_include" != x; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype_include" - fi - if test "x$with_freetype_lib" != x; then - POTENTIAL_FREETYPE_LIB_PATH="$with_freetype_lib" - fi - - if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x && test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then - # Okay, we got it. Check that it works. - - POTENTIAL_FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" - POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" - METHOD="--with-freetype" - - # Let's start with an optimistic view of the world :-) - FOUND_FREETYPE=yes - - # First look for the canonical freetype main include file ft2build.h. - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Oh no! Let's try in the freetype2 directory. This is needed at least at Mac OS X Yosemite. - POTENTIAL_FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH/freetype2" - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Fail. - FOUND_FREETYPE=no - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - # Include file found, let's continue the sanity check. - { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 -$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} - - # Reset to default value - FREETYPE_BASE_NAME=freetype - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then - if test "x$OPENJDK_TARGET_OS" = xmacosx \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH/${LIBRARY_PREFIX}freetype.6${SHARED_LIBRARY_SUFFIX}"; then - # On Mac OS X Yosemite, the symlink from libfreetype.dylib to libfreetype.6.dylib disappeared. Check - # for the .6 version explicitly. - FREETYPE_BASE_NAME=freetype.6 - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - { $as_echo "$as_me:${as_lineno-$LINENO}: Compensating for missing symlink by using version 6 explicitly" >&5 -$as_echo "$as_me: Compensating for missing symlink by using version 6 explicitly" >&6;} - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - else - if test "x$OPENJDK_TARGET_OS" = xwindows; then - # On Windows, we will need both .lib and .dll file. - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - elif test "x$OPENJDK_TARGET_OS" = xsolaris \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then - # Found lib in isa dir, use that instead. - POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&5 -$as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;} - fi - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_LIB_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_LIB_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 -$as_echo_n "checking for freetype includes... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 -$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } - FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 -$as_echo_n "checking for freetype libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 -$as_echo "$FREETYPE_LIB_PATH" >&6; } - fi - - if test "x$FOUND_FREETYPE" != xyes; then - as_fn_error $? "Can not find or use freetype at location given by --with-freetype" "$LINENO" 5 - fi - else - # User specified only one of lib or include. This is an error. - if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" = x ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: User specified --with-freetype-lib but not --with-freetype-include" >&5 -$as_echo "$as_me: User specified --with-freetype-lib but not --with-freetype-include" >&6;} - as_fn_error $? "Need both freetype lib and include paths. Consider using --with-freetype instead." "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: User specified --with-freetype-include but not --with-freetype-lib" >&5 -$as_echo "$as_me: User specified --with-freetype-include but not --with-freetype-lib" >&6;} - as_fn_error $? "Need both freetype lib and include paths. Consider using --with-freetype instead." "$LINENO" 5 - fi - fi - else - # User did not specify settings, but we need freetype. Try to locate it. - - if test "x$BUNDLE_FREETYPE" = x; then - # If not specified, default is to bundle freetype only on windows - if test "x$OPENJDK_TARGET_OS" = xwindows; then - BUNDLE_FREETYPE=yes - else - BUNDLE_FREETYPE=no - fi - fi - - # If we have a sysroot, assume that's where we are supposed to look and skip pkg-config. - if test "x$SYSROOT" = x; then - if test "x$FOUND_FREETYPE" != xyes; then - # Check modules using pkg-config, but only if we have it (ugly output results otherwise) - if test "x$PKG_CONFIG" != x; then - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FREETYPE" >&5 -$as_echo_n "checking for FREETYPE... " >&6; } - -if test -n "$FREETYPE_CFLAGS"; then - pkg_cv_FREETYPE_CFLAGS="$FREETYPE_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"freetype2\""; } >&5 - ($PKG_CONFIG --exists --print-errors "freetype2") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_FREETYPE_CFLAGS=`$PKG_CONFIG --cflags "freetype2" 2>/dev/null` -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$FREETYPE_LIBS"; then - pkg_cv_FREETYPE_LIBS="$FREETYPE_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"freetype2\""; } >&5 - ($PKG_CONFIG --exists --print-errors "freetype2") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_FREETYPE_LIBS=`$PKG_CONFIG --libs "freetype2" 2>/dev/null` -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - FREETYPE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "freetype2" 2>&1` - else - FREETYPE_PKG_ERRORS=`$PKG_CONFIG --print-errors "freetype2" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$FREETYPE_PKG_ERRORS" >&5 - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - FOUND_FREETYPE=no -elif test $pkg_failed = untried; then - FOUND_FREETYPE=no -else - FREETYPE_CFLAGS=$pkg_cv_FREETYPE_CFLAGS - FREETYPE_LIBS=$pkg_cv_FREETYPE_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - FOUND_FREETYPE=yes -fi - if test "x$FOUND_FREETYPE" = xyes; then - # On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us. - FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's/-lz//g'` - # 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64 - if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then - FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's?/lib?/lib/amd64?g'` - fi - # PKG_CHECK_MODULES will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling. - if test "x$BUNDLE_FREETYPE" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype using pkg-config, but ignoring since we can not bundle that" >&5 -$as_echo "$as_me: Found freetype using pkg-config, but ignoring since we can not bundle that" >&6;} - FOUND_FREETYPE=no - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype" >&5 -$as_echo_n "checking for freetype... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (using pkg-config)" >&5 -$as_echo "yes (using pkg-config)" >&6; } - fi - fi - fi - fi - fi - - if test "x$FOUND_FREETYPE" != xyes; then - # Check in well-known locations - if test "x$OPENJDK_TARGET_OS" = xwindows; then - FREETYPE_BASE_DIR="$PROGRAMFILES/GnuWin32" - - windows_path="$FREETYPE_BASE_DIR" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - FREETYPE_BASE_DIR="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - FREETYPE_BASE_DIR="$unix_path" - fi - - - POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" - POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib" - METHOD="well-known location" - - # Let's start with an optimistic view of the world :-) - FOUND_FREETYPE=yes - - # First look for the canonical freetype main include file ft2build.h. - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Oh no! Let's try in the freetype2 directory. This is needed at least at Mac OS X Yosemite. - POTENTIAL_FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH/freetype2" - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Fail. - FOUND_FREETYPE=no - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - # Include file found, let's continue the sanity check. - { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 -$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} - - # Reset to default value - FREETYPE_BASE_NAME=freetype - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then - if test "x$OPENJDK_TARGET_OS" = xmacosx \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH/${LIBRARY_PREFIX}freetype.6${SHARED_LIBRARY_SUFFIX}"; then - # On Mac OS X Yosemite, the symlink from libfreetype.dylib to libfreetype.6.dylib disappeared. Check - # for the .6 version explicitly. - FREETYPE_BASE_NAME=freetype.6 - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - { $as_echo "$as_me:${as_lineno-$LINENO}: Compensating for missing symlink by using version 6 explicitly" >&5 -$as_echo "$as_me: Compensating for missing symlink by using version 6 explicitly" >&6;} - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - else - if test "x$OPENJDK_TARGET_OS" = xwindows; then - # On Windows, we will need both .lib and .dll file. - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - elif test "x$OPENJDK_TARGET_OS" = xsolaris \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then - # Found lib in isa dir, use that instead. - POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&5 -$as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;} - fi - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_LIB_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_LIB_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 -$as_echo_n "checking for freetype includes... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 -$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } - FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 -$as_echo_n "checking for freetype libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 -$as_echo "$FREETYPE_LIB_PATH" >&6; } - fi - - if test "x$FOUND_FREETYPE" != xyes; then - FREETYPE_BASE_DIR="$ProgramW6432/GnuWin32" - - windows_path="$FREETYPE_BASE_DIR" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - FREETYPE_BASE_DIR="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - FREETYPE_BASE_DIR="$unix_path" - fi - - - POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" - POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib" - METHOD="well-known location" - - # Let's start with an optimistic view of the world :-) - FOUND_FREETYPE=yes - - # First look for the canonical freetype main include file ft2build.h. - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Oh no! Let's try in the freetype2 directory. This is needed at least at Mac OS X Yosemite. - POTENTIAL_FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH/freetype2" - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Fail. - FOUND_FREETYPE=no - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - # Include file found, let's continue the sanity check. - { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 -$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} - - # Reset to default value - FREETYPE_BASE_NAME=freetype - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then - if test "x$OPENJDK_TARGET_OS" = xmacosx \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH/${LIBRARY_PREFIX}freetype.6${SHARED_LIBRARY_SUFFIX}"; then - # On Mac OS X Yosemite, the symlink from libfreetype.dylib to libfreetype.6.dylib disappeared. Check - # for the .6 version explicitly. - FREETYPE_BASE_NAME=freetype.6 - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - { $as_echo "$as_me:${as_lineno-$LINENO}: Compensating for missing symlink by using version 6 explicitly" >&5 -$as_echo "$as_me: Compensating for missing symlink by using version 6 explicitly" >&6;} - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - else - if test "x$OPENJDK_TARGET_OS" = xwindows; then - # On Windows, we will need both .lib and .dll file. - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - elif test "x$OPENJDK_TARGET_OS" = xsolaris \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then - # Found lib in isa dir, use that instead. - POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&5 -$as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;} - fi - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_LIB_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_LIB_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 -$as_echo_n "checking for freetype includes... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 -$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } - FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 -$as_echo_n "checking for freetype libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 -$as_echo "$FREETYPE_LIB_PATH" >&6; } - fi - - fi - if test "x$FOUND_FREETYPE" != xyes; then - FREETYPE_BASE_DIR="$HOME/freetype" - - windows_path="$FREETYPE_BASE_DIR" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - FREETYPE_BASE_DIR="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - FREETYPE_BASE_DIR="$unix_path" - fi - - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - - POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" - POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib64" - METHOD="well-known location" - - # Let's start with an optimistic view of the world :-) - FOUND_FREETYPE=yes - - # First look for the canonical freetype main include file ft2build.h. - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Oh no! Let's try in the freetype2 directory. This is needed at least at Mac OS X Yosemite. - POTENTIAL_FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH/freetype2" - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Fail. - FOUND_FREETYPE=no - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - # Include file found, let's continue the sanity check. - { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 -$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} - - # Reset to default value - FREETYPE_BASE_NAME=freetype - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then - if test "x$OPENJDK_TARGET_OS" = xmacosx \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH/${LIBRARY_PREFIX}freetype.6${SHARED_LIBRARY_SUFFIX}"; then - # On Mac OS X Yosemite, the symlink from libfreetype.dylib to libfreetype.6.dylib disappeared. Check - # for the .6 version explicitly. - FREETYPE_BASE_NAME=freetype.6 - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - { $as_echo "$as_me:${as_lineno-$LINENO}: Compensating for missing symlink by using version 6 explicitly" >&5 -$as_echo "$as_me: Compensating for missing symlink by using version 6 explicitly" >&6;} - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - else - if test "x$OPENJDK_TARGET_OS" = xwindows; then - # On Windows, we will need both .lib and .dll file. - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - elif test "x$OPENJDK_TARGET_OS" = xsolaris \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then - # Found lib in isa dir, use that instead. - POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&5 -$as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;} - fi - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_LIB_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_LIB_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 -$as_echo_n "checking for freetype includes... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 -$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } - FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 -$as_echo_n "checking for freetype libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 -$as_echo "$FREETYPE_LIB_PATH" >&6; } - fi - - else - - POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" - POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib32" - METHOD="well-known location" - - # Let's start with an optimistic view of the world :-) - FOUND_FREETYPE=yes - - # First look for the canonical freetype main include file ft2build.h. - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Oh no! Let's try in the freetype2 directory. This is needed at least at Mac OS X Yosemite. - POTENTIAL_FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH/freetype2" - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Fail. - FOUND_FREETYPE=no - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - # Include file found, let's continue the sanity check. - { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 -$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} - - # Reset to default value - FREETYPE_BASE_NAME=freetype - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then - if test "x$OPENJDK_TARGET_OS" = xmacosx \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH/${LIBRARY_PREFIX}freetype.6${SHARED_LIBRARY_SUFFIX}"; then - # On Mac OS X Yosemite, the symlink from libfreetype.dylib to libfreetype.6.dylib disappeared. Check - # for the .6 version explicitly. - FREETYPE_BASE_NAME=freetype.6 - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - { $as_echo "$as_me:${as_lineno-$LINENO}: Compensating for missing symlink by using version 6 explicitly" >&5 -$as_echo "$as_me: Compensating for missing symlink by using version 6 explicitly" >&6;} - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - else - if test "x$OPENJDK_TARGET_OS" = xwindows; then - # On Windows, we will need both .lib and .dll file. - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - elif test "x$OPENJDK_TARGET_OS" = xsolaris \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then - # Found lib in isa dir, use that instead. - POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&5 -$as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;} - fi - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_LIB_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_LIB_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 -$as_echo_n "checking for freetype includes... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 -$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } - FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 -$as_echo_n "checking for freetype libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 -$as_echo "$FREETYPE_LIB_PATH" >&6; } - fi - - fi - if test "x$FOUND_FREETYPE" != xyes && test -d $FREETYPE_BASE_DIR \ - && test -s "$FREETYPE_BASE_DIR/builds/windows/vc2010/freetype.vcxproj" && test "x$MSBUILD" != x; then - # Source is available, as a last resort try to build freetype in default location - - FREETYPE_SRC_PATH="$FREETYPE_BASE_DIR" - BUILD_FREETYPE=yes - - # Check if the freetype sources are acessible.. - if ! test -d $FREETYPE_SRC_PATH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-freetype-src specified, but can not find path \"$FREETYPE_SRC_PATH\" - ignoring --with-freetype-src" >&5 -$as_echo "$as_me: WARNING: --with-freetype-src specified, but can not find path \"$FREETYPE_SRC_PATH\" - ignoring --with-freetype-src" >&2;} - BUILD_FREETYPE=no - fi - # ..and contain a vc2010 project file - vcxproj_path="$FREETYPE_SRC_PATH/builds/windows/vc2010/freetype.vcxproj" - if test "x$BUILD_FREETYPE" = xyes && ! test -s $vcxproj_path; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can not find project file $vcxproj_path (you may try a newer freetype version) - ignoring --with-freetype-src" >&5 -$as_echo "$as_me: WARNING: Can not find project file $vcxproj_path (you may try a newer freetype version) - ignoring --with-freetype-src" >&2;} - BUILD_FREETYPE=no - fi - # Now check if configure found a version of 'msbuild.exe' - if test "x$BUILD_FREETYPE" = xyes && test "x$MSBUILD" == x ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can not find an msbuild.exe executable (you may try to install .NET 4.0) - ignoring --with-freetype-src" >&5 -$as_echo "$as_me: WARNING: Can not find an msbuild.exe executable (you may try to install .NET 4.0) - ignoring --with-freetype-src" >&2;} - BUILD_FREETYPE=no - fi - - # Ready to go.. - if test "x$BUILD_FREETYPE" = xyes; then - # msbuild requires trailing slashes for output directories - freetype_lib_path="$FREETYPE_SRC_PATH/lib$OPENJDK_TARGET_CPU_BITS/" - freetype_lib_path_unix="$freetype_lib_path" - freetype_obj_path="$FREETYPE_SRC_PATH/obj$OPENJDK_TARGET_CPU_BITS/" - - unix_path="$vcxproj_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - windows_path=`$CYGPATH -m "$unix_path"` - vcxproj_path="$windows_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - windows_path=`cmd //c echo $unix_path` - vcxproj_path="$windows_path" - fi - - - unix_path="$freetype_lib_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - windows_path=`$CYGPATH -m "$unix_path"` - freetype_lib_path="$windows_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - windows_path=`cmd //c echo $unix_path` - freetype_lib_path="$windows_path" - fi - - - unix_path="$freetype_obj_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - windows_path=`$CYGPATH -m "$unix_path"` - freetype_obj_path="$windows_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - windows_path=`cmd //c echo $unix_path` - freetype_obj_path="$windows_path" - fi - - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - freetype_platform=x64 - else - freetype_platform=win32 - fi - - # The original freetype project file is for VS 2010 (i.e. 'v100'), - # so we have to adapt the toolset if building with any other toolsed (i.e. SDK). - # Currently 'PLATFORM_TOOLSET' is set in 'TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT'/ - # 'TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT' in toolchain_windows.m4 - { $as_echo "$as_me:${as_lineno-$LINENO}: Trying to compile freetype sources with PlatformToolset=$PLATFORM_TOOLSET to $freetype_lib_path_unix ..." >&5 -$as_echo "$as_me: Trying to compile freetype sources with PlatformToolset=$PLATFORM_TOOLSET to $freetype_lib_path_unix ..." >&6;} - - # First we try to build the freetype.dll - $ECHO -e "@echo off\n"\ - "$MSBUILD $vcxproj_path "\ - "/p:PlatformToolset=$PLATFORM_TOOLSET "\ - "/p:Configuration=\"Release Multithreaded\" "\ - "/p:Platform=$freetype_platform "\ - "/p:ConfigurationType=DynamicLibrary "\ - "/p:TargetName=freetype "\ - "/p:OutDir=\"$freetype_lib_path\" "\ - "/p:IntDir=\"$freetype_obj_path\" > freetype.log" > freetype.bat - cmd /c freetype.bat - - if test -s "$freetype_lib_path_unix/freetype.dll"; then - # If that succeeds we also build freetype.lib - $ECHO -e "@echo off\n"\ - "$MSBUILD $vcxproj_path "\ - "/p:PlatformToolset=$PLATFORM_TOOLSET "\ - "/p:Configuration=\"Release Multithreaded\" "\ - "/p:Platform=$freetype_platform "\ - "/p:ConfigurationType=StaticLibrary "\ - "/p:TargetName=freetype "\ - "/p:OutDir=\"$freetype_lib_path\" "\ - "/p:IntDir=\"$freetype_obj_path\" >> freetype.log" > freetype.bat - cmd /c freetype.bat - - if test -s "$freetype_lib_path_unix/freetype.lib"; then - # Once we build both, lib and dll, set freetype lib and include path appropriately - POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_SRC_PATH/include" - POTENTIAL_FREETYPE_LIB_PATH="$freetype_lib_path_unix" - { $as_echo "$as_me:${as_lineno-$LINENO}: Compiling freetype sources succeeded! (see freetype.log for build results)" >&5 -$as_echo "$as_me: Compiling freetype sources succeeded! (see freetype.log for build results)" >&6;} - else - BUILD_FREETYPE=no - fi - else - BUILD_FREETYPE=no - fi - fi - - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - - POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" - POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib64" - METHOD="well-known location" - - # Let's start with an optimistic view of the world :-) - FOUND_FREETYPE=yes - - # First look for the canonical freetype main include file ft2build.h. - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Oh no! Let's try in the freetype2 directory. This is needed at least at Mac OS X Yosemite. - POTENTIAL_FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH/freetype2" - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Fail. - FOUND_FREETYPE=no - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - # Include file found, let's continue the sanity check. - { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 -$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} - - # Reset to default value - FREETYPE_BASE_NAME=freetype - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then - if test "x$OPENJDK_TARGET_OS" = xmacosx \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH/${LIBRARY_PREFIX}freetype.6${SHARED_LIBRARY_SUFFIX}"; then - # On Mac OS X Yosemite, the symlink from libfreetype.dylib to libfreetype.6.dylib disappeared. Check - # for the .6 version explicitly. - FREETYPE_BASE_NAME=freetype.6 - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - { $as_echo "$as_me:${as_lineno-$LINENO}: Compensating for missing symlink by using version 6 explicitly" >&5 -$as_echo "$as_me: Compensating for missing symlink by using version 6 explicitly" >&6;} - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - else - if test "x$OPENJDK_TARGET_OS" = xwindows; then - # On Windows, we will need both .lib and .dll file. - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - elif test "x$OPENJDK_TARGET_OS" = xsolaris \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then - # Found lib in isa dir, use that instead. - POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&5 -$as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;} - fi - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_LIB_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_LIB_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 -$as_echo_n "checking for freetype includes... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 -$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } - FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 -$as_echo_n "checking for freetype libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 -$as_echo "$FREETYPE_LIB_PATH" >&6; } - fi - - else - - POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" - POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib32" - METHOD="well-known location" - - # Let's start with an optimistic view of the world :-) - FOUND_FREETYPE=yes - - # First look for the canonical freetype main include file ft2build.h. - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Oh no! Let's try in the freetype2 directory. This is needed at least at Mac OS X Yosemite. - POTENTIAL_FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH/freetype2" - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Fail. - FOUND_FREETYPE=no - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - # Include file found, let's continue the sanity check. - { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 -$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} - - # Reset to default value - FREETYPE_BASE_NAME=freetype - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then - if test "x$OPENJDK_TARGET_OS" = xmacosx \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH/${LIBRARY_PREFIX}freetype.6${SHARED_LIBRARY_SUFFIX}"; then - # On Mac OS X Yosemite, the symlink from libfreetype.dylib to libfreetype.6.dylib disappeared. Check - # for the .6 version explicitly. - FREETYPE_BASE_NAME=freetype.6 - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - { $as_echo "$as_me:${as_lineno-$LINENO}: Compensating for missing symlink by using version 6 explicitly" >&5 -$as_echo "$as_me: Compensating for missing symlink by using version 6 explicitly" >&6;} - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - else - if test "x$OPENJDK_TARGET_OS" = xwindows; then - # On Windows, we will need both .lib and .dll file. - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - elif test "x$OPENJDK_TARGET_OS" = xsolaris \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then - # Found lib in isa dir, use that instead. - POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&5 -$as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;} - fi - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_LIB_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_LIB_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 -$as_echo_n "checking for freetype includes... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 -$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } - FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 -$as_echo_n "checking for freetype libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 -$as_echo "$FREETYPE_LIB_PATH" >&6; } - fi - - fi - fi - fi - else - FREETYPE_BASE_DIR="$SYSROOT/usr" - - POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" - POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib" - METHOD="well-known location" - - # Let's start with an optimistic view of the world :-) - FOUND_FREETYPE=yes - - # First look for the canonical freetype main include file ft2build.h. - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Oh no! Let's try in the freetype2 directory. This is needed at least at Mac OS X Yosemite. - POTENTIAL_FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH/freetype2" - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Fail. - FOUND_FREETYPE=no - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - # Include file found, let's continue the sanity check. - { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 -$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} - - # Reset to default value - FREETYPE_BASE_NAME=freetype - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then - if test "x$OPENJDK_TARGET_OS" = xmacosx \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH/${LIBRARY_PREFIX}freetype.6${SHARED_LIBRARY_SUFFIX}"; then - # On Mac OS X Yosemite, the symlink from libfreetype.dylib to libfreetype.6.dylib disappeared. Check - # for the .6 version explicitly. - FREETYPE_BASE_NAME=freetype.6 - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - { $as_echo "$as_me:${as_lineno-$LINENO}: Compensating for missing symlink by using version 6 explicitly" >&5 -$as_echo "$as_me: Compensating for missing symlink by using version 6 explicitly" >&6;} - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - else - if test "x$OPENJDK_TARGET_OS" = xwindows; then - # On Windows, we will need both .lib and .dll file. - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - elif test "x$OPENJDK_TARGET_OS" = xsolaris \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then - # Found lib in isa dir, use that instead. - POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&5 -$as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;} - fi - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_LIB_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_LIB_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 -$as_echo_n "checking for freetype includes... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 -$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } - FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 -$as_echo_n "checking for freetype libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 -$as_echo "$FREETYPE_LIB_PATH" >&6; } - fi - - - if test "x$FOUND_FREETYPE" != xyes; then - FREETYPE_BASE_DIR="$SYSROOT/usr/X11" - - POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" - POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib" - METHOD="well-known location" - - # Let's start with an optimistic view of the world :-) - FOUND_FREETYPE=yes - - # First look for the canonical freetype main include file ft2build.h. - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Oh no! Let's try in the freetype2 directory. This is needed at least at Mac OS X Yosemite. - POTENTIAL_FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH/freetype2" - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Fail. - FOUND_FREETYPE=no - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - # Include file found, let's continue the sanity check. - { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 -$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} - - # Reset to default value - FREETYPE_BASE_NAME=freetype - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then - if test "x$OPENJDK_TARGET_OS" = xmacosx \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH/${LIBRARY_PREFIX}freetype.6${SHARED_LIBRARY_SUFFIX}"; then - # On Mac OS X Yosemite, the symlink from libfreetype.dylib to libfreetype.6.dylib disappeared. Check - # for the .6 version explicitly. - FREETYPE_BASE_NAME=freetype.6 - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - { $as_echo "$as_me:${as_lineno-$LINENO}: Compensating for missing symlink by using version 6 explicitly" >&5 -$as_echo "$as_me: Compensating for missing symlink by using version 6 explicitly" >&6;} - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - else - if test "x$OPENJDK_TARGET_OS" = xwindows; then - # On Windows, we will need both .lib and .dll file. - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - elif test "x$OPENJDK_TARGET_OS" = xsolaris \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then - # Found lib in isa dir, use that instead. - POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&5 -$as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;} - fi - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_LIB_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_LIB_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 -$as_echo_n "checking for freetype includes... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 -$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } - FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 -$as_echo_n "checking for freetype libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 -$as_echo "$FREETYPE_LIB_PATH" >&6; } - fi - - fi - if test "x$FOUND_FREETYPE" != xyes; then - FREETYPE_BASE_DIR="$SYSROOT/usr/local" - - POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" - POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib" - METHOD="well-known location" - - # Let's start with an optimistic view of the world :-) - FOUND_FREETYPE=yes - - # First look for the canonical freetype main include file ft2build.h. - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Oh no! Let's try in the freetype2 directory. This is needed at least at Mac OS X Yosemite. - POTENTIAL_FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH/freetype2" - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Fail. - FOUND_FREETYPE=no - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - # Include file found, let's continue the sanity check. - { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 -$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} - - # Reset to default value - FREETYPE_BASE_NAME=freetype - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then - if test "x$OPENJDK_TARGET_OS" = xmacosx \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH/${LIBRARY_PREFIX}freetype.6${SHARED_LIBRARY_SUFFIX}"; then - # On Mac OS X Yosemite, the symlink from libfreetype.dylib to libfreetype.6.dylib disappeared. Check - # for the .6 version explicitly. - FREETYPE_BASE_NAME=freetype.6 - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - { $as_echo "$as_me:${as_lineno-$LINENO}: Compensating for missing symlink by using version 6 explicitly" >&5 -$as_echo "$as_me: Compensating for missing symlink by using version 6 explicitly" >&6;} - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - else - if test "x$OPENJDK_TARGET_OS" = xwindows; then - # On Windows, we will need both .lib and .dll file. - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - elif test "x$OPENJDK_TARGET_OS" = xsolaris \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then - # Found lib in isa dir, use that instead. - POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&5 -$as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;} - fi - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_LIB_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_LIB_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 -$as_echo_n "checking for freetype includes... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 -$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } - FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 -$as_echo_n "checking for freetype libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 -$as_echo "$FREETYPE_LIB_PATH" >&6; } - fi - - fi - - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - if test "x$FOUND_FREETYPE" != xyes; then - # Due to changes in OSX 10.11 XQuartz now installs to /opt/X11 - FREETYPE_BASE_DIR="$SYSROOT/opt/X11" - - POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" - POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib" - METHOD="well-known location" - - # Let's start with an optimistic view of the world :-) - FOUND_FREETYPE=yes - - # First look for the canonical freetype main include file ft2build.h. - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Oh no! Let's try in the freetype2 directory. This is needed at least at Mac OS X Yosemite. - POTENTIAL_FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH/freetype2" - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Fail. - FOUND_FREETYPE=no - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - # Include file found, let's continue the sanity check. - { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 -$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} - - # Reset to default value - FREETYPE_BASE_NAME=freetype - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then - if test "x$OPENJDK_TARGET_OS" = xmacosx \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH/${LIBRARY_PREFIX}freetype.6${SHARED_LIBRARY_SUFFIX}"; then - # On Mac OS X Yosemite, the symlink from libfreetype.dylib to libfreetype.6.dylib disappeared. Check - # for the .6 version explicitly. - FREETYPE_BASE_NAME=freetype.6 - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - { $as_echo "$as_me:${as_lineno-$LINENO}: Compensating for missing symlink by using version 6 explicitly" >&5 -$as_echo "$as_me: Compensating for missing symlink by using version 6 explicitly" >&6;} - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - else - if test "x$OPENJDK_TARGET_OS" = xwindows; then - # On Windows, we will need both .lib and .dll file. - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - elif test "x$OPENJDK_TARGET_OS" = xsolaris \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then - # Found lib in isa dir, use that instead. - POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&5 -$as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;} - fi - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_LIB_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_LIB_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 -$as_echo_n "checking for freetype includes... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 -$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } - FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 -$as_echo_n "checking for freetype libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 -$as_echo "$FREETYPE_LIB_PATH" >&6; } - fi - - fi - fi - - if test "x$FOUND_FREETYPE" != xyes; then - FREETYPE_BASE_DIR="$SYSROOT/usr" - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - - POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" - POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib/$OPENJDK_TARGET_CPU-linux-gnu" - METHOD="well-known location" - - # Let's start with an optimistic view of the world :-) - FOUND_FREETYPE=yes - - # First look for the canonical freetype main include file ft2build.h. - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Oh no! Let's try in the freetype2 directory. This is needed at least at Mac OS X Yosemite. - POTENTIAL_FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH/freetype2" - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Fail. - FOUND_FREETYPE=no - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - # Include file found, let's continue the sanity check. - { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 -$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} - - # Reset to default value - FREETYPE_BASE_NAME=freetype - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then - if test "x$OPENJDK_TARGET_OS" = xmacosx \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH/${LIBRARY_PREFIX}freetype.6${SHARED_LIBRARY_SUFFIX}"; then - # On Mac OS X Yosemite, the symlink from libfreetype.dylib to libfreetype.6.dylib disappeared. Check - # for the .6 version explicitly. - FREETYPE_BASE_NAME=freetype.6 - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - { $as_echo "$as_me:${as_lineno-$LINENO}: Compensating for missing symlink by using version 6 explicitly" >&5 -$as_echo "$as_me: Compensating for missing symlink by using version 6 explicitly" >&6;} - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - else - if test "x$OPENJDK_TARGET_OS" = xwindows; then - # On Windows, we will need both .lib and .dll file. - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - elif test "x$OPENJDK_TARGET_OS" = xsolaris \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then - # Found lib in isa dir, use that instead. - POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&5 -$as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;} - fi - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_LIB_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_LIB_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 -$as_echo_n "checking for freetype includes... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 -$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } - FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 -$as_echo_n "checking for freetype libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 -$as_echo "$FREETYPE_LIB_PATH" >&6; } - fi - - else - - POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" - POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib/i386-linux-gnu" - METHOD="well-known location" - - # Let's start with an optimistic view of the world :-) - FOUND_FREETYPE=yes - - # First look for the canonical freetype main include file ft2build.h. - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Oh no! Let's try in the freetype2 directory. This is needed at least at Mac OS X Yosemite. - POTENTIAL_FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH/freetype2" - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Fail. - FOUND_FREETYPE=no - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - # Include file found, let's continue the sanity check. - { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 -$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} - - # Reset to default value - FREETYPE_BASE_NAME=freetype - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then - if test "x$OPENJDK_TARGET_OS" = xmacosx \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH/${LIBRARY_PREFIX}freetype.6${SHARED_LIBRARY_SUFFIX}"; then - # On Mac OS X Yosemite, the symlink from libfreetype.dylib to libfreetype.6.dylib disappeared. Check - # for the .6 version explicitly. - FREETYPE_BASE_NAME=freetype.6 - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - { $as_echo "$as_me:${as_lineno-$LINENO}: Compensating for missing symlink by using version 6 explicitly" >&5 -$as_echo "$as_me: Compensating for missing symlink by using version 6 explicitly" >&6;} - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - else - if test "x$OPENJDK_TARGET_OS" = xwindows; then - # On Windows, we will need both .lib and .dll file. - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - elif test "x$OPENJDK_TARGET_OS" = xsolaris \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then - # Found lib in isa dir, use that instead. - POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&5 -$as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;} - fi - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_LIB_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_LIB_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 -$as_echo_n "checking for freetype includes... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 -$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } - FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 -$as_echo_n "checking for freetype libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 -$as_echo "$FREETYPE_LIB_PATH" >&6; } - fi - - if test "x$FOUND_FREETYPE" != xyes; then - - POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" - POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib32" - METHOD="well-known location" - - # Let's start with an optimistic view of the world :-) - FOUND_FREETYPE=yes - - # First look for the canonical freetype main include file ft2build.h. - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Oh no! Let's try in the freetype2 directory. This is needed at least at Mac OS X Yosemite. - POTENTIAL_FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH/freetype2" - if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then - # Fail. - FOUND_FREETYPE=no - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - # Include file found, let's continue the sanity check. - { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 -$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} - - # Reset to default value - FREETYPE_BASE_NAME=freetype - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then - if test "x$OPENJDK_TARGET_OS" = xmacosx \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH/${LIBRARY_PREFIX}freetype.6${SHARED_LIBRARY_SUFFIX}"; then - # On Mac OS X Yosemite, the symlink from libfreetype.dylib to libfreetype.6.dylib disappeared. Check - # for the .6 version explicitly. - FREETYPE_BASE_NAME=freetype.6 - FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" - { $as_echo "$as_me:${as_lineno-$LINENO}: Compensating for missing symlink by using version 6 explicitly" >&5 -$as_echo "$as_me: Compensating for missing symlink by using version 6 explicitly" >&6;} - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - else - if test "x$OPENJDK_TARGET_OS" = xwindows; then - # On Windows, we will need both .lib and .dll file. - if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&5 -$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&6;} - FOUND_FREETYPE=no - fi - elif test "x$OPENJDK_TARGET_OS" = xsolaris \ - && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then - # Found lib in isa dir, use that instead. - POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&5 -$as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;} - fi - fi - fi - - if test "x$FOUND_FREETYPE" = xyes; then - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - # Only process if variable expands to non-empty - - if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$POTENTIAL_FREETYPE_LIB_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - POTENTIAL_FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - POTENTIAL_FREETYPE_LIB_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - - FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 -$as_echo_n "checking for freetype includes... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 -$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } - FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 -$as_echo_n "checking for freetype libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 -$as_echo "$FREETYPE_LIB_PATH" >&6; } - fi - - fi - fi - fi - fi - fi # end check in well-known locations - - if test "x$FOUND_FREETYPE" != xyes; then - - # Print a helpful message on how to acquire the necessary build dependency. - # freetype is the help tag: freetype, cups, alsa etc - MISSING_DEPENDENCY=freetype - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - cygwin_help $MISSING_DEPENDENCY - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - msys_help $MISSING_DEPENDENCY - else - PKGHANDLER_COMMAND= - - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - brew) - brew_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - esac - - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." - fi - fi - - as_fn_error $? "Could not find freetype! $HELP_MSG " "$LINENO" 5 - fi - fi # end user specified settings - - # Set FREETYPE_CFLAGS, _LIBS and _LIB_PATH from include and lib dir. - if test "x$FREETYPE_CFLAGS" = x; then - - # Only process if variable expands to non-empty - - if test "x$FREETYPE_INCLUDE_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$FREETYPE_INCLUDE_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of FREETYPE_INCLUDE_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$FREETYPE_INCLUDE_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - FREETYPE_INCLUDE_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - FREETYPE_INCLUDE_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - if test -d $FREETYPE_INCLUDE_PATH/freetype2/freetype; then - FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH/freetype2 -I$FREETYPE_INCLUDE_PATH" - else - FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH" - fi - fi - - if test "x$FREETYPE_LIBS" = x; then - - # Only process if variable expands to non-empty - - if test "x$FREETYPE_LIB_PATH" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$FREETYPE_LIB_PATH" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of FREETYPE_LIB_PATH" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$FREETYPE_LIB_PATH" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - FREETYPE_LIB_PATH="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FREETYPE_LIB_PATH to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting FREETYPE_LIB_PATH to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - FREETYPE_LIB_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - if test "x$OPENJDK_TARGET_OS" = xwindows; then - FREETYPE_LIBS="$FREETYPE_LIB_PATH/$FREETYPE_BASE_NAME.lib" - else - FREETYPE_LIBS="-L$FREETYPE_LIB_PATH -l$FREETYPE_BASE_NAME" - fi - fi - - # Try to compile it - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can compile and link with freetype" >&5 -$as_echo_n "checking if we can compile and link with freetype... " >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - PREV_CXXCFLAGS="$CXXFLAGS" - PREV_LIBS="$LIBS" - PREV_CXX="$CXX" - CXXFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" - LIBS="$LIBS $FREETYPE_LIBS" - CXX="$FIXPATH $CXX" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - #include FT_FREETYPE_H - int main () { - FT_Init_FreeType(NULL); - return 0; - } - -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not compile and link with freetype. This might be a 32/64-bit mismatch." >&5 -$as_echo "$as_me: Could not compile and link with freetype. This might be a 32/64-bit mismatch." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Using FREETYPE_CFLAGS=$FREETYPE_CFLAGS and FREETYPE_LIBS=$FREETYPE_LIBS" >&5 -$as_echo "$as_me: Using FREETYPE_CFLAGS=$FREETYPE_CFLAGS and FREETYPE_LIBS=$FREETYPE_LIBS" >&6;} - - - # Print a helpful message on how to acquire the necessary build dependency. - # freetype is the help tag: freetype, cups, alsa etc - MISSING_DEPENDENCY=freetype - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - cygwin_help $MISSING_DEPENDENCY - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - msys_help $MISSING_DEPENDENCY - else - PKGHANDLER_COMMAND= - - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - brew) - brew_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - esac - - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." - fi - fi - - - as_fn_error $? "Can not continue without freetype. $HELP_MSG" "$LINENO" 5 - - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CXXCFLAGS="$PREV_CXXFLAGS" - LIBS="$PREV_LIBS" - CXX="$PREV_CXX" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should bundle freetype" >&5 -$as_echo_n "checking if we should bundle freetype... " >&6; } - if test "x$BUNDLE_FREETYPE" = xyes; then - FREETYPE_BUNDLE_LIB_PATH="$FREETYPE_LIB_PATH" - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUNDLE_FREETYPE" >&5 -$as_echo "$BUNDLE_FREETYPE" >&6; } - - if test "x$BUNDLE_FREETYPE" = xyes; then - FREETYPE_LICENSE="" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype license" >&5 -$as_echo_n "checking for freetype license... " >&6; } - if test "x$with_freetype_license" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_fn_error $? "--with-freetype-license must have a value" "$LINENO" 5 - elif test "x$with_freetype_license" != "x"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_freetype_license" >&5 -$as_echo "$with_freetype_license" >&6; } - FREETYPE_LICENSE="$with_freetype_license" - - # Only process if variable expands to non-empty - - if test "x$FREETYPE_LICENSE" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$FREETYPE_LICENSE" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPE_LICENSE, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of FREETYPE_LICENSE, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of FREETYPE_LICENSE" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - FREETYPE_LICENSE="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FREETYPE_LICENSE to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting FREETYPE_LICENSE to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$FREETYPE_LICENSE" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - FREETYPE_LICENSE="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FREETYPE_LICENSE to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting FREETYPE_LICENSE to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$FREETYPE_LICENSE" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPE_LICENSE, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of FREETYPE_LICENSE, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of FREETYPE_LICENSE, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - FREETYPE_LICENSE="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - FREETYPE_LICENSE="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - if test ! -f "$FREETYPE_LICENSE"; then - as_fn_error $? "$FREETYPE_LICENSE cannot be found" "$LINENO" 5 - fi - else - if test "x$with_freetype" != "x" && test -f $with_freetype/freetype.md; then - FREETYPE_LICENSE="$with_freetype/freetype.md" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LICENSE" >&5 -$as_echo "$FREETYPE_LICENSE" >&6; } - - # Only process if variable expands to non-empty - - if test "x$FREETYPE_LICENSE" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$FREETYPE_LICENSE" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPE_LICENSE, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of FREETYPE_LICENSE, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of FREETYPE_LICENSE" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - FREETYPE_LICENSE="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FREETYPE_LICENSE to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting FREETYPE_LICENSE to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$FREETYPE_LICENSE" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - FREETYPE_LICENSE="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FREETYPE_LICENSE to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting FREETYPE_LICENSE to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$FREETYPE_LICENSE" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPE_LICENSE, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of FREETYPE_LICENSE, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of FREETYPE_LICENSE, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - FREETYPE_LICENSE="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - FREETYPE_LICENSE="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - fi - fi - - fi # end freetype needed - - - - - - - - -# Check whether --with-alsa was given. -if test "${with_alsa+set}" = set; then : - withval=$with_alsa; -fi - - -# Check whether --with-alsa-include was given. -if test "${with_alsa_include+set}" = set; then : - withval=$with_alsa_include; -fi - - -# Check whether --with-alsa-lib was given. -if test "${with_alsa_lib+set}" = set; then : - withval=$with_alsa_lib; -fi - - - if test "x$NEEDS_LIB_ALSA" = xfalse; then - if (test "x${with_alsa}" != x && test "x${with_alsa}" != xno) || \ - (test "x${with_alsa_include}" != x && test "x${with_alsa_include}" != xno) || \ - (test "x${with_alsa_lib}" != x && test "x${with_alsa_lib}" != xno); then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: alsa not used, so --with-alsa[-*] is ignored" >&5 -$as_echo "$as_me: WARNING: alsa not used, so --with-alsa[-*] is ignored" >&2;} - fi - ALSA_CFLAGS= - ALSA_LIBS= - else - ALSA_FOUND=no - - if test "x${with_alsa}" = xno || test "x${with_alsa_include}" = xno || test "x${with_alsa_lib}" = xno; then - as_fn_error $? "It is not possible to disable the use of alsa. Remove the --without-alsa option." "$LINENO" 5 - fi - - if test "x${with_alsa}" != x; then - ALSA_LIBS="-L${with_alsa}/lib -lasound" - ALSA_CFLAGS="-I${with_alsa}/include" - ALSA_FOUND=yes - fi - if test "x${with_alsa_include}" != x; then - ALSA_CFLAGS="-I${with_alsa_include}" - ALSA_FOUND=yes - fi - if test "x${with_alsa_lib}" != x; then - ALSA_LIBS="-L${with_alsa_lib} -lasound" - ALSA_FOUND=yes - fi - # Do not try pkg-config if we have a sysroot set. - if test "x$SYSROOT" = x; then - if test "x$ALSA_FOUND" = xno; then - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ALSA" >&5 -$as_echo_n "checking for ALSA... " >&6; } - -if test -n "$ALSA_CFLAGS"; then - pkg_cv_ALSA_CFLAGS="$ALSA_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"alsa\""; } >&5 - ($PKG_CONFIG --exists --print-errors "alsa") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_ALSA_CFLAGS=`$PKG_CONFIG --cflags "alsa" 2>/dev/null` -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$ALSA_LIBS"; then - pkg_cv_ALSA_LIBS="$ALSA_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"alsa\""; } >&5 - ($PKG_CONFIG --exists --print-errors "alsa") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_ALSA_LIBS=`$PKG_CONFIG --libs "alsa" 2>/dev/null` -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - ALSA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "alsa" 2>&1` - else - ALSA_PKG_ERRORS=`$PKG_CONFIG --print-errors "alsa" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$ALSA_PKG_ERRORS" >&5 - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ALSA_FOUND=no -elif test $pkg_failed = untried; then - ALSA_FOUND=no -else - ALSA_CFLAGS=$pkg_cv_ALSA_CFLAGS - ALSA_LIBS=$pkg_cv_ALSA_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ALSA_FOUND=yes -fi - fi - fi - if test "x$ALSA_FOUND" = xno; then - for ac_header in alsa/asoundlib.h -do : - ac_fn_cxx_check_header_mongrel "$LINENO" "alsa/asoundlib.h" "ac_cv_header_alsa_asoundlib_h" "$ac_includes_default" -if test "x$ac_cv_header_alsa_asoundlib_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ALSA_ASOUNDLIB_H 1 -_ACEOF - - ALSA_FOUND=yes - ALSA_CFLAGS=-Iignoreme - ALSA_LIBS=-lasound - DEFAULT_ALSA=yes - -else - ALSA_FOUND=no - -fi - -done - - fi - if test "x$ALSA_FOUND" = xno; then - - # Print a helpful message on how to acquire the necessary build dependency. - # alsa is the help tag: freetype, cups, alsa etc - MISSING_DEPENDENCY=alsa - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - cygwin_help $MISSING_DEPENDENCY - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - msys_help $MISSING_DEPENDENCY - else - PKGHANDLER_COMMAND= - - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - brew) - brew_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - esac - - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." - fi - fi - - as_fn_error $? "Could not find alsa! $HELP_MSG" "$LINENO" 5 - fi - fi - - - - - - -# Check whether --with-libffi was given. -if test "${with_libffi+set}" = set; then : - withval=$with_libffi; -fi - - -# Check whether --with-libffi-include was given. -if test "${with_libffi_include+set}" = set; then : - withval=$with_libffi_include; -fi - - -# Check whether --with-libffi-lib was given. -if test "${with_libffi_lib+set}" = set; then : - withval=$with_libffi_lib; -fi - - # Check whether --enable-libffi-bundling was given. -if test "${enable_libffi_bundling+set}" = set; then : - enableval=$enable_libffi_bundling; -fi - - - if test "x$NEEDS_LIB_FFI" = xfalse; then - if (test "x${with_libffi}" != x && test "x${with_libffi}" != xno) || \ - (test "x${with_libffi_include}" != x && test "x${with_libffi_include}" != xno) || \ - (test "x${with_libffi_lib}" != x && test "x${with_libffi_lib}" != xno); then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libffi not used, so --with-libffi[-*] is ignored" >&5 -$as_echo "$as_me: WARNING: libffi not used, so --with-libffi[-*] is ignored" >&2;} - fi - LIBFFI_CFLAGS= - LIBFFI_LIBS= - else - LIBFFI_FOUND=no - - if test "x${with_libffi}" = xno || test "x${with_libffi_include}" = xno || test "x${with_libffi_lib}" = xno; then - as_fn_error $? "It is not possible to disable the use of libffi. Remove the --without-libffi option." "$LINENO" 5 - fi - - if test "x${with_libffi}" != x; then - LIBFFI_LIB_PATH="${with_libffi}/lib" - LIBFFI_LIBS="-L${with_libffi}/lib -lffi" - LIBFFI_CFLAGS="-I${with_libffi}/include" - LIBFFI_FOUND=yes - fi - if test "x${with_libffi_include}" != x; then - LIBFFI_CFLAGS="-I${with_libffi_include}" - LIBFFI_FOUND=yes - fi - if test "x${with_libffi_lib}" != x; then - LIBFFI_LIB_PATH="${with_libffi_lib}" - LIBFFI_LIBS="-L${with_libffi_lib} -lffi" - LIBFFI_FOUND=yes - fi - # Do not try pkg-config if we have a sysroot set. - if test "x$SYSROOT" = x; then - if test "x$LIBFFI_FOUND" = xno; then - # Figure out LIBFFI_CFLAGS and LIBFFI_LIBS - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBFFI" >&5 -$as_echo_n "checking for LIBFFI... " >&6; } - -if test -n "$LIBFFI_CFLAGS"; then - pkg_cv_LIBFFI_CFLAGS="$LIBFFI_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libffi\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libffi") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LIBFFI_CFLAGS=`$PKG_CONFIG --cflags "libffi" 2>/dev/null` -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$LIBFFI_LIBS"; then - pkg_cv_LIBFFI_LIBS="$LIBFFI_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libffi\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libffi") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LIBFFI_LIBS=`$PKG_CONFIG --libs "libffi" 2>/dev/null` -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - LIBFFI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libffi" 2>&1` - else - LIBFFI_PKG_ERRORS=`$PKG_CONFIG --print-errors "libffi" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$LIBFFI_PKG_ERRORS" >&5 - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - LIBFFI_FOUND=no -elif test $pkg_failed = untried; then - LIBFFI_FOUND=no -else - LIBFFI_CFLAGS=$pkg_cv_LIBFFI_CFLAGS - LIBFFI_LIBS=$pkg_cv_LIBFFI_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - LIBFFI_FOUND=yes -fi - fi - fi - if test "x$LIBFFI_FOUND" = xno; then - for ac_header in ffi.h -do : - ac_fn_cxx_check_header_mongrel "$LINENO" "ffi.h" "ac_cv_header_ffi_h" "$ac_includes_default" -if test "x$ac_cv_header_ffi_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_FFI_H 1 -_ACEOF - - LIBFFI_FOUND=yes - LIBFFI_CFLAGS= - LIBFFI_LIBS=-lffi - -else - LIBFFI_FOUND=no - -fi - -done - - fi - if test "x$LIBFFI_FOUND" = xno; then - - # Print a helpful message on how to acquire the necessary build dependency. - # ffi is the help tag: freetype, cups, alsa etc - MISSING_DEPENDENCY=ffi - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - cygwin_help $MISSING_DEPENDENCY - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - msys_help $MISSING_DEPENDENCY - else - PKGHANDLER_COMMAND= - - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - brew) - brew_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - esac - - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." - fi - fi - - as_fn_error $? "Could not find libffi! $HELP_MSG" "$LINENO" 5 - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libffi works" >&5 -$as_echo_n "checking if libffi works... " >&6; } - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - OLD_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $LIBFFI_CFLAGS" - OLD_LIBS="$LIBS" - LIBS="$LIBS $LIBFFI_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ - - ffi_call(NULL, NULL, NULL, NULL); - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - LIBFFI_WORKS=yes -else - LIBFFI_WORKS=no - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS="$OLD_CFLAGS" - LIBS="$OLD_LIBS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBFFI_WORKS" >&5 -$as_echo "$LIBFFI_WORKS" >&6; } - - if test "x$LIBFFI_WORKS" = xno; then - - # Print a helpful message on how to acquire the necessary build dependency. - # ffi is the help tag: freetype, cups, alsa etc - MISSING_DEPENDENCY=ffi - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - cygwin_help $MISSING_DEPENDENCY - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - msys_help $MISSING_DEPENDENCY - else - PKGHANDLER_COMMAND= - - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - brew) - brew_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - esac - - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." - fi - fi - - as_fn_error $? "Found libffi but could not link and compile with it. $HELP_MSG" "$LINENO" 5 - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libffi should be bundled" >&5 -$as_echo_n "checking if libffi should be bundled... " >&6; } - if test "x$enable_libffi_bundling" = "x"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ENABLE_LIBFFI_BUNDLING=false - elif test "x$enable_libffi_bundling" = "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, forced" >&5 -$as_echo "no, forced" >&6; } - ENABLE_LIBFFI_BUNDLING=false - elif test "x$enable_libffi_bundling" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, forced" >&5 -$as_echo "yes, forced" >&6; } - ENABLE_LIBFFI_BUNDLING=true - else - as_fn_error $? "Invalid value for --enable-libffi-bundling" "$LINENO" 5 - fi - - # Find the libffi.so.X to bundle - if test "x${ENABLE_LIBFFI_BUNDLING}" = "xtrue"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libffi lib file location" >&5 -$as_echo_n "checking for libffi lib file location... " >&6; } - if test "x${LIBFFI_LIB_PATH}" != x; then - if test -e ${LIBFFI_LIB_PATH}/libffi.so.?; then - LIBFFI_LIB_FILE="${LIBFFI_LIB_PATH}/libffi.so.?" - else - as_fn_error $? "Could not locate libffi.so.? for bundling in ${LIBFFI_LIB_PATH}" "$LINENO" 5 - fi - else - # If we don't have an explicit path, look in a few obvious places - if test "x${OPENJDK_TARGET_CPU}" = "xx86"; then - if test -e ${SYSROOT}/usr/lib/libffi.so.? ; then - LIBFFI_LIB_FILE="${SYSROOT}/usr/lib/libffi.so.?" - elif test -e ${SYSROOT}/usr/lib/i386-linux-gnu/libffi.so.? ; then - LIBFFI_LIB_FILE="${SYSROOT}/usr/lib/i386-linux-gnu/libffi.so.?" - else - as_fn_error $? "Could not locate libffi.so.? for bundling" "$LINENO" 5 - fi - elif test "x${OPENJDK_TARGET_CPU}" = "xx86_64"; then - if test -e ${SYSROOT}/usr/lib64/libffi.so.? ; then - LIBFFI_LIB_FILE="${SYSROOT}/usr/lib64/libffi.so.?" - elif test -e ${SYSROOT}/usr/lib/x86_64-linux-gnu/libffi.so.? ; then - LIBFFI_LIB_FILE="${SYSROOT}/usr/lib/x86_64-linux-gnu/libffi.so.?" - else - as_fn_error $? "Could not locate libffi.so.? for bundling" "$LINENO" 5 - fi - else - # Fallback on the default /usr/lib dir - if test -e ${SYSROOT}/usr/lib/libffi.so.? ; then - LIBFFI_LIB_FILE="${SYSROOT}/usr/lib/libffi.so.?" - else - as_fn_error $? "Could not locate libffi.so.? for bundling" "$LINENO" 5 - fi - fi - fi - # Make sure the wildcard is evaluated - LIBFFI_LIB_FILE="$(ls ${LIBFFI_LIB_FILE})" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${LIBFFI_LIB_FILE}" >&5 -$as_echo "${LIBFFI_LIB_FILE}" >&6; } - fi - fi - - - - - - - - -# Check whether --with-libjpeg was given. -if test "${with_libjpeg+set}" = set; then : - withval=$with_libjpeg; -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for which libjpeg to use" >&5 -$as_echo_n "checking for which libjpeg to use... " >&6; } - # default is bundled - DEFAULT_LIBJPEG=bundled - # if user didn't specify, use DEFAULT_LIBJPEG - if test "x${with_libjpeg}" = "x"; then - with_libjpeg=${DEFAULT_LIBJPEG} - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libjpeg}" >&5 -$as_echo "${with_libjpeg}" >&6; } - - if test "x${with_libjpeg}" = "xbundled"; then - USE_EXTERNAL_LIBJPEG=false - elif test "x${with_libjpeg}" = "xsystem"; then - ac_fn_cxx_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default" -if test "x$ac_cv_header_jpeglib_h" = xyes; then : - -else - as_fn_error $? "--with-libjpeg=system specified, but jpeglib.h not found!" "$LINENO" 5 -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_CreateDecompress in -ljpeg" >&5 -$as_echo_n "checking for jpeg_CreateDecompress in -ljpeg... " >&6; } -if ${ac_cv_lib_jpeg_jpeg_CreateDecompress+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ljpeg $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char jpeg_CreateDecompress (); -int -main () -{ -return jpeg_CreateDecompress (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_jpeg_jpeg_CreateDecompress=yes -else - ac_cv_lib_jpeg_jpeg_CreateDecompress=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_CreateDecompress" >&5 -$as_echo "$ac_cv_lib_jpeg_jpeg_CreateDecompress" >&6; } -if test "x$ac_cv_lib_jpeg_jpeg_CreateDecompress" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBJPEG 1 -_ACEOF - - LIBS="-ljpeg $LIBS" - -else - as_fn_error $? "--with-libjpeg=system specified, but no libjpeg found" "$LINENO" 5 -fi - - - USE_EXTERNAL_LIBJPEG=true - else - as_fn_error $? "Invalid use of --with-libjpeg: ${with_libjpeg}, use 'system' or 'bundled'" "$LINENO" 5 - fi - - - - - -# Check whether --with-giflib was given. -if test "${with_giflib+set}" = set; then : - withval=$with_giflib; -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for which giflib to use" >&5 -$as_echo_n "checking for which giflib to use... " >&6; } - # default is bundled - DEFAULT_GIFLIB=bundled - # if user didn't specify, use DEFAULT_GIFLIB - if test "x${with_giflib}" = "x"; then - with_giflib=${DEFAULT_GIFLIB} - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_giflib}" >&5 -$as_echo "${with_giflib}" >&6; } - - if test "x${with_giflib}" = "xbundled"; then - USE_EXTERNAL_LIBGIF=false - elif test "x${with_giflib}" = "xsystem"; then - ac_fn_cxx_check_header_mongrel "$LINENO" "gif_lib.h" "ac_cv_header_gif_lib_h" "$ac_includes_default" -if test "x$ac_cv_header_gif_lib_h" = xyes; then : - -else - as_fn_error $? "--with-giflib=system specified, but gif_lib.h not found!" "$LINENO" 5 -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DGifGetCode in -lgif" >&5 -$as_echo_n "checking for DGifGetCode in -lgif... " >&6; } -if ${ac_cv_lib_gif_DGifGetCode+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgif $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char DGifGetCode (); -int -main () -{ -return DGifGetCode (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_gif_DGifGetCode=yes -else - ac_cv_lib_gif_DGifGetCode=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_DGifGetCode" >&5 -$as_echo "$ac_cv_lib_gif_DGifGetCode" >&6; } -if test "x$ac_cv_lib_gif_DGifGetCode" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBGIF 1 -_ACEOF - - LIBS="-lgif $LIBS" - -else - as_fn_error $? "--with-giflib=system specified, but no giflib found!" "$LINENO" 5 -fi - - - USE_EXTERNAL_LIBGIF=true - else - as_fn_error $? "Invalid value of --with-giflib: ${with_giflib}, use 'system' or 'bundled'" "$LINENO" 5 - fi - - - - - -# Check whether --with-libpng was given. -if test "${with_libpng+set}" = set; then : - withval=$with_libpng; -fi - - - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PNG" >&5 -$as_echo_n "checking for PNG... " >&6; } - -if test -n "$PNG_CFLAGS"; then - pkg_cv_PNG_CFLAGS="$PNG_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpng\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libpng") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_PNG_CFLAGS=`$PKG_CONFIG --cflags "libpng" 2>/dev/null` -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$PNG_LIBS"; then - pkg_cv_PNG_LIBS="$PNG_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpng\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libpng") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_PNG_LIBS=`$PKG_CONFIG --libs "libpng" 2>/dev/null` -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - PNG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libpng" 2>&1` - else - PNG_PKG_ERRORS=`$PKG_CONFIG --print-errors "libpng" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$PNG_PKG_ERRORS" >&5 - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - LIBPNG_FOUND=no -elif test $pkg_failed = untried; then - LIBPNG_FOUND=no -else - PNG_CFLAGS=$pkg_cv_PNG_CFLAGS - PNG_LIBS=$pkg_cv_PNG_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - LIBPNG_FOUND=yes -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for which libpng to use" >&5 -$as_echo_n "checking for which libpng to use... " >&6; } - - # default is bundled - DEFAULT_LIBPNG=bundled - # if user didn't specify, use DEFAULT_LIBPNG - if test "x${with_libpng}" = "x"; then - with_libpng=${DEFAULT_LIBPNG} - fi - - if test "x${with_libpng}" = "xbundled"; then - USE_EXTERNAL_LIBPNG=false - PNG_CFLAGS="" - PNG_LIBS="" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: bundled" >&5 -$as_echo "bundled" >&6; } - elif test "x${with_libpng}" = "xsystem"; then - if test "x${LIBPNG_FOUND}" = "xyes"; then - # PKG_CHECK_MODULES will set PNG_CFLAGS and PNG_LIBS - USE_EXTERNAL_LIBPNG=true - { $as_echo "$as_me:${as_lineno-$LINENO}: result: system" >&5 -$as_echo "system" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: system not found" >&5 -$as_echo "system not found" >&6; } - as_fn_error $? "--with-libpng=system specified, but no libpng found!" "$LINENO" 5 - fi - else - as_fn_error $? "Invalid value of --with-libpng: ${with_libpng}, use 'system' or 'bundled'" "$LINENO" 5 - fi - - - - - - - -# Check whether --with-zlib was given. -if test "${with_zlib+set}" = set; then : - withval=$with_zlib; -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress in -lz" >&5 -$as_echo_n "checking for compress in -lz... " >&6; } -if ${ac_cv_lib_z_compress+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lz $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char compress (); -int -main () -{ -return compress (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_z_compress=yes -else - ac_cv_lib_z_compress=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_compress" >&5 -$as_echo "$ac_cv_lib_z_compress" >&6; } -if test "x$ac_cv_lib_z_compress" = xyes; then : - ZLIB_FOUND=yes -else - ZLIB_FOUND=no -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for which zlib to use" >&5 -$as_echo_n "checking for which zlib to use... " >&6; } - - DEFAULT_ZLIB=system - if test "x$OPENJDK_TARGET_OS" = xwindows; then - # On windows default is bundled...on others default is system - DEFAULT_ZLIB=bundled - fi - - if test "x${ZLIB_FOUND}" != "xyes"; then - # If we don't find any system...set default to bundled - DEFAULT_ZLIB=bundled - fi - - # If user didn't specify, use DEFAULT_ZLIB - if test "x${with_zlib}" = "x"; then - with_zlib=${DEFAULT_ZLIB} - fi - - if test "x${with_zlib}" = "xbundled"; then - USE_EXTERNAL_LIBZ=false - { $as_echo "$as_me:${as_lineno-$LINENO}: result: bundled" >&5 -$as_echo "bundled" >&6; } - elif test "x${with_zlib}" = "xsystem"; then - if test "x${ZLIB_FOUND}" = "xyes"; then - USE_EXTERNAL_LIBZ=true - { $as_echo "$as_me:${as_lineno-$LINENO}: result: system" >&5 -$as_echo "system" >&6; } - - if test "x$USE_EXTERNAL_LIBPNG" != "xtrue"; then - # If we use bundled libpng, we must verify that we have a proper zlib. - # For instance zlib-ng has had issues with inflateValidate(). - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for system zlib functionality" >&5 -$as_echo_n "checking for system zlib functionality... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include "zlib.h" -int -main () -{ - - #if ZLIB_VERNUM >= 0x1281 - inflateValidate(NULL, 0); - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not ok" >&5 -$as_echo "not ok" >&6; } - as_fn_error $? "System zlib not working correctly" "$LINENO" 5 - - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: system not found" >&5 -$as_echo "system not found" >&6; } - as_fn_error $? "--with-zlib=system specified, but no zlib found!" "$LINENO" 5 - fi - else - as_fn_error $? "Invalid value for --with-zlib: ${with_zlib}, use 'system' or 'bundled'" "$LINENO" 5 - fi - - - - - -# Check whether --with-lcms was given. -if test "${with_lcms+set}" = set; then : - withval=$with_lcms; -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for which lcms to use" >&5 -$as_echo_n "checking for which lcms to use... " >&6; } - - DEFAULT_LCMS=bundled - # If user didn't specify, use DEFAULT_LCMS - if test "x${with_lcms}" = "x"; then - with_lcms=${DEFAULT_LCMS} - fi - - if test "x${with_lcms}" = "xbundled"; then - USE_EXTERNAL_LCMS=false - LCMS_CFLAGS="" - LCMS_LIBS="" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: bundled" >&5 -$as_echo "bundled" >&6; } - elif test "x${with_lcms}" = "xsystem"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: system" >&5 -$as_echo "system" >&6; } - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LCMS" >&5 -$as_echo_n "checking for LCMS... " >&6; } - -if test -n "$LCMS_CFLAGS"; then - pkg_cv_LCMS_CFLAGS="$LCMS_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lcms2\""; } >&5 - ($PKG_CONFIG --exists --print-errors "lcms2") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LCMS_CFLAGS=`$PKG_CONFIG --cflags "lcms2" 2>/dev/null` -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$LCMS_LIBS"; then - pkg_cv_LCMS_LIBS="$LCMS_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lcms2\""; } >&5 - ($PKG_CONFIG --exists --print-errors "lcms2") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LCMS_LIBS=`$PKG_CONFIG --libs "lcms2" 2>/dev/null` -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - LCMS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "lcms2" 2>&1` - else - LCMS_PKG_ERRORS=`$PKG_CONFIG --print-errors "lcms2" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$LCMS_PKG_ERRORS" >&5 - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - LCMS_FOUND=no -elif test $pkg_failed = untried; then - LCMS_FOUND=no -else - LCMS_CFLAGS=$pkg_cv_LCMS_CFLAGS - LCMS_LIBS=$pkg_cv_LCMS_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - LCMS_FOUND=yes -fi - if test "x${LCMS_FOUND}" = "xyes"; then - # PKG_CHECK_MODULES will set LCMS_CFLAGS and LCMS_LIBS - USE_EXTERNAL_LCMS=true - else - as_fn_error $? "--with-lcms=system specified, but no lcms found!" "$LINENO" 5 - fi - else - as_fn_error $? "Invalid value for --with-lcms: ${with_lcms}, use 'system' or 'bundled'" "$LINENO" 5 - fi - - - - - - - - - - - - - - # Setup libm (the maths library) - if test "x$OPENJDK_TARGET_OS" != "xwindows"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 -$as_echo_n "checking for cos in -lm... " >&6; } -if ${ac_cv_lib_m_cos+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char cos (); -int -main () -{ -return cos (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_m_cos=yes -else - ac_cv_lib_m_cos=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5 -$as_echo "$ac_cv_lib_m_cos" >&6; } -if test "x$ac_cv_lib_m_cos" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBM 1 -_ACEOF - - LIBS="-lm $LIBS" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: Maths library was not found" >&5 -$as_echo "$as_me: Maths library was not found" >&6;} - -fi - - LIBM="-lm" - else - LIBM="" - fi - - - # Setup libdl (for dynamic library loading) - save_LIBS="$LIBS" - LIBS="" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBDL 1 -_ACEOF - - LIBS="-ldl $LIBS" - -fi - - LIBDL="$LIBS" - - LIBS="$save_LIBS" - - # Deprecated libraries, keep the flags for backwards compatibility - if test "x$OPENJDK_TARGET_OS" = "xwindows"; then - - -# Check whether --with-dxsdk was given. -if test "${with_dxsdk+set}" = set; then : - withval=$with_dxsdk; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --with-dxsdk is deprecated and will be ignored." >&5 -$as_echo "$as_me: WARNING: Option --with-dxsdk is deprecated and will be ignored." >&2;} -fi - - - - -# Check whether --with-dxsdk-lib was given. -if test "${with_dxsdk_lib+set}" = set; then : - withval=$with_dxsdk_lib; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --with-dxsdk-lib is deprecated and will be ignored." >&5 -$as_echo "$as_me: WARNING: Option --with-dxsdk-lib is deprecated and will be ignored." >&2;} -fi - - - - -# Check whether --with-dxsdk-include was given. -if test "${with_dxsdk_include+set}" = set; then : - withval=$with_dxsdk_include; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --with-dxsdk-include is deprecated and will be ignored." >&5 -$as_echo "$as_me: WARNING: Option --with-dxsdk-include is deprecated and will be ignored." >&2;} -fi - - - fi - - # Control if libzip can use mmap. Available for purposes of overriding. - LIBZIP_CAN_USE_MMAP=true - - - - if test "$OPENJDK_TARGET_OS" = "solaris" && test "x$BUILD_GTEST" = "xtrue"; then - # Find the root of the Solaris Studio installation from the compiler path - SOLARIS_STUDIO_DIR="$(dirname $CC)/.." - STLPORT_LIB="$SOLARIS_STUDIO_DIR/lib/stlport4$OPENJDK_TARGET_CPU_ISADIR/libstlport.so.1" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libstlport.so.1" >&5 -$as_echo_n "checking for libstlport.so.1... " >&6; } - if ! test -f "$STLPORT_LIB" && test "x$OPENJDK_TARGET_CPU_ISADIR" = "x/sparcv9"; then - # SS12u3 has libstlport under 'stlport4/v9' instead of 'stlport4/sparcv9' - STLPORT_LIB="$SOLARIS_STUDIO_DIR/lib/stlport4/v9/libstlport.so.1" - fi - if test -f "$STLPORT_LIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, $STLPORT_LIB" >&5 -$as_echo "yes, $STLPORT_LIB" >&6; } - - # Only process if variable expands to non-empty - - if test "x$STLPORT_LIB" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$STLPORT_LIB" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STLPORT_LIB, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of STLPORT_LIB, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of STLPORT_LIB" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - STLPORT_LIB="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STLPORT_LIB to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting STLPORT_LIB to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$STLPORT_LIB" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - STLPORT_LIB="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STLPORT_LIB to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting STLPORT_LIB to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a unix platform. Hooray! :) - path="$STLPORT_LIB" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STLPORT_LIB, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of STLPORT_LIB, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of STLPORT_LIB, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - if test -d "$path"; then - STLPORT_LIB="`cd "$path"; $THEPWDCMD -L`" - else - dir="`$DIRNAME "$path"`" - base="`$BASENAME "$path"`" - STLPORT_LIB="`cd "$dir"; $THEPWDCMD -L`/$base" - fi - fi - fi - - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, not found at $STLPORT_LIB" >&5 -$as_echo "no, not found at $STLPORT_LIB" >&6; } - as_fn_error $? "Failed to find libstlport.so.1, cannot build Hotspot gtests" "$LINENO" 5 - fi - - fi - - - - - - - - - - - - - - -# Hotspot setup depends on lib checks. - - - # The user can in some cases supply additional jvm features. For the custom - # variant, this defines the entire variant. - -# Check whether --with-jvm-features was given. -if test "${with_jvm_features+set}" = set; then : - withval=$with_jvm_features; -fi - - if test "x$with_jvm_features" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking additional JVM features" >&5 -$as_echo_n "checking additional JVM features... " >&6; } - JVM_FEATURES=`$ECHO $with_jvm_features | $SED -e 's/,/ /g'` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JVM_FEATURES" >&5 -$as_echo "$JVM_FEATURES" >&6; } - fi - - # Override hotspot cpu definitions for ARM platforms - if test "x$OPENJDK_TARGET_CPU" = xarm; then - HOTSPOT_TARGET_CPU=arm_32 - HOTSPOT_TARGET_CPU_DEFINE="ARM32" - JVM_LDFLAGS="$JVM_LDFLAGS -fsigned-char" - JVM_CFLAGS="$JVM_CFLAGS -DARM -fsigned-char" - elif test "x$OPENJDK_TARGET_CPU" = xaarch64 && test "x$HOTSPOT_TARGET_CPU_PORT" = xarm64; then - HOTSPOT_TARGET_CPU=arm_64 - HOTSPOT_TARGET_CPU_ARCH=arm - JVM_LDFLAGS="$JVM_LDFLAGS -fsigned-char" - JVM_CFLAGS="$JVM_CFLAGS -DARM -fsigned-char" - fi - - # Verify that dependencies are met for explicitly set features. - if [[ " $JVM_FEATURES " =~ " jvmti " ]] && ! [[ " $JVM_FEATURES " =~ " services " ]] ; then - as_fn_error $? "Specified JVM feature 'jvmti' requires feature 'services'" "$LINENO" 5 - fi - - if [[ " $JVM_FEATURES " =~ " management " ]] && ! [[ " $JVM_FEATURES " =~ " nmt " ]] ; then - as_fn_error $? "Specified JVM feature 'management' requires feature 'nmt'" "$LINENO" 5 - fi - - if [[ " $JVM_FEATURES " =~ " jvmci " ]] && ! ( [[ " $JVM_FEATURES " =~ " compiler1 " ]] || [[ " $JVM_FEATURES " =~ " compiler2 " ]] ); then - as_fn_error $? "Specified JVM feature 'jvmci' requires feature 'compiler2' or 'compiler1'" "$LINENO" 5 - fi - - if [[ " $JVM_FEATURES " =~ " compiler2 " ]] && ! [[ " $JVM_FEATURES " =~ " all-gcs " ]] ; then - as_fn_error $? "Specified JVM feature 'compiler2' requires feature 'all-gcs'" "$LINENO" 5 - fi - - if [[ " $JVM_FEATURES " =~ " vm-structs " ]] && ! [[ " $JVM_FEATURES " =~ " all-gcs " ]] ; then - as_fn_error $? "Specified JVM feature 'vm-structs' requires feature 'all-gcs'" "$LINENO" 5 - fi - - # Turn on additional features based on other parts of configure - if test "x$INCLUDE_DTRACE" = "xtrue"; then - JVM_FEATURES="$JVM_FEATURES dtrace" - else - if [[ " $JVM_FEATURES " =~ " dtrace " ]] ; then - as_fn_error $? "To enable dtrace, you must use --enable-dtrace" "$LINENO" 5 - fi - fi - - if test "x$STATIC_BUILD" = "xtrue"; then - JVM_FEATURES="$JVM_FEATURES static-build" - else - if [[ " $JVM_FEATURES " =~ " static-build " ]] ; then - as_fn_error $? "To enable static-build, you must use --enable-static-build" "$LINENO" 5 - fi - fi - - if ! [[ " $JVM_VARIANTS " =~ " zero " ]] ; then - if [[ " $JVM_FEATURES " =~ " zero " ]] ; then - as_fn_error $? "To enable zero, you must use --with-jvm-variants=zero" "$LINENO" 5 - fi - fi - - # Only enable jvmci on x86_64, sparcv9 and aarch64. - if test "x$OPENJDK_TARGET_CPU" = "xx86_64" || \ - test "x$OPENJDK_TARGET_CPU" = "xsparcv9" || \ - test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then - JVM_FEATURES_jvmci="jvmci" - else - JVM_FEATURES_jvmci="" - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if jdk.internal.vm.compiler should be built" >&5 -$as_echo_n "checking if jdk.internal.vm.compiler should be built... " >&6; } - if [[ " $JVM_FEATURES " =~ " graal " ]] ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, forced" >&5 -$as_echo "yes, forced" >&6; } - if test "x$JVM_FEATURES_jvmci" != "xjvmci" ; then - as_fn_error $? "Specified JVM feature 'graal' requires feature 'jvmci'" "$LINENO" 5 - fi - INCLUDE_GRAAL="true" - else - # By default enable graal build on linux-x64 or where AOT is available. - # graal build requires jvmci. - if test "x$JVM_FEATURES_jvmci" = "xjvmci" && \ - (test "x$OPENJDK_TARGET_CPU" = "xx86_64" && \ - test "x$OPENJDK_TARGET_OS" = "xlinux" || \ - test "x$ENABLE_AOT" = "xtrue") ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - JVM_FEATURES_graal="graal" - INCLUDE_GRAAL="true" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - JVM_FEATURES_graal="" - INCLUDE_GRAAL="false" - fi - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if aot should be enabled" >&5 -$as_echo_n "checking if aot should be enabled... " >&6; } - if test "x$ENABLE_AOT" = "xtrue"; then - if test "x$enable_aot" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, forced" >&5 -$as_echo "yes, forced" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - fi - JVM_FEATURES_aot="aot" - else - if test "x$enable_aot" = "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, forced" >&5 -$as_echo "no, forced" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - JVM_FEATURES_aot="" - fi - - if test "x$OPENJDK_TARGET_CPU" = xarm ; then - # Default to use link time optimizations on minimal on arm - JVM_FEATURES_link_time_opt="link-time-opt" - else - JVM_FEATURES_link_time_opt="" - fi - - # All variants but minimal (and custom) get these features - NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES jvmti vm-structs jni-check services management all-gcs nmt" - if test "x$ENABLE_CDS" = "xtrue"; then - NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES cds" - fi - - # Enable features depending on variant. - JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci $JVM_FEATURES_aot $JVM_FEATURES_graal" - JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci" - JVM_FEATURES_core="$NON_MINIMAL_FEATURES $JVM_FEATURES" - JVM_FEATURES_minimal="compiler1 minimal $JVM_FEATURES $JVM_FEATURES_link_time_opt" - JVM_FEATURES_zero="zero $NON_MINIMAL_FEATURES $JVM_FEATURES" - JVM_FEATURES_custom="$JVM_FEATURES" - - - - - - - - - # Used for verification of Makefiles by check-jvm-feature - - - # We don't support --with-jvm-interpreter anymore, use zero instead. - - -# Check whether --with-jvm-interpreter was given. -if test "${with_jvm_interpreter+set}" = set; then : - withval=$with_jvm_interpreter; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --with-jvm-interpreter is deprecated and will be ignored." >&5 -$as_echo "$as_me: WARNING: Option --with-jvm-interpreter is deprecated and will be ignored." >&2;} -fi - - - - -############################################################################### -# -# We need to do some final tweaking, when everything else is done. -# -############################################################################### - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if elliptic curve crypto implementation is present" >&5 -$as_echo_n "checking if elliptic curve crypto implementation is present... " >&6; } - - if test -d "${TOPDIR}/src/jdk.crypto.ec/share/native/libsunec/impl"; then - ENABLE_INTREE_EC=true - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - ENABLE_INTREE_EC=false - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - - - - - # Check whether --enable-jtreg-failure-handler was given. -if test "${enable_jtreg_failure_handler+set}" = set; then : - enableval=$enable_jtreg_failure_handler; -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if jtreg failure handler should be built" >&5 -$as_echo_n "checking if jtreg failure handler should be built... " >&6; } - - if test "x$enable_jtreg_failure_handler" = "xyes"; then - if test "x$JT_HOME" = "x"; then - as_fn_error $? "Cannot enable jtreg failure handler without jtreg." "$LINENO" 5 - else - BUILD_FAILURE_HANDLER=true - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, forced" >&5 -$as_echo "yes, forced" >&6; } - fi - elif test "x$enable_jtreg_failure_handler" = "xno"; then - BUILD_FAILURE_HANDLER=false - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, forced" >&5 -$as_echo "no, forced" >&6; } - elif test "x$enable_jtreg_failure_handler" = "xauto" \ - || test "x$enable_jtreg_failure_handler" = "x"; then - if test "x$JT_HOME" = "x"; then - BUILD_FAILURE_HANDLER=false - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, missing jtreg" >&5 -$as_echo "no, missing jtreg" >&6; } - else - BUILD_FAILURE_HANDLER=true - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, jtreg present" >&5 -$as_echo "yes, jtreg present" >&6; } - fi - else - as_fn_error $? "Invalid value for --enable-jtreg-failure-handler: $enable_jtreg_failure_handler" "$LINENO" 5 - fi - - - - - # Check whether --enable-generate-classlist was given. -if test "${enable_generate_classlist+set}" = set; then : - enableval=$enable_generate_classlist; -fi - - - # Check if it's likely that it's possible to generate the classlist. Depending - # on exact jvm configuration it could be possible anyway. - if test "x$ENABLE_CDS" = "xtrue" && ( [[ " $JVM_VARIANTS " =~ " server " ]] || [[ " $JVM_VARIANTS " =~ " client " ]] ); then - ENABLE_GENERATE_CLASSLIST_POSSIBLE="true" - else - ENABLE_GENERATE_CLASSLIST_POSSIBLE="false" - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the CDS classlist generation should be enabled" >&5 -$as_echo_n "checking if the CDS classlist generation should be enabled... " >&6; } - if test "x$enable_generate_classlist" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, forced" >&5 -$as_echo "yes, forced" >&6; } - ENABLE_GENERATE_CLASSLIST="true" - if test "x$ENABLE_GENERATE_CLASSLIST_POSSIBLE" = "xfalse"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Generation of classlist might not be possible with JVM Variants $JVM_VARIANTS and enable-cds=$ENABLE_CDS" >&5 -$as_echo "$as_me: WARNING: Generation of classlist might not be possible with JVM Variants $JVM_VARIANTS and enable-cds=$ENABLE_CDS" >&2;} - fi - elif test "x$enable_generate_classlist" = "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, forced" >&5 -$as_echo "no, forced" >&6; } - ENABLE_GENERATE_CLASSLIST="false" - elif test "x$enable_generate_classlist" = "x"; then - if test "x$ENABLE_GENERATE_CLASSLIST_POSSIBLE" = "xtrue"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ENABLE_GENERATE_CLASSLIST="true" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ENABLE_GENERATE_CLASSLIST="false" - fi - else - as_fn_error $? "Invalid value for --enable-generate-classlist: $enable_generate_classlist" "$LINENO" 5 - fi - - - - -############################################################################### -# -# Configure parts of the build that only affect the build performance, -# not the result. -# -############################################################################### - - - # How many cores do we have on this build system? - -# Check whether --with-num-cores was given. -if test "${with_num_cores+set}" = set; then : - withval=$with_num_cores; -fi - - if test "x$with_num_cores" = x; then - # The number of cores were not specified, try to probe them. - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for number of cores" >&5 -$as_echo_n "checking for number of cores... " >&6; } - NUM_CORES=1 - FOUND_CORES=no - - if test -f /proc/cpuinfo; then - # Looks like a Linux (or cygwin) system - NUM_CORES=`cat /proc/cpuinfo | grep -c processor` - FOUND_CORES=yes - elif test -x /usr/sbin/psrinfo; then - # Looks like a Solaris system - NUM_CORES=`LC_MESSAGES=C /usr/sbin/psrinfo -v | grep -c on-line` - FOUND_CORES=yes - elif test -x /usr/sbin/sysctl; then - # Looks like a MacOSX system - NUM_CORES=`/usr/sbin/sysctl -n hw.ncpu` - FOUND_CORES=yes - elif test "x$OPENJDK_BUILD_OS" = xaix ; then - NUM_CORES=`/usr/sbin/prtconf | grep "^Number Of Processors" | awk '{ print $4 }'` - FOUND_CORES=yes - elif test -n "$NUMBER_OF_PROCESSORS"; then - # On windows, look in the env - NUM_CORES=$NUMBER_OF_PROCESSORS - FOUND_CORES=yes - fi - - if test "x$FOUND_CORES" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NUM_CORES" >&5 -$as_echo "$NUM_CORES" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not detect number of cores, defaulting to 1" >&5 -$as_echo "could not detect number of cores, defaulting to 1" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This will disable all parallelism from build!" >&5 -$as_echo "$as_me: WARNING: This will disable all parallelism from build!" >&2;} - fi - - else - NUM_CORES=$with_num_cores - fi - - - - # How much memory do we have on this build system? - -# Check whether --with-memory-size was given. -if test "${with_memory_size+set}" = set; then : - withval=$with_memory_size; -fi - - if test "x$with_memory_size" = x; then - # The memory size was not specified, try to probe it. - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for memory size" >&5 -$as_echo_n "checking for memory size... " >&6; } - # Default to 1024 MB - MEMORY_SIZE=1024 - FOUND_MEM=no - - if test -f /proc/meminfo; then - # Looks like a Linux (or cygwin) system - MEMORY_SIZE=`cat /proc/meminfo | grep MemTotal | awk '{print $2}'` - MEMORY_SIZE=`expr $MEMORY_SIZE / 1024` - FOUND_MEM=yes - elif test -x /usr/sbin/prtconf; then - # Looks like a Solaris or AIX system - MEMORY_SIZE=`/usr/sbin/prtconf 2> /dev/null | grep "^Memory [Ss]ize" | awk '{ print $3 }'` - FOUND_MEM=yes - elif test -x /usr/sbin/sysctl; then - # Looks like a MacOSX system - MEMORY_SIZE=`/usr/sbin/sysctl -n hw.memsize` - MEMORY_SIZE=`expr $MEMORY_SIZE / 1024 / 1024` - FOUND_MEM=yes - elif test "x$OPENJDK_BUILD_OS" = xwindows; then - # Windows, but without cygwin - MEMORY_SIZE=`wmic computersystem get totalphysicalmemory -value | grep = | cut -d "=" -f 2-` - MEMORY_SIZE=`expr $MEMORY_SIZE / 1024 / 1024` - FOUND_MEM=yes - fi - - if test "x$FOUND_MEM" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MEMORY_SIZE MB" >&5 -$as_echo "$MEMORY_SIZE MB" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not detect memory size, defaulting to $MEMORY_SIZE MB" >&5 -$as_echo "could not detect memory size, defaulting to $MEMORY_SIZE MB" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This might seriously impact build performance!" >&5 -$as_echo "$as_me: WARNING: This might seriously impact build performance!" >&2;} - fi - - else - MEMORY_SIZE=$with_memory_size - fi - - - - # Provide a decent default number of parallel jobs for make depending on - # number of cores, amount of memory and machine architecture. - -# Check whether --with-jobs was given. -if test "${with_jobs+set}" = set; then : - withval=$with_jobs; -fi - - if test "x$with_jobs" = x; then - # Number of jobs was not specified, calculate. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for appropriate number of jobs to run in parallel" >&5 -$as_echo_n "checking for appropriate number of jobs to run in parallel... " >&6; } - # Approximate memory in GB. - memory_gb=`expr $MEMORY_SIZE / 1024` - # Pick the lowest of memory in gb and number of cores. - if test "$memory_gb" -lt "$NUM_CORES"; then - JOBS="$memory_gb" - else - JOBS="$NUM_CORES" - fi - if test "$JOBS" -eq "0"; then - JOBS=1 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JOBS" >&5 -$as_echo "$JOBS" >&6; } - else - JOBS=$with_jobs - fi - - - - # The number of test jobs will be chosen automatically if TEST_JOBS is 0 - -# Check whether --with-test-jobs was given. -if test "${with_test_jobs+set}" = set; then : - withval=$with_test_jobs; -fi - - if test "x$with_test_jobs" = x; then - TEST_JOBS=0 - else - TEST_JOBS=$with_test_jobs - fi - - - -# Setup arguments for the boot jdk (after cores and memory have been setup) - - ############################################################################## - # - # Specify jvm options for anything that is run with the Boot JDK. - # Not all JVM:s accept the same arguments on the command line. - # - -# Check whether --with-boot-jdk-jvmargs was given. -if test "${with_boot_jdk_jvmargs+set}" = set; then : - withval=$with_boot_jdk_jvmargs; -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking flags for boot jdk java command " >&5 -$as_echo_n "checking flags for boot jdk java command ... " >&6; } - - # Force en-US environment - - $ECHO "Check if jvm arg is ok: -Duser.language=en -Duser.country=US" >&5 - $ECHO "Command: $JAVA -Duser.language=en -Duser.country=US -version" >&5 - OUTPUT=`$JAVA -Duser.language=en -Duser.country=US -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | $GREP -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | $GREP " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - boot_jdk_jvmargs="$boot_jdk_jvmargs -Duser.language=en -Duser.country=US" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi - - - if test "x$BOOTJDK_USE_LOCAL_CDS" = xtrue; then - # Use our own CDS archive - - $ECHO "Check if jvm arg is ok: $boot_jdk_cds_args -Xshare:auto" >&5 - $ECHO "Command: $JAVA $boot_jdk_cds_args -Xshare:auto -version" >&5 - OUTPUT=`$JAVA $boot_jdk_cds_args -Xshare:auto -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | $GREP -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | $GREP " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - boot_jdk_jvmargs="$boot_jdk_jvmargs $boot_jdk_cds_args -Xshare:auto" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi - - else - # Otherwise optimistically use the system-wide one, if one is present - - $ECHO "Check if jvm arg is ok: -Xshare:auto" >&5 - $ECHO "Command: $JAVA -Xshare:auto -version" >&5 - OUTPUT=`$JAVA -Xshare:auto -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | $GREP -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | $GREP " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - boot_jdk_jvmargs="$boot_jdk_jvmargs -Xshare:auto" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi - - fi - - # Apply user provided options. - - $ECHO "Check if jvm arg is ok: $with_boot_jdk_jvmargs" >&5 - $ECHO "Command: $JAVA $with_boot_jdk_jvmargs -version" >&5 - OUTPUT=`$JAVA $with_boot_jdk_jvmargs -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | $GREP -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | $GREP " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - boot_jdk_jvmargs="$boot_jdk_jvmargs $with_boot_jdk_jvmargs" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boot_jdk_jvmargs" >&5 -$as_echo "$boot_jdk_jvmargs" >&6; } - - # For now, general JAVA_FLAGS are the same as the boot jdk jvmargs - JAVA_FLAGS=$boot_jdk_jvmargs - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking flags for boot jdk java command for big workloads" >&5 -$as_echo_n "checking flags for boot jdk java command for big workloads... " >&6; } - - # Starting amount of heap memory. - - $ECHO "Check if jvm arg is ok: -Xms64M" >&5 - $ECHO "Command: $JAVA -Xms64M -version" >&5 - OUTPUT=`$JAVA -Xms64M -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | $GREP -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | $GREP " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - boot_jdk_jvmargs_big="$boot_jdk_jvmargs_big -Xms64M" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi - - BOOTCYCLE_JVM_ARGS_BIG=-Xms64M - - # Maximum amount of heap memory and stack size. - JVM_HEAP_LIMIT_32="1024" - # Running a 64 bit JVM allows for and requires a bigger heap - JVM_HEAP_LIMIT_64="1600" - STACK_SIZE_32=768 - STACK_SIZE_64=1536 - JVM_HEAP_LIMIT_GLOBAL=`expr $MEMORY_SIZE / 2` - if test "$JVM_HEAP_LIMIT_GLOBAL" -lt "$JVM_HEAP_LIMIT_32"; then - JVM_HEAP_LIMIT_32=$JVM_HEAP_LIMIT_GLOBAL - fi - if test "$JVM_HEAP_LIMIT_GLOBAL" -lt "$JVM_HEAP_LIMIT_64"; then - JVM_HEAP_LIMIT_64=$JVM_HEAP_LIMIT_GLOBAL - fi - if test "$JVM_HEAP_LIMIT_GLOBAL" -lt "512"; then - JVM_HEAP_LIMIT_32=512 - JVM_HEAP_LIMIT_64=512 - fi - - if test "x$BOOT_JDK_BITS" = "x32"; then - STACK_SIZE=$STACK_SIZE_32 - JVM_MAX_HEAP=$JVM_HEAP_LIMIT_32 - else - STACK_SIZE=$STACK_SIZE_64 - JVM_MAX_HEAP=$JVM_HEAP_LIMIT_64 - fi - - $ECHO "Check if jvm arg is ok: -Xmx${JVM_MAX_HEAP}M" >&5 - $ECHO "Command: $JAVA -Xmx${JVM_MAX_HEAP}M -version" >&5 - OUTPUT=`$JAVA -Xmx${JVM_MAX_HEAP}M -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | $GREP -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | $GREP " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - boot_jdk_jvmargs_big="$boot_jdk_jvmargs_big -Xmx${JVM_MAX_HEAP}M" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi - - - $ECHO "Check if jvm arg is ok: -XX:ThreadStackSize=$STACK_SIZE" >&5 - $ECHO "Command: $JAVA -XX:ThreadStackSize=$STACK_SIZE -version" >&5 - OUTPUT=`$JAVA -XX:ThreadStackSize=$STACK_SIZE -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | $GREP -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | $GREP " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - boot_jdk_jvmargs_big="$boot_jdk_jvmargs_big -XX:ThreadStackSize=$STACK_SIZE" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boot_jdk_jvmargs_big" >&5 -$as_echo "$boot_jdk_jvmargs_big" >&6; } - - JAVA_FLAGS_BIG=$boot_jdk_jvmargs_big - - - if test "x$OPENJDK_TARGET_CPU_BITS" = "x32"; then - BOOTCYCLE_MAX_HEAP=$JVM_HEAP_LIMIT_32 - BOOTCYCLE_STACK_SIZE=$STACK_SIZE_32 - else - BOOTCYCLE_MAX_HEAP=$JVM_HEAP_LIMIT_64 - BOOTCYCLE_STACK_SIZE=$STACK_SIZE_64 - fi - BOOTCYCLE_JVM_ARGS_BIG="$BOOTCYCLE_JVM_ARGS_BIG -Xmx${BOOTCYCLE_MAX_HEAP}M" - BOOTCYCLE_JVM_ARGS_BIG="$BOOTCYCLE_JVM_ARGS_BIG -XX:ThreadStackSize=$BOOTCYCLE_STACK_SIZE" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking flags for bootcycle boot jdk java command for big workloads" >&5 -$as_echo_n "checking flags for bootcycle boot jdk java command for big workloads... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOTCYCLE_JVM_ARGS_BIG" >&5 -$as_echo "$BOOTCYCLE_JVM_ARGS_BIG" >&6; } - - - # By default, the main javac compilations use big - JAVA_FLAGS_JAVAC="$JAVA_FLAGS_BIG" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking flags for boot jdk java command for small workloads" >&5 -$as_echo_n "checking flags for boot jdk java command for small workloads... " >&6; } - - # Use serial gc for small short lived tools if possible - - $ECHO "Check if jvm arg is ok: -XX:+UseSerialGC" >&5 - $ECHO "Command: $JAVA -XX:+UseSerialGC -version" >&5 - OUTPUT=`$JAVA -XX:+UseSerialGC -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | $GREP -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | $GREP " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - boot_jdk_jvmargs_small="$boot_jdk_jvmargs_small -XX:+UseSerialGC" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi - - - $ECHO "Check if jvm arg is ok: -Xms32M" >&5 - $ECHO "Command: $JAVA -Xms32M -version" >&5 - OUTPUT=`$JAVA -Xms32M -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | $GREP -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | $GREP " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - boot_jdk_jvmargs_small="$boot_jdk_jvmargs_small -Xms32M" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi - - - $ECHO "Check if jvm arg is ok: -Xmx512M" >&5 - $ECHO "Command: $JAVA -Xmx512M -version" >&5 - OUTPUT=`$JAVA -Xmx512M -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | $GREP -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | $GREP " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - boot_jdk_jvmargs_small="$boot_jdk_jvmargs_small -Xmx512M" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi - - - $ECHO "Check if jvm arg is ok: -XX:TieredStopAtLevel=1" >&5 - $ECHO "Command: $JAVA -XX:TieredStopAtLevel=1 -version" >&5 - OUTPUT=`$JAVA -XX:TieredStopAtLevel=1 -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | $GREP -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | $GREP " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - boot_jdk_jvmargs_small="$boot_jdk_jvmargs_small -XX:TieredStopAtLevel=1" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boot_jdk_jvmargs_small" >&5 -$as_echo "$boot_jdk_jvmargs_small" >&6; } - - JAVA_FLAGS_SMALL=$boot_jdk_jvmargs_small - - - JAVA_TOOL_FLAGS_SMALL="" - for f in $JAVA_FLAGS_SMALL; do - JAVA_TOOL_FLAGS_SMALL="$JAVA_TOOL_FLAGS_SMALL -J$f" - done - - - -# Setup smart javac (after cores and memory have been setup) - - -# Check whether --with-sjavac-server-java was given. -if test "${with_sjavac_server_java+set}" = set; then : - withval=$with_sjavac_server_java; -fi - - - if test "x$with_sjavac_server_java" != x; then - SJAVAC_SERVER_JAVA="$with_sjavac_server_java" - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -version 2>&1 | grep " version \""` - if test "x$FOUND_VERSION" = x; then - as_fn_error $? "Could not execute server java: $SJAVAC_SERVER_JAVA" "$LINENO" 5 - fi - else - SJAVAC_SERVER_JAVA="$JAVA" - fi - - - if test "$MEMORY_SIZE" -gt "3000"; then - if "$JAVA" -version 2>&1 | $GREP -q "64-Bit"; then - JVM_64BIT=true - fi - fi - - MX_VALUE=`expr $MEMORY_SIZE / 2` - if test "$JVM_64BIT" = true; then - # Set ms lower than mx since more than one instance of the server might - # get launched at the same time before they figure out which instance won. - MS_VALUE=512 - if test "$MX_VALUE" -gt "2048"; then - MX_VALUE=2048 - fi - else - MS_VALUE=256 - if test "$MX_VALUE" -gt "1500"; then - MX_VALUE=1500 - fi - fi - if test "$MX_VALUE" -lt "512"; then - MX_VALUE=512 - fi - - $ECHO "Check if jvm arg is ok: -Xms${MS_VALUE}M -Xmx${MX_VALUE}M" >&5 - $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms${MS_VALUE}M -Xmx${MX_VALUE}M -version" >&5 - OUTPUT=`$SJAVAC_SERVER_JAVA -Xms${MS_VALUE}M -Xmx${MX_VALUE}M -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | $GREP -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | $GREP " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - SJAVAC_SERVER_JAVA_FLAGS="$SJAVAC_SERVER_JAVA_FLAGS -Xms${MS_VALUE}M -Xmx${MX_VALUE}M" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi - - - - # Check whether --enable-sjavac was given. -if test "${enable_sjavac+set}" = set; then : - enableval=$enable_sjavac; ENABLE_SJAVAC="${enableval}" -else - ENABLE_SJAVAC="no" -fi - - if test "x$JVM_ARG_OK" = "xfalse"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not set -Xms${MS_VALUE}M -Xmx${MX_VALUE}M, disabling sjavac" >&5 -$as_echo "$as_me: WARNING: Could not set -Xms${MS_VALUE}M -Xmx${MX_VALUE}M, disabling sjavac" >&2;} - ENABLE_SJAVAC="no" - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use sjavac" >&5 -$as_echo_n "checking whether to use sjavac... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLE_SJAVAC" >&5 -$as_echo "$ENABLE_SJAVAC" >&6; } - - - # Check whether --enable-javac-server was given. -if test "${enable_javac_server+set}" = set; then : - enableval=$enable_javac_server; ENABLE_JAVAC_SERVER="${enableval}" -else - ENABLE_JAVAC_SERVER="yes" -fi - - if test "x$JVM_ARG_OK" = "xfalse"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not set -Xms${MS_VALUE}M -Xmx${MX_VALUE}M, disabling javac server" >&5 -$as_echo "$as_me: WARNING: Could not set -Xms${MS_VALUE}M -Xmx${MX_VALUE}M, disabling javac server" >&2;} - ENABLE_JAVAC_SERVER="no" - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use javac server" >&5 -$as_echo_n "checking whether to use javac server... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLE_JAVAC_SERVER" >&5 -$as_echo "$ENABLE_JAVAC_SERVER" >&6; } - - - if test "x$ENABLE_JAVAC_SERVER" = "xyes" || test "x$ENABLE_SJAVAC" = "xyes"; then - # When using a server javac, the small client instances do not need much - # resources. - JAVA_FLAGS_JAVAC="$JAVA_FLAGS_SMALL" - fi - - -# Setup use of icecc if requested - - # Check whether --enable-icecc was given. -if test "${enable_icecc+set}" = set; then : - enableval=$enable_icecc; -fi - - - if test "x${enable_icecc}" = "xyes"; then - - - - # Publish this variable in the help. - - - if [ -z "${ICECC_CMD+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in icecc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ICECC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ICECC_CMD in - [\\/]* | ?:[\\/]*) - ac_cv_path_ICECC_CMD="$ICECC_CMD" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ICECC_CMD="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ICECC_CMD=$ac_cv_path_ICECC_CMD -if test -n "$ICECC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ICECC_CMD" >&5 -$as_echo "$ICECC_CMD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ICECC_CMD" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !ICECC_CMD! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!ICECC_CMD!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xICECC_CMD" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of ICECC_CMD from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of ICECC_CMD from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in icecc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ICECC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ICECC_CMD in - [\\/]* | ?:[\\/]*) - ac_cv_path_ICECC_CMD="$ICECC_CMD" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ICECC_CMD="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ICECC_CMD=$ac_cv_path_ICECC_CMD -if test -n "$ICECC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ICECC_CMD" >&5 -$as_echo "$ICECC_CMD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ICECC_CMD" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$ICECC_CMD" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool ICECC_CMD= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool ICECC_CMD= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ICECC_CMD" >&5 -$as_echo_n "checking for ICECC_CMD... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$ICECC_CMD" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool ICECC_CMD=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool ICECC_CMD=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ICECC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ICECC_CMD in - [\\/]* | ?:[\\/]*) - ac_cv_path_ICECC_CMD="$ICECC_CMD" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ICECC_CMD="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ICECC_CMD=$ac_cv_path_ICECC_CMD -if test -n "$ICECC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ICECC_CMD" >&5 -$as_echo "$ICECC_CMD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$ICECC_CMD" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool ICECC_CMD=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool ICECC_CMD=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ICECC_CMD" >&5 -$as_echo_n "checking for ICECC_CMD... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool ICECC_CMD=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$ICECC_CMD" = x; then - as_fn_error $? "Could not find required tool for ICECC_CMD" "$LINENO" 5 - fi - - - old_path="$PATH" - - # Look for icecc-create-env in some known places - PATH="$PATH:/usr/lib/icecc:/usr/lib64/icecc" - - - - # Publish this variable in the help. - - - if [ -z "${ICECC_CREATE_ENV+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in icecc-create-env -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ICECC_CREATE_ENV+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ICECC_CREATE_ENV in - [\\/]* | ?:[\\/]*) - ac_cv_path_ICECC_CREATE_ENV="$ICECC_CREATE_ENV" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ICECC_CREATE_ENV="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ICECC_CREATE_ENV=$ac_cv_path_ICECC_CREATE_ENV -if test -n "$ICECC_CREATE_ENV"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ICECC_CREATE_ENV" >&5 -$as_echo "$ICECC_CREATE_ENV" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ICECC_CREATE_ENV" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !ICECC_CREATE_ENV! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!ICECC_CREATE_ENV!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xICECC_CREATE_ENV" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of ICECC_CREATE_ENV from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of ICECC_CREATE_ENV from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in icecc-create-env -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ICECC_CREATE_ENV+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ICECC_CREATE_ENV in - [\\/]* | ?:[\\/]*) - ac_cv_path_ICECC_CREATE_ENV="$ICECC_CREATE_ENV" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ICECC_CREATE_ENV="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ICECC_CREATE_ENV=$ac_cv_path_ICECC_CREATE_ENV -if test -n "$ICECC_CREATE_ENV"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ICECC_CREATE_ENV" >&5 -$as_echo "$ICECC_CREATE_ENV" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ICECC_CREATE_ENV" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$ICECC_CREATE_ENV" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool ICECC_CREATE_ENV= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool ICECC_CREATE_ENV= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ICECC_CREATE_ENV" >&5 -$as_echo_n "checking for ICECC_CREATE_ENV... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$ICECC_CREATE_ENV" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool ICECC_CREATE_ENV=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool ICECC_CREATE_ENV=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ICECC_CREATE_ENV+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ICECC_CREATE_ENV in - [\\/]* | ?:[\\/]*) - ac_cv_path_ICECC_CREATE_ENV="$ICECC_CREATE_ENV" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ICECC_CREATE_ENV="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ICECC_CREATE_ENV=$ac_cv_path_ICECC_CREATE_ENV -if test -n "$ICECC_CREATE_ENV"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ICECC_CREATE_ENV" >&5 -$as_echo "$ICECC_CREATE_ENV" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$ICECC_CREATE_ENV" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool ICECC_CREATE_ENV=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool ICECC_CREATE_ENV=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ICECC_CREATE_ENV" >&5 -$as_echo_n "checking for ICECC_CREATE_ENV... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool ICECC_CREATE_ENV=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$ICECC_CREATE_ENV" = x; then - as_fn_error $? "Could not find required tool for ICECC_CREATE_ENV" "$LINENO" 5 - fi - - - # Use icecc-create-env to create a minimal compilation environment that can - # be sent to the other hosts in the icecream cluster. - icecc_create_env_log="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/icecc_create_env.log" - ${MKDIR} -p ${CONFIGURESUPPORT_OUTPUTDIR}/icecc - # Older versions of icecc does not have the --gcc parameter - if ${ICECC_CREATE_ENV} | $GREP -q -e --gcc; then - icecc_gcc_arg="--gcc" - fi - if test "x${TOOLCHAIN_TYPE}" = "xgcc"; then - - ( cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \ - && ${ICECC_CREATE_ENV} ${icecc_gcc_arg} ${CC} ${CXX} > \ - ${icecc_create_env_log} 2>&1 ) - if test "$?" != "0"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: icecc-create-env output:" >&5 -$as_echo "$as_me: icecc-create-env output:" >&6;} - cat \ - ${icecc_create_env_log} - as_fn_error $? "Failed to create icecc compiler environment" "$LINENO" 5 - fi - - elif test "x$TOOLCHAIN_TYPE" = "xclang"; then - # For clang, the icecc compilerwrapper is needed. It usually resides next - # to icecc-create-env. - - - - # Publish this variable in the help. - - - if [ -z "${ICECC_WRAPPER+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in compilerwrapper -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ICECC_WRAPPER+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ICECC_WRAPPER in - [\\/]* | ?:[\\/]*) - ac_cv_path_ICECC_WRAPPER="$ICECC_WRAPPER" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ICECC_WRAPPER="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ICECC_WRAPPER=$ac_cv_path_ICECC_WRAPPER -if test -n "$ICECC_WRAPPER"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ICECC_WRAPPER" >&5 -$as_echo "$ICECC_WRAPPER" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ICECC_WRAPPER" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !ICECC_WRAPPER! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!ICECC_WRAPPER!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xICECC_WRAPPER" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of ICECC_WRAPPER from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of ICECC_WRAPPER from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in compilerwrapper -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ICECC_WRAPPER+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ICECC_WRAPPER in - [\\/]* | ?:[\\/]*) - ac_cv_path_ICECC_WRAPPER="$ICECC_WRAPPER" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ICECC_WRAPPER="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ICECC_WRAPPER=$ac_cv_path_ICECC_WRAPPER -if test -n "$ICECC_WRAPPER"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ICECC_WRAPPER" >&5 -$as_echo "$ICECC_WRAPPER" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ICECC_WRAPPER" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$ICECC_WRAPPER" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool ICECC_WRAPPER= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool ICECC_WRAPPER= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ICECC_WRAPPER" >&5 -$as_echo_n "checking for ICECC_WRAPPER... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$ICECC_WRAPPER" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool ICECC_WRAPPER=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool ICECC_WRAPPER=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ICECC_WRAPPER+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ICECC_WRAPPER in - [\\/]* | ?:[\\/]*) - ac_cv_path_ICECC_WRAPPER="$ICECC_WRAPPER" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ICECC_WRAPPER="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ICECC_WRAPPER=$ac_cv_path_ICECC_WRAPPER -if test -n "$ICECC_WRAPPER"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ICECC_WRAPPER" >&5 -$as_echo "$ICECC_WRAPPER" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$ICECC_WRAPPER" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool ICECC_WRAPPER=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool ICECC_WRAPPER=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ICECC_WRAPPER" >&5 -$as_echo_n "checking for ICECC_WRAPPER... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool ICECC_WRAPPER=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$ICECC_WRAPPER" = x; then - as_fn_error $? "Could not find required tool for ICECC_WRAPPER" "$LINENO" 5 - fi - - - - ( cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \ - && ${ICECC_CREATE_ENV} --clang ${CC} ${ICECC_WRAPPER} > ${icecc_create_env_log} 2>&1 ) - if test "$?" != "0"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: icecc-create-env output:" >&5 -$as_echo "$as_me: icecc-create-env output:" >&6;} - cat ${icecc_create_env_log} - as_fn_error $? "Failed to create icecc compiler environment" "$LINENO" 5 - fi - - else - as_fn_error $? "Can only create icecc compiler packages for toolchain types gcc and clang" "$LINENO" 5 - fi - PATH="$old_path" - # The bundle with the compiler gets a name based on checksums. Parse log file - # to find it. - ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log}`" - ICECC_ENV_BUNDLE="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/${ICECC_ENV_BUNDLE_BASENAME}" - if test ! -f ${ICECC_ENV_BUNDLE}; then - as_fn_error $? "icecc-create-env did not produce an environment ${ICECC_ENV_BUNDLE}" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for icecc build environment for target compiler" >&5 -$as_echo_n "checking for icecc build environment for target compiler... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ICECC_ENV_BUNDLE}" >&5 -$as_echo "${ICECC_ENV_BUNDLE}" >&6; } - ICECC="ICECC_VERSION=${ICECC_ENV_BUNDLE} ICECC_CC=${CC} ICECC_CXX=${CXX} ${ICECC_CMD}" - - if test "x${COMPILE_TYPE}" = "xcross"; then - # If cross compiling, create a separate env package for the build compiler - # Assume "gcc" or "cc" is gcc and "clang" is clang. Otherwise bail. - icecc_create_env_log_build="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/icecc_create_env_build.log" - if test "x${BUILD_CC##*/}" = "xgcc" || test "x${BUILD_CC##*/}" = "xcc"; then - - ( cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \ - && ${ICECC_CREATE_ENV} ${icecc_gcc_arg} ${BUILD_CC} ${BUILD_CXX} > \ - ${icecc_create_env_log_build} 2>&1 ) - if test "$?" != "0"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: icecc-create-env output:" >&5 -$as_echo "$as_me: icecc-create-env output:" >&6;} - cat \ - ${icecc_create_env_log_build} - as_fn_error $? "Failed to create icecc compiler environment" "$LINENO" 5 - fi - - elif test "x${BUILD_CC##*/}" = "xclang"; then - - ( cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \ - && ${ICECC_CREATE_ENV} --clang ${BUILD_CC} ${ICECC_WRAPPER} > ${icecc_create_env_log_build} 2>&1 ) - if test "$?" != "0"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: icecc-create-env output:" >&5 -$as_echo "$as_me: icecc-create-env output:" >&6;} - cat ${icecc_create_env_log_build} - as_fn_error $? "Failed to create icecc compiler environment" "$LINENO" 5 - fi - - else - as_fn_error $? "Cannot create icecc compiler package for ${BUILD_CC}" "$LINENO" 5 - fi - ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log_build}`" - ICECC_ENV_BUNDLE="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/${ICECC_ENV_BUNDLE_BASENAME}" - if test ! -f ${ICECC_ENV_BUNDLE}; then - as_fn_error $? "icecc-create-env did not produce an environment ${ICECC_ENV_BUNDLE}" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for icecc build environment for build compiler" >&5 -$as_echo_n "checking for icecc build environment for build compiler... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ICECC_ENV_BUNDLE}" >&5 -$as_echo "${ICECC_ENV_BUNDLE}" >&6; } - BUILD_ICECC="ICECC_VERSION=${ICECC_ENV_BUNDLE} ICECC_CC=${BUILD_CC} \ - ICECC_CXX=${BUILD_CXX} ${ICECC_CMD}" - else - BUILD_ICECC="${ICECC}" - fi - - - fi - - -# Can the C/C++ compiler use precompiled headers? - - - ############################################################################### - # - # Can the C/C++ compiler use precompiled headers? - # - # Check whether --enable-precompiled-headers was given. -if test "${enable_precompiled_headers+set}" = set; then : - enableval=$enable_precompiled_headers; ENABLE_PRECOMPH=${enable_precompiled_headers} -else - ENABLE_PRECOMPH=yes -fi - - - USE_PRECOMPILED_HEADER=true - { $as_echo "$as_me:${as_lineno-$LINENO}: checking If precompiled header is enabled" >&5 -$as_echo_n "checking If precompiled header is enabled... " >&6; } - if test "x$ENABLE_PRECOMPH" = xno; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, forced" >&5 -$as_echo "no, forced" >&6; } - USE_PRECOMPILED_HEADER=false - elif test "x$ICECC" != "x"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, does not work effectively with icecc" >&5 -$as_echo "no, does not work effectively with icecc" >&6; } - USE_PRECOMPILED_HEADER=false - elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, does not work with Solaris Studio" >&5 -$as_echo "no, does not work with Solaris Studio" >&6; } - USE_PRECOMPILED_HEADER=false - elif test "x$TOOLCHAIN_TYPE" = xxlc; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, does not work with xlc" >&5 -$as_echo "no, does not work with xlc" >&6; } - USE_PRECOMPILED_HEADER=false - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - fi - - if test "x$ENABLE_PRECOMPH" = xyes; then - # Check that the compiler actually supports precomp headers. - if test "x$TOOLCHAIN_TYPE" = xgcc; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking that precompiled headers work" >&5 -$as_echo_n "checking that precompiled headers work... " >&6; } - echo "int alfa();" > conftest.h - $CXX -x c++-header conftest.h -o conftest.hpp.gch 2>&5 >&5 - if test ! -f conftest.hpp.gch; then - USE_PRECOMPILED_HEADER=false - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - fi - $RM conftest.h conftest.hpp.gch - fi - fi - - - - -# Setup use of ccache, if available - - # Check whether --enable-ccache was given. -if test "${enable_ccache+set}" = set; then : - enableval=$enable_ccache; -fi - - - CCACHE_STATUS= - { $as_echo "$as_me:${as_lineno-$LINENO}: checking is ccache enabled" >&5 -$as_echo_n "checking is ccache enabled... " >&6; } - if test "x$enable_ccache" = xyes; then - if test "x$TOOLCHAIN_TYPE" = "xgcc" -o "x$TOOLCHAIN_TYPE" = "xclang"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - OLD_PATH="$PATH" - if test "x$TOOLCHAIN_PATH" != x; then - PATH=$TOOLCHAIN_PATH:$PATH - fi - - - - # Publish this variable in the help. - - - if [ -z "${CCACHE+x}" ]; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in ccache -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CCACHE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CCACHE in - [\\/]* | ?:[\\/]*) - ac_cv_path_CCACHE="$CCACHE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CCACHE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CCACHE=$ac_cv_path_CCACHE -if test -n "$CCACHE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CCACHE" >&5 -$as_echo "$CCACHE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CCACHE" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !CCACHE! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!CCACHE!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xCCACHE" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of CCACHE from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of CCACHE from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in ccache -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CCACHE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CCACHE in - [\\/]* | ?:[\\/]*) - ac_cv_path_CCACHE="$CCACHE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CCACHE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CCACHE=$ac_cv_path_CCACHE -if test -n "$CCACHE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CCACHE" >&5 -$as_echo "$CCACHE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CCACHE" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if we try to supply an empty value - if test "x$CCACHE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool CCACHE= (no value)" >&5 -$as_echo "$as_me: Setting user supplied tool CCACHE= (no value)" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CCACHE" >&5 -$as_echo_n "checking for CCACHE... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - # Check if the provided tool contains a complete path. - tool_specified="$CCACHE" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool CCACHE=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool CCACHE=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CCACHE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $CCACHE in - [\\/]* | ?:[\\/]*) - ac_cv_path_CCACHE="$CCACHE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CCACHE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CCACHE=$ac_cv_path_CCACHE -if test -n "$CCACHE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CCACHE" >&5 -$as_echo "$CCACHE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$CCACHE" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool CCACHE=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool CCACHE=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CCACHE" >&5 -$as_echo_n "checking for CCACHE... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool CCACHE=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - fi - - - - if test "x$CCACHE" = x; then - as_fn_error $? "Could not find required tool for CCACHE" "$LINENO" 5 - fi - - - PATH="$OLD_PATH" - CCACHE_VERSION=`$CCACHE --version | head -n1 | $SED 's/[A-Za-z ]*//'` - CCACHE_STATUS="Active ($CCACHE_VERSION)" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ccache is not supported with toolchain type $TOOLCHAIN_TYPE" >&5 -$as_echo "$as_me: WARNING: ccache is not supported with toolchain type $TOOLCHAIN_TYPE" >&2;} - fi - elif test "x$enable_ccache" = xno; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, explicitly disabled" >&5 -$as_echo "no, explicitly disabled" >&6; } - CCACHE_STATUS="Disabled" - elif test "x$enable_ccache" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5 -$as_echo "unknown" >&6; } - as_fn_error $? "--enable-ccache does not accept any parameters" "$LINENO" 5 - fi - - - -# Check whether --with-ccache-dir was given. -if test "${with_ccache_dir+set}" = set; then : - withval=$with_ccache_dir; -fi - - - if test "x$with_ccache_dir" != x; then - # When using a non home ccache directory, assume the use is to share ccache files - # with other users. Thus change the umask. - SET_CCACHE_DIR="CCACHE_DIR=$with_ccache_dir CCACHE_UMASK=002" - if test "x$CCACHE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-ccache-dir has no meaning when ccache is not enabled" >&5 -$as_echo "$as_me: WARNING: --with-ccache-dir has no meaning when ccache is not enabled" >&2;} - fi - fi - - if test "x$CCACHE" != x; then - - if test "x$CCACHE" != x; then - if test "x$OPENJDK_BUILD_OS" = "xmacosx"; then - HAS_BAD_CCACHE=`$ECHO $CCACHE_VERSION | \ - $GREP -e '^1\.' -e '^2\.' -e '^3\.0\.' -e '^3\.1\.'` - if test "x$HAS_BAD_CCACHE" != "x"; then - as_fn_error $? "On macosx, ccache 3.2 or later is required, found $CCACHE_VERSION" "$LINENO" 5 - fi - fi - if test "x$USE_PRECOMPILED_HEADER" = "xtrue"; then - HAS_BAD_CCACHE=`$ECHO $CCACHE_VERSION | \ - $GREP -e '^1.*' -e '^2.*' -e '^3\.0.*' -e '^3\.1\.[0123]$'` - if test "x$HAS_BAD_CCACHE" != "x"; then - as_fn_error $? "Precompiled headers requires ccache 3.1.4 or later, found $CCACHE_VERSION" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if C-compiler supports ccache precompiled headers" >&5 -$as_echo_n "checking if C-compiler supports ccache precompiled headers... " >&6; } - CCACHE_PRECOMP_FLAG="-fpch-preprocess" - PUSHED_FLAGS="$CXXFLAGS" - CXXFLAGS="$CCACHE_PRECOMP_FLAG $CXXFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - CC_KNOWS_CCACHE_TRICK=yes -else - CC_KNOWS_CCACHE_TRICK=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CXXFLAGS="$PUSHED_FLAGS" - if test "x$CC_KNOWS_CCACHE_TRICK" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - CFLAGS_CCACHE="$CCACHE_PRECOMP_FLAG" - - CCACHE_SLOPPINESS=pch_defines,time_macros - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_fn_error $? "Cannot use ccache with precompiled headers without compiler support for $CCACHE_PRECOMP_FLAG" "$LINENO" 5 - fi - fi - - CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR \ - CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS CCACHE_BASEDIR=$TOPDIR $CCACHE" - - if test "x$SET_CCACHE_DIR" != x; then - mkdir -p $CCACHE_DIR > /dev/null 2>&1 - chmod a+rwxs $CCACHE_DIR > /dev/null 2>&1 - fi - fi - - fi - - -############################################################################### -# -# And now the finish... -# -############################################################################### - -# Check for some common pitfalls - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - file_to_test="$TOPDIR/LICENSE" - if test `$STAT -c '%a' "$file_to_test"` -lt 400; then - as_fn_error $? "Bad file permissions on src files. This is usually caused by cloning the repositories with a non cygwin hg in a directory not created in cygwin." "$LINENO" 5 - fi - fi - - - # Did user specify any unknown variables? - - if test "x$CONFIGURE_OVERRIDDEN_VARIABLES" != x; then - # Replace the separating ! with spaces before presenting for end user. - unknown_variables=${CONFIGURE_OVERRIDDEN_VARIABLES//!/ } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The following variables might be unknown to configure: $unknown_variables" >&5 -$as_echo "$as_me: WARNING: The following variables might be unknown to configure: $unknown_variables" >&2;} - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if build directory is on local disk" >&5 -$as_echo_n "checking if build directory is on local disk... " >&6; } - - # df -l lists only local disks; if the given directory is not found then - # a non-zero exit code is given - if test "x$DF" = x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - # msys does not have df; use Windows "net use" instead. - IS_NETWORK_DISK=`net use | grep \`pwd -W | cut -d ":" -f 1 | tr a-z A-Z\`:` - if test "x$IS_NETWORK_DISK" = x; then - OUTPUT_DIR_IS_LOCAL="yes" - else - OUTPUT_DIR_IS_LOCAL="no" - fi - else - # No df here, say it's local - OUTPUT_DIR_IS_LOCAL="yes" - fi - else - # JDK-8189619 - # df on AIX does not understand -l. On modern AIXes it understands "-T local" which - # is the same. On older AIXes we just continue to live with a "not local build" warning. - if test "x$OPENJDK_TARGET_OS" = xaix; then - DF_LOCAL_ONLY_OPTION='-T local' - else - DF_LOCAL_ONLY_OPTION='-l' - fi - if $DF $DF_LOCAL_ONLY_OPTION $OUTPUTDIR > /dev/null 2>&1; then - OUTPUT_DIR_IS_LOCAL="yes" - else - OUTPUT_DIR_IS_LOCAL="no" - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OUTPUT_DIR_IS_LOCAL" >&5 -$as_echo "$OUTPUT_DIR_IS_LOCAL" >&6; } - - - - # Check if the user has any old-style ALT_ variables set. - FOUND_ALT_VARIABLES=`env | grep ^ALT_` - - # Before generating output files, test if they exist. If they do, this is a reconfigure. - # Since we can't properly handle the dependencies for this, warn the user about the situation - if test -e $OUTPUTDIR/spec.gmk; then - IS_RECONFIGURE=yes - else - IS_RECONFIGURE=no - fi - - -# At the end, call the custom hook. (Dummy macro if no custom sources available) - - -# This needs to be done after CUSTOM_LATE_HOOK since we can setup custom features. - - # Keep feature lists sorted and free of duplicates - JVM_FEATURES_server="$($ECHO $($PRINTF '%s\n' $JVM_FEATURES_server | $SORT -u))" - JVM_FEATURES_client="$($ECHO $($PRINTF '%s\n' $JVM_FEATURES_client | $SORT -u))" - JVM_FEATURES_core="$($ECHO $($PRINTF '%s\n' $JVM_FEATURES_core | $SORT -u))" - JVM_FEATURES_minimal="$($ECHO $($PRINTF '%s\n' $JVM_FEATURES_minimal | $SORT -u))" - JVM_FEATURES_zero="$($ECHO $($PRINTF '%s\n' $JVM_FEATURES_zero | $SORT -u))" - JVM_FEATURES_custom="$($ECHO $($PRINTF '%s\n' $JVM_FEATURES_custom | $SORT -u))" - - # Validate features - for variant in $JVM_VARIANTS; do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking JVM features for JVM variant '$variant'" >&5 -$as_echo_n "checking JVM features for JVM variant '$variant'... " >&6; } - features_var_name=JVM_FEATURES_$variant - JVM_FEATURES_TO_TEST=${!features_var_name} - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JVM_FEATURES_TO_TEST" >&5 -$as_echo "$JVM_FEATURES_TO_TEST" >&6; } - NEEDLE=${VALID_JVM_FEATURES// /$'\n'} - STACK=${JVM_FEATURES_TO_TEST// /$'\n'} - INVALID_FEATURES=`$GREP -Fvx "${NEEDLE}" <<< "${STACK}"` - if test "x$INVALID_FEATURES" != x; then - as_fn_error $? "Invalid JVM feature(s): $INVALID_FEATURES" "$LINENO" 5 - fi - done - - -# We're messing a bit with internal autoconf variables to put the config.status -# in the output directory instead of the current directory. -CONFIG_STATUS="$CONFIGURESUPPORT_OUTPUTDIR/config.status" - -# Create the actual output files. Now the main work of configure is done. -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -# -# If the first sed substitution is executed (which looks for macros that -# take arguments), then branch to the quote section. Otherwise, -# look for a macro that doesn't take arguments. -ac_script=' -:mline -/\\$/{ - N - s,\\\n,, - b mline -} -t clear -:clear -s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g -t quote -s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g -t quote -b any -:quote -s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g -s/\[/\\&/g -s/\]/\\&/g -s/\$/$$/g -H -:any -${ - g - s/^\n// - s/\n/ /g - p -} -' -DEFS=`sed -n "$ac_script" confdefs.h` - - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by OpenJDK $as_me jdk9, which was -generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - -Configuration files: -$config_files - -Report bugs to . -OpenJDK home page: ." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -OpenJDK config.status jdk9 -configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2012 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -AWK='$AWK' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h | --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "$OUTPUTDIR/spec.gmk") CONFIG_FILES="$CONFIG_FILES $OUTPUTDIR/spec.gmk:$AUTOCONF_DIR/spec.gmk.in" ;; - "$OUTPUTDIR/bootcycle-spec.gmk") CONFIG_FILES="$CONFIG_FILES $OUTPUTDIR/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in" ;; - "$OUTPUTDIR/buildjdk-spec.gmk") CONFIG_FILES="$CONFIG_FILES $OUTPUTDIR/buildjdk-spec.gmk:$AUTOCONF_DIR/buildjdk-spec.gmk.in" ;; - "$OUTPUTDIR/compare.sh") CONFIG_FILES="$CONFIG_FILES $OUTPUTDIR/compare.sh:$AUTOCONF_DIR/compare.sh.in" ;; - "$OUTPUTDIR/Makefile") CONFIG_FILES="$CONFIG_FILES $OUTPUTDIR/Makefile:$AUTOCONF_DIR/Makefile.in" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - - -eval set X " :F $CONFIG_FILES " -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$ac_tmp/stdin" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - - - - esac - -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - - -# After AC_OUTPUT, we need to do final work - - - # Try to move config.log (generated by autoconf) to the configure-support directory. - if test -e ./config.log; then - $MV -f ./config.log "$CONFIGURESUPPORT_OUTPUTDIR/config.log" 2> /dev/null - fi - - # Rotate our log file (configure.log) - if test -e "$OUTPUTDIR/configure.log.old"; then - $RM -f "$OUTPUTDIR/configure.log.old" - fi - if test -e "$OUTPUTDIR/configure.log"; then - $MV -f "$OUTPUTDIR/configure.log" "$OUTPUTDIR/configure.log.old" 2> /dev/null - fi - - # Move configure.log from current directory to the build output root - if test -e ./configure.log; then - $MV -f ./configure.log "$OUTPUTDIR/configure.log" 2> /dev/null - fi - - # Make the compare script executable - $CHMOD +x $OUTPUTDIR/compare.sh - - -# Finally output some useful information to the user - - # Finally output some useful information to the user - - printf "\n" - printf "====================================================\n" - if test "x$no_create" != "xyes"; then - if test "x$IS_RECONFIGURE" != "xyes"; then - printf "A new configuration has been successfully created in\n%s\n" "$OUTPUTDIR" - else - printf "The existing configuration has been successfully updated in\n%s\n" "$OUTPUTDIR" - fi - else - if test "x$IS_RECONFIGURE" != "xyes"; then - printf "A configuration has been successfully checked but not created\n" - else - printf "The existing configuration has been successfully checked in\n%s\n" "$OUTPUTDIR" - fi - fi - if test "x$CONFIGURE_COMMAND_LINE" != x; then - printf "using configure arguments '$CONFIGURE_COMMAND_LINE'.\n" - else - printf "using default settings.\n" - fi - - printf "\n" - printf "Configuration summary:\n" - printf "* Debug level: $DEBUG_LEVEL\n" - printf "* HS debug level: $HOTSPOT_DEBUG_LEVEL\n" - printf "* JDK variant: $JDK_VARIANT\n" - printf "* JVM variants: $JVM_VARIANTS\n" - printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n" - printf "* Version string: $VERSION_STRING ($VERSION_SHORT)\n" - - printf "\n" - printf "Tools summary:\n" - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - printf "* Environment: $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n" - fi - printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n" - if test "x$TOOLCHAIN_VERSION" != "x"; then - print_version=" $TOOLCHAIN_VERSION" - fi - printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION$print_version)\n" - printf "* C Compiler: Version $CC_VERSION_NUMBER (at $CC)\n" - printf "* C++ Compiler: Version $CXX_VERSION_NUMBER (at $CXX)\n" - - printf "\n" - printf "Build performance summary:\n" - printf "* Cores to use: $JOBS\n" - printf "* Memory limit: $MEMORY_SIZE MB\n" - if test "x$CCACHE_STATUS" != "x"; then - printf "* ccache status: $CCACHE_STATUS\n" - fi - printf "\n" - - if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xtrue"; then - printf "NOTE: You have requested to build more than one version of the JVM, which\n" - printf "will result in longer build times.\n" - printf "\n" - fi - - if test "x$FOUND_ALT_VARIABLES" != "x"; then - printf "WARNING: You have old-style ALT_ environment variables set.\n" - printf "These are not respected, and will be ignored. It is recommended\n" - printf "that you clean your environment. The following variables are set:\n" - printf "$FOUND_ALT_VARIABLES\n" - printf "\n" - fi - - if test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then - printf "WARNING: Your build output directory is not on a local disk.\n" - printf "This will severely degrade build performance!\n" - printf "It is recommended that you create an output directory on a local disk,\n" - printf "and run the configure script again from that directory.\n" - printf "\n" - fi - - if test "x$IS_RECONFIGURE" = "xyes" && test "x$no_create" != "xyes"; then - printf "WARNING: The result of this configuration has overridden an older\n" - printf "configuration. You *should* run 'make clean' to make sure you get a\n" - printf "proper build. Failure to do so might result in strange build problems.\n" - printf "\n" - fi - - if test "x$IS_RECONFIGURE" != "xyes" && test "x$no_create" = "xyes"; then - printf "WARNING: The result of this configuration was not saved.\n" - printf "You should run without '--no-create | -n' to create the configuration.\n" - printf "\n" - fi - - - - # Locate config.log. - if test -e "$CONFIGURESUPPORT_OUTPUTDIR/config.log"; then - CONFIG_LOG_PATH="$CONFIGURESUPPORT_OUTPUTDIR" - elif test -e "./config.log"; then - CONFIG_LOG_PATH="." - fi - - if test -e "$CONFIG_LOG_PATH/config.log"; then - $GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" > /dev/null 2>&1 - if test $? -eq 0; then - printf "The following warnings were produced. Repeated here for convenience:\n" - # We must quote sed expression (using []) to stop m4 from eating the []. - $GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" | $SED -e 's/^configure:[0-9]*: //' - printf "\n" - fi - fi - diff --git a/make/autoconf/help.m4 b/make/autoconf/help.m4 index 3937b93c15b..785597300be 100644 --- a/make/autoconf/help.m4 +++ b/make/autoconf/help.m4 @@ -242,10 +242,7 @@ AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS], printf "* Environment: $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n" fi printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n" - if test "x$TOOLCHAIN_VERSION" != "x"; then - print_version=" $TOOLCHAIN_VERSION" - fi - printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION$print_version)\n" + printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)\n" printf "* C Compiler: Version $CC_VERSION_NUMBER (at $CC)\n" printf "* C++ Compiler: Version $CXX_VERSION_NUMBER (at $CXX)\n" @@ -292,6 +289,12 @@ AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS], printf "You should run without '--no-create | -n' to create the configuration.\n" printf "\n" fi + + if test "x$UNSUPPORTED_TOOLCHAIN_VERSION" = "xyes"; then + printf "WARNING: The toolchain version used is known to have issues. Please\n" + printf "consider using a supported version unless you know what you are doing.\n" + printf "\n" + fi ]) AC_DEFUN_ONCE([HELP_REPEAT_WARNINGS], diff --git a/make/autoconf/jdk-version.m4 b/make/autoconf/jdk-version.m4 index 37985385a26..b6580cd372e 100644 --- a/make/autoconf/jdk-version.m4 +++ b/make/autoconf/jdk-version.m4 @@ -381,6 +381,10 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS], VENDOR_VERSION_STRING="$with_vendor_version_string" fi + # We could define --with flags for these, if really needed + VERSION_CLASSFILE_MAJOR="$DEFAULT_VERSION_CLASSFILE_MAJOR" + VERSION_CLASSFILE_MINOR="$DEFAULT_VERSION_CLASSFILE_MINOR" + AC_MSG_CHECKING([for version string]) AC_MSG_RESULT([$VERSION_STRING]) @@ -398,4 +402,7 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS], AC_SUBST(VERSION_IS_GA) AC_SUBST(VERSION_DATE) AC_SUBST(VENDOR_VERSION_STRING) + AC_SUBST(VERSION_CLASSFILE_MAJOR) + AC_SUBST(VERSION_CLASSFILE_MINOR) + ]) diff --git a/make/autoconf/lib-bundled.m4 b/make/autoconf/lib-bundled.m4 index b97ad3c6c2d..0680a99d175 100644 --- a/make/autoconf/lib-bundled.m4 +++ b/make/autoconf/lib-bundled.m4 @@ -209,7 +209,17 @@ AC_DEFUN_ONCE([LIB_SETUP_ZLIB], AC_MSG_ERROR([Invalid value for --with-zlib: ${with_zlib}, use 'system' or 'bundled']) fi + LIBZ_CFLAGS="" + LIBZ_LIBS="" + if test "x$USE_EXTERNAL_LIBZ" = "xfalse"; then + LIBZ_CFLAGS="$LIBZ_CFLAGS -I$TOPDIR/src/java.base/share/native/libzip/zlib" + else + LIBZ_LIBS="-lz" + fi + AC_SUBST(USE_EXTERNAL_LIBZ) + AC_SUBST(LIBZ_CFLAGS) + AC_SUBST(LIBZ_LIBS) ]) ################################################################################ diff --git a/make/autoconf/platform.m4 b/make/autoconf/platform.m4 index f62f94daace..654ce9b2b4e 100644 --- a/make/autoconf/platform.m4 +++ b/make/autoconf/platform.m4 @@ -478,6 +478,14 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER], fi AC_SUBST(HOTSPOT_$1_CPU_DEFINE) + # For historical reasons, the OS include directories have odd names. + OPENJDK_$1_OS_INCLUDE_SUBDIR="$OPENJDK_TARGET_OS" + if test "x$OPENJDK_TARGET_OS" = "xwindows"; then + OPENJDK_$1_OS_INCLUDE_SUBDIR="win32" + elif test "x$OPENJDK_TARGET_OS" = "xmacosx"; then + OPENJDK_$1_OS_INCLUDE_SUBDIR="darwin" + fi + AC_SUBST(OPENJDK_$1_OS_INCLUDE_SUBDIR) ]) AC_DEFUN([PLATFORM_SET_RELEASE_FILE_OS_VALUES], diff --git a/make/autoconf/spec.gmk.in b/make/autoconf/spec.gmk.in index 38a30a44cf6..5364a61505b 100644 --- a/make/autoconf/spec.gmk.in +++ b/make/autoconf/spec.gmk.in @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -78,6 +78,7 @@ OPENJDK_TARGET_CPU_ISADIR:=@OPENJDK_TARGET_CPU_ISADIR@ OPENJDK_TARGET_CPU_LEGACY:=@OPENJDK_TARGET_CPU_LEGACY@ OPENJDK_TARGET_CPU_LEGACY_LIB:=@OPENJDK_TARGET_CPU_LEGACY_LIB@ OPENJDK_TARGET_CPU_OSARCH:=@OPENJDK_TARGET_CPU_OSARCH@ +OPENJDK_TARGET_OS_INCLUDE_SUBIDR:=@OPENJDK_TARGET_OS_INCLUDE_SUBDIR@ HOTSPOT_TARGET_OS := @HOTSPOT_TARGET_OS@ HOTSPOT_TARGET_OS_TYPE := @HOTSPOT_TARGET_OS_TYPE@ @@ -100,6 +101,8 @@ OPENJDK_BUILD_CPU_ARCH:=@OPENJDK_BUILD_CPU_ARCH@ OPENJDK_BUILD_CPU_BITS:=@OPENJDK_BUILD_CPU_BITS@ OPENJDK_BUILD_CPU_ENDIAN:=@OPENJDK_BUILD_CPU_ENDIAN@ +OPENJDK_BUILD_OS_INCLUDE_SUBIDR:=@OPENJDK_TARGET_OS_INCLUDE_SUBDIR@ + # Target platform value in ModuleTarget class file attribute. OPENJDK_MODULE_TARGET_PLATFORM:=@OPENJDK_MODULE_TARGET_PLATFORM@ @@ -189,6 +192,10 @@ VERSION_DATE := @VERSION_DATE@ # Vendor version string VENDOR_VERSION_STRING := @VENDOR_VERSION_STRING@ +# Class-file version +VERSION_CLASSFILE_MAJOR := @VERSION_CLASSFILE_MAJOR@ +VERSION_CLASSFILE_MINOR := @VERSION_CLASSFILE_MINOR@ + # Convenience CFLAGS settings for passing version information into native programs. VERSION_CFLAGS := \ -DVERSION_FEATURE=$(VERSION_FEATURE) \ @@ -204,6 +211,8 @@ VERSION_CFLAGS := \ -DVERSION_SPECIFICATION='"$(VERSION_SPECIFICATION)"' \ -DVERSION_DATE='"$(VERSION_DATE)"' \ -DVENDOR_VERSION_STRING='"$(VENDOR_VERSION_STRING)"' \ + -DVERSION_CLASSFILE_MAJOR=$(VERSION_CLASSFILE_MAJOR) \ + -DVERSION_CLASSFILE_MINOR=$(VERSION_CLASSFILE_MINOR) \ # ifneq ($(COMPANY_NAME),) @@ -212,9 +221,9 @@ ifneq ($(COMPANY_NAME),) # Only export "VENDOR" to the build if COMPANY_NAME contains a real value. # Otherwise the default value for VENDOR, which is used to set the "java.vendor" # and "java.vm.vendor" properties is hard-coded into the source code (i.e. in - # System.c in the jdk for "vm.vendor" and vm_version.cpp in the VM for "java.vm.vendor") + # System.c in the jdk for "vm.vendor" and vm_version.cpp in the VM for "java.vm.vendor") ifneq ($(COMPANY_NAME), N/A) - VERSION_CFLAGS += -DVENDOR='"$(COMPANY_NAME)"' + VERSION_CFLAGS += -DVENDOR='"$(COMPANY_NAME)"' endif endif @@ -604,6 +613,8 @@ INTERIM_LANGTOOLS_BASE_MODULES := java.compiler jdk.compiler jdk.javadoc INTERIM_LANGTOOLS_MODULES := $(addsuffix .interim, $(INTERIM_LANGTOOLS_BASE_MODULES)) INTERIM_LANGTOOLS_ADD_EXPORTS := \ --add-exports java.base/sun.reflect.annotation=jdk.compiler.interim \ + --add-exports java.base/jdk.internal.jmod=jdk.compiler.interim \ + --add-exports java.base/jdk.internal.misc=jdk.compiler.interim \ # INTERIM_LANGTOOLS_MODULES_COMMA := $(strip $(subst $(SPACE),$(COMMA),$(strip \ $(INTERIM_LANGTOOLS_MODULES)))) @@ -618,14 +629,11 @@ JAVADOC_MAIN_CLASS = -m jdk.javadoc.interim/jdk.javadoc.internal.tool.Main INTERIM_RMIC_BASE_MODULES := jdk.rmic INTERIM_RMIC_MODULES := $(addsuffix .interim, $(INTERIM_RMIC_BASE_MODULES)) -INTERIM_RMIC_ADD_EXPORTS := \ - --add-exports java.corba/com.sun.corba.se.impl.util=jdk.rmic.interim \ # # Use = to delay expansion of PathList since it's not available in this file. -INTERIM_RMIC_ARGS = --limit-modules java.base,jdk.compiler,jdk.javadoc,java.corba \ +INTERIM_RMIC_ARGS = --limit-modules java.base,jdk.compiler,jdk.javadoc \ --module-path $(call PathList, $(BUILDTOOLS_OUTPUTDIR)/interim_rmic_modules \ $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules) \ - $(INTERIM_RMIC_ADD_EXPORTS) \ # # You run the new javac using the boot jdk with $(BOOT_JDK)/bin/java $(NEW_JAVAC) ... @@ -726,6 +734,8 @@ ENABLE_INTREE_EC:=@ENABLE_INTREE_EC@ USE_EXTERNAL_LIBJPEG:=@USE_EXTERNAL_LIBJPEG@ USE_EXTERNAL_LIBGIF:=@USE_EXTERNAL_LIBGIF@ USE_EXTERNAL_LIBZ:=@USE_EXTERNAL_LIBZ@ +LIBZ_CFLAGS:=@LIBZ_CFLAGS@ +LIBZ_LIBS:=@LIBZ_LIBS@ LIBZIP_CAN_USE_MMAP:=@LIBZIP_CAN_USE_MMAP@ MSVCR_DLL:=@MSVCR_DLL@ MSVCP_DLL:=@MSVCP_DLL@ diff --git a/make/autoconf/toolchain.m4 b/make/autoconf/toolchain.m4 index b5416aed9af..599a2212647 100644 --- a/make/autoconf/toolchain.m4 +++ b/make/autoconf/toolchain.m4 @@ -286,7 +286,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_PRE_DETECTION], if test "x$XCODE_VERSION_OUTPUT" != x; then # For Xcode, we set the Xcode version as TOOLCHAIN_VERSION TOOLCHAIN_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | $CUT -f 2 -d ' '` - TOOLCHAIN_DESCRIPTION="$TOOLCHAIN_DESCRIPTION from Xcode" + TOOLCHAIN_DESCRIPTION="$TOOLCHAIN_DESCRIPTION from Xcode $TOOLCHAIN_VERSION" else # Currently we do not define this for other toolchains. This might change as the need arise. TOOLCHAIN_VERSION= diff --git a/make/autoconf/toolchain_windows.m4 b/make/autoconf/toolchain_windows.m4 index f2304df0fe9..6ce41805c5f 100644 --- a/make/autoconf/toolchain_windows.m4 +++ b/make/autoconf/toolchain_windows.m4 @@ -25,7 +25,7 @@ ################################################################################ # The order of these defines the priority by which we try to find them. -VALID_VS_VERSIONS="2013 2012 2010" +VALID_VS_VERSIONS="2013 2012 2010 2015 2017" VS_DESCRIPTION_2010="Microsoft Visual Studio 2010" VS_VERSION_INTERNAL_2010=100 @@ -58,6 +58,30 @@ VS_SDK_INSTALLDIR_2013= VS_VS_PLATFORM_NAME_2013="v120" VS_SDK_PLATFORM_NAME_2013= +VS_DESCRIPTION_2015="Microsoft Visual Studio 2015 - CURRENTLY NOT WORKING" +VS_VERSION_INTERNAL_2015=140 +VS_MSVCR_2015=vcruntime140.dll +VS_MSVCP_2015=msvcp140.dll +VS_ENVVAR_2015="VS140COMNTOOLS" +VS_VS_INSTALLDIR_2015="Microsoft Visual Studio 14.0" +VS_SDK_INSTALLDIR_2015= +VS_VS_PLATFORM_NAME_2015="v140" +VS_SDK_PLATFORM_NAME_2015= +# The vcvars of 2015 breaks if 2017 is also installed. Work around this by +# explicitly specifying Windows Kit 8.1 to be used. +VS_ENV_ARGS_2015="8.1" + +VS_DESCRIPTION_2017="Microsoft Visual Studio 2017 - CURRENTLY NOT WORKING" +VS_VERSION_INTERNAL_2017=141 +VS_MSVCR_2017=vcruntime140.dll +VS_MSVCP_2017=msvcp140.dll +VS_ENVVAR_2017="VS150COMNTOOLS" +VS_VS_INSTALLDIR_2017="Microsoft Visual Studio/2017" +VS_EDITIONS_2017="Community Professional Enterprise" +VS_SDK_INSTALLDIR_2017= +VS_VS_PLATFORM_NAME_2017="v141" +VS_SDK_PLATFORM_NAME_2017= + ################################################################################ AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT], @@ -67,23 +91,41 @@ AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT], VS_BASE="$2" METHOD="$3" - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - VCVARSFILE="vc/bin/vcvars32.bat" - else - VCVARSFILE="vc/bin/amd64/vcvars64.bat" + BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(VS_BASE) + # In VS 2017, the default installation is in a subdir named after the edition. + # Find the first one present and use that. + if test "x$VS_EDITIONS" != x; then + for edition in $VS_EDITIONS; do + if test -d "$VS_BASE/$edition"; then + VS_BASE="$VS_BASE/$edition" + break + fi + done fi - BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(VS_BASE) if test -d "$VS_BASE"; then - if test -f "$VS_BASE/$VCVARSFILE"; then - AC_MSG_NOTICE([Found Visual Studio installation at $VS_BASE using $METHOD]) - VS_ENV_CMD="$VS_BASE/$VCVARSFILE" - # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see - # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013 - eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}" + AC_MSG_NOTICE([Found Visual Studio installation at $VS_BASE using $METHOD]) + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + VCVARSFILES="vc/bin/vcvars32.bat vc/auxiliary/build/vcvars32.bat" else - AC_MSG_NOTICE([Found Visual Studio installation at $VS_BASE using $METHOD]) - AC_MSG_NOTICE([Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring]) + VCVARSFILES="vc/bin/amd64/vcvars64.bat vc/bin/x86_amd64/vcvarsx86_amd64.bat \ + vc/auxiliary/build/vcvarsx86_amd64.bat vc/auxiliary/build/vcvars64.bat" + fi + + for VCVARSFILE in $VCVARSFILES; do + if test -f "$VS_BASE/$VCVARSFILE"; then + VS_ENV_CMD="$VS_BASE/$VCVARSFILE" + break + fi + done + + if test "x$VS_ENV_CMD" = x; then + AC_MSG_NOTICE([Warning: None of $VCVARSFILES were found, Visual Studio installation not recognized. Ignoring]) + else + # PLATFORM_TOOLSET is used during the compilation of the freetype sources + # (see 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', + # 'v110' or 'v120' for VS 2010, 2012 or VS2013 + eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}" fi fi fi @@ -133,7 +175,9 @@ AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE], eval VS_COMNTOOLS_VAR="\${VS_ENVVAR_${VS_VERSION}}" eval VS_COMNTOOLS="\$${VS_COMNTOOLS_VAR}" eval VS_INSTALL_DIR="\${VS_VS_INSTALLDIR_${VS_VERSION}}" + eval VS_EDITIONS="\${VS_EDITIONS_${VS_VERSION}}" eval SDK_INSTALL_DIR="\${VS_SDK_INSTALLDIR_${VS_VERSION}}" + eval VS_ENV_ARGS="\${VS_ENV_ARGS_${VS_VERSION}}" # When using --with-tools-dir, assume it points to the correct and default # version of Visual Studio or that --with-toolchain-version was also set. @@ -153,7 +197,6 @@ AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE], fi VS_ENV_CMD="" - VS_ENV_ARGS="" if test "x$VS_COMNTOOLS" != x; then TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}], @@ -213,7 +256,11 @@ AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO], elif test "x$DEVKIT_VS_VERSION" != x; then VS_VERSION=$DEVKIT_VS_VERSION TOOLCHAIN_VERSION=$VS_VERSION - eval VS_DESCRIPTION="\${VS_DESCRIPTION_${VS_VERSION}}" + # If the devkit has a name, use that as description + VS_DESCRIPTION="$DEVKIT_NAME" + if test "x$VS_DESCRIPTION" = x; then + eval VS_DESCRIPTION="\${VS_DESCRIPTION_${VS_VERSION}}" + fi eval VS_VERSION_INTERNAL="\${VS_VERSION_INTERNAL_${VS_VERSION}}" eval MSVCR_NAME="\${VS_MSVCR_${VS_VERSION}}" eval MSVCP_NAME="\${VS_MSVCP_${VS_VERSION}}" @@ -267,6 +314,11 @@ AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO], break fi done + + TOOLCHAIN_DESCRIPTION="$VS_DESCRIPTION" + if test "$TOOLCHAIN_VERSION" -gt 2013; then + UNSUPPORTED_TOOLCHAIN_VERSION=yes + fi ]) ################################################################################ @@ -320,6 +372,9 @@ AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV], # This will end up something like: # call C:/progra~2/micros~2.0/vc/bin/amd64/vcvars64.bat $ECHO "call $WINPATH_VS_ENV_CMD $VS_ENV_ARGS" >> $EXTRACT_VC_ENV_BAT_FILE + # In some cases, the VS_ENV_CMD will change directory, change back so + # the set-vs-env.sh ends up in the right place. + $ECHO 'cd %~dp0' >> $EXTRACT_VC_ENV_BAT_FILE # These will end up something like: # C:/CygWin/bin/bash -c 'echo VS_PATH=\"$PATH\" > localdevenv.sh # The trailing space for everyone except PATH is no typo, but is needed due @@ -483,18 +538,30 @@ AC_DEFUN([TOOLCHAIN_SETUP_MSVC_DLL], MSVC_DLL= if test "x$MSVC_DLL" = x; then - # Probe: Using well-known location from Visual Studio 10.0 if test "x$VCINSTALLDIR" != x; then CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR" BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_VC_INSTALL_DIR) - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME" + if test "$VS_VERSION" -lt 2017; then + # Probe: Using well-known location from Visual Studio 12.0 and older + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME" + else + POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME" + fi else - POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME" + # Probe: Using well-known location from VS 2017 + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + POSSIBLE_MSVC_DLL="`ls $CYGWIN_VC_INSTALL_DIR/Redist/MSVC/*/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME`" + else + POSSIBLE_MSVC_DLL="`ls $CYGWIN_VC_INSTALL_DIR/Redist/MSVC/*/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME`" + fi fi - $ECHO "POSSIBLE_MSVC_DLL $POSSIBLEMSVC_DLL" - TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$POSSIBLE_MSVC_DLL], - [well-known location in VCINSTALLDIR]) + # In case any of the above finds more than one file, loop over them. + for possible_msvc_dll in $POSSIBLE_MSVC_DLL; do + $ECHO "POSSIBLE_MSVC_DLL $possible_msvc_dll" + TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$possible_msvc_dll], + [well-known location in VCINSTALLDIR]) + done fi fi @@ -576,7 +643,7 @@ AC_DEFUN([TOOLCHAIN_SETUP_VS_RUNTIME_DLLS], TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL($MSVCR_NAME, [$DEVKIT_MSVCR_DLL], [devkit]) if test "x$MSVC_DLL" = x; then AC_MSG_ERROR([Could not find a proper $MSVCR_NAME as specified by devkit]) - fi + fi MSVCR_DLL="$MSVC_DLL" else TOOLCHAIN_SETUP_MSVC_DLL([${MSVCR_NAME}]) @@ -599,7 +666,7 @@ AC_DEFUN([TOOLCHAIN_SETUP_VS_RUNTIME_DLLS], TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL($MSVCP_NAME, [$DEVKIT_MSVCP_DLL], [devkit]) if test "x$MSVC_DLL" = x; then AC_MSG_ERROR([Could not find a proper $MSVCP_NAME as specified by devkit]) - fi + fi MSVCP_DLL="$MSVC_DLL" else TOOLCHAIN_SETUP_MSVC_DLL([${MSVCP_NAME}]) diff --git a/make/autoconf/version-numbers b/make/autoconf/version-numbers index 60d565c1805..b6c838d274f 100644 --- a/make/autoconf/version-numbers +++ b/make/autoconf/version-numbers @@ -25,11 +25,13 @@ # Default version numbers to use unless overridden by configure -DEFAULT_VERSION_FEATURE=10 +DEFAULT_VERSION_FEATURE=11 DEFAULT_VERSION_INTERIM=0 DEFAULT_VERSION_UPDATE=0 DEFAULT_VERSION_PATCH=0 DEFAULT_VERSION_DATE=2018-03-20 +DEFAULT_VERSION_CLASSFILE_MAJOR=55 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`" +DEFAULT_VERSION_CLASSFILE_MINOR=0 LAUNCHER_NAME=openjdk PRODUCT_NAME=OpenJDK diff --git a/make/common/IdlCompilation.gmk b/make/common/IdlCompilation.gmk deleted file mode 100644 index ab08004a0d0..00000000000 --- a/make/common/IdlCompilation.gmk +++ /dev/null @@ -1,113 +0,0 @@ -# -# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -PREFIXES=-pkgPrefix CORBA org.omg \ - -pkgPrefix CosNaming org.omg \ - -pkgPrefix CosTransactions org.omg \ - -pkgPrefix CosTSInteroperation org.omg \ - -pkgPrefix DynamicAny org.omg \ - -pkgPrefix Dynamic org.omg \ - -pkgPrefix IOP org.omg \ - -pkgPrefix Messaging org.omg \ - -pkgPrefix PortableInterceptor org.omg \ - -pkgPrefix PortableServer org.omg \ - -pkgPrefix activation com.sun.corba.se.spi \ - -pkgPrefix GIOP com.sun.corba.se \ - -pkgPrefix PortableActivationIDL com.sun.corba.se \ - -pkgPrefix messages com.sun.corba.se - -define add_idl_package - # param 1 = MYPACKAGE - # param 2 = src root - # param 3 = gensrc root - # param 4 = source idl to compile - # param 5 = target idl package - # param 6 = delete these files that were output from the idlj - # param 7 = idls that match these patterns should be compiled with -oldImplBase - # param 8 = the idlj command - # Save the generated java files to a temporary directory so - # that we can find them and create proper dependencies. - # After that, we move them to the real gensrc target dir. - $4_TMPDIR:=tmp___$(subst /,_,$(patsubst $2/%,%,$4))___ - ifneq ($$(filter $7,$4),) - $4_OLDIMPLBASE:=-oldImplBase - $4_OLDIMPLBASE_MSG:=with -oldImplBase - endif - $5 : $4 - $$(call LogInfo, Compiling IDL $(patsubst $2/%,%,$4)) - $$(call MakeDir, $$(@D)) - $(RM) -rf $3/$$($4_TMPDIR) - $8 -td $3/$$($4_TMPDIR) \ - -i $2/org/omg/CORBA \ - -i $2/org/omg/PortableInterceptor \ - -i $2/org/omg/PortableServer \ - -D CORBA3 -corba 3.0 \ - -fall \ - $$($4_OLDIMPLBASE) \ - $(PREFIXES) \ - $4 - $(RM) -f $$(addprefix $3/$$($4_TMPDIR)/,$6) - $(CP) -r $3/$$($4_TMPDIR)/* $3 - ($(CD) $3/$$($4_TMPDIR) && $(FIND) . -type f | $(SED) 's!\./!$3/!g' | $(NAWK) '{ print $$$$1 ": $4" }' > $5) - $(RM) -rf $3/$$($4_TMPDIR) -endef - -# Setup make rules for creating an IDL compilation. -# -# Parameter 1 is the name of the rule. This name is used as variable prefix, -# and the targets generated are listed in a variable by that name. -# -# Remaining parameters are named arguments. These include: -# IDLJ -# SRC -# BIN -# INCLUDES -# EXCLUDES -# OLDIMPLBASES -# DELETES -SetupIdlCompilation = $(NamedParamsMacroTemplate) -define SetupIdlCompilationBody - - # Find all existing java files and existing class files. - $$(call MakeDir,$$($1_BIN)) - $1_SRCS := $$(shell find $$($1_SRC) -name "*.idl") - $1_BINS := $$(shell find $$($1_BIN) -name "*.java") - # Prepend the source/bin path to the filter expressions. - $1_SRC_INCLUDES := $$(addprefix $$($1_SRC)/,$$($1_INCLUDES)) - $1_SRC_EXCLUDES := $$(addprefix $$($1_SRC)/,$$($1_EXCLUDES)) - $1_BIN_INCLUDES := $$(addprefix $$($1_BIN)/,$$($1_INCLUDES)) - $1_BIN_EXCLUDES := $$(addprefix $$($1_BIN)/,$$($1_EXCLUDES)) - $1_OLDIMPLBASES := $$(addprefix $$($1_SRC)/,$$($1_OLDIMPLBASES)) - # Now remove unwanted java/class files. - $1_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_SRCS)) - $1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS)) - $1_BINS := $$(filter $$($1_BIN_INCLUDES),$$($1_BINS)) - $1_BINS := $$(filter-out $$($1_BIN_EXCLUDES),$$($1_BINS)) - $1 := $$(sort $$(patsubst $$($1_SRC)/%.idl,$$($1_BIN)/%.idl.d,$$($1_SRCS))) - # Now create the dependencies for each idl target. - $$(foreach p,$$($1),$$(eval $$(call add_idl_package,$1,$$($1_SRC),$$($1_BIN),$$(patsubst $$($1_BIN)/%.idl.d,$$($1_SRC)/%.idl,$$p),$$p,$$($1_DELETES),$$($1_OLDIMPLBASES),$$($1_IDLJ)))) -endef - -.SUFFIXES: .java .class .package diff --git a/make/common/Modules.gmk b/make/common/Modules.gmk index 9fcc4166ead..0861755ae98 100644 --- a/make/common/Modules.gmk +++ b/make/common/Modules.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -74,24 +74,13 @@ BOOT_MODULES += \ # Modules that directly or indirectly requiring upgradeable modules # should carefully be considered if it should be upgradeable or not. UPGRADEABLE_MODULES += \ - java.activation \ java.compiler \ - java.corba \ - java.transaction \ - java.xml.bind \ - java.xml.ws \ - java.xml.ws.annotation \ jdk.internal.vm.compiler \ # -UPGRADEABLE_TOOL_MODULES += \ - jdk.xml.bind \ - jdk.xml.ws \ - # AGGREGATOR_MODULES += \ java.se \ - java.se.ee \ # PLATFORM_MODULES += \ @@ -143,7 +132,7 @@ JRE_TOOL_MODULES += \ # DOCS_MODULES defines the root modules for javadoc generation. # All of their `require transitive` modules directly and indirectly will be included. DOCS_MODULES += \ - java.se.ee \ + java.se \ java.smartcardio \ jdk.accessibility \ jdk.attach \ @@ -195,8 +184,6 @@ LANGTOOLS_MODULES := \ jdk.jshell \ # -CORBA_MODULES := java.corba - HOTSPOT_MODULES := \ jdk.aot \ jdk.hotspot.agent \ @@ -395,7 +382,7 @@ FindTransitiveIndirectDepsForModules = \ # Upgradeable modules are those that are either defined as upgradeable or that # require an upradeable module. FindAllUpgradeableModules = \ - $(sort $(filter-out $(MODULES_FILTER), $(UPGRADEABLE_MODULES) $(UPGRADEABLE_TOOL_MODULES))) + $(sort $(filter-out $(MODULES_FILTER), $(UPGRADEABLE_MODULES))) ################################################################################ diff --git a/make/common/SetupJavaCompilers.gmk b/make/common/SetupJavaCompilers.gmk index 72bc7e442b7..861406901a7 100644 --- a/make/common/SetupJavaCompilers.gmk +++ b/make/common/SetupJavaCompilers.gmk @@ -26,13 +26,16 @@ ifndef _SETUP_GMK _SETUP_GMK := 1 +# Include custom extension hook +$(eval $(call IncludeCustomExtension, common/SetupJavaCompilers.gmk)) + include JavaCompilation.gmk -DISABLE_WARNINGS := -Xlint:all,-deprecation,-removal,-unchecked,-rawtypes,-cast,-serial,-dep-ann,-static,-fallthrough,-try,-varargs,-empty,-finally +DISABLE_WARNINGS ?= -Xlint:all,-deprecation,-removal,-unchecked,-rawtypes,-cast,-serial,-dep-ann,-static,-fallthrough,-try,-varargs,-empty,-finally # If warnings needs to be non-fatal for testing purposes use a command like: # make JAVAC_WARNINGS="-Xlint:all -Xmaxwarns 10000" -JAVAC_WARNINGS := -Xlint:all -Werror +JAVAC_WARNINGS ?= -Xlint:all -Werror # The BOOT_JAVAC setup uses the boot jdk compiler to compile the tools # and the interim javac, to be run by the boot jdk. @@ -69,7 +72,7 @@ $(eval $(call SetupJavaCompiler,GENERATE_OLDBYTECODE, \ $(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE, \ JVM := $(JAVA_JAVAC), \ JAVAC := $(NEW_JAVAC), \ - FLAGS := -source 10 -target 10 --doclint-format html5 \ + FLAGS := -source 11 -target 11 --doclint-format html5 \ -encoding ascii -XDignore.symbol.file=true $(JAVAC_WARNINGS), \ SERVER_DIR := $(SJAVAC_SERVER_DIR), \ SERVER_JVM := $(SJAVAC_SERVER_JAVA))) @@ -79,7 +82,7 @@ $(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE, \ $(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE_NOWARNINGS, \ JVM := $(JAVA_JAVAC), \ JAVAC := $(NEW_JAVAC), \ - FLAGS := -source 10 -target 10 \ + FLAGS := -source 11 -target 11 \ -encoding ascii -XDignore.symbol.file=true $(DISABLE_WARNINGS), \ SERVER_DIR := $(SJAVAC_SERVER_DIR), \ SERVER_JVM := $(SJAVAC_SERVER_JAVA))) diff --git a/make/conf/jib-profiles.js b/make/conf/jib-profiles.js index 34668f349b8..7d1f0683000 100644 --- a/make/conf/jib-profiles.js +++ b/make/conf/jib-profiles.js @@ -200,7 +200,7 @@ var getJibProfiles = function (input) { data.configuration_make_arg = "CONF_NAME="; // Exclude list to use when Jib creates a source bundle - data.src_bundle_excludes = "./build webrev* */webrev* */*/webrev* */*/*/webrev* .hg */.hg */*/.hg */*/*/.hg"; + data.src_bundle_excludes = "./build .build webrev* */webrev* */*/webrev* */*/*/webrev* .hg */.hg */*/.hg */*/*/.hg"; // Include list to use when creating a minimal jib source bundle which // contains just the jib configuration files. data.conf_bundle_includes = "*/conf/jib-profiles.* make/autoconf/version-numbers" @@ -411,7 +411,7 @@ var getJibProfilesProfiles = function (input, common, data) { "linux-x64": { target_os: "linux", target_cpu: "x64", - dependencies: ["devkit", "graphviz", "pandoc"], + dependencies: ["devkit", "autoconf", "graphviz", "pandoc"], configure_args: concat(common.configure_args_64bit, "--enable-full-docs", "--with-zlib=system"), default_make_targets: ["docs-bundles"], @@ -421,7 +421,7 @@ var getJibProfilesProfiles = function (input, common, data) { target_os: "linux", target_cpu: "x86", build_cpu: "x64", - dependencies: ["devkit"], + dependencies: ["devkit", "autoconf"], configure_args: concat(common.configure_args_32bit, "--with-jvm-variants=minimal,server", "--with-zlib=system"), }, @@ -429,7 +429,7 @@ var getJibProfilesProfiles = function (input, common, data) { "macosx-x64": { target_os: "macosx", target_cpu: "x64", - dependencies: ["devkit", "freetype"], + dependencies: ["devkit", "autoconf", "freetype"], configure_args: concat(common.configure_args_64bit, "--with-zlib=system", "--with-macosx-version-max=10.7.0"), }, @@ -437,7 +437,7 @@ var getJibProfilesProfiles = function (input, common, data) { "solaris-x64": { target_os: "solaris", target_cpu: "x64", - dependencies: ["devkit", "cups"], + dependencies: ["devkit", "autoconf", "cups"], configure_args: concat(common.configure_args_64bit, "--with-zlib=system", "--enable-dtrace"), }, @@ -445,7 +445,7 @@ var getJibProfilesProfiles = function (input, common, data) { "solaris-sparcv9": { target_os: "solaris", target_cpu: "sparcv9", - dependencies: ["devkit", "cups"], + dependencies: ["devkit", "autoconf", "cups"], configure_args: concat(common.configure_args_64bit, "--with-zlib=system", "--enable-dtrace"), }, @@ -453,7 +453,7 @@ var getJibProfilesProfiles = function (input, common, data) { "windows-x64": { target_os: "windows", target_cpu: "x64", - dependencies: ["devkit", "freetype"], + dependencies: ["devkit", "autoconf", "freetype"], configure_args: concat(common.configure_args_64bit), }, @@ -461,7 +461,7 @@ var getJibProfilesProfiles = function (input, common, data) { target_os: "windows", target_cpu: "x86", build_cpu: "x64", - dependencies: ["devkit", "freetype"], + dependencies: ["devkit", "autoconf", "freetype"], configure_args: concat(common.configure_args_32bit), }, @@ -469,7 +469,7 @@ var getJibProfilesProfiles = function (input, common, data) { target_os: "linux", target_cpu: "aarch64", build_cpu: "x64", - dependencies: ["devkit", "build_devkit", "cups", "headless_stubs"], + dependencies: ["devkit", "autoconf", "build_devkit", "cups", "headless_stubs"], configure_args: [ "--with-cpu-port=arm64", "--with-jvm-variants=server", @@ -482,7 +482,7 @@ var getJibProfilesProfiles = function (input, common, data) { target_os: "linux", target_cpu: "arm", build_cpu: "x64", - dependencies: ["devkit", "build_devkit", "cups"], + dependencies: ["devkit", "autoconf", "build_devkit", "cups"], configure_args: [ "--with-jvm-variants=minimal1,client", "--with-x=" + input.get("devkit", "install_path") + "/arm-linux-gnueabihf/libc/usr/X11R6-PI", @@ -829,7 +829,7 @@ var getJibProfilesDependencies = function (input, common) { jtreg: { server: "javare", revision: "4.2", - build_number: "b10", + build_number: "b12", checksum_file: "MD5_VALUES", file: "jtreg_bin-4.2.zip", environment_name: "JT_HOME", @@ -854,6 +854,17 @@ var getJibProfilesDependencies = function (input, common) { environment_path: makeBinDir }, + autoconf: { + organization: common.organization, + ext: "tar.gz", + revision: "2.69+1.0.1", + module: (input.build_os == "windows" + ? "autoconf-" + input.build_osenv_platform + : "autoconf-" + input.build_platform), + configure_args: "", + environment_path: input.get("autoconf", "install_path") + }, + freetype: { organization: common.organization, ext: "tar.gz", @@ -878,6 +889,7 @@ var getJibProfilesDependencies = function (input, common) { configure_args: "PANDOC=" + input.get("pandoc", "install_path") + "/pandoc/pandoc", environment_path: input.get("pandoc", "install_path") + "/pandoc" }, + // This adds java jib as a dependency for the test artifacts resolver jib: { organization: "com.oracle.java.jib", diff --git a/make/copy/Copy-java.base.gmk b/make/copy/Copy-java.base.gmk index 74759879179..096f6c0e903 100644 --- a/make/copy/Copy-java.base.gmk +++ b/make/copy/Copy-java.base.gmk @@ -24,6 +24,7 @@ # include CopyCommon.gmk +include TextFileProcessing.gmk $(eval $(call IncludeCustomExtension, copy/Copy-java.base.gmk)) @@ -244,3 +245,16 @@ ifeq ($(ENABLE_LIBFFI_BUNDLING), true) endif ################################################################################ +# Generate classfile_constants.h + +$(eval $(call SetupTextFileProcessing, CREATE_CLASSFILE_CONSTANTS_H, \ + SOURCE_FILES := $(TOPDIR)/src/java.base/share/native/include/classfile_constants.h.template, \ + OUTPUT_FILE := $(SUPPORT_OUTPUTDIR)/modules_include/java.base/classfile_constants.h, \ + REPLACEMENTS := \ + @@VERSION_CLASSFILE_MAJOR@@ => $(VERSION_CLASSFILE_MAJOR) ; \ + @@VERSION_CLASSFILE_MINOR@@ => $(VERSION_CLASSFILE_MINOR) ; , \ +)) + +TARGETS += $(CREATE_CLASSFILE_CONSTANTS_H) + +################################################################################ diff --git a/make/copy/Copy-java.corba.gmk b/make/copy/Copy-java.corba.gmk deleted file mode 100644 index 61628c465af..00000000000 --- a/make/copy/Copy-java.corba.gmk +++ /dev/null @@ -1,34 +0,0 @@ -# -# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -################################################################################ -# Copy idl files to jdk/lib. -$(eval $(call SetupCopyFiles,COPY_IDL, \ - SRC := $(TOPDIR)/src/java.corba/share/classes/com/sun/tools/corba/se/idl, \ - DEST := $(SUPPORT_OUTPUTDIR)/modules_include/$(MODULE), \ - FILES := $(TOPDIR)/src/java.corba/share/classes/com/sun/tools/corba/se/idl/orb.idl \ - $(TOPDIR)/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ir.idl)) - -TARGETS := $(COPY_IDL) diff --git a/make/copy/CopyCommon.gmk b/make/copy/CopyCommon.gmk index 2956e9ddf92..6d4cdbaf747 100644 --- a/make/copy/CopyCommon.gmk +++ b/make/copy/CopyCommon.gmk @@ -39,20 +39,12 @@ ifneq ($(wildcard $(INCLUDE_SOURCE_DIR)/*), ) $(eval $(call SetupCopyFiles, COPY_EXPORTED_INCLUDE, \ SRC := $(INCLUDE_SOURCE_DIR), \ DEST := $(INCLUDE_TARGET_DIR), \ - FILES := $(shell $(FIND) $(INCLUDE_SOURCE_DIR) -type f), \ + FILES := $(filter %.h, $(call CacheFind, $(INCLUDE_SOURCE_DIR))), \ )) TARGETS += $(COPY_EXPORTED_INCLUDE) endif -# For historical reasons, the OS include directories have odd names. -INCLUDE_TARGET_OS_SUBDIR := $(OPENJDK_TARGET_OS) -ifeq ($(OPENJDK_TARGET_OS), windows) - INCLUDE_TARGET_OS_SUBDIR := win32 -else ifeq ($(OPENJDK_TARGET_OS), macosx) - INCLUDE_TARGET_OS_SUBDIR := darwin -endif - # Use the most specific of OS and OS_TYPE. INCLUDE_SOURCE_OS_DIR := $(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS)/native/include ifeq ($(wildcard $(INCLUDE_SOURCE_OS_DIR)/*), ) @@ -62,8 +54,8 @@ endif ifneq ($(wildcard $(INCLUDE_SOURCE_OS_DIR)/*), ) $(eval $(call SetupCopyFiles, COPY_EXPORTED_INCLUDE_OS, \ SRC := $(INCLUDE_SOURCE_OS_DIR), \ - DEST := $(INCLUDE_TARGET_DIR)/$(INCLUDE_TARGET_OS_SUBDIR), \ - FILES := $(shell $(FIND) $(INCLUDE_SOURCE_OS_DIR) -type f), \ + DEST := $(INCLUDE_TARGET_DIR)/$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR), \ + FILES := $(filter %.h, $(call CacheFind, $(INCLUDE_SOURCE_OS_DIR))), \ )) TARGETS += $(COPY_EXPORTED_INCLUDE_OS) diff --git a/make/corba/src/classes/build/tools/logutil/IndentingPrintWriter.java b/make/corba/src/classes/build/tools/logutil/IndentingPrintWriter.java deleted file mode 100644 index d6272db118b..00000000000 --- a/make/corba/src/classes/build/tools/logutil/IndentingPrintWriter.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package build.tools.logutil; - -import java.io.PrintWriter ; -import java.io.Writer ; -import java.io.OutputStream ; -import java.io.BufferedWriter ; -import java.io.OutputStreamWriter ; -import java.util.StringTokenizer ; - -public class IndentingPrintWriter extends PrintWriter { - private int level = 0 ; - private int indentWidth = 4 ; - private String indentString = "" ; - - public void printMsg( String msg, Object... data ) - { - // System.out.println( "printMsg called with msg=" + msg + " data=" + data ) ; - StringTokenizer st = new StringTokenizer( msg, "@", true ) ; - StringBuffer result = new StringBuffer() ; - String token = null ; - int pos = 0; - - while (st.hasMoreTokens()) { - token = st.nextToken() ; - if (token.equals("@")) { - if (pos < data.length) { - result.append( data[pos] ); - ++pos; - } else { - throw new Error( "List too short for message" ) ; - } - } else { - result.append( token ) ; - } - } - - // System.out.println( "Printing result " + result + " to file" ) ; - print( result ) ; - println() ; - } - - public IndentingPrintWriter (Writer out) { - super( out, true ) ; - // System.out.println( "Constructing a new IndentingPrintWriter with Writer " + out ) ; - } - - public IndentingPrintWriter(Writer out, boolean autoFlush) { - super( out, autoFlush ) ; - // System.out.println( "Constructing a new IndentingPrintWriter with Writer " + out ) ; - } - - public IndentingPrintWriter(OutputStream out) { - super(out, true); - // System.out.println( "Constructing a new IndentingPrintWriter with OutputStream " + out ) ; - } - - public IndentingPrintWriter(OutputStream out, boolean autoFlush) { - super(new BufferedWriter(new OutputStreamWriter(out)), autoFlush); - // System.out.println( "Constructing a new IndentingPrintWriter with OutputStream " + out ) ; - } - - public void setIndentWidth( int indentWidth ) - { - this.indentWidth = indentWidth ; - updateIndentString() ; - } - - public void indent() - { - level++ ; - updateIndentString() ; - } - - public void undent() - { - if (level > 0) { - level-- ; - updateIndentString() ; - } - } - - private void updateIndentString() - { - int size = level * indentWidth ; - StringBuffer sbuf = new StringBuffer( size ) ; - for (int ctr = 0; ctr exceptions; - - /** - * Represents the current state of parsing the input. - */ - private enum State - { - OUTER, - IN_CLASS, - IN_EXCEPTION_LIST - }; - - /** - * Regular expression to match each code line. - */ - private static final Pattern EXCEPTION_INFO_REGEX = - Pattern.compile("(\\w+)\\s*(\\d+)\\s*(\\w+)"); - - /** - * Parses the specified file to create a new {@link Input} - * object. - * - * @param filename the file to parse. - * @throws FileNotFoundException if the file can't be found. - * @throws IOException if an I/O error occurs. - */ - public Input(final String filename) - throws FileNotFoundException, IOException { - BufferedReader r = - new BufferedReader(new InputStreamReader(new FileInputStream(filename))); - State state = State.OUTER; - InputException current = null; - exceptions = new LinkedList(); - String line; - while ((line = r.readLine()) != null) { - // Skip ; comments - if (line.startsWith(";")) - continue; - - int index = line.indexOf("("); - if (index == -1) - continue; - - switch (state) { - case OUTER: - state = State.IN_CLASS; - String[] classInfo = line.substring(index).split(" "); - packageName = classInfo[0].substring(2, classInfo[0].length() - 1); - className = classInfo[1].substring(1, classInfo[1].length() - 1); - groupName = classInfo[2]; - break; - case IN_CLASS: - state = State.IN_EXCEPTION_LIST; - break; - case IN_EXCEPTION_LIST: - boolean inQuote = false; - boolean inCode = false; - boolean end = false; - int start = index + 1; - Queue lines = new LinkedList(); - for (int a = start; a < line.length(); ++a) { - if (line.charAt(a) == '(' && !inCode && !inQuote) { - if (current == null) - current = - new InputException(line.substring(start, a).trim()); - start = a + 1; - inCode = true; - } - if (line.charAt(a) == '"') - inQuote = !inQuote; - if (line.charAt(a) == ')' && !inQuote) { - if (inCode) { - lines.offer(line.substring(start, a)); - inCode = false; - } else - end = true; - } - if (!end && a == line.length() - 1) - line += r.readLine(); - } - for (String l : lines) { - int stringStart = l.indexOf("\"") + 1; - int stringEnd = l.indexOf("\"", stringStart); - Matcher matcher = EXCEPTION_INFO_REGEX.matcher(l.substring(0, stringStart)); - if (matcher.find()) - current.add(new InputCode(matcher.group(1), - Integer.parseInt(matcher.group(2)), - matcher.group(3), - l.substring(stringStart, stringEnd))); - } - exceptions.offer(current); - current = null; - break; - } - } - } - - /** - * Returns the name of this group of exceptions. - * - * @return the name of this group of exceptions. - */ - public String getGroupName() - { - return groupName; - } - - /** - * Returns the name of the package this class will go in. - * - * @return the name of the package. - */ - public String getPackageName() - { - return packageName; - } - - /** - * Returns the name of the generated class. - * - * @return the name of the class. - */ - public String getClassName() - { - return className; - } - - /** - * Returns the exceptions contained in this class. - * - * @return the exceptions. - */ - public Queue getExceptions() { - return exceptions; - } - - /** - * Returns a textual representation of this input. - * - * @return a textual representation. - */ - public String toString() { - return getClass().getName() + - "[packageName=" + packageName + - ",className=" + className + - ",groupName=" + groupName + - ",exceptions=" + exceptions + - "]"; - } - -} diff --git a/make/corba/src/classes/build/tools/logutil/InputCode.java b/make/corba/src/classes/build/tools/logutil/InputCode.java deleted file mode 100644 index b033382196b..00000000000 --- a/make/corba/src/classes/build/tools/logutil/InputCode.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package build.tools.logutil; - -public class InputCode { - - /** - * The name of this code. - */ - private final String name; - - /** - * The code. - */ - private final int code; - - /** - * The log level for this code. - */ - private final String logLevel; - - /** - * The error message for this code. - */ - private final String message; - - /** - * Creates a new error code with the specified name, code, - * log level and error message. - * - * @param name the name of the new code. - * @param code the code itself. - * @param logLevel the level of severity of this error. - * @param message the error message for this code. - */ - public InputCode(final String name, final int code, - final String logLevel, final String message) { - this.name = name; - this.code = code; - this.logLevel = logLevel; - this.message = message; - } - - /** - * Returns the name of this code. - * - * @return the name of the code. - */ - public String getName() { - return name; - } - - /** - * Returns the code. - * - * @return the code. - */ - public int getCode() { - return code; - } - - /** - * Returns the severity of this code. - * - * @return the log level severity of the code. - */ - public String getLogLevel() { - return logLevel; - } - - /** - * Returns the error message for this code. - * - * @return the error message for this code. - */ - public String getMessage() { - return message; - } - - /** - * Returns a textual representation of this code. - * - * @return a textual representation. - */ - public String toString() { - return getClass().getName() + - "[name=" + name + - ",code=" + code + - ",logLevel=" + logLevel + - ",message=" + message + - "]"; - } - -} diff --git a/make/corba/src/classes/build/tools/logutil/InputException.java b/make/corba/src/classes/build/tools/logutil/InputException.java deleted file mode 100644 index 5b13de20496..00000000000 --- a/make/corba/src/classes/build/tools/logutil/InputException.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package build.tools.logutil; - -import java.util.LinkedList; -import java.util.Queue; - -public class InputException { - - /** - * The name of this exception. - */ - private final String name; - - /** - * The codes associated with this exception. - */ - private final Queue codes; - - /** - * Constructs a new {@link InputException} with the - * specified name. - * - * @param name the name of the new exception; - */ - public InputException(final String name) { - this.name = name; - codes = new LinkedList(); - } - - /** - * Adds a new code to this exception. - * - * @param c the code to add. - */ - public void add(InputCode c) - { - codes.offer(c); - } - - /** - * Returns the name of this exception. - * - * @return the exception's name. - */ - public String getName() { - return name; - } - - /** - * Returns the codes associated with this exception. - * - * @return the exception's codes. - */ - public Queue getCodes() { - return codes; - } - - /** - * Returns a textual representation of this exception. - * - * @return a textual representation. - */ - public String toString() { - return getClass().getName() - + "[name=" + name - + ",codes=" + codes - + "]"; - } - -} diff --git a/make/corba/src/classes/build/tools/logutil/MC.java b/make/corba/src/classes/build/tools/logutil/MC.java deleted file mode 100644 index c02602ec0b7..00000000000 --- a/make/corba/src/classes/build/tools/logutil/MC.java +++ /dev/null @@ -1,559 +0,0 @@ -/* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package build.tools.logutil; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; - -import java.util.Arrays; -import java.util.Date; -import java.util.Formatter; -import java.util.List; -import java.util.Queue; - -public class MC { - - private static final String VERSION = "1.0"; - - private static final List SUN_EXCEPTION_GROUPS = Arrays.asList(new String[] - { "SUNBASE", "ORBUTIL", "ACTIVATION", "NAMING", "INTERCEPTORS", "POA", "IOR", "UTIL" }); - - private static final List EXCEPTIONS = Arrays.asList(new String[] - { "UNKNOWN", "BAD_PARAM", "NO_MEMORY", "IMP_LIMIT", "COMM_FAILURE", "INV_OBJREF", "NO_PERMISSION", - "INTERNAL", "MARSHAL", "INITIALIZE", "NO_IMPLEMENT", "BAD_TYPECODE", "BAD_OPERATION", "NO_RESOURCES", - "NO_RESPONSE", "PERSIST_STORE", "BAD_INV_ORDER", "TRANSIENT", "FREE_MEM", "INV_IDENT", "INV_FLAG", - "INTF_REPOS", "BAD_CONTEXT", "OBJ_ADAPTER", "DATA_CONVERSION", "OBJECT_NOT_EXIST", "TRANSACTION_REQUIRED", - "TRANSACTION_ROLLEDBACK", "INVALID_TRANSACTION", "INV_POLICY", "CODESET_INCOMPATIBLE", "REBIND", - "TIMEOUT", "TRANSACTION_UNAVAILABLE", "BAD_QOS", "INVALID_ACTIVITY", "ACTIVITY_COMPLETED", - "ACTIVITY_REQUIRED" }); - - /** - * Read the minor codes from the input file and - * write out a resource file. - * - * @param inFile the file to read the codes from. - * @param outDir the directory to write the resource file to. - * @throws FileNotFoundException if the input file can not be found. - * @throws IOException if an I/O error occurs. - */ - private void makeResource(String inFile, String outDir) - throws FileNotFoundException, IOException { - writeResource(outDir, new Input(inFile)); - } - - /** - * Create a new Java source file using the specified Scheme input file, - * and writing the result to the given output directory. - * - * @param inFile the file to read the data from. - * @param outDir the directory to write the Java class to. - * @throws FileNotFoundException if the input file can not be found. - * @throws IOException if an I/O error occurs. - */ - private void makeClass(String inFile, String outDir) - throws FileNotFoundException, IOException { - writeClass(inFile, outDir, new Input(inFile)); - } - - /** - * Writes out a Java source file using the data from the given - * {@link Input} object. The result is written to {@code outDir}. - * The name of the input file is just used in the header of the - * resulting source file. - * - * @param inFile the name of the file the data was read from. - * @param outDir the directory to write the Java class to. - * @param input the parsed input data. - * @throws FileNotFoundException if the output file can't be written. - */ - private void writeClass(String inFile, String outDir, Input input) - throws FileNotFoundException { - String packageName = input.getPackageName(); - String className = input.getClassName(); - String groupName = input.getGroupName(); - Queue exceptions = input.getExceptions(); - FileOutputStream file = new FileOutputStream(outDir + File.separator + className + ".java"); - IndentingPrintWriter pw = new IndentingPrintWriter(file); - - writeClassHeader(inFile, groupName, pw); - pw.printMsg("package @ ;", packageName); - pw.println(); - pw.println("import java.util.logging.Logger ;"); - pw.println("import java.util.logging.Level ;"); - pw.println(); - pw.println("import org.omg.CORBA.OMGVMCID ;"); - pw.println( "import com.sun.corba.se.impl.util.SUNVMCID ;"); - pw.println( "import org.omg.CORBA.CompletionStatus ;"); - pw.println( "import org.omg.CORBA.SystemException ;"); - pw.println(); - pw.println( "import com.sun.corba.se.spi.orb.ORB ;"); - pw.println(); - pw.println( "import com.sun.corba.se.spi.logging.LogWrapperFactory;"); - pw.println(); - pw.println( "import com.sun.corba.se.spi.logging.LogWrapperBase;"); - pw.println(); - writeImports(exceptions, pw); - pw.println(); - pw.indent(); - pw.printMsg("public class @ extends LogWrapperBase {", className); - pw.println(); - pw.printMsg("public @( Logger logger )", className); - pw.indent(); - pw.println( "{"); - pw.undent(); - pw.println( "super( logger ) ;"); - pw.println( "}"); - pw.println(); - pw.flush(); - writeFactoryMethod(className, groupName, pw); - writeExceptions(groupName, exceptions, className, pw); - pw.undent(); - pw.println( ); - pw.println( "}"); - pw.flush(); - pw.close(); - } - - /** - * Writes out the header of a Java source file. - * - * @param inFile the input file the file was generated from. - * @param groupName the group of exceptions the Java source file is for. - * @param pw the print writer used to write the output. - */ - private void writeClassHeader(String inFile, String groupName, - IndentingPrintWriter pw) { - if (groupName.equals("OMG")) - pw.println("// Log wrapper class for standard exceptions"); - else - pw.printMsg("// Log wrapper class for Sun private system exceptions in group @", - groupName); - pw.println("//"); - pw.printMsg("// Generated by MC.java version @, DO NOT EDIT BY HAND!", VERSION); - pw.printMsg("// Generated from input file @ on @", inFile, new Date()); - pw.println(); - } - - /** - * Write out the import list for the exceptions. - * - * @param groups the exceptions that were parsed. - * @param pw the {@link IndentingPrintWriter} for writing to the file. - */ - private void writeImports(Queue exceptions, - IndentingPrintWriter pw) { - if (exceptions == null) - return; - for (InputException e : exceptions) - pw.println("import org.omg.CORBA." + e.getName() + " ;"); - } - - /** - * Write out the factory method for this group of exceptions. - * - * @param className the name of the generated class. - * @param groupName the name of this group of exceptions. - * @param pw the {@link IndentingPrintWriter} for writing to the file. - */ - private void writeFactoryMethod(String className, String groupName, - IndentingPrintWriter pw) { - pw.indent(); - pw.println( "private static LogWrapperFactory factory = new LogWrapperFactory() {"); - pw.println( "public LogWrapperBase create( Logger logger )" ); - pw.indent(); - pw.println( "{"); - pw.undent(); - pw.printMsg("return new @( logger ) ;", className); - pw.undent(); - pw.println( "}" ); - pw.println( "} ;" ); - pw.println(); - pw.printMsg("public static @ get( ORB orb, String logDomain )", className); - pw.indent(); - pw.println( "{"); - pw.indent(); - pw.printMsg( "@ wrapper = ", className); - pw.indent(); - pw.printMsg( "(@) orb.getLogWrapper( logDomain, ", className); - pw.undent(); - pw.undent(); - pw.printMsg( "\"@\", factory ) ;", groupName); - pw.undent(); - pw.println( "return wrapper ;" ); - pw.println( "} " ); - pw.println(); - pw.printMsg( "public static @ get( String logDomain )", className); - pw.indent(); - pw.println( "{"); - pw.indent(); - pw.printMsg( "@ wrapper = ", className); - pw.indent(); - pw.printMsg( "(@) ORB.staticGetLogWrapper( logDomain, ", className); - pw.undent(); - pw.undent(); - pw.printMsg( "\"@\", factory ) ;", groupName); - pw.undent(); - pw.println( "return wrapper ;" ); - pw.println( "} " ); - pw.println(); - } - - /** - * Writes out the exceptions themselves. - * - * @param groupName the name of this group of exceptions. - * @param exceptions the exceptions to write out. - * @param className the name of the generated class. - * @param pw the {@link IndentingPrintWriter} for writing to the file. - */ - private void writeExceptions(String groupName, Queue exceptions, - String className, IndentingPrintWriter pw) { - for (InputException e : exceptions) { - pw.println("///////////////////////////////////////////////////////////"); - pw.printMsg("// @", e.getName()); - pw.println("///////////////////////////////////////////////////////////"); - pw.println(); - for (InputCode c : e.getCodes()) - writeMethods(groupName, e.getName(), c.getName(), c.getCode(), - c.getLogLevel(), className, StringUtil.countArgs(c.getMessage()), pw); - pw.flush(); - } - } - - /** - * Writes out the methods for a particular error. - * - * @param groupName the name of this group of exceptions. - * @param exceptionName the name of this particular exception. - * @param errorName the name of this particular error. - * @param code the minor code for this particular error. - * @param ident the name of the error in mixed-case identifier form. - * @param level the level at which to place log messages. - * @param className the name of the class for this group of exceptions. - * @param numParams the number of parameters the detail message takes. - * @param pw the print writer for writing to the file. - */ - private void writeMethods(String groupName, String exceptionName, String errorName, - int code, String level, String className, int numParams, - IndentingPrintWriter pw) { - String ident = StringUtil.toMixedCase(errorName); - pw.printMsg("public static final int @ = @ ;", errorName, getBase(groupName, code)); - pw.println(); - pw.flush(); - writeMethodStatusCause(groupName, exceptionName, errorName, ident, level, - numParams, className, pw); - pw.println(); - pw.flush(); - writeMethodStatus(exceptionName, ident, numParams, pw); - pw.println(); - pw.flush(); - writeMethodCause(exceptionName, ident, numParams, pw); - pw.println(); - pw.flush(); - writeMethodNoArgs(exceptionName, ident, numParams, pw); - pw.println(); - pw.flush(); - } - - /** - * Writes out a method for an error that takes a - * {@link org.omg.CORBA.CompletionStatus} and a cause. - * - * @param groupName the name of this group of exceptions. - * @param exceptionName the name of this particular exception. - * @param errorName the name of this particular error. - * @param ident the name of the error in mixed-case identifier form. - * @param logLevel the level at which to place log messages. - * @param numParams the number of parameters the detail message takes. - * @param className the name of the class for this group of exceptions. - * @param pw the print writer for writing to the file. - */ - private void writeMethodStatusCause(String groupName, String exceptionName, - String errorName, String ident, - String logLevel, int numParams, - String className, IndentingPrintWriter pw) { - pw.indent(); - pw.printMsg( "public @ @( CompletionStatus cs, Throwable t@) {", exceptionName, - ident, makeDeclArgs(true, numParams)); - pw.printMsg( "@ exc = new @( @, cs ) ;", exceptionName, exceptionName, errorName); - pw.indent(); - pw.println( "if (t != null)" ); - pw.undent(); - pw.println( "exc.initCause( t ) ;" ); - pw.println(); - pw.indent(); - pw.printMsg( "if (logger.isLoggable( Level.@ )) {", logLevel); - if (numParams > 0) { - pw.printMsg( "Object[] parameters = new Object[@] ;", numParams); - for (int a = 0; a < numParams; ++a) - pw.printMsg("parameters[@] = arg@ ;", a, a); - } else - pw.println( "Object[] parameters = null ;"); - pw.indent(); - pw.printMsg( "doLog( Level.@, \"@.@\",", logLevel, groupName, ident); - pw.undent(); - pw.undent(); - pw.printMsg( "parameters, @.class, exc ) ;", className); - pw.println( "}"); - pw.println(); - - pw.undent(); - pw.println( "return exc ;"); - pw.println( "}"); - } - - /** - * Writes out a method for an error that takes a - * {@link org.omg.CORBA.CompletionStatus}. - * - * @param exceptionName the name of this particular exception. - * @param ident the name of the error in mixed-case identifier form. - * @param numParams the number of parameters the detail message takes. - * @param pw the print writer for writing to the file. - */ - private void writeMethodStatus(String exceptionName, String ident, - int numParams, IndentingPrintWriter pw) { - pw.indent(); - pw.printMsg("public @ @( CompletionStatus cs@) {", exceptionName, - ident, makeDeclArgs(true, numParams)); - pw.undent(); - pw.printMsg("return @( cs, null@ ) ;", ident, makeCallArgs(true, numParams)); - pw.println("}"); - } - - /** - * Writes out a method for an error that takes a cause. - * - * @param exceptionName the name of this particular exception. - * @param ident the name of the error in mixed-case identifier form. - * @param numParams the number of parameters the detail message takes. - * @param pw the print writer for writing to the file. - */ - private void writeMethodCause(String exceptionName, String ident, - int numParams, IndentingPrintWriter pw) { - pw.indent(); - pw.printMsg("public @ @( Throwable t@) {", exceptionName, ident, - makeDeclArgs(true, numParams)); - pw.undent(); - pw.printMsg("return @( CompletionStatus.COMPLETED_NO, t@ ) ;", ident, - makeCallArgs(true, numParams)); - pw.println("}"); - } - - /** - * Writes out a method for an error that takes no arguments. - * - * @param exceptionName the name of this particular exception. - * @param ident the name of the error in mixed-case identifier form. - * @param numParams the number of parameters the detail message takes. - * @param pw the print writer for writing to the file. - */ - private void writeMethodNoArgs(String exceptionName, String ident, - int numParams, IndentingPrintWriter pw) { - - pw.indent(); - pw.printMsg("public @ @( @) {", exceptionName, ident, - makeDeclArgs(false, numParams)); - pw.undent(); - pw.printMsg("return @( CompletionStatus.COMPLETED_NO, null@ ) ;", - ident, makeCallArgs(true, numParams)); - pw.println("}"); - } - - /** - * Returns a list of comma-separated arguments with type declarations. - * - * @param leadingComma true if the list should start with a comma. - * @param numArgs the number of arguments to generate. - * @return the generated string. - */ - private String makeDeclArgs(boolean leadingComma, int numArgs) { - return makeArgString("Object arg", leadingComma, numArgs); - } - - /** - * Returns a list of comma-separated arguments without type declarations. - * - * @param leadingComma true if the list should start with a comma. - * @param numArgs the number of arguments to generate. - * @return the generated string. - */ - private String makeCallArgs(boolean leadingComma, int numArgs) { - return makeArgString("arg", leadingComma, numArgs); - } - - /** - * Returns a list of comma-separated arguments. - * - * @param prefixString the string with which to prefix each argument. - * @param leadingComma true if the list should start with a comma. - * @param numArgs the number of arguments to generate. - * @return the generated string. - */ - private String makeArgString(String prefixString, boolean leadingComma, - int numArgs) { - if (numArgs == 0) - return " "; - if (numArgs == 1) { - if (leadingComma) - return ", " + prefixString + (numArgs - 1); - else - return " " + prefixString + (numArgs - 1); - } - return makeArgString(prefixString, leadingComma, numArgs - 1) + - ", " + prefixString + (numArgs - 1); - } - - /** - * Returns the {@link String} containing the calculation of the - * error code. - * - * @param groupName the group of exception to which the code belongs. - * @param code the minor code number representing the exception within the group. - * @return the unique error code. - */ - private String getBase(String groupName, int code) { - if (groupName.equals("OMG")) - return "OMGVMCID.value + " + code; - else - return "SUNVMCID.value + " + (code + getSunBaseNumber(groupName)); - } - - /** - * Returns the base number for Sun-specific exceptions. - * - * @return the base number. - */ - private int getSunBaseNumber(String groupName) { - return 200 * SUN_EXCEPTION_GROUPS.indexOf(groupName); - } - - /** - * Writes out a resource file using the data from the given - * {@link Input} object. The result is written to {@code outDir}. - * - * @param outDir the directory to write the Java class to. - * @param input the parsed input data. - * @throws FileNotFoundException if the output file can't be written. - */ - private void writeResource(String outDir, Input input) - throws FileNotFoundException { - FileOutputStream file = new FileOutputStream(outDir + File.separator + - input.getClassName() + ".resource"); - IndentingPrintWriter pw = new IndentingPrintWriter(file); - String groupName = input.getGroupName(); - for (InputException e : input.getExceptions()) { - String exName = e.getName(); - for (InputCode c : e.getCodes()) { - String ident = StringUtil.toMixedCase(c.getName()); - pw.printMsg("@.@=\"@: (@) @\"", groupName, ident, - getMessageID(groupName, exName, c.getCode()), exName, c.getMessage()); - } - pw.flush(); - } - pw.close(); - } - - /** - * Returns the message ID corresponding to the given group name, - * exception name and error code. - * - * @param groupName the name of the group of exceptions. - * @param exception the name of the particular exception. - * @param code an error code from the given exception. - * @return the message ID. - */ - private String getMessageID(String groupName, String exceptionName, int code) { - if (groupName.equals("OMG")) - return getStandardMessageID(exceptionName, code); - else - return getSunMessageID(groupName, exceptionName, code); - } - - /** - * Returns the standard (OMG) message ID corresponding to the given - * exception name and error code. - * - * @param exceptionName the name of the particular exception. - * @param code an error code from the given exception. - * @return the message ID. - */ - private String getStandardMessageID(String exceptionName, int code) { - return new Formatter().format("IOP%s0%04d", getExceptionID(exceptionName), - code).toString(); - } - - /** - * Returns the Sun message ID corresponding to the given group name, - * exception name and error code. - * - * @param groupName the name of the group of exceptions. - * @param exceptionName the name of the particular exception. - * @param code an error code from the given exception. - * @return the message ID. - */ - private String getSunMessageID(String groupName, String exceptionName, int code) { - return new Formatter().format("IOP%s1%04d", getExceptionID(exceptionName), - getSunBaseNumber(groupName) + code).toString(); - } - - /** - * Returns the exception ID corresponding to the given exception name. - * - * @param exceptionName the name of the particular exception. - * @return the message ID. - */ - private String getExceptionID(String exceptionName) { - return new Formatter().format("%03d", EXCEPTIONS.indexOf(exceptionName)).toString(); - } - - /** - * Entry point for running the generator from the command - * line. Users can specify either "make-class" or "make-resource" - * as the first argument to generate the specified type of file. - * - * @param args the command-line arguments. - * @throws FileNotFoundException if the input file can not be found. - * @throws IOException if an I/O error occurs. - */ - public static void main(String[] args) - throws FileNotFoundException, IOException - { - if (args.length < 3) - { - System.err.println("(make-class|make-resource) "); - System.exit(-1); - } - if (args[0].equals("make-class")) - new MC().makeClass(args[1], args[2]); - else if (args[0].equals("make-resource")) - new MC().makeResource(args[1], args[2]); - else - System.err.println("Invalid command: " + args[0]); - } - -} diff --git a/make/corba/src/classes/build/tools/logutil/StringUtil.java b/make/corba/src/classes/build/tools/logutil/StringUtil.java deleted file mode 100644 index c56023545df..00000000000 --- a/make/corba/src/classes/build/tools/logutil/StringUtil.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package build.tools.logutil; - -public abstract class StringUtil { - /** Take a string containing underscores, and return a string - * with the underscore removed, and all characters exception in lower - * case except the characters after the underscores. - */ - public static String toMixedCase( String str ) - { - StringBuffer sbuf = new StringBuffer( str.length() ) ; - boolean uppercaseNext = false ; - for (int ctr=0; ctr= '0' && i <= '9') { v = i - '0'; } + // else if (i >= 'A' && i <= 'Z') { v = i - 'A' + 10; } + // else if (i >= 'a' && i <= 'z') { v = i - 'a' + 10; } + // if (i % 20 == 0) System.out.println(); + // System.out.printf("%2d, ", v); + // } + // + // Analysis has shown that generating the whole array allows the JIT to generate + // better code compared to a slimmed down array, such as one cutting off after 'z' + private static final byte[] DIGITS = new byte[] { + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, + -1, -1, -1, -1, -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, -1, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; + int digit(int ch, int radix) { - int value = -1; - if (radix >= Character.MIN_RADIX && radix <= Character.MAX_RADIX) { - int val = getProperties(ch); - int kind = val & $$maskType; - if (kind == Character.DECIMAL_DIGIT_NUMBER) { - value = ch + ((val & $$maskDigitOffset) >> $$shiftDigitOffset) & $$maskDigit; - } - else if ((val & $$maskNumericType) == $$valueJavaSupradecimal) { - // Java supradecimal digit - value = (ch + ((val & $$maskDigitOffset) >> $$shiftDigitOffset) & $$maskDigit) + 10; - } - } - return (value < radix) ? value : -1; + int value = DIGITS[ch]; + return (value >= 0 && value < radix && radix >= Character.MIN_RADIX + && radix <= Character.MAX_RADIX) ? value : -1; } int getNumericValue(int ch) { diff --git a/make/data/jdwp/jdwp.spec b/make/data/jdwp/jdwp.spec index 0b7afa76a9c..a33f31ed41c 100644 --- a/make/data/jdwp/jdwp.spec +++ b/make/data/jdwp/jdwp.spec @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -869,7 +869,6 @@ JDWP "Java(tm) Debug Wire Protocol" "section in " "The Java™ Virtual Machine Specification. " "Since JDWP version 1.5." - "

      (Out (referenceType refType "The reference type ID.") ) @@ -2723,7 +2722,6 @@ JDWP "Java(tm) Debug Wire Protocol" "

      " "The events that are grouped in a composite event are restricted in the " "following ways: " - "

      " "

        " "
      • Only with other thread start events for the same thread:" "
          " diff --git a/make/devkit/Makefile b/make/devkit/Makefile index 96b5e3a255a..32fa6f5212e 100644 --- a/make/devkit/Makefile +++ b/make/devkit/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ # questions. # -########################################################################################## +################################################################################ # # This Makefile, together with Tools.gmk, can be used to compile a set of # gcc based cross compilation, portable, self contained packages, capable @@ -31,60 +31,55 @@ # # In addition to the makefiles, access to Oracle Linux installation # media is required. This has been tested against Oracle Enterprise Linux -# 5.5. Set variables RPM_DIR_x86_64 and RPM_DIR_i686 respectively to point -# to directory containing the RPMs. +# 6.4. # -# By default this Makefile will build crosstools for: -# * i686-unknown-linux-gnu -# * x86_64-unknown-linux-gnu -# The x86_64 version of the compilers will work in multi arch mode and will -# be able to compile 32bit binaries with the -m32 flag. This makes the -# explicit cross compiler for i686 somewhat redundant and is a known issue. +# By default this Makefile will build a native toolchain for the current +# platform if called with something like this: # -# To build the full set of crosstools, use a command line looking like this: +# make tars # -# make tars RPM_DIR_x86_64=/tmp/oel64-x86_64/Packages/ RPM_DIR_i686=/tmp/oel64-i686/Packages/ +# To build the full set of crosstools for additional platforms, use a command +# line looking like this: # -# To create a x86_64 package without the redundant i686 cross compiler, do -# like this: +# make tars platforms="x86_64-unknown-linux-gnu sparc64-unknown-linux-gnu" # -# make tars platforms=x86_64-unknown-linux-gnu RPM_DIR_x86_64=/tmp/oel64-x86_64/Packages/ RPM_DIR_i686=/tmp/oel64-i686/Packages/ - -# -# Main makefile which iterates over all host and target platforms. +# This is the makefile which iterates over all host and target platforms. # os := $(shell uname -o) -cpu := x86_64 -#$(shell uname -p) - -# -# This wrapper script can handle exactly these platforms -# -platforms := $(foreach p,x86_64 i686,$(p)-unknown-linux-gnu) -#platforms := $(foreach p,x86_64,$(p)-unknown-linux-gnu) +cpu := $(shell uname -p) # Figure out what platform this is building on. me := $(cpu)-$(if $(findstring Linux,$(os)),unknown-linux-gnu) $(info Building on platform $(me)) +# +# By default just build for the current platform, which is assumed to be Linux +# +platforms := $(me) +host_platforms := $(platforms) +target_platforms := $(platforms) +$(info host_platforms $(host_platforms)) +$(info target_platforms $(target_platforms)) + all compile : $(platforms) ifeq (,$(SKIP_ME)) $(foreach p,$(filter-out $(me),$(platforms)),$(eval $(p) : $$(me))) endif -OUTPUTDIR = $(abspath ../../build/devkit) -RESULT = $(OUTPUTDIR)/result +OUTPUT_ROOT = $(abspath ../../build/devkit) +RESULT = $(OUTPUT_ROOT)/result submakevars = HOST=$@ BUILD=$(me) \ RESULT=$(RESULT) PREFIX=$(RESULT)/$@ \ - OUTPUTDIR=$(OUTPUTDIR) -$(platforms) : + OUTPUT_ROOT=$(OUTPUT_ROOT) +$(host_platforms) : @echo 'Building compilers for $@' - @echo 'Targets: $(platforms)' - for p in $@ $(filter-out $@,$(platforms)); do \ + @echo 'Targets: $(target_platforms)' + for p in $(filter $@, $(target_platforms)) $(filter-out $@, $(target_platforms)); do \ + $(MAKE) -f Tools.gmk download-rpms $(submakevars) TARGET=$$p && \ $(MAKE) -f Tools.gmk all $(submakevars) \ TARGET=$$p || exit 1 ; \ done @@ -92,12 +87,8 @@ $(platforms) : $(MAKE) -f Tools.gmk ccache $(submakevars) TARGET=$@ @echo 'All done"' -$(foreach a,i686 x86_64,$(eval $(a) : $(filter $(a)%,$(platforms)))) - -ia32 : i686 today := $(shell date +%Y%m%d) - define Mktar $(1)_tar = $$(RESULT)/sdk-$(1)-$$(today).tar.gz $$($(1)_tar) : PLATFORM = $(1) @@ -105,7 +96,7 @@ define Mktar $$($(1)_tar) : $(1) $$(shell find $$(RESULT)/$(1)) endef -$(foreach p,$(platforms),$(eval $(call Mktar,$(p)))) +$(foreach p,$(host_platforms),$(eval $(call Mktar,$(p)))) tars : all $(TARFILES) onlytars : $(TARFILES) @@ -115,7 +106,9 @@ onlytars : $(TARFILES) touch $@ clean : - rm -rf build result + rm -rf $(addprefix ../../build/devkit/, result $(host_platforms)) +dist-clean: clean + rm -rf $(addprefix ../../build/devkit/, src download) FORCE : -.PHONY : $(configs) $(platforms) +.PHONY : all compile tars $(configs) $(host_platforms) clean dist-clean diff --git a/make/devkit/Tools.gmk b/make/devkit/Tools.gmk index b259f9e77ac..126b0265fa0 100644 --- a/make/devkit/Tools.gmk +++ b/make/devkit/Tools.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -44,24 +44,42 @@ $(info HOST=$(HOST)) $(info BUILD=$(BUILD)) ARCH := $(word 1,$(subst -, ,$(TARGET))) +$(info ARCH=$(ARCH)) ########################################################################################## # Define external dependencies # Latest that could be made to work. -gcc_ver := gcc-4.9.2 -binutils_ver := binutils-2.25 -ccache_ver := ccache-3.2.1 -mpfr_ver := mpfr-3.0.1 -gmp_ver := gmp-4.3.2 -mpc_ver := mpc-1.0.1 +GCC_VER := 7.3.0 +ifeq ($(GCC_VER), 7.3.0) + gcc_ver := gcc-7.3.0 + binutils_ver := binutils-2.30 + ccache_ver := ccache-3.3.6 + mpfr_ver := mpfr-3.1.5 + gmp_ver := gmp-6.1.2 + mpc_ver := mpc-1.0.3 + gdb_ver := gdb-8.1 +else ifeq ($(GCC_VER), 4.9.2) + gcc_ver := gcc-4.9.2 + binutils_ver := binutils-2.25 + ccache_ver := ccache-3.2.1 + mpfr_ver := mpfr-3.0.1 + gmp_ver := gmp-4.3.2 + mpc_ver := mpc-1.0.1 + gdb_ver := gdb-7.12.1 +else + $(error Unsupported GCC version) +endif -GCC := http://ftp.gnu.org/pub/gnu/gcc/$(gcc_ver)/$(gcc_ver).tar.bz2 -BINUTILS := http://ftp.gnu.org/pub/gnu/binutils/$(binutils_ver).tar.bz2 -CCACHE := http://samba.org/ftp/ccache/$(ccache_ver).tar.gz +GCC := http://ftp.gnu.org/pub/gnu/gcc/$(gcc_ver)/$(gcc_ver).tar.xz +BINUTILS := http://ftp.gnu.org/pub/gnu/binutils/$(binutils_ver).tar.xz +CCACHE := https://samba.org/ftp/ccache/$(ccache_ver).tar.xz MPFR := http://www.mpfr.org/${mpfr_ver}/${mpfr_ver}.tar.bz2 GMP := http://ftp.gnu.org/pub/gnu/gmp/${gmp_ver}.tar.bz2 -MPC := http://www.multiprecision.org/mpc/download/${mpc_ver}.tar.gz +MPC := http://ftp.gnu.org/pub/gnu/mpc/${mpc_ver}.tar.gz +GDB := http://ftp.gnu.org/gnu/gdb/${gdb_ver}.tar.xz + +OEL_URL := http://yum.oracle.com/repo/OracleLinux/OL6/4/base/$(ARCH)/ # RPMs in OEL6.4 LINUX_VERSION := OEL6.4 @@ -85,30 +103,9 @@ RPM_LIST := \ libgcc \ zlib zlib-devel \ libffi libffi-devel \ - fontconfig fontconfig-devel - -ifeq ($(ARCH),x86_64) - RPM_DIR ?= $(RPM_DIR_x86_64) - RPM_ARCHS := x86_64 noarch - ifeq ($(BUILD),$(HOST)) - ifeq ($(TARGET),$(HOST)) - # When building the native compiler for x86_64, enable mixed mode. - RPM_ARCHS += i386 i686 - endif - endif -else - RPM_DIR ?= $(RPM_DIR_i686) - RPM_ARCHS := i386 i686 -endif - -# Sort to remove duplicates -RPM_FILE_LIST := $(sort $(foreach a,$(RPM_ARCHS),$(wildcard $(patsubst %,$(RPM_DIR)/%*$a.rpm,$(RPM_LIST))))) - -#$(info RPM_FILE_LIST $(RPM_FILE_LIST)) - -ifeq ($(RPM_FILE_LIST),) - $(error Found no RPMs, RPM_DIR must point to list of directories to search for RPMs) -endif + fontconfig fontconfig-devel \ + systemtap-sdt-devel \ + # ########################################################################################## # Define common directories and files @@ -122,13 +119,14 @@ else endif # Define directories -RESULT := $(OUTPUTDIR)/result -BUILDDIR := $(OUTPUTDIR)/$(HOST)/$(TARGET) +RESULT := $(OUTPUT_ROOT)/result +BUILDDIR := $(OUTPUT_ROOT)/$(HOST)/$(TARGET) PREFIX := $(RESULT)/$(HOST) TARGETDIR := $(PREFIX)/$(TARGET) SYSROOT := $(TARGETDIR)/sysroot -DOWNLOAD := $(OUTPUTDIR)/download -SRCDIR := $(OUTPUTDIR)/src +DOWNLOAD := $(OUTPUT_ROOT)/download +DOWNLOAD_RPMS := $(DOWNLOAD)/rpms +SRCDIR := $(OUTPUT_ROOT)/src # Marker file for unpacking rpms rpms := $(SYSROOT)/rpms_unpacked @@ -136,6 +134,16 @@ rpms := $(SYSROOT)/rpms_unpacked # Need to patch libs that are linker scripts to use non-absolute paths libs := $(SYSROOT)/libs_patched +################################################################################ +# Download RPMs +download-rpms: + mkdir -p $(DOWNLOAD_RPMS) + # Only run this if rpm dir is empty. + ifeq ($(wildcard $(DOWNLOAD_RPMS)/*.rpm), ) + cd $(DOWNLOAD_RPMS) && \ + wget -r -np -nd $(patsubst %, -A "*%*.rpm", $(RPM_LIST)) $(OEL_URL) + endif + ########################################################################################## # Unpack source packages @@ -147,7 +155,7 @@ define Download $$($(1)_CFG) : $$($(1)_FILE) mkdir -p $$(SRCDIR) - tar -C $$(SRCDIR) -x$$(if $$(findstring .gz, $$<),z,j)f $$< + tar -C $$(SRCDIR) -xf $$< $$(foreach p,$$(abspath $$(wildcard $$(notdir $$($(1)_DIR)).patch)), \ echo PATCHING $$(p) ; \ patch -d $$($(1)_DIR) -p1 -i $$(p) ; \ @@ -159,15 +167,32 @@ define Download endef # Download and unpack all source packages -$(foreach p,GCC BINUTILS CCACHE MPFR GMP MPC,$(eval $(call Download,$(p)))) +$(foreach p,GCC BINUTILS CCACHE MPFR GMP MPC GDB,$(eval $(call Download,$(p)))) ########################################################################################## # Unpack RPMS +ifeq ($(ARCH),x86_64) + RPM_ARCHS := x86_64 noarch + ifeq ($(BUILD),$(HOST)) + ifeq ($(TARGET),$(HOST)) + # When building the native compiler for x86_64, enable mixed mode. + RPM_ARCHS += i386 i686 + endif + endif +else ifeq ($(ARCH),i686)) + RPM_ARCHS := i386 i686 +else + RPM_ARCHS := $(ARCH) +endif + +RPM_FILE_LIST := $(sort $(foreach a, $(RPM_ARCHS), \ + $(wildcard $(patsubst %,$(DOWNLOAD_RPMS)/%*$a.rpm,$(RPM_LIST))) \ +)) + # Note. For building linux you should install rpm2cpio. define unrpm - $(SYSROOT)/$(notdir $(1)).unpacked \ - : $(1) + $(SYSROOT)/$(notdir $(1)).unpacked : $(1) $$(rpms) : $(SYSROOT)/$(notdir $(1)).unpacked endef @@ -210,19 +235,20 @@ $(libs) : $(rpms) ########################################################################################## # Create links for ffi header files so that they become visible by default when using the # devkit. +ifeq ($(ARCH), x86_64) + $(SYSROOT)/usr/include/ffi.h: $(rpms) + cd $(@D) && rm -f $(@F) && ln -s ../lib/libffi-*/include/$(@F) . -$(SYSROOT)/usr/include/ffi.h: $(rpms) - cd $(@D) && rm $(@F) && ln -s ../lib/libffi-*/include/$(@F) . + $(SYSROOT)/usr/include/ffitarget.h: $(rpms) + cd $(@D) && rm -f $(@F) && ln -s ../lib/libffi-*/include/$(@F) . -$(SYSROOT)/usr/include/ffitarget.h: $(rpms) - cd $(@D) && rm $(@F) && ln -s ../lib/libffi-*/include/$(@F) . - -SYSROOT_LINKS += $(SYSROOT)/usr/include/ffi.h $(SYSROOT)/usr/include/ffitarget.h + SYSROOT_LINKS += $(SYSROOT)/usr/include/ffi.h $(SYSROOT)/usr/include/ffitarget.h +endif ########################################################################################## # Define marker files for each source package to be compiled -$(foreach t,binutils mpfr gmp mpc gcc ccache,$(eval $(t) = $(TARGETDIR)/$($(t)_ver).done)) +$(foreach t,binutils mpfr gmp mpc gcc ccache gdb,$(eval $(t) = $(TARGETDIR)/$($(t)_ver).done)) ########################################################################################## @@ -234,7 +260,8 @@ CONFIG = --target=$(TARGET) \ PATHEXT = $(RESULT)/$(BUILD)/bin: PATHPRE = PATH=$(PATHEXT)$(PATH) -BUILDPAR = -j16 +NUM_CORES := $(shell cat /proc/cpuinfo | grep -c processor) +BUILDPAR = -j$(NUM_CORES) # Default commands to when making MAKECMD = @@ -317,6 +344,8 @@ $(BUILDDIR)/$(binutils_ver)/Makefile \ --disable-nls \ --program-prefix=$(TARGET)- \ --enable-multilib \ + --enable-gold \ + --enable-plugins \ ) > $(@D)/log.config 2>&1 @echo 'done' @@ -392,7 +421,6 @@ $(BUILDDIR)/$(gcc_ver)/Makefile \ --with-sysroot=$(SYSROOT) \ --enable-languages=c,c++ \ --enable-shared \ - --enable-multilib \ --disable-nls \ --with-gnu-as \ --with-gnu-ld \ @@ -410,6 +438,23 @@ $(BUILDDIR)/$(gcc_ver)/Makefile : $(gmp) $(mpfr) $(mpc) $(mpfr) : $(gmp) $(mpc) : $(gmp) $(mpfr) +################################################################################ +# Build gdb but only where host and target match +ifeq ($(HOST), $(TARGET)) + $(BUILDDIR)/$(gdb_ver)/Makefile: $(GDB_CFG) + $(info Configuring $@. Log in $(@D)/log.config) + mkdir -p $(@D) + ( \ + cd $(@D) ; \ + $(PATHPRE) $(ENVS) CFLAGS="$(CFLAGS)" $(GDB_CFG) \ + $(CONFIG) \ + --with-sysroot=$(SYSROOT) \ + ) > $(@D)/log.config 2>&1 + @echo 'done' + + $(gdb): $(gcc) +endif + ########################################################################################## # very straightforward. just build a ccache. it is only for host. $(BUILDDIR)/$(ccache_ver)/Makefile \ @@ -434,7 +479,7 @@ ifeq ($(HOST),$(TARGET)) if [ ! -e $(PREFIX)/bin/$(TARGET)-$$f ]; \ then \ cd $(PREFIX)/bin && \ - ln -s $$f $(TARGET)-$$f ; \ + ln -fs $$f $(TARGET)-$$f ; \ fi \ done @touch $@ @@ -451,7 +496,7 @@ ifeq ($(HOST),$(TARGET)) if [ ! -e $(TARGETDIR)/$(l)/$$f ]; then \ mkdir -p $(TARGETDIR)/$(l) && \ cd $(TARGETDIR)/$(l)/ && \ - ln -s $(if $(findstring /,$(l)),../,)../../$(l)/$$f $$f; \ + ln -fs $(if $(findstring /,$(l)),../,)../../$(l)/$$f $$f; \ fi \ done;) @echo 'done' @@ -471,6 +516,7 @@ $(TARGETDIR)/%.done : $(BUILDDIR)/%/Makefile $(PATHPRE) $(ENVS) $(MAKE) $(BUILDPAR) -f $< -C $( $(&1 @echo -n 'installing...' $(PATHPRE) $(MAKE) $(INSTALLPAR) -f $< -C $( $(&1 + @mkdir -p $(@D) @touch $@ @echo 'done' @@ -486,17 +532,38 @@ $(PREFIX)/devkit.info: FRC echo 'DEVKIT_NAME="$(gcc_ver) - $(LINUX_VERSION)"' >> $@ echo 'DEVKIT_TOOLCHAIN_PATH="$$DEVKIT_ROOT/bin"' >> $@ echo 'DEVKIT_SYSROOT="$$DEVKIT_ROOT/$$host/sysroot"' >> $@ + echo 'DEVKIT_EXTRA_PATH="$$DEVKIT_ROOT/bin"' >> $@ + +########################################################################################## +# Copy these makefiles into the root of the kit +$(PREFIX)/Makefile: ./Makefile + rm -rf $@ + cp $< $@ + +$(PREFIX)/Tools.gmk: ./Tools.gmk + rm -rf $@ + cp $< $@ + +THESE_MAKEFILES := $(PREFIX)/Makefile $(PREFIX)/Tools.gmk ########################################################################################## ifeq ($(TARGET), $(HOST)) + # To build with dtrace support, the build needs access to the dtrace executable from the + # sysroot. Generally we don't want to add binaries in the sysroot to the path, but + # luckily this seems to execute well enough on a different host Linux distro, so symlink + # it into the main bin dir. + $(PREFIX)/bin/dtrace: + @echo 'Creating dtrace soft link' + ln -s ../$(HOST)/sysroot/usr/bin/dtrace $@ + $(PREFIX)/bin/%: @echo 'Creating missing $* soft link' ln -s $(TARGET)-$* $@ missing-links := $(addprefix $(PREFIX)/bin/, \ addr2line ar as c++ c++filt elfedit g++ gcc gprof ld nm objcopy ranlib readelf \ - size strings strip) + size strings strip ld.bfd ld.gold dtrace) endif ########################################################################################## @@ -507,7 +574,9 @@ rpms : $(rpms) libs : $(libs) sysroot : rpms libs gcc : sysroot $(gcc) $(gccpatch) -all : binutils gcc bfdlib $(PREFIX)/devkit.info $(missing-links) $(SYSROOT_LINKS) +gdb : $(gdb) +all : binutils gcc bfdlib $(PREFIX)/devkit.info $(missing-links) $(SYSROOT_LINKS) \ + $(THESE_MAKEFILES) gdb # this is only built for host. so separate. ccache : $(ccache) diff --git a/make/devkit/createAutoconfBundle.sh b/make/devkit/createAutoconfBundle.sh new file mode 100644 index 00000000000..861a0a47242 --- /dev/null +++ b/make/devkit/createAutoconfBundle.sh @@ -0,0 +1,116 @@ +#!/bin/bash -e +# +# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# Create a bundle in the current directory, containing what's needed to run +# the 'autoconf' program by the OpenJDK build. + +# Autoconf depends on m4, so download and build that first. +AUTOCONF_VERSION=2.69 +M4_VERSION=1.4.18 + +PACKAGE_VERSION=1.0.1 +TARGET_PLATFORM=linux_x86 +MODULE_NAME=autoconf-$TARGET_PLATFORM-$AUTOCONF_VERSION+$PACKAGE_VERSION +BUNDLE_NAME=$MODULE_NAME.tar.gz + +TMPDIR=`mktemp -d -t autoconfbundle-XXXX` +trap "rm -rf \"$TMPDIR\"" EXIT + +ORIG_DIR=`pwd` +cd $TMPDIR +OUTPUT_DIR=$TMPDIR/$MODULE_NAME +mkdir -p $OUTPUT_DIR/usr + +# Download and build m4 + +if test "x$TARGET_PLATFORM" = xcygwin_x64; then + # On cygwin 64-bit, just copy the cygwin .exe file + mkdir -p $OUTPUT_DIR/usr/bin + cp /usr/bin/m4 $OUTPUT_DIR/usr/bin +elif test "x$TARGET_PLATFORM" = xcygwin_x86; then + # On cygwin 32-bit, just copy the cygwin .exe file + mkdir -p $OUTPUT_DIR/usr/bin + cp /usr/bin/m4 $OUTPUT_DIR/usr/bin +elif test "x$TARGET_PLATFORM" = xlinux_x64; then + M4_VERSION=1.4.13-5 + wget http://yum.oracle.com/repo/OracleLinux/OL6/latest/x86_64/getPackage/m4-$M4_VERSION.el6.x86_64.rpm + cd $OUTPUT_DIR + rpm2cpio ../m4-$M4_VERSION.el6.x86_64.rpm | cpio -d -i +elif test "x$TARGET_PLATFORM" = xlinux_x86; then + M4_VERSION=1.4.13-5 + wget http://yum.oracle.com/repo/OracleLinux/OL6/latest/i386/getPackage/m4-$M4_VERSION.el6.i686.rpm + cd $OUTPUT_DIR + rpm2cpio ../m4-$M4_VERSION.el6.i686.rpm | cpio -d -i +else + wget https://ftp.gnu.org/gnu/m4/m4-$M4_VERSION.tar.gz + tar xzf m4-$M4_VERSION.tar.gz + cd m4-$M4_VERSION + ./configure --prefix=$OUTPUT_DIR/usr + make + make install + cd .. +fi + +# Download and build autoconf + +wget https://ftp.gnu.org/gnu/autoconf/autoconf-$AUTOCONF_VERSION.tar.gz +tar xzf autoconf-$AUTOCONF_VERSION.tar.gz +cd autoconf-$AUTOCONF_VERSION +./configure --prefix=$OUTPUT_DIR/usr M4=$OUTPUT_DIR/usr/bin/m4 +make +make install +cd .. + +perl -pi -e "s!$OUTPUT_DIR/!./!" $OUTPUT_DIR/usr/bin/auto* $OUTPUT_DIR/usr/share/autoconf/autom4te.cfg +cp $OUTPUT_DIR/usr/share/autoconf/autom4te.cfg $OUTPUT_DIR/autom4te.cfg + +cat > $OUTPUT_DIR/autoconf << EOF +#!/bin/bash +# Get an absolute path to this script +this_script_dir=\`dirname \$0\` +this_script_dir=\`cd \$this_script_dir > /dev/null && pwd\` + +export M4="\$this_script_dir/usr/bin/m4" +export AUTOM4TE="\$this_script_dir/usr/bin/autom4te" +export AUTOCONF="\$this_script_dir/usr/bin/autoconf" +export AUTOHEADER="\$this_script_dir/usr/bin/autoheader" +export AC_MACRODIR="\$this_script_dir/usr/share/autoconf" +export autom4te_perllibdir="\$this_script_dir/usr/share/autoconf" + +autom4te_cfg=\$this_script_dir/usr/share/autoconf/autom4te.cfg +cp \$this_script_dir/autom4te.cfg \$autom4te_cfg + +echo 'begin-language: "M4sugar"' >> \$autom4te_cfg +echo "args: --prepend-include '"\$this_script_dir/usr/share/autoconf"'" >> \$autom4te_cfg +echo 'end-language: "M4sugar"' >> \$autom4te_cfg + +exec \$this_script_dir/usr/bin/autoconf "\$@" +EOF +chmod +x $OUTPUT_DIR/autoconf +cd $OUTPUT_DIR +tar -cvzf ../$BUNDLE_NAME * +cd .. +cp $BUNDLE_NAME "$ORIG_DIR" diff --git a/make/devkit/createMacosxDevkit.sh b/make/devkit/createMacosxDevkit6.sh similarity index 100% rename from make/devkit/createMacosxDevkit.sh rename to make/devkit/createMacosxDevkit6.sh diff --git a/make/devkit/createMacosxDevkit9.sh b/make/devkit/createMacosxDevkit9.sh new file mode 100644 index 00000000000..28cd31e94a3 --- /dev/null +++ b/make/devkit/createMacosxDevkit9.sh @@ -0,0 +1,146 @@ +#!/bin/bash +# +# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# This script copies parts of an Xcode installation into a devkit suitable +# for building OpenJDK and OracleJDK. The installation Xcode_X.X.xip needs +# to be either installed or extracted using for example Archive Utility. +# The easiest way to accomplish this is to right click the file in Finder +# and choose "Open With -> Archive Utility", or possible typing +# "open Xcode_9.2.xip" in a terminal. +# erik.joelsson@oracle.com + +USAGE="$0 " + +if [ "$1" = "" ]; then + echo $USAGE + exit 1 +fi + +XCODE_APP="$1" +XCODE_APP_DIR_NAME="${XCODE_APP##*/}" + +SCRIPT_DIR="$(cd "$(dirname $0)" > /dev/null && pwd)" +BUILD_DIR="${SCRIPT_DIR}/../../build/devkit" + +# Find the version of Xcode +XCODE_VERSION="$($XCODE_APP/Contents/Developer/usr/bin/xcodebuild -version \ + | awk '/Xcode/ { print $2 }' )" +SDK_VERSION="MacOSX10.13" +if [ ! -e "$XCODE_APP/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/${SDK_VERSION}.sdk" ]; then + echo "Expected SDK version not found: ${SDK_VERSION}" + exit 1 +fi + +DEVKIT_ROOT="${BUILD_DIR}/Xcode${XCODE_VERSION}-${SDK_VERSION}" +DEVKIT_BUNDLE="${DEVKIT_ROOT}.tar.gz" + +echo "Xcode version: $XCODE_VERSION" +echo "Creating devkit in $DEVKIT_ROOT" + +mkdir -p $DEVKIT_ROOT + +################################################################################ +# Copy the relevant parts of Xcode.app, removing things that are both big and +# unecessary for our purposes, without building an impossibly long exclude list. +# +# Not including WatchSimulator.platform makes ibtool crashes in some situations. +# It doesn't seem to matter which extra platform is included, but that is the +# smallest one. + +EXCLUDE_DIRS=" \ + Contents/_CodeSignature \ + $XCODE_APP_DIR_NAME/Contents/Applications \ + $XCODE_APP_DIR_NAME/Contents/Resources \ + $XCODE_APP_DIR_NAME/Contents/Library \ + $XCODE_APP_DIR_NAME/Contents/XPCServices \ + $XCODE_APP_DIR_NAME/Contents/OtherFrameworks \ + $XCODE_APP_DIR_NAME/Contents/Developer/Documentation \ + $XCODE_APP_DIR_NAME/Contents/Developer/usr/share \ + $XCODE_APP_DIR_NAME/Contents/Developer/usr/libexec/git-core \ + $XCODE_APP_DIR_NAME/Contents/Developer/usr/bin/git* \ + $XCODE_APP_DIR_NAME/Contents/Developer/usr/bin/svn* \ + $XCODE_APP_DIR_NAME/Contents/Developer/usr/lib/libgit* \ + $XCODE_APP_DIR_NAME/Contents/Developer/usr/lib/libsvn* \ + $XCODE_APP_DIR_NAME/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/share/man \ + $XCODE_APP_DIR_NAME/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/${SDK_VERSION}.sdk/usr/share/man \ + $XCODE_APP_DIR_NAME/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/share/man \ + $XCODE_APP_DIR_NAME/Contents/Developer/Platforms/MacOSX.platform/usr \ + $XCODE_APP_DIR_NAME/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man \ + $XCODE_APP_DIR_NAME/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift* \ + $XCODE_APP_DIR_NAME/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift* \ + $XCODE_APP_DIR_NAME/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/sourcekitd.framework \ + $XCODE_APP_DIR_NAME/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/libexec/swift* \ + $XCODE_APP_DIR_NAME/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/swift* \ + $XCODE_APP_DIR_NAME/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/arc \ + Platforms/AppleTVSimulator.platform \ + Platforms/iPhoneSimulator.platform \ + $XCODE_APP_DIR_NAME/Contents/SharedFrameworks/LLDB.framework \ + $XCODE_APP_DIR_NAME/Contents/SharedFrameworks/ModelIO.framework \ + $XCODE_APP_DIR_NAME/Contents/SharedFrameworks/XCSUI.framework \ + $XCODE_APP_DIR_NAME/Contents/SharedFrameworks/SceneKit.framework \ + $XCODE_APP_DIR_NAME/Contents/SharedFrameworks/XCBuild.framework \ + $XCODE_APP_DIR_NAME/Contents/SharedFrameworks/GPUTools.framework \ + $(cd $XCODE_APP/.. && ls -d $XCODE_APP_DIR_NAME/Contents/Developer/Platforms/* \ + | grep -v MacOSX.platform | grep -v WatchSimulator.platform) \ +" + +for ex in $EXCLUDE_DIRS; do + EXCLUDE_ARGS+="--exclude=$ex " +done + +echo "Copying Xcode.app..." +echo rsync -rlH $INCLUDE_ARGS $EXCLUDE_ARGS "$XCODE_APP" $DEVKIT_ROOT/ +rsync -rlH $INCLUDE_ARGS $EXCLUDE_ARGS "$XCODE_APP" $DEVKIT_ROOT/ + +################################################################################ + +echo-info() { + echo "$1" >> $DEVKIT_ROOT/devkit.info +} + +echo "Generating devkit.info..." +rm -f $DEVKIT_ROOT/devkit.info +echo-info "# This file describes to configure how to interpret the contents of this devkit" +echo-info "DEVKIT_NAME=\"Xcode $XCODE_VERSION (devkit)\"" +echo-info "DEVKIT_TOOLCHAIN_PATH=\"\$DEVKIT_ROOT/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:\$DEVKIT_ROOT/Xcode.app/Contents/Developer/usr/bin\"" +echo-info "DEVKIT_SYSROOT=\"\$DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/$SDK_VERSION.sdk\"" +echo-info "DEVKIT_EXTRA_PATH=\"\$DEVKIT_TOOLCHAIN_PATH\"" + +################################################################################ +# Copy this script + +echo "Copying this script..." +cp $0 $DEVKIT_ROOT/ + +################################################################################ +# Create bundle + +echo "Creating bundle..." +GZIP=$(command -v pigz) +if [ -z "$GZIP" ]; then + GZIP="gzip" +fi +(cd $DEVKIT_ROOT && tar c - . | $GZIP - > "$DEVKIT_BUNDLE") diff --git a/make/devkit/createWindowsDevkit.sh b/make/devkit/createWindowsDevkit2013.sh similarity index 100% rename from make/devkit/createWindowsDevkit.sh rename to make/devkit/createWindowsDevkit2013.sh diff --git a/make/devkit/createWindowsDevkit2015.sh b/make/devkit/createWindowsDevkit2015.sh new file mode 100644 index 00000000000..12a2f31d024 --- /dev/null +++ b/make/devkit/createWindowsDevkit2015.sh @@ -0,0 +1,142 @@ +#!/bin/bash +# +# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# This script copies parts of a Visual Studio installation into a devkit +# suitable for building OpenJDK and OracleJDK. Needs to run in Cygwin. +# erik.joelsson@oracle.com + +VS_VERSION="2015" +VS_VERSION_NUM="14.0" +VS_VERSION_NUM_NODOT="140" +SDK_VERSION="8.1" +VS_VERSION_SP="update3" + +SCRIPT_DIR="$(cd "$(dirname $0)" > /dev/null && pwd)" +BUILD_DIR="${SCRIPT_DIR}/../../build/devkit" +DEVKIT_ROOT="${BUILD_DIR}/VS${VS_VERSION}${VS_VERSION_SP}-devkit" +DEVKIT_BUNDLE="${DEVKIT_ROOT}.tar.gz" + +echo "Creating devkit in $DEVKIT_ROOT" + +MSVCR_DLL=Microsoft.VC${VS_VERSION_NUM_NODOT}.CRT/vcruntime${VS_VERSION_NUM_NODOT}.dll +MSVCP_DLL=Microsoft.VC${VS_VERSION_NUM_NODOT}.CRT/msvcp${VS_VERSION_NUM_NODOT}.dll + +################################################################################ +# Copy Visual Studio files + +eval VSNNNCOMNTOOLS="\"\${VS${VS_VERSION_NUM_NODOT}COMNTOOLS}\"" +VS_INSTALL_DIR="$(cygpath "$VSNNNCOMNTOOLS/../..")" +echo "VS_INSTALL_DIR: $VS_INSTALL_DIR" + +if [ ! -d $DEVKIT_ROOT/VC ]; then + echo "Copying VC..." + mkdir -p $DEVKIT_ROOT/VC/bin + cp -r "$VS_INSTALL_DIR/VC/bin/amd64" $DEVKIT_ROOT/VC/bin/ + cp "$VS_INSTALL_DIR/VC/bin/"*.* $DEVKIT_ROOT/VC/bin/ + cp -r "$VS_INSTALL_DIR/VC/bin/1033/" $DEVKIT_ROOT/VC/bin/ + mkdir -p $DEVKIT_ROOT/VC/lib + cp -r "$VS_INSTALL_DIR/VC/lib/amd64" $DEVKIT_ROOT/VC/lib/ + cp "$VS_INSTALL_DIR/VC/lib/"*.* $DEVKIT_ROOT/VC/lib/ + cp -r "$VS_INSTALL_DIR/VC/include" $DEVKIT_ROOT/VC/ + mkdir -p $DEVKIT_ROOT/VC/atlmfc/lib + cp -r "$VS_INSTALL_DIR/VC/atlmfc/include" $DEVKIT_ROOT/VC/atlmfc/ + cp -r "$VS_INSTALL_DIR/VC/atlmfc/lib/amd64" $DEVKIT_ROOT/VC/atlmfc/lib/ + cp "$VS_INSTALL_DIR/VC/atlmfc/lib/"*.* $DEVKIT_ROOT/VC/atlmfc/lib/ + mkdir -p $DEVKIT_ROOT/VC/redist + cp -r "$VS_INSTALL_DIR/VC/redist/x64" $DEVKIT_ROOT/VC/redist/ + cp -r "$VS_INSTALL_DIR/VC/redist/x86" $DEVKIT_ROOT/VC/redist/ + # The redist runtime libs are needed to run the compiler but may not be + # installed on the machine where the devkit will be used. + cp $DEVKIT_ROOT/VC/redist/x86/$MSVCR_DLL $DEVKIT_ROOT/VC/bin/ + cp $DEVKIT_ROOT/VC/redist/x86/$MSVCP_DLL $DEVKIT_ROOT/VC/bin/ + cp $DEVKIT_ROOT/VC/redist/x64/$MSVCR_DLL $DEVKIT_ROOT/VC/bin/amd64/ + cp $DEVKIT_ROOT/VC/redist/x64/$MSVCP_DLL $DEVKIT_ROOT/VC/bin/amd64/ + # The msvcdis dll is needed to run some of the tools in VC/bin but is not + # shipped in that directory. Copy it from the common dir. + cp "$VS_INSTALL_DIR/Common7/IDE/msvcdis${VS_VERSION_NUM_NODOT}.dll" \ + $DEVKIT_ROOT/VC/bin/ +fi + +################################################################################ +# Copy SDK files + +PROGRAMFILES_X86="`env | sed -n 's/^ProgramFiles(x86)=//p'`" +SDK_INSTALL_DIR="$(cygpath "$PROGRAMFILES_X86/Windows Kits/$SDK_VERSION")" +echo "SDK_INSTALL_DIR: $SDK_INSTALL_DIR" + +if [ ! -d $DEVKIT_ROOT/$SDK_VERSION ]; then + echo "Copying SDK..." + mkdir -p $DEVKIT_ROOT/$SDK_VERSION/bin + cp -r "$SDK_INSTALL_DIR/bin/x64" $DEVKIT_ROOT/$SDK_VERSION/bin/ + cp -r "$SDK_INSTALL_DIR/bin/x86" $DEVKIT_ROOT/$SDK_VERSION/bin/ + mkdir -p $DEVKIT_ROOT/$SDK_VERSION/lib + cp -r "$SDK_INSTALL_DIR/lib/"winv*/um/x64 $DEVKIT_ROOT/$SDK_VERSION/lib/ + cp -r "$SDK_INSTALL_DIR/lib/"winv*/um/x86 $DEVKIT_ROOT/$SDK_VERSION/lib/ + cp -r "$SDK_INSTALL_DIR/include" $DEVKIT_ROOT/$SDK_VERSION/ + # In 2015, the new Universal CRT is delivered in the sdk 10 directory + # so need to include that as well. + mkdir -p $DEVKIT_ROOT/10/lib + cp -r "$SDK_INSTALL_DIR/../10/lib/10.0.10240.0/ucrt" $DEVKIT_ROOT/10/lib/ + mkdir -p $DEVKIT_ROOT/10/include + cp -r "$SDK_INSTALL_DIR/../10/include/10.0.10240.0/ucrt" $DEVKIT_ROOT/10/include/ +fi + +################################################################################ +# Generate devkit.info + +echo-info() { + echo "$1" >> $DEVKIT_ROOT/devkit.info +} + +echo "Generating devkit.info..." +rm -f $DEVKIT_ROOT/devkit.info +echo-info "# This file describes to configure how to interpret the contents of this devkit" +echo-info "DEVKIT_NAME=\"Microsoft Visual Studio $VS_VERSION $VS_VERSION_SP (devkit)\"" +echo-info "DEVKIT_VS_VERSION=\"$VS_VERSION\"" +echo-info "" +echo-info "DEVKIT_TOOLCHAIN_PATH_x86=\"\$DEVKIT_ROOT/VC/bin:\$DEVKIT_ROOT/$SDK_VERSION/bin/x86\"" +echo-info "DEVKIT_VS_INCLUDE_x86=\"\$DEVKIT_ROOT/VC/include;\$DEVKIT_ROOT/VC/atlmfc/include;\$DEVKIT_ROOT/$SDK_VERSION/include/shared;\$DEVKIT_ROOT/$SDK_VERSION/include/um;\$DEVKIT_ROOT/$SDK_VERSION/include/winrt;\$DEVKIT_ROOT/10/include/ucrt\"" +echo-info "DEVKIT_VS_LIB_x86=\"\$DEVKIT_ROOT/VC/lib;\$DEVKIT_ROOT/VC/atlmfc/lib;\$DEVKIT_ROOT/$SDK_VERSION/lib/x86;\$DEVKIT_ROOT/10/lib/ucrt/x86\"" +echo-info "DEVKIT_MSVCR_DLL_x86=\"\$DEVKIT_ROOT/VC/redist/x86/$MSVCR_DLL\"" +echo-info "DEVKIT_MSVCP_DLL_x86=\"\$DEVKIT_ROOT/VC/redist/x86/$MSVCP_DLL\"" +echo-info "" +echo-info "DEVKIT_TOOLCHAIN_PATH_x86_64=\"\$DEVKIT_ROOT/VC/bin/amd64:\$DEVKIT_ROOT/$SDK_VERSION/bin/x64:\$DEVKIT_ROOT/$SDK_VERSION/bin/x86\"" +echo-info "DEVKIT_VS_INCLUDE_x86_64=\"\$DEVKIT_ROOT/VC/include;\$DEVKIT_ROOT/VC/atlmfc/include;\$DEVKIT_ROOT/$SDK_VERSION/include/shared;\$DEVKIT_ROOT/$SDK_VERSION/include/um;\$DEVKIT_ROOT/$SDK_VERSION/include/winrt;\$DEVKIT_ROOT/10/include/ucrt\"" +echo-info "DEVKIT_VS_LIB_x86_64=\"\$DEVKIT_ROOT/VC/lib/amd64;\$DEVKIT_ROOT/VC/atlmfc/lib/amd64;\$DEVKIT_ROOT/$SDK_VERSION/lib/x64;\$DEVKIT_ROOT/10/lib/ucrt/x64\"" +echo-info "DEVKIT_MSVCR_DLL_x86_64=\"\$DEVKIT_ROOT/VC/redist/x64/$MSVCR_DLL\"" +echo-info "DEVKIT_MSVCP_DLL_x86_64=\"\$DEVKIT_ROOT/VC/redist/x64/$MSVCP_DLL\"" + +################################################################################ +# Copy this script + +echo "Copying this script..." +cp $0 $DEVKIT_ROOT/ + +################################################################################ +# Create bundle + +echo "Creating bundle: $DEVKIT_BUNDLE" +(cd "$DEVKIT_ROOT" && tar zcf "$DEVKIT_BUNDLE" .) diff --git a/make/devkit/createWindowsDevkit2017.sh b/make/devkit/createWindowsDevkit2017.sh new file mode 100644 index 00000000000..b4cd65d438b --- /dev/null +++ b/make/devkit/createWindowsDevkit2017.sh @@ -0,0 +1,172 @@ +#!/bin/bash +# +# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# This script copies parts of a Visual Studio installation into a devkit +# suitable for building OpenJDK and OracleJDK. Needs to run in Cygwin. +# erik.joelsson@oracle.com + +VS_VERSION="2017" +VS_VERSION_NUM_NODOT="150" +VS_DLL_VERSION="140" +SDK_VERSION="10" +SDK_FULL_VERSION="10.0.16299.0" +MSVC_DIR="Microsoft.VC141.CRT" + +SCRIPT_DIR="$(cd "$(dirname $0)" > /dev/null && pwd)" +BUILD_DIR="${SCRIPT_DIR}/../../build/devkit" + +################################################################################ +# Prepare settings + +# Work around the insanely named ProgramFiles(x86) env variable +PROGRAMFILES_X86="$(cygpath "$(env | sed -n 's/^ProgramFiles(x86)=//p')")" + +# Find Visual Studio installation dir +eval VSNNNCOMNTOOLS="\"\${VS${VS_VERSION_NUM_NODOT}COMNTOOLS}\"" +if [ -d "$VSNNNCOMNTOOLS" ]; then + VS_INSTALL_DIR="$(cygpath "$VSNNNCOMNTOOLS/../..")" +else + VS_INSTALL_DIR="${PROGRAMFILES_X86}/Microsoft Visual Studio/2017" + VS_INSTALL_DIR="$(ls -d "${VS_INSTALL_DIR}/"{Community,Professional} 2>/dev/null | head -n1)" + VS_INSTALL_DIR="$(cygpath "$VS_INSTALL_DIR")" +fi +echo "VS_INSTALL_DIR: $VS_INSTALL_DIR" + +# Extract semantic version +POTENTIAL_INI_FILES="Common7\IDE\wdexpress.isolation.ini Common7\IDE\devenv.isolation.ini" +for f in $POTENTIAL_INI_FILES; do + if [ -f "$VS_INSTALL_DIR/$f" ]; then + VS_VERSION_SP="$(grep ^SemanticVersion= "$VS_INSTALL_DIR/$f")" + # Remove SemnaticVersion= + VS_VERSION_SP="${VS_VERSION_SP#*=}" + # Remove suffix of too detailed numbering starting with + + VS_VERSION_SP="${VS_VERSION_SP%+*}" + break + fi +done +if [ -z "$VS_VERSION_SP" ]; then + echo "Failed to find SP version" + exit 1 +fi +echo "Found Version SP: $VS_VERSION_SP" + +# Setup output dirs +DEVKIT_ROOT="${BUILD_DIR}/VS${VS_VERSION}-${VS_VERSION_SP}-devkit" +DEVKIT_BUNDLE="${DEVKIT_ROOT}.tar.gz" + +echo "Creating devkit in $DEVKIT_ROOT" + +MSVCR_DLL=${MSVC_DIR}/vcruntime${VS_DLL_VERSION}.dll +MSVCP_DLL=${MSVC_DIR}/msvcp${VS_DLL_VERSION}.dll + +################################################################################ +# Copy Visual Studio files + +if [ ! -d $DEVKIT_ROOT/VC ]; then + VC_SUBDIR="VC/Tools/MSVC/14.12.25827" + REDIST_SUBDIR="VC/Redist/MSVC/14.12.25810" + echo "Copying VC..." + mkdir -p $DEVKIT_ROOT/VC/bin + cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/bin/Hostx64/x64" $DEVKIT_ROOT/VC/bin/ + cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/bin/Hostx86/x86" $DEVKIT_ROOT/VC/bin/ + mkdir -p $DEVKIT_ROOT/VC/lib + cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/lib/x64" $DEVKIT_ROOT/VC/lib/ + cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/lib/x86" $DEVKIT_ROOT/VC/lib/ + cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/include" $DEVKIT_ROOT/VC/ + mkdir -p $DEVKIT_ROOT/VC/atlmfc/lib + cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/atlmfc/lib/x64" $DEVKIT_ROOT/VC/atlmfc/lib/ + cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/atlmfc/lib/x86" $DEVKIT_ROOT/VC/atlmfc/lib/ + cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/atlmfc/include" $DEVKIT_ROOT/VC/atlmfc/ + mkdir -p $DEVKIT_ROOT/VC/Auxiliary + cp -r "$VS_INSTALL_DIR/VC/Auxiliary/Build" $DEVKIT_ROOT/VC/Auxiliary/ + mkdir -p $DEVKIT_ROOT/VC/redist + cp -r "$VS_INSTALL_DIR/$REDIST_SUBDIR/x64" $DEVKIT_ROOT/VC/redist/ + cp -r "$VS_INSTALL_DIR/$REDIST_SUBDIR/x86" $DEVKIT_ROOT/VC/redist/ + + # The redist runtime libs are needed to run the compiler but may not be + # installed on the machine where the devkit will be used. + cp $DEVKIT_ROOT/VC/redist/x64/$MSVCR_DLL $DEVKIT_ROOT/VC/bin/x86 + cp $DEVKIT_ROOT/VC/redist/x64/$MSVCP_DLL $DEVKIT_ROOT/VC/bin/x86 + cp $DEVKIT_ROOT/VC/redist/x64/$MSVCR_DLL $DEVKIT_ROOT/VC/bin/x64 + cp $DEVKIT_ROOT/VC/redist/x64/$MSVCP_DLL $DEVKIT_ROOT/VC/bin/x64 +fi + +################################################################################ +# Copy SDK files + +SDK_INSTALL_DIR="$(cygpath "$PROGRAMFILES_X86/Windows Kits/$SDK_VERSION")" +echo "SDK_INSTALL_DIR: $SDK_INSTALL_DIR" + +if [ ! -d $DEVKIT_ROOT/$SDK_VERSION ]; then + echo "Copying SDK..." + mkdir -p $DEVKIT_ROOT/$SDK_VERSION/bin + cp -r "$SDK_INSTALL_DIR/bin/$SDK_FULL_VERSION/x64" $DEVKIT_ROOT/$SDK_VERSION/bin/ + cp -r "$SDK_INSTALL_DIR/bin/$SDK_FULL_VERSION/x86" $DEVKIT_ROOT/$SDK_VERSION/bin/ + mkdir -p $DEVKIT_ROOT/$SDK_VERSION/lib + cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/um/x64" $DEVKIT_ROOT/$SDK_VERSION/lib/ + cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/um/x86" $DEVKIT_ROOT/$SDK_VERSION/lib/ + cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/ucrt/x64" $DEVKIT_ROOT/$SDK_VERSION/lib/ + cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/ucrt/x86" $DEVKIT_ROOT/$SDK_VERSION/lib/ + mkdir -p $DEVKIT_ROOT/$SDK_VERSION/include + cp -r "$SDK_INSTALL_DIR/include/$SDK_FULL_VERSION/"* $DEVKIT_ROOT/$SDK_VERSION/include/ +fi + +################################################################################ +# Generate devkit.info + +echo-info() { + echo "$1" >> $DEVKIT_ROOT/devkit.info +} + +echo "Generating devkit.info..." +rm -f $DEVKIT_ROOT/devkit.info +echo-info "# This file describes to configure how to interpret the contents of this devkit" +echo-info "DEVKIT_NAME=\"Microsoft Visual Studio $VS_VERSION $VS_VERSION_SP (devkit)\"" +echo-info "DEVKIT_VS_VERSION=\"$VS_VERSION\"" +echo-info "" +echo-info "DEVKIT_TOOLCHAIN_PATH_x86=\"\$DEVKIT_ROOT/VC/bin/x86:\$DEVKIT_ROOT/$SDK_VERSION/bin/x86\"" +echo-info "DEVKIT_VS_INCLUDE_x86=\"\$DEVKIT_ROOT/VC/include;\$DEVKIT_ROOT/VC/atlmfc/include;\$DEVKIT_ROOT/$SDK_VERSION/include/shared;\$DEVKIT_ROOT/$SDK_VERSION/include/ucrt;\$DEVKIT_ROOT/$SDK_VERSION/include/um;\$DEVKIT_ROOT/$SDK_VERSION/include/winrt\"" +echo-info "DEVKIT_VS_LIB_x86=\"\$DEVKIT_ROOT/VC/lib/x86;\$DEVKIT_ROOT/VC/atlmfc/lib/x86;\$DEVKIT_ROOT/$SDK_VERSION/lib/x86\"" +echo-info "DEVKIT_MSVCR_DLL_x86=\"\$DEVKIT_ROOT/VC/redist/x86/$MSVCR_DLL\"" +echo-info "DEVKIT_MSVCP_DLL_x86=\"\$DEVKIT_ROOT/VC/redist/x86/$MSVCP_DLL\"" +echo-info "" +echo-info "DEVKIT_TOOLCHAIN_PATH_x86_64=\"\$DEVKIT_ROOT/VC/bin/x64:\$DEVKIT_ROOT/$SDK_VERSION/bin/x64:\$DEVKIT_ROOT/$SDK_VERSION/bin/x86\"" +echo-info "DEVKIT_VS_INCLUDE_x86_64=\"\$DEVKIT_ROOT/VC/include;\$DEVKIT_ROOT/VC/atlmfc/include;\$DEVKIT_ROOT/$SDK_VERSION/include/shared;\$DEVKIT_ROOT/$SDK_VERSION/include/ucrt;\$DEVKIT_ROOT/$SDK_VERSION/include/um;\$DEVKIT_ROOT/$SDK_VERSION/include/winrt\"" +echo-info "DEVKIT_VS_LIB_x86_64=\"\$DEVKIT_ROOT/VC/lib/x64;\$DEVKIT_ROOT/VC/atlmfc/lib/x64;\$DEVKIT_ROOT/$SDK_VERSION/lib/x64\"" +echo-info "DEVKIT_MSVCR_DLL_x86_64=\"\$DEVKIT_ROOT/VC/redist/x64/$MSVCR_DLL\"" +echo-info "DEVKIT_MSVCP_DLL_x86_64=\"\$DEVKIT_ROOT/VC/redist/x64/$MSVCP_DLL\"" + +################################################################################ +# Copy this script + +echo "Copying this script..." +cp $0 $DEVKIT_ROOT/ + +################################################################################ +# Create bundle + +echo "Creating bundle: $DEVKIT_BUNDLE" +(cd "$DEVKIT_ROOT" && tar zcf "$DEVKIT_BUNDLE" .) diff --git a/make/gensrc/Gensrc-java.corba.gmk b/make/gensrc/Gensrc-java.corba.gmk deleted file mode 100644 index 45c2301aae3..00000000000 --- a/make/gensrc/Gensrc-java.corba.gmk +++ /dev/null @@ -1,242 +0,0 @@ -# -# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -default: all - -include $(SPEC) -include MakeBase.gmk -include JavaCompilation.gmk -include IdlCompilation.gmk -include SetupJavaCompilers.gmk - -################################################################################ - -$(eval $(call SetupJavaCompilation,BUILD_TOOLS_CORBA, \ - SETUP := GENERATE_OLDBYTECODE, \ - SRC := $(TOPDIR)/make/corba/src/classes, \ - BIN := $(BUILDTOOLS_OUTPUTDIR)/corba_tools_classes)) - -TOOL_LOGUTIL_CMD := $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/corba_tools_classes \ - build.tools.logutil.MC - -$(eval $(call SetupJavaCompilation,BUILD_IDLJ, \ - SETUP := GENERATE_OLDBYTECODE, \ - SRC := $(TOPDIR)/src/java.corba/share/classes, \ - BIN := $(BUILDTOOLS_OUTPUTDIR)/idlj_classes, \ - COPY := .prp, \ - INCLUDES := com/sun/tools/corba/se/idl, \ - EXCLUDE_FILES := ResourceBundleUtil.java module-info.java)) - -# Force the language to english for predictable source code generation. -TOOL_IDLJ_CMD := $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/idlj_classes \ - -Duser.language=en com.sun.tools.corba.se.idl.toJavaPortable.Compile - -################################################################################ - -EXCEPTION_DIR := $(SUPPORT_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging -LOGWRAPPER_DIR := $(SUPPORT_OUTPUTDIR)/gensrc/java.corba/_logwrappers - -# Generate LogWrapper classes -$(EXCEPTION_DIR)/%SystemException.java: \ - $(TOPDIR)/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/%.mc \ - $(BUILD_TOOLS_CORBA) - $(call LogInfo, Generating class file from $*.mc) - $(call MakeDir, $(@D)) - $(RM) -f $(@D)/_the_wrappers.d - $(TOOL_LOGUTIL_CMD) make-class $< $(@D) - -# Generate LogWrapper properties file by concatening resource files -$(EXCEPTION_DIR)/LogStrings.properties: \ - $(LOGWRAPPER_DIR)/ActivationSystemException.resource \ - $(LOGWRAPPER_DIR)/IORSystemException.resource \ - $(LOGWRAPPER_DIR)/InterceptorsSystemException.resource \ - $(LOGWRAPPER_DIR)/NamingSystemException.resource \ - $(LOGWRAPPER_DIR)/OMGSystemException.resource \ - $(LOGWRAPPER_DIR)/ORBUtilSystemException.resource \ - $(LOGWRAPPER_DIR)/POASystemException.resource \ - $(LOGWRAPPER_DIR)/UtilSystemException.resource - $(call LogInfo, Concatenating 8 resource files into $(@F)) - $(call MakeDir, $(@D)) - $(CAT) $^ > $@ - -# The resources files are generated from lisp-like .mc files. -$(LOGWRAPPER_DIR)/%SystemException.resource: \ - $(TOPDIR)/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/%.mc \ - $(BUILD_TOOLS_CORBA) - $(call LogInfo, Generating resource file from $*.mc) - $(call MakeDir, $(@D)) - $(RM) -f $(@D)/_the_wrappers.d - $(TOOL_LOGUTIL_CMD) make-resource $< $(@D) - - -LOGWRAPPER_TARGETS := \ - $(EXCEPTION_DIR)/ActivationSystemException.java \ - $(EXCEPTION_DIR)/IORSystemException.java \ - $(EXCEPTION_DIR)/InterceptorsSystemException.java \ - $(EXCEPTION_DIR)/NamingSystemException.java \ - $(EXCEPTION_DIR)/OMGSystemException.java \ - $(EXCEPTION_DIR)/ORBUtilSystemException.java \ - $(EXCEPTION_DIR)/POASystemException.java \ - $(EXCEPTION_DIR)/UtilSystemException.java \ - $(EXCEPTION_DIR)/LogStrings.properties - -################################################################################ -# Build the IDLs. - -IDL_DELETES := \ - org/omg/DynamicAny/*POA* \ - org/omg/DynamicAny/*Holder* \ - org/omg/DynamicAny/DynValueBoxHelper.java \ - org/omg/DynamicAny/DynValueCommonHelper.java \ - org/omg/DynamicAny/_DynValueCommonStub.java \ - org/omg/DynamicAny/_DynValueBoxStub.java \ - org/omg/DynamicAny/DynAnyPackage/TypeMismatchHolder.java \ - org/omg/DynamicAny/DynAnyPackage/InvalidValueHolder.java \ - org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHolder.java \ - org/omg/IOP/BI_DIR_IIOP.java \ - org/omg/IOP/ChainBypassCheck.java \ - org/omg/IOP/ChainBypassInfo.java \ - org/omg/IOP/FORWARDED_IDENTITY.java \ - org/omg/IOP/INVOCATION_POLICIES.java \ - org/omg/IOP/LogicalThreadId.java \ - org/omg/IOP/SendingContextRunTime.java \ - org/omg/IOP/UnknownExceptionInfo.java \ - org/omg/IOP/TaggedComponentSeqHolder.java \ - org/omg/PortableServer/CurrentPackage/NoContextHolder.java \ - org/omg/PortableServer/ForwardRequestHolder.java \ - org/omg/PortableServer/IdAssignmentPolicyValueHelper.java \ - org/omg/PortableServer/IdAssignmentPolicyValueHolder.java \ - org/omg/PortableServer/IdUniquenessPolicyValueHelper.java \ - org/omg/PortableServer/IdUniquenessPolicyValueHolder.java \ - org/omg/PortableServer/ImplicitActivationPolicyValueHelper.java \ - org/omg/PortableServer/ImplicitActivationPolicyValueHolder.java \ - org/omg/PortableServer/LifespanPolicyValueHelper.java \ - org/omg/PortableServer/LifespanPolicyValueHolder.java \ - org/omg/PortableServer/ServantRetentionPolicyValueHelper.java \ - org/omg/PortableServer/ServantRetentionPolicyValueHolder.java \ - org/omg/PortableServer/ObjectIdHelper.java \ - org/omg/PortableServer/ObjectIdHolder.java \ - org/omg/PortableServer/POAListHelper.java \ - org/omg/PortableServer/POAListHolder.java \ - org/omg/PortableServer/POAManagerPackage/AdapterInactiveHolder.java \ - org/omg/PortableServer/POAManagerPackage/StateHelper.java \ - org/omg/PortableServer/POAManagerPackage/StateHolder.java \ - org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHolder.java \ - org/omg/PortableServer/POAPackage/AdapterNonExistentHolder.java \ - org/omg/PortableServer/POAPackage/InvalidPolicyHolder.java \ - org/omg/PortableServer/POAPackage/NoServantHolder.java \ - org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHolder.java \ - org/omg/PortableServer/POAPackage/ObjectNotActiveHolder.java \ - org/omg/PortableServer/POAPackage/ServantAlreadyActiveHolder.java \ - org/omg/PortableServer/POAPackage/ServantNotActiveHolder.java \ - org/omg/PortableServer/POAPackage/WrongAdapterHolder.java \ - org/omg/PortableServer/POAPackage/WrongPolicyHolder.java \ - org/omg/PortableServer/RequestProcessingPolicyValueHelper.java \ - org/omg/PortableServer/RequestProcessingPolicyValueHolder.java \ - org/omg/PortableServer/ServantActivatorHolder.java \ - org/omg/PortableServer/ServantLocatorHolder.java \ - org/omg/PortableServer/ThreadPolicyValueHelper.java \ - org/omg/PortableServer/ThreadPolicyValueHolder.java \ - org/omg/PortableInterceptor/ClientRequestInfoHelper.java \ - org/omg/PortableInterceptor/ClientRequestInterceptorHelper.java \ - org/omg/PortableInterceptor/IORInfoHelper.java \ - org/omg/PortableInterceptor/IORInterceptorHelper.java \ - org/omg/PortableInterceptor/InterceptorHelper.java \ - org/omg/PortableInterceptor/ORBInitInfoHelper.java \ - org/omg/PortableInterceptor/ORBInitializerHelper.java \ - org/omg/PortableInterceptor/PolicyFactoryHelper.java \ - org/omg/PortableInterceptor/ReplyStatusHelper.java \ - org/omg/PortableInterceptor/RequestInfoHelper.java \ - org/omg/PortableInterceptor/ServerRequestInfoHelper.java \ - org/omg/PortableInterceptor/ServerRequestInterceptorHelper.java \ - org/omg/PortableInterceptor/SlotIdHelper.java \ - org/omg/PortableInterceptor/ClientRequestInfoHolder.java \ - org/omg/PortableInterceptor/ClientRequestInterceptorHolder.java \ - org/omg/PortableInterceptor/CurrentHolder.java \ - org/omg/PortableInterceptor/ForwardRequestHolder.java \ - org/omg/PortableInterceptor/IORInfoHolder.java \ - org/omg/PortableInterceptor/IORInterceptorHolder.java \ - org/omg/PortableInterceptor/InterceptorHolder.java \ - org/omg/PortableInterceptor/InvalidSlotHolder.java \ - org/omg/PortableInterceptor/ORBInitInfoHolder.java \ - org/omg/PortableInterceptor/ORBInitializerHolder.java \ - org/omg/PortableInterceptor/PolicyFactoryHolder.java \ - org/omg/PortableInterceptor/RequestInfoHolder.java \ - org/omg/PortableInterceptor/ServerRequestInfoHolder.java \ - org/omg/PortableInterceptor/ServerRequestInterceptorHolder.java \ - org/omg/PortableInterceptor/TaggedComponentSeqHolder.java \ - org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateNameHolder.java \ - org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidNameHolder.java \ - org/omg/IOP/CodecPackage/FormatMismatchHolder.java \ - org/omg/IOP/CodecPackage/InvalidTypeForEncodingHolder.java \ - org/omg/IOP/CodecPackage/TypeMismatchHolder.java \ - org/omg/IOP/CodecHelper.java \ - org/omg/IOP/EncodingFormatHelper.java \ - org/omg/IOP/EncodingHelper.java \ - org/omg/IOP/CodecFactoryPackage/UnknownEncodingHolder.java \ - org/omg/IOP/CodecFactoryHolder.java \ - org/omg/IOP/CodecHolder.java \ - org/omg/IOP/EncodingHolder.java \ - org/omg/IOP/TaggedComponentSeqHelper.java \ - org/omg/Dynamic/ContextListHelper.java \ - org/omg/Dynamic/ExceptionListHelper.java \ - org/omg/Dynamic/ParameterHolder.java \ - org/omg/Dynamic/ParameterListHolder.java \ - org/omg/Dynamic/ExceptionListHolder.java \ - org/omg/Dynamic/ParameterHelper.java \ - org/omg/Dynamic/ParameterListHelper.java \ - org/omg/Dynamic/RequestContextHelper.java \ - org/omg/CORBA/OctetSeqHelper.java \ - org/omg/CORBA/OctetSeqHolder.java \ - org/omg/CORBA/PolicyError.java \ - org/omg/CORBA/RepositoryIdHelper.java \ - # - -$(eval $(call SetupIdlCompilation,BUILD_IDLS, \ - IDLJ := $(TOOL_IDLJ_CMD), \ - SRC := $(TOPDIR)/src/java.corba/share/classes, \ - BIN := $(SUPPORT_OUTPUTDIR)/gensrc/java.corba, \ - EXCLUDES := com/sun/tools/corba/se/idl/% \ - org/omg/CORBA/% \ - com/sun/corba/se/GiopIDL/% \ - org/omg/PortableServer/corba.idl, \ - INCLUDES := %, \ - OLDIMPLBASES := com/sun/corba/se/PortableActivationIDL/activation.idl \ - com/sun/corba/se/spi/activation/activation.idl, \ - DELETES := $(IDL_DELETES))) - -$(BUILD_IDLS): $(BUILD_IDLJ) - -################################################################################ -# zh_HK is just a copy of zh_TW - -$(SUPPORT_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_HK.properties: \ - $(TOPDIR)/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_TW.properties - $(install-file) - -################################################################################ - -all: $(BUILD_IDLS) $(LOGWRAPPER_TARGETS) \ - $(SUPPORT_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_HK.properties diff --git a/make/gensrc/GensrcVarHandles.gmk b/make/gensrc/GensrcVarHandles.gmk index acdce6c03a7..2f9e4bd928d 100644 --- a/make/gensrc/GensrcVarHandles.gmk +++ b/make/gensrc/GensrcVarHandles.gmk @@ -168,3 +168,7 @@ $(foreach t, $(VARHANDLES_BYTE_ARRAY_TYPES), \ $(eval $(call GenerateVarHandleByteArray,VAR_HANDLE_BYTE_ARRAY_$t,$t))) GENSRC_JAVA_BASE += $(GENSRC_VARHANDLES) + +# Include custom extension post hook +$(eval $(call IncludeCustomExtension, gensrc/GensrcVarHandles-post.gmk)) + diff --git a/make/gensrc/GensrcX11Wrappers.gmk b/make/gensrc/GensrcX11Wrappers.gmk index e506c5c01ff..ca95d0edae9 100644 --- a/make/gensrc/GensrcX11Wrappers.gmk +++ b/make/gensrc/GensrcX11Wrappers.gmk @@ -92,10 +92,10 @@ ifneq ($(COMPILE_TYPE), cross) endif SIZER_CFLAGS := \ - -I${TOPDIR}/src/hotspot/share/include \ - -I${TOPDIR}/src/hotspot/os/$(HOTSPOT_TARGET_OS_TYPE)/include \ - -I$(TOPDIR)/src/java.base/share/native/include \ - -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/include \ + -I$(TOPDIR)/src/hotspot/share/include \ + -I$(TOPDIR)/src/hotspot/os/$(HOTSPOT_TARGET_OS_TYPE)/include \ + -I$(SUPPORT_OUTPUTDIR)/modules_include/java.base \ + -I$(SUPPORT_OUTPUTDIR)/modules_include/java.base/$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \ -I$(TOPDIR)/src/java.base/share/native/libjava \ -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \ -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \ diff --git a/make/hotspot/lib/CompileJvm.gmk b/make/hotspot/lib/CompileJvm.gmk index 91b5f9c74aa..de8213232b6 100644 --- a/make/hotspot/lib/CompileJvm.gmk +++ b/make/hotspot/lib/CompileJvm.gmk @@ -59,8 +59,8 @@ JVM_CFLAGS_INCLUDES += \ -I$(TOPDIR)/src/hotspot/share/precompiled \ -I$(TOPDIR)/src/hotspot/share/include \ -I$(TOPDIR)/src/hotspot/os/$(HOTSPOT_TARGET_OS_TYPE)/include \ - -I$(TOPDIR)/src/java.base/share/native/include \ - -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/include \ + -I$(SUPPORT_OUTPUTDIR)/modules_include/java.base \ + -I$(SUPPORT_OUTPUTDIR)/modules_include/java.base/$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \ -I$(TOPDIR)/src/java.base/share/native/libjimage \ # diff --git a/make/hotspot/lib/JvmOverrideFiles.gmk b/make/hotspot/lib/JvmOverrideFiles.gmk index b9092001e3b..55732a75e86 100644 --- a/make/hotspot/lib/JvmOverrideFiles.gmk +++ b/make/hotspot/lib/JvmOverrideFiles.gmk @@ -32,6 +32,8 @@ $(eval $(call IncludeCustomExtension, hotspot/lib/JvmOverrideFiles.gmk)) ifeq ($(TOOLCHAIN_TYPE), gcc) BUILD_LIBJVM_vmStructs.cpp_CXXFLAGS := -fno-var-tracking-assignments -O0 BUILD_LIBJVM_jvmciCompilerToVM.cpp_CXXFLAGS := -fno-var-tracking-assignments + BUILD_LIBJVM_assembler_x86.cpp_CXXFLAGS := -Wno-maybe-uninitialized + BUILD_LIBJVM_interp_masm_x86.cpp_CXXFLAGS := -Wno-uninitialized endif ifeq ($(OPENJDK_TARGET_OS), linux) diff --git a/make/idea/idea.gmk b/make/idea/idea.gmk index 299ffe805bc..8b9d862794b 100644 --- a/make/idea/idea.gmk +++ b/make/idea/idea.gmk @@ -20,16 +20,9 @@ else #with SPEC SEL_MODULES := $(MODULES) endif - # Find all source dirs for a particular module - # $1 - Module to find source dirs for - FindIdeaModuleSrcDirs = \ - $(strip $(addsuffix /$(strip $1), $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \ - $(wildcard $(foreach sub, $(SRC_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS))))) - - idea: $(ECHO) "SUPPORT=$(SUPPORT_OUTPUTDIR)" >> $(OUT) - $(ECHO) "MODULE_ROOTS=\"$(foreach mod, $(SEL_MODULES), $(call FindIdeaModuleSrcDirs,$(mod)))\"" >> $(OUT) + $(ECHO) "MODULE_ROOTS=\"$(foreach mod, $(SEL_MODULES), $(call FindModuleSrcDirs,$(mod)))\"" >> $(OUT) $(ECHO) "MODULE_NAMES=\"$(strip $(foreach mod, $(SEL_MODULES), $(mod)))\"" >> $(OUT) $(ECHO) "SEL_MODULES=\"$(SEL_MODULES)\"" >> $(OUT) $(ECHO) "BOOT_JDK=\"$(BOOT_JDK)\"" >> $(OUT) diff --git a/make/idea/template/ant.xml b/make/idea/template/ant.xml index 9e7c19b8c89..74d7c1e34c2 100644 --- a/make/idea/template/ant.xml +++ b/make/idea/template/ant.xml @@ -3,7 +3,6 @@ - diff --git a/make/idea/template/build.xml b/make/idea/template/build.xml index 7f0eff40e3b..a553a940d2b 100644 --- a/make/idea/template/build.xml +++ b/make/idea/template/build.xml @@ -6,32 +6,16 @@ new JdkLogger(project) - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + @@ -43,71 +27,17 @@ **** Global JDK Build Targets --> - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/make/idea/template/jdk.iml b/make/idea/template/jdk.iml index 384f7806d3b..c3fb9c6963a 100644 --- a/make/idea/template/jdk.iml +++ b/make/idea/template/jdk.iml @@ -4,11 +4,9 @@ - - - + diff --git a/make/jdk/src/classes/build/tools/jdwpgen/AbstractCommandNode.java b/make/jdk/src/classes/build/tools/jdwpgen/AbstractCommandNode.java index b4b17196088..d007c584b69 100644 --- a/make/jdk/src/classes/build/tools/jdwpgen/AbstractCommandNode.java +++ b/make/jdk/src/classes/build/tools/jdwpgen/AbstractCommandNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,8 +30,8 @@ import java.io.*; class AbstractCommandNode extends AbstractNamedNode { void document(PrintWriter writer) { - writer.println("
          " + name + - " Command (" + nameNode.value() + ")
          "); + writer.println("
          " + name + + " Command (" + nameNode.value() + ")
          "); writer.println(comment()); writer.println("
          "); for (Node node : components) { diff --git a/make/jdk/src/classes/build/tools/jdwpgen/AbstractNamedNode.java b/make/jdk/src/classes/build/tools/jdwpgen/AbstractNamedNode.java index a71b8949e3d..764558be1a7 100644 --- a/make/jdk/src/classes/build/tools/jdwpgen/AbstractNamedNode.java +++ b/make/jdk/src/classes/build/tools/jdwpgen/AbstractNamedNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -62,8 +62,8 @@ abstract class AbstractNamedNode extends Node { } void document(PrintWriter writer) { - writer.println("

          " + name + - " Command Set

          "); + writer.println("

          " + name + + " Command Set

          "); for (Node node : components) { node.document(writer); } diff --git a/make/jdk/src/classes/build/tools/jdwpgen/AbstractTypeListNode.java b/make/jdk/src/classes/build/tools/jdwpgen/AbstractTypeListNode.java index eea9b9314a9..5ceae49b811 100644 --- a/make/jdk/src/classes/build/tools/jdwpgen/AbstractTypeListNode.java +++ b/make/jdk/src/classes/build/tools/jdwpgen/AbstractTypeListNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,11 +43,11 @@ abstract class AbstractTypeListNode extends AbstractNamedNode { if (components.isEmpty()) { writer.println("
          (None)"); } else { - writer.println("
          "); + writer.println("
          "); for (int i = maxStructIndent; i > 0; --i) { - writer.print("
          "); + writer.print(""); } - writer.println(""); + writer.println(""); writer.println(""); for (Node node : components) { node.document(writer); diff --git a/make/jdk/src/classes/build/tools/jdwpgen/CommandSetNode.java b/make/jdk/src/classes/build/tools/jdwpgen/CommandSetNode.java index 738cf61be5b..440e138ccb9 100644 --- a/make/jdk/src/classes/build/tools/jdwpgen/CommandSetNode.java +++ b/make/jdk/src/classes/build/tools/jdwpgen/CommandSetNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,8 +38,8 @@ class CommandSetNode extends AbstractNamedNode { } void document(PrintWriter writer) { - writer.println("

          " + name + - " Command Set (" + + writer.println("

          " + name + + " Command Set (" + nameNode.value() + ")

          "); writer.println(comment()); for (Node node : components) { @@ -51,11 +51,13 @@ class CommandSetNode extends AbstractNamedNode { writer.print("
        • "); writer.println(name() + " Command Set (" + nameNode.value() + ")"); - writer.println("
            "); - for (Node node : components) { - node.documentIndex(writer); + if (components.size() > 0) { + writer.println("
              "); + for (Node node : components) { + node.documentIndex(writer); + } + writer.println("
            "); } - writer.println("
          "); } void genJavaClassSpecifics(PrintWriter writer, int depth) { diff --git a/make/jdk/src/classes/build/tools/jdwpgen/ConstantSetNode.java b/make/jdk/src/classes/build/tools/jdwpgen/ConstantSetNode.java index 280136766d4..4990cb2740e 100644 --- a/make/jdk/src/classes/build/tools/jdwpgen/ConstantSetNode.java +++ b/make/jdk/src/classes/build/tools/jdwpgen/ConstantSetNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,15 +54,15 @@ class ConstantSetNode extends AbstractNamedNode { } void document(PrintWriter writer) { - writer.println("

          " + name + - " Constants

          "); + writer.println("

          " + name + + " Constants

          "); writer.println(comment()); - writer.println("
          "); - writer.println(" - + @@ -403,6 +401,15 @@ td.agg { background-color: lightgray; } + + + + + + + + + @@ -414,102 +421,6 @@ td.agg { background-color: lightgray; } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/make/jdk/src/classes/build/tools/taglet/ModuleGraph.java b/make/jdk/src/classes/build/tools/taglet/ModuleGraph.java index 6e2b0309667..fc53c939c51 100644 --- a/make/jdk/src/classes/build/tools/taglet/ModuleGraph.java +++ b/make/jdk/src/classes/build/tools/taglet/ModuleGraph.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -64,7 +64,7 @@ public class ModuleGraph implements Taglet { } String moduleName = ((ModuleElement) element).getQualifiedName().toString(); - String imageFile = moduleName + "-graph.png"; + String imageFile = moduleName + "/module-graph.png"; int thumbnailHeight = -1; String hoverImage = ""; if (!moduleName.equals("java.base")) { diff --git a/make/launcher/Launcher-java.corba.gmk b/make/launcher/Launcher-java.corba.gmk deleted file mode 100644 index f859877bbc2..00000000000 --- a/make/launcher/Launcher-java.corba.gmk +++ /dev/null @@ -1,50 +0,0 @@ -# -# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -include LauncherCommon.gmk - -$(eval $(call SetupBuildLauncher, idlj, \ - MAIN_CLASS := com.sun.tools.corba.se.idl.toJavaPortable.Compile, \ -)) - -$(eval $(call SetupBuildLauncher, orbd, \ - MAIN_CLASS := com.sun.corba.se.impl.activation.ORBD, \ - JAVA_ARGS := \ - -Dcom.sun.CORBA.activation.DbDir=./orb.db \ - -Dcom.sun.CORBA.activation.Port=1049 \ - -Dcom.sun.CORBA.POA.ORBServerId=1, \ -)) - -$(eval $(call SetupBuildLauncher, servertool, \ - MAIN_CLASS := com.sun.corba.se.impl.activation.ServerTool, \ -)) - -$(eval $(call SetupBuildLauncher, tnameserv, \ - MAIN_CLASS := com.sun.corba.se.impl.naming.cosnaming.TransientNameServer, \ - JAVA_ARGS := \ - -Dcom.sun.CORBA.activation.DbDir=./orb.db \ - -Djava.util.logging.LoggingPermission=contol \ - -Dcom.sun.CORBA.POA.ORBServerId=1, \ -)) diff --git a/make/launcher/Launcher-jdk.pack.gmk b/make/launcher/Launcher-jdk.pack.gmk index fed0ac81968..af1fe139c6b 100644 --- a/make/launcher/Launcher-jdk.pack.gmk +++ b/make/launcher/Launcher-jdk.pack.gmk @@ -82,7 +82,7 @@ $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE, \ CFLAGS_linux := -fPIC, \ CFLAGS_solaris := -KPIC, \ CFLAGS_macosx := -fPIC, \ - DISABLED_WARNINGS_gcc := unused-result, \ + DISABLED_WARNINGS_gcc := unused-result implicit-fallthrough, \ MAPFILE := $(UNPACK_MAPFILE),\ LDFLAGS := $(UNPACKEXE_ZIPOBJS) \ $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \ diff --git a/make/launcher/Launcher-jdk.xml.bind.gmk b/make/launcher/Launcher-jdk.xml.bind.gmk deleted file mode 100644 index 19ede8880b6..00000000000 --- a/make/launcher/Launcher-jdk.xml.bind.gmk +++ /dev/null @@ -1,34 +0,0 @@ -# -# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -include LauncherCommon.gmk - -$(eval $(call SetupBuildLauncher, schemagen, \ - MAIN_CLASS := com.sun.tools.internal.jxc.SchemaGenerator, \ -)) - -$(eval $(call SetupBuildLauncher, xjc, \ - MAIN_CLASS := com.sun.tools.internal.xjc.Driver, \ -)) diff --git a/make/launcher/Launcher-jdk.xml.ws.gmk b/make/launcher/Launcher-jdk.xml.ws.gmk deleted file mode 100644 index 9a5bbeff599..00000000000 --- a/make/launcher/Launcher-jdk.xml.ws.gmk +++ /dev/null @@ -1,34 +0,0 @@ -# -# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -include LauncherCommon.gmk - -$(eval $(call SetupBuildLauncher, wsgen, \ - MAIN_CLASS := com.sun.tools.internal.ws.WsGen, \ -)) - -$(eval $(call SetupBuildLauncher, wsimport, \ - MAIN_CLASS := com.sun.tools.internal.ws.WsImport, \ -)) diff --git a/make/lib/Awt2dLibraries.gmk b/make/lib/Awt2dLibraries.gmk index 42f8895aeed..14c41b9d83a 100644 --- a/make/lib/Awt2dLibraries.gmk +++ b/make/lib/Awt2dLibraries.gmk @@ -358,7 +358,8 @@ ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),) WARNINGS_AS_ERRORS_xlc := false, \ DISABLED_WARNINGS_gcc := type-limits pointer-to-int-cast \ unused-result maybe-uninitialized format \ - format-security int-to-pointer-cast parentheses, \ + format-security int-to-pointer-cast parentheses \ + implicit-fallthrough, \ DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE \ E_ASSIGNMENT_TYPE_MISMATCH E_NON_CONST_INIT, \ MAPFILE := $(TOPDIR)/make/mapfiles/libawt_xawt/mapfile-vers, \ @@ -491,7 +492,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJAVAJPEG, \ CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBJAVAJPEG_HEADERS) \ $(LIBJAVA_HEADER_FLAGS) \ -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \ - DISABLED_WARNINGS_gcc := clobbered, \ + DISABLED_WARNINGS_gcc := clobbered implicit-fallthrough shift-negative-value, \ MAPFILE := $(TOPDIR)/make/mapfiles/libjpeg/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ @@ -669,7 +670,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \ CFLAGS_windows = -DCC_NOEX, \ WARNINGS_AS_ERRORS_xlc := false, \ DISABLED_WARNINGS_gcc := sign-compare int-to-pointer-cast \ - type-limits missing-field-initializers, \ + type-limits missing-field-initializers implicit-fallthrough, \ DISABLED_WARNINGS_CXX_gcc := reorder delete-non-virtual-dtor strict-overflow \ maybe-uninitialized, \ DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types \ @@ -905,9 +906,18 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false) LIBSPLASHSCREEN_LIBS := - ifneq ($(USE_EXTERNAL_LIBZ), true) + ifeq ($(USE_EXTERNAL_LIBZ), false) LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.base/share/native/libzip/zlib - LIBSPLASHSCREEN_CFLAGS += $(ZLIB_CPPFLAGS) + else + ifeq ($(OPENJDK_TARGET_OS), macosx) + ifeq ($(USE_EXTERNAL_LIBPNG), false) + # When building our own libpng and using an external libz, we need to + # inject our own libz.h to tweak the exported ZLIB_VERNUM macro. See + # $(TOPDIR)/src/java.desktop/macosx/native/libsplashscreen/libpng/zlib.h + # for details. + LIBSPLASHSCREEN_CFLAGS += -iquote $(TOPDIR)/src/java.desktop/macosx/native/libsplashscreen/libpng + endif + endif endif ifeq ($(OPENJDK_TARGET_OS), macosx) @@ -933,8 +943,9 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false) EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \ OPTIMIZATION := LOW, \ CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) \ - $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS), \ - DISABLED_WARNINGS_gcc := sign-compare type-limits unused-result maybe-uninitialized shift-negative-value, \ + $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS), \ + DISABLED_WARNINGS_gcc := sign-compare type-limits unused-result \ + maybe-uninitialized shift-negative-value implicit-fallthrough, \ DISABLED_WARNINGS_clang := incompatible-pointer-types, \ DISABLED_WARNINGS_solstudio := E_NEWLINE_NOT_LAST E_DECLARATION_IN_CODE \ E_STATEMENT_NOT_REACHED, \ @@ -942,8 +953,8 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false) MAPFILE := $(TOPDIR)/make/mapfiles/libsplashscreen/mapfile-vers, \ LDFLAGS := $(LIBSPLASHSCREEN_LDFLAGS) $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ - LIBS := $(JDKLIB_LIBS) $(LIBSPLASHSCREEN_LIBS) $(LIBZ) \ - $(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(PNG_LIBS), \ + LIBS := $(JDKLIB_LIBS) $(LIBSPLASHSCREEN_LIBS) $(LIBZ_LIBS) \ + $(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(PNG_LIBS), \ LIBS_aix := -liconv, \ VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ RC_FLAGS := $(RC_FLAGS) \ diff --git a/make/lib/CoreLibraries.gmk b/make/lib/CoreLibraries.gmk index 090e425d703..72e5fe8a7e4 100644 --- a/make/lib/CoreLibraries.gmk +++ b/make/lib/CoreLibraries.gmk @@ -67,7 +67,7 @@ ifneq ($(OPENJDK_TARGET_OS), macosx) CFLAGS_linux_ppc64le := -ffp-contract=off, \ CFLAGS_linux_s390x := -ffp-contract=off, \ CFLAGS_linux_aarch64 := -ffp-contract=off, \ - DISABLED_WARNINGS_gcc := sign-compare, \ + DISABLED_WARNINGS_gcc := sign-compare misleading-indentation, \ DISABLED_WARNINGS_microsoft := 4146 4244 4018, \ ARFLAGS := $(ARFLAGS), \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \ @@ -82,7 +82,7 @@ else OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \ SRC := $(LIBFDLIBM_SRC), \ CFLAGS := $(CFLAGS_JDKLIB) $(LIBFDLIBM_CFLAGS), \ - LDFLAGS := -nostdlib -r -arch x86_64, \ + LDFLAGS := -nostdlib $(ARFLAGS), \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \ )) @@ -113,6 +113,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBVERIFY, \ SRC := $(TOPDIR)/src/java.base/share/native/libverify, \ OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \ CFLAGS := $(CFLAGS_JDKLIB), \ + DISABLED_WARNINGS_gcc := implicit-fallthrough, \ DISABLED_WARNINGS_microsoft := 4244 4267, \ MAPFILE := $(TOPDIR)/make/mapfiles/libverify/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ @@ -224,11 +225,12 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBZIP, \ SRC := $(TOPDIR)/src/java.base/share/native/libzip, \ EXCLUDES := $(LIBZIP_EXCLUDES), \ CFLAGS := $(CFLAGS_JDKLIB) \ - $(ZLIB_CPPFLAGS) \ + $(LIBZ_CFLAGS) \ -I$(TOPDIR)/src/java.base/share/native/libjava \ -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \ -I$(SUPPORT_OUTPUTDIR)/headers/java.base, \ CFLAGS_unix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \ + DISABLED_WARNINGS_gcc := implicit-fallthrough, \ MAPFILE := $(TOPDIR)/make/mapfiles/libzip/mapfile-vers, \ REORDER := $(BUILD_LIBZIP_REORDER), \ LDFLAGS := $(LDFLAGS_JDKLIB) \ @@ -236,7 +238,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBZIP, \ LDFLAGS_windows := -export:ZIP_Open -export:ZIP_Close -export:ZIP_FindEntry \ -export:ZIP_ReadEntry -export:ZIP_GetNextEntry \ -export:ZIP_InflateFully -export:ZIP_CRC32 -export:ZIP_FreeEntry, \ - LIBS_unix := -ljvm -ljava $(LIBZ), \ + LIBS_unix := -ljvm -ljava $(LIBZ_LIBS), \ LIBS_solaris := -lc, \ LIBS_windows := jvm.lib $(WIN_JAVA_LIB), \ VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ @@ -270,6 +272,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJIMAGE, \ EXCLUDES := $(LIBJIMAGE_EXCLUDES), \ CFLAGS := $(CFLAGS_JDKLIB) $(JIMAGELIB_CPPFLAGS), \ CXXFLAGS := $(CXXFLAGS_JDKLIB) $(JIMAGELIB_CPPFLAGS), \ + DISABLED_WARNINGS_gcc := implicit-fallthrough, \ CFLAGS_unix := -UDEBUG, \ MAPFILE := $(TOPDIR)/make/mapfiles/libjimage/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \ @@ -341,8 +344,9 @@ endif LIBJLI_CFLAGS += $(addprefix -I, $(LIBJLI_SRC_DIRS)) +LIBJLI_CFLAGS += $(LIBZ_CFLAGS) + ifneq ($(USE_EXTERNAL_LIBZ), true) - LIBJLI_CFLAGS += $(ZLIB_CPPFLAGS) LIBJLI_EXTRA_FILES += \ $(addprefix $(TOPDIR)/src/java.base/share/native/libzip/zlib/, \ inflate.c \ @@ -362,6 +366,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJLI, \ EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \ OPTIMIZATION := HIGH, \ CFLAGS := $(LIBJLI_CFLAGS), \ + DISABLED_WARNINGS_gcc := maybe-uninitialized, \ DISABLED_WARNINGS_solstudio := \ E_ASM_DISABLES_OPTIMIZATION \ E_STATEMENT_NOT_REACHED, \ @@ -390,7 +395,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJLI, \ -export:JLI_PreprocessArg \ -export:JLI_AddArgsFromEnvVar \ -export:JLI_GetAppArgIndex, \ - LIBS_unix := $(LIBZ), \ + LIBS_unix := $(LIBZ_LIBS), \ LIBS_linux := $(LIBDL) -lc -lpthread, \ LIBS_solaris := $(LIBDL) -lc, \ LIBS_aix := $(LIBDL),\ @@ -437,7 +442,7 @@ else ifeq ($(OPENJDK_TARGET_OS), macosx) EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \ OPTIMIZATION := HIGH, \ CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \ - LDFLAGS := -nostdlib -r, \ + LDFLAGS := -nostdlib $(ARFLAGS), \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static, \ )) diff --git a/make/lib/Lib-java.instrument.gmk b/make/lib/Lib-java.instrument.gmk index 2fbc6ab2835..51523c8855e 100644 --- a/make/lib/Lib-java.instrument.gmk +++ b/make/lib/Lib-java.instrument.gmk @@ -68,7 +68,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBINSTRUMENT, \ LDFLAGS_macosx := -Wl$(COMMA)-all_load, \ LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \ LIBS := $(JDKLIB_LIBS), \ - LIBS_unix := -ljava -ljvm $(LIBZ), \ + LIBS_unix := -ljava -ljvm $(LIBZ_LIBS), \ LIBS_linux := -ljli $(LIBDL), \ LIBS_solaris := -ljli $(LIBDL), \ LIBS_aix := -liconv -ljli_static $(LIBDL), \ diff --git a/make/lib/Lib-java.management.gmk b/make/lib/Lib-java.management.gmk index f59a6ac05e1..84e37386ba3 100644 --- a/make/lib/Lib-java.management.gmk +++ b/make/lib/Lib-java.management.gmk @@ -70,3 +70,7 @@ $(BUILD_LIBMANAGEMENT): $(call FindLib, java.base, java) TARGETS += $(BUILD_LIBMANAGEMENT) ################################################################################ + +# Include custom extension post hook +$(eval $(call IncludeCustomExtension, lib/Lib-java.management-post.gmk)) + diff --git a/make/lib/Lib-jdk.crypto.ec.gmk b/make/lib/Lib-jdk.crypto.ec.gmk index c71bc4fa801..96323314f92 100644 --- a/make/lib/Lib-jdk.crypto.ec.gmk +++ b/make/lib/Lib-jdk.crypto.ec.gmk @@ -54,7 +54,7 @@ ifeq ($(ENABLE_INTREE_EC), true) -DMP_API_COMPATIBLE -DNSS_ECC_MORE_THAN_SUITE_B, \ CXXFLAGS := $(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CXXFLAGS_JDKLIB)) \ $(BUILD_LIBSUNEC_FLAGS), \ - DISABLED_WARNINGS_gcc := sign-compare, \ + DISABLED_WARNINGS_gcc := sign-compare implicit-fallthrough, \ DISABLED_WARNINGS_microsoft := 4101 4244 4146 4018, \ MAPFILE := $(TOPDIR)/make/mapfiles/libsunec/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \ diff --git a/make/lib/Lib-jdk.jdwp.agent.gmk b/make/lib/Lib-jdk.jdwp.agent.gmk index 59cc4f6b2fb..f86000cd720 100644 --- a/make/lib/Lib-jdk.jdwp.agent.gmk +++ b/make/lib/Lib-jdk.jdwp.agent.gmk @@ -43,6 +43,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBDT_SOCKET, \ OPTIMIZATION := LOW, \ CFLAGS := $(CFLAGS_JDKLIB) -DUSE_MMAP \ $(LIBDT_SOCKET_CPPFLAGS), \ + DISABLED_WARNINGS_gcc := shift-negative-value, \ MAPFILE := $(TOPDIR)/make/mapfiles/libdt_socket/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ diff --git a/make/lib/Lib-jdk.management.gmk b/make/lib/Lib-jdk.management.gmk index b04f5b2ed3a..6bb92b1c796 100644 --- a/make/lib/Lib-jdk.management.gmk +++ b/make/lib/Lib-jdk.management.gmk @@ -80,3 +80,7 @@ $(BUILD_LIBMANAGEMENT_EXT): $(call FindLib, java.base, java) TARGETS += $(BUILD_LIBMANAGEMENT_EXT) ################################################################################ + +# Include custom extension post hook +$(eval $(call IncludeCustomExtension, lib/Lib-jdk.management-post.gmk)) + diff --git a/make/lib/Lib-jdk.pack.gmk b/make/lib/Lib-jdk.pack.gmk index 7b8f9708643..3bbc3a4537a 100644 --- a/make/lib/Lib-jdk.pack.gmk +++ b/make/lib/Lib-jdk.pack.gmk @@ -40,6 +40,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBUNPACK, \ -I$(TOPDIR)/src/jdk.pack/share/native/common-unpack \ $(LIBJAVA_HEADER_FLAGS), \ CFLAGS_release := -DPRODUCT, \ + DISABLED_WARNINGS_gcc := implicit-fallthrough, \ MAPFILE := $(TOPDIR)/make/mapfiles/libunpack/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ diff --git a/make/lib/LibCommon.gmk b/make/lib/LibCommon.gmk index 487d882dbf2..0c329d1b858 100644 --- a/make/lib/LibCommon.gmk +++ b/make/lib/LibCommon.gmk @@ -68,12 +68,3 @@ LIBJAVA_HEADER_FLAGS := $(addprefix -I, $(call FindSrcDirsForLib, java.base, jav INSTALL_LIBRARIES_HERE := $(call FindLibDirForModule, $(MODULE)) ################################################################################ - -# Define it here since there are multiple uses. -ifeq ($(USE_EXTERNAL_LIBZ), true) - LIBZ := -lz -else - ZLIB_CPPFLAGS := -I$(TOPDIR)/src/java.base/share/native/libzip/zlib -endif - -############################################################################### diff --git a/make/mapfiles/libjava/mapfile-vers b/make/mapfiles/libjava/mapfile-vers index 8b68c02469e..4ee3bc1d72f 100644 --- a/make/mapfiles/libjava/mapfile-vers +++ b/make/mapfiles/libjava/mapfile-vers @@ -258,7 +258,6 @@ SUNWprivate_1.1 { Java_jdk_internal_reflect_NativeConstructorAccessorImpl_newInstance0; Java_jdk_internal_reflect_NativeMethodAccessorImpl_invoke0; Java_jdk_internal_reflect_Reflection_getCallerClass__; - Java_jdk_internal_reflect_Reflection_getCallerClass__I; Java_jdk_internal_reflect_Reflection_getClassAccessFlags; Java_jdk_internal_misc_VM_latestUserDefinedLoader0; Java_jdk_internal_misc_VM_getuid; diff --git a/make/mapfiles/libjava/reorder-sparc b/make/mapfiles/libjava/reorder-sparc index 990ca32b6fb..43f1afda6b1 100644 --- a/make/mapfiles/libjava/reorder-sparc +++ b/make/mapfiles/libjava/reorder-sparc @@ -27,7 +27,6 @@ text: .text%Java_java_io_FileDescriptor_initIDs; text: .text%Java_java_io_FileOutputStream_initIDs; text: .text%Java_java_lang_System_setIn0; text: .text%Java_sun_reflect_Reflection_getCallerClass__; -text: .text%Java_sun_reflect_Reflection_getCallerClass__I; text: .text%Java_java_lang_Class_forName0; text: .text%Java_java_lang_Object_getClass; text: .text%Java_sun_reflect_Reflection_getClassAccessFlags; diff --git a/make/mapfiles/libjava/reorder-sparcv9 b/make/mapfiles/libjava/reorder-sparcv9 index 4e3ce84b862..3e480bb7682 100644 --- a/make/mapfiles/libjava/reorder-sparcv9 +++ b/make/mapfiles/libjava/reorder-sparcv9 @@ -26,7 +26,6 @@ text: .text%Java_java_io_FileDescriptor_initIDs; text: .text%Java_java_io_FileOutputStream_initIDs; text: .text%Java_java_lang_System_setIn0; text: .text%Java_sun_reflect_Reflection_getCallerClass__; -text: .text%Java_sun_reflect_Reflection_getCallerClass__I; text: .text%Java_java_lang_Class_forName0; text: .text%Java_java_lang_String_intern; text: .text%Java_java_lang_StringUTF16_isBigEndian; diff --git a/make/mapfiles/libjava/reorder-x86 b/make/mapfiles/libjava/reorder-x86 index de28893a4d2..f294a93c4ba 100644 --- a/make/mapfiles/libjava/reorder-x86 +++ b/make/mapfiles/libjava/reorder-x86 @@ -27,7 +27,6 @@ text: .text%Java_java_io_FileDescriptor_initIDs; text: .text%Java_java_io_FileOutputStream_initIDs; text: .text%Java_java_lang_System_setIn0; text: .text%Java_sun_reflect_Reflection_getCallerClass__; -text: .text%Java_sun_reflect_Reflection_getCallerClass__I; text: .text%Java_java_lang_Class_forName0; text: .text%Java_java_lang_String_intern; text: .text%Java_java_lang_StringUTF16_isBigEndian; diff --git a/make/mapfiles/libnet/mapfile-vers b/make/mapfiles/libnet/mapfile-vers index 6967a4dcfcc..ccf2736e6e2 100644 --- a/make/mapfiles/libnet/mapfile-vers +++ b/make/mapfiles/libnet/mapfile-vers @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -89,6 +89,7 @@ SUNWprivate_1.1 { Java_java_net_PlainDatagramSocketImpl_setTimeToLive; Java_java_net_AbstractPlainSocketImpl_isReusePortAvailable0; Java_java_net_AbstractPlainDatagramSocketImpl_isReusePortAvailable0; + Java_java_net_SocketCleanable_cleanupClose0; Java_jdk_net_Sockets_isReusePortAvailable0; Java_sun_net_PortConfig_getUpper0; Java_sun_net_PortConfig_getLower0; diff --git a/make/test/JtregNativeHotspot.gmk b/make/test/JtregNativeHotspot.gmk index 40df7d1ee42..70f9884eafb 100644 --- a/make/test/JtregNativeHotspot.gmk +++ b/make/test/JtregNativeHotspot.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -44,6 +44,7 @@ $(eval $(call IncludeCustomExtension, test/JtregNativeHotspot.gmk)) # Add more directories here when needed. BUILD_HOTSPOT_JTREG_NATIVE_SRC += \ $(TOPDIR)/test/hotspot/jtreg/gc/g1/TestJNIWeakG1 \ + $(TOPDIR)/test/hotspot/jtreg/gc/stress/TestJNIBlockFullGC \ $(TOPDIR)/test/hotspot/jtreg/gc/stress/gclocker \ $(TOPDIR)/test/hotspot/jtreg/gc/cslocker \ $(TOPDIR)/test/hotspot/jtreg/native_sanity \ @@ -66,7 +67,9 @@ BUILD_HOTSPOT_JTREG_NATIVE_SRC += \ $(TOPDIR)/test/hotspot/jtreg/compiler/calls \ $(TOPDIR)/test/hotspot/jtreg/compiler/runtime/criticalnatives/lookup \ $(TOPDIR)/test/hotspot/jtreg/compiler/runtime/criticalnatives/argumentcorruption \ + $(TOPDIR)/test/hotspot/jtreg/serviceability/jvmti/CanGenerateAllClassHook \ $(TOPDIR)/test/hotspot/jtreg/serviceability/jvmti/GetOwnedMonitorInfo \ + $(TOPDIR)/test/hotspot/jtreg/serviceability/jvmti/GetOwnedMonitorStackDepthInfo \ $(TOPDIR)/test/hotspot/jtreg/serviceability/jvmti/GetNamedModule \ $(TOPDIR)/test/hotspot/jtreg/serviceability/jvmti/IsModifiableModule \ $(TOPDIR)/test/hotspot/jtreg/serviceability/jvmti/AddModuleReads \ @@ -99,7 +102,9 @@ endif ifeq ($(TOOLCHAIN_TYPE), solstudio) BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_liboverflow := -lc BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libSimpleClassFileLoadHook := -lc + BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libCanGenerateAllClassHook := -lc BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libGetOwnedMonitorInfoTest := -lc + BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libGetOwnedMonitorStackDepthInfoTest := -lc BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libGetNamedModuleTest := -lc BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libIsModifiableModuleTest := -lc BUILD_HOTSPOT_JTREG_LIBRARIES_LDFLAGS_libAddModuleReadsTest := -lc diff --git a/src/bsd/doc/man/idlj.1 b/src/bsd/doc/man/idlj.1 deleted file mode 100644 index 936c1c35d85..00000000000 --- a/src/bsd/doc/man/idlj.1 +++ /dev/null @@ -1,567 +0,0 @@ -'\" t -.\" Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. -.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -.\" -.\" This code is free software; you can redistribute it and/or modify it -.\" under the terms of the GNU General Public License version 2 only, as -.\" published by the Free Software Foundation. -.\" -.\" This code is distributed in the hope that it will be useful, but WITHOUT -.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -.\" version 2 for more details (a copy is included in the LICENSE file that -.\" accompanied this code). -.\" -.\" You should have received a copy of the GNU General Public License version -.\" 2 along with this work; if not, write to the Free Software Foundation, -.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -.\" -.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -.\" or visit www.oracle.com if you need additional information or have any -.\" questions. -.\" -.\" Arch: generic -.\" Software: JDK 8 -.\" Date: 21 November 2013 -.\" SectDesc: Java IDL and RMI-IIOP Tools -.\" Title: idlj.1 -.\" -.if n .pl 99999 -.TH idlj 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- - -.SH NAME -idlj \- Generates Java bindings for a specified Interface Definition Language (IDL) file\&. -.SH SYNOPSIS -.sp -.nf - -\fBidlj\fR [ \fIoptions\fR ] \fIidlfile\fR -.fi -.sp -.TP -\fIoptions\fR -The command-line options\&. See Options\&. Options can appear in any order, but must precede the \f3idlfile\fR\&. -.TP -\fIidlfile\fR -The name of a file that contains Interface Definition Language (IDL) definitions\&. -.SH DESCRIPTION -The IDL-to-Java Compiler generates the Java bindings for a specified IDL file\&. For binding details, see Java IDL: IDL to Java Language Mapping at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/mapping/jidlMapping\&.html -.PP -Some earlier releases of the IDL-to-Java compiler were named \f3idltojava\fR\&. -.SS EMIT\ CLIENT\ AND\ SERVER\ BINDINGS -The following \f3idlj\fR command generates an IDL file named \f3My\&.idl\fR with client-side bindings\&. -.sp -.nf -\f3idlj My\&.idl\fP -.fi -.nf -\f3\fR -.fi -.sp -The previous syntax is equivalent to the following: -.sp -.nf -\f3idlj \-fclient My\&.idl\fP -.fi -.nf -\f3\fR -.fi -.sp -The next example generates the server-side bindings, and includes the client-side bindings plus the skeleton, all of which are POA (Inheritance Model)\&. -.sp -.nf -\f3idlg \-fserver My\&.idl\fP -.fi -.nf -\f3\fR -.fi -.sp -If you want to generate both client and server-side bindings, then use one of the following (equivalent) commands: -.sp -.nf -\f3idlj \-fclient \-fserver My\&.idl\fP -.fi -.nf -\f3idlj \-fall My\&.idl\fP -.fi -.nf -\f3\fR -.fi -.sp -There are two possible server-side models: the Portal Servant Inheritance Model and the Tie Model\&. See Tie Delegation Model\&. -.PP -\f3Portable Servant Inheritance Model\fR\&. The default server-side model is the Portable Servant Inheritance Model\&. Given an interface \f3My\fR defined in \f3My\&.idl\fR, the file \f3MyPOA\&.java\fR is generated\&. You must provide the implementation for the \f3My\fR interface, and the \f3My\fR interface must inherit from the \f3MyPOA\fR class\&. \f3MyPOA\&.java\fR is a stream-based skeleton that extends the \f3org\&.omg\&.PortableServer\&.Servant\fR class at http://docs\&.oracle\&.com/javase/8/docs/api/org/omg/PortableServer/Servant\&.html The \f3My\fR interface implements the \f3callHandler\fR interface and the operations interface associated with the IDL interface the skeleton implements\&.The \f3PortableServer\fR module for the Portable Object Adapter (POA) defines the native \f3Servant\fR type\&. See Portable Object Adapter (POA) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/POA\&.html In the Java programming language, the \f3Servant\fR type is mapped to the Java \f3org\&.omg\&.PortableServer\&.Servant\fR class\&. It serves as the base class for all POA servant implementations and provides a number of methods that can be called by the application programmer, and methods that are called by the POA and that can be overridden by the user to control aspects of servant behavior\&.Another option for the Inheritance Model is to use the \f3-oldImplBase\fR flag to generate server-side bindings that are compatible with releases of the Java programming language before Java SE 1\&.4\&. The -\f3oldImplBase\fR flag is nonstandard, and these APIs are deprecated\&. You would use this flag only for compatibility with existing servers written in Java SE 1\&.3\&. In that case, you would need to modify an existing make file to add the \f3-oldImplBase\fR flag to the \f3idlj\fR compiler\&. Otherwise POA-based server-side mappings are generated\&. To generate server-side bindings that are backward compatible, do the following: -.sp -.nf -\f3idlj \-fclient \-fserver \-oldImplBase My\&.idl\fP -.fi -.nf -\f3idlj \-fall \-oldImplBase My\&.idl\fP -.fi -.nf -\f3\fR -.fi -.sp -Given an interface \f3My\fR defined in \f3My\&.idl\fR, the file \f3_MyImplBase\&.java\fR is generated\&. You must provide the implementation for the \f3My\fR interface, and the \f3My\fR interface must inherit from the \f3_MyImplBase\fR class\&. -.PP -\f3Tie Delegation Model\fR\&. The other server-side model is called the Tie Model\&. This is a delegation model\&. Because it is not possible to generate ties and skeletons at the same time, they must be generated separately\&. The following commands generate the bindings for the Tie Model: -.sp -.nf -\f3idlj \-fall My\&.idl\fP -.fi -.nf -\f3idlj \-fallTIE My\&.idl\fP -.fi -.nf -\f3\fR -.fi -.sp -For the \f3My\fR interface, the second command generates \f3MyPOATie\&.java\fR\&. The constructor to the \f3MyPOATie\fR class takes a delegate\&. In this example, using the default POA model, the constructor also needs a POA\&. You must provide the implementation for the delegate, but it does not have to inherit from any other class, only the interface \f3MyOperations\fR\&. To use it with the ORB, you must wrap your implementation within the \f3MyPOATie\fR class, for example: -.sp -.nf -\f3ORB orb = ORB\&.init(args, System\&.getProperties());\fP -.fi -.nf -\f3\fR -.fi -.nf -\f3// Get reference to rootpoa & activate the POAManager\fP -.fi -.nf -\f3POA rootpoa = (POA)orb\&.resolve_initial_references("RootPOA");\fP -.fi -.nf -\f3rootpoa\&.the_POAManager()\&.activate();\fP -.fi -.nf -\f3\fR -.fi -.nf -\f3// create servant and register it with the ORB\fP -.fi -.nf -\f3MyServant myDelegate = new MyServant();\fP -.fi -.nf -\f3myDelegate\&.setORB(orb); \fP -.fi -.nf -\f3\fR -.fi -.nf -\f3// create a tie, with servant being the delegate\&.\fP -.fi -.nf -\f3MyPOATie tie = new MyPOATie(myDelegate, rootpoa);\fP -.fi -.nf -\f3\fR -.fi -.nf -\f3// obtain the objectRef for the tie\fP -.fi -.nf -\f3My ref = tie\&._this(orb);\fP -.fi -.nf -\f3\fR -.fi -.sp -You might want to use the Tie model instead of the typical Inheritance model when your implementation must inherit from some other implementation\&. Java allows any number of interface inheritance, but there is only one slot for class inheritance\&. If you use the inheritance model, then that slot is used up\&. With the Tie Model, that slot is freed up for your own use\&. The drawback is that it introduces a level of indirection: one extra method call occurs when a method is called\&. -.PP -For server-side generation, Tie model bindings that are compatible with versions of the IDL to Java language mapping in versions earlier than Java SE 1\&.4\&. -.sp -.nf -\f3idlj \-oldImplBase \-fall My\&.idl\fP -.fi -.nf -\f3idlj \-oldImplBase \-fallTIE My\&.idl\fP -.fi -.nf -\f3\fR -.fi -.sp -For the \f3My\fR interface, the this generates \f3My_Tie\&.java\fR\&. The constructor to the \f3My_Tie\fR class takes an \f3impl\fR object\&. You must provide the implementation for \f3impl\fR, but it does not have to inherit from any other class, only the interface \f3HelloOperations\fR\&. But to use it with the ORB, you must wrap your implementation within \f3My_Tie\fR, for example: -.sp -.nf -\f3ORB orb = ORB\&.init(args, System\&.getProperties());\fP -.fi -.nf -\f3\fR -.fi -.nf -\f3// create servant and register it with the ORB\fP -.fi -.nf -\f3MyServant myDelegate = new MyServant();\fP -.fi -.nf -\f3myDelegate\&.setORB(orb); \fP -.fi -.nf -\f3\fR -.fi -.nf -\f3// create a tie, with servant being the delegate\&.\fP -.fi -.nf -\f3MyPOATie tie = new MyPOATie(myDelegate);\fP -.fi -.nf -\f3\fR -.fi -.nf -\f3// obtain the objectRef for the tie\fP -.fi -.nf -\f3My ref = tie\&._this(orb);\fP -.fi -.nf -\f3\fR -.fi -.sp -.SS SPECIFY\ ALTERNATE\ LOCATIONS\ FOR\ EMITTED\ FILES -If you want to direct the emitted files to a directory other than the current directory, then call the compiler this way: \f3i\fR\f3dlj -td /altdir My\&.idl\fR\&. -.PP -For the \f3My\fR interface, the bindings are emitted to \f3/altdir/My\&.java\fR, etc\&., instead of \f3\&./My\&.java\fR\&. -.SS SPECIFY\ ALTERNATE\ LOCATIONS\ FOR\ INCLUDE\ FILES -If the \f3My\&.idl\fR file includes another \f3idl\fR file, \f3MyOther\&.idl\fR, then the compiler assumes that the \f3MyOther\&.idl\fR file resides in the local directory\&. If it resides in \f3/includes\fR, for example, then you call the compiler with the following command: -.sp -.nf -\f3idlj \-i /includes My\&.idl\fP -.fi -.nf -\f3\fR -.fi -.sp -If \f3My\&.idl\fR also included \f3Another\&.idl\fR that resided in \f3/moreIncludes\fR, for example, then you call the compiler with the following command: -.sp -.nf -\f3idlj \-i /includes \-i /moreIncludes My\&.idl\fP -.fi -.nf -\f3\fR -.fi -.sp -Because this form of \f3include\fR can become long, another way to indicate to the compiler where to search for included files is provided\&. This technique is similar to the idea of an environment variable\&. Create a file named idl\&.config in a directory that is listed in your \f3CLASSPATH\fR variable\&. Inside of \f3idl\&.config\fR, provide a line with the following form: -.sp -.nf -\f3includes=/includes;/moreIncludes\fP -.fi -.nf -\f3\fR -.fi -.sp -The compiler will find this file and read in the includes list\&. Note that in this example the separator character between the two directories is a semicolon (;)\&. This separator character is platform dependent\&. On the Windows platform, use a semicolon, on the Unix platform, use a colon, and so on\&. -.SS EMIT\ BINDINGS\ FOR\ INCLUDE\ FILES -By default, only those interfaces, structures, and so on, that are defined in the \f3idl\fR file on the command line have Java bindings generated for them\&. The types defined in included files are not generated\&. For example, assume the following two \f3idl\fR files: -.sp -.nf -\f3My\&.idl file:\fP -.fi -.nf -\f3\fR -.fi -.nf -\f3#include \fP -.fi -.nf -\f3interface My\fP -.fi -.nf -\f3{\fP -.fi -.nf -\f3};\fP -.fi -.nf -\f3\fR -.fi -.nf -\f3MyOther\&.idl file:\fP -.fi -.nf -\f3\fR -.fi -.nf -\f3interface MyOther\fP -.fi -.nf -\f3{\fP -.fi -.nf -\f3};\fP -.fi -.nf -\f3\fR -.fi -.sp -There is a caveat to the default rule\&. Any \f3#include\fR statements that appear at the global scope are treated as described\&. These \f3#include\fR statements can be thought of as import statements\&. The \f3#include\fR statements that appear within an enclosed scope are treated as true \f3#include\fR statements, which means that the code within the included file is treated as though it appeared in the original file and, therefore, Java bindings are emitted for it\&. Here is an example: -.sp -.nf -\f3My\&.idl file:\fP -.fi -.nf -\f3\fR -.fi -.nf -\f3#include \fP -.fi -.nf -\f3interface My\fP -.fi -.nf -\f3{\fP -.fi -.nf -\f3 #include \fP -.fi -.nf -\f3};\fP -.fi -.nf -\f3\fR -.fi -.nf -\f3MyOther\&.idl file:\fP -.fi -.nf -\f3\fR -.fi -.nf -\f3interface MyOther\fP -.fi -.nf -\f3{\fP -.fi -.nf -\f3};\fP -.fi -.nf -\f3\fR -.fi -.nf -\f3Embedded\&.idl\fP -.fi -.nf -\f3\fR -.fi -.nf -\f3enum E {one, two, three};\fP -.fi -.nf -\f3\fR -.fi -.sp -Run\f3idlj My\&.idl\fRto generate the following list of Java files\&. Notice that \f3MyOther\&.java\fR is not generated because it is defined in an import-like \f3#include\fR\&. But \f3E\&.java\fR was generated because it was defined in a true \f3#include\fR\&. Notice that because the \f3Embedded\&.idl\fR file is included within the scope of the interface \f3My\fR, it appears within the scope of \f3My\fR (in \f3MyPackage\fR)\&. If the \f3-emitAll\fR flag had been used, then all types in all included files would have been emitted\&. -.sp -.nf -\f3\&./MyHolder\&.java\fP -.fi -.nf -\f3\&./MyHelper\&.java\fP -.fi -.nf -\f3\&./_MyStub\&.java\fP -.fi -.nf -\f3\&./MyPackage\fP -.fi -.nf -\f3\&./MyPackage/EHolder\&.java\fP -.fi -.nf -\f3\&./MyPackage/EHelper\&.java\fP -.fi -.nf -\f3\&./MyPackage/E\&.java\fP -.fi -.nf -\f3\&./My\&.java\fP -.fi -.nf -\f3\fR -.fi -.sp -.SS INSERT\ PACKAGE\ PREFIXES -Suppose that you work for a company named ABC that has constructed the following IDL file: -.sp -.nf -\f3Widgets\&.idl file:\fP -.fi -.nf -\f3\fR -.fi -.nf -\f3module Widgets\fP -.fi -.nf -\f3{\fP -.fi -.nf -\f3 interface W1 {\&.\&.\&.};\fP -.fi -.nf -\f3 interface W2 {\&.\&.\&.};\fP -.fi -.nf -\f3};\fP -.fi -.nf -\f3\fR -.fi -.sp -If you run this file through the IDL-to-Java compiler, then the Java bindings for W1 and W2 are placed within the \f3Widgets\fR package\&. There is an industry convention that states that a company\&'s packages should reside within a package named \f3com\&.\fR\&. To follow this convention, the package name should be \f3com\&.abc\&.Widgets\fR\&. To place this package prefix onto the Widgets module, execute the following: -.sp -.nf -\f3idlj \-pkgPrefix Widgets com\&.abc Widgets\&.idl\fP -.fi -.nf -\f3\fR -.fi -.sp -If you have an IDL file that includes Widgets\&.idl, then the \f3-pkgPrefix\fR flag must appear in that command also\&. If it does not, then your IDL file will be looking for a \f3Widgets\fR package rather than a \f3com\&.abc\&.Widgets\fR package\&. -.PP -If you have a number of these packages that require prefixes, then it might be easier to place them into the idl\&.config file described previously\&. Each package prefix line should be of the form: \f3PkgPrefix\&.=\fR\&. The line for the previous example would be \f3PkgPrefix\&.Widgets=com\&.abc\fR\&. This option does not affect the Repository ID\&. -.SS DEFINE\ SYMBOLS\ BEFORE\ COMPILATION -You might need to define a symbol for compilation that is not defined within the IDL file, perhaps to include debugging code in the bindings\&. The command \f3idlj -d MYDEF My\&.idl\fRis equivalent to putting the line \f3#define MYDEF\fR inside My\&.idl\&. -.SS PRESERVE\ PREEXISTING\ BINDINGS -If the Java binding files already exist, then the \f3-keep\fR flag keeps the compiler from overwriting them\&. The default is to generate all files without considering that they already exist\&. If you have customized those files (which you should not do unless you are very comfortable with their contents), then the \f3-keep\fR option is very useful\&. The command \f3idlj -keep My\&.idl\fR emits all client-side bindings that do not already exist\&. -.SS VIEW\ COMPILATION\ PROGRESS -The IDL-to-Java compiler generates status messages as it progresses through its phases of execution\&. Use the \f3-v\fR option to activate the verbose mode: \f3idlj -v My\&.idl\fR\&. -.PP -By default the compiler does not operate in verbose mode -.SS DISPLAY\ VERSION\ INFORMATION -To display the build version of the IDL-to-Java compiler, specify the \f3-version\fR option on the command-line: \f3idlj -version\fR\&. -.PP -Version information also appears within the bindings generated by the compiler\&. Any additional options appearing on the command-line are ignored\&. -.SH OPTIONS -.TP --d \fIsymbol\fR -.br -This is equivalent to the following line in an IDL file: -.sp -.nf -\f3#define \fIsymbol\fR\fP -.fi -.nf -\f3\fR -.fi -.sp - -.TP --demitAll -.br -Emit all types, including those found in \f3#include\fR files\&. -.TP --fside -.br -Defines what bindings to emit\&. The \f3side\fR parameter can be \f3client\fR, \f3server\fR, \f3serverTIE\fR, \f3all\fR, or \f3allTIE\fR\&. The \f3-fserverTIE\fR and \f3-fallTIE\fR options cause delegate model skeletons to be emitted\&. Defaults to \f3-fclient\fR when the flag is not specified\&. -.TP --i \fIinclude-path\fR -.br -By default, the current directory is scanned for included files\&. This option adds another directory\&. -.TP --i \fIkeep\fR -.br -If a file to be generated already exists, then do not overwrite it\&. By default it is overwritten\&. -.TP --noWarn -.br -Suppress warning messages\&. -.TP --oldImplBase -.br -Generates skeletons compatible with pre-1\&.4 JDK ORBs\&. By default, the POA Inheritance Model server-side bindings are generated\&. This option provides backward-compatibility with earlier releases of the Java programming language by generating server-side bindings that are \f3ImplBase\fR Inheritance Model classes\&. -.TP --pkgPrefix \fItype\fR\fIprefix\fR -.br -Wherever \f3type\fR is encountered at file scope, prefix the generated Java package name with \f3prefix\fR for all files generated for that type\&. The type is the simple name of either a top-level module, or an IDL type defined outside of any module\&. -.TP --pkgTranslate \fItype\fR\fIpackage\fR -.br -Whenever the module name type is encountered in an identifier, replace it in the identifier with package for all files in the generated Java package\&. Note that \f3pkgPrefix\fR changes are made first\&. The type value is the simple name of either a top-level module, or an IDL type defined outside of any module and must match the full package name exactly\&. - -If more than one translation matches an identifier, then the longest match is chosen as shown in the following example: - -\fICommand\fR: -.sp -.nf -\f3pkgTranslate type pkg \-pkgTranslate type2\&.baz pkg2\&.fizz\fP -.fi -.nf -\f3\fR -.fi -.sp - - -\fIResulting Translation\fR: -.sp -.nf -\f3type => pkg\fP -.fi -.nf -\f3type\&.ext => pkg\&.ext\fP -.fi -.nf -\f3type\&.baz => pkg2\&.fizz\fP -.fi -.nf -\f3type2\&.baz\&.pkg => pkg2\&.fizz\&.pkg\fP -.fi -.nf -\f3\fR -.fi -.sp - - -The following package names \f3org\fR, \f3org\fR\&.o\f3mg\fR, or any subpackages of \f3org\&.omg\fR cannot be translated\&. Any attempt to translate these packages results in uncompilable code, and the use of these packages as the first argument after \f3-pkgTranslate\fR is treated as an error\&. -.TP --skeletonName \fIxxx%yyy\fR -.br -Use \f3xxx%yyy\fR as the pattern for naming the skeleton\&. The defaults are: \f3%POA\fR for the \f3POA\fR base class (\f3-fserver\fR or \f3-fall\fR), and \f3_%ImplBase\fR for the \f3oldImplBase\fR class (-\f3oldImplBase\fR) and (\f3-fserver\fR or \f3-fall\fR))\&. -.TP --td \fIdir\fR -.br -Use \fIdir\fR for the output directory instead of the current directory\&. -.TP --tieName \fIxxx%yyy\fR -.br -Use \f3xxx%yyy\fR according to the pattern\&. The defaults are: \f3%POA\fR for the \f3POA\fR base class (\f3-fserverTie or -fallTie\fR), and \f3_%Tie\fR for the \f3oldImplBase\fR tie class (-\f3oldImplBase\fR) and (\f3-fserverTie\fR or \f3-fallTie\fR)) -.TP --nowarn, -verbose -.br -Displays release information and terminates\&. -.TP --version -.br -Displays release information and terminates\&. -.SH RESTRICTIONS -Escaped identifiers in the global scope cannot have the same spelling as IDL primitive types, \f3Object\fR, or \f3ValueBase\fR\&. This is because the symbol table is preloaded with these identifiers\&. Allowing them to be redefined would overwrite their original definitions\&. Possible permanent restriction\&. -.PP -The \f3fixed\fR IDL type is not supported\&. -.SH KNOWN\ PROBLEMS -No import is generated for global identifiers\&. If you call an unexported local \f3impl\fR object, then you do get an exception, but it seems to be due to a \f3NullPointerException\fR in the \f3ServerDelegate\fR DSI code\&. -.RE -.br -'pl 8.5i -'bp diff --git a/src/bsd/doc/man/ja/idlj.1 b/src/bsd/doc/man/ja/idlj.1 deleted file mode 100644 index 3062fdcfc59..00000000000 --- a/src/bsd/doc/man/ja/idlj.1 +++ /dev/null @@ -1,24 +0,0 @@ -." Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. -." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -." -." This code is free software; you can redistribute it and/or modify it -." under the terms of the GNU General Public License version 2 only, as -." published by the Free Software Foundation. -." -." This code is distributed in the hope that it will be useful, but WITHOUT -." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -." version 2 for more details (a copy is included in the LICENSE file that -." accompanied this code). -." -." You should have received a copy of the GNU General Public License version -." 2 along with this work; if not, write to the Free Software Foundation, -." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -." -." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -." or visit www.oracle.com if you need additional information or have any -." questions. -." -.TH idlj 1 "07 May 2011" - -.LP diff --git a/src/bsd/doc/man/ja/orbd.1 b/src/bsd/doc/man/ja/orbd.1 deleted file mode 100644 index 0e48344c1b5..00000000000 --- a/src/bsd/doc/man/ja/orbd.1 +++ /dev/null @@ -1,24 +0,0 @@ -." Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. -." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -." -." This code is free software; you can redistribute it and/or modify it -." under the terms of the GNU General Public License version 2 only, as -." published by the Free Software Foundation. -." -." This code is distributed in the hope that it will be useful, but WITHOUT -." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -." version 2 for more details (a copy is included in the LICENSE file that -." accompanied this code). -." -." You should have received a copy of the GNU General Public License version -." 2 along with this work; if not, write to the Free Software Foundation, -." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -." -." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -." or visit www.oracle.com if you need additional information or have any -." questions. -." -.TH orbd 1 "07 May 2011" - -.LP diff --git a/src/bsd/doc/man/ja/schemagen.1 b/src/bsd/doc/man/ja/schemagen.1 deleted file mode 100644 index 15699200bce..00000000000 --- a/src/bsd/doc/man/ja/schemagen.1 +++ /dev/null @@ -1,24 +0,0 @@ -." Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. -." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -." -." This code is free software; you can redistribute it and/or modify it -." under the terms of the GNU General Public License version 2 only, as -." published by the Free Software Foundation. -." -." This code is distributed in the hope that it will be useful, but WITHOUT -." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -." version 2 for more details (a copy is included in the LICENSE file that -." accompanied this code). -." -." You should have received a copy of the GNU General Public License version -." 2 along with this work; if not, write to the Free Software Foundation, -." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -." -." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -." or visit www.oracle.com if you need additional information or have any -." questions. -." -.TH schemagen 1 "07 May 2011" - -.LP diff --git a/src/bsd/doc/man/ja/servertool.1 b/src/bsd/doc/man/ja/servertool.1 deleted file mode 100644 index a1b5d5696b2..00000000000 --- a/src/bsd/doc/man/ja/servertool.1 +++ /dev/null @@ -1,24 +0,0 @@ -." Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. -." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -." -." This code is free software; you can redistribute it and/or modify it -." under the terms of the GNU General Public License version 2 only, as -." published by the Free Software Foundation. -." -." This code is distributed in the hope that it will be useful, but WITHOUT -." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -." version 2 for more details (a copy is included in the LICENSE file that -." accompanied this code). -." -." You should have received a copy of the GNU General Public License version -." 2 along with this work; if not, write to the Free Software Foundation, -." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -." -." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -." or visit www.oracle.com if you need additional information or have any -." questions. -." -.TH servertool 1 "07 May 2011" - -.LP diff --git a/src/bsd/doc/man/ja/tnameserv.1 b/src/bsd/doc/man/ja/tnameserv.1 deleted file mode 100644 index 0ab477f10eb..00000000000 --- a/src/bsd/doc/man/ja/tnameserv.1 +++ /dev/null @@ -1,24 +0,0 @@ -." Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. -." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -." -." This code is free software; you can redistribute it and/or modify it -." under the terms of the GNU General Public License version 2 only, as -." published by the Free Software Foundation. -." -." This code is distributed in the hope that it will be useful, but WITHOUT -." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -." version 2 for more details (a copy is included in the LICENSE file that -." accompanied this code). -." -." You should have received a copy of the GNU General Public License version -." 2 along with this work; if not, write to the Free Software Foundation, -." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -." -." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -." or visit www.oracle.com if you need additional information or have any -." questions. -." -.TH tnameserv 1 "07 May 2011" - -.LP diff --git a/src/bsd/doc/man/ja/wsgen.1 b/src/bsd/doc/man/ja/wsgen.1 deleted file mode 100644 index f109f42c9f7..00000000000 --- a/src/bsd/doc/man/ja/wsgen.1 +++ /dev/null @@ -1,22 +0,0 @@ -." Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. -." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -." -." This code is free software; you can redistribute it and/or modify it -." under the terms of the GNU General Public License version 2 only, as -." published by the Free Software Foundation. -." -." This code is distributed in the hope that it will be useful, but WITHOUT -." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -." version 2 for more details (a copy is included in the LICENSE file that -." accompanied this code). -." -." You should have received a copy of the GNU General Public License version -." 2 along with this work; if not, write to the Free Software Foundation, -." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -." -." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -." or visit www.oracle.com if you need additional information or have any -." questions. -." -.TH wsgen 1 "07 May 2011" diff --git a/src/bsd/doc/man/ja/wsimport.1 b/src/bsd/doc/man/ja/wsimport.1 deleted file mode 100644 index 5e4ecba0f34..00000000000 --- a/src/bsd/doc/man/ja/wsimport.1 +++ /dev/null @@ -1,22 +0,0 @@ -." Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. -." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -." -." This code is free software; you can redistribute it and/or modify it -." under the terms of the GNU General Public License version 2 only, as -." published by the Free Software Foundation. -." -." This code is distributed in the hope that it will be useful, but WITHOUT -." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -." version 2 for more details (a copy is included in the LICENSE file that -." accompanied this code). -." -." You should have received a copy of the GNU General Public License version -." 2 along with this work; if not, write to the Free Software Foundation, -." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -." -." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -." or visit www.oracle.com if you need additional information or have any -." questions. -." -.TH wsimport 1 "07 May 2011" diff --git a/src/bsd/doc/man/ja/xjc.1 b/src/bsd/doc/man/ja/xjc.1 deleted file mode 100644 index 53b61d57ea5..00000000000 --- a/src/bsd/doc/man/ja/xjc.1 +++ /dev/null @@ -1,25 +0,0 @@ -." Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. -." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -." -." This code is free software; you can redistribute it and/or modify it -." under the terms of the GNU General Public License version 2 only, as -." published by the Free Software Foundation. -." -." This code is distributed in the hope that it will be useful, but WITHOUT -." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -." version 2 for more details (a copy is included in the LICENSE file that -." accompanied this code). -." -." You should have received a copy of the GNU General Public License version -." 2 along with this work; if not, write to the Free Software Foundation, -." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -." -." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -." or visit www.oracle.com if you need additional information or have any -." questions. -." -.TH xjc 1 "07 May 2011" - -.LP -.ad c diff --git a/src/bsd/doc/man/orbd.1 b/src/bsd/doc/man/orbd.1 deleted file mode 100644 index f4478eca1fe..00000000000 --- a/src/bsd/doc/man/orbd.1 +++ /dev/null @@ -1,213 +0,0 @@ -'\" t -.\" Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. -.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -.\" -.\" This code is free software; you can redistribute it and/or modify it -.\" under the terms of the GNU General Public License version 2 only, as -.\" published by the Free Software Foundation. -.\" -.\" This code is distributed in the hope that it will be useful, but WITHOUT -.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -.\" version 2 for more details (a copy is included in the LICENSE file that -.\" accompanied this code). -.\" -.\" You should have received a copy of the GNU General Public License version -.\" 2 along with this work; if not, write to the Free Software Foundation, -.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -.\" -.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -.\" or visit www.oracle.com if you need additional information or have any -.\" questions. -.\" -.\" Arch: generic -.\" Software: JDK 8 -.\" Date: 21 November 2013 -.\" SectDesc: Java IDL and RMI-IIOP Tools -.\" Title: orbd.1 -.\" -.if n .pl 99999 -.TH orbd 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- - -.SH NAME -orbd \- Enables clients to locate and call persistent objects on servers in the CORBA environment\&. -.SH SYNOPSIS -.sp -.nf - -\fBorbd\fR [ \fIoptions\fR ] -.fi -.sp -.TP -\fIoptions\fR -Command-line options\&. See Options\&. -.SH DESCRIPTION -The \f3orbd\fR command enables clients to transparently locate and call persistent objects on servers in the CORBA environment\&. The Server Manager included with the orbd tool is used to enable clients to transparently locate and call persistent objects on servers in the CORBA environment\&. The persistent servers, while publishing the persistent object references in the naming service, include the port number of the ORBD in the object reference instead of the port number of the server\&. The inclusion of an ORBD port number in the object reference for persistent object references has the following advantages: -.TP 0.2i -\(bu -The object reference in the naming service remains independent of the server life cycle\&. For example, the object reference could be published by the server in the Naming Service when it is first installed, and then, independent of how many times the server is started or shut down, the ORBD returns the correct object reference to the calling client\&. -.TP 0.2i -\(bu -The client needs to look up the object reference in the naming service only once, and can keep reusing this reference independent of the changes introduced due to server life cycle\&. -.PP -To access the ORBD Server Manager, the server must be started using \f3servertool\fR, which is a command-line interface for application programmers to register, unregister, start up, and shut down a persistent server\&. For more information on the Server Manager, see Server Manager\&. -.PP -When \f3orbd\fR starts, it also starts a naming service\&. For more information about the naming service\&. See Start and Stop the Naming Service\&. -.SH OPTIONS -.TP --ORBInitialPort \fInameserverport\fR -.br -Required\&. Specifies the port on which the name server should be started\&. After it is started, \f3orbd\fR listens for incoming requests on this port\&. On Oracle Solaris software, you must become the root user to start a process on a port below 1024\&. For this reason, Oracle recommends that you use a port number above or equal to 1024\&. -.SS NONREQUIRED\ OPTIONS -.TP --port \fIport\fR -.br -Specifies the activation port where ORBD should be started, and where ORBD will be accepting requests for persistent objects\&. The default value for this port is 1049\&. This port number is added to the port field of the persistent Interoperable Object References (IOR)\&. -.TP --defaultdb \fIdirectory\fR -.br -Specifies the base where the ORBD persistent storage directory, \f3orb\&.db\fR, is created\&. If this option is not specified, then the default value is \f3\&./orb\&.db\fR\&. -.TP --serverPollingTime \fImilliseconds\fR -.br -Specifies how often ORBD checks for the health of persistent servers registered through \f3servertool\fR\&. The default value is 1000 ms\&. The value specified for \f3milliseconds\fR must be a valid positive integer\&. -.TP --serverStartupDelay milliseconds -.br -Specifies how long ORBD waits before sending a location forward exception after a persistent server that is registered through \f3servertool\fR is restarted\&. The default value is 1000 ms\&. The value specified for \f3milliseconds\fR must be a valid positive integer\&. -.TP --J\fIoption\fR -.br -Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&. -.SS START\ AND\ STOP\ THE\ NAMING\ SERVICE -A naming service is a CORBA service that allows CORBA objects to be named by means of binding a name to an object reference\&. The name binding can be stored in the naming service, and a client can supply the name to obtain the desired object reference\&. -.PP -Before running a client or a server, you will start ORBD\&. ORBD includes a persistent naming service and a transient naming service, both of which are an implementation of the COS Naming Service\&. -.PP -The Persistent Naming Service provides persistence for naming contexts\&. This means that this information is persistent across service shutdowns and startups, and is recoverable in the event of a service failure\&. If ORBD is restarted, then the Persistent Naming Service restores the naming context graph, so that the binding of all clients\&' and servers\&' names remains intact (persistent)\&. -.PP -For backward compatibility, \f3tnameserv\fR, a Transient Naming Service that shipped with earlier releases of the JDK, is also included in this release of Java SE\&. A transient naming service retains naming contexts as long as it is running\&. If there is a service interruption, then the naming context graph is lost\&. -.PP -The \f3-ORBInitialPort\fR argument is a required command-line argument for \f3orbd\fR, and is used to set the port number on which the naming service runs\&. The following instructions assume you can use port 1050 for the Java IDL Object Request Broker Daemon\&. When using Oracle Solaris software, you must become a root user to start a process on a port lower than 1024\&. For this reason, it is recommended that you use a port number above or equal to 1024\&. You can substitute a different port when necessary\&. -.PP -To start \f3orbd\fR from a UNIX command shell, enter: -.sp -.nf -\f3orbd \-ORBInitialPort 1050&\fP -.fi -.nf -\f3\fP -.fi -.sp -From an MS-DOS system prompt (Windows), enter: -.sp -.nf -\f3start orbd \-ORBInitialPort 1050\fP -.fi -.nf -\f3\fP -.fi -.sp -Now that ORBD is running, you can run your server and client applications\&. When running the client and server applications, they must be made aware of the port number (and machine name, when applicable) where the Naming Service is running\&. One way to do this is to add the following code to your application: -.sp -.nf -\f3Properties props = new Properties();\fP -.fi -.nf -\f3props\&.put("org\&.omg\&.CORBA\&.ORBInitialPort", "1050");\fP -.fi -.nf -\f3props\&.put("org\&.omg\&.CORBA\&.ORBInitialHost", "MyHost");\fP -.fi -.nf -\f3ORB orb = ORB\&.init(args, props);\fP -.fi -.nf -\f3\fP -.fi -.sp -In this example, the naming service is running on port 1050 on host \f3MyHost\fR\&. Another way is to specify the port number and/or machine name when running the server or client application from the command line\&. For example, you would start your \f3HelloApplication\fR with the following command line: -.sp -.nf -\f3java HelloApplication \-ORBInitialPort 1050 \-ORBInitialHost MyHost\fP -.fi -.nf -\f3\fP -.fi -.sp -To stop the naming service, use the relevant operating system command, such as \f3pkill\fR\f3orbd\fR on Oracle Solaris, or \fICtrl+C\fR in the DOS window in which \f3orbd\fR is running\&. Note that names registered with the naming service can disappear when the service is terminated because of a transient naming service\&. The Java IDL naming service will run until it is explicitly stopped\&. -.PP -For more information about the naming service included with ORBD, see Naming Service at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.html -.SH SERVER\ MANAGER -To access the ORBD Server Manager and run a persistent server, the server must be started with \f3servertool\fR, which is a command-line interface for application programmers to register, unregister, start up, and shut down a persistent server\&. When a server is started using \f3servertool\fR, it must be started on the same host and port on which \f3orbd\fR is executing\&. If the server is run on a different port, then the information stored in the database for local contexts will be invalid and the service will not work properly\&. -.PP -See Java IDL: The "Hello World" Example at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlExample\&.html -.PP -In this example, you run the \f3idlj\fR compiler and \f3javac\fR compiler as shown in the tutorial\&. To run the ORBD Server Manager, follow these steps for running the application: -.PP -Start \f3orbd\fR\&. -.PP -UNIX command shell, enter: \f3orbd -ORBInitialPort 1050\fR\&. -.PP -MS-DOS system prompt (Windows), enter: \f3s\fR\f3tart orbd -ORBInitialPort 105\fR\f30\fR\&. -.PP -Port 1050 is the port on which you want the name server to run\&. The \f3-ORBInitialPort\fR option is a required command-line argument\&. When using Oracle Solaris software, you must become a root user to start a process on a port below 1024\&. For this reason, it is recommended that you use a port number above or equal to 1024\&. -.PP -Start the \f3servertool\fR: \f3servertool -ORBInitialPort 1050\fR\&. -.PP -Make sure the name server (\f3orbd\fR) port is the same as in the previous step, for example, \f3-ORBInitialPort 1050\&.\fR The \f3servertool\fR must be started on the same port as the name server\&. -.PP -In the \f3servertool\fR command line interface, start the \f3Hello\fR server from the \f3servertool\fR prompt: -.sp -.nf -\f3servertool > register \-server HelloServer \-classpath \&. \-applicationName\fP -.fi -.nf -\f3 HelloServerApName\fP -.fi -.nf -\f3\fP -.fi -.sp -The \f3servertool\fR registers the server, assigns it the name \f3HelloServerApName\fR, and displays its server ID with a listing of all registered servers\&.Run the client application from another terminal window or prompt: -.sp -.nf -\f3java HelloClient \-ORBInitialPort 1050 \-ORBInitialHost localhost\fP -.fi -.nf -\f3\fP -.fi -.sp -For this example, you can omit \f3-ORBInitialHost localhost\fR because the name server is running on the same host as the \f3Hello\fR client\&. If the name server is running on a different host, then use the -\f3ORBInitialHost nameserverhost\fR option to specify the host on which the IDL name server is running\&.Specify the name server (\f3orbd\fR) port as done in the previous step, for example, \f3-ORBInitialPort 1050\fR\&. When you finish experimenting with the ORBD Server Manager, be sure to shut down or terminate the name server (\f3orbd\fR) and \f3servertool\fR\&. To shut down \f3orbd\fR from am MS-DOS prompt, select the window that is running the server and enter \fICtrl+C\fR to shut it down\&. -.PP -To shut down \f3orbd\fR from an Oracle Solaris shell, find the process, and terminate with the \f3kill\fR command\&. The server continues to wait for invocations until it is explicitly stopped\&. To shut down the \f3servertool\fR, type \fIquit\fR and press the \fIEnter\fR key\&. -.SH SEE\ ALSO -.TP 0.2i -\(bu -servertool(1) -.TP 0.2i -\(bu -Naming Service at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.html -.RE -.br -'pl 8.5i -'bp diff --git a/src/bsd/doc/man/schemagen.1 b/src/bsd/doc/man/schemagen.1 deleted file mode 100644 index 031f4debb42..00000000000 --- a/src/bsd/doc/man/schemagen.1 +++ /dev/null @@ -1,121 +0,0 @@ -'\" t -.\" Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. -.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -.\" -.\" This code is free software; you can redistribute it and/or modify it -.\" under the terms of the GNU General Public License version 2 only, as -.\" published by the Free Software Foundation. -.\" -.\" This code is distributed in the hope that it will be useful, but WITHOUT -.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -.\" version 2 for more details (a copy is included in the LICENSE file that -.\" accompanied this code). -.\" -.\" You should have received a copy of the GNU General Public License version -.\" 2 along with this work; if not, write to the Free Software Foundation, -.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -.\" -.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -.\" or visit www.oracle.com if you need additional information or have any -.\" questions. -.\" -.\" Arch: generic -.\" Software: JDK 8 -.\" Date: 21 November 2013 -.\" SectDesc: Java Web Services Tools -.\" Title: schemagen.1 -.\" -.if n .pl 99999 -.TH schemagen 1 "21 November 2013" "JDK 8" "Java Web Services Tools" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- - -.SH NAME -schemagen \- Generates a schema for every name space that is referenced in your Java classes\&. -.SH SYNOPSIS -.sp -.nf - -\fBschemagen\fR [ \fIoptions\fR ] \fIjava\-files\fR -.fi -.sp -.TP -\fIoptions\fR -The command-line options\&. See Options\&. -.TP -\fIjava-files\fR -The Java class files to be processed\&. -.SH DESCRIPTION -The schema generator creates a schema file for each name space referenced in your Java classes\&. Currently, you cannot control the name of the generated schema files\&. To control the schema file names, see Using SchemaGen with Ant at http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/schemagenTask\&.html -.PP -Start the schema generator with the appropriate \f3schemagen\fR shell script in the bin directory for your platform\&. The current schema generator can process either Java source files or class files\&. -.sp -.nf -\f3schemagen\&.sh Foo\&.java Bar\&.java \&.\&.\&.\fP -.fi -.nf -\f3Note: Writing schema1\&.xsd\fP -.fi -.nf -\f3\fP -.fi -.sp -If your java files reference other classes, then those classes must be accessible on your system \f3CLASSPATH\fR environment variable, or they need to be specified in the \f3schemagen\fR command line with the class path options\&. See Options\&. If the referenced files are not accessible or specified, then you get errors when you generate the schema\&. -.SH OPTIONS -.TP --d \fIpath\fR -.br -The location where the \f3schemagen\fR command places processor-generated and \f3javac\fR-generated class files\&. -.TP --cp \fIpath\fR -.br -The location where the \f3schemagen\fR command places user-specified files\&. -.TP --classpath \fIpath\fR -.br -The location where the \f3schemagen\fR command places user-specified files\&. -.TP --encoding \fIencoding\fR -.br -Specifies the encoding to use for \f3apt\fR or \f3javac\fR command invocations\&. -.TP --episode \fIfile\fR -.br -Generates an episode file for separate compilation\&. -.TP --version -.br -Displays release information\&. -.TP --help -.br -Displays a help message\&. -.SH SEE\ ALSO -.TP 0.2i -\(bu -Using SchemaGen with Ant at http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/schemagenTask\&.html -.TP 0.2i -\(bu -Java Architecture for XML Binding (JAXB) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/xml/jaxb/index\&.html -.RE -.br -'pl 8.5i -'bp diff --git a/src/bsd/doc/man/servertool.1 b/src/bsd/doc/man/servertool.1 deleted file mode 100644 index 3204a2e2cc8..00000000000 --- a/src/bsd/doc/man/servertool.1 +++ /dev/null @@ -1,137 +0,0 @@ -'\" t -.\" Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. -.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -.\" -.\" This code is free software; you can redistribute it and/or modify it -.\" under the terms of the GNU General Public License version 2 only, as -.\" published by the Free Software Foundation. -.\" -.\" This code is distributed in the hope that it will be useful, but WITHOUT -.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -.\" version 2 for more details (a copy is included in the LICENSE file that -.\" accompanied this code). -.\" -.\" You should have received a copy of the GNU General Public License version -.\" 2 along with this work; if not, write to the Free Software Foundation, -.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -.\" -.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -.\" or visit www.oracle.com if you need additional information or have any -.\" questions. -.\" -.\" Arch: generic -.\" Software: JDK 8 -.\" Date: 21 November 2013 -.\" SectDesc: Java IDL and RMI-IIOP Tools -.\" Title: servertool.1 -.\" -.if n .pl 99999 -.TH servertool 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- - -.SH NAME -servertool \- Provides an easy-to-use interface for developers to register, unregister, start up, and shut down a persistent server\&. -.SH SYNOPSIS -.sp -.nf - -\fBservertool\fR \-ORBInitialPort \fInameserverport\fR [ \fIoptions\fR ] [ \fIcommands \fR] -.fi -.sp -.TP -\fIoptions\fR -The command-line options\&. See Options\&. -.TP -commands -The command-line commands\&. See Commands\&. -.SH DESCRIPTION -The \f3servertool\fR command provides the command-line interface for developers to register, unregister, start up, and shut down a persistent server\&. Command-line commands let you obtain various statistical information about the server\&. See Commands\&. -.SH OPTIONS -.TP --ORBInitialHost \fInameserverhost\fR -.br -This options is required\&. It specifies the host machine on which the name server runs and listens for incoming requests\&. The \f3nameserverhost\fR value must specify the port on which the \f3orb\fR is running and listening for requests\&. The value defaults to \f3localhost\fR when this option is not specified\&. If \f3orbd\fR and \f3servertool\fR are running on different machines, then you must specify the name or IP address of the host on which \f3orbd\fR is running\&. - -\fINote:\fR On Oracle Solaris, you must become a root user to start a process on a port below 1024\&. Oracle recommends that you use a port number above or equal to 1024 for the \f3nameserverport\fR value\&. -.TP --J\fIoption\fR -.br -Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&. -.SH COMMANDS -You can start the \f3servertool\fR command with or without a command-line command\&. -.TP 0.2i -\(bu -If you did not specify a command when you started \f3servertool\fR, then the command-line tool displays the \f3servertool\fR prompt where you can enter commands: \f3servertool >\fR\&. -.TP 0.2i -\(bu -If you specify a command when you start \f3servertool\fR, then the Java IDL Server Tool starts, executes the command, and exits\&. -.TP -.ll 180 -register -server \fIserver-class-name\fR -classpath \fIclasspath-to-server\fR [ -applicationName \fIapplication-name\fR -args \fIargs-to-server\fR -vmargs \fIflags-for-JVM\fR ] -Registers a new persistent server with the Object Request Broker Daemon (ORBD)\&. If the server is not already registered, then it is registered and activated\&. This command causes an installation method to be called in the \f3main\fR class of the server identified by the \f3-server\fR option\&. The installation method must be \f3public static void install(org\&.omg\&.CORBA\&.ORB)\fR\&. The install method is optional and lets developers provide their own server installation behavior, such as creating a database schema\&. -.TP -.ll 180 -unregister -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR -Unregisters a server from the ORBD with either its server ID or its application name\&. This command causes an uninstallation method to be called in the \f3main\fR class of the server identified by the \f3-server\fR option\&. The \f3uninstall\fR method must be \f3public static void uninstall(org\&.omg\&.CORBA\&.ORB)\fR\&. The \f3uninstall\fR method is optional and lets developers provide their own server uninstallation behavior, such as undoing the behavior of the \f3install\fR method\&. -.TP -getserverid -applicationName \fIapplication-name\fR -Returns the server ID that corresponds to the \f3application-name\fR value\&. -.TP -list -Lists information about all persistent servers registered with the ORBD\&. -.TP -listappnames -Lists the application names for all servers currently registered with the ORBD\&. -.TP -listactive -Lists information about all persistent servers that were started by the ORBD and are currently running\&. -.TP -.ll 180 -locate -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR [ -endpointType \fIendpointType\fR ] -Locates the endpoints (ports) of a specific type for all ORBs created by a registered server\&. If a server is not already running, then it is activated\&. If an \f3endpointType\fR value is not specified, then the plain/non-protected endpoint associated with each ORB in a server is returned\&. -.TP -.ll 180 -locateperorb -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR [ -orbid \fIORB-name\fR ] -Locates all the endpoints (ports) registered by a specific Object Request Broker (ORB) of registered server\&. If a server is not already running, then it is activated\&. If an \f3orbid\fR is not specified, then the default value of \f3""\fR is assigned to the \f3orbid\fR\&. If any ORBs are created with an \f3orbid\fR of empty string, then all ports registered by it are returned\&. -.TP -orblist -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR -Lists the \f3ORBId\fR of the ORBs defined on a server\&. An \f3ORBId\fR is the string name for the ORB created by the server\&. If the server is not already running, then it is activated\&. -.TP -shutdown -serverid \fIserver-id\fR | -applicationName application-name -Shut down an active server that is registered with ORBD\&. During execution of this command, the \f3shutdown\fR method defined in the class specified by either the \f3-serverid\fR or \f3-applicationName\fR parameter is also called to shut down the server process\&. -.TP -startup -serverid \fIserver-id\fR | -applicationName application-name -Starts up or activate a server that is registered with ORBD\&. If the server is not running, then this command starts the server\&. If the server is already running, then an error message is displayed\&. -.TP -help -Lists all the commands available to the server through the \f3servertool\fR command\&. -.TP -quit -Exits the \f3servertool\fR command\&. -.SH SEE\ ALSO -.TP 0.2i -\(bu -orbd(1) -.RE -.br -'pl 8.5i -'bp diff --git a/src/bsd/doc/man/tnameserv.1 b/src/bsd/doc/man/tnameserv.1 deleted file mode 100644 index 446183b26e6..00000000000 --- a/src/bsd/doc/man/tnameserv.1 +++ /dev/null @@ -1,488 +0,0 @@ -'\" t -.\" Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. -.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -.\" -.\" This code is free software; you can redistribute it and/or modify it -.\" under the terms of the GNU General Public License version 2 only, as -.\" published by the Free Software Foundation. -.\" -.\" This code is distributed in the hope that it will be useful, but WITHOUT -.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -.\" version 2 for more details (a copy is included in the LICENSE file that -.\" accompanied this code). -.\" -.\" You should have received a copy of the GNU General Public License version -.\" 2 along with this work; if not, write to the Free Software Foundation, -.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -.\" -.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -.\" or visit www.oracle.com if you need additional information or have any -.\" questions. -.\" -.\" Arch: generic -.\" Software: JDK 8 -.\" Date: 21 November 2013 -.\" SectDesc: Java IDL and RMI-IIOP Tools -.\" Title: tnameserv.1 -.\" -.if n .pl 99999 -.TH tnameserv 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- - -.SH NAME -tnameserv \- Interface Definition Language (IDL)\&. -.SH SYNOPSIS -.sp -.nf - -\fBtnameserve\fR \fB\-ORBInitialPort\fR [ \fInameserverport\fR ] -.fi -.sp -.TP --ORBInitialPort \fInameserverport\fR -.br -The initial port where the naming service listens for the bootstrap protocol used to implement the ORB \f3resolve_initial_references\fR and \f3list_initial_references\fR methods\&. -.SH DESCRIPTION -Java IDL includes the Object Request Broker Daemon (ORBD)\&. ORBD is a daemon process that contains a Bootstrap Service, a Transient Naming Service, a Persistent Naming Service, and a Server Manager\&. The Java IDL tutorials all use ORBD, but you can substitute the \f3tnameserv\fR command for the \f3orbd\fR command in any of the examples that use a Transient Naming Service\&. -.PP -See orbd(1) or Naming Service at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.html -.PP -The CORBA Common Object Services (COS) Naming Service provides a tree-structure directory for object references similar to a file system that provides a directory structure for files\&. The Transient Naming Service provided with Java IDL, \f3tnameserv\fR, is a simple implementation of the COS Naming Service specification\&. -.PP -Object references are stored in the name space by name and each object reference-name pair is called a name binding\&. Name bindings can be organized under naming contexts\&. Naming contexts are name bindings and serve the same organizational function as a file system subdirectory\&. All bindings are stored under the initial naming context\&. The initial naming context is the only persistent binding in the name space\&. The rest of the name space is lost when the Java IDL naming service process stops and restarts\&. -.PP -For an applet or application to use COS naming, its ORB must know the port of a host running a naming service or have access to an initial naming context string for that naming service\&. The naming service can either be the Java IDL naming service or another COS-compliant naming service\&. -.SS START\ THE\ NAMING\ SERVICE -You must start the Java IDL naming service before an application or applet that uses its naming service\&. Installation of the Java IDL product creates a script (Oracle Solaris: \f3tnameserv\fR) or executable file (Windows: \f3tnameserv\&.exe\fR) that starts the Java IDL naming service\&. Start the naming service so it runs in the background\&. -.PP -If you do not specify otherwise, then the Java IDL naming service listens on port 900 for the bootstrap protocol used to implement the ORB \f3resolve_initial_references\fR and \f3list_initial_references methods\fR, as follows: -.sp -.nf -\f3tnameserv \-ORBInitialPort nameserverport&\fP -.fi -.nf -\f3\fP -.fi -.sp -If you do not specify the name server port, then port 900 is used by default\&. When running Oracle Solaris software, you must become the root user to start a process on a port below 1024\&. For this reason, it is recommended that you use a port number greater than or equal to 1024\&. To specify a different port, for example, 1050, and to run the naming service in the background, from a UNIX command shell, enter: -.sp -.nf -\f3tnameserv \-ORBInitialPort 1050&\fP -.fi -.nf -\f3\fP -.fi -.sp -From an MS-DOS system prompt (Windows), enter: -.sp -.nf -\f3start tnameserv \-ORBInitialPort 1050\fP -.fi -.nf -\f3\fP -.fi -.sp -Clients of the name server must be made aware of the new port number\&. Do this by setting the \f3org\&.omg\&.CORBA\&.ORBInitialPort\fR property to the new port number when you create the ORB object\&. -.SS RUN\ THE\ SERVER\ AND\ CLIENT\ ON\ DIFFERENT\ HOSTS -In most of the Java IDL and RMI-IIOP tutorials, the naming service, server, and client are all running on the development machine\&. In real-world deployment, the client and server probably run on different host machines from the Naming Service\&. -.PP -For the client and server to find the Naming Service, they must be made aware of the port number and host on which the naming service is running\&. Do this by setting the \f3org\&.omg\&.CORBA\&.ORBInitialPort\fR and \f3org\&.omg\&.CORBA\&.ORBInitialHost\fR properties in the client and server files to the machine name and port number on which the Naming Service is running\&. An example of this is shown in Getting Started Using RMI-IIOP at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/rmi-iiop/rmiiiopexample\&.html -.PP -You could also use the command-line options \f3-ORBInitialPort nameserverport#\fR and \f3-ORBInitialHost nameserverhostname\fR to tell the client and server where to find the naming service\&. For one example of doing this using the command-line option, see Java IDL: The Hello World Example on Two Machines at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/tutorial/jidl2machines\&.html -.PP -For example, suppose the Transient Naming Service, \f3tnameserv\fR is running on port 1050 on host \f3nameserverhost\fR\&. The client is running on host \f3clienthost,\fR and the server is running on host \f3serverhost\fR\&. -.PP -Start \f3tnameserv\fR on the host \f3nameserverhost\fR: -.sp -.nf -\f3tnameserv \-ORBInitialPort 1050\fP -.fi -.nf -\f3\fP -.fi -.sp -Start the server on the \f3serverhost\fR: -.sp -.nf -\f3java Server \-ORBInitialPort 1050 \-ORBInitialHost nameserverhost\fP -.fi -.nf -\f3\fP -.fi -.sp -Start the client on the \f3clienthost\fR: -.sp -.nf -\f3java Client \-ORBInitialPort 1050 \-ORBInitialHost nameserverhost\fP -.fi -.nf -\f3\fP -.fi -.sp -.SS STOP\ THE\ NAMING\ SERVICE -To stop the Java IDL naming service, use the relevant operating system command, such as \f3kill\fR for a Unix process or \f3Ctrl+C\fR for a Windows process\&. The naming service continues to wait for invocations until it is explicitly shut down\&. Note that names registered with the Java IDL naming service disappear when the service is terminated\&. -.SH OPTIONS -.TP --J\fIoption\fR -.br -Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&. -.SH EXAMPLES -.SS ADD\ OBJECTS\ TO\ THE\ NAME\ SPACE -The following example shows how to add names to the name space\&. It is a self-contained Transient Naming Service client that creates the following simple tree\&. -.sp -.nf -\f3Initial Naming Context\fP -.fi -.nf -\f3 plans\fP -.fi -.nf -\f3 Personal\fP -.fi -.nf -\f3 calendar\fP -.fi -.nf -\f3 schedule\fP -.fi -.nf -\f3\fP -.fi -.sp -In this example, \f3plans\fR is an object reference and \f3Personal\fR is a naming context that contains two object references: \f3calendar\fR and \f3schedule\fR\&. -.sp -.nf -\f3import java\&.util\&.Properties;\fP -.fi -.nf -\f3import org\&.omg\&.CORBA\&.*;\fP -.fi -.nf -\f3import org\&.omg\&.CosNaming\&.*;\fP -.fi -.nf -\f3\fP -.fi -.nf -\f3public class NameClient {\fP -.fi -.nf -\f3\fP -.fi -.nf -\f3 public static void main(String args[]) {\fP -.fi -.nf -\f3\fP -.fi -.nf -\f3 try {\fP -.fi -.nf -\f3\fP -.fi -.sp -In Start the Naming Service, the \f3nameserver\fR was started on port 1050\&. The following code ensures that the client program is aware of this port number\&. -.sp -.nf -\f3 Properties props = new Properties();\fP -.fi -.nf -\f3 props\&.put("org\&.omg\&.CORBA\&.ORBInitialPort", "1050");\fP -.fi -.nf -\f3 ORB orb = ORB\&.init(args, props);\fP -.fi -.nf -\f3\fP -.fi -.sp -This code obtains the initial naming context and assigns it to \f3ctx\fR\&. The second line copies \f3ctx\fR into a dummy object reference \f3objref\fR that is attached to various names and added into the name space\&. -.sp -.nf -\f3 NamingContext ctx =\fP -.fi -.nf -\f3 NamingContextHelper\&.narrow(\fP -.fi -.nf -\f3 orb\&.resolve_initial_references("NameService"));\fP -.fi -.nf -\f3 NamingContext objref = ctx;\fP -.fi -.nf -\f3\fP -.fi -.sp -This code creates a name \f3plans\fR of type \f3text\fR and binds it to the dummy object reference\&. \f3plans\fR is then added under the initial naming context using the \f3rebind\fR method\&. The \f3rebind\fR method enables you to run this program over and over again without getting the exceptions from using the \f3bind\fR method\&. -.sp -.nf -\f3 NameComponent nc1 = new NameComponent("plans", "text");\fP -.fi -.nf -\f3 NameComponent[] name1 = {nc1};\fP -.fi -.nf -\f3 ctx\&.rebind(name1, objref);\fP -.fi -.nf -\f3 System\&.out\&.println("plans rebind successful!");\fP -.fi -.nf -\f3\fP -.fi -.sp -This code creates a naming context called \f3Personal\fR of type \f3directory\fR\&. The resulting object reference, \f3ctx2\fR, is bound to the \f3name\fR and added under the initial naming context\&. -.sp -.nf -\f3 NameComponent nc2 = new NameComponent("Personal", "directory");\fP -.fi -.nf -\f3 NameComponent[] name2 = {nc2};\fP -.fi -.nf -\f3 NamingContext ctx2 = ctx\&.bind_new_context(name2);\fP -.fi -.nf -\f3 System\&.out\&.println("new naming context added\&.\&.");\fP -.fi -.nf -\f3\fP -.fi -.sp -The remainder of the code binds the dummy object reference using the names \f3schedule\fR and \f3calendar\fR under the \f3Personal\fR naming context (\f3ctx2\fR)\&. -.sp -.nf -\f3 NameComponent nc3 = new NameComponent("schedule", "text");\fP -.fi -.nf -\f3 NameComponent[] name3 = {nc3};\fP -.fi -.nf -\f3 ctx2\&.rebind(name3, objref);\fP -.fi -.nf -\f3 System\&.out\&.println("schedule rebind successful!");\fP -.fi -.nf -\f3\fP -.fi -.nf -\f3 NameComponent nc4 = new NameComponent("calender", "text");\fP -.fi -.nf -\f3 NameComponent[] name4 = {nc4};\fP -.fi -.nf -\f3 ctx2\&.rebind(name4, objref);\fP -.fi -.nf -\f3 System\&.out\&.println("calender rebind successful!");\fP -.fi -.nf -\f3 } catch (Exception e) {\fP -.fi -.nf -\f3 e\&.printStackTrace(System\&.err);\fP -.fi -.nf -\f3 }\fP -.fi -.nf -\f3 }\fP -.fi -.nf -\f3}\fP -.fi -.nf -\f3\fP -.fi -.sp -.SS BROWSING\ THE\ NAME\ SPACE -The following sample program shoes how to browse the name space\&. -.sp -.nf -\f3import java\&.util\&.Properties;\fP -.fi -.nf -\f3import org\&.omg\&.CORBA\&.*;\fP -.fi -.nf -\f3import org\&.omg\&.CosNaming\&.*;\fP -.fi -.nf -\f3\fP -.fi -.nf -\f3public class NameClientList {\fP -.fi -.nf -\f3\fP -.fi -.nf -\f3 public static void main(String args[]) {\fP -.fi -.nf -\f3\fP -.fi -.nf -\f3 try {\fP -.fi -.nf -\f3\fP -.fi -.sp -In Start the Naming Service, the \f3nameserver\fR was started on port 1050\&. The following code ensures that the client program is aware of this port number\&. -.sp -.nf -\f3 Properties props = new Properties();\fP -.fi -.nf -\f3 props\&.put("org\&.omg\&.CORBA\&.ORBInitialPort", "1050");\fP -.fi -.nf -\f3 ORB orb = ORB\&.init(args, props);\fP -.fi -.nf -\f3\fP -.fi -.sp -The following code obtains the initial naming context\&. -.sp -.nf -\f3 NamingContext nc =\fP -.fi -.nf -\f3 NamingContextHelper\&.narrow(\fP -.fi -.nf -\f3 orb\&.resolve_initial_references("NameService"));\fP -.fi -.nf -\f3\fP -.fi -.sp -The \f3list\fR method lists the bindings in the naming context\&. In this case, up to 1000 bindings from the initial naming context will be returned in the \f3BindingListHolder\fR; any remaining bindings are returned in the \f3BindingIteratorHolder\fR\&. -.sp -.nf -\f3 BindingListHolder bl = new BindingListHolder();\fP -.fi -.nf -\f3 BindingIteratorHolder blIt= new BindingIteratorHolder();\fP -.fi -.nf -\f3 nc\&.list(1000, bl, blIt);\fP -.fi -.nf -\f3\fP -.fi -.sp -This code gets the array of bindings out of the returned \f3BindingListHolder\fR\&. If there are no bindings, then the program ends\&. -.sp -.nf -\f3 Binding bindings[] = bl\&.value;\fP -.fi -.nf -\f3 if (bindings\&.length == 0) return;\fP -.fi -.nf -\f3\fP -.fi -.sp -The remainder of the code loops through the bindings and prints outs the names\&. -.sp -.nf -\f3 for (int i=0; i < bindings\&.length; i++) {\fP -.fi -.nf -\f3\fP -.fi -.nf -\f3 // get the object reference for each binding\fP -.fi -.nf -\f3 org\&.omg\&.CORBA\&.Object obj = nc\&.resolve(bindings[i]\&.binding_name);\fP -.fi -.nf -\f3 String objStr = orb\&.object_to_string(obj);\fP -.fi -.nf -\f3 int lastIx = bindings[i]\&.binding_name\&.length\-1;\fP -.fi -.nf -\f3\fP -.fi -.nf -\f3 // check to see if this is a naming context\fP -.fi -.nf -\f3 if (bindings[i]\&.binding_type == BindingType\&.ncontext) {\fP -.fi -.nf -\f3 System\&.out\&.println("Context: " +\fP -.fi -.nf -\f3 bindings[i]\&.binding_name[lastIx]\&.id);\fP -.fi -.nf -\f3 } else {\fP -.fi -.nf -\f3 System\&.out\&.println("Object: " +\fP -.fi -.nf -\f3 bindings[i]\&.binding_name[lastIx]\&.id);\fP -.fi -.nf -\f3 }\fP -.fi -.nf -\f3 }\fP -.fi -.nf -\f3 } catch (Exception e) {\fP -.fi -.nf -\f3 e\&.printStackTrace(System\&.err)\fP -.fi -.nf -\f3 }\fP -.fi -.nf -\f3 }\fP -.fi -.nf -\f3}\fP -.fi -.nf -\f3\fP -.fi -.sp -.SH SEE\ ALSO -.TP 0.2i -\(bu -orbd(1) -.RE -.br -'pl 8.5i -'bp diff --git a/src/bsd/doc/man/wsgen.1 b/src/bsd/doc/man/wsgen.1 deleted file mode 100644 index 2f81ab15c85..00000000000 --- a/src/bsd/doc/man/wsgen.1 +++ /dev/null @@ -1,175 +0,0 @@ -'\" t -.\" Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. -.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -.\" -.\" This code is free software; you can redistribute it and/or modify it -.\" under the terms of the GNU General Public License version 2 only, as -.\" published by the Free Software Foundation. -.\" -.\" This code is distributed in the hope that it will be useful, but WITHOUT -.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -.\" version 2 for more details (a copy is included in the LICENSE file that -.\" accompanied this code). -.\" -.\" You should have received a copy of the GNU General Public License version -.\" 2 along with this work; if not, write to the Free Software Foundation, -.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -.\" -.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -.\" or visit www.oracle.com if you need additional information or have any -.\" questions. -.\" -.\" Arch: generic -.\" Software: JDK 8 -.\" Date: 21 November 2013 -.\" SectDesc: Java Web Services Tools -.\" Title: wsgen.1 -.\" -.if n .pl 99999 -.TH wsgen 1 "21 November 2013" "JDK 8" "Java Web Services Tools" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- - -.SH NAME -wsgen \- Reads a web service endpoint implementation (SEI) class and generates all of the required artifacts for web service deployment, and invocation\&. -.SH SYNOPSIS -.sp -.nf - -\fBwsgen\fR [ \fIoptions\fR ] \fISEI\fR -.fi -.sp -.TP -\fIoptions\fR -The command-line options\&. See Options\&. -.TP -\fISEI\fR -The web service endpoint implementation class (SEI) to be read\&. -.SH DESCRIPTION -The \f3wsgen\fR command generates JAX-WS portable artifacts used in JAX-WS web services\&. The tool reads a web service endpoint class and generates all the required artifacts for web service deployment and invocation\&. JAXWS 2\&.1\&.1 RI also provides a \f3wsgen\fR Ant task, see the \fITools\fR tab of the JAX-WS (wsgen) page at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsgenant\&.html -.PP -To start the \f3wsgen\fR command, do the following: -.sp -.nf -\f3export JAXWS_HOME=/pathto/jaxws\-ri\fP -.fi -.nf -\f3$JAXWS_HOME/bin/wsgen\&.sh \-help\fP -.fi -.nf -\f3\fP -.fi -.sp -.SH OPTIONS -.TP --classpath \fIpath\fR -.br -The location of the input class files\&. -.TP --cp \fIpath\fR -.br -The location of the input class files\&. -.TP --d \fIdirectory\fR -.br -The location for where to place generated output files\&. -.TP --extension -.br -Allow vendor extensions\&. Use of extensions can result in applications that are not portable or that do not work with other implementations\&. -.TP --help -.br -Displays a help message about the \f3wsgen\fR command\&. -.TP --keep -.br -Keeps the generated files\&. -.TP --r \fIdirectory\fR -.br -Uses this option with the \f3-wsdl\fR option to specify where to place generated resource files such as WSDLs\&. -.TP --s \fIdirectory\fR -.br -The location for where to place generated source files\&. -.TP --verbose -.br -Displays compiler messages\&. -.TP --version -.br -Prints release information\&. -.TP --wsdl [ :protocol ] \fI\fR -.br -An optional command that generates a WSDL file to review before endpoint deployment\&. The WSDL files contains a machine-readable description of how the service can be called, what parameters it expects, and what data structures it returns\&. - -By default the \f3wsgen\fR command does not generate a WSDL file\&. The \f3protocol\fR value is optional and is used to specify what protocol should be used for the WSDL binding (\f3wsdl:binding\fR)\&. Valid protocols are \f3soap1\&.1\fR and \f3Xsoap1\&.2\fR\&. The default is \f3soap1\&.1\fR\&. The \f3Xsoap1\&.2\fR protocol is not standard and can only be used with the \f3-extension\fR option\&. -.TP --servicename \fIname\fR -.br -Used only with the \f3-wsdl\fR option to specify a particular WSDL service (\f3wsdl:service\fR) name to be generated in the WSDL, for example: \f3-servicename "{http://mynamespace/}MyService"\fR\&. -.TP --portname \fIname\fR -.br -Used only with the \f3-wsdl\fR option to specify a particular WSDL port (\f3wsdl:port\fR) name to be generated in the WSDL, for example: \f3-portname "{http://mynamespace/}MyPort"\fR\&. -.SH EXAMPLES -The following example generates the wrapper classes for \f3StockService\fR with \f3@WebService\fR annotations inside stock directory\&. -.sp -.nf -\f3wsgen \-d stock \-cp myclasspath stock\&.StockService\fP -.fi -.nf -\f3\fP -.fi -.sp -The following example generates a SOAP 1\&.1 WSDL and schema for the \f3stock\&.StockService\fR class with \f3@WebService\fR annotations\&. -.sp -.nf -\f3wsgen \-wsdl \-d stock \-cp myclasspath stock\&.StockService\fP -.fi -.nf -\f3\fP -.fi -.sp -The following example generates a SOAP 1\&.2 WSDL\&. -.sp -.nf -\f3wsgen \-wsdl:Xsoap1\&.2 \-d stock \-cp myclasspath stock\&.StockService \fP -.fi -.nf -\f3\fP -.fi -.sp -\fINote:\fR You do not have to generate WSDL at development time because the JAXWS run time environment generates a WSDL for you when you deploy your service\&. -.SH SEE\ ALSO -.TP 0.2i -\(bu -wsimport(1) -.TP 0.2i -\(bu -\fIThe Tools\fR tab of the JAX-WS (wsgen) page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsgenant\&.html -.RE -.br -'pl 8.5i -'bp diff --git a/src/bsd/doc/man/wsimport.1 b/src/bsd/doc/man/wsimport.1 deleted file mode 100644 index 3c3ffd530fb..00000000000 --- a/src/bsd/doc/man/wsimport.1 +++ /dev/null @@ -1,216 +0,0 @@ -'\" t -.\" Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. -.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -.\" -.\" This code is free software; you can redistribute it and/or modify it -.\" under the terms of the GNU General Public License version 2 only, as -.\" published by the Free Software Foundation. -.\" -.\" This code is distributed in the hope that it will be useful, but WITHOUT -.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -.\" version 2 for more details (a copy is included in the LICENSE file that -.\" accompanied this code). -.\" -.\" You should have received a copy of the GNU General Public License version -.\" 2 along with this work; if not, write to the Free Software Foundation, -.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -.\" -.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -.\" or visit www.oracle.com if you need additional information or have any -.\" questions. -.\" -.\" Arch: generic -.\" Software: JDK 8 -.\" Date: 21 November 2013 -.\" SectDesc: Java Web Services Tools -.\" Title: wsimport.1 -.\" -.if n .pl 99999 -.TH wsimport 1 "21 November 2013" "JDK 8" "Java Web Services Tools" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- - -.SH NAME -wsimport \- Generates JAX-WS portable artifacts that can be packaged in a web application archive (WAR) file and provides an Ant task\&. -.SH SYNOPSIS -.sp -.nf - -\fBwsimport\fR [ \fIoptions\fR ] \fIwsdl\fR -.fi -.sp -.TP -\fIoptions\fR -The command-line options\&. See Options\&. -.TP -\fIwsdl\fR -The file that contains the machine-readable description of how the web service can be called, what parameters it expects, and what data structures it returns\&. -.SH DESCRIPTION -The \f3wsimport\fR command generates the following JAX-WS portable artifacts\&. These artifacts can be packaged in a WAR file with the WSDL and schema documents and the endpoint implementation to be deployed\&. The \f3wsimport\fR command also provides a \f3wsimport\fR Ant task, see the Tools tab of the Wsimport Ant Task page at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html -.TP 0.2i -\(bu -Service Endpoint Interface (SEI) -.TP 0.2i -\(bu -Service -.TP 0.2i -\(bu -Exception class is mapped from \f3wsdl:fault\fR (if any) -.TP 0.2i -\(bu -Async Response Bean is derived from response \f3wsdl:message\fR (if any) -.TP 0.2i -\(bu -JAXB generated value types (mapped java classes from schema types) -.PP -To start the \f3wsgen\fR command, do the following: -.PP -\fIOracle Solaris/Linux\fR: -.sp -.nf -\f3/bin/wsimport\&.sh \-help\fP -.fi -.nf -\f3\fP -.fi -.sp -\fIWindows\fR: -.sp -.nf -\f3\ebin\ewsimport\&.bat \-help\fP -.fi -.nf -\f3\fP -.fi -.sp -.SH OPTIONS -.TP --d \fIdirectory\fR -.br -Specifies where to place generated output files\&. -.TP --b \fIpath\fR -.br -Specifies external JAX-WS or JAXB binding files\&. Multiple JAX-WS and JAXB binding files can be specified with the \f3-b\fR option\&. You can use these files to customize package names, bean names, and so on\&. For more information about JAX-WS and JAXB binding files, see the \fIUsers Guide\fR tab of WSDL Customization at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html -.TP --B \fIjaxbOption\fR -.br -Passes the \f3jaxbOption\fR option to the JAXB schema compiler\&. -.TP --catalog -.br -Specifies a catalog file to resolve external entity references\&. The \f3-catalog\fR option supports the TR9401, XCatalog, and OASIS XML Catalog formats\&. See the \fIUsers Guide\fR tab of the Catalog Support page at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/catalog-support\&.html -.TP --extension -.br -Allows vendor extensions\&. Use of extensions can result in applications that are not portable or that do not work with other implementations\&. -.TP --help -.br -Displays a help message for the \f3wsimport\fR command\&. -.TP --httpproxy: \fIhost\fR:\fIport\fR -.br -Specifies an HTTP proxy server\&. The default is 8080\&. -.TP --keep -.br -Keeps generated files\&. -.TP --p \fIname\fR -.br -Specifies a target package \fIname\fR to override the WSDL and schema binding customizations, and the default algorithm defined in the specification\&. -.TP --s \fIdirectory\fR -.br -Specifies where to place generated source files\&. -.TP --verbose -.br -Displays compiler messages\&. -.TP --version -.br -Prints release information\&. -.TP --wsdllocation \fIlocation\fR -.br -Specifies the \f3@WebServiceClient\&.wsdlLocation\fR value\&. -.TP --target -.br -Generates code according to the specified JAX-WS specification version\&. Version 2\&.0 generates compliant code for the JAX-WS 2\&.0 specification\&. -.TP --quiet -.br -Suppresses the \f3wsimport\fR command output\&. -.PP -Multiple \f3JAX-WS\fR and \f3JAXB\fR binding files can be specified using the \f3-b\fR option, and they can be used to customize various things such as package names and bean names\&. More information about \f3JAX-WS\fR and \f3JAXB\fR binding files can be found in the customization documentation at https://jax-ws\&.dev\&.java\&.net/nonav/2\&.1\&.1/docs/customizations\&.html -.SH NONSTANDARD\ OPTIONS -.TP --XadditionalHeaders -.br -Maps headers not bound to a request or response message to Java method parameters\&. -.TP --Xauthfile \fIfile\fR -.br -The WSDL URI that specifies the file that contains authorization information\&. This URI is in the following format: - -http://\fIuser-name\fR:\f3password\fR@\fIhost-name\fR/\fIweb-service-name\fR>?wsdl\&. -.TP --Xdebug -.br -Prints debugging information\&. -.TP --Xno-addressing-databinding -.br -Enables binding of W3C EndpointReferenceType to Java\&. -.TP --Xnocompile -.br -Does not compile the generated Java files\&. -.SH EXAMPLE -The following example generates the Java artifacts and compiles the artifacts by importing \f3http://stockquote\&.example\&.com/quote?wsdl\fR -.sp -.nf -\f3wsimport \-p stockquote http://stockquote\&.example\&.com/quote?wsdl\fP -.fi -.nf -\f3\fP -.fi -.sp -.SH SEE\ ALSO -.TP 0.2i -\(bu -wsgen(1) -.TP 0.2i -\(bu -The Tools tab of Wsimport Ant Task page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html -.TP 0.2i -\(bu -The \fIUsers Guide\fR tab of Catalog Support page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/catalog-support\&.html -.TP 0.2i -\(bu -The \fIUsers Guide\fR tab of WSDL Customization page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html -.RE -.br -'pl 8.5i -'bp diff --git a/src/bsd/doc/man/xjc.1 b/src/bsd/doc/man/xjc.1 deleted file mode 100644 index fef71fea86e..00000000000 --- a/src/bsd/doc/man/xjc.1 +++ /dev/null @@ -1,232 +0,0 @@ -'\" t -.\" Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. -.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -.\" -.\" This code is free software; you can redistribute it and/or modify it -.\" under the terms of the GNU General Public License version 2 only, as -.\" published by the Free Software Foundation. -.\" -.\" This code is distributed in the hope that it will be useful, but WITHOUT -.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -.\" version 2 for more details (a copy is included in the LICENSE file that -.\" accompanied this code). -.\" -.\" You should have received a copy of the GNU General Public License version -.\" 2 along with this work; if not, write to the Free Software Foundation, -.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -.\" -.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -.\" or visit www.oracle.com if you need additional information or have any -.\" questions. -.\" -.\" Arch: generic -.\" Software: JDK 8 -.\" Date: 21 November 2013 -.\" SectDesc: Java Web Services Tools -.\" Title: xjc.1 -.\" -.if n .pl 99999 -.TH xjc 1 "21 November 2013" "JDK 8" "Java Web Services Tools" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- - -.SH NAME -xjc \- Compiles an XML schema file into fully annotated Java classes\&. -.SH SYNOPSIS -.sp -.nf - -\fBxjc\fR [ \fIoptions\fR ] \fBschema\fR \fIfile/URL/dir/jar\fR \&.\&.\&. [\fB\-b\fR \fIbindinfo\fR ] \&.\&.\&. -.fi -.sp -.TP -\fIoptions\fR -The command-line options\&. See Options\&. -.TP -schema \fIfile/URL/dir/jar \&.\&.\&.\fR -The location of the XML schema file\&. If \f3dir\fR is specified, then all schema files in it are compiled\&. If \f3jar\fR is specified, then the \f3/META-INF/sun-jaxb\&.episode\fR binding file is compiled\&. -.TP --b \fIbindinfo\fR -.br -The location of the bindings files\&. -.SH DESCRIPTION -Start the binding compiler with the appropriate \f3xjc\fR shell script in the bin directory for your platform\&. There is also an Ant task to run the binding complier\&. See Using the XJC with Ant at http://jaxb\&.java\&.net/nonav/2\&.1\&.3/docs/xjcTask\&.html -.SH OPTIONS -.TP 0.2i -\(bu -See also Nonstandard Options -.TP 0.2i -\(bu -See also Deprecated and Removed Options -.TP --nv -.br -By default, the XJC binding compiler performs strict validation of the source schema before processing it\&. Use this option to disable strict schema validation\&. This does not mean that the binding compiler will not perform any validation, but means that it will perform a less-strict validation\&. -.TP --extension -.br -By default, the XJC binding compiler strictly enforces the rules outlined in the Compatibility chapter of the JAXB Specification\&. Appendix E\&.2 defines a set of W3C XML Schema features that are not completely supported by JAXB v1\&.0\&. In some cases, you may be allowed to use them in the \f3-extension\fR mode enabled by this switch\&. In the default (strict) mode, you are also limited to using only the binding customization defined in the specification\&. By using the \f3-extension\fR switch, you will be allowed to use the JAXB Vendor Extensions\&. -.TP --b \fIfile\fR -.br -Specifies one or more external binding files to process\&. Each binding file must have its own \f3-b\fR switch\&. The syntax of the external binding files is flexible\&. You can have a single binding file that contains customization for multiple schemas or you can break the customization into multiple bindings files: \f3xjc schema1\&.xsd schema2\&.xsd schema3\&.xsd -b bindings123\&.xjb\fR\f3xjc schema1\&.xsd schema2\&.xsd schema3\&.xsd -b bindings1\&.xjb -b bindings2\&.xjb -b bindings3\&.xjb\fR\&. In addition, the ordering of the schema files and binding files on the command line does not matter\&. -.TP --d \fIdir\fR -.br -By default, the XJC binding compiler generates the Java content classes in the current directory\&. Use this option to specify an alternate output directory\&. The output directory must already exist\&. The XJC binding compiler does not create it for you\&. -.TP --p \fIpkg\fR -.br -When you specify a target package with this command-line option, it overrides any binding customization for the package name and the default package name algorithm defined in the specification\&. -.TP --httpproxy \fIproxy\fR -.br -Specifies the HTTP or HTTPS proxy in the format \fI[user[:password]@]proxyHost[:proxyPort]\fR\&. The old \f3-host\fR and \f3-port\fR options are still supported by the RI for backward compatibility, but they were deprecated\&. The password specified with this option is an argument that is visible to other users who use the top command\&. For greater security, use the \f3-httpproxyfile\fR option\&. -.TP --httpproxyfile file -.br -Specifies the HTTP or HTTPS proxy with a file\&. The same format as the \f3-httpproxy\fR option, but the password specified in the file is not visible to other users\&. -.TP --classpath arg -.br -Specifies where to find client application class files used by the \fIjxb:javaType\fR and xjc:\fIsuperClass\fR customization\&. -.TP --catalog file -.br -Specifies catalog files to resolve external entity references\&. Supports the TR9401, XCatalog, and OASIS XML Catalog formats\&. See XML Entity and URI Resolvers at http://xerces\&.apache\&.org/xml-commons/components/resolver/resolver-article\&.html -.TP --readOnly -.br -By default, the XJC binding compiler does not write-protect the Java source files it generates\&. Use this option to force the XJC binding compiler to mark the generated Java sources as read-only\&. -.TP --npa -.br -Suppresses the generation of package level annotations into \f3**/package-info\&.java\fR\&. Using this switch causes the generated code to internalize those annotations into the other generated classes\&. -.TP --no-header -.br -Suppresses the generation of a file header comment that includes some note and time stamp\&. Using this makes the generated code more compatible with the \f3diff\fR command\&. -.TP --target 2\&.0 -.br -Avoids generating code that relies on any JAXB 2\&.1 features\&. This will allow the generated code to run with JAXB 2\&.0 runtime environment (such as Java SE 6)\&. -.TP --xmlschema -.br -Treats input schemas as W3C XML Schema (default)\&. If you do not specify this switch, then your input schemas are treated as though they are W3C XML Schemas\&. -.TP --relaxing -.br -Treats input schemas as RELAX NG (experimental and unsupported)\&. Support for RELAX NG schemas is provided as a JAXB Vendor Extension\&. -.TP --relaxing-compact -.br -Treat input schemas as RELAX NG compact syntax (experimental and unsupported)\&. Support for RELAX NG schemas is provided as a JAXB Vendor Extension\&. -.TP --dtd -.br -Treats input schemas as XML DTD (experimental and unsupported)\&. Support for RELAX NG schemas is provided as a JAXB Vendor Extension\&. -.TP --wsdl -.br -Treats input as WSDL and compiles schemas inside it (experimental and unsupported)\&. -.TP --quiet -.br -Suppress compiler output, such as progress information and warnings\&. -.TP --verbose -.br -Be extra verbose, such as printing informational messages or displaying stack traces upon some errors\&. -.TP --help -.br -Displays a brief summary of the compiler switches\&. -.TP --version -.br -Displays the compiler version information\&. -.TP -\fIschema file/URL/dir\fR -Specifies one or more schema files to compile\&. If you specify a directory, then the \f3xjc\fR command scans it for all schema files and compiles them\&. -.SS NONSTANDARD\ OPTIONS -.TP --XLocator -.br -Causes the generated code to expose SAX Locator information about the source XML in the Java bean instances after unmarshalling\&. -.TP --Xsync-methods -.br -Causes all of the generated method signatures to include the \f3synchronized\fR keyword\&. -.TP --mark-generated -.br -Marks the generated code with the annotation \f3@javax\&.annotation\&.Generated\fR\&. -.TP --episode file -.br -Generates the specified episode file for separate compilation\&. -.SS DEPRECATED\ AND\ REMOVED\ OPTIONS -.TP --host & -port -.br -These options are replaced with the \f3-httpproxy\fR option\&. For backward compatibility, these options are supported, but will not be documented and might be removed from future releases\&. -.TP --use-runtime -.br -Because the JAXB 2\&.0 specification has defined a portable runtime environment, it is no longer necessary for the JAXB RI to generate \f3**/impl/runtime\fRpackages\&. Therefore, this switch is obsolete and was removed\&. -.TP --source -.br -The \f3-source\fR compatibility switch was introduced in the first JAXB 2\&.0 Early Access release\&. This switch is removed from future releases of JAXB 2\&.0\&. If you need to generate 1\&.0\&.x code, then use an installation of the 1\&.0\&.x code base\&. -.SH COMPILER\ RESTRICTIONS -In general, it is safest to compile all related schemas as a single unit with the same binding compiler switches\&. Keep the following list of restrictions in mind when running the \f3xjc\fR command\&. Most of these issues only apply when you compile multiple schemas with multiple invocations of the \f3xjc\fR command\&. -.PP -To compile multiple schemas at the same time, keep the following precedence rules for the target Java package name in mind: -.TP 0.4i -1\&. -The \f3-p\fR option has the highest precedence\&. -.TP 0.4i -2\&. -\fIjaxb:package\fR customization\&. -.TP 0.4i -3\&. -If \f3targetNamespace\fR is declared, then apply the \f3t\fR\f3argetNamespace\fR to the Java package name algorithm defined in the specification\&. -.TP 0.4i -4\&. -If no \f3targetNamespace\fR is declared, then use a hard coded package named \f3generated\fR\&. -.PP -You cannot have more than one \fIjaxb:schemaBindings\fR per name space, so it is impossible to have two schemas in the same target name space compiled into different Java packages\&. -.PP -All schemas being compiled into the same Java package must be submitted to the XJC binding compiler at the same time\&. They cannot be compiled independently and work as expected\&. -.PP -Element substitution groups that are spread across multiple schema files must be compiled at the same time\&. -.SH SEE\ ALSO -.TP 0.2i -\(bu -Binding Compiler (xjc) at http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/xjc\&.html -.TP 0.2i -\(bu -Java Architecture for XML Binding (JAXB) at http://www\&.oracle\&.com/technetwork/articles/javase/index-140168\&.html -.RE -.br -'pl 8.5i -'bp diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad index 0b1e086f3a9..e6b88fe4c44 100644 --- a/src/hotspot/cpu/aarch64/aarch64.ad +++ b/src/hotspot/cpu/aarch64/aarch64.ad @@ -5844,8 +5844,8 @@ operand immPollPage() operand immByteMapBase() %{ // Get base of card map - predicate((jbyte*)n->get_ptr() == - ((CardTableModRefBS*)(Universe::heap()->barrier_set()))->byte_map_base); + predicate(Universe::heap()->barrier_set()->is_a(BarrierSet::CardTableModRef) && + (jbyte*)n->get_ptr() == ((CardTableModRefBS*)(Universe::heap()->barrier_set()))->byte_map_base); match(ConP); op_cost(0); @@ -17725,7 +17725,7 @@ instruct vsll8B_imm(vecD dst, vecD src, immI shift) %{ ins_cost(INSN_COST); format %{ "shl $dst, $src, $shift\t# vector (8B)" %} ins_encode %{ - int sh = (int)$shift$$constant & 31; + int sh = (int)$shift$$constant; if (sh >= 8) { __ eor(as_FloatRegister($dst$$reg), __ T8B, as_FloatRegister($src$$reg), @@ -17744,7 +17744,7 @@ instruct vsll16B_imm(vecX dst, vecX src, immI shift) %{ ins_cost(INSN_COST); format %{ "shl $dst, $src, $shift\t# vector (16B)" %} ins_encode %{ - int sh = (int)$shift$$constant & 31; + int sh = (int)$shift$$constant; if (sh >= 8) { __ eor(as_FloatRegister($dst$$reg), __ T16B, as_FloatRegister($src$$reg), @@ -17764,9 +17764,8 @@ instruct vsra8B_imm(vecD dst, vecD src, immI shift) %{ ins_cost(INSN_COST); format %{ "sshr $dst, $src, $shift\t# vector (8B)" %} ins_encode %{ - int sh = (int)$shift$$constant & 31; + int sh = (int)$shift$$constant; if (sh >= 8) sh = 7; - sh = -sh & 7; __ sshr(as_FloatRegister($dst$$reg), __ T8B, as_FloatRegister($src$$reg), sh); %} @@ -17779,9 +17778,8 @@ instruct vsra16B_imm(vecX dst, vecX src, immI shift) %{ ins_cost(INSN_COST); format %{ "sshr $dst, $src, $shift\t# vector (16B)" %} ins_encode %{ - int sh = (int)$shift$$constant & 31; + int sh = (int)$shift$$constant; if (sh >= 8) sh = 7; - sh = -sh & 7; __ sshr(as_FloatRegister($dst$$reg), __ T16B, as_FloatRegister($src$$reg), sh); %} @@ -17795,14 +17793,14 @@ instruct vsrl8B_imm(vecD dst, vecD src, immI shift) %{ ins_cost(INSN_COST); format %{ "ushr $dst, $src, $shift\t# vector (8B)" %} ins_encode %{ - int sh = (int)$shift$$constant & 31; + int sh = (int)$shift$$constant; if (sh >= 8) { __ eor(as_FloatRegister($dst$$reg), __ T8B, as_FloatRegister($src$$reg), as_FloatRegister($src$$reg)); } else { __ ushr(as_FloatRegister($dst$$reg), __ T8B, - as_FloatRegister($src$$reg), -sh & 7); + as_FloatRegister($src$$reg), sh); } %} ins_pipe(vshift64_imm); @@ -17814,14 +17812,14 @@ instruct vsrl16B_imm(vecX dst, vecX src, immI shift) %{ ins_cost(INSN_COST); format %{ "ushr $dst, $src, $shift\t# vector (16B)" %} ins_encode %{ - int sh = (int)$shift$$constant & 31; + int sh = (int)$shift$$constant; if (sh >= 8) { __ eor(as_FloatRegister($dst$$reg), __ T16B, as_FloatRegister($src$$reg), as_FloatRegister($src$$reg)); } else { __ ushr(as_FloatRegister($dst$$reg), __ T16B, - as_FloatRegister($src$$reg), -sh & 7); + as_FloatRegister($src$$reg), sh); } %} ins_pipe(vshift128_imm); @@ -17890,7 +17888,7 @@ instruct vsll4S_imm(vecD dst, vecD src, immI shift) %{ ins_cost(INSN_COST); format %{ "shl $dst, $src, $shift\t# vector (4H)" %} ins_encode %{ - int sh = (int)$shift$$constant & 31; + int sh = (int)$shift$$constant; if (sh >= 16) { __ eor(as_FloatRegister($dst$$reg), __ T8B, as_FloatRegister($src$$reg), @@ -17909,7 +17907,7 @@ instruct vsll8S_imm(vecX dst, vecX src, immI shift) %{ ins_cost(INSN_COST); format %{ "shl $dst, $src, $shift\t# vector (8H)" %} ins_encode %{ - int sh = (int)$shift$$constant & 31; + int sh = (int)$shift$$constant; if (sh >= 16) { __ eor(as_FloatRegister($dst$$reg), __ T16B, as_FloatRegister($src$$reg), @@ -17929,9 +17927,8 @@ instruct vsra4S_imm(vecD dst, vecD src, immI shift) %{ ins_cost(INSN_COST); format %{ "sshr $dst, $src, $shift\t# vector (4H)" %} ins_encode %{ - int sh = (int)$shift$$constant & 31; + int sh = (int)$shift$$constant; if (sh >= 16) sh = 15; - sh = -sh & 15; __ sshr(as_FloatRegister($dst$$reg), __ T4H, as_FloatRegister($src$$reg), sh); %} @@ -17944,9 +17941,8 @@ instruct vsra8S_imm(vecX dst, vecX src, immI shift) %{ ins_cost(INSN_COST); format %{ "sshr $dst, $src, $shift\t# vector (8H)" %} ins_encode %{ - int sh = (int)$shift$$constant & 31; + int sh = (int)$shift$$constant; if (sh >= 16) sh = 15; - sh = -sh & 15; __ sshr(as_FloatRegister($dst$$reg), __ T8H, as_FloatRegister($src$$reg), sh); %} @@ -17960,14 +17956,14 @@ instruct vsrl4S_imm(vecD dst, vecD src, immI shift) %{ ins_cost(INSN_COST); format %{ "ushr $dst, $src, $shift\t# vector (4H)" %} ins_encode %{ - int sh = (int)$shift$$constant & 31; + int sh = (int)$shift$$constant; if (sh >= 16) { __ eor(as_FloatRegister($dst$$reg), __ T8B, as_FloatRegister($src$$reg), as_FloatRegister($src$$reg)); } else { __ ushr(as_FloatRegister($dst$$reg), __ T4H, - as_FloatRegister($src$$reg), -sh & 15); + as_FloatRegister($src$$reg), sh); } %} ins_pipe(vshift64_imm); @@ -17979,14 +17975,14 @@ instruct vsrl8S_imm(vecX dst, vecX src, immI shift) %{ ins_cost(INSN_COST); format %{ "ushr $dst, $src, $shift\t# vector (8H)" %} ins_encode %{ - int sh = (int)$shift$$constant & 31; + int sh = (int)$shift$$constant; if (sh >= 16) { __ eor(as_FloatRegister($dst$$reg), __ T16B, as_FloatRegister($src$$reg), as_FloatRegister($src$$reg)); } else { __ ushr(as_FloatRegister($dst$$reg), __ T8H, - as_FloatRegister($src$$reg), -sh & 15); + as_FloatRegister($src$$reg), sh); } %} ins_pipe(vshift128_imm); @@ -18054,7 +18050,7 @@ instruct vsll2I_imm(vecD dst, vecD src, immI shift) %{ ins_encode %{ __ shl(as_FloatRegister($dst$$reg), __ T2S, as_FloatRegister($src$$reg), - (int)$shift$$constant & 31); + (int)$shift$$constant); %} ins_pipe(vshift64_imm); %} @@ -18067,7 +18063,7 @@ instruct vsll4I_imm(vecX dst, vecX src, immI shift) %{ ins_encode %{ __ shl(as_FloatRegister($dst$$reg), __ T4S, as_FloatRegister($src$$reg), - (int)$shift$$constant & 31); + (int)$shift$$constant); %} ins_pipe(vshift128_imm); %} @@ -18080,7 +18076,7 @@ instruct vsra2I_imm(vecD dst, vecD src, immI shift) %{ ins_encode %{ __ sshr(as_FloatRegister($dst$$reg), __ T2S, as_FloatRegister($src$$reg), - -(int)$shift$$constant & 31); + (int)$shift$$constant); %} ins_pipe(vshift64_imm); %} @@ -18093,7 +18089,7 @@ instruct vsra4I_imm(vecX dst, vecX src, immI shift) %{ ins_encode %{ __ sshr(as_FloatRegister($dst$$reg), __ T4S, as_FloatRegister($src$$reg), - -(int)$shift$$constant & 31); + (int)$shift$$constant); %} ins_pipe(vshift128_imm); %} @@ -18106,7 +18102,7 @@ instruct vsrl2I_imm(vecD dst, vecD src, immI shift) %{ ins_encode %{ __ ushr(as_FloatRegister($dst$$reg), __ T2S, as_FloatRegister($src$$reg), - -(int)$shift$$constant & 31); + (int)$shift$$constant); %} ins_pipe(vshift64_imm); %} @@ -18119,7 +18115,7 @@ instruct vsrl4I_imm(vecX dst, vecX src, immI shift) %{ ins_encode %{ __ ushr(as_FloatRegister($dst$$reg), __ T4S, as_FloatRegister($src$$reg), - -(int)$shift$$constant & 31); + (int)$shift$$constant); %} ins_pipe(vshift128_imm); %} @@ -18159,7 +18155,7 @@ instruct vsll2L_imm(vecX dst, vecX src, immI shift) %{ ins_encode %{ __ shl(as_FloatRegister($dst$$reg), __ T2D, as_FloatRegister($src$$reg), - (int)$shift$$constant & 63); + (int)$shift$$constant); %} ins_pipe(vshift128_imm); %} @@ -18172,7 +18168,7 @@ instruct vsra2L_imm(vecX dst, vecX src, immI shift) %{ ins_encode %{ __ sshr(as_FloatRegister($dst$$reg), __ T2D, as_FloatRegister($src$$reg), - -(int)$shift$$constant & 63); + (int)$shift$$constant); %} ins_pipe(vshift128_imm); %} @@ -18185,7 +18181,7 @@ instruct vsrl2L_imm(vecX dst, vecX src, immI shift) %{ ins_encode %{ __ ushr(as_FloatRegister($dst$$reg), __ T2D, as_FloatRegister($src$$reg), - -(int)$shift$$constant & 63); + (int)$shift$$constant); %} ins_pipe(vshift128_imm); %} diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp index 2a9766f5143..23d0c691ce1 100644 --- a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp @@ -848,7 +848,7 @@ public: // architecture. In debug mode we shrink it in order to test // trampolines, but not so small that branches in the interpreter // are out of range. - static const unsigned long branch_range = INCLUDE_JVMCI ? 128 * M : NOT_DEBUG(128 * M) DEBUG_ONLY(2 * M); + static const unsigned long branch_range = NOT_DEBUG(128 * M) DEBUG_ONLY(2 * M); static bool reachable_from_branch_at(address branch, address target) { return uabs(target - branch) < branch_range; @@ -2295,23 +2295,32 @@ public: rf(Vn, 5), rf(Rd, 0); } -#define INSN(NAME, opc, opc2) \ +#define INSN(NAME, opc, opc2, isSHR) \ void NAME(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn, int shift){ \ starti; \ - /* The encodings for the immh:immb fields (bits 22:16) are \ - * 0001 xxx 8B/16B, shift = xxx \ - * 001x xxx 4H/8H, shift = xxxx \ - * 01xx xxx 2S/4S, shift = xxxxx \ - * 1xxx xxx 1D/2D, shift = xxxxxx (1D is RESERVED) \ + /* The encodings for the immh:immb fields (bits 22:16) in *SHR are \ + * 0001 xxx 8B/16B, shift = 16 - UInt(immh:immb) \ + * 001x xxx 4H/8H, shift = 32 - UInt(immh:immb) \ + * 01xx xxx 2S/4S, shift = 64 - UInt(immh:immb) \ + * 1xxx xxx 1D/2D, shift = 128 - UInt(immh:immb) \ + * (1D is RESERVED) \ + * for SHL shift is calculated as: \ + * 0001 xxx 8B/16B, shift = UInt(immh:immb) - 8 \ + * 001x xxx 4H/8H, shift = UInt(immh:immb) - 16 \ + * 01xx xxx 2S/4S, shift = UInt(immh:immb) - 32 \ + * 1xxx xxx 1D/2D, shift = UInt(immh:immb) - 64 \ + * (1D is RESERVED) \ */ \ assert((1 << ((T>>1)+3)) > shift, "Invalid Shift value"); \ + int cVal = (1 << (((T >> 1) + 3) + (isSHR ? 1 : 0))); \ + int encodedShift = isSHR ? cVal - shift : cVal + shift; \ f(0, 31), f(T & 1, 30), f(opc, 29), f(0b011110, 28, 23), \ - f((1 << ((T>>1)+3))|shift, 22, 16); f(opc2, 15, 10), rf(Vn, 5), rf(Vd, 0); \ + f(encodedShift, 22, 16); f(opc2, 15, 10), rf(Vn, 5), rf(Vd, 0); \ } - INSN(shl, 0, 0b010101); - INSN(sshr, 0, 0b000001); - INSN(ushr, 1, 0b000001); + INSN(shl, 0, 0b010101, /* isSHR = */ false); + INSN(sshr, 0, 0b000001, /* isSHR = */ true); + INSN(ushr, 1, 0b000001, /* isSHR = */ true); #undef INSN diff --git a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp index ecd4a8e19f2..c09e3d46767 100644 --- a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -2532,7 +2532,7 @@ void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) { ciMethodData* md = method->method_data_or_null(); assert(md != NULL, "Sanity"); ciProfileData* data = md->bci_to_data(bci); - assert(data->is_CounterData(), "need CounterData for calls"); + assert(data != NULL && data->is_CounterData(), "need CounterData for calls"); assert(op->mdo()->is_single_cpu(), "mdo must be allocated"); Register mdo = op->mdo()->as_register(); __ mov_metadata(mdo, md->constant_encoding()); diff --git a/src/hotspot/cpu/aarch64/compiledIC_aarch64.cpp b/src/hotspot/cpu/aarch64/compiledIC_aarch64.cpp index 3059ad37bc6..09860aa0708 100644 --- a/src/hotspot/cpu/aarch64/compiledIC_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/compiledIC_aarch64.cpp @@ -71,6 +71,13 @@ int CompiledStaticCall::to_interp_stub_size() { return 7 * NativeInstruction::instruction_size; } +int CompiledStaticCall::to_trampoline_stub_size() { + // Somewhat pessimistically, we count 3 instructions here (although + // there are only two) because we sometimes emit an alignment nop. + // Trampoline stubs are always word aligned. + return 3 * NativeInstruction::instruction_size + wordSize; +} + // Relocation entries for call stub, compiled java to interpreter. int CompiledStaticCall::reloc_to_interp_stub() { return 4; // 3 in emit_to_interp_stub + 1 in emit_call diff --git a/src/hotspot/cpu/aarch64/jvmciCodeInstaller_aarch64.cpp b/src/hotspot/cpu/aarch64/jvmciCodeInstaller_aarch64.cpp index bebd5ae8ca9..9e36f607234 100644 --- a/src/hotspot/cpu/aarch64/jvmciCodeInstaller_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/jvmciCodeInstaller_aarch64.cpp @@ -109,7 +109,7 @@ void CodeInstaller::pd_relocate_ForeignCall(NativeInstruction* inst, jlong forei TRACE_jvmci_3("relocating (foreign call) at " PTR_FORMAT, p2i(inst)); } -void CodeInstaller::pd_relocate_JavaMethod(Handle hotspot_method, jint pc_offset, TRAPS) { +void CodeInstaller::pd_relocate_JavaMethod(CodeBuffer &cbuf, Handle hotspot_method, jint pc_offset, TRAPS) { #ifdef ASSERT Method* method = NULL; // we need to check, this might also be an unresolved method @@ -124,22 +124,22 @@ void CodeInstaller::pd_relocate_JavaMethod(Handle hotspot_method, jint pc_offset case INVOKEINTERFACE: { assert(method == NULL || !method->is_static(), "cannot call static method with invokeinterface"); NativeCall* call = nativeCall_at(_instructions->start() + pc_offset); - call->set_destination(SharedRuntime::get_resolve_virtual_call_stub()); _instructions->relocate(call->instruction_address(), virtual_call_Relocation::spec(_invoke_mark_pc)); + call->trampoline_jump(cbuf, SharedRuntime::get_resolve_virtual_call_stub()); break; } case INVOKESTATIC: { assert(method == NULL || method->is_static(), "cannot call non-static method with invokestatic"); NativeCall* call = nativeCall_at(_instructions->start() + pc_offset); - call->set_destination(SharedRuntime::get_resolve_static_call_stub()); _instructions->relocate(call->instruction_address(), relocInfo::static_call_type); + call->trampoline_jump(cbuf, SharedRuntime::get_resolve_static_call_stub()); break; } case INVOKESPECIAL: { assert(method == NULL || !method->is_static(), "cannot call static method with invokespecial"); NativeCall* call = nativeCall_at(_instructions->start() + pc_offset); - call->set_destination(SharedRuntime::get_resolve_opt_virtual_call_stub()); _instructions->relocate(call->instruction_address(), relocInfo::opt_virtual_call_type); + call->trampoline_jump(cbuf, SharedRuntime::get_resolve_opt_virtual_call_stub()); break; } default: diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp index 5bc06e36533..87c2ba75194 100644 --- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp @@ -801,7 +801,7 @@ address MacroAssembler::emit_trampoline_stub(int insts_call_instruction_offset, assert(is_NativeCallTrampolineStub_at(stub_start_addr), "doesn't look like a trampoline"); end_a_stub(); - return stub; + return stub_start_addr; } address MacroAssembler::ic_call(address entry, jint method_index) { diff --git a/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp b/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp index 6a313273ea6..98672792a32 100644 --- a/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp @@ -367,3 +367,24 @@ void NativeCallTrampolineStub::set_destination(address new_destination) { set_ptr_at(data_offset, new_destination); OrderAccess::release(); } + +// Generate a trampoline for a branch to dest. If there's no need for a +// trampoline, simply patch the call directly to dest. +address NativeCall::trampoline_jump(CodeBuffer &cbuf, address dest) { + MacroAssembler a(&cbuf); + address stub = NULL; + + if (a.far_branches() + && ! is_NativeCallTrampolineStub_at(instruction_address() + displacement())) { + stub = a.emit_trampoline_stub(instruction_address() - cbuf.insts()->start(), dest); + } + + if (stub == NULL) { + // If we generated no stub, patch this call directly to dest. + // This will happen if we don't need far branches or if there + // already was a trampoline. + set_destination(dest); + } + + return stub; +} diff --git a/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp b/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp index a3a6d6a1302..da61fcf75d1 100644 --- a/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp @@ -61,7 +61,7 @@ class NativeInstruction VALUE_OBJ_CLASS_SPEC { return uint_at(0); } - bool is_blr() const { return (encoding() & 0xfffffc1f) == 0xd63f0000; } + bool is_blr() const { return (encoding() & 0xff9ffc1f) == 0xd61f0000; } // blr(register) or br(register) bool is_adr_aligned() const { return (encoding() & 0xff000000) == 0x10000000; } // adr Xn,
          "); + writer.println(""); + writer.println("
          "); ConstantNode n; for (Node node : components) { n = (ConstantNode)node; - writer.println(""); + writer.println(""); n.document(writer); } writer.println("
          "); diff --git a/make/jdk/src/classes/build/tools/jdwpgen/ErrorSetNode.java b/make/jdk/src/classes/build/tools/jdwpgen/ErrorSetNode.java index 2cfe505a858..50dd0af39d4 100644 --- a/make/jdk/src/classes/build/tools/jdwpgen/ErrorSetNode.java +++ b/make/jdk/src/classes/build/tools/jdwpgen/ErrorSetNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,7 @@ class ErrorSetNode extends AbstractSimpleNode { if (components.isEmpty()) { writer.println("
          (None)"); } else { - writer.println("
          "); + writer.println("
          "); for (Node node : components) { node.document(writer); } diff --git a/make/jdk/src/classes/build/tools/jdwpgen/RootNode.java b/make/jdk/src/classes/build/tools/jdwpgen/RootNode.java index 2361f335949..da485d66a61 100644 --- a/make/jdk/src/classes/build/tools/jdwpgen/RootNode.java +++ b/make/jdk/src/classes/build/tools/jdwpgen/RootNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,11 +41,22 @@ class RootNode extends AbstractNamedNode { void document(PrintWriter writer) { writer.println(""); - writer.println("" + comment() + ""); - writer.println(""); + writer.println(""); + writer.println(""); + writer.println(""); + writer.println("" + comment() + ""); + writer.println(""); + writer.println(""); + writer.println(""); + writer.println("
            "); for (Node node : components) { node.documentIndex(writer); } + writer.println("
          "); for (Node node : components) { node.document(writer); } diff --git a/make/jdk/src/classes/build/tools/jigsaw/GenGraphs.java b/make/jdk/src/classes/build/tools/jigsaw/GenGraphs.java index 8301929ebd1..a721ca19815 100644 --- a/make/jdk/src/classes/build/tools/jigsaw/GenGraphs.java +++ b/make/jdk/src/classes/build/tools/jigsaw/GenGraphs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -144,8 +144,6 @@ public class GenGraphs { ranks.add(Set.of("java.sql")); ranks.add(Set.of("java.compiler", "java.instrument")); ranks.add(Set.of("java.desktop", "java.management")); - ranks.add(Set.of("java.corba", "java.xml.ws")); - ranks.add(Set.of("java.xml.bind", "java.xml.ws.annotation")); this.attrs = attrs; } diff --git a/make/jdk/src/classes/build/tools/jigsaw/technology-summary.html b/make/jdk/src/classes/build/tools/jigsaw/technology-summary.html index 1c86f905f19..3f581433245 100644 --- a/make/jdk/src/classes/build/tools/jigsaw/technology-summary.html +++ b/make/jdk/src/classes/build/tools/jigsaw/technology-summary.html @@ -1,11 +1,10 @@ -JCP Technologies in JDK 9 +JCP Technologies in JDK 11 -

          JCP Technologies in JDK 9

          +

          JCP Technologies in JDK 11

          -

          Last updated 2017-06-08

          +

          Last updated 2018-02-07

          -

          JDK 9 Module Summary | Technologies in the Java SE 8 Documentation

          +

          JDK 11 Module Summary | Technologies in the Java SE 9 Documentation

          - - +
          Legend
          JCP technology in the Java SE Platform only -- in java.base
          JCP technology in the Java SE Platform only -- not in java.base
          JCP technology in the Java SE Platform derived from the Java EE Platform
          JCP technology in the Java SE Platform derived from non-JCP standards
          JCP technology in neither the Java SE or EE Platforms
          JCP technology not included in the Java SE Platform

          @@ -50,7 +48,7 @@ td.agg { background-color: lightgray; }
          boot No java.sejava.se
          No
          907JTA (XA)Original JSRjava.sqlplatNoFormerly a Standalone Technology (unlisted)
          (W3C)Formerly an Endorsed Standard
          (OMG)RMI-IIOP, IDLUJSR for Java SEjava.corbaplatYesFormerly an Endorsed Standardjava.se.ee
          67SAAJOriginal JSRjava.xml.wsplatYesFormerly a Standalone Technology (f.k.a. JAXM)
          181Web Services MetadataOriginal JSRjava.xml.wsplatYesFormerly a Standalone Technology (unlisted)
          222JAXBOriginal JSRjava.xml.bindplatYesFormerly a Standalone Technology
          224JAXWSOriginal JSRjava.xml.wsplatYesFormerly a Standalone Technology
          250Common AnnotationsOriginal JSRjava.xml.ws.annotationplatYesFormerly a Standalone Technology (unlisted)
          907JTA (non-XA)Original JSRjava.transactionplatYesFormerly a Standalone Technology (unlisted)
          907JTA (XA)Original JSRjava.sqlplatNoFormerly a Standalone Technology (unlisted)java.se
          925JAFOriginal JSRjava.activationplatYesFormerly a Standalone Technology (unlisted)java.se.ee
          56 JNLP
          - +
          + @@ -369,8 +378,8 @@ -
          Phase
          - +
          + @@ -500,13 +509,13 @@ -
          +
          -
          Phase
          +
                 typedef 
          @@ -528,7 +537,7 @@
             
          -
          + @@ -536,8 +545,8 @@ -

          -


          +
          +

          @@ -557,8 +566,8 @@ typedef struct { -

          -


          +
          +

          Event Index

            @@ -585,9 +594,9 @@ typedef struct {

            -
            +

            -

            +

            @@ -660,13 +669,13 @@ typedef struct {
             
             
             
            -    
            -      
            -        
            + + + - + @@ -691,18 +700,18 @@ typedef struct { -
            -
            Field
            - -
            + + + - + - + @@ -772,11 +781,9 @@ typedef struct {
            -
            All types are unsigned int : 1
            Field - - - . - - + + . + @@ -806,14 +813,12 @@ typedef struct {
            - - - - - - - -
            + + + + + + - + @@ -861,7 +866,7 @@ typedef struct { -
            ( @@ -824,7 +829,7 @@ typedef struct {
            Constant + @@ -876,13 +881,13 @@ typedef struct {

            - - -
            + + + - + @@ -949,7 +954,7 @@ typedef struct { -

            +

            @@ -1064,14 +1069,14 @@ typedef struct { -

            -

            Type
            - -
            +
            + + + - + @@ -1111,17 +1116,28 @@ typedef struct { -

            -

            Parameters
            Name
            - -
            +
            + + + + 2 + 1 + + + + + - @@ -1152,7 +1168,7 @@ typedef struct { - + @@ -1164,13 +1180,13 @@ typedef struct { - - + - + @@ -1185,10 +1201,10 @@ typedef struct { -

            -

            Capabilities
            + Required Functionality
            Capability
            +
            Optional Features
            Capability
            - -
            +
            + + + @@ -1197,12 +1213,12 @@ typedef struct { Required Functionality - - + - + @@ -1275,10 +1291,21 @@ typedef struct { -

            -

            Capabilities
            +
            Event Enabling Capabilities
            Capability
            - -
            +
            + + + + 2 + 1 + + + + + @@ -1291,7 +1318,7 @@ typedef struct { or one of the following errors - + @@ -1305,7 +1332,7 @@ typedef struct { - @@ -1673,36 +1700,35 @@ typedef struct { -

            -


            +
            +

            Errors

            -

            +

            -

            +

            -

            +

            -

            -


            +
            +

            Data Types

            -

            +

            -

            - -

            Errors
            Error
            + This function returns a universal error
            - -
            +
            + + + - + @@ -1714,15 +1740,14 @@ typedef struct {
            Structure Type Definitions
            Type
            -

            - - - -
            +
            + + + - + @@ -1734,15 +1759,14 @@ typedef struct {
            Function Type Definitions
            Type
            -

            - - - -
            +
            + + + - + @@ -1754,15 +1778,14 @@ typedef struct {
            Enumeration Definitions
            Type
            -

            - - - - - @@ -1852,11 +1875,11 @@ typedef struct { -

            +

            -

            +

            @@ -1870,20 +1893,21 @@ typedef struct {
            -

            +

            -


            +
            +

            Change History

            Last update:
            Version: -

            +

            -

            -

            +
            + + + - + @@ -1778,7 +1801,7 @@ typedef struct {
            Function Table Layout
            Position
            -

            +

            @@ -1787,7 +1810,7 @@ typedef struct {
            +
            - +
            +
            + - @@ -2027,10 +2055,14 @@ typedef struct { - -

            + +

            -

            +
            +
            + + +
            @@ -2041,7 +2073,7 @@ typedef struct {
              - + list-style-type:
            diff --git a/src/hotspot/share/prims/jvmtiEnvBase.cpp b/src/hotspot/share/prims/jvmtiEnvBase.cpp index 18d59fbc2e8..3db530ae4e0 100644 --- a/src/hotspot/share/prims/jvmtiEnvBase.cpp +++ b/src/hotspot/share/prims/jvmtiEnvBase.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -677,7 +677,7 @@ JvmtiEnvBase::get_owned_monitors(JavaThread *calling_thread, JavaThread* java_th int depth = 0; for (javaVFrame *jvf = java_thread->last_java_vframe(®_map); jvf != NULL; jvf = jvf->java_sender()) { - if (depth++ < MaxJavaStackTraceDepth) { // check for stack too deep + if (MaxJavaStackTraceDepth == 0 || depth++ < MaxJavaStackTraceDepth) { // check for stack too deep // add locked objects for this frame into list err = get_locked_objects_in_frame(calling_thread, java_thread, jvf, owned_monitors_list, depth-1); if (err != JVMTI_ERROR_NONE) { diff --git a/src/hotspot/share/prims/jvmtiExport.cpp b/src/hotspot/share/prims/jvmtiExport.cpp index 631ddcdabaa..458a04b880d 100644 --- a/src/hotspot/share/prims/jvmtiExport.cpp +++ b/src/hotspot/share/prims/jvmtiExport.cpp @@ -597,12 +597,10 @@ void JvmtiExport::enter_primordial_phase() { } void JvmtiExport::enter_early_start_phase() { - JvmtiManageCapabilities::recompute_always_capabilities(); set_early_vmstart_recorded(true); } void JvmtiExport::enter_start_phase() { - JvmtiManageCapabilities::recompute_always_capabilities(); JvmtiEnvBase::set_phase(JVMTI_PHASE_START); } diff --git a/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp b/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp index b404283cb46..cc78e646c50 100644 --- a/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp +++ b/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,6 +29,9 @@ #include "prims/jvmtiGetLoadedClasses.hpp" #include "runtime/thread.hpp" #include "utilities/stack.inline.hpp" +#if INCLUDE_ALL_GCS +#include "gc/g1/g1SATBCardTableModRefBS.hpp" +#endif // The closure for GetLoadedClasses @@ -38,6 +41,20 @@ private: JvmtiEnv* _env; Thread* _cur_thread; +// Tell the GC to keep this klass alive +static void ensure_klass_alive(oop o) { + // A klass that was previously considered dead can be looked up in the + // CLD/SD, and its _java_mirror or _class_loader can be stored in a root + // or a reachable object making it alive again. The SATB part of G1 needs + // to get notified about this potential resurrection, otherwise the marking + // might not find the object. +#if INCLUDE_ALL_GCS + if (UseG1GC && o != NULL) { + G1SATBCardTableModRefBS::enqueue(o); + } +#endif +} + public: LoadedClassesClosure(Thread* thread, JvmtiEnv* env) : _cur_thread(thread), _env(env) { assert(_cur_thread == Thread::current(), "must be current thread"); @@ -46,6 +63,7 @@ public: void do_klass(Klass* k) { // Collect all jclasses _classStack.push((jclass) _env->jni_reference(Handle(_cur_thread, k->java_mirror()))); + ensure_klass_alive(k->java_mirror()); } int extract(jclass* result_list) { diff --git a/src/hotspot/share/prims/jvmtiLib.xsl b/src/hotspot/share/prims/jvmtiLib.xsl index fda6abc99c5..3c3ef9e0856 100644 --- a/src/hotspot/share/prims/jvmtiLib.xsl +++ b/src/hotspot/share/prims/jvmtiLib.xsl @@ -1,7 +1,7 @@ " PTR_FORMAT, size, p2i(ptr)); + log_warning(malloc, free)("os::malloc caught, " SIZE_FORMAT " bytes --> " PTR_FORMAT, size, p2i(ptr)); breakpoint(); } debug_only(if (paranoid) verify_memory(ptr)); - if (PrintMalloc && tty != NULL) { - tty->print_cr("os::malloc " SIZE_FORMAT " bytes --> " PTR_FORMAT, size, p2i(ptr)); - } // we do not track guard memory return MemTracker::record_malloc((address)ptr, size, memflags, stack, level); @@ -727,7 +728,7 @@ void* os::realloc(void *memblock, size_t size, MEMFLAGS memflags, const NativeCa return os::malloc(size, memflags, stack); } if ((intptr_t)memblock == (intptr_t)MallocCatchPtr) { - tty->print_cr("os::realloc caught " PTR_FORMAT, p2i(memblock)); + log_warning(malloc, free)("os::realloc caught " PTR_FORMAT, p2i(memblock)); breakpoint(); } // NMT support @@ -735,18 +736,15 @@ void* os::realloc(void *memblock, size_t size, MEMFLAGS memflags, const NativeCa verify_memory(membase); // always move the block void* ptr = os::malloc(size, memflags, stack); - if (PrintMalloc && tty != NULL) { - tty->print_cr("os::realloc " SIZE_FORMAT " bytes, " PTR_FORMAT " --> " PTR_FORMAT, size, p2i(memblock), p2i(ptr)); - } // Copy to new memory if malloc didn't fail - if ( ptr != NULL ) { + if (ptr != NULL ) { GuardedMemory guarded(MemTracker::malloc_base(memblock)); // Guard's user data contains NMT header size_t memblock_size = guarded.get_user_size() - MemTracker::malloc_header_size(memblock); memcpy(ptr, memblock, MIN2(size, memblock_size)); if (paranoid) verify_memory(MemTracker::malloc_base(ptr)); if ((intptr_t)ptr == (intptr_t)MallocCatchPtr) { - tty->print_cr("os::realloc caught, " SIZE_FORMAT " bytes --> " PTR_FORMAT, size, p2i(ptr)); + log_warning(malloc, free)("os::realloc caught, " SIZE_FORMAT " bytes --> " PTR_FORMAT, size, p2i(ptr)); breakpoint(); } os::free(memblock); @@ -761,7 +759,7 @@ void os::free(void *memblock) { #ifdef ASSERT if (memblock == NULL) return; if ((intptr_t)memblock == (intptr_t)MallocCatchPtr) { - if (tty != NULL) tty->print_cr("os::free caught " PTR_FORMAT, p2i(memblock)); + log_warning(malloc, free)("os::free caught " PTR_FORMAT, p2i(memblock)); breakpoint(); } void* membase = MemTracker::record_free(memblock); @@ -771,9 +769,6 @@ void os::free(void *memblock) { size_t size = guarded.get_user_size(); inc_stat_counter(&free_bytes, size); membase = guarded.release_for_freeing(); - if (PrintMalloc && tty != NULL) { - fprintf(stderr, "os::free " SIZE_FORMAT " bytes --> " PTR_FORMAT "\n", size, (uintptr_t)membase); - } ::free(membase); #else void* membase = MemTracker::record_free(memblock); @@ -987,6 +982,11 @@ void os::print_date_and_time(outputStream *st, char* buf, size_t buflen) { // The verbose parameter is only set by the debug code in one case void os::print_location(outputStream* st, intptr_t x, bool verbose) { address addr = (address)x; + // Handle NULL first, so later checks don't need to protect against it. + if (addr == NULL) { + st->print_cr("0x0 is NULL"); + return; + } CodeBlob* b = CodeCache::find_blob_unsafe(addr); if (b != NULL) { if (b->is_buffer_blob()) { @@ -1087,7 +1087,7 @@ void os::print_location(outputStream* st, intptr_t x, bool verbose) { } #ifndef PRODUCT // we don't keep the block list in product mode - if (JNIHandleBlock::any_contains((jobject) addr)) { + if (JNIHandles::is_local_handle((jobject) addr)) { st->print_cr(INTPTR_FORMAT " is a local jni handle", p2i(addr)); return; } @@ -1749,7 +1749,7 @@ void os::commit_memory_or_exit(char* addr, size_t size, size_t alignment_hint, bool os::uncommit_memory(char* addr, size_t bytes) { bool res; if (MemTracker::tracking_level() > NMT_minimal) { - Tracker tkr = MemTracker::get_virtual_memory_uncommit_tracker(); + Tracker tkr(Tracker::uncommit); res = pd_uncommit_memory(addr, bytes); if (res) { tkr.record((address)addr, bytes); @@ -1763,7 +1763,7 @@ bool os::uncommit_memory(char* addr, size_t bytes) { bool os::release_memory(char* addr, size_t bytes) { bool res; if (MemTracker::tracking_level() > NMT_minimal) { - Tracker tkr = MemTracker::get_virtual_memory_release_tracker(); + Tracker tkr(Tracker::release); res = pd_release_memory(addr, bytes); if (res) { tkr.record((address)addr, bytes); @@ -1800,7 +1800,7 @@ char* os::remap_memory(int fd, const char* file_name, size_t file_offset, bool os::unmap_memory(char *addr, size_t bytes) { bool result; if (MemTracker::tracking_level() > NMT_minimal) { - Tracker tkr = MemTracker::get_virtual_memory_release_tracker(); + Tracker tkr(Tracker::release); result = pd_unmap_memory(addr, bytes); if (result) { tkr.record((address)addr, bytes); diff --git a/src/hotspot/share/runtime/os.hpp b/src/hotspot/share/runtime/os.hpp index 83b24f574ed..50324026166 100644 --- a/src/hotspot/share/runtime/os.hpp +++ b/src/hotspot/share/runtime/os.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -717,9 +717,6 @@ class os: AllStatic { // Fills in path to jvm.dll/libjvm.so (used by the Disassembler) static void jvm_path(char *buf, jint buflen); - // Returns true if we are running in a headless jre. - static bool is_headless_jre(); - // JNI names static void print_jni_name_prefix_on(outputStream* st, int args_size); static void print_jni_name_suffix_on(outputStream* st, int args_size); @@ -778,7 +775,6 @@ class os: AllStatic { static void* signal(int signal_number, void* handler); static void signal_raise(int signal_number); static int signal_wait(); - static int signal_lookup(); static void* user_handler(); static void terminate_signal_thread(); static int sigexitnum_pd(); diff --git a/src/hotspot/share/runtime/safepoint.cpp b/src/hotspot/share/runtime/safepoint.cpp index 23d56c8e0d5..4c573746361 100644 --- a/src/hotspot/share/runtime/safepoint.cpp +++ b/src/hotspot/share/runtime/safepoint.cpp @@ -103,7 +103,7 @@ void SafepointSynchronize::begin() { int nof_threads = Threads::number_of_threads(); - log_debug(safepoint)("Safepoint synchronization initiated. (%d)", nof_threads); + log_debug(safepoint)("Safepoint synchronization initiated. (%d threads)", nof_threads); RuntimeService::record_safepoint_begin(); @@ -407,9 +407,7 @@ void SafepointSynchronize::begin() { // Update the count of active JNI critical regions GCLocker::set_jni_lock_count(_current_jni_active_count); - if (log_is_enabled(Debug, safepoint)) { - log_debug(safepoint)("Entering safepoint region: %s", VMThread::vm_safepoint_description()); - } + log_info(safepoint)("Entering safepoint region: %s", VMThread::vm_safepoint_description()); RuntimeService::record_safepoint_synchronized(); if (PrintSafepointStatistics) { @@ -496,14 +494,14 @@ void SafepointSynchronize::end() { cur_state->restart(); // TSS _running SafepointMechanism::disarm_local_poll(current); // release store, local state -> polling page } - log_debug(safepoint)("Leaving safepoint region"); + log_info(safepoint)("Leaving safepoint region"); } else { // Set to not synchronized, so the threads will not go into the signal_thread_blocked method // when they get restarted. _state = _not_synchronized; OrderAccess::fence(); - log_debug(safepoint)("Leaving safepoint region"); + log_info(safepoint)("Leaving safepoint region"); // Start suspended threads jtiwh.rewind(); diff --git a/src/hotspot/share/runtime/stubRoutines.cpp b/src/hotspot/share/runtime/stubRoutines.cpp index 3043e9382d7..ec0be25e9e3 100644 --- a/src/hotspot/share/runtime/stubRoutines.cpp +++ b/src/hotspot/share/runtime/stubRoutines.cpp @@ -62,12 +62,11 @@ address StubRoutines::_verify_oop_subroutine_entry = NULL; address StubRoutines::_atomic_xchg_entry = NULL; address StubRoutines::_atomic_xchg_long_entry = NULL; address StubRoutines::_atomic_store_entry = NULL; -address StubRoutines::_atomic_store_ptr_entry = NULL; address StubRoutines::_atomic_cmpxchg_entry = NULL; address StubRoutines::_atomic_cmpxchg_byte_entry = NULL; address StubRoutines::_atomic_cmpxchg_long_entry = NULL; address StubRoutines::_atomic_add_entry = NULL; -address StubRoutines::_atomic_add_ptr_entry = NULL; +address StubRoutines::_atomic_add_long_entry = NULL; address StubRoutines::_fence_entry = NULL; address StubRoutines::_d2i_wrapper = NULL; address StubRoutines::_d2l_wrapper = NULL; diff --git a/src/hotspot/share/runtime/stubRoutines.hpp b/src/hotspot/share/runtime/stubRoutines.hpp index 25884a86b90..23f5f35d44f 100644 --- a/src/hotspot/share/runtime/stubRoutines.hpp +++ b/src/hotspot/share/runtime/stubRoutines.hpp @@ -103,12 +103,11 @@ class StubRoutines: AllStatic { static address _atomic_xchg_entry; static address _atomic_xchg_long_entry; static address _atomic_store_entry; - static address _atomic_store_ptr_entry; static address _atomic_cmpxchg_entry; static address _atomic_cmpxchg_byte_entry; static address _atomic_cmpxchg_long_entry; static address _atomic_add_entry; - static address _atomic_add_ptr_entry; + static address _atomic_add_long_entry; static address _fence_entry; static address _d2i_wrapper; static address _d2l_wrapper; @@ -277,12 +276,11 @@ class StubRoutines: AllStatic { static address atomic_xchg_entry() { return _atomic_xchg_entry; } static address atomic_xchg_long_entry() { return _atomic_xchg_long_entry; } static address atomic_store_entry() { return _atomic_store_entry; } - static address atomic_store_ptr_entry() { return _atomic_store_ptr_entry; } static address atomic_cmpxchg_entry() { return _atomic_cmpxchg_entry; } static address atomic_cmpxchg_byte_entry() { return _atomic_cmpxchg_byte_entry; } static address atomic_cmpxchg_long_entry() { return _atomic_cmpxchg_long_entry; } static address atomic_add_entry() { return _atomic_add_entry; } - static address atomic_add_ptr_entry() { return _atomic_add_ptr_entry; } + static address atomic_add_long_entry() { return _atomic_add_long_entry; } static address fence_entry() { return _fence_entry; } static address d2i_wrapper() { return _d2i_wrapper; } diff --git a/src/hotspot/share/runtime/synchronizer.cpp b/src/hotspot/share/runtime/synchronizer.cpp index 6b8898959c8..82fc6a012bb 100644 --- a/src/hotspot/share/runtime/synchronizer.cpp +++ b/src/hotspot/share/runtime/synchronizer.cpp @@ -238,8 +238,7 @@ bool ObjectSynchronizer::quick_enter(oop obj, Thread * Self, // and last are the inflated Java Monitor (ObjectMonitor) checks. lock->set_displaced_header(markOopDesc::unused_mark()); - if (owner == NULL && - Atomic::cmpxchg(Self, &(m->_owner), (void*)NULL) == NULL) { + if (owner == NULL && Atomic::replace_if_null(Self, &(m->_owner))) { assert(m->_recursions == 0, "invariant"); assert(m->_owner == Self, "invariant"); return true; diff --git a/src/hotspot/share/runtime/thread.cpp b/src/hotspot/share/runtime/thread.cpp index 9721e98c020..1994c86eb0c 100644 --- a/src/hotspot/share/runtime/thread.cpp +++ b/src/hotspot/share/runtime/thread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -3200,7 +3200,7 @@ void JavaThread::print_stack_on(outputStream* st) { RegisterMap reg_map(this); vframe* start_vf = last_java_vframe(®_map); int count = 0; - for (vframe* f = start_vf; f; f = f->sender()) { + for (vframe* f = start_vf; f != NULL; f = f->sender()) { if (f->is_java_frame()) { javaVFrame* jvf = javaVFrame::cast(f); java_lang_Throwable::print_stack_element(st, jvf->method(), jvf->bci()); @@ -3213,9 +3213,9 @@ void JavaThread::print_stack_on(outputStream* st) { // Ignore non-Java frames } - // Bail-out case for too deep stacks + // Bail-out case for too deep stacks if MaxJavaStackTraceDepth > 0 count++; - if (MaxJavaStackTraceDepth == count) return; + if (MaxJavaStackTraceDepth > 0 && MaxJavaStackTraceDepth == count) return; } } @@ -4039,9 +4039,16 @@ static OnLoadEntry_t lookup_on_load(AgentLibrary* agent, } if (library == NULL) { const char *sub_msg = " on the library path, with error: "; - size_t len = strlen(msg) + strlen(name) + strlen(sub_msg) + strlen(ebuf) + 1; + const char *sub_msg2 = "\nModule java.instrument may be missing from runtime image."; + + size_t len = strlen(msg) + strlen(name) + strlen(sub_msg) + + strlen(ebuf) + strlen(sub_msg2) + 1; char *buf = NEW_C_HEAP_ARRAY(char, len, mtThread); - jio_snprintf(buf, len, "%s%s%s%s", msg, name, sub_msg, ebuf); + if (!agent->is_instrument_lib()) { + jio_snprintf(buf, len, "%s%s%s%s", msg, name, sub_msg, ebuf); + } else { + jio_snprintf(buf, len, "%s%s%s%s%s", msg, name, sub_msg, ebuf, sub_msg2); + } // If we can't find the agent, exit. vm_exit_during_initialization(buf, NULL); FREE_C_HEAP_ARRAY(char, buf); diff --git a/src/hotspot/share/runtime/vmStructs.cpp b/src/hotspot/share/runtime/vmStructs.cpp index c613aa0b074..5b6208e3bc3 100644 --- a/src/hotspot/share/runtime/vmStructs.cpp +++ b/src/hotspot/share/runtime/vmStructs.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -55,6 +55,7 @@ #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/generation.hpp" #include "gc/shared/generationSpec.hpp" +#include "gc/shared/oopStorage.hpp" #include "gc/shared/space.hpp" #include "interpreter/bytecodeInterpreter.hpp" #include "interpreter/bytecodes.hpp" @@ -948,10 +949,8 @@ typedef PaddedEnd PaddedObjectMonitor; /*********************************/ \ /* JNIHandles and JNIHandleBlock */ \ /*********************************/ \ - static_field(JNIHandles, _global_handles, JNIHandleBlock*) \ - static_field(JNIHandles, _weak_global_handles, JNIHandleBlock*) \ - static_field(JNIHandles, _deleted_handle, oop) \ - \ + static_field(JNIHandles, _global_handles, OopStorage*) \ + static_field(JNIHandles, _weak_global_handles, OopStorage*) \ unchecked_nonstatic_field(JNIHandleBlock, _handles, JNIHandleBlock::block_size_in_oops * sizeof(Oop)) /* Note: no type */ \ nonstatic_field(JNIHandleBlock, _top, int) \ nonstatic_field(JNIHandleBlock, _next, JNIHandleBlock*) \ @@ -1677,6 +1676,12 @@ typedef PaddedEnd PaddedObjectMonitor; declare_toplevel_type(JNIHandleBlock) \ declare_toplevel_type(jobject) \ \ + /**************/ \ + /* OopStorage */ \ + /**************/ \ + \ + declare_toplevel_type(OopStorage) \ + \ /**********************/ \ /* Runtime1 (C1 only) */ \ /**********************/ \ @@ -2334,6 +2339,7 @@ typedef PaddedEnd PaddedObjectMonitor; declare_constant(JVM_CONSTANT_NameAndType) \ declare_constant(JVM_CONSTANT_MethodHandle) \ declare_constant(JVM_CONSTANT_MethodType) \ + declare_constant(JVM_CONSTANT_Dynamic) \ declare_constant(JVM_CONSTANT_InvokeDynamic) \ declare_constant(JVM_CONSTANT_ExternalMax) \ \ @@ -2345,6 +2351,7 @@ typedef PaddedEnd PaddedObjectMonitor; declare_constant(JVM_CONSTANT_UnresolvedClassInError) \ declare_constant(JVM_CONSTANT_MethodHandleInError) \ declare_constant(JVM_CONSTANT_MethodTypeInError) \ + declare_constant(JVM_CONSTANT_DynamicInError) \ declare_constant(JVM_CONSTANT_InternalMax) \ \ /*****************************/ \ diff --git a/src/hotspot/share/runtime/vm_operations.hpp b/src/hotspot/share/runtime/vm_operations.hpp index 145337a8d01..56451abe0cb 100644 --- a/src/hotspot/share/runtime/vm_operations.hpp +++ b/src/hotspot/share/runtime/vm_operations.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -67,9 +67,8 @@ template(CGC_Operation) \ template(CMS_Initial_Mark) \ template(CMS_Final_Remark) \ - template(G1CollectFull) \ template(G1CollectForAllocation) \ - template(G1IncCollectionPause) \ + template(G1CollectFull) \ template(HandshakeOneThread) \ template(HandshakeAllThreads) \ template(HandshakeFallback) \ @@ -116,6 +115,7 @@ template(ICBufferFull) \ template(ScavengeMonitors) \ template(PrintMetadata) \ + template(GTestExecuteAtSafepoint) \ class VM_Operation: public CHeapObj { public: @@ -287,6 +287,17 @@ class VM_ScavengeMonitors: public VM_ForceSafepoint { bool is_cheap_allocated() const { return true; } }; +// Base class for invoking parts of a gtest in a safepoint. +// Derived classes provide the doit method. +// Typically also need to transition the gtest thread from native to VM. +class VM_GTestExecuteAtSafepoint: public VM_Operation { + public: + VMOp_Type type() const { return VMOp_GTestExecuteAtSafepoint; } + + protected: + VM_GTestExecuteAtSafepoint() {} +}; + class VM_Deoptimize: public VM_Operation { public: VM_Deoptimize() {} diff --git a/src/hotspot/share/services/heapDumper.cpp b/src/hotspot/share/services/heapDumper.cpp index 71dbe24f0b5..a920f222b49 100644 --- a/src/hotspot/share/services/heapDumper.cpp +++ b/src/hotspot/share/services/heapDumper.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1317,9 +1317,9 @@ class JNILocalsDumper : public OopClosure { void JNILocalsDumper::do_oop(oop* obj_p) { - // ignore null or deleted handles + // ignore null handles oop o = *obj_p; - if (o != NULL && o != JNIHandles::deleted_handle()) { + if (o != NULL) { writer()->write_u1(HPROF_GC_ROOT_JNI_LOCAL); writer()->write_objectID(o); writer()->write_u4(_thread_serial_num); @@ -1347,7 +1347,7 @@ void JNIGlobalsDumper::do_oop(oop* obj_p) { oop o = *obj_p; // ignore these - if (o == NULL || o == JNIHandles::deleted_handle()) return; + if (o == NULL) return; // we ignore global ref to symbols and other internal objects if (o->is_instance() || o->is_objArray() || o->is_typeArray()) { @@ -1422,9 +1422,6 @@ class HeapObjectDumper : public ObjectClosure { }; void HeapObjectDumper::do_object(oop o) { - // hide the sentinel for deleted handles - if (o == JNIHandles::deleted_handle()) return; - // skip classes as these emitted as HPROF_GC_CLASS_DUMP records if (o->klass() == SystemDictionary::Class_klass()) { if (!java_lang_Class::is_primitive(o)) { diff --git a/src/hotspot/share/services/mallocSiteTable.cpp b/src/hotspot/share/services/mallocSiteTable.cpp index 4c6c7fe933d..d92a61ecf24 100644 --- a/src/hotspot/share/services/mallocSiteTable.cpp +++ b/src/hotspot/share/services/mallocSiteTable.cpp @@ -147,7 +147,7 @@ MallocSite* MallocSiteTable::lookup_or_add(const NativeCallStack& key, size_t* b if (entry == NULL) return NULL; // swap in the head - if (Atomic::cmpxchg(entry, &_table[index], (MallocSiteHashtableEntry*)NULL) == NULL) { + if (Atomic::replace_if_null(entry, &_table[index])) { return entry->data(); } @@ -259,5 +259,5 @@ void MallocSiteTable::AccessLock::exclusiveLock() { } bool MallocSiteHashtableEntry::atomic_insert(MallocSiteHashtableEntry* entry) { - return Atomic::cmpxchg(entry, &_next, (MallocSiteHashtableEntry*)NULL) == NULL; + return Atomic::replace_if_null(entry, &_next); } diff --git a/src/hotspot/share/services/memBaseline.cpp b/src/hotspot/share/services/memBaseline.cpp index f2d6c36188c..a56bf50a75a 100644 --- a/src/hotspot/share/services/memBaseline.cpp +++ b/src/hotspot/share/services/memBaseline.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "classfile/classLoaderData.inline.hpp" #include "memory/allocation.hpp" #include "runtime/safepoint.hpp" #include "runtime/thread.inline.hpp" @@ -180,7 +181,8 @@ bool MemBaseline::baseline_allocation_sites() { bool MemBaseline::baseline(bool summaryOnly) { reset(); - _class_count = InstanceKlass::number_of_instance_classes(); + _instance_class_count = ClassLoaderDataGraph::num_instance_classes(); + _array_class_count = ClassLoaderDataGraph::num_array_classes(); if (!baseline_summary()) { return false; diff --git a/src/hotspot/share/services/memBaseline.hpp b/src/hotspot/share/services/memBaseline.hpp index 9040306aca4..570016cbccc 100644 --- a/src/hotspot/share/services/memBaseline.hpp +++ b/src/hotspot/share/services/memBaseline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -67,7 +67,8 @@ class MemBaseline VALUE_OBJ_CLASS_SPEC { VirtualMemorySnapshot _virtual_memory_snapshot; MetaspaceSnapshot _metaspace_snapshot; - size_t _class_count; + size_t _instance_class_count; + size_t _array_class_count; // Allocation sites information // Malloc allocation sites @@ -89,7 +90,7 @@ class MemBaseline VALUE_OBJ_CLASS_SPEC { // create a memory baseline MemBaseline(): _baseline_type(Not_baselined), - _class_count(0) { + _instance_class_count(0), _array_class_count(0) { } bool baseline(bool summaryOnly = true); @@ -160,7 +161,17 @@ class MemBaseline VALUE_OBJ_CLASS_SPEC { size_t class_count() const { assert(baseline_type() != Not_baselined, "Not yet baselined"); - return _class_count; + return _instance_class_count + _array_class_count; + } + + size_t instance_class_count() const { + assert(baseline_type() != Not_baselined, "Not yet baselined"); + return _instance_class_count; + } + + size_t array_class_count() const { + assert(baseline_type() != Not_baselined, "Not yet baselined"); + return _array_class_count; } size_t thread_count() const { @@ -172,7 +183,8 @@ class MemBaseline VALUE_OBJ_CLASS_SPEC { void reset() { _baseline_type = Not_baselined; // _malloc_memory_snapshot and _virtual_memory_snapshot are copied over. - _class_count = 0; + _instance_class_count = 0; + _array_class_count = 0; _malloc_sites.clear(); _virtual_memory_sites.clear(); diff --git a/src/hotspot/share/services/memReporter.cpp b/src/hotspot/share/services/memReporter.cpp index 77abb49833d..fb880b9ffa8 100644 --- a/src/hotspot/share/services/memReporter.cpp +++ b/src/hotspot/share/services/memReporter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -145,7 +145,10 @@ void MemSummaryReporter::report_summary_of_type(MEMFLAGS flag, if (flag == mtClass) { // report class count - out->print_cr("%27s (classes #" SIZE_FORMAT ")", " ", _class_count); + out->print_cr("%27s (classes #" SIZE_FORMAT ")", + " ", (_instance_class_count + _array_class_count)); + out->print_cr("%27s ( instance classes #" SIZE_FORMAT ", array classes #" SIZE_FORMAT ")", + " ", _instance_class_count, _array_class_count); } else if (flag == mtThread) { // report thread count out->print_cr("%27s (thread #" SIZE_FORMAT ")", " ", _malloc_snapshot->thread_count()); @@ -459,6 +462,17 @@ void MemSummaryDiffReporter::diff_summary_of_type(MEMFLAGS flag, out->print(" %+d", (int)(_current_baseline.class_count() - _early_baseline.class_count())); } out->print_cr(")"); + + out->print("%27s ( instance classes #" SIZE_FORMAT, " ", _current_baseline.instance_class_count()); + if (_current_baseline.instance_class_count() != _early_baseline.instance_class_count()) { + out->print(" %+d", (int)(_current_baseline.instance_class_count() - _early_baseline.instance_class_count())); + } + out->print(", array classes #" SIZE_FORMAT, _current_baseline.array_class_count()); + if (_current_baseline.array_class_count() != _early_baseline.array_class_count()) { + out->print(" %+d", (int)(_current_baseline.array_class_count() - _early_baseline.array_class_count())); + } + out->print_cr(")"); + } else if (flag == mtThread) { // report thread count out->print("%27s (thread #" SIZE_FORMAT "", " ", _current_baseline.thread_count()); diff --git a/src/hotspot/share/services/memReporter.hpp b/src/hotspot/share/services/memReporter.hpp index f244ad55248..3fdec239365 100644 --- a/src/hotspot/share/services/memReporter.hpp +++ b/src/hotspot/share/services/memReporter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -94,7 +94,8 @@ class MemSummaryReporter : public MemReporterBase { private: MallocMemorySnapshot* _malloc_snapshot; VirtualMemorySnapshot* _vm_snapshot; - size_t _class_count; + size_t _instance_class_count; + size_t _array_class_count; public: // This constructor is for normal reporting from a recent baseline. @@ -102,7 +103,8 @@ class MemSummaryReporter : public MemReporterBase { size_t scale = K) : MemReporterBase(output, scale), _malloc_snapshot(baseline.malloc_memory_snapshot()), _vm_snapshot(baseline.virtual_memory_snapshot()), - _class_count(baseline.class_count()) { } + _instance_class_count(baseline.instance_class_count()), + _array_class_count(baseline.array_class_count()) { } // Generate summary report diff --git a/src/hotspot/share/services/memTracker.hpp b/src/hotspot/share/services/memTracker.hpp index a5d22cb6492..ca60bddfe88 100644 --- a/src/hotspot/share/services/memTracker.hpp +++ b/src/hotspot/share/services/memTracker.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,8 +36,14 @@ class Tracker : public StackObj { public: - Tracker() { } - void record(address addr, size_t size) { } + enum TrackerType { + uncommit, + release + }; + Tracker(enum TrackerType type) : _type(type) { } + void record(address addr, size_t size); + private: + enum TrackerType _type; }; class MemTracker : AllStatic { @@ -63,8 +69,6 @@ class MemTracker : AllStatic { static inline void record_virtual_memory_reserve_and_commit(void* addr, size_t size, const NativeCallStack& stack, MEMFLAGS flag = mtNone) { } static inline void record_virtual_memory_commit(void* addr, size_t size, const NativeCallStack& stack) { } - static inline Tracker get_virtual_memory_uncommit_tracker() { return Tracker(); } - static inline Tracker get_virtual_memory_release_tracker() { return Tracker(); } static inline void record_virtual_memory_type(void* addr, MEMFLAGS flag) { } static inline void record_thread_stack(void* addr, size_t size) { } static inline void release_thread_stack(void* addr, size_t size) { } @@ -227,16 +231,6 @@ class MemTracker : AllStatic { } } - static inline Tracker get_virtual_memory_uncommit_tracker() { - assert(tracking_level() >= NMT_summary, "Check by caller"); - return Tracker(Tracker::uncommit); - } - - static inline Tracker get_virtual_memory_release_tracker() { - assert(tracking_level() >= NMT_summary, "Check by caller"); - return Tracker(Tracker::release); - } - static inline void record_virtual_memory_type(void* addr, MEMFLAGS flag) { if (tracking_level() < NMT_summary) return; if (addr != NULL) { diff --git a/src/hotspot/share/services/serviceUtil.hpp b/src/hotspot/share/services/serviceUtil.hpp index 14276bb7da0..04fa2c2e694 100644 --- a/src/hotspot/share/services/serviceUtil.hpp +++ b/src/hotspot/share/services/serviceUtil.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,11 +39,6 @@ class ServiceUtil : public AllStatic { // Return true if oop represents an object that is "visible" // to the java world. static inline bool visible_oop(oop o) { - // the sentinel for deleted handles isn't visible - if (o == JNIHandles::deleted_handle()) { - return false; - } - // instance if (o->is_instance()) { // instance objects are visible diff --git a/src/hotspot/share/services/threadService.cpp b/src/hotspot/share/services/threadService.cpp index 9a1a4ae393d..2323efd0327 100644 --- a/src/hotspot/share/services/threadService.cpp +++ b/src/hotspot/share/services/threadService.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -489,7 +489,7 @@ StackFrameInfo::StackFrameInfo(javaVFrame* jvf, bool with_lock_info) { _locked_monitors = new (ResourceObj::C_HEAP, mtInternal) GrowableArray(length, true); for (int i = 0; i < length; i++) { MonitorInfo* monitor = list->at(i); - assert(monitor->owner(), "This monitor must have an owning object"); + assert(monitor->owner() != NULL, "This monitor must have an owning object"); _locked_monitors->append(monitor->owner()); } } diff --git a/src/hotspot/share/utilities/bitMap.cpp b/src/hotspot/share/utilities/bitMap.cpp index d461772c002..687b98e7085 100644 --- a/src/hotspot/share/utilities/bitMap.cpp +++ b/src/hotspot/share/utilities/bitMap.cpp @@ -628,7 +628,7 @@ void BitMap::init_pop_count_table() { table[i] = num_set_bits(i); } - if (Atomic::cmpxchg(table, &_pop_count_table, (BitMap::idx_t*)NULL) != NULL) { + if (!Atomic::replace_if_null(table, &_pop_count_table)) { guarantee(_pop_count_table != NULL, "invariant"); FREE_C_HEAP_ARRAY(idx_t, table); } diff --git a/src/hotspot/share/utilities/constantTag.cpp b/src/hotspot/share/utilities/constantTag.cpp index 187bb5ed200..d57f7c3dcaf 100644 --- a/src/hotspot/share/utilities/constantTag.cpp +++ b/src/hotspot/share/utilities/constantTag.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -56,6 +56,11 @@ BasicType constantTag::basic_type() const { case JVM_CONSTANT_MethodType : case JVM_CONSTANT_MethodTypeInError : return T_OBJECT; + + case JVM_CONSTANT_Dynamic : + case JVM_CONSTANT_DynamicInError : + assert(false, "Dynamic constant has no fixed basic type"); + default: ShouldNotReachHere(); return T_ILLEGAL; @@ -71,6 +76,8 @@ jbyte constantTag::non_error_value() const { return JVM_CONSTANT_MethodHandle; case JVM_CONSTANT_MethodTypeInError: return JVM_CONSTANT_MethodType; + case JVM_CONSTANT_DynamicInError: + return JVM_CONSTANT_Dynamic; default: return _tag; } @@ -85,6 +92,8 @@ jbyte constantTag::error_value() const { return JVM_CONSTANT_MethodHandleInError; case JVM_CONSTANT_MethodType: return JVM_CONSTANT_MethodTypeInError; + case JVM_CONSTANT_Dynamic: + return JVM_CONSTANT_DynamicInError; default: ShouldNotReachHere(); return JVM_CONSTANT_Invalid; @@ -123,6 +132,10 @@ const char* constantTag::internal_name() const { return "MethodType"; case JVM_CONSTANT_MethodTypeInError : return "MethodType Error"; + case JVM_CONSTANT_Dynamic : + return "Dynamic"; + case JVM_CONSTANT_DynamicInError : + return "Dynamic Error"; case JVM_CONSTANT_InvokeDynamic : return "InvokeDynamic"; case JVM_CONSTANT_Utf8 : diff --git a/src/hotspot/share/utilities/constantTag.hpp b/src/hotspot/share/utilities/constantTag.hpp index 73cee23a513..314ff66c602 100644 --- a/src/hotspot/share/utilities/constantTag.hpp +++ b/src/hotspot/share/utilities/constantTag.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,8 @@ enum { JVM_CONSTANT_UnresolvedClassInError = 103, // Error tag due to resolution error JVM_CONSTANT_MethodHandleInError = 104, // Error tag due to resolution error JVM_CONSTANT_MethodTypeInError = 105, // Error tag due to resolution error - JVM_CONSTANT_InternalMax = 105 // Last implementation tag + JVM_CONSTANT_DynamicInError = 106, // Error tag due to resolution error + JVM_CONSTANT_InternalMax = 106 // Last implementation tag }; @@ -80,6 +81,10 @@ class constantTag VALUE_OBJ_CLASS_SPEC { return _tag == JVM_CONSTANT_MethodTypeInError; } + bool is_dynamic_constant_in_error() const { + return _tag == JVM_CONSTANT_DynamicInError; + } + bool is_klass_index() const { return _tag == JVM_CONSTANT_ClassIndex; } bool is_string_index() const { return _tag == JVM_CONSTANT_StringIndex; } @@ -88,13 +93,14 @@ class constantTag VALUE_OBJ_CLASS_SPEC { bool is_field_or_method() const { return is_field() || is_method() || is_interface_method(); } bool is_symbol() const { return is_utf8(); } - bool is_method_type() const { return _tag == JVM_CONSTANT_MethodType; } - bool is_method_handle() const { return _tag == JVM_CONSTANT_MethodHandle; } - bool is_invoke_dynamic() const { return _tag == JVM_CONSTANT_InvokeDynamic; } + bool is_method_type() const { return _tag == JVM_CONSTANT_MethodType; } + bool is_method_handle() const { return _tag == JVM_CONSTANT_MethodHandle; } + bool is_dynamic_constant() const { return _tag == JVM_CONSTANT_Dynamic; } + bool is_invoke_dynamic() const { return _tag == JVM_CONSTANT_InvokeDynamic; } bool is_loadable_constant() const { return ((_tag >= JVM_CONSTANT_Integer && _tag <= JVM_CONSTANT_String) || - is_method_type() || is_method_handle() || + is_method_type() || is_method_handle() || is_dynamic_constant() || is_unresolved_klass()); } @@ -108,6 +114,20 @@ class constantTag VALUE_OBJ_CLASS_SPEC { _tag = tag; } + static constantTag ofBasicType(BasicType bt) { + if (is_subword_type(bt)) bt = T_INT; + switch (bt) { + case T_OBJECT: return constantTag(JVM_CONSTANT_String); + case T_INT: return constantTag(JVM_CONSTANT_Integer); + case T_LONG: return constantTag(JVM_CONSTANT_Long); + case T_FLOAT: return constantTag(JVM_CONSTANT_Float); + case T_DOUBLE: return constantTag(JVM_CONSTANT_Double); + default: break; + } + assert(false, "bad basic type for tag"); + return constantTag(); + } + jbyte value() const { return _tag; } jbyte error_value() const; jbyte non_error_value() const; diff --git a/src/hotspot/share/utilities/exceptions.cpp b/src/hotspot/share/utilities/exceptions.cpp index 622cde92031..72804805ce1 100644 --- a/src/hotspot/share/utilities/exceptions.cpp +++ b/src/hotspot/share/utilities/exceptions.cpp @@ -403,6 +403,37 @@ Handle Exceptions::new_exception(Thread* thread, Symbol* name, h_prot, to_utf8_safe); } +// invokedynamic uses wrap_dynamic_exception for: +// - bootstrap method resolution +// - post call to MethodHandleNatives::linkCallSite +// dynamically computed constant uses wrap_dynamic_exception for: +// - bootstrap method resolution +// - post call to MethodHandleNatives::linkDynamicConstant +void Exceptions::wrap_dynamic_exception(Thread* THREAD) { + if (THREAD->has_pending_exception()) { + oop exception = THREAD->pending_exception(); + // See the "Linking Exceptions" section for the invokedynamic instruction + // in JVMS 6.5. + if (exception->is_a(SystemDictionary::Error_klass())) { + // Pass through an Error, including BootstrapMethodError, any other form + // of linkage error, or say ThreadDeath/OutOfMemoryError + if (TraceMethodHandles) { + tty->print_cr("[constant/invoke]dynamic passes through an Error for " INTPTR_FORMAT, p2i((void *)exception)); + exception->print(); + } + return; + } + + // Otherwise wrap the exception in a BootstrapMethodError + if (TraceMethodHandles) { + tty->print_cr("[constant/invoke]dynamic throws BSME for " INTPTR_FORMAT, p2i((void *)exception)); + exception->print(); + } + Handle nested_exception(THREAD, exception); + THREAD->clear_pending_exception(); + THROW_CAUSE(vmSymbols::java_lang_BootstrapMethodError(), nested_exception) + } +} // Exception counting for hs_err file volatile int Exceptions::_stack_overflow_errors = 0; diff --git a/src/hotspot/share/utilities/exceptions.hpp b/src/hotspot/share/utilities/exceptions.hpp index e7aaf800237..ee8b404b61e 100644 --- a/src/hotspot/share/utilities/exceptions.hpp +++ b/src/hotspot/share/utilities/exceptions.hpp @@ -166,6 +166,8 @@ class Exceptions { static void throw_stack_overflow_exception(Thread* thread, const char* file, int line, const methodHandle& method); + static void wrap_dynamic_exception(Thread* thread); + // Exception counting for error files of interesting exceptions that may have // caused a problem for the jvm static volatile int _stack_overflow_errors; diff --git a/src/hotspot/share/utilities/globalDefinitions.hpp b/src/hotspot/share/utilities/globalDefinitions.hpp index e98ec391144..e1bcf297343 100644 --- a/src/hotspot/share/utilities/globalDefinitions.hpp +++ b/src/hotspot/share/utilities/globalDefinitions.hpp @@ -596,6 +596,10 @@ inline bool is_signed_subword_type(BasicType t) { return (t == T_BYTE || t == T_SHORT); } +inline bool is_reference_type(BasicType t) { + return (t == T_OBJECT || t == T_ARRAY); +} + // Convert a char from a classfile signature to a BasicType inline BasicType char2type(char c) { switch( c ) { diff --git a/src/hotspot/share/utilities/hashtable.cpp b/src/hotspot/share/utilities/hashtable.cpp index 2195920c1a2..2aa74410ced 100644 --- a/src/hotspot/share/utilities/hashtable.cpp +++ b/src/hotspot/share/utilities/hashtable.cpp @@ -32,7 +32,7 @@ #include "classfile/protectionDomainCache.hpp" #include "classfile/stringTable.hpp" #include "memory/allocation.inline.hpp" -#include "memory/filemap.hpp" +#include "memory/metaspaceShared.hpp" #include "memory/resourceArea.hpp" #include "oops/oop.inline.hpp" #include "runtime/safepoint.hpp" @@ -161,8 +161,7 @@ template void BasicHashtable::free_buckets() { if (NULL != _buckets) { // Don't delete the buckets in the shared space. They aren't // allocated by os::malloc - if (!UseSharedSpaces || - !FileMapInfo::current_info()->is_in_shared_space(_buckets)) { + if (!MetaspaceShared::is_in_shared_metaspace(_buckets)) { FREE_C_HEAP_ARRAY(HashtableBucket, _buckets); } _buckets = NULL; diff --git a/src/hotspot/share/utilities/ostream.cpp b/src/hotspot/share/utilities/ostream.cpp index 531c2c9bafd..47ef66b723f 100644 --- a/src/hotspot/share/utilities/ostream.cpp +++ b/src/hotspot/share/utilities/ostream.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -947,18 +947,11 @@ void ostream_exit() { delete classlist_file; } #endif - { - // we temporaly disable PrintMallocFree here - // as otherwise it'll lead to using of almost deleted - // tty or defaultStream::instance in logging facility - // of HeapFree(), see 6391258 - DEBUG_ONLY(FlagSetting fs(PrintMallocFree, false);) - if (tty != defaultStream::instance) { - delete tty; - } - if (defaultStream::instance != NULL) { - delete defaultStream::instance; - } + if (tty != defaultStream::instance) { + delete tty; + } + if (defaultStream::instance != NULL) { + delete defaultStream::instance; } tty = NULL; xtty = NULL; diff --git a/src/hotspot/share/utilities/vmError.cpp b/src/hotspot/share/utilities/vmError.cpp index 8d127605e13..93dc660cf39 100644 --- a/src/hotspot/share/utilities/vmError.cpp +++ b/src/hotspot/share/utilities/vmError.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -243,11 +243,12 @@ void VMError::print_native_stack(outputStream* st, frame fr, Thread* t, char* bu RegisterMap map((JavaThread*)t, false); // No update fr = fr.sender(&map); } else { + // is_first_C_frame() does only simple checks for frame pointer, + // it will pass if java compiled code has a pointer in EBP. + if (os::is_first_C_frame(&fr)) break; fr = os::get_sender_for_C_frame(&fr); } } else { - // is_first_C_frame() does only simple checks for frame pointer, - // it will pass if java compiled code has a pointer in EBP. if (os::is_first_C_frame(&fr)) break; fr = os::get_sender_for_C_frame(&fr); } @@ -479,7 +480,7 @@ void VMError::report(outputStream* st, bool _verbose) { STEP("printing type of error") - switch(_id) { + switch(static_cast(_id)) { case OOM_MALLOC_ERROR: case OOM_MMAP_ERROR: if (_size) { diff --git a/src/java.activation/share/classes/META-INF/mailcap.default b/src/java.activation/share/classes/META-INF/mailcap.default deleted file mode 100644 index 542de7deb93..00000000000 --- a/src/java.activation/share/classes/META-INF/mailcap.default +++ /dev/null @@ -1,7 +0,0 @@ -# -# This is a very simple 'mailcap' file -# -image/gif;; x-java-view=com.sun.activation.viewers.ImageViewer -image/jpeg;; x-java-view=com.sun.activation.viewers.ImageViewer -text/*;; x-java-view=com.sun.activation.viewers.TextViewer -text/*;; x-java-edit=com.sun.activation.viewers.TextEditor diff --git a/src/java.activation/share/classes/META-INF/mimetypes.default b/src/java.activation/share/classes/META-INF/mimetypes.default deleted file mode 100644 index 1b4056b194f..00000000000 --- a/src/java.activation/share/classes/META-INF/mimetypes.default +++ /dev/null @@ -1,25 +0,0 @@ -# -# A simple, old format, mime.types file -# -text/html html htm HTML HTM -text/plain txt text TXT TEXT -image/gif gif GIF -image/ief ief -image/jpeg jpeg jpg jpe JPG -image/tiff tiff tif -image/png png PNG -image/x-xwindowdump xwd -application/postscript ai eps ps -application/rtf rtf -application/x-tex tex -application/x-texinfo texinfo texi -application/x-troff t tr roff -audio/basic au -audio/midi midi mid -audio/x-aifc aifc -audio/x-aiff aif aiff -audio/x-mpeg mpeg mpg -audio/x-wav wav -video/mpeg mpeg mpg mpe -video/quicktime qt mov -video/x-msvideo avi diff --git a/src/java.activation/share/classes/com/sun/activation/registries/LogSupport.java b/src/java.activation/share/classes/com/sun/activation/registries/LogSupport.java deleted file mode 100644 index 78ff3e95d47..00000000000 --- a/src/java.activation/share/classes/com/sun/activation/registries/LogSupport.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.activation.registries; - -import java.io.*; -import java.util.logging.*; - -/** - * Logging related methods. - */ -public class LogSupport { - private static boolean debug = false; - private static Logger logger; - private static final Level level = Level.FINE; - - static { - try { - debug = Boolean.getBoolean("javax.activation.debug"); - } catch (Throwable t) { - // ignore any errors - } - logger = Logger.getLogger("javax.activation"); - } - - /** - * Constructor. - */ - private LogSupport() { - // private constructor, can't create instances - } - - public static void log(String msg) { - if (debug) - System.out.println(msg); - logger.log(level, msg); - } - - public static void log(String msg, Throwable t) { - if (debug) - System.out.println(msg + "; Exception: " + t); - logger.log(level, msg, t); - } - - public static boolean isLoggable() { - return debug || logger.isLoggable(level); - } -} diff --git a/src/java.activation/share/classes/com/sun/activation/registries/MailcapFile.java b/src/java.activation/share/classes/com/sun/activation/registries/MailcapFile.java deleted file mode 100644 index 613356892e0..00000000000 --- a/src/java.activation/share/classes/com/sun/activation/registries/MailcapFile.java +++ /dev/null @@ -1,563 +0,0 @@ -/* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.activation.registries; - -import java.io.*; -import java.util.*; - -public class MailcapFile { - - /** - * A Map indexed by MIME type (string) that references - * a Map of commands for each type. The comand Map - * is indexed by the command name and references a List of - * class names (strings) for each command. - */ - private Map type_hash = new HashMap(); - - /** - * Another Map like above, but for fallback entries. - */ - private Map fallback_hash = new HashMap(); - - /** - * A Map indexed by MIME type (string) that references - * a List of native commands (string) corresponding to the type. - */ - private Map native_commands = new HashMap(); - - private static boolean addReverse = false; - - static { - try { - addReverse = Boolean.getBoolean("javax.activation.addreverse"); - } catch (Throwable t) { - // ignore any errors - } - } - - /** - * The constructor that takes a filename as an argument. - * - * @param new_fname The file name of the mailcap file. - */ - public MailcapFile(String new_fname) throws IOException { - if (LogSupport.isLoggable()) - LogSupport.log("new MailcapFile: file " + new_fname); - FileReader reader = null; - try { - reader = new FileReader(new_fname); - parse(new BufferedReader(reader)); - } finally { - if (reader != null) { - try { - reader.close(); - } catch (IOException ex) { } - } - } - } - - /** - * The constructor that takes an input stream as an argument. - * - * @param is the input stream - */ - public MailcapFile(InputStream is) throws IOException { - if (LogSupport.isLoggable()) - LogSupport.log("new MailcapFile: InputStream"); - parse(new BufferedReader(new InputStreamReader(is, "iso-8859-1"))); - } - - /** - * Mailcap file default constructor. - */ - public MailcapFile() { - if (LogSupport.isLoggable()) - LogSupport.log("new MailcapFile: default"); - } - - /** - * Get the Map of MailcapEntries based on the MIME type. - * - *

            - * Semantics: First check for the literal mime type, - * if that fails looks for wildcard /\* and return that. Return the - * list of all that hit. - */ - public Map getMailcapList(String mime_type) { - Map search_result = null; - Map wildcard_result = null; - - // first try the literal - search_result = (Map)type_hash.get(mime_type); - - // ok, now try the wildcard - int separator = mime_type.indexOf('/'); - String subtype = mime_type.substring(separator + 1); - if (!subtype.equals("*")) { - String type = mime_type.substring(0, separator + 1) + "*"; - wildcard_result = (Map)type_hash.get(type); - - if (wildcard_result != null) { // damn, we have to merge!!! - if (search_result != null) - search_result = - mergeResults(search_result, wildcard_result); - else - search_result = wildcard_result; - } - } - return search_result; - } - - /** - * Get the Map of fallback MailcapEntries based on the MIME type. - * - *

            - * Semantics: First check for the literal mime type, - * if that fails looks for wildcard /\* and return that. Return the - * list of all that hit. - */ - public Map getMailcapFallbackList(String mime_type) { - Map search_result = null; - Map wildcard_result = null; - - // first try the literal - search_result = (Map)fallback_hash.get(mime_type); - - // ok, now try the wildcard - int separator = mime_type.indexOf('/'); - String subtype = mime_type.substring(separator + 1); - if (!subtype.equals("*")) { - String type = mime_type.substring(0, separator + 1) + "*"; - wildcard_result = (Map)fallback_hash.get(type); - - if (wildcard_result != null) { // damn, we have to merge!!! - if (search_result != null) - search_result = - mergeResults(search_result, wildcard_result); - else - search_result = wildcard_result; - } - } - return search_result; - } - - /** - * Return all the MIME types known to this mailcap file. - */ - public String[] getMimeTypes() { - Set types = new HashSet(type_hash.keySet()); - types.addAll(fallback_hash.keySet()); - types.addAll(native_commands.keySet()); - String[] mts = new String[types.size()]; - mts = (String[])types.toArray(mts); - return mts; - } - - /** - * Return all the native comands for the given MIME type. - */ - public String[] getNativeCommands(String mime_type) { - String[] cmds = null; - List v = - (List)native_commands.get(mime_type.toLowerCase(Locale.ENGLISH)); - if (v != null) { - cmds = new String[v.size()]; - cmds = (String[])v.toArray(cmds); - } - return cmds; - } - - /** - * Merge the first hash into the second. - * This merge will only effect the hashtable that is - * returned, we don't want to touch the one passed in since - * its integrity must be maintained. - */ - private Map mergeResults(Map first, Map second) { - Iterator verb_enum = second.keySet().iterator(); - Map clonedHash = new HashMap(first); - - // iterate through the verbs in the second map - while (verb_enum.hasNext()) { - String verb = (String)verb_enum.next(); - List cmdVector = (List)clonedHash.get(verb); - if (cmdVector == null) { - clonedHash.put(verb, second.get(verb)); - } else { - // merge the two - List oldV = (List)second.get(verb); - cmdVector = new ArrayList(cmdVector); - cmdVector.addAll(oldV); - clonedHash.put(verb, cmdVector); - } - } - return clonedHash; - } - - /** - * appendToMailcap: Append to this Mailcap DB, use the mailcap - * format: - * Comment == "# comment string - * Entry == "mimetype; javabeanclass - * - * Example: - * # this is a comment - * image/gif jaf.viewers.ImageViewer - */ - public void appendToMailcap(String mail_cap) { - if (LogSupport.isLoggable()) - LogSupport.log("appendToMailcap: " + mail_cap); - try { - parse(new StringReader(mail_cap)); - } catch (IOException ex) { - // can't happen - } - } - - /** - * parse file into a hash table of MC Type Entry Obj - */ - private void parse(Reader reader) throws IOException { - BufferedReader buf_reader = new BufferedReader(reader); - String line = null; - String continued = null; - - while ((line = buf_reader.readLine()) != null) { - // LogSupport.log("parsing line: " + line); - - line = line.trim(); - - try { - if (line.charAt(0) == '#') - continue; - if (line.charAt(line.length() - 1) == '\\') { - if (continued != null) - continued += line.substring(0, line.length() - 1); - else - continued = line.substring(0, line.length() - 1); - } else if (continued != null) { - // handle the two strings - continued = continued + line; - // LogSupport.log("parse: " + continued); - try { - parseLine(continued); - } catch (MailcapParseException e) { - //e.printStackTrace(); - } - continued = null; - } - else { - // LogSupport.log("parse: " + line); - try { - parseLine(line); - // LogSupport.log("hash.size = " + type_hash.size()); - } catch (MailcapParseException e) { - //e.printStackTrace(); - } - } - } catch (StringIndexOutOfBoundsException e) {} - } - } - - /** - * A routine to parse individual entries in a Mailcap file. - * - * Note that this routine does not handle line continuations. - * They should have been handled prior to calling this routine. - */ - protected void parseLine(String mailcapEntry) - throws MailcapParseException, IOException { - MailcapTokenizer tokenizer = new MailcapTokenizer(mailcapEntry); - tokenizer.setIsAutoquoting(false); - - if (LogSupport.isLoggable()) - LogSupport.log("parse: " + mailcapEntry); - // parse the primary type - int currentToken = tokenizer.nextToken(); - if (currentToken != MailcapTokenizer.STRING_TOKEN) { - reportParseError(MailcapTokenizer.STRING_TOKEN, currentToken, - tokenizer.getCurrentTokenValue()); - } - String primaryType = - tokenizer.getCurrentTokenValue().toLowerCase(Locale.ENGLISH); - String subType = "*"; - - // parse the '/' between primary and sub - // if it's not present that's ok, we just don't have a subtype - currentToken = tokenizer.nextToken(); - if ((currentToken != MailcapTokenizer.SLASH_TOKEN) && - (currentToken != MailcapTokenizer.SEMICOLON_TOKEN)) { - reportParseError(MailcapTokenizer.SLASH_TOKEN, - MailcapTokenizer.SEMICOLON_TOKEN, currentToken, - tokenizer.getCurrentTokenValue()); - } - - // only need to look for a sub type if we got a '/' - if (currentToken == MailcapTokenizer.SLASH_TOKEN) { - // parse the sub type - currentToken = tokenizer.nextToken(); - if (currentToken != MailcapTokenizer.STRING_TOKEN) { - reportParseError(MailcapTokenizer.STRING_TOKEN, - currentToken, tokenizer.getCurrentTokenValue()); - } - subType = - tokenizer.getCurrentTokenValue().toLowerCase(Locale.ENGLISH); - - // get the next token to simplify the next step - currentToken = tokenizer.nextToken(); - } - - String mimeType = primaryType + "/" + subType; - - if (LogSupport.isLoggable()) - LogSupport.log(" Type: " + mimeType); - - // now setup the commands hashtable - Map commands = new LinkedHashMap(); // keep commands in order found - - // parse the ';' that separates the type from the parameters - if (currentToken != MailcapTokenizer.SEMICOLON_TOKEN) { - reportParseError(MailcapTokenizer.SEMICOLON_TOKEN, - currentToken, tokenizer.getCurrentTokenValue()); - } - // eat it - - // parse the required view command - tokenizer.setIsAutoquoting(true); - currentToken = tokenizer.nextToken(); - tokenizer.setIsAutoquoting(false); - if ((currentToken != MailcapTokenizer.STRING_TOKEN) && - (currentToken != MailcapTokenizer.SEMICOLON_TOKEN)) { - reportParseError(MailcapTokenizer.STRING_TOKEN, - MailcapTokenizer.SEMICOLON_TOKEN, currentToken, - tokenizer.getCurrentTokenValue()); - } - - if (currentToken == MailcapTokenizer.STRING_TOKEN) { - // have a native comand, save the entire mailcap entry - //String nativeCommand = tokenizer.getCurrentTokenValue(); - List v = (List)native_commands.get(mimeType); - if (v == null) { - v = new ArrayList(); - v.add(mailcapEntry); - native_commands.put(mimeType, v); - } else { - // XXX - check for duplicates? - v.add(mailcapEntry); - } - } - - // only have to get the next token if the current one isn't a ';' - if (currentToken != MailcapTokenizer.SEMICOLON_TOKEN) { - currentToken = tokenizer.nextToken(); - } - - // look for a ';' which will indicate whether - // a parameter list is present or not - if (currentToken == MailcapTokenizer.SEMICOLON_TOKEN) { - boolean isFallback = false; - do { - // eat the ';' - - // parse the parameter name - currentToken = tokenizer.nextToken(); - if (currentToken != MailcapTokenizer.STRING_TOKEN) { - reportParseError(MailcapTokenizer.STRING_TOKEN, - currentToken, tokenizer.getCurrentTokenValue()); - } - String paramName = tokenizer.getCurrentTokenValue(). - toLowerCase(Locale.ENGLISH); - - // parse the '=' which separates the name from the value - currentToken = tokenizer.nextToken(); - if ((currentToken != MailcapTokenizer.EQUALS_TOKEN) && - (currentToken != MailcapTokenizer.SEMICOLON_TOKEN) && - (currentToken != MailcapTokenizer.EOI_TOKEN)) { - reportParseError(MailcapTokenizer.EQUALS_TOKEN, - MailcapTokenizer.SEMICOLON_TOKEN, - MailcapTokenizer.EOI_TOKEN, - currentToken, tokenizer.getCurrentTokenValue()); - } - - // we only have a useful command if it is named - if (currentToken == MailcapTokenizer.EQUALS_TOKEN) { - // eat it - - // parse the parameter value (which is autoquoted) - tokenizer.setIsAutoquoting(true); - currentToken = tokenizer.nextToken(); - tokenizer.setIsAutoquoting(false); - if (currentToken != MailcapTokenizer.STRING_TOKEN) { - reportParseError(MailcapTokenizer.STRING_TOKEN, - currentToken, tokenizer.getCurrentTokenValue()); - } - String paramValue = - tokenizer.getCurrentTokenValue(); - - // add the class to the list iff it is one we care about - if (paramName.startsWith("x-java-")) { - String commandName = paramName.substring(7); - // 7 == "x-java-".length - - if (commandName.equals("fallback-entry") && - paramValue.equalsIgnoreCase("true")) { - isFallback = true; - } else { - - // setup the class entry list - if (LogSupport.isLoggable()) - LogSupport.log(" Command: " + commandName + - ", Class: " + paramValue); - List classes = (List)commands.get(commandName); - if (classes == null) { - classes = new ArrayList(); - commands.put(commandName, classes); - } - if (addReverse) - classes.add(0, paramValue); - else - classes.add(paramValue); - } - } - - // set up the next iteration - currentToken = tokenizer.nextToken(); - } - } while (currentToken == MailcapTokenizer.SEMICOLON_TOKEN); - - Map masterHash = isFallback ? fallback_hash : type_hash; - Map curcommands = - (Map)masterHash.get(mimeType); - if (curcommands == null) { - masterHash.put(mimeType, commands); - } else { - if (LogSupport.isLoggable()) - LogSupport.log("Merging commands for type " + mimeType); - // have to merge current and new commands - // first, merge list of classes for commands already known - Iterator cn = curcommands.keySet().iterator(); - while (cn.hasNext()) { - String cmdName = (String)cn.next(); - List ccv = (List)curcommands.get(cmdName); - List cv = (List)commands.get(cmdName); - if (cv == null) - continue; - // add everything in cv to ccv, if it's not already there - Iterator cvn = cv.iterator(); - while (cvn.hasNext()) { - String clazz = (String)cvn.next(); - if (!ccv.contains(clazz)) - if (addReverse) - ccv.add(0, clazz); - else - ccv.add(clazz); - } - } - // now, add commands not previously known - cn = commands.keySet().iterator(); - while (cn.hasNext()) { - String cmdName = (String)cn.next(); - if (curcommands.containsKey(cmdName)) - continue; - List cv = (List)commands.get(cmdName); - curcommands.put(cmdName, cv); - } - } - } else if (currentToken != MailcapTokenizer.EOI_TOKEN) { - reportParseError(MailcapTokenizer.EOI_TOKEN, - MailcapTokenizer.SEMICOLON_TOKEN, - currentToken, tokenizer.getCurrentTokenValue()); - } - } - - protected static void reportParseError(int expectedToken, int actualToken, - String actualTokenValue) throws MailcapParseException { - throw new MailcapParseException("Encountered a " + - MailcapTokenizer.nameForToken(actualToken) + " token (" + - actualTokenValue + ") while expecting a " + - MailcapTokenizer.nameForToken(expectedToken) + " token."); - } - - protected static void reportParseError(int expectedToken, - int otherExpectedToken, int actualToken, String actualTokenValue) - throws MailcapParseException { - throw new MailcapParseException("Encountered a " + - MailcapTokenizer.nameForToken(actualToken) + " token (" + - actualTokenValue + ") while expecting a " + - MailcapTokenizer.nameForToken(expectedToken) + " or a " + - MailcapTokenizer.nameForToken(otherExpectedToken) + " token."); - } - - protected static void reportParseError(int expectedToken, - int otherExpectedToken, int anotherExpectedToken, int actualToken, - String actualTokenValue) throws MailcapParseException { - if (LogSupport.isLoggable()) - LogSupport.log("PARSE ERROR: " + "Encountered a " + - MailcapTokenizer.nameForToken(actualToken) + " token (" + - actualTokenValue + ") while expecting a " + - MailcapTokenizer.nameForToken(expectedToken) + ", a " + - MailcapTokenizer.nameForToken(otherExpectedToken) + ", or a " + - MailcapTokenizer.nameForToken(anotherExpectedToken) + " token."); - throw new MailcapParseException("Encountered a " + - MailcapTokenizer.nameForToken(actualToken) + " token (" + - actualTokenValue + ") while expecting a " + - MailcapTokenizer.nameForToken(expectedToken) + ", a " + - MailcapTokenizer.nameForToken(otherExpectedToken) + ", or a " + - MailcapTokenizer.nameForToken(anotherExpectedToken) + " token."); - } - - /** for debugging - public static void main(String[] args) throws Exception { - Map masterHash = new HashMap(); - for (int i = 0; i < args.length; ++i) { - System.out.println("Entry " + i + ": " + args[i]); - parseLine(args[i], masterHash); - } - - Enumeration types = masterHash.keys(); - while (types.hasMoreElements()) { - String key = (String)types.nextElement(); - System.out.println("MIME Type: " + key); - - Map commandHash = (Map)masterHash.get(key); - Enumeration commands = commandHash.keys(); - while (commands.hasMoreElements()) { - String command = (String)commands.nextElement(); - System.out.println(" Command: " + command); - - Vector classes = (Vector)commandHash.get(command); - for (int i = 0; i < classes.size(); ++i) { - System.out.println(" Class: " + - (String)classes.elementAt(i)); - } - } - - System.out.println(""); - } - } - */ -} diff --git a/src/java.activation/share/classes/com/sun/activation/registries/MailcapParseException.java b/src/java.activation/share/classes/com/sun/activation/registries/MailcapParseException.java deleted file mode 100644 index ec48bf36707..00000000000 --- a/src/java.activation/share/classes/com/sun/activation/registries/MailcapParseException.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.activation.registries; - -/** - * A class to encapsulate Mailcap parsing related exceptions - */ -public class MailcapParseException extends Exception { - - public MailcapParseException() { - super(); - } - - public MailcapParseException(String inInfo) { - super(inInfo); - } -} diff --git a/src/java.activation/share/classes/com/sun/activation/registries/MailcapTokenizer.java b/src/java.activation/share/classes/com/sun/activation/registries/MailcapTokenizer.java deleted file mode 100644 index 9ece7dc645d..00000000000 --- a/src/java.activation/share/classes/com/sun/activation/registries/MailcapTokenizer.java +++ /dev/null @@ -1,321 +0,0 @@ -/* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.activation.registries; - -/** - * A tokenizer for strings in the form of "foo/bar; prop1=val1; ... ". - * Useful for parsing MIME content types. - */ -public class MailcapTokenizer { - - public static final int UNKNOWN_TOKEN = 0; - public static final int START_TOKEN = 1; - public static final int STRING_TOKEN = 2; - public static final int EOI_TOKEN = 5; - public static final int SLASH_TOKEN = '/'; - public static final int SEMICOLON_TOKEN = ';'; - public static final int EQUALS_TOKEN = '='; - - /** - * Constructor - * - * @param inputString the string to tokenize - */ - public MailcapTokenizer(String inputString) { - data = inputString; - dataIndex = 0; - dataLength = inputString.length(); - - currentToken = START_TOKEN; - currentTokenValue = ""; - - isAutoquoting = false; - autoquoteChar = ';'; - } - - /** - * Set whether auto-quoting is on or off. - * - * Auto-quoting means that all characters after the first - * non-whitespace, non-control character up to the auto-quote - * terminator character or EOI (minus any whitespace immediatley - * preceeding it) is considered a token. - * - * This is required for handling command strings in a mailcap entry. - */ - public void setIsAutoquoting(boolean value) { - isAutoquoting = value; - } - - /** - * Retrieve current token. - * - * @return The current token value - */ - public int getCurrentToken() { - return currentToken; - } - - /* - * Get a String that describes the given token. - */ - public static String nameForToken(int token) { - String name = "really unknown"; - - switch(token) { - case UNKNOWN_TOKEN: - name = "unknown"; - break; - case START_TOKEN: - name = "start"; - break; - case STRING_TOKEN: - name = "string"; - break; - case EOI_TOKEN: - name = "EOI"; - break; - case SLASH_TOKEN: - name = "'/'"; - break; - case SEMICOLON_TOKEN: - name = "';'"; - break; - case EQUALS_TOKEN: - name = "'='"; - break; - } - - return name; - } - - /* - * Retrieve current token value. - * - * @return A String containing the current token value - */ - public String getCurrentTokenValue() { - return currentTokenValue; - } - /* - * Process the next token. - * - * @return the next token - */ - public int nextToken() { - if (dataIndex < dataLength) { - // skip white space - while ((dataIndex < dataLength) && - (isWhiteSpaceChar(data.charAt(dataIndex)))) { - ++dataIndex; - } - - if (dataIndex < dataLength) { - // examine the current character and see what kind of token we have - char c = data.charAt(dataIndex); - if (isAutoquoting) { - if (c == ';' || c == '=') { - currentToken = c; - currentTokenValue = new Character(c).toString(); - ++dataIndex; - } else { - processAutoquoteToken(); - } - } else { - if (isStringTokenChar(c)) { - processStringToken(); - } else if ((c == '/') || (c == ';') || (c == '=')) { - currentToken = c; - currentTokenValue = new Character(c).toString(); - ++dataIndex; - } else { - currentToken = UNKNOWN_TOKEN; - currentTokenValue = new Character(c).toString(); - ++dataIndex; - } - } - } else { - currentToken = EOI_TOKEN; - currentTokenValue = null; - } - } else { - currentToken = EOI_TOKEN; - currentTokenValue = null; - } - - return currentToken; - } - - private void processStringToken() { - // capture the initial index - int initialIndex = dataIndex; - - // skip to 1st non string token character - while ((dataIndex < dataLength) && - isStringTokenChar(data.charAt(dataIndex))) { - ++dataIndex; - } - - currentToken = STRING_TOKEN; - currentTokenValue = data.substring(initialIndex, dataIndex); - } - - private void processAutoquoteToken() { - // capture the initial index - int initialIndex = dataIndex; - - // now skip to the 1st non-escaped autoquote termination character - // XXX - doesn't actually consider escaping - boolean foundTerminator = false; - while ((dataIndex < dataLength) && !foundTerminator) { - char c = data.charAt(dataIndex); - if (c != autoquoteChar) { - ++dataIndex; - } else { - foundTerminator = true; - } - } - - currentToken = STRING_TOKEN; - currentTokenValue = - fixEscapeSequences(data.substring(initialIndex, dataIndex)); - } - - private static boolean isSpecialChar(char c) { - boolean lAnswer = false; - - switch(c) { - case '(': - case ')': - case '<': - case '>': - case '@': - case ',': - case ';': - case ':': - case '\\': - case '"': - case '/': - case '[': - case ']': - case '?': - case '=': - lAnswer = true; - break; - } - - return lAnswer; - } - - private static boolean isControlChar(char c) { - return Character.isISOControl(c); - } - - private static boolean isWhiteSpaceChar(char c) { - return Character.isWhitespace(c); - } - - private static boolean isStringTokenChar(char c) { - return !isSpecialChar(c) && !isControlChar(c) && !isWhiteSpaceChar(c); - } - - private static String fixEscapeSequences(String inputString) { - int inputLength = inputString.length(); - StringBuffer buffer = new StringBuffer(); - buffer.ensureCapacity(inputLength); - - for (int i = 0; i < inputLength; ++i) { - char currentChar = inputString.charAt(i); - if (currentChar != '\\') { - buffer.append(currentChar); - } else { - if (i < inputLength - 1) { - char nextChar = inputString.charAt(i + 1); - buffer.append(nextChar); - - // force a skip over the next character too - ++i; - } else { - buffer.append(currentChar); - } - } - } - - return buffer.toString(); - } - - private String data; - private int dataIndex; - private int dataLength; - private int currentToken; - private String currentTokenValue; - private boolean isAutoquoting; - private char autoquoteChar; - - /* - public static void main(String[] args) { - for (int i = 0; i < args.length; ++i) { - MailcapTokenizer tokenizer = new MailcapTokenizer(args[i]); - - System.out.println("Original: |" + args[i] + "|"); - - int currentToken = tokenizer.nextToken(); - while (currentToken != EOI_TOKEN) { - switch(currentToken) { - case UNKNOWN_TOKEN: - System.out.println(" Unknown Token: |" + tokenizer.getCurrentTokenValue() + "|"); - break; - case START_TOKEN: - System.out.println(" Start Token: |" + tokenizer.getCurrentTokenValue() + "|"); - break; - case STRING_TOKEN: - System.out.println(" String Token: |" + tokenizer.getCurrentTokenValue() + "|"); - break; - case EOI_TOKEN: - System.out.println(" EOI Token: |" + tokenizer.getCurrentTokenValue() + "|"); - break; - case SLASH_TOKEN: - System.out.println(" Slash Token: |" + tokenizer.getCurrentTokenValue() + "|"); - break; - case SEMICOLON_TOKEN: - System.out.println(" Semicolon Token: |" + tokenizer.getCurrentTokenValue() + "|"); - break; - case EQUALS_TOKEN: - System.out.println(" Equals Token: |" + tokenizer.getCurrentTokenValue() + "|"); - break; - default: - System.out.println(" Really Unknown Token: |" + tokenizer.getCurrentTokenValue() + "|"); - break; - } - - currentToken = tokenizer.nextToken(); - } - - System.out.println(""); - } - } - */ -} diff --git a/src/java.activation/share/classes/com/sun/activation/registries/MimeTypeEntry.java b/src/java.activation/share/classes/com/sun/activation/registries/MimeTypeEntry.java deleted file mode 100644 index fd6d10aef76..00000000000 --- a/src/java.activation/share/classes/com/sun/activation/registries/MimeTypeEntry.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.activation.registries; - -import java.lang.*; - -public class MimeTypeEntry { - private String type; - private String extension; - - public MimeTypeEntry(String mime_type, String file_ext) { - type = mime_type; - extension = file_ext; - } - - public String getMIMEType() { - return type; - } - - public String getFileExtension() { - return extension; - } - - public String toString() { - return "MIMETypeEntry: " + type + ", " + extension; - } -} diff --git a/src/java.activation/share/classes/com/sun/activation/registries/MimeTypeFile.java b/src/java.activation/share/classes/com/sun/activation/registries/MimeTypeFile.java deleted file mode 100644 index e7e179fca23..00000000000 --- a/src/java.activation/share/classes/com/sun/activation/registries/MimeTypeFile.java +++ /dev/null @@ -1,317 +0,0 @@ -/* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.activation.registries; - -import java.io.*; -import java.util.*; - -public class MimeTypeFile { - private String fname = null; - private Hashtable type_hash = new Hashtable(); - - /** - * The construtor that takes a filename as an argument. - * - * @param new_fname The file name of the mime types file. - */ - public MimeTypeFile(String new_fname) throws IOException { - File mime_file = null; - FileReader fr = null; - - fname = new_fname; // remember the file name - - mime_file = new File(fname); // get a file object - - fr = new FileReader(mime_file); - - try { - parse(new BufferedReader(fr)); - } finally { - try { - fr.close(); // close it - } catch (IOException e) { - // ignore it - } - } - } - - public MimeTypeFile(InputStream is) throws IOException { - parse(new BufferedReader(new InputStreamReader(is, "iso-8859-1"))); - } - - /** - * Creates an empty DB. - */ - public MimeTypeFile() { - } - - /** - * get the MimeTypeEntry based on the file extension - */ - public MimeTypeEntry getMimeTypeEntry(String file_ext) { - return (MimeTypeEntry)type_hash.get((Object)file_ext); - } - - /** - * Get the MIME type string corresponding to the file extension. - */ - public String getMIMETypeString(String file_ext) { - MimeTypeEntry entry = this.getMimeTypeEntry(file_ext); - - if (entry != null) - return entry.getMIMEType(); - else - return null; - } - - /** - * Appends string of entries to the types registry, must be valid - * .mime.types format. - * A mime.types entry is one of two forms: - * - * type/subtype ext1 ext2 ... - * or - * type=type/subtype desc="description of type" exts=ext1,ext2,... - * - * Example: - * # this is a test - * audio/basic au - * text/plain txt text - * type=application/postscript exts=ps,eps - */ - public void appendToRegistry(String mime_types) { - try { - parse(new BufferedReader(new StringReader(mime_types))); - } catch (IOException ex) { - // can't happen - } - } - - /** - * Parse a stream of mime.types entries. - */ - private void parse(BufferedReader buf_reader) throws IOException { - String line = null, prev = null; - - while ((line = buf_reader.readLine()) != null) { - if (prev == null) - prev = line; - else - prev += line; - int end = prev.length(); - if (prev.length() > 0 && prev.charAt(end - 1) == '\\') { - prev = prev.substring(0, end - 1); - continue; - } - this.parseEntry(prev); - prev = null; - } - if (prev != null) - this.parseEntry(prev); - } - - /** - * Parse single mime.types entry. - */ - private void parseEntry(String line) { - String mime_type = null; - String file_ext = null; - line = line.trim(); - - if (line.length() == 0) // empty line... - return; // BAIL! - - // check to see if this is a comment line? - if (line.charAt(0) == '#') - return; // then we are done! - - // is it a new format line or old format? - if (line.indexOf('=') > 0) { - // new format - LineTokenizer lt = new LineTokenizer(line); - while (lt.hasMoreTokens()) { - String name = lt.nextToken(); - String value = null; - if (lt.hasMoreTokens() && lt.nextToken().equals("=") && - lt.hasMoreTokens()) - value = lt.nextToken(); - if (value == null) { - if (LogSupport.isLoggable()) - LogSupport.log("Bad .mime.types entry: " + line); - return; - } - if (name.equals("type")) - mime_type = value; - else if (name.equals("exts")) { - StringTokenizer st = new StringTokenizer(value, ","); - while (st.hasMoreTokens()) { - file_ext = st.nextToken(); - MimeTypeEntry entry = - new MimeTypeEntry(mime_type, file_ext); - type_hash.put(file_ext, entry); - if (LogSupport.isLoggable()) - LogSupport.log("Added: " + entry.toString()); - } - } - } - } else { - // old format - // count the tokens - StringTokenizer strtok = new StringTokenizer(line); - int num_tok = strtok.countTokens(); - - if (num_tok == 0) // empty line - return; - - mime_type = strtok.nextToken(); // get the MIME type - - while (strtok.hasMoreTokens()) { - MimeTypeEntry entry = null; - - file_ext = strtok.nextToken(); - entry = new MimeTypeEntry(mime_type, file_ext); - type_hash.put(file_ext, entry); - if (LogSupport.isLoggable()) - LogSupport.log("Added: " + entry.toString()); - } - } - } - - // for debugging - /* - public static void main(String[] argv) throws Exception { - MimeTypeFile mf = new MimeTypeFile(argv[0]); - System.out.println("ext " + argv[1] + " type " + - mf.getMIMETypeString(argv[1])); - System.exit(0); - } - */ -} - -class LineTokenizer { - private int currentPosition; - private int maxPosition; - private String str; - private Vector stack = new Vector(); - private static final String singles = "="; // single character tokens - - /** - * Constructs a tokenizer for the specified string. - *

            - * - * @param str a string to be parsed. - */ - public LineTokenizer(String str) { - currentPosition = 0; - this.str = str; - maxPosition = str.length(); - } - - /** - * Skips white space. - */ - private void skipWhiteSpace() { - while ((currentPosition < maxPosition) && - Character.isWhitespace(str.charAt(currentPosition))) { - currentPosition++; - } - } - - /** - * Tests if there are more tokens available from this tokenizer's string. - * - * @return true if there are more tokens available from this - * tokenizer's string; false otherwise. - */ - public boolean hasMoreTokens() { - if (stack.size() > 0) - return true; - skipWhiteSpace(); - return (currentPosition < maxPosition); - } - - /** - * Returns the next token from this tokenizer. - * - * @return the next token from this tokenizer. - * @exception NoSuchElementException if there are no more tokens in this - * tokenizer's string. - */ - public String nextToken() { - int size = stack.size(); - if (size > 0) { - String t = (String)stack.elementAt(size - 1); - stack.removeElementAt(size - 1); - return t; - } - skipWhiteSpace(); - - if (currentPosition >= maxPosition) { - throw new NoSuchElementException(); - } - - int start = currentPosition; - char c = str.charAt(start); - if (c == '"') { - currentPosition++; - boolean filter = false; - while (currentPosition < maxPosition) { - c = str.charAt(currentPosition++); - if (c == '\\') { - currentPosition++; - filter = true; - } else if (c == '"') { - String s; - - if (filter) { - StringBuffer sb = new StringBuffer(); - for (int i = start + 1; i < currentPosition - 1; i++) { - c = str.charAt(i); - if (c != '\\') - sb.append(c); - } - s = sb.toString(); - } else - s = str.substring(start + 1, currentPosition - 1); - return s; - } - } - } else if (singles.indexOf(c) >= 0) { - currentPosition++; - } else { - while ((currentPosition < maxPosition) && - singles.indexOf(str.charAt(currentPosition)) < 0 && - !Character.isWhitespace(str.charAt(currentPosition))) { - currentPosition++; - } - } - return str.substring(start, currentPosition); - } - - public void pushToken(String token) { - stack.addElement(token); - } -} diff --git a/src/java.activation/share/classes/javax/activation/ActivationDataFlavor.java b/src/java.activation/share/classes/javax/activation/ActivationDataFlavor.java deleted file mode 100644 index c4836e4d0a7..00000000000 --- a/src/java.activation/share/classes/javax/activation/ActivationDataFlavor.java +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package javax.activation; - -import java.awt.datatransfer.DataFlavor; -import java.io.IOException; -import javax.activation.MimeType; - -/** - * The ActivationDataFlavor class is a special subclass of - * {@code java.awt.datatransfer.DataFlavor}. It allows the JAF to - * set all three values stored by the DataFlavor class via a new - * constructor. It also contains improved MIME parsing in the {@code equals} - * method. Except for the improved parsing, its semantics are - * identical to that of the JDK's DataFlavor class. - * - * @since 1.6 - */ - -public class ActivationDataFlavor extends DataFlavor { - - /* - * Raison d'etre: - * - * The DataFlavor class included in JDK 1.1 has several limitations - * including piss poor MIME type parsing, and the limitation of - * only supporting serialized objects and InputStreams as - * representation objects. This class 'fixes' that. - */ - - // I think for now I'll keep copies of all the variables and - // then later I may choose try to better coexist with the base - // class *sigh* - private String mimeType = null; - private MimeType mimeObject = null; - private String humanPresentableName = null; - private Class representationClass = null; - - /** - * Construct a DataFlavor that represents an arbitrary - * Java object. This constructor is an extension of the - * JDK's DataFlavor in that it allows the explicit setting - * of all three DataFlavor attributes. - *

            - * The returned DataFlavor will have the following characteristics: - *

            - * representationClass = representationClass
            - * mimeType = mimeType
            - * humanName = humanName - * - * @param representationClass the class used in this DataFlavor - * @param mimeType the MIME type of the data represented by this class - * @param humanPresentableName the human presentable name of the flavor - */ - public ActivationDataFlavor(Class representationClass, - String mimeType, String humanPresentableName) { - super(mimeType, humanPresentableName); // need to call super - - // init private variables: - this.mimeType = mimeType; - this.humanPresentableName = humanPresentableName; - this.representationClass = representationClass; - } - - /** - * Construct a DataFlavor that represents a MimeType. - *

            - * The returned DataFlavor will have the following characteristics: - *

            - * If the mimeType is "application/x-java-serialized-object; - * class=", the result is the same as calling new - * DataFlavor(Class.forName()) as above. - *

            - * otherwise: - *

            - * representationClass = InputStream

            - * mimeType = mimeType - * - * @param representationClass the class used in this DataFlavor - * @param humanPresentableName the human presentable name of the flavor - */ - public ActivationDataFlavor(Class representationClass, - String humanPresentableName) { - super(representationClass, humanPresentableName); - this.mimeType = super.getMimeType(); - this.representationClass = representationClass; - this.humanPresentableName = humanPresentableName; - } - - /** - * Construct a DataFlavor that represents a MimeType. - *

            - * The returned DataFlavor will have the following characteristics: - *

            - * If the mimeType is "application/x-java-serialized-object; class=", - * the result is the same as calling new DataFlavor(Class.forName()) as - * above, otherwise: - *

            - * representationClass = InputStream

            - * mimeType = mimeType - * - * @param mimeType the MIME type of the data represented by this class - * @param humanPresentableName the human presentable name of the flavor - */ - public ActivationDataFlavor(String mimeType, String humanPresentableName) { - super(mimeType, humanPresentableName); - this.mimeType = mimeType; - try { - this.representationClass = Class.forName("java.io.InputStream"); - } catch (ClassNotFoundException ex) { - // XXX - should never happen, ignore it - } - this.humanPresentableName = humanPresentableName; - } - - /** - * Return the MIME type for this DataFlavor. - * - * @return the MIME type - */ - public String getMimeType() { - return mimeType; - } - - /** - * Return the representation class. - * - * @return the representation class - */ - public Class getRepresentationClass() { - return representationClass; - } - - /** - * Return the Human Presentable name. - * - * @return the human presentable name - */ - public String getHumanPresentableName() { - return humanPresentableName; - } - - /** - * Set the human presentable name. - * - * @param humanPresentableName the name to set - */ - public void setHumanPresentableName(String humanPresentableName) { - this.humanPresentableName = humanPresentableName; - } - - /** - * Compares the DataFlavor passed in with this DataFlavor; calls - * the {@code isMimeTypeEqual} method. - * - * @param dataFlavor the DataFlavor to compare with - * @return true if the MIME type and representation class - * are the same - */ - public boolean equals(DataFlavor dataFlavor) { - return (isMimeTypeEqual(dataFlavor) && - dataFlavor.getRepresentationClass() == representationClass); - } - - /** - * Is the string representation of the MIME type passed in equivalent - * to the MIME type of this DataFlavor.

            - * - * ActivationDataFlavor delegates the comparison of MIME types to - * the MimeType class included as part of the JavaBeans Activation - * Framework. This provides a more robust comparison than is normally - * available in the DataFlavor class. - * - * @param mimeType the MIME type - * @return true if the same MIME type - */ - public boolean isMimeTypeEqual(String mimeType) { - MimeType mt = null; - try { - if (mimeObject == null) - mimeObject = new MimeType(this.mimeType); - mt = new MimeType(mimeType); - } catch (MimeTypeParseException e) { - // something didn't parse, do a crude comparison - return this.mimeType.equalsIgnoreCase(mimeType); - } - - return mimeObject.match(mt); - } - - /** - * Called on DataFlavor for every MIME Type parameter to allow DataFlavor - * subclasses to handle special parameters like the text/plain charset - * parameters, whose values are case insensitive. (MIME type parameter - * values are supposed to be case sensitive). - *

            - * This method is called for each parameter name/value pair and should - * return the normalized representation of the parameterValue. - * This method is never invoked by this implementation. - * - * @param parameterName the parameter name - * @param parameterValue the parameter value - * @return the normalized parameter value - * @deprecated - */ - protected String normalizeMimeTypeParameter(String parameterName, - String parameterValue) { - return parameterValue; - } - - /** - * Called for each MIME type string to give DataFlavor subtypes the - * opportunity to change how the normalization of MIME types is - * accomplished. - * One possible use would be to add default parameter/value pairs in cases - * where none are present in the MIME type string passed in. - * This method is never invoked by this implementation. - * - * @param mimeType the MIME type - * @return the normalized MIME type - * @deprecated - */ - protected String normalizeMimeType(String mimeType) { - return mimeType; - } -} diff --git a/src/java.activation/share/classes/javax/activation/CommandInfo.java b/src/java.activation/share/classes/javax/activation/CommandInfo.java deleted file mode 100644 index 3350e2e0fa3..00000000000 --- a/src/java.activation/share/classes/javax/activation/CommandInfo.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package javax.activation; - -import java.io.*; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.security.AccessController; -import java.security.PrivilegedAction; - -/** - * The CommandInfo class is used by CommandMap implementations to - * describe the results of command requests. It provides the requestor - * with both the verb requested, as well as an instance of the - * bean. There is also a method that will return the name of the - * class that implements the command but it is not guaranteed to - * return a valid value. The reason for this is to allow CommandMap - * implmentations that subclass CommandInfo to provide special - * behavior. For example a CommandMap could dynamically generate - * JavaBeans. In this case, it might not be possible to create an - * object with all the correct state information solely from the class - * name. - * - * @since 1.6 - */ - -public class CommandInfo { - private String verb; - private String className; - - /** - * The Constructor for CommandInfo. - * @param verb The command verb this CommandInfo decribes. - * @param className The command's fully qualified class name. - */ - public CommandInfo(String verb, String className) { - this.verb = verb; - this.className = className; - } - - /** - * Return the command verb. - * - * @return the command verb. - */ - public String getCommandName() { - return verb; - } - - /** - * Return the command's class name. This method MAY return null in - * cases where a CommandMap subclassed CommandInfo for its - * own purposes. In other words, it might not be possible to - * create the correct state in the command by merely knowing - * its class name. DO NOT DEPEND ON THIS METHOD RETURNING - * A VALID VALUE! - * - * @return The class name of the command, or null - */ - public String getCommandClass() { - return className; - } - - /** - * Return the instantiated JavaBean component. - *

            - * If {@code java.beans.Beans} is visible then it's - * {@code java.beans.Beans#instantiate} method is invoked to instantiate - * the component as a JavaBeans component. - * When {@code java.beans.Beans} is not visible (when {@code java.desktop} - * module is not readable or when the runtime image does not contain the - * {@code java.desktop} module) then the command's class is loaded and - * instantiated with its public no-args constructor. - *

            - * The component class needs to be public. - *

            - * If the bean implements the {@code javax.activation.CommandObject} - * interface, call its {@code setCommandContext} method. - *

            - * If the DataHandler parameter is null, then the bean is - * instantiated with no data. NOTE: this may be useful - * if for some reason the DataHandler that is passed in - * throws IOExceptions when this method attempts to - * access its InputStream. It will allow the caller to - * retrieve a reference to the bean if it can be - * instantiated. - *

            - * If the bean does NOT implement the CommandObject interface, - * this method will check if it implements the - * java.io.Externalizable interface. If it does, the bean's - * readExternal method will be called if an InputStream - * can be acquired from the DataHandler. - * - * @param dh The DataHandler that describes the data to be - * passed to the command. - * @param loader The ClassLoader to be used to instantiate the bean. - * @return The bean - * @exception IOException for failures reading data - * @exception ClassNotFoundException if command object class can't - * be found - * @see java.beans.Beans#instantiate - * @see javax.activation.CommandObject - */ - public Object getCommandObject(DataHandler dh, ClassLoader loader) - throws IOException, ClassNotFoundException { - Object new_bean = null; - - // try to instantiate the bean - new_bean = Beans.instantiate(loader, className); - - // if we got one and it is a CommandObject - if (new_bean != null) { - if (new_bean instanceof CommandObject) { - ((CommandObject)new_bean).setCommandContext(verb, dh); - } else if (new_bean instanceof Externalizable) { - if (dh != null) { - InputStream is = dh.getInputStream(); - if (is != null) { - ((Externalizable)new_bean).readExternal( - new ObjectInputStream(is)); - } - } - } - } - - return new_bean; - } - - /** - * Helper class to invoke Beans.instantiate reflectively or the equivalent - * with core reflection when module java.desktop is not readable. - */ - private static final class Beans { - static final Method instantiateMethod; - - static { - Method m; - try { - Class c = Class.forName("java.beans.Beans"); - m = c.getDeclaredMethod("instantiate", ClassLoader.class, String.class); - } catch (ClassNotFoundException e) { - m = null; - } catch (NoSuchMethodException e) { - m = null; - } - instantiateMethod = m; - } - - /** - * Equivalent to invoking java.beans.Beans.instantiate(loader, cn) - */ - static Object instantiate(ClassLoader loader, String cn) - throws IOException, ClassNotFoundException { - - Exception exception; - - if (instantiateMethod != null) { - - // invoke Beans.instantiate - try { - return instantiateMethod.invoke(null, loader, cn); - } catch (InvocationTargetException e) { - exception = e; - } catch (IllegalAccessException e) { - exception = e; - } - - } else { - - SecurityManager security = System.getSecurityManager(); - if (security != null) { - // if it's ok with the SecurityManager, it's ok with me. - String cname = cn.replace('/', '.'); - if (cname.startsWith("[")) { - int b = cname.lastIndexOf('[') + 2; - if (b > 1 && b < cname.length()) { - cname = cname.substring(b); - } - } - int i = cname.lastIndexOf('.'); - if (i != -1) { - security.checkPackageAccess(cname.substring(0, i)); - } - } - - // Beans.instantiate specified to use SCL when loader is null - if (loader == null) { - loader = (ClassLoader) - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - ClassLoader cl = null; - try { - cl = ClassLoader.getSystemClassLoader(); - } catch (SecurityException ex) { } - return cl; - } - }); - } - Class beanClass = Class.forName(cn, false, loader); - try { - return beanClass.getDeclaredConstructor().newInstance(); - } catch (Exception ex) { - throw new ClassNotFoundException(beanClass + ": " + ex, ex); - } - - } - return null; - } - } -} diff --git a/src/java.activation/share/classes/javax/activation/CommandMap.java b/src/java.activation/share/classes/javax/activation/CommandMap.java deleted file mode 100644 index 16e18ca5ff8..00000000000 --- a/src/java.activation/share/classes/javax/activation/CommandMap.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package javax.activation; - -import java.util.Map; -import java.util.WeakHashMap; - - -/** - * The CommandMap class provides an interface to a registry of - * command objects available in the system. - * Developers are expected to either use the CommandMap - * implementation included with this package (MailcapCommandMap) or - * develop their own. Note that some of the methods in this class are - * abstract. - * - * @since 1.6 - */ -public abstract class CommandMap { - private static CommandMap defaultCommandMap = null; - private static Map map = - new WeakHashMap(); - - /** - * Get the default CommandMap. - * - *

              - *
            • In cases where a CommandMap instance has been previously set - * to some value (via setDefaultCommandMap) - * return the CommandMap. - *
            • - * In cases where no CommandMap has been set, the CommandMap - * creates an instance of {@code MailcapCommandMap} and - * set that to the default, returning its value. - * - *
            - * - * @return the CommandMap - */ - public static synchronized CommandMap getDefaultCommandMap() { - if (defaultCommandMap != null) - return defaultCommandMap; - - // fetch per-thread-context-class-loader default - ClassLoader tccl = SecuritySupport.getContextClassLoader(); - CommandMap def = map.get(tccl); - if (def == null) { - def = new MailcapCommandMap(); - map.put(tccl, def); - } - return def; - } - - /** - * Set the default CommandMap. Reset the CommandMap to the default by - * calling this method with {@code null}. - * - * @param commandMap The new default CommandMap. - * @exception SecurityException if the caller doesn't have permission - * to change the default - */ - public static synchronized void setDefaultCommandMap(CommandMap commandMap) { - SecurityManager security = System.getSecurityManager(); - if (security != null) { - try { - // if it's ok with the SecurityManager, it's ok with me... - security.checkSetFactory(); - } catch (SecurityException ex) { - // otherwise, we also allow it if this code and the - // factory come from the same (non-system) class loader (e.g., - // the JAF classes were loaded with the applet classes). - ClassLoader cl = CommandMap.class.getClassLoader(); - if (cl == null || cl.getParent() == null || - cl != commandMap.getClass().getClassLoader()) { - throw ex; - } - } - } - // remove any per-thread-context-class-loader CommandMap - map.remove(SecuritySupport.getContextClassLoader()); - defaultCommandMap = commandMap; - } - - /** - * Get the preferred command list from a MIME Type. The actual semantics - * are determined by the implementation of the CommandMap. - * - * @param mimeType the MIME type - * @return the CommandInfo classes that represent the command Beans. - */ - abstract public CommandInfo[] getPreferredCommands(String mimeType); - - /** - * Get the preferred command list from a MIME Type. The actual semantics - * are determined by the implementation of the CommandMap.

            - * - * The {@code DataSource} provides extra information, such as - * the file name, that a CommandMap implementation may use to further - * refine the list of commands that are returned. The implementation - * in this class simply calls the {@code getPreferredCommands} - * method that ignores this argument. - * - * @param mimeType the MIME type - * @param ds a DataSource for the data - * @return the CommandInfo classes that represent the command Beans. - * @since 1.6, JAF 1.1 - */ - public CommandInfo[] getPreferredCommands(String mimeType, DataSource ds) { - return getPreferredCommands(mimeType); - } - - /** - * Get all the available commands for this type. This method - * should return all the possible commands for this MIME type. - * - * @param mimeType the MIME type - * @return the CommandInfo objects representing all the commands. - */ - abstract public CommandInfo[] getAllCommands(String mimeType); - - /** - * Get all the available commands for this type. This method - * should return all the possible commands for this MIME type.

            - * - * The {@code DataSource} provides extra information, such as - * the file name, that a CommandMap implementation may use to further - * refine the list of commands that are returned. The implementation - * in this class simply calls the {@code getAllCommands} - * method that ignores this argument. - * - * @param mimeType the MIME type - * @param ds a DataSource for the data - * @return the CommandInfo objects representing all the commands. - * @since 1.6, JAF 1.1 - */ - public CommandInfo[] getAllCommands(String mimeType, DataSource ds) { - return getAllCommands(mimeType); - } - - /** - * Get the default command corresponding to the MIME type. - * - * @param mimeType the MIME type - * @param cmdName the command name - * @return the CommandInfo corresponding to the command. - */ - abstract public CommandInfo getCommand(String mimeType, String cmdName); - - /** - * Get the default command corresponding to the MIME type.

            - * - * The {@code DataSource} provides extra information, such as - * the file name, that a CommandMap implementation may use to further - * refine the command that is chosen. The implementation - * in this class simply calls the {@code getCommand} - * method that ignores this argument. - * - * @param mimeType the MIME type - * @param cmdName the command name - * @param ds a DataSource for the data - * @return the CommandInfo corresponding to the command. - * @since 1.6, JAF 1.1 - */ - public CommandInfo getCommand(String mimeType, String cmdName, - DataSource ds) { - return getCommand(mimeType, cmdName); - } - - /** - * Locate a DataContentHandler that corresponds to the MIME type. - * The mechanism and semantics for determining this are determined - * by the implementation of the particular CommandMap. - * - * @param mimeType the MIME type - * @return the DataContentHandler for the MIME type - */ - abstract public DataContentHandler createDataContentHandler(String - mimeType); - - /** - * Locate a DataContentHandler that corresponds to the MIME type. - * The mechanism and semantics for determining this are determined - * by the implementation of the particular CommandMap.

            - * - * The {@code DataSource} provides extra information, such as - * the file name, that a CommandMap implementation may use to further - * refine the choice of DataContentHandler. The implementation - * in this class simply calls the {@code createDataContentHandler} - * method that ignores this argument. - * - * @param mimeType the MIME type - * @param ds a DataSource for the data - * @return the DataContentHandler for the MIME type - * @since 1.6, JAF 1.1 - */ - public DataContentHandler createDataContentHandler(String mimeType, - DataSource ds) { - return createDataContentHandler(mimeType); - } - - /** - * Get all the MIME types known to this command map. - * If the command map doesn't support this operation, - * null is returned. - * - * @return array of MIME types as strings, or null if not supported - * @since 1.6, JAF 1.1 - */ - public String[] getMimeTypes() { - return null; - } -} diff --git a/src/java.activation/share/classes/javax/activation/CommandObject.java b/src/java.activation/share/classes/javax/activation/CommandObject.java deleted file mode 100644 index 1ec5849b38b..00000000000 --- a/src/java.activation/share/classes/javax/activation/CommandObject.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package javax.activation; - -import java.io.IOException; - -/** - * JavaBeans components that are Activation Framework aware implement - * this interface to find out which command verb they're being asked - * to perform, and to obtain the DataHandler representing the - * data they should operate on. JavaBeans that don't implement - * this interface may be used as well. Such commands may obtain - * the data using the Externalizable interface, or using an - * application-specific method. - * - * @since 1.6 - */ -public interface CommandObject { - - /** - * Initialize the Command with the verb it is requested to handle - * and the DataHandler that describes the data it will - * operate on. NOTE: it is acceptable for the caller - * to pass null as the value for {@code DataHandler}. - * - * @param verb The Command Verb this object refers to. - * @param dh The DataHandler. - * @exception IOException for failures accessing data - */ - public void setCommandContext(String verb, DataHandler dh) - throws IOException; -} diff --git a/src/java.activation/share/classes/javax/activation/DataContentHandler.java b/src/java.activation/share/classes/javax/activation/DataContentHandler.java deleted file mode 100644 index 8d429ef4c33..00000000000 --- a/src/java.activation/share/classes/javax/activation/DataContentHandler.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package javax.activation; - -import java.awt.datatransfer.DataFlavor; -import java.awt.datatransfer.UnsupportedFlavorException; -import java.io.InputStream; -import java.io.IOException; -import java.io.OutputStream; -import javax.activation.DataSource; - -/** - *

            The DataContentHandler interface is implemented by objects that can - * be used to extend the capabilities of the DataHandler's implementation - * of the Transferable interface. Through DataContentHandlers - * the framework can be extended to convert streams in to objects, and - * to write objects to streams.

            - * - *

            An implementation of DataContentHandler should be a public class - * with a public no-arg constructor. If the implementation class is in - * a named module then it should be in an API package that is exported - * to the module {@code java.activation}.

            - * - *

            Applications don't generally call the methods in DataContentHandlers - * directly. Instead, an application calls the equivalent methods in - * DataHandler. The DataHandler will attempt to find an appropriate - * DataContentHandler that corresponds to its MIME type using the - * current DataContentHandlerFactory. The DataHandler then calls - * through to the methods in the DataContentHandler.

            - * - * @since 1.6 - */ - -public interface DataContentHandler { - /** - * Returns an array of DataFlavor objects indicating the flavors the - * data can be provided in. The array should be ordered according to - * preference for providing the data (from most richly descriptive to - * least descriptive). - * - * @return The DataFlavors. - */ - public DataFlavor[] getTransferDataFlavors(); - - /** - * Returns an object which represents the data to be transferred. - * The class of the object returned is defined by the representation class - * of the flavor. - * - * @param df The DataFlavor representing the requested type. - * @param ds The DataSource representing the data to be converted. - * @return The constructed Object. - * @exception UnsupportedFlavorException if the handler doesn't - * support the requested flavor - * @exception IOException if the data can't be accessed - */ - public Object getTransferData(DataFlavor df, DataSource ds) - throws UnsupportedFlavorException, IOException; - - /** - * Return an object representing the data in its most preferred form. - * Generally this will be the form described by the first DataFlavor - * returned by the getTransferDataFlavors method. - * - * @param ds The DataSource representing the data to be converted. - * @return The constructed Object. - * @exception IOException if the data can't be accessed - */ - public Object getContent(DataSource ds) throws IOException; - - /** - * Convert the object to a byte stream of the specified MIME type - * and write it to the output stream. - * - * @param obj The object to be converted. - * @param mimeType The requested MIME type of the resulting byte stream. - * @param os The output stream into which to write the converted - * byte stream. - * @exception IOException errors writing to the stream - */ - public void writeTo(Object obj, String mimeType, OutputStream os) - throws IOException; -} diff --git a/src/java.activation/share/classes/javax/activation/DataContentHandlerFactory.java b/src/java.activation/share/classes/javax/activation/DataContentHandlerFactory.java deleted file mode 100644 index 85d3b71c648..00000000000 --- a/src/java.activation/share/classes/javax/activation/DataContentHandlerFactory.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package javax.activation; - -/** - * This interface defines a factory for DataContentHandlers. An - * implementation of this interface should map a MIME type into an - * instance of DataContentHandler. The design pattern for classes implementing - * this interface is the same as for the ContentHandler mechanism used in - * java.net.URL. - * - * @since 1.6 - */ - -public interface DataContentHandlerFactory { - - /** - * Creates a new DataContentHandler object for the MIME type. - * - * @param mimeType the MIME type to create the DataContentHandler for. - * @return The new DataContentHandler, or null - * if none are found. - */ - public DataContentHandler createDataContentHandler(String mimeType); -} diff --git a/src/java.activation/share/classes/javax/activation/DataHandler.java b/src/java.activation/share/classes/javax/activation/DataHandler.java deleted file mode 100644 index 59503997eb4..00000000000 --- a/src/java.activation/share/classes/javax/activation/DataHandler.java +++ /dev/null @@ -1,900 +0,0 @@ -/* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package javax.activation; - -import java.io.InputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.io.PipedInputStream; -import java.io.PipedOutputStream; -import java.io.OutputStreamWriter; -import java.net.URL; -import java.awt.datatransfer.Transferable; -import java.awt.datatransfer.DataFlavor; -import java.awt.datatransfer.UnsupportedFlavorException; - -/** - * The DataHandler class provides a consistent interface to data - * available in many different sources and formats. - * It manages simple stream to string conversions and related operations - * using DataContentHandlers. - * It provides access to commands that can operate on the data. - * The commands are found using a CommandMap.

            - * - * DataHandler and the Transferable Interface

            - * DataHandler implements the Transferable interface so that data can - * be used in AWT data transfer operations, such as cut and paste and - * drag and drop. The implementation of the Transferable interface - * relies on the availability of an installed DataContentHandler - * object corresponding to the MIME type of the data represented in - * the specific instance of the DataHandler.

            - * - * DataHandler and CommandMaps

            - * The DataHandler keeps track of the current CommandMap that it uses to - * service requests for commands ({@code getCommand, getAllCommands, - * getPreferredCommands}). - * Each instance of a DataHandler may have a CommandMap associated with - * it using the {@code setCommandMap} method. If a CommandMap was - * not set, DataHandler calls the {@code getDefaultCommandMap} - * method in CommandMap and uses the value it returns. See - * CommandMap for more information.

            - * - * DataHandler and URLs

            - * The current DataHandler implementation creates a private - * instance of URLDataSource when it is constructed with a URL. - * - * @see javax.activation.CommandMap - * @see javax.activation.DataContentHandler - * @see javax.activation.DataSource - * @see javax.activation.URLDataSource - * - * @since 1.6 - */ - -public class DataHandler implements Transferable { - - // Use the datasource to indicate whether we were started via the - // DataSource constructor or the object constructor. - private DataSource dataSource = null; - private DataSource objDataSource = null; - - // The Object and mimetype from the constructor (if passed in). - // object remains null if it was instantiated with a - // DataSource. - private Object object = null; - private String objectMimeType = null; - - // Keep track of the CommandMap - private CommandMap currentCommandMap = null; - - // our transfer flavors - private static final DataFlavor emptyFlavors[] = new DataFlavor[0]; - private DataFlavor transferFlavors[] = emptyFlavors; - - // our DataContentHandler - private DataContentHandler dataContentHandler = null; - private DataContentHandler factoryDCH = null; - - // our DataContentHandlerFactory - private static DataContentHandlerFactory factory = null; - private DataContentHandlerFactory oldFactory = null; - // the short representation of the ContentType (sans params) - private String shortType = null; - - /** - * Create a {@code DataHandler} instance referencing the - * specified DataSource. The data exists in a byte stream form. - * The DataSource will provide an InputStream to access the data. - * - * @param ds the DataSource - */ - public DataHandler(DataSource ds) { - // save a reference to the incoming DS - dataSource = ds; - oldFactory = factory; // keep track of the factory - } - - /** - * Create a {@code DataHandler} instance representing an object - * of this MIME type. This constructor is - * used when the application already has an in-memory representation - * of the data in the form of a Java Object. - * - * @param obj the Java Object - * @param mimeType the MIME type of the object - */ - public DataHandler(Object obj, String mimeType) { - object = obj; - objectMimeType = mimeType; - oldFactory = factory; // keep track of the factory - } - - /** - * Create a {@code DataHandler} instance referencing a URL. - * The DataHandler internally creates a {@code URLDataSource} - * instance to represent the URL. - * - * @param url a URL object - */ - public DataHandler(URL url) { - dataSource = new URLDataSource(url); - oldFactory = factory; // keep track of the factory - } - - /** - * Return the CommandMap for this instance of DataHandler. - */ - private synchronized CommandMap getCommandMap() { - if (currentCommandMap != null) - return currentCommandMap; - else - return CommandMap.getDefaultCommandMap(); - } - - /** - * Return the DataSource associated with this instance - * of DataHandler. - *

            - * For DataHandlers that have been instantiated with a DataSource, - * this method returns the DataSource that was used to create the - * DataHandler object. In other cases the DataHandler - * constructs a DataSource from the data used to construct - * the DataHandler. DataSources created for DataHandlers not - * instantiated with a DataSource are cached for performance - * reasons. - * - * @return a valid DataSource object for this DataHandler - */ - public DataSource getDataSource() { - if (dataSource == null) { - // create one on the fly - if (objDataSource == null) - objDataSource = new DataHandlerDataSource(this); - return objDataSource; - } - return dataSource; - } - - /** - * Return the name of the data object. If this DataHandler - * was created with a DataSource, this method calls through - * to the {@code DataSource.getName} method, otherwise it - * returns null. - * - * @return the name of the object - */ - public String getName() { - if (dataSource != null) - return dataSource.getName(); - else - return null; - } - - /** - * Return the MIME type of this object as retrieved from - * the source object. Note that this is the full - * type with parameters. - * - * @return the MIME type - */ - public String getContentType() { - if (dataSource != null) // data source case - return dataSource.getContentType(); - else - return objectMimeType; // obj/type case - } - - /** - * Get the InputStream for this object.

            - * - * For DataHandlers instantiated with a DataSource, the DataHandler - * calls the {@code DataSource.getInputStream} method and - * returns the result to the caller. - *

            - * For DataHandlers instantiated with an Object, the DataHandler - * first attempts to find a DataContentHandler for the Object. If - * the DataHandler can not find a DataContentHandler for this MIME - * type, it throws an UnsupportedDataTypeException. If it is - * successful, it creates a pipe and a thread. The thread uses the - * DataContentHandler's {@code writeTo} method to write the - * stream data into one end of the pipe. The other end of the pipe - * is returned to the caller. Because a thread is created to copy - * the data, IOExceptions that may occur during the copy can not be - * propagated back to the caller. The result is an empty stream. - * - * @return the InputStream representing this data - * @exception IOException if an I/O error occurs - * - * @see javax.activation.DataContentHandler#writeTo - * @see javax.activation.UnsupportedDataTypeException - */ - public InputStream getInputStream() throws IOException { - InputStream ins = null; - - if (dataSource != null) { - ins = dataSource.getInputStream(); - } else { - DataContentHandler dch = getDataContentHandler(); - // we won't even try if we can't get a dch - if (dch == null) - throw new UnsupportedDataTypeException( - "no DCH for MIME type " + getBaseType()); - - if (dch instanceof ObjectDataContentHandler) { - if (((ObjectDataContentHandler)dch).getDCH() == null) - throw new UnsupportedDataTypeException( - "no object DCH for MIME type " + getBaseType()); - } - // there is none but the default^^^^^^^^^^^^^^^^ - final DataContentHandler fdch = dch; - - // from bill s. - // ce n'est pas une pipe! - // - // NOTE: This block of code needs to throw exceptions, but - // can't because it is in another thread!!! ARG! - // - final PipedOutputStream pos = new PipedOutputStream(); - PipedInputStream pin = new PipedInputStream(pos); - new Thread( - new Runnable() { - public void run() { - try { - fdch.writeTo(object, objectMimeType, pos); - } catch (IOException e) { - - } finally { - try { - pos.close(); - } catch (IOException ie) { } - } - } - }, - "DataHandler.getInputStream").start(); - ins = pin; - } - - return ins; - } - - /** - * Write the data to an {@code OutputStream}.

            - * - * If the DataHandler was created with a DataSource, writeTo - * retrieves the InputStream and copies the bytes from the - * InputStream to the OutputStream passed in. - *

            - * If the DataHandler was created with an object, writeTo - * retrieves the DataContentHandler for the object's type. - * If the DataContentHandler was found, it calls the - * {@code writeTo} method on the {@code DataContentHandler}. - * - * @param os the OutputStream to write to - * @exception IOException if an I/O error occurs - */ - public void writeTo(OutputStream os) throws IOException { - // for the DataSource case - if (dataSource != null) { - InputStream is = null; - byte data[] = new byte[8*1024]; - int bytes_read; - - is = dataSource.getInputStream(); - - try { - while ((bytes_read = is.read(data)) > 0) { - os.write(data, 0, bytes_read); - } - } finally { - is.close(); - is = null; - } - } else { // for the Object case - DataContentHandler dch = getDataContentHandler(); - dch.writeTo(object, objectMimeType, os); - } - } - - /** - * Get an OutputStream for this DataHandler to allow overwriting - * the underlying data. - * If the DataHandler was created with a DataSource, the - * DataSource's {@code getOutputStream} method is called. - * Otherwise, {@code null} is returned. - * - * @return the OutputStream - * @exception IOException for failures creating the OutputStream - * - * @see javax.activation.DataSource#getOutputStream - * @see javax.activation.URLDataSource - */ - public OutputStream getOutputStream() throws IOException { - if (dataSource != null) - return dataSource.getOutputStream(); - else - return null; - } - - /** - * Return the DataFlavors in which this data is available.

            - * - * Returns an array of DataFlavor objects indicating the flavors - * the data can be provided in. The array is usually ordered - * according to preference for providing the data, from most - * richly descriptive to least richly descriptive.

            - * - * The DataHandler attempts to find a DataContentHandler that - * corresponds to the MIME type of the data. If one is located, - * the DataHandler calls the DataContentHandler's - * {@code getTransferDataFlavors} method.

            - * - * If a DataContentHandler can not be located, and if the - * DataHandler was created with a DataSource (or URL), one - * DataFlavor is returned that represents this object's MIME type - * and the {@code java.io.InputStream} class. If the - * DataHandler was created with an object and a MIME type, - * getTransferDataFlavors returns one DataFlavor that represents - * this object's MIME type and the object's class. - * - * @return an array of data flavors in which this data can be transferred - * @see javax.activation.DataContentHandler#getTransferDataFlavors - */ - public synchronized DataFlavor[] getTransferDataFlavors() { - if (factory != oldFactory) // if the factory has changed, clear cache - transferFlavors = emptyFlavors; - - // if it's not set, set it... - if (transferFlavors == emptyFlavors) - transferFlavors = getDataContentHandler().getTransferDataFlavors(); - - if (transferFlavors == emptyFlavors) - return transferFlavors; - else - return transferFlavors.clone(); - - } - - /** - * Returns whether the specified data flavor is supported - * for this object.

            - * - * This method iterates through the DataFlavors returned from - * {@code getTransferDataFlavors}, comparing each with - * the specified flavor. - * - * @param flavor the requested flavor for the data - * @return true if the data flavor is supported - * @see javax.activation.DataHandler#getTransferDataFlavors - */ - public boolean isDataFlavorSupported(DataFlavor flavor) { - DataFlavor[] lFlavors = getTransferDataFlavors(); - - for (int i = 0; i < lFlavors.length; i++) { - if (lFlavors[i].equals(flavor)) - return true; - } - return false; - } - - /** - * Returns an object that represents the data to be - * transferred. The class of the object returned is defined by the - * representation class of the data flavor.

            - * - * For DataHandler's created with DataSources or URLs:

            - * - * The DataHandler attempts to locate a DataContentHandler - * for this MIME type. If one is found, the passed in DataFlavor - * and the type of the data are passed to its {@code getTransferData} - * method. If the DataHandler fails to locate a DataContentHandler - * and the flavor specifies this object's MIME type and the - * {@code java.io.InputStream} class, this object's InputStream - * is returned. - * Otherwise it throws an UnsupportedFlavorException.

            - * - * For DataHandler's created with Objects:

            - * - * The DataHandler attempts to locate a DataContentHandler - * for this MIME type. If one is found, the passed in DataFlavor - * and the type of the data are passed to its getTransferData - * method. If the DataHandler fails to locate a DataContentHandler - * and the flavor specifies this object's MIME type and its class, - * this DataHandler's referenced object is returned. - * Otherwise it throws an UnsupportedFlavorException. - * - * @param flavor the requested flavor for the data - * @return the object - * @exception UnsupportedFlavorException if the data could not be - * converted to the requested flavor - * @exception IOException if an I/O error occurs - * @see javax.activation.ActivationDataFlavor - */ - public Object getTransferData(DataFlavor flavor) - throws UnsupportedFlavorException, IOException { - return getDataContentHandler().getTransferData(flavor, dataSource); - } - - /** - * Set the CommandMap for use by this DataHandler. - * Setting it to {@code null} causes the CommandMap to revert - * to the CommandMap returned by the - * {@code CommandMap.getDefaultCommandMap} method. - * Changing the CommandMap, or setting it to {@code null}, - * clears out any data cached from the previous CommandMap. - * - * @param commandMap the CommandMap to use in this DataHandler - * - * @see javax.activation.CommandMap#setDefaultCommandMap - */ - public synchronized void setCommandMap(CommandMap commandMap) { - if (commandMap != currentCommandMap || commandMap == null) { - // clear cached values... - transferFlavors = emptyFlavors; - dataContentHandler = null; - - currentCommandMap = commandMap; - } - } - - /** - * Return the preferred commands for this type of data. - * This method calls the {@code getPreferredCommands} method - * in the CommandMap associated with this instance of DataHandler. - * This method returns an array that represents a subset of - * available commands. In cases where multiple commands for the - * MIME type represented by this DataHandler are present, the - * installed CommandMap chooses the appropriate commands. - * - * @return the CommandInfo objects representing the preferred commands - * - * @see javax.activation.CommandMap#getPreferredCommands - */ - public CommandInfo[] getPreferredCommands() { - if (dataSource != null) - return getCommandMap().getPreferredCommands(getBaseType(), - dataSource); - else - return getCommandMap().getPreferredCommands(getBaseType()); - } - - /** - * Return all the commands for this type of data. - * This method returns an array containing all commands - * for the type of data represented by this DataHandler. The - * MIME type for the underlying data represented by this DataHandler - * is used to call through to the {@code getAllCommands} method - * of the CommandMap associated with this DataHandler. - * - * @return the CommandInfo objects representing all the commands - * - * @see javax.activation.CommandMap#getAllCommands - */ - public CommandInfo[] getAllCommands() { - if (dataSource != null) - return getCommandMap().getAllCommands(getBaseType(), dataSource); - else - return getCommandMap().getAllCommands(getBaseType()); - } - - /** - * Get the command cmdName. Use the search semantics as - * defined by the CommandMap installed in this DataHandler. The - * MIME type for the underlying data represented by this DataHandler - * is used to call through to the {@code getCommand} method - * of the CommandMap associated with this DataHandler. - * - * @param cmdName the command name - * @return the CommandInfo corresponding to the command - * - * @see javax.activation.CommandMap#getCommand - */ - public CommandInfo getCommand(String cmdName) { - if (dataSource != null) - return getCommandMap().getCommand(getBaseType(), cmdName, - dataSource); - else - return getCommandMap().getCommand(getBaseType(), cmdName); - } - - /** - * Return the data in its preferred Object form.

            - * - * If the DataHandler was instantiated with an object, return - * the object.

            - * - * If the DataHandler was instantiated with a DataSource, - * this method uses a DataContentHandler to return the content - * object for the data represented by this DataHandler. If no - * {@code DataContentHandler} can be found for the - * the type of this data, the DataHandler returns an - * InputStream for the data. - * - * @return the content. - * @exception IOException if an IOException occurs during - * this operation. - */ - public Object getContent() throws IOException { - if (object != null) - return object; - else - return getDataContentHandler().getContent(getDataSource()); - } - - /** - * A convenience method that takes a CommandInfo object - * and instantiates the corresponding command, usually - * a JavaBean component. - *

            - * This method calls the CommandInfo's {@code getCommandObject} - * method with the {@code ClassLoader} used to load - * the {@code javax.activation.DataHandler} class itself. - * - * @param cmdinfo the CommandInfo corresponding to a command - * @return the instantiated command object - */ - public Object getBean(CommandInfo cmdinfo) { - Object bean = null; - - try { - // make the bean - ClassLoader cld = null; - // First try the "application's" class loader. - cld = SecuritySupport.getContextClassLoader(); - if (cld == null) - cld = this.getClass().getClassLoader(); - bean = cmdinfo.getCommandObject(this, cld); - } catch (IOException e) { - } catch (ClassNotFoundException e) { } - - return bean; - } - - /** - * Get the DataContentHandler for this DataHandler:

            - * - * If a DataContentHandlerFactory is set, use it. - * Otherwise look for an object to serve DCH in the - * following order:

            - * - * 1) if a factory is set, use it

            - * 2) if a CommandMap is set, use it

            - * 3) use the default CommandMap

            - * - * In any case, wrap the real DataContentHandler with one of our own - * to handle any missing cases, fill in defaults, and to ensure that - * we always have a non-null DataContentHandler. - * - * @return the requested DataContentHandler - */ - private synchronized DataContentHandler getDataContentHandler() { - - // make sure the factory didn't change - if (factory != oldFactory) { - oldFactory = factory; - factoryDCH = null; - dataContentHandler = null; - transferFlavors = emptyFlavors; - } - - if (dataContentHandler != null) - return dataContentHandler; - - String simpleMT = getBaseType(); - - if (factoryDCH == null && factory != null) - factoryDCH = factory.createDataContentHandler(simpleMT); - - if (factoryDCH != null) - dataContentHandler = factoryDCH; - - if (dataContentHandler == null) { - if (dataSource != null) - dataContentHandler = getCommandMap(). - createDataContentHandler(simpleMT, dataSource); - else - dataContentHandler = getCommandMap(). - createDataContentHandler(simpleMT); - } - - // getDataContentHandler always uses these 'wrapper' handlers - // to make sure it returns SOMETHING meaningful... - if (dataSource != null) - dataContentHandler = new DataSourceDataContentHandler( - dataContentHandler, - dataSource); - else - dataContentHandler = new ObjectDataContentHandler( - dataContentHandler, - object, - objectMimeType); - return dataContentHandler; - } - - /** - * Use the MimeType class to extract the MIME type/subtype, - * ignoring the parameters. The type is cached. - */ - private synchronized String getBaseType() { - if (shortType == null) { - String ct = getContentType(); - try { - MimeType mt = new MimeType(ct); - shortType = mt.getBaseType(); - } catch (MimeTypeParseException e) { - shortType = ct; - } - } - return shortType; - } - - /** - * Sets the DataContentHandlerFactory. The DataContentHandlerFactory - * is called first to find DataContentHandlers. - * The DataContentHandlerFactory can only be set once. - *

            - * If the DataContentHandlerFactory has already been set, - * this method throws an Error. - * - * @param newFactory the DataContentHandlerFactory - * @exception Error if the factory has already been defined. - * - * @see javax.activation.DataContentHandlerFactory - */ - public static synchronized void setDataContentHandlerFactory( - DataContentHandlerFactory newFactory) { - if (factory != null) - throw new Error("DataContentHandlerFactory already defined"); - - SecurityManager security = System.getSecurityManager(); - if (security != null) { - try { - // if it's ok with the SecurityManager, it's ok with me... - security.checkSetFactory(); - } catch (SecurityException ex) { - // otherwise, we also allow it if this code and the - // factory come from the same class loader (e.g., - // the JAF classes were loaded with the applet classes). - if (DataHandler.class.getClassLoader() != - newFactory.getClass().getClassLoader()) - throw ex; - } - } - factory = newFactory; - } -} - -/** - * The DataHanderDataSource class implements the - * DataSource interface when the DataHandler is constructed - * with an Object and a mimeType string. - */ -class DataHandlerDataSource implements DataSource { - DataHandler dataHandler = null; - - /** - * The constructor. - */ - public DataHandlerDataSource(DataHandler dh) { - this.dataHandler = dh; - } - - /** - * Returns an {@code InputStream} representing this object. - * @return the {@code InputStream} - */ - public InputStream getInputStream() throws IOException { - return dataHandler.getInputStream(); - } - - /** - * Returns the {@code OutputStream} for this object. - * @return the {@code OutputStream} - */ - public OutputStream getOutputStream() throws IOException { - return dataHandler.getOutputStream(); - } - - /** - * Returns the MIME type of the data represented by this object. - * @return the MIME type - */ - public String getContentType() { - return dataHandler.getContentType(); - } - - /** - * Returns the name of this object. - * @return the name of this object - */ - public String getName() { - return dataHandler.getName(); // what else would it be? - } -} - -/* - * DataSourceDataContentHandler - * - * This is a private DataContentHandler that wraps the real - * DataContentHandler in the case where the DataHandler was instantiated - * with a DataSource. - */ -class DataSourceDataContentHandler implements DataContentHandler { - private DataSource ds = null; - private DataFlavor transferFlavors[] = null; - private DataContentHandler dch = null; - - /** - * The constructor. - */ - public DataSourceDataContentHandler(DataContentHandler dch, DataSource ds) { - this.ds = ds; - this.dch = dch; - } - - /** - * Return the DataFlavors for this {@code DataContentHandler}. - * @return the DataFlavors - */ - public DataFlavor[] getTransferDataFlavors() { - - if (transferFlavors == null) { - if (dch != null) { // is there a dch? - transferFlavors = dch.getTransferDataFlavors(); - } else { - transferFlavors = new DataFlavor[1]; - transferFlavors[0] = - new ActivationDataFlavor(ds.getContentType(), - ds.getContentType()); - } - } - return transferFlavors; - } - - /** - * Return the Transfer Data of type DataFlavor from InputStream. - * @param df the DataFlavor - * @param ds the DataSource - * @return the constructed Object - */ - public Object getTransferData(DataFlavor df, DataSource ds) throws - UnsupportedFlavorException, IOException { - - if (dch != null) - return dch.getTransferData(df, ds); - else if (df.equals(getTransferDataFlavors()[0])) // only have one now - return ds.getInputStream(); - else - throw new UnsupportedFlavorException(df); - } - - public Object getContent(DataSource ds) throws IOException { - - if (dch != null) - return dch.getContent(ds); - else - return ds.getInputStream(); - } - - /** - * Write the object to the output stream. - */ - public void writeTo(Object obj, String mimeType, OutputStream os) - throws IOException { - if (dch != null) - dch.writeTo(obj, mimeType, os); - else - throw new UnsupportedDataTypeException( - "no DCH for content type " + ds.getContentType()); - } -} - -/* - * ObjectDataContentHandler - * - * This is a private DataContentHandler that wraps the real - * DataContentHandler in the case where the DataHandler was instantiated - * with an object. - */ -class ObjectDataContentHandler implements DataContentHandler { - private DataFlavor transferFlavors[] = null; - private Object obj; - private String mimeType; - private DataContentHandler dch = null; - - /** - * The constructor. - */ - public ObjectDataContentHandler(DataContentHandler dch, - Object obj, String mimeType) { - this.obj = obj; - this.mimeType = mimeType; - this.dch = dch; - } - - /** - * Return the DataContentHandler for this object. - * Used only by the DataHandler class. - */ - public DataContentHandler getDCH() { - return dch; - } - - /** - * Return the DataFlavors for this {@code DataContentHandler}. - * @return the DataFlavors - */ - public synchronized DataFlavor[] getTransferDataFlavors() { - if (transferFlavors == null) { - if (dch != null) { - transferFlavors = dch.getTransferDataFlavors(); - } else { - transferFlavors = new DataFlavor[1]; - transferFlavors[0] = new ActivationDataFlavor(obj.getClass(), - mimeType, mimeType); - } - } - return transferFlavors; - } - - /** - * Return the Transfer Data of type DataFlavor from InputStream. - * @param df the DataFlavor - * @param ds the DataSource - * @return the constructed Object - */ - public Object getTransferData(DataFlavor df, DataSource ds) - throws UnsupportedFlavorException, IOException { - - if (dch != null) - return dch.getTransferData(df, ds); - else if (df.equals(getTransferDataFlavors()[0])) // only have one now - return obj; - else - throw new UnsupportedFlavorException(df); - - } - - public Object getContent(DataSource ds) { - return obj; - } - - /** - * Write the object to the output stream. - */ - public void writeTo(Object obj, String mimeType, OutputStream os) - throws IOException { - if (dch != null) - dch.writeTo(obj, mimeType, os); - else if (obj instanceof byte[]) - os.write((byte[])obj); - else if (obj instanceof String) { - OutputStreamWriter osw = new OutputStreamWriter(os); - osw.write((String)obj); - osw.flush(); - } else throw new UnsupportedDataTypeException( - "no object DCH for MIME type " + this.mimeType); - } -} diff --git a/src/java.activation/share/classes/javax/activation/DataSource.java b/src/java.activation/share/classes/javax/activation/DataSource.java deleted file mode 100644 index cee1018d1fd..00000000000 --- a/src/java.activation/share/classes/javax/activation/DataSource.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package javax.activation; - -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - -/** - * The DataSource interface provides the JavaBeans Activation Framework - * with an abstraction of an arbitrary collection of data. It - * provides a type for that data as well as access - * to it in the form of InputStreams and - * OutputStreams where appropriate. - * - * @since 1.6 - */ - -public interface DataSource { - - /** - * This method returns an InputStream representing - * the data and throws the appropriate exception if it can - * not do so. Note that a new InputStream object must be - * returned each time this method is called, and the stream must be - * positioned at the beginning of the data. - * - * @return an InputStream - * @exception IOException for failures creating the InputStream - */ - public InputStream getInputStream() throws IOException; - - /** - * This method returns an OutputStream where the - * data can be written and throws the appropriate exception if it can - * not do so. Note that a new OutputStream object must - * be returned each time this method is called, and the stream must - * be positioned at the location the data is to be written. - * - * @return an OutputStream - * @exception IOException for failures creating the OutputStream - */ - public OutputStream getOutputStream() throws IOException; - - /** - * This method returns the MIME type of the data in the form of a - * string. It should always return a valid type. It is suggested - * that getContentType return "application/octet-stream" if the - * DataSource implementation can not determine the data type. - * - * @return the MIME Type - */ - public String getContentType(); - - /** - * Return the name of this object where the name of the object - * is dependant on the nature of the underlying objects. DataSources - * encapsulating files may choose to return the filename of the object. - * (Typically this would be the last component of the filename, not an - * entire pathname.) - * - * @return the name of the object. - */ - public String getName(); -} diff --git a/src/java.activation/share/classes/javax/activation/FileDataSource.java b/src/java.activation/share/classes/javax/activation/FileDataSource.java deleted file mode 100644 index a59a390ffe3..00000000000 --- a/src/java.activation/share/classes/javax/activation/FileDataSource.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package javax.activation; - -import java.io.InputStream; -import java.io.OutputStream; -import java.io.File; -import java.io.FileDescriptor; -import java.io.FileNotFoundException; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import com.sun.activation.registries.MimeTypeFile; - -/** - * The FileDataSource class implements a simple DataSource object - * that encapsulates a file. It provides data typing services via - * a FileTypeMap object.

            - * - * FileDataSource Typing Semantics

            - * - * The FileDataSource class delegates data typing of files - * to an object subclassed from the FileTypeMap class. - * The setFileTypeMap method can be used to explicitly - * set the FileTypeMap for an instance of FileDataSource. If no - * FileTypeMap is set, the FileDataSource will call the FileTypeMap's - * getDefaultFileTypeMap method to get the System's default FileTypeMap. - * - * @see javax.activation.DataSource - * @see javax.activation.FileTypeMap - * @see javax.activation.MimetypesFileTypeMap - * - * @since 1.6 - */ -public class FileDataSource implements DataSource { - - // keep track of original 'ref' passed in, non-null - // one indicated which was passed in: - private File _file = null; - private FileTypeMap typeMap = null; - - /** - * Creates a FileDataSource from a File object. Note: - * The file will not actually be opened until a method is - * called that requires the file to be opened. - * - * @param file the file - */ - public FileDataSource(File file) { - _file = file; // save the file Object... - } - - /** - * Creates a FileDataSource from - * the specified path name. Note: - * The file will not actually be opened until a method is - * called that requires the file to be opened. - * - * @param name the system-dependent file name. - */ - public FileDataSource(String name) { - this(new File(name)); // use the file constructor - } - - /** - * This method will return an InputStream representing the - * the data and will throw an IOException if it can - * not do so. This method will return a new - * instance of InputStream with each invocation. - * - * @return an InputStream - */ - public InputStream getInputStream() throws IOException { - return new FileInputStream(_file); - } - - /** - * This method will return an OutputStream representing the - * the data and will throw an IOException if it can - * not do so. This method will return a new instance of - * OutputStream with each invocation. - * - * @return an OutputStream - */ - public OutputStream getOutputStream() throws IOException { - return new FileOutputStream(_file); - } - - /** - * This method returns the MIME type of the data in the form of a - * string. This method uses the currently installed FileTypeMap. If - * there is no FileTypeMap explictly set, the FileDataSource will - * call the getDefaultFileTypeMap method on - * FileTypeMap to acquire a default FileTypeMap. Note: By - * default, the FileTypeMap used will be a MimetypesFileTypeMap. - * - * @return the MIME Type - * @see javax.activation.FileTypeMap#getDefaultFileTypeMap - */ - public String getContentType() { - // check to see if the type map is null? - if (typeMap == null) - return FileTypeMap.getDefaultFileTypeMap().getContentType(_file); - else - return typeMap.getContentType(_file); - } - - /** - * Return the name of this object. The FileDataSource - * will return the file name of the object. - * - * @return the name of the object. - * @see javax.activation.DataSource - */ - public String getName() { - return _file.getName(); - } - - /** - * Return the File object that corresponds to this FileDataSource. - * @return the File object for the file represented by this object. - */ - public File getFile() { - return _file; - } - - /** - * Set the FileTypeMap to use with this FileDataSource - * - * @param map The FileTypeMap for this object. - */ - public void setFileTypeMap(FileTypeMap map) { - typeMap = map; - } -} diff --git a/src/java.activation/share/classes/javax/activation/FileTypeMap.java b/src/java.activation/share/classes/javax/activation/FileTypeMap.java deleted file mode 100644 index 313998a6aec..00000000000 --- a/src/java.activation/share/classes/javax/activation/FileTypeMap.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package javax.activation; - -import java.io.File; -import java.util.Map; -import java.util.WeakHashMap; - -/** - * The FileTypeMap is an abstract class that provides a data typing - * interface for files. Implementations of this class will - * implement the getContentType methods which will derive a content - * type from a file name or a File object. FileTypeMaps could use any - * scheme to determine the data type, from examining the file extension - * of a file (like the MimetypesFileTypeMap) to opening the file and - * trying to derive its type from the contents of the file. The - * FileDataSource class uses the default FileTypeMap (a MimetypesFileTypeMap - * unless changed) to determine the content type of files. - * - * @see javax.activation.FileTypeMap - * @see javax.activation.FileDataSource - * @see javax.activation.MimetypesFileTypeMap - * - * @since 1.6 - */ - -public abstract class FileTypeMap { - - private static FileTypeMap defaultMap = null; - private static Map map = - new WeakHashMap(); - - /** - * The default constructor. - */ - public FileTypeMap() { - super(); - } - - /** - * Return the type of the file object. This method should - * always return a valid MIME type. - * - * @param file A file to be typed. - * @return The content type. - */ - abstract public String getContentType(File file); - - /** - * Return the type of the file passed in. This method should - * always return a valid MIME type. - * - * @param filename the pathname of the file. - * @return The content type. - */ - abstract public String getContentType(String filename); - - /** - * Sets the default FileTypeMap for the system. This instance - * will be returned to callers of getDefaultFileTypeMap. - * - * @param fileTypeMap The FileTypeMap. - * @exception SecurityException if the caller doesn't have permission - * to change the default - */ - public static synchronized void setDefaultFileTypeMap(FileTypeMap fileTypeMap) { - SecurityManager security = System.getSecurityManager(); - if (security != null) { - try { - // if it's ok with the SecurityManager, it's ok with me... - security.checkSetFactory(); - } catch (SecurityException ex) { - // otherwise, we also allow it if this code and the - // factory come from the same (non-system) class loader (e.g., - // the JAF classes were loaded with the applet classes). - ClassLoader cl = FileTypeMap.class.getClassLoader(); - if (cl == null || cl.getParent() == null || - cl != fileTypeMap.getClass().getClassLoader()) - throw ex; - } - } - // remove any per-thread-context-class-loader FileTypeMap - map.remove(SecuritySupport.getContextClassLoader()); - defaultMap = fileTypeMap; - } - - /** - * Return the default FileTypeMap for the system. - * If setDefaultFileTypeMap was called, return - * that instance, otherwise return an instance of - * MimetypesFileTypeMap. - * - * @return The default FileTypeMap - * @see javax.activation.FileTypeMap#setDefaultFileTypeMap - */ - public static synchronized FileTypeMap getDefaultFileTypeMap() { - if (defaultMap != null) - return defaultMap; - - // fetch per-thread-context-class-loader default - ClassLoader tccl = SecuritySupport.getContextClassLoader(); - FileTypeMap def = map.get(tccl); - if (def == null) { - def = new MimetypesFileTypeMap(); - map.put(tccl, def); - } - return def; - } -} diff --git a/src/java.activation/share/classes/javax/activation/MailcapCommandMap.java b/src/java.activation/share/classes/javax/activation/MailcapCommandMap.java deleted file mode 100644 index d88a4405166..00000000000 --- a/src/java.activation/share/classes/javax/activation/MailcapCommandMap.java +++ /dev/null @@ -1,721 +0,0 @@ -/* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package javax.activation; - -import java.util.*; -import java.io.*; -import java.net.*; -import java.security.AccessController; -import java.security.PrivilegedAction; -import com.sun.activation.registries.MailcapFile; -import com.sun.activation.registries.LogSupport; - -/** - * MailcapCommandMap extends the CommandMap - * abstract class. It implements a CommandMap whose configuration - * is based on mailcap files - * (RFC 1524). - * The MailcapCommandMap can be configured both programmatically - * and via configuration files. - *

            - * Mailcap file search order:

            - * The MailcapCommandMap looks in various places in the user's - * system for mailcap file entries. When requests are made - * to search for commands in the MailcapCommandMap, it searches - * mailcap files in the following order: - *

              - *
            1. Programatically added entries to the MailcapCommandMap instance. - *
            2. The file {@code .mailcap} in the user's home directory. - *
            3. The file {@code mailcap} in the Java runtime. - *
            4. The file or resources named {@code META-INF/mailcap}. - *
            5. The file or resource named {@code META-INF/mailcap.default} - * (usually found only in the {@code activation.jar} file). - *
            - *

            - * (The current implementation looks for the {@code mailcap} file - * in the Java runtime in the directory java.home{@code /conf} - * if it exists, and otherwise in the directory - * java.home{@code /lib}, where java.home is the value - * of the "java.home" System property. Note that the "conf" directory was - * introduced in JDK 9.) - *

            - * Mailcap file format:

            - * - * Mailcap files must conform to the mailcap - * file specification (RFC 1524, A User Agent Configuration Mechanism - * For Multimedia Mail Format Information). - * The file format consists of entries corresponding to - * particular MIME types. In general, the specification - * specifies applications for clients to use when they - * themselves cannot operate on the specified MIME type. The - * MailcapCommandMap extends this specification by using a parameter mechanism - * in mailcap files that allows JavaBeans(tm) components to be specified as - * corresponding to particular commands for a MIME type.

            - * - * When a mailcap file is - * parsed, the MailcapCommandMap recognizes certain parameter signatures, - * specifically those parameter names that begin with {@code x-java-}. - * The MailcapCommandMap uses this signature to find - * command entries for inclusion into its registries. - * Parameter names with the form {@code x-java-} - * are read by the MailcapCommandMap as identifying a command - * with the name name. When the name is {@code - * content-handler} the MailcapCommandMap recognizes the class - * signified by this parameter as a DataContentHandler. - * All other commands are handled generically regardless of command - * name. The command implementation is specified by a fully qualified - * class name of a JavaBean(tm) component. For example; a command for viewing - * some data can be specified as: {@code x-java-view=com.foo.ViewBean}.

            - * - * When the command name is {@code fallback-entry}, the value of - * the command may be {@code true} or {@code false}. An - * entry for a MIME type that includes a parameter of - * {@code x-java-fallback-entry=true} defines fallback commands - * for that MIME type that will only be used if no non-fallback entry - * can be found. For example, an entry of the form {@code text/*; ; - * x-java-fallback-entry=true; x-java-view=com.sun.TextViewer} - * specifies a view command to be used for any text MIME type. This - * view command would only be used if a non-fallback view command for - * the MIME type could not be found.

            - * - * MailcapCommandMap aware mailcap files have the - * following general form: - *

            {@code
            - * # Comments begin with a '#' and continue to the end of the line.
            - * ; ; 
            - * # Where a parameter list consists of one or more parameters,
            - * # where parameters look like: x-java-view=com.sun.TextViewer
            - * # and a parameter list looks like:
            - * text/plain; ; x-java-view=com.sun.TextViewer; x-java-edit=com.sun.TextEdit
            - * # Note that mailcap entries that do not contain 'x-java' parameters
            - * # and comply to RFC 1524 are simply ignored:
            - * image/gif; /usr/dt/bin/sdtimage %s
            - * }
            - * - * @author Bart Calder - * @author Bill Shannon - * - * @since 1.6 - */ - -public class MailcapCommandMap extends CommandMap { - /* - * We manage a collection of databases, searched in order. - */ - private MailcapFile[] DB; - private static final int PROG = 0; // programmatically added entries - - private static final String confDir; - - static { - String dir = null; - try { - dir = (String)AccessController.doPrivileged( - new PrivilegedAction() { - public Object run() { - String home = System.getProperty("java.home"); - String newdir = home + File.separator + "conf"; - File conf = new File(newdir); - if (conf.exists()) - return newdir + File.separator; - else - return home + File.separator + "lib" + File.separator; - } - }); - } catch (Exception ex) { - // ignore any exceptions - } - confDir = dir; - } - - /** - * The default Constructor. - */ - public MailcapCommandMap() { - super(); - List dbv = new ArrayList(5); // usually 5 or less databases - MailcapFile mf = null; - dbv.add(null); // place holder for PROG entry - - LogSupport.log("MailcapCommandMap: load HOME"); - try { - String user_home = System.getProperty("user.home"); - - if (user_home != null) { - String path = user_home + File.separator + ".mailcap"; - mf = loadFile(path); - if (mf != null) - dbv.add(mf); - } - } catch (SecurityException ex) {} - - LogSupport.log("MailcapCommandMap: load SYS"); - try { - // check system's home - if (confDir != null) { - mf = loadFile(confDir + "mailcap"); - if (mf != null) - dbv.add(mf); - } - } catch (SecurityException ex) {} - - LogSupport.log("MailcapCommandMap: load JAR"); - // load from the app's jar file - loadAllResources(dbv, "META-INF/mailcap"); - - LogSupport.log("MailcapCommandMap: load DEF"); - mf = loadResource("/META-INF/mailcap.default"); - - if (mf != null) - dbv.add(mf); - - DB = new MailcapFile[dbv.size()]; - DB = (MailcapFile[])dbv.toArray(DB); - } - - /** - * Load from the named resource. - */ - private MailcapFile loadResource(String name) { - InputStream clis = null; - try { - clis = SecuritySupport.getResourceAsStream(this.getClass(), name); - if (clis != null) { - MailcapFile mf = new MailcapFile(clis); - if (LogSupport.isLoggable()) - LogSupport.log("MailcapCommandMap: successfully loaded " + - "mailcap file: " + name); - return mf; - } else { - if (LogSupport.isLoggable()) - LogSupport.log("MailcapCommandMap: not loading " + - "mailcap file: " + name); - } - } catch (IOException e) { - if (LogSupport.isLoggable()) - LogSupport.log("MailcapCommandMap: can't load " + name, e); - } catch (SecurityException sex) { - if (LogSupport.isLoggable()) - LogSupport.log("MailcapCommandMap: can't load " + name, sex); - } finally { - try { - if (clis != null) - clis.close(); - } catch (IOException ex) { } // ignore it - } - return null; - } - - /** - * Load all of the named resource. - */ - private void loadAllResources(List v, String name) { - boolean anyLoaded = false; - try { - URL[] urls; - ClassLoader cld = null; - // First try the "application's" class loader. - cld = SecuritySupport.getContextClassLoader(); - if (cld == null) - cld = this.getClass().getClassLoader(); - if (cld != null) - urls = SecuritySupport.getResources(cld, name); - else - urls = SecuritySupport.getSystemResources(name); - if (urls != null) { - if (LogSupport.isLoggable()) - LogSupport.log("MailcapCommandMap: getResources"); - for (int i = 0; i < urls.length; i++) { - URL url = urls[i]; - InputStream clis = null; - if (LogSupport.isLoggable()) - LogSupport.log("MailcapCommandMap: URL " + url); - try { - clis = SecuritySupport.openStream(url); - if (clis != null) { - v.add(new MailcapFile(clis)); - anyLoaded = true; - if (LogSupport.isLoggable()) - LogSupport.log("MailcapCommandMap: " + - "successfully loaded " + - "mailcap file from URL: " + - url); - } else { - if (LogSupport.isLoggable()) - LogSupport.log("MailcapCommandMap: " + - "not loading mailcap " + - "file from URL: " + url); - } - } catch (IOException ioex) { - if (LogSupport.isLoggable()) - LogSupport.log("MailcapCommandMap: can't load " + - url, ioex); - } catch (SecurityException sex) { - if (LogSupport.isLoggable()) - LogSupport.log("MailcapCommandMap: can't load " + - url, sex); - } finally { - try { - if (clis != null) - clis.close(); - } catch (IOException cex) { } - } - } - } - } catch (Exception ex) { - if (LogSupport.isLoggable()) - LogSupport.log("MailcapCommandMap: can't load " + name, ex); - } - - // if failed to load anything, fall back to old technique, just in case - if (!anyLoaded) { - if (LogSupport.isLoggable()) - LogSupport.log("MailcapCommandMap: !anyLoaded"); - MailcapFile mf = loadResource("/" + name); - if (mf != null) - v.add(mf); - } - } - - /** - * Load from the named file. - */ - private MailcapFile loadFile(String name) { - MailcapFile mtf = null; - - try { - mtf = new MailcapFile(name); - } catch (IOException e) { - // e.printStackTrace(); - } - return mtf; - } - - /** - * Constructor that allows the caller to specify the path - * of a mailcap file. - * - * @param fileName The name of the mailcap file to open - * @exception IOException if the file can't be accessed - */ - public MailcapCommandMap(String fileName) throws IOException { - this(); - - if (LogSupport.isLoggable()) - LogSupport.log("MailcapCommandMap: load PROG from " + fileName); - if (DB[PROG] == null) { - DB[PROG] = new MailcapFile(fileName); - } - } - - - /** - * Constructor that allows the caller to specify an InputStream - * containing a mailcap file. - * - * @param is InputStream of the mailcap file to open - */ - public MailcapCommandMap(InputStream is) { - this(); - - LogSupport.log("MailcapCommandMap: load PROG"); - if (DB[PROG] == null) { - try { - DB[PROG] = new MailcapFile(is); - } catch (IOException ex) { - // XXX - should throw it - } - } - } - - /** - * Get the preferred command list for a MIME Type. The MailcapCommandMap - * searches the mailcap files as described above under - * Mailcap file search order.

            - * - * The result of the search is a proper subset of available - * commands in all mailcap files known to this instance of - * MailcapCommandMap. The first entry for a particular command - * is considered the preferred command. - * - * @param mimeType the MIME type - * @return the CommandInfo objects representing the preferred commands. - */ - public synchronized CommandInfo[] getPreferredCommands(String mimeType) { - List cmdList = new ArrayList(); - if (mimeType != null) - mimeType = mimeType.toLowerCase(Locale.ENGLISH); - - for (int i = 0; i < DB.length; i++) { - if (DB[i] == null) - continue; - Map cmdMap = DB[i].getMailcapList(mimeType); - if (cmdMap != null) - appendPrefCmdsToList(cmdMap, cmdList); - } - - // now add the fallback commands - for (int i = 0; i < DB.length; i++) { - if (DB[i] == null) - continue; - Map cmdMap = DB[i].getMailcapFallbackList(mimeType); - if (cmdMap != null) - appendPrefCmdsToList(cmdMap, cmdList); - } - - CommandInfo[] cmdInfos = new CommandInfo[cmdList.size()]; - cmdInfos = (CommandInfo[])cmdList.toArray(cmdInfos); - - return cmdInfos; - } - - /** - * Put the commands that are in the hash table, into the list. - */ - private void appendPrefCmdsToList(Map cmdHash, List cmdList) { - Iterator verb_enum = cmdHash.keySet().iterator(); - - while (verb_enum.hasNext()) { - String verb = (String)verb_enum.next(); - if (!checkForVerb(cmdList, verb)) { - List cmdList2 = (List)cmdHash.get(verb); // get the list - String className = (String)cmdList2.get(0); - cmdList.add(new CommandInfo(verb, className)); - } - } - } - - /** - * Check the cmdList to see if this command exists, return - * true if the verb is there. - */ - private boolean checkForVerb(List cmdList, String verb) { - Iterator ee = cmdList.iterator(); - while (ee.hasNext()) { - String enum_verb = - (String)((CommandInfo)ee.next()).getCommandName(); - if (enum_verb.equals(verb)) - return true; - } - return false; - } - - /** - * Get all the available commands in all mailcap files known to - * this instance of MailcapCommandMap for this MIME type. - * - * @param mimeType the MIME type - * @return the CommandInfo objects representing all the commands. - */ - public synchronized CommandInfo[] getAllCommands(String mimeType) { - List cmdList = new ArrayList(); - if (mimeType != null) - mimeType = mimeType.toLowerCase(Locale.ENGLISH); - - for (int i = 0; i < DB.length; i++) { - if (DB[i] == null) - continue; - Map cmdMap = DB[i].getMailcapList(mimeType); - if (cmdMap != null) - appendCmdsToList(cmdMap, cmdList); - } - - // now add the fallback commands - for (int i = 0; i < DB.length; i++) { - if (DB[i] == null) - continue; - Map cmdMap = DB[i].getMailcapFallbackList(mimeType); - if (cmdMap != null) - appendCmdsToList(cmdMap, cmdList); - } - - CommandInfo[] cmdInfos = new CommandInfo[cmdList.size()]; - cmdInfos = (CommandInfo[])cmdList.toArray(cmdInfos); - - return cmdInfos; - } - - /** - * Put the commands that are in the hash table, into the list. - */ - private void appendCmdsToList(Map typeHash, List cmdList) { - Iterator verb_enum = typeHash.keySet().iterator(); - - while (verb_enum.hasNext()) { - String verb = (String)verb_enum.next(); - List cmdList2 = (List)typeHash.get(verb); - Iterator cmd_enum = ((List)cmdList2).iterator(); - - while (cmd_enum.hasNext()) { - String cmd = (String)cmd_enum.next(); - cmdList.add(new CommandInfo(verb, cmd)); - // cmdList.add(0, new CommandInfo(verb, cmd)); - } - } - } - - /** - * Get the command corresponding to {@code cmdName} for the MIME type. - * - * @param mimeType the MIME type - * @param cmdName the command name - * @return the CommandInfo object corresponding to the command. - */ - public synchronized CommandInfo getCommand(String mimeType, - String cmdName) { - if (mimeType != null) - mimeType = mimeType.toLowerCase(Locale.ENGLISH); - - for (int i = 0; i < DB.length; i++) { - if (DB[i] == null) - continue; - Map cmdMap = DB[i].getMailcapList(mimeType); - if (cmdMap != null) { - // get the cmd list for the cmd - List v = (List)cmdMap.get(cmdName); - if (v != null) { - String cmdClassName = (String)v.get(0); - - if (cmdClassName != null) - return new CommandInfo(cmdName, cmdClassName); - } - } - } - - // now try the fallback list - for (int i = 0; i < DB.length; i++) { - if (DB[i] == null) - continue; - Map cmdMap = DB[i].getMailcapFallbackList(mimeType); - if (cmdMap != null) { - // get the cmd list for the cmd - List v = (List)cmdMap.get(cmdName); - if (v != null) { - String cmdClassName = (String)v.get(0); - - if (cmdClassName != null) - return new CommandInfo(cmdName, cmdClassName); - } - } - } - return null; - } - - /** - * Add entries to the registry. Programmatically - * added entries are searched before other entries.

            - * - * The string that is passed in should be in mailcap - * format. - * - * @param mail_cap a correctly formatted mailcap string - */ - public synchronized void addMailcap(String mail_cap) { - // check to see if one exists - LogSupport.log("MailcapCommandMap: add to PROG"); - if (DB[PROG] == null) - DB[PROG] = new MailcapFile(); - - DB[PROG].appendToMailcap(mail_cap); - } - - /** - * Return the DataContentHandler for the specified MIME type. - * - * @param mimeType the MIME type - * @return the DataContentHandler - */ - public synchronized DataContentHandler createDataContentHandler( - String mimeType) { - if (LogSupport.isLoggable()) - LogSupport.log( - "MailcapCommandMap: createDataContentHandler for " + mimeType); - if (mimeType != null) - mimeType = mimeType.toLowerCase(Locale.ENGLISH); - - for (int i = 0; i < DB.length; i++) { - if (DB[i] == null) - continue; - if (LogSupport.isLoggable()) - LogSupport.log(" search DB #" + i); - Map cmdMap = DB[i].getMailcapList(mimeType); - if (cmdMap != null) { - List v = (List)cmdMap.get("content-handler"); - if (v != null) { - String name = (String)v.get(0); - DataContentHandler dch = getDataContentHandler(name); - if (dch != null) - return dch; - } - } - } - - // now try the fallback entries - for (int i = 0; i < DB.length; i++) { - if (DB[i] == null) - continue; - if (LogSupport.isLoggable()) - LogSupport.log(" search fallback DB #" + i); - Map cmdMap = DB[i].getMailcapFallbackList(mimeType); - if (cmdMap != null) { - List v = (List)cmdMap.get("content-handler"); - if (v != null) { - String name = (String)v.get(0); - DataContentHandler dch = getDataContentHandler(name); - if (dch != null) - return dch; - } - } - } - return null; - } - - private DataContentHandler getDataContentHandler(String name) { - if (LogSupport.isLoggable()) - LogSupport.log(" got content-handler"); - if (LogSupport.isLoggable()) - LogSupport.log(" class " + name); - try { - ClassLoader cld = null; - // First try the "application's" class loader. - cld = SecuritySupport.getContextClassLoader(); - if (cld == null) - cld = this.getClass().getClassLoader(); - Class cl = null; - try { - cl = cld.loadClass(name); - } catch (Exception ex) { - // if anything goes wrong, do it the old way - cl = Class.forName(name); - } - return (DataContentHandler) cl.newInstance(); - } catch (IllegalAccessException e) { - if (LogSupport.isLoggable()) - LogSupport.log("Can't load DCH " + name, e); - } catch (ClassNotFoundException e) { - if (LogSupport.isLoggable()) - LogSupport.log("Can't load DCH " + name, e); - } catch (InstantiationException e) { - if (LogSupport.isLoggable()) - LogSupport.log("Can't load DCH " + name, e); - } - return null; - } - - /** - * Get all the MIME types known to this command map. - * - * @return array of MIME types as strings - * @since 1.6, JAF 1.1 - */ - public synchronized String[] getMimeTypes() { - List mtList = new ArrayList(); - - for (int i = 0; i < DB.length; i++) { - if (DB[i] == null) - continue; - String[] ts = DB[i].getMimeTypes(); - if (ts != null) { - for (int j = 0; j < ts.length; j++) { - // eliminate duplicates - if (!mtList.contains(ts[j])) - mtList.add(ts[j]); - } - } - } - - String[] mts = new String[mtList.size()]; - mts = (String[])mtList.toArray(mts); - - return mts; - } - - /** - * Get the native commands for the given MIME type. - * Returns an array of strings where each string is - * an entire mailcap file entry. The application - * will need to parse the entry to extract the actual - * command as well as any attributes it needs. See - * RFC 1524 - * for details of the mailcap entry syntax. Only mailcap - * entries that specify a view command for the specified - * MIME type are returned. - * - * @param mimeType the MIME type - * @return array of native command entries - * @since 1.6, JAF 1.1 - */ - public synchronized String[] getNativeCommands(String mimeType) { - List cmdList = new ArrayList(); - if (mimeType != null) - mimeType = mimeType.toLowerCase(Locale.ENGLISH); - - for (int i = 0; i < DB.length; i++) { - if (DB[i] == null) - continue; - String[] cmds = DB[i].getNativeCommands(mimeType); - if (cmds != null) { - for (int j = 0; j < cmds.length; j++) { - // eliminate duplicates - if (!cmdList.contains(cmds[j])) - cmdList.add(cmds[j]); - } - } - } - - String[] cmds = new String[cmdList.size()]; - cmds = (String[])cmdList.toArray(cmds); - - return cmds; - } - - /** - * for debugging... - * - public static void main(String[] argv) throws Exception { - MailcapCommandMap map = new MailcapCommandMap(); - CommandInfo[] cmdInfo; - - cmdInfo = map.getPreferredCommands(argv[0]); - System.out.println("Preferred Commands:"); - for (int i = 0; i < cmdInfo.length; i++) - System.out.println("Command " + cmdInfo[i].getCommandName() + " [" + - cmdInfo[i].getCommandClass() + "]"); - cmdInfo = map.getAllCommands(argv[0]); - System.out.println(); - System.out.println("All Commands:"); - for (int i = 0; i < cmdInfo.length; i++) - System.out.println("Command " + cmdInfo[i].getCommandName() + " [" + - cmdInfo[i].getCommandClass() + "]"); - DataContentHandler dch = map.createDataContentHandler(argv[0]); - if (dch != null) - System.out.println("DataContentHandler " + - dch.getClass().toString()); - System.exit(0); - } - */ -} diff --git a/src/java.activation/share/classes/javax/activation/MimeType.java b/src/java.activation/share/classes/javax/activation/MimeType.java deleted file mode 100644 index d96f454270a..00000000000 --- a/src/java.activation/share/classes/javax/activation/MimeType.java +++ /dev/null @@ -1,346 +0,0 @@ -/* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package javax.activation; - -import java.io.*; -import java.util.Locale; - -/** - * A Multipurpose Internet Mail Extension (MIME) type, as defined - * in RFC 2045 and 2046. - * - * @since 1.6 - */ -public class MimeType implements Externalizable { - - private String primaryType; - private String subType; - private MimeTypeParameterList parameters; - - /** - * A string that holds all the special chars. - */ - private static final String TSPECIALS = "()<>@,;:/[]?=\\\""; - - /** - * Default constructor. - */ - public MimeType() { - primaryType = "application"; - subType = "*"; - parameters = new MimeTypeParameterList(); - } - - /** - * Constructor that builds a MimeType from a String. - * - * @param rawdata the MIME type string - * @exception MimeTypeParseException if the MIME type can't be parsed - */ - public MimeType(String rawdata) throws MimeTypeParseException { - parse(rawdata); - } - - /** - * Constructor that builds a MimeType with the given primary and sub type - * but has an empty parameter list. - * - * @param primary the primary MIME type - * @param sub the MIME sub-type - * @exception MimeTypeParseException if the primary type or subtype - * is not a valid token - */ - public MimeType(String primary, String sub) throws MimeTypeParseException { - // check to see if primary is valid - if (isValidToken(primary)) { - primaryType = primary.toLowerCase(Locale.ENGLISH); - } else { - throw new MimeTypeParseException("Primary type is invalid."); - } - - // check to see if sub is valid - if (isValidToken(sub)) { - subType = sub.toLowerCase(Locale.ENGLISH); - } else { - throw new MimeTypeParseException("Sub type is invalid."); - } - - parameters = new MimeTypeParameterList(); - } - - /** - * A routine for parsing the MIME type out of a String. - */ - private void parse(String rawdata) throws MimeTypeParseException { - int slashIndex = rawdata.indexOf('/'); - int semIndex = rawdata.indexOf(';'); - if ((slashIndex < 0) && (semIndex < 0)) { - // neither character is present, so treat it - // as an error - throw new MimeTypeParseException("Unable to find a sub type."); - } else if ((slashIndex < 0) && (semIndex >= 0)) { - // we have a ';' (and therefore a parameter list), - // but no '/' indicating a sub type is present - throw new MimeTypeParseException("Unable to find a sub type."); - } else if ((slashIndex >= 0) && (semIndex < 0)) { - // we have a primary and sub type but no parameter list - primaryType = rawdata.substring(0, slashIndex).trim(). - toLowerCase(Locale.ENGLISH); - subType = rawdata.substring(slashIndex + 1).trim(). - toLowerCase(Locale.ENGLISH); - parameters = new MimeTypeParameterList(); - } else if (slashIndex < semIndex) { - // we have all three items in the proper sequence - primaryType = rawdata.substring(0, slashIndex).trim(). - toLowerCase(Locale.ENGLISH); - subType = rawdata.substring(slashIndex + 1, semIndex).trim(). - toLowerCase(Locale.ENGLISH); - parameters = new MimeTypeParameterList(rawdata.substring(semIndex)); - } else { - // we have a ';' lexically before a '/' which means we - // have a primary type and a parameter list but no sub type - throw new MimeTypeParseException("Unable to find a sub type."); - } - - // now validate the primary and sub types - - // check to see if primary is valid - if (!isValidToken(primaryType)) - throw new MimeTypeParseException("Primary type is invalid."); - - // check to see if sub is valid - if (!isValidToken(subType)) - throw new MimeTypeParseException("Sub type is invalid."); - } - - /** - * Retrieve the primary type of this object. - * - * @return the primary MIME type - */ - public String getPrimaryType() { - return primaryType; - } - - /** - * Set the primary type for this object to the given String. - * - * @param primary the primary MIME type - * @exception MimeTypeParseException if the primary type - * is not a valid token - */ - public void setPrimaryType(String primary) throws MimeTypeParseException { - // check to see if primary is valid - if (!isValidToken(primaryType)) - throw new MimeTypeParseException("Primary type is invalid."); - primaryType = primary.toLowerCase(Locale.ENGLISH); - } - - /** - * Retrieve the subtype of this object. - * - * @return the MIME subtype - */ - public String getSubType() { - return subType; - } - - /** - * Set the subtype for this object to the given String. - * - * @param sub the MIME subtype - * @exception MimeTypeParseException if the subtype - * is not a valid token - */ - public void setSubType(String sub) throws MimeTypeParseException { - // check to see if sub is valid - if (!isValidToken(subType)) - throw new MimeTypeParseException("Sub type is invalid."); - subType = sub.toLowerCase(Locale.ENGLISH); - } - - /** - * Retrieve this object's parameter list. - * - * @return a MimeTypeParameterList object representing the parameters - */ - public MimeTypeParameterList getParameters() { - return parameters; - } - - /** - * Retrieve the value associated with the given name, or null if there - * is no current association. - * - * @param name the parameter name - * @return the paramter's value - */ - public String getParameter(String name) { - return parameters.get(name); - } - - /** - * Set the value to be associated with the given name, replacing - * any previous association. - * - * @param name the parameter name - * @param value the paramter's value - */ - public void setParameter(String name, String value) { - parameters.set(name, value); - } - - /** - * Remove any value associated with the given name. - * - * @param name the parameter name - */ - public void removeParameter(String name) { - parameters.remove(name); - } - - /** - * Return the String representation of this object. - */ - public String toString() { - return getBaseType() + parameters.toString(); - } - - /** - * Return a String representation of this object - * without the parameter list. - * - * @return the MIME type and sub-type - */ - public String getBaseType() { - return primaryType + "/" + subType; - } - - /** - * Determine if the primary and sub type of this object is - * the same as what is in the given type. - * - * @param type the MimeType object to compare with - * @return true if they match - */ - public boolean match(MimeType type) { - return primaryType.equals(type.getPrimaryType()) - && (subType.equals("*") - || type.getSubType().equals("*") - || (subType.equals(type.getSubType()))); - } - - /** - * Determine if the primary and sub type of this object is - * the same as the content type described in rawdata. - * - * @param rawdata the MIME type string to compare with - * @return true if they match - * @exception MimeTypeParseException if the MIME type can't be parsed - */ - public boolean match(String rawdata) throws MimeTypeParseException { - return match(new MimeType(rawdata)); - } - - /** - * The object implements the writeExternal method to save its contents - * by calling the methods of DataOutput for its primitive values or - * calling the writeObject method of ObjectOutput for objects, strings - * and arrays. - * - * @param out the ObjectOutput object to write to - * @exception IOException Includes any I/O exceptions that may occur - */ - public void writeExternal(ObjectOutput out) throws IOException { - out.writeUTF(toString()); - out.flush(); - } - - /** - * The object implements the readExternal method to restore its - * contents by calling the methods of DataInput for primitive - * types and readObject for objects, strings and arrays. The - * readExternal method must read the values in the same sequence - * and with the same types as were written by writeExternal. - * - * @param in the ObjectInput object to read from - * @exception ClassNotFoundException If the class for an object being - * restored cannot be found. - */ - public void readExternal(ObjectInput in) - throws IOException, ClassNotFoundException { - try { - parse(in.readUTF()); - } catch (MimeTypeParseException e) { - throw new IOException(e.toString()); - } - } - - // below here be scary parsing related things - - /** - * Determine whether or not a given character belongs to a legal token. - */ - private static boolean isTokenChar(char c) { - return ((c > 040) && (c < 0177)) && (TSPECIALS.indexOf(c) < 0); - } - - /** - * Determine whether or not a given string is a legal token. - */ - private boolean isValidToken(String s) { - int len = s.length(); - if (len > 0) { - for (int i = 0; i < len; ++i) { - char c = s.charAt(i); - if (!isTokenChar(c)) { - return false; - } - } - return true; - } else { - return false; - } - } - - /** - * A simple parser test, - * for debugging... - * - public static void main(String[] args) - throws MimeTypeParseException, IOException { - for (int i = 0; i < args.length; ++i) { - System.out.println("Original: " + args[i]); - - MimeType type = new MimeType(args[i]); - - System.out.println("Short: " + type.getBaseType()); - System.out.println("Parsed: " + type.toString()); - System.out.println(); - } - } - */ -} diff --git a/src/java.activation/share/classes/javax/activation/MimeTypeParameterList.java b/src/java.activation/share/classes/javax/activation/MimeTypeParameterList.java deleted file mode 100644 index 83822fa5a66..00000000000 --- a/src/java.activation/share/classes/javax/activation/MimeTypeParameterList.java +++ /dev/null @@ -1,341 +0,0 @@ -/* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package javax.activation; - -import java.util.Hashtable; -import java.util.Enumeration; -import java.util.Locale; - -/** - * A parameter list of a MimeType - * as defined in RFC 2045 and 2046. The Primary type of the - * object must already be stripped off. - * - * @see javax.activation.MimeType - * - * @since 1.6 - */ -public class MimeTypeParameterList { - private Hashtable parameters; - - /** - * A string that holds all the special chars. - */ - private static final String TSPECIALS = "()<>@,;:/[]?=\\\""; - - - /** - * Default constructor. - */ - public MimeTypeParameterList() { - parameters = new Hashtable(); - } - - /** - * Constructs a new MimeTypeParameterList with the passed in data. - * - * @param parameterList an RFC 2045, 2046 compliant parameter list. - * @exception MimeTypeParseException if the MIME type can't be parsed - */ - public MimeTypeParameterList(String parameterList) - throws MimeTypeParseException { - parameters = new Hashtable(); - - // now parse rawdata - parse(parameterList); - } - - /** - * A routine for parsing the parameter list out of a String. - * - * @param parameterList an RFC 2045, 2046 compliant parameter list. - * @exception MimeTypeParseException if the MIME type can't be parsed - */ - protected void parse(String parameterList) throws MimeTypeParseException { - if (parameterList == null) - return; - - int length = parameterList.length(); - if (length <= 0) - return; - - int i; - char c; - for (i = skipWhiteSpace(parameterList, 0); - i < length && (c = parameterList.charAt(i)) == ';'; - i = skipWhiteSpace(parameterList, i)) { - int lastIndex; - String name; - String value; - - // eat the ';' - i++; - - // now parse the parameter name - - // skip whitespace - i = skipWhiteSpace(parameterList, i); - - // tolerate trailing semicolon, even though it violates the spec - if (i >= length) - return; - - // find the end of the token char run - lastIndex = i; - while ((i < length) && isTokenChar(parameterList.charAt(i))) - i++; - - name = parameterList.substring(lastIndex, i). - toLowerCase(Locale.ENGLISH); - - // now parse the '=' that separates the name from the value - i = skipWhiteSpace(parameterList, i); - - if (i >= length || parameterList.charAt(i) != '=') - throw new MimeTypeParseException( - "Couldn't find the '=' that separates a " + - "parameter name from its value."); - - // eat it and parse the parameter value - i++; - i = skipWhiteSpace(parameterList, i); - - if (i >= length) - throw new MimeTypeParseException( - "Couldn't find a value for parameter named " + name); - - // now find out whether or not we have a quoted value - c = parameterList.charAt(i); - if (c == '"') { - // yup it's quoted so eat it and capture the quoted string - i++; - if (i >= length) - throw new MimeTypeParseException( - "Encountered unterminated quoted parameter value."); - - lastIndex = i; - - // find the next unescaped quote - while (i < length) { - c = parameterList.charAt(i); - if (c == '"') - break; - if (c == '\\') { - // found an escape sequence - // so skip this and the - // next character - i++; - } - i++; - } - if (c != '"') - throw new MimeTypeParseException( - "Encountered unterminated quoted parameter value."); - - value = unquote(parameterList.substring(lastIndex, i)); - // eat the quote - i++; - } else if (isTokenChar(c)) { - // nope it's an ordinary token so it - // ends with a non-token char - lastIndex = i; - while (i < length && isTokenChar(parameterList.charAt(i))) - i++; - value = parameterList.substring(lastIndex, i); - } else { - // it ain't a value - throw new MimeTypeParseException( - "Unexpected character encountered at index " + i); - } - - // now put the data into the hashtable - parameters.put(name, value); - } - if (i < length) { - throw new MimeTypeParseException( - "More characters encountered in input than expected."); - } - } - - /** - * Return the number of name-value pairs in this list. - * - * @return the number of parameters - */ - public int size() { - return parameters.size(); - } - - /** - * Determine whether or not this list is empty. - * - * @return true if there are no parameters - */ - public boolean isEmpty() { - return parameters.isEmpty(); - } - - /** - * Retrieve the value associated with the given name, or null if there - * is no current association. - * - * @param name the parameter name - * @return the parameter's value - */ - public String get(String name) { - return (String)parameters.get(name.trim().toLowerCase(Locale.ENGLISH)); - } - - /** - * Set the value to be associated with the given name, replacing - * any previous association. - * - * @param name the parameter name - * @param value the parameter's value - */ - public void set(String name, String value) { - parameters.put(name.trim().toLowerCase(Locale.ENGLISH), value); - } - - /** - * Remove any value associated with the given name. - * - * @param name the parameter name - */ - public void remove(String name) { - parameters.remove(name.trim().toLowerCase(Locale.ENGLISH)); - } - - /** - * Retrieve an enumeration of all the names in this list. - * - * @return an enumeration of all parameter names - */ - public Enumeration getNames() { - return parameters.keys(); - } - - /** - * Return a string representation of this object. - */ - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.ensureCapacity(parameters.size() * 16); - // heuristic: 8 characters per field - - Enumeration keys = parameters.keys(); - while (keys.hasMoreElements()) { - String key = (String)keys.nextElement(); - buffer.append("; "); - buffer.append(key); - buffer.append('='); - buffer.append(quote((String)parameters.get(key))); - } - - return buffer.toString(); - } - - // below here be scary parsing related things - - /** - * Determine whether or not a given character belongs to a legal token. - */ - private static boolean isTokenChar(char c) { - return ((c > 040) && (c < 0177)) && (TSPECIALS.indexOf(c) < 0); - } - - /** - * return the index of the first non white space character in - * rawdata at or after index i. - */ - private static int skipWhiteSpace(String rawdata, int i) { - int length = rawdata.length(); - while ((i < length) && Character.isWhitespace(rawdata.charAt(i))) - i++; - return i; - } - - /** - * A routine that knows how and when to quote and escape the given value. - */ - private static String quote(String value) { - boolean needsQuotes = false; - - // check to see if we actually have to quote this thing - int length = value.length(); - for (int i = 0; (i < length) && !needsQuotes; i++) { - needsQuotes = !isTokenChar(value.charAt(i)); - } - - if (needsQuotes) { - StringBuffer buffer = new StringBuffer(); - buffer.ensureCapacity((int)(length * 1.5)); - - // add the initial quote - buffer.append('"'); - - // add the properly escaped text - for (int i = 0; i < length; ++i) { - char c = value.charAt(i); - if ((c == '\\') || (c == '"')) - buffer.append('\\'); - buffer.append(c); - } - - // add the closing quote - buffer.append('"'); - - return buffer.toString(); - } else { - return value; - } - } - - /** - * A routine that knows how to strip the quotes and - * escape sequences from the given value. - */ - private static String unquote(String value) { - int valueLength = value.length(); - StringBuffer buffer = new StringBuffer(); - buffer.ensureCapacity(valueLength); - - boolean escaped = false; - for (int i = 0; i < valueLength; ++i) { - char currentChar = value.charAt(i); - if (!escaped && (currentChar != '\\')) { - buffer.append(currentChar); - } else if (escaped) { - buffer.append(currentChar); - escaped = false; - } else { - escaped = true; - } - } - - return buffer.toString(); - } -} diff --git a/src/java.activation/share/classes/javax/activation/MimeTypeParseException.java b/src/java.activation/share/classes/javax/activation/MimeTypeParseException.java deleted file mode 100644 index 88fc325586e..00000000000 --- a/src/java.activation/share/classes/javax/activation/MimeTypeParseException.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package javax.activation; - -/** - * A class to encapsulate MimeType parsing related exceptions. - * - * @since 1.6 - */ -public class MimeTypeParseException extends Exception { - - /** - * Constructs a MimeTypeParseException with no specified detail message. - */ - public MimeTypeParseException() { - super(); - } - - /** - * Constructs a MimeTypeParseException with the specified detail message. - * - * @param s the detail message. - */ - public MimeTypeParseException(String s) { - super(s); - } -} diff --git a/src/java.activation/share/classes/javax/activation/MimetypesFileTypeMap.java b/src/java.activation/share/classes/javax/activation/MimetypesFileTypeMap.java deleted file mode 100644 index d2494634410..00000000000 --- a/src/java.activation/share/classes/javax/activation/MimetypesFileTypeMap.java +++ /dev/null @@ -1,360 +0,0 @@ -/* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package javax.activation; - -import java.io.*; -import java.net.*; -import java.util.*; -import java.security.AccessController; -import java.security.PrivilegedAction; -import com.sun.activation.registries.MimeTypeFile; -import com.sun.activation.registries.LogSupport; - -/** - * This class extends FileTypeMap and provides data typing of files - * via their file extension. It uses the {@code .mime.types} format.

            - * - * MIME types file search order:

            - * The MimetypesFileTypeMap looks in various places in the user's - * system for MIME types file entries. When requests are made - * to search for MIME types in the MimetypesFileTypeMap, it searches - * MIME types files in the following order: - *

              - *
            1. Programmatically added entries to the MimetypesFileTypeMap instance. - *
            2. The file {@code .mime.types} in the user's home directory. - *
            3. The file {@code mime.types} in the Java runtime. - *
            4. The file or resources named {@code META-INF/mime.types}. - *
            5. The file or resource named {@code META-INF/mimetypes.default} - * (usually found only in the {@code activation.jar} file). - *
            - *

            - * (The current implementation looks for the {@code mime.types} file - * in the Java runtime in the directory java.home{@code /conf} - * if it exists, and otherwise in the directory - * java.home{@code /lib}, where java.home is the value - * of the "java.home" System property. Note that the "conf" directory was - * introduced in JDK 9.) - *

            - * MIME types file format: - * - *

            {@code
            - * # comments begin with a '#'
            - * # the format is  
            - * # for example:
            - * text/plain    txt text TXT
            - * # this would map file.txt, file.text, and file.TXT to
            - * # the mime type "text/plain"
            - * }
            - * - * @author Bart Calder - * @author Bill Shannon - * - * @since 1.6 - */ -public class MimetypesFileTypeMap extends FileTypeMap { - /* - * We manage a collection of databases, searched in order. - */ - private MimeTypeFile[] DB; - private static final int PROG = 0; // programmatically added entries - - private static final String defaultType = "application/octet-stream"; - - private static final String confDir; - - static { - String dir = null; - try { - dir = (String)AccessController.doPrivileged( - new PrivilegedAction() { - public Object run() { - String home = System.getProperty("java.home"); - String newdir = home + File.separator + "conf"; - File conf = new File(newdir); - if (conf.exists()) - return newdir + File.separator; - else - return home + File.separator + "lib" + File.separator; - } - }); - } catch (Exception ex) { - // ignore any exceptions - } - confDir = dir; - } - - /** - * The default constructor. - */ - public MimetypesFileTypeMap() { - Vector dbv = new Vector(5); // usually 5 or less databases - MimeTypeFile mf = null; - dbv.addElement(null); // place holder for PROG entry - - LogSupport.log("MimetypesFileTypeMap: load HOME"); - try { - String user_home = System.getProperty("user.home"); - - if (user_home != null) { - String path = user_home + File.separator + ".mime.types"; - mf = loadFile(path); - if (mf != null) - dbv.addElement(mf); - } - } catch (SecurityException ex) {} - - LogSupport.log("MimetypesFileTypeMap: load SYS"); - try { - // check system's home - if (confDir != null) { - mf = loadFile(confDir + "mime.types"); - if (mf != null) - dbv.addElement(mf); - } - } catch (SecurityException ex) {} - - LogSupport.log("MimetypesFileTypeMap: load JAR"); - // load from the app's jar file - loadAllResources(dbv, "META-INF/mime.types"); - - LogSupport.log("MimetypesFileTypeMap: load DEF"); - mf = loadResource("/META-INF/mimetypes.default"); - - if (mf != null) - dbv.addElement(mf); - - DB = new MimeTypeFile[dbv.size()]; - dbv.copyInto(DB); - } - - /** - * Load from the named resource. - */ - private MimeTypeFile loadResource(String name) { - InputStream clis = null; - try { - clis = SecuritySupport.getResourceAsStream(this.getClass(), name); - if (clis != null) { - MimeTypeFile mf = new MimeTypeFile(clis); - if (LogSupport.isLoggable()) - LogSupport.log("MimetypesFileTypeMap: successfully " + - "loaded mime types file: " + name); - return mf; - } else { - if (LogSupport.isLoggable()) - LogSupport.log("MimetypesFileTypeMap: not loading " + - "mime types file: " + name); - } - } catch (IOException e) { - if (LogSupport.isLoggable()) - LogSupport.log("MimetypesFileTypeMap: can't load " + name, e); - } catch (SecurityException sex) { - if (LogSupport.isLoggable()) - LogSupport.log("MimetypesFileTypeMap: can't load " + name, sex); - } finally { - try { - if (clis != null) - clis.close(); - } catch (IOException ex) { } // ignore it - } - return null; - } - - /** - * Load all of the named resource. - */ - private void loadAllResources(Vector v, String name) { - boolean anyLoaded = false; - try { - URL[] urls; - ClassLoader cld = null; - // First try the "application's" class loader. - cld = SecuritySupport.getContextClassLoader(); - if (cld == null) - cld = this.getClass().getClassLoader(); - if (cld != null) - urls = SecuritySupport.getResources(cld, name); - else - urls = SecuritySupport.getSystemResources(name); - if (urls != null) { - if (LogSupport.isLoggable()) - LogSupport.log("MimetypesFileTypeMap: getResources"); - for (int i = 0; i < urls.length; i++) { - URL url = urls[i]; - InputStream clis = null; - if (LogSupport.isLoggable()) - LogSupport.log("MimetypesFileTypeMap: URL " + url); - try { - clis = SecuritySupport.openStream(url); - if (clis != null) { - v.addElement(new MimeTypeFile(clis)); - anyLoaded = true; - if (LogSupport.isLoggable()) - LogSupport.log("MimetypesFileTypeMap: " + - "successfully loaded " + - "mime types from URL: " + url); - } else { - if (LogSupport.isLoggable()) - LogSupport.log("MimetypesFileTypeMap: " + - "not loading " + - "mime types from URL: " + url); - } - } catch (IOException ioex) { - if (LogSupport.isLoggable()) - LogSupport.log("MimetypesFileTypeMap: can't load " + - url, ioex); - } catch (SecurityException sex) { - if (LogSupport.isLoggable()) - LogSupport.log("MimetypesFileTypeMap: can't load " + - url, sex); - } finally { - try { - if (clis != null) - clis.close(); - } catch (IOException cex) { } - } - } - } - } catch (Exception ex) { - if (LogSupport.isLoggable()) - LogSupport.log("MimetypesFileTypeMap: can't load " + name, ex); - } - - // if failed to load anything, fall back to old technique, just in case - if (!anyLoaded) { - LogSupport.log("MimetypesFileTypeMap: !anyLoaded"); - MimeTypeFile mf = loadResource("/" + name); - if (mf != null) - v.addElement(mf); - } - } - - /** - * Load the named file. - */ - private MimeTypeFile loadFile(String name) { - MimeTypeFile mtf = null; - - try { - mtf = new MimeTypeFile(name); - } catch (IOException e) { - // e.printStackTrace(); - } - return mtf; - } - - /** - * Construct a MimetypesFileTypeMap with programmatic entries - * added from the named file. - * - * @param mimeTypeFileName the file name - * @exception IOException for errors reading the file - */ - public MimetypesFileTypeMap(String mimeTypeFileName) throws IOException { - this(); - DB[PROG] = new MimeTypeFile(mimeTypeFileName); - } - - /** - * Construct a MimetypesFileTypeMap with programmatic entries - * added from the InputStream. - * - * @param is the input stream to read from - */ - public MimetypesFileTypeMap(InputStream is) { - this(); - try { - DB[PROG] = new MimeTypeFile(is); - } catch (IOException ex) { - // XXX - really should throw it - } - } - - /** - * Prepend the MIME type values to the registry. - * - * @param mime_types A .mime.types formatted string of entries. - */ - public synchronized void addMimeTypes(String mime_types) { - // check to see if we have created the registry - if (DB[PROG] == null) - DB[PROG] = new MimeTypeFile(); // make one - - DB[PROG].appendToRegistry(mime_types); - } - - /** - * Return the MIME type of the file object. - * The implementation in this class calls - * {@code getContentType(f.getName())}. - * - * @param f the file - * @return the file's MIME type - */ - public String getContentType(File f) { - return this.getContentType(f.getName()); - } - - /** - * Return the MIME type based on the specified file name. - * The MIME type entries are searched as described above under - * MIME types file search order. - * If no entry is found, the type "application/octet-stream" is returned. - * - * @param filename the file name - * @return the file's MIME type - */ - public synchronized String getContentType(String filename) { - int dot_pos = filename.lastIndexOf("."); // period index - - if (dot_pos < 0) - return defaultType; - - String file_ext = filename.substring(dot_pos + 1); - if (file_ext.length() == 0) - return defaultType; - - for (int i = 0; i < DB.length; i++) { - if (DB[i] == null) - continue; - String result = DB[i].getMIMETypeString(file_ext); - if (result != null) - return result; - } - return defaultType; - } - - /** - * for debugging... - * - public static void main(String[] argv) throws Exception { - MimetypesFileTypeMap map = new MimetypesFileTypeMap(); - System.out.println("File " + argv[0] + " has MIME type " + - map.getContentType(argv[0])); - System.exit(0); - } - */ -} diff --git a/src/java.activation/share/classes/javax/activation/SecuritySupport.java b/src/java.activation/share/classes/javax/activation/SecuritySupport.java deleted file mode 100644 index 6bf8fad01b0..00000000000 --- a/src/java.activation/share/classes/javax/activation/SecuritySupport.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package javax.activation; - -import java.security.*; -import java.net.*; -import java.io.*; -import java.util.*; - -/** - * Security related methods that only work on J2SE 1.2 and newer. - * - * @since 1.6 - */ -class SecuritySupport { - - private SecuritySupport() { - // private constructor, can't create an instance - } - - public static ClassLoader getContextClassLoader() { - return (ClassLoader) - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - ClassLoader cl = null; - try { - cl = Thread.currentThread().getContextClassLoader(); - } catch (SecurityException ex) { } - return cl; - } - }); - } - - public static InputStream getResourceAsStream(final Class c, - final String name) throws IOException { - try { - return (InputStream) - AccessController.doPrivileged(new PrivilegedExceptionAction() { - public Object run() throws IOException { - return c.getResourceAsStream(name); - } - }); - } catch (PrivilegedActionException e) { - throw (IOException)e.getException(); - } - } - - public static URL[] getResources(final ClassLoader cl, final String name) { - return (URL[]) - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - URL[] ret = null; - try { - List v = new ArrayList(); - Enumeration e = cl.getResources(name); - while (e != null && e.hasMoreElements()) { - URL url = (URL)e.nextElement(); - if (url != null) - v.add(url); - } - if (v.size() > 0) { - ret = new URL[v.size()]; - ret = (URL[])v.toArray(ret); - } - } catch (IOException ioex) { - } catch (SecurityException ex) { } - return ret; - } - }); - } - - public static URL[] getSystemResources(final String name) { - return (URL[]) - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - URL[] ret = null; - try { - List v = new ArrayList(); - Enumeration e = ClassLoader.getSystemResources(name); - while (e != null && e.hasMoreElements()) { - URL url = (URL)e.nextElement(); - if (url != null) - v.add(url); - } - if (v.size() > 0) { - ret = new URL[v.size()]; - ret = (URL[])v.toArray(ret); - } - } catch (IOException ioex) { - } catch (SecurityException ex) { } - return ret; - } - }); - } - - public static InputStream openStream(final URL url) throws IOException { - try { - return (InputStream) - AccessController.doPrivileged(new PrivilegedExceptionAction() { - public Object run() throws IOException { - return url.openStream(); - } - }); - } catch (PrivilegedActionException e) { - throw (IOException)e.getException(); - } - } -} diff --git a/src/java.activation/share/classes/javax/activation/URLDataSource.java b/src/java.activation/share/classes/javax/activation/URLDataSource.java deleted file mode 100644 index 2239e2ffb9b..00000000000 --- a/src/java.activation/share/classes/javax/activation/URLDataSource.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package javax.activation; - -import java.net.URL; -import java.net.URLConnection; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - -/** - * The URLDataSource class provides an object that wraps a URL - * object in a DataSource interface. URLDataSource simplifies the handling - * of data described by URLs within the JavaBeans Activation Framework - * because this class can be used to create new DataHandlers. NOTE: The - * DataHandler object creates a URLDataSource internally, - * when it is constructed with a URL. - * - * @see javax.activation.DataSource - * @see javax.activation.DataHandler - * - * @since 1.6 - */ -public class URLDataSource implements DataSource { - private URL url = null; - private URLConnection url_conn = null; - - /** - * URLDataSource constructor. The URLDataSource class will - * not open a connection to the URL until a method requiring it - * to do so is called. - * - * @param url The URL to be encapsulated in this object. - */ - public URLDataSource(URL url) { - this.url = url; - } - - /** - * Returns the value of the URL content-type header field. - * It calls the URL's URLConnection.getContentType method - * after retrieving a URLConnection object. - * Note: this method attempts to call the openConnection - * method on the URL. If this method fails, or if a content type is not - * returned from the URLConnection, getContentType returns - * "application/octet-stream" as the content type. - * - * @return the content type. - */ - public String getContentType() { - String type = null; - - try { - if (url_conn == null) - url_conn = url.openConnection(); - } catch (IOException e) { } - - if (url_conn != null) - type = url_conn.getContentType(); - - if (type == null) - type = "application/octet-stream"; - - return type; - } - - /** - * Calls the getFile method on the URL used to - * instantiate the object. - * - * @return the result of calling the URL's getFile method. - */ - public String getName() { - return url.getFile(); - } - - /** - * The getInputStream method from the URL. Calls the - * openStream method on the URL. - * - * @return the InputStream. - */ - public InputStream getInputStream() throws IOException { - return url.openStream(); - } - - /** - * The getOutputStream method from the URL. First an attempt is - * made to get the URLConnection object for the URL. If that - * succeeds, the getOutputStream method on the URLConnection - * is returned. - * - * @return the OutputStream. - */ - public OutputStream getOutputStream() throws IOException { - // get the url connection if it is available - url_conn = url.openConnection(); - - if (url_conn != null) { - url_conn.setDoOutput(true); - return url_conn.getOutputStream(); - } else - return null; - } - - /** - * Return the URL used to create this DataSource. - * - * @return The URL. - */ - public URL getURL() { - return url; - } -} diff --git a/src/java.activation/share/classes/javax/activation/UnsupportedDataTypeException.java b/src/java.activation/share/classes/javax/activation/UnsupportedDataTypeException.java deleted file mode 100644 index 7cd7069cdc0..00000000000 --- a/src/java.activation/share/classes/javax/activation/UnsupportedDataTypeException.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package javax.activation; - -import java.io.IOException; - -/** - * Signals that the requested operation does not support the - * requested data type. - * - * @see javax.activation.DataHandler - * - * @since 1.6 - */ - -public class UnsupportedDataTypeException extends IOException { - /** - * Constructs an UnsupportedDataTypeException with no detail - * message. - */ - public UnsupportedDataTypeException() { - super(); - } - - /** - * Constructs an UnsupportedDataTypeException with the specified - * message. - * - * @param s The detail message. - */ - public UnsupportedDataTypeException(String s) { - super(s); - } -} diff --git a/src/java.activation/share/classes/module-info.java b/src/java.activation/share/classes/module-info.java deleted file mode 100644 index c575883a67c..00000000000 --- a/src/java.activation/share/classes/module-info.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/** - * Defines the JavaBeans Activation Framework (JAF) API. - * - *

            This module is upgradeable. - * - * @moduleGraph - * @since 9 - */ -@Deprecated(since="9", forRemoval=true) -module java.activation { - requires java.logging; - - requires transitive java.datatransfer; - - exports javax.activation; -} - diff --git a/src/java.base/linux/classes/sun/nio/fs/LinuxFileStore.java b/src/java.base/linux/classes/sun/nio/fs/LinuxFileStore.java index 217a8850d65..c14cac0b5f3 100644 --- a/src/java.base/linux/classes/sun/nio/fs/LinuxFileStore.java +++ b/src/java.base/linux/classes/sun/nio/fs/LinuxFileStore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -66,6 +66,8 @@ class LinuxFileStore } // step 2: find mount point + List procMountsEntries = + fs.getMountEntries("/proc/mounts"); UnixPath parent = path.getParent(); while (parent != null) { UnixFileAttributes attrs = null; @@ -74,16 +76,23 @@ class LinuxFileStore } catch (UnixException x) { x.rethrowAsIOException(parent); } - if (attrs.dev() != dev()) - break; + if (attrs.dev() != dev()) { + // step 3: lookup mounted file systems (use /proc/mounts to + // ensure we find the file system even when not in /etc/mtab) + byte[] dir = path.asByteArray(); + for (UnixMountEntry entry : procMountsEntries) { + if (Arrays.equals(dir, entry.dir())) + return entry; + } + } path = parent; parent = parent.getParent(); } - // step 3: lookup mounted file systems (use /proc/mounts to ensure we - // find the file system even when not in /etc/mtab) + // step 3: lookup mounted file systems (use /proc/mounts to + // ensure we find the file system even when not in /etc/mtab) byte[] dir = path.asByteArray(); - for (UnixMountEntry entry: fs.getMountEntries("/proc/mounts")) { + for (UnixMountEntry entry : procMountsEntries) { if (Arrays.equals(dir, entry.dir())) return entry; } diff --git a/src/java.base/linux/classes/sun/nio/fs/LinuxFileSystem.java b/src/java.base/linux/classes/sun/nio/fs/LinuxFileSystem.java index 48f68dc5992..c154ff56476 100644 --- a/src/java.base/linux/classes/sun/nio/fs/LinuxFileSystem.java +++ b/src/java.base/linux/classes/sun/nio/fs/LinuxFileSystem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -75,7 +75,7 @@ class LinuxFileSystem extends UnixFileSystem { /** * Returns object to iterate over the mount entries in the given fstab file. */ - Iterable getMountEntries(String fstab) { + List getMountEntries(String fstab) { ArrayList entries = new ArrayList<>(); try { long fp = setmntent(Util.toBytes(fstab), Util.toBytes("r")); @@ -101,7 +101,7 @@ class LinuxFileSystem extends UnixFileSystem { * Returns object to iterate over the mount entries in /etc/mtab */ @Override - Iterable getMountEntries() { + List getMountEntries() { return getMountEntries("/etc/mtab"); } diff --git a/src/java.base/macosx/native/libnio/ch/KQueueArrayWrapper.c b/src/java.base/macosx/native/libnio/ch/KQueueArrayWrapper.c index 059d9a7badb..0b7a6c2fb59 100644 --- a/src/java.base/macosx/native/libnio/ch/KQueueArrayWrapper.c +++ b/src/java.base/macosx/native/libnio/ch/KQueueArrayWrapper.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,6 +34,7 @@ #include "jni_util.h" #include "jvm.h" #include "jlong.h" +#include "nio_util.h" #include #include @@ -153,15 +154,10 @@ Java_sun_nio_ch_KQueueArrayWrapper_kevent0(JNIEnv *env, jobject this, jint kq, tsp = NULL; } - result = kevent(kq, NULL, 0, kevs, kevCount, tsp); - + RESTARTABLE(kevent(kq, NULL, 0, kevs, kevCount, tsp), result); if (result < 0) { - if (errno == EINTR) { - // ignore EINTR, pretend nothing was selected - result = 0; - } else { - JNU_ThrowIOExceptionWithLastError(env, "KQueueArrayWrapper: kqueue failed"); - } + JNU_ThrowIOExceptionWithLastError(env, + "KQueueArrayWrapper: kevent poll failed"); } return result; diff --git a/src/java.base/share/classes/com/sun/java/util/jar/pack/Constants.java b/src/java.base/share/classes/com/sun/java/util/jar/pack/Constants.java index 5eb79adb6ae..6d2922fb337 100644 --- a/src/java.base/share/classes/com/sun/java/util/jar/pack/Constants.java +++ b/src/java.base/share/classes/com/sun/java/util/jar/pack/Constants.java @@ -48,6 +48,7 @@ class Constants { 1.8 to 1.8.X 52,0 1.9 to 1.9.X 53,0 1.10 to 1.10.X 54,0 + 1.11 to 1.11.X 55,0 */ public static final Package.Version JAVA_MIN_CLASS_VERSION = @@ -71,6 +72,9 @@ class Constants { public static final Package.Version JAVA10_MAX_CLASS_VERSION = Package.Version.of(54, 00); + public static final Package.Version JAVA11_MAX_CLASS_VERSION = + Package.Version.of(55, 00); + public static final int JAVA_PACKAGE_MAGIC = 0xCAFED00D; public static final Package.Version JAVA5_PACKAGE_VERSION = @@ -87,7 +91,7 @@ class Constants { // upper limit, should point to the latest class version public static final Package.Version JAVA_MAX_CLASS_VERSION = - JAVA10_MAX_CLASS_VERSION; + JAVA11_MAX_CLASS_VERSION; // upper limit should point to the latest package version, for version info!. public static final Package.Version MAX_PACKAGE_VERSION = diff --git a/src/java.base/share/classes/com/sun/java/util/jar/pack/Driver.java b/src/java.base/share/classes/com/sun/java/util/jar/pack/Driver.java index 13ccac8b46d..16c0bd4ab16 100644 --- a/src/java.base/share/classes/com/sun/java/util/jar/pack/Driver.java +++ b/src/java.base/share/classes/com/sun/java/util/jar/pack/Driver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -162,11 +162,12 @@ class Driver { engProps.put((String) me.getKey(), (String) me.getValue()); } } else if ("--version".equals(state)) { - System.out.println(MessageFormat.format(RESOURCE.getString(DriverResource.VERSION), Driver.class.getName(), "1.31, 07/05/05")); + System.out.println(MessageFormat.format(RESOURCE.getString(DriverResource.VERSION), + Driver.class.getName(), "1.31, 07/05/05")); return; } else if ("--help".equals(state)) { printUsage(doPack, true, System.out); - System.exit(1); + System.exit(0); return; } else { break; diff --git a/src/java.base/share/classes/com/sun/java/util/jar/pack/DriverResource.java b/src/java.base/share/classes/com/sun/java/util/jar/pack/DriverResource.java index 108f4a174dd..249821f8a68 100644 --- a/src/java.base/share/classes/com/sun/java/util/jar/pack/DriverResource.java +++ b/src/java.base/share/classes/com/sun/java/util/jar/pack/DriverResource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -89,7 +89,7 @@ public class DriverResource extends ListResourceBundle { " -q, --quiet set verbosity to lowest level", " -l{F}, --log-file={F} output to the given log file, ", " or '-' for System.out", - " -?, -h, --help print this message", + " -?, -h, --help print this help message", " -V, --version print program version", " -J{X} pass option X to underlying Java VM", "", @@ -118,7 +118,7 @@ public class DriverResource extends ListResourceBundle { " -q, --quiet set verbosity to lowest level", " -l{F}, --log-file={F} output to the given log file, or", " '-' for System.out", - " -?, -h, --help print this message", + " -?, -h, --help print this help message", " -V, --version print program version", " -J{X} pass option X to underlying Java VM" } diff --git a/src/java.base/share/classes/java/io/ByteArrayOutputStream.java b/src/java.base/share/classes/java/io/ByteArrayOutputStream.java index 7448eac2560..c0c88c91c07 100644 --- a/src/java.base/share/classes/java/io/ByteArrayOutputStream.java +++ b/src/java.base/share/classes/java/io/ByteArrayOutputStream.java @@ -27,6 +27,7 @@ package java.io; import java.nio.charset.Charset; import java.util.Arrays; +import java.util.Objects; /** * This class implements an output stream in which the data is @@ -147,10 +148,7 @@ public class ByteArrayOutputStream extends OutputStream { * @param len the number of bytes to write. */ public synchronized void write(byte b[], int off, int len) { - if ((off < 0) || (off > b.length) || (len < 0) || - ((off + len) - b.length > 0)) { - throw new IndexOutOfBoundsException(); - } + Objects.checkFromIndexSize(off, len, b.length); ensureCapacity(count + len); System.arraycopy(b, off, buf, count, len); count += len; diff --git a/src/java.base/share/classes/java/io/File.java b/src/java.base/share/classes/java/io/File.java index 72fa1f9445b..6bf3fe708aa 100644 --- a/src/java.base/share/classes/java/io/File.java +++ b/src/java.base/share/classes/java/io/File.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2256,7 +2256,7 @@ public class File private transient volatile Path filePath; /** - * Returns a {@link Path java.nio.file.Path} object constructed from the + * Returns a {@link Path java.nio.file.Path} object constructed from * this abstract path. The resulting {@code Path} is associated with the * {@link java.nio.file.FileSystems#getDefault default-filesystem}. * diff --git a/src/java.base/share/classes/java/io/InputStream.java b/src/java.base/share/classes/java/io/InputStream.java index b4d6255034f..a8b3425ebfd 100644 --- a/src/java.base/share/classes/java/io/InputStream.java +++ b/src/java.base/share/classes/java/io/InputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,9 @@ package java.io; +import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import java.util.Objects; /** @@ -53,6 +55,103 @@ public abstract class InputStream implements Closeable { private static final int DEFAULT_BUFFER_SIZE = 8192; + /** + * Returns a new {@code InputStream} that reads no bytes. The returned + * stream is initially open. The stream is closed by calling the + * {@code close()} method. Subsequent calls to {@code close()} have no + * effect. + * + *

            While the stream is open, the {@code available()}, {@code read()}, + * {@code read(byte[])}, {@code read(byte[], int, int)}, + * {@code readAllBytes()}, {@code readNBytes(byte[], int, int)}, + * {@code readNBytes(int)}, {@code skip(long)}, and + * {@code transferTo()} methods all behave as if end of stream has been + * reached. After the stream has been closed, these methods all throw + * {@code IOException}. + * + *

            The {@code markSupported()} method returns {@code false}. The + * {@code mark()} method does nothing, and the {@code reset()} method + * throws {@code IOException}. + * + * @return an {@code InputStream} which contains no bytes + * + * @since 11 + */ + public static InputStream nullInputStream() { + return new InputStream() { + private volatile boolean closed; + + private void ensureOpen() throws IOException { + if (closed) { + throw new IOException("Stream closed"); + } + } + + @Override + public int available () throws IOException { + ensureOpen(); + return 0; + } + + @Override + public int read() throws IOException { + ensureOpen(); + return -1; + } + + @Override + public int read(byte[] b, int off, int len) throws IOException { + Objects.checkFromIndexSize(off, len, b.length); + if (len == 0) { + return 0; + } + ensureOpen(); + return -1; + } + + @Override + public byte[] readAllBytes() throws IOException { + ensureOpen(); + return new byte[0]; + } + + @Override + public int readNBytes(byte[] b, int off, int len) + throws IOException { + Objects.checkFromIndexSize(off, len, b.length); + ensureOpen(); + return 0; + } + + @Override + public byte[] readNBytes(int len) throws IOException { + if (len < 0) { + throw new IllegalArgumentException("len < 0"); + } + ensureOpen(); + return new byte[0]; + } + + @Override + public long skip(long n) throws IOException { + ensureOpen(); + return 0L; + } + + @Override + public long transferTo(OutputStream out) throws IOException { + Objects.requireNonNull(out); + ensureOpen(); + return 0L; + } + + @Override + public void close() throws IOException { + closed = true; + } + }; + } + /** * Reads the next byte of data from the input stream. The value byte is * returned as an int in the range 0 to @@ -144,8 +243,8 @@ public abstract class InputStream implements Closeable { * b and the number of bytes read before the exception * occurred is returned. The default implementation of this method blocks * until the requested amount of input data len has been read, - * end of file is detected, or an exception is thrown. Subclasses are encouraged - * to provide a more efficient implementation of this method. + * end of file is detected, or an exception is thrown. Subclasses are + * encouraged to provide a more efficient implementation of this method. * * @param b the buffer into which the data is read. * @param off the start offset in array b @@ -164,7 +263,6 @@ public abstract class InputStream implements Closeable { * @see java.io.InputStream#read() */ public int read(byte b[], int off, int len) throws IOException { - Objects.requireNonNull(b); Objects.checkFromIndexSize(off, len, b.length); if (len == 0) { return 0; @@ -220,39 +318,125 @@ public abstract class InputStream implements Closeable { * It is strongly recommended that the stream be promptly closed if an I/O * error occurs. * + * @implSpec + * This method invokes {@link #readNBytes(int)} with a length of + * {@link Integer#MAX_VALUE}. + * * @return a byte array containing the bytes read from this input stream * @throws IOException if an I/O error occurs * @throws OutOfMemoryError if an array of the required size cannot be - * allocated. For example, if an array larger than {@code 2GB} would - * be required to store the bytes. + * allocated. * * @since 9 */ public byte[] readAllBytes() throws IOException { - byte[] buf = new byte[DEFAULT_BUFFER_SIZE]; - int capacity = buf.length; - int nread = 0; - int n; - for (;;) { - // read to EOF which may read more or less than initial buffer size - while ((n = read(buf, nread, capacity - nread)) > 0) - nread += n; + return readNBytes(Integer.MAX_VALUE); + } - // if the last call to read returned -1, then we're done - if (n < 0) - break; - - // need to allocate a larger buffer - if (capacity <= MAX_BUFFER_SIZE - capacity) { - capacity = capacity << 1; - } else { - if (capacity == MAX_BUFFER_SIZE) - throw new OutOfMemoryError("Required array size too large"); - capacity = MAX_BUFFER_SIZE; - } - buf = Arrays.copyOf(buf, capacity); + /** + * Reads up to a specified number of bytes from the input stream. This + * method blocks until the requested number of bytes have been read, end + * of stream is detected, or an exception is thrown. This method does not + * close the input stream. + * + *

            The length of the returned array equals the number of bytes read + * from the stream. If {@code len} is zero, then no bytes are read and + * an empty byte array is returned. Otherwise, up to {@code len} bytes + * are read from the stream. Fewer than {@code len} bytes may be read if + * end of stream is encountered. + * + *

            When this stream reaches end of stream, further invocations of this + * method will return an empty byte array. + * + *

            Note that this method is intended for simple cases where it is + * convenient to read the specified number of bytes into a byte array. The + * total amount of memory allocated by this method is proportional to the + * number of bytes read from the stream which is bounded by {@code len}. + * Therefore, the method may be safely called with very large values of + * {@code len} provided sufficient memory is available. + * + *

            The behavior for the case where the input stream is asynchronously + * closed, or the thread interrupted during the read, is highly input + * stream specific, and therefore not specified. + * + *

            If an I/O error occurs reading from the input stream, then it may do + * so after some, but not all, bytes have been read. Consequently the input + * stream may not be at end of stream and may be in an inconsistent state. + * It is strongly recommended that the stream be promptly closed if an I/O + * error occurs. + * + * @implNote + * The number of bytes allocated to read data from this stream and return + * the result is bounded by {@code 2*(long)len}, inclusive. + * + * @param len the maximum number of bytes to read + * @return a byte array containing the bytes read from this input stream + * @throws IllegalArgumentException if {@code length} is negative + * @throws IOException if an I/O error occurs + * @throws OutOfMemoryError if an array of the required size cannot be + * allocated. + * + * @since 11 + */ + public byte[] readNBytes(int len) throws IOException { + if (len < 0) { + throw new IllegalArgumentException("len < 0"); } - return (capacity == nread) ? buf : Arrays.copyOf(buf, nread); + + List bufs = null; + byte[] result = null; + int total = 0; + int remaining = len; + int n; + do { + byte[] buf = new byte[Math.min(remaining, DEFAULT_BUFFER_SIZE)]; + int nread = 0; + + // read to EOF which may read more or less than buffer size + while ((n = read(buf, nread, + Math.min(buf.length - nread, remaining))) > 0) { + nread += n; + remaining -= n; + } + + if (nread > 0) { + if (MAX_BUFFER_SIZE - total < nread) { + throw new OutOfMemoryError("Required array size too large"); + } + total += nread; + if (result == null) { + result = buf; + } else { + if (bufs == null) { + bufs = new ArrayList<>(); + bufs.add(result); + } + bufs.add(buf); + } + } + // if the last call to read returned -1 or the number of bytes + // requested have been read then break + } while (n >= 0 && remaining > 0); + + if (bufs == null) { + if (result == null) { + return new byte[0]; + } + return result.length == total ? + result : Arrays.copyOf(result, total); + } + + result = new byte[total]; + int offset = 0; + remaining = total; + for (byte[] b : bufs) { + int count = Math.min(b.length, remaining); + System.arraycopy(b, 0, result, offset, count); + offset += count; + remaining -= count; + } + + return result; } /** @@ -299,7 +483,6 @@ public abstract class InputStream implements Closeable { * @since 9 */ public int readNBytes(byte[] b, int off, int len) throws IOException { - Objects.requireNonNull(b); Objects.checkFromIndexSize(off, len, b.length); int n = 0; diff --git a/src/java.base/share/classes/java/io/ObjectInputStream.java b/src/java.base/share/classes/java/io/ObjectInputStream.java index 359305d8d81..2552247a1c9 100644 --- a/src/java.base/share/classes/java/io/ObjectInputStream.java +++ b/src/java.base/share/classes/java/io/ObjectInputStream.java @@ -1296,7 +1296,6 @@ public class ObjectInputStream * @throws InvalidClassException if the filter rejects creation */ private void checkArray(Class arrayType, int arrayLength) throws InvalidClassException { - Objects.requireNonNull(arrayType); if (! arrayType.isArray()) { throw new IllegalArgumentException("not an array type"); } diff --git a/src/java.base/share/classes/java/io/OutputStream.java b/src/java.base/share/classes/java/io/OutputStream.java index c6cb74d9452..556e7e00a63 100644 --- a/src/java.base/share/classes/java/io/OutputStream.java +++ b/src/java.base/share/classes/java/io/OutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,6 +46,51 @@ import java.util.Objects; * @since 1.0 */ public abstract class OutputStream implements Closeable, Flushable { + /** + * Returns a new {@code OutputStream} which discards all bytes. The + * returned stream is initially open. The stream is closed by calling + * the {@code close()} method. Subsequent calls to {@code close()} have + * no effect. + * + *

            While the stream is open, the {@code write(int)}, {@code + * write(byte[])}, and {@code write(byte[], int, int)} methods do nothing. + * After the stream has been closed, these methods all throw {@code + * IOException}. + * + *

            The {@code flush()} method does nothing. + * + * @return an {@code OutputStream} which discards all bytes + * + * @since 11 + */ + public static OutputStream nullOutputStream() { + return new OutputStream() { + private volatile boolean closed; + + private void ensureOpen() throws IOException { + if (closed) { + throw new IOException("Stream closed"); + } + } + + @Override + public void write(int b) throws IOException { + ensureOpen(); + } + + @Override + public void write(byte b[], int off, int len) throws IOException { + Objects.checkFromIndexSize(off, len, b.length); + ensureOpen(); + } + + @Override + public void close() { + closed = true; + } + }; + } + /** * Writes the specified byte to this output stream. The general * contract for write is that one byte is written @@ -106,7 +151,6 @@ public abstract class OutputStream implements Closeable, Flushable { * stream is closed. */ public void write(byte b[], int off, int len) throws IOException { - Objects.requireNonNull(b); Objects.checkFromIndexSize(off, len, b.length); // len == 0 condition implicitly handled by loop bounds for (int i = 0 ; i < len ; i++) { diff --git a/src/java.base/share/classes/java/lang/BootstrapMethodError.java b/src/java.base/share/classes/java/lang/BootstrapMethodError.java index dbca27cb223..8ffe2ca9d12 100644 --- a/src/java.base/share/classes/java/lang/BootstrapMethodError.java +++ b/src/java.base/share/classes/java/lang/BootstrapMethodError.java @@ -26,11 +26,15 @@ package java.lang; /** - * Thrown to indicate that an {@code invokedynamic} instruction has - * failed to find its bootstrap method, - * or the bootstrap method has failed to provide a - * {@linkplain java.lang.invoke.CallSite call site} with a {@linkplain java.lang.invoke.CallSite#getTarget target} - * of the correct {@linkplain java.lang.invoke.MethodHandle#type() method type}. + * Thrown to indicate that an {@code invokedynamic} instruction or a dynamic + * constant failed to resolve its bootstrap method and arguments, + * or for {@code invokedynamic} instruction the bootstrap method has failed to + * provide a + * {@linkplain java.lang.invoke.CallSite call site} with a + * {@linkplain java.lang.invoke.CallSite#getTarget target} + * of the correct {@linkplain java.lang.invoke.MethodHandle#type() method type}, + * or for a dynamic constant the bootstrap method has failed to provide a + * constant value of the required type. * * @author John Rose, JSR 292 EG * @since 1.7 diff --git a/src/java.base/share/classes/java/lang/ClassLoader.java b/src/java.base/share/classes/java/lang/ClassLoader.java index c18a9ad9774..43d8db808be 100644 --- a/src/java.base/share/classes/java/lang/ClassLoader.java +++ b/src/java.base/share/classes/java/lang/ClassLoader.java @@ -1876,14 +1876,15 @@ public abstract class ClassLoader { * value until the system is fully initialized. * *

            The name of the built-in system class loader is {@code "app"}. - * The class path used by the built-in system class loader is determined - * by the system property "{@code java.class.path}" during early - * initialization of the VM. If the system property is not defined, - * or its value is an empty string, then there is no class path - * when the initial module is a module on the application module path, - * i.e. a named module. If the initial module is not on - * the application module path then the class path defaults to - * the current working directory. + * The system property "{@code java.class.path}" is read during early + * initialization of the VM to determine the class path. + * An empty value of "{@code java.class.path}" property is interpreted + * differently depending on whether the initial module (the module + * containing the main class) is named or unnamed: + * If named, the built-in system class loader will have no class path and + * will search for classes and resources using the application module path; + * otherwise, if unnamed, it will set the class path to the current + * working directory. * * @return The system {@code ClassLoader} * diff --git a/src/java.base/share/classes/java/lang/Runtime.java b/src/java.base/share/classes/java/lang/Runtime.java index d09c1a28b93..c2bb813ed5c 100644 --- a/src/java.base/share/classes/java/lang/Runtime.java +++ b/src/java.base/share/classes/java/lang/Runtime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1099,16 +1099,23 @@ public class Runtime { m.group(VersionPattern.OPT_GROUP)); // empty '+' - if ((m.group(VersionPattern.PLUS_GROUP) != null) - && !build.isPresent()) { - if (optional.isPresent()) { - if (pre.isPresent()) - throw new IllegalArgumentException("'+' found with" - + " pre-release and optional components:'" + s - + "'"); + if (!build.isPresent()) { + if (m.group(VersionPattern.PLUS_GROUP) != null) { + if (optional.isPresent()) { + if (pre.isPresent()) + throw new IllegalArgumentException("'+' found with" + + " pre-release and optional components:'" + s + + "'"); + } else { + throw new IllegalArgumentException("'+' found with neither" + + " build or optional components: '" + s + "'"); + } } else { - throw new IllegalArgumentException("'+' found with neither" - + " build or optional components: '" + s + "'"); + if (optional.isPresent() && !pre.isPresent()) { + throw new IllegalArgumentException("optional component" + + " must be preceeded by a pre-release component" + + " or '+': '" + s + "'"); + } } } return new Version(List.of(version), pre, build, optional); diff --git a/src/java.base/share/classes/java/lang/System.java b/src/java.base/share/classes/java/lang/System.java index 04c98cace8a..2471d8e76ce 100644 --- a/src/java.base/share/classes/java/lang/System.java +++ b/src/java.base/share/classes/java/lang/System.java @@ -631,7 +631,8 @@ public final class System { *

            * * - * + * * * * diff --git a/src/java.base/share/classes/java/lang/VersionProps.java.template b/src/java.base/share/classes/java/lang/VersionProps.java.template index 031d1393d38..e8585e4b0a3 100644 --- a/src/java.base/share/classes/java/lang/VersionProps.java.template +++ b/src/java.base/share/classes/java/lang/VersionProps.java.template @@ -166,15 +166,8 @@ class VersionProps { * Print version info. */ private static void print(boolean err, boolean newln) { - boolean isHeadless = false; PrintStream ps = err ? System.err : System.out; - /* Report that we're running headless if the property is true */ - String headless = System.getProperty("java.awt.headless"); - if ( (headless != null) && (headless.equalsIgnoreCase("true")) ) { - isHeadless = true; - } - /* First line: platform version. */ if (err) { ps.println(launcher_name + " version \"" + java_version + "\"" diff --git a/src/java.base/share/classes/java/lang/invoke/AbstractConstantGroup.java b/src/java.base/share/classes/java/lang/invoke/AbstractConstantGroup.java new file mode 100644 index 00000000000..ce9854f68c5 --- /dev/null +++ b/src/java.base/share/classes/java/lang/invoke/AbstractConstantGroup.java @@ -0,0 +1,341 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package java.lang.invoke; + +import java.util.*; +import jdk.internal.vm.annotation.Stable; + +import static java.lang.invoke.MethodHandleStatics.rangeCheck1; +import static java.lang.invoke.MethodHandleStatics.rangeCheck2; + +/** Utility class for implementing ConstantGroup. */ +/*non-public*/ +abstract class AbstractConstantGroup implements ConstantGroup { + /** The size of this constant group, set permanently by the constructor. */ + protected final int size; + + /** The constructor requires the size of the constant group being represented. + * @param size the size of this constant group, set permanently by the constructor + */ + AbstractConstantGroup(int size) { + this.size = size; + } + + @Override public final int size() { + return size; + } + + public abstract Object get(int index) throws LinkageError; + + public abstract Object get(int index, Object ifNotPresent); + + public abstract boolean isPresent(int index); + + // Do not override equals or hashCode, since this type is stateful. + + /** + * Produce a string using the non-resolving list view, + * where unresolved elements are presented as asterisks. + * @return {@code this.asList("*").toString()} + */ + @Override public String toString() { + return asList("*").toString(); + } + + static class AsIterator implements Iterator { + private final ConstantGroup self; + private final int end; + private final boolean resolving; + private final Object ifNotPresent; + + // Mutable state: + private int index; + + private AsIterator(ConstantGroup self, int start, int end, + boolean resolving, Object ifNotPresent) { + this.self = self; + this.end = end; + this.index = start; + this.resolving = resolving; + this.ifNotPresent = ifNotPresent; + } + AsIterator(ConstantGroup self, int start, int end) { + this(self, start, end, true, null); + } + AsIterator(ConstantGroup self, int start, int end, + Object ifNotPresent) { + this(self, start, end, false, ifNotPresent); + } + + @Override + public boolean hasNext() { + return index < end; + } + + @Override + public Object next() { + int i = bumpIndex(); + if (resolving) + return self.get(i); + else + return self.get(i, ifNotPresent); + } + + private int bumpIndex() { + int i = index; + if (i >= end) throw new NoSuchElementException(); + index = i+1; + return i; + } + } + + static class SubGroup extends AbstractConstantGroup { + private final ConstantGroup self; // the real CG + private final int offset; // offset within myself + SubGroup(ConstantGroup self, int start, int end) { + super(end - start); + this.self = self; + this.offset = start; + rangeCheck2(start, end, size); + } + + private int mapIndex(int index) { + return rangeCheck1(index, size) + offset; + } + + @Override + public Object get(int index) { + return self.get(mapIndex(index)); + } + + @Override + public Object get(int index, Object ifNotPresent) { + return self.get(mapIndex(index), ifNotPresent); + } + + @Override + public boolean isPresent(int index) { + return self.isPresent(mapIndex(index)); + } + + @Override + public ConstantGroup subGroup(int start, int end) { + rangeCheck2(start, end, size); + return new SubGroup(self, offset + start, offset + end); + } + + @Override + public List asList() { + return new AsList(self, offset, offset + size); + } + + @Override + public List asList(Object ifNotPresent) { + return new AsList(self, offset, offset + size, ifNotPresent); + } + + @Override + public int copyConstants(int start, int end, + Object[] buf, int pos) throws LinkageError { + rangeCheck2(start, end, size); + return self.copyConstants(offset + start, offset + end, + buf, pos); + } + + @Override + public int copyConstants(int start, int end, + Object[] buf, int pos, + Object ifNotPresent) { + rangeCheck2(start, end, size); + return self.copyConstants(offset + start, offset + end, + buf, pos, ifNotPresent); + } + } + + static class AsList extends AbstractList { + private final ConstantGroup self; + private final int size; + private final int offset; + private final boolean resolving; + private final Object ifNotPresent; + + private AsList(ConstantGroup self, int start, int end, + boolean resolving, Object ifNotPresent) { + this.self = self; + this.size = end - start; + this.offset = start; + this.resolving = resolving; + this.ifNotPresent = ifNotPresent; + rangeCheck2(start, end, self.size()); + } + AsList(ConstantGroup self, int start, int end) { + this(self, start, end, true, null); + } + AsList(ConstantGroup self, int start, int end, + Object ifNotPresent) { + this(self, start, end, false, ifNotPresent); + } + + private int mapIndex(int index) { + return rangeCheck1(index, size) + offset; + } + + @Override public final int size() { + return size; + } + + @Override public Object get(int index) { + if (resolving) + return self.get(mapIndex(index)); + else + return self.get(mapIndex(index), ifNotPresent); + } + + @Override + public Iterator iterator() { + if (resolving) + return new AsIterator(self, offset, offset + size); + else + return new AsIterator(self, offset, offset + size, ifNotPresent); + } + + @Override public List subList(int start, int end) { + rangeCheck2(start, end, size); + return new AsList(self, offset + start, offset + end, + resolving, ifNotPresent); + } + + @Override public Object[] toArray() { + return toArray(new Object[size]); + } + @Override public T[] toArray(T[] a) { + int pad = a.length - size; + if (pad < 0) { + pad = 0; + a = Arrays.copyOf(a, size); + } + if (resolving) + self.copyConstants(offset, offset + size, a, 0); + else + self.copyConstants(offset, offset + size, a, 0, + ifNotPresent); + if (pad > 0) a[size] = null; + return a; + } + } + + static abstract + class WithCache extends AbstractConstantGroup { + @Stable final Object[] cache; + + WithCache(int size) { + super(size); + // It is caller's responsibility to initialize the cache. + // Initial contents are all-null, which means nothing is present. + cache = new Object[size]; + } + + void initializeCache(List cacheContents, Object ifNotPresent) { + // Replace ifNotPresent with NOT_PRESENT, + // and null with RESOLVED_TO_NULL. + // Then forget about the user-provided ifNotPresent. + for (int i = 0; i < cache.length; i++) { + Object x = cacheContents.get(i); + if (x == ifNotPresent) + continue; // leave the null in place + if (x == null) + x = RESOLVED_TO_NULL; + cache[i] = x; + } + } + + @Override public Object get(int i) { + Object x = cache[i]; + // @Stable array must use null for sentinel + if (x == null) x = fillCache(i); + return unwrapNull(x); + } + + @Override public Object get(int i, Object ifNotAvailable) { + Object x = cache[i]; + // @Stable array must use null for sentinel + if (x == null) return ifNotAvailable; + return unwrapNull(x); + } + + @Override + public boolean isPresent(int i) { + return cache[i] != null; + } + + /** hook for local subclasses */ + Object fillCache(int i) { + throw new NoSuchElementException("constant group does not contain element #"+i); + } + + /// routines for mapping between null sentinel and true resolved null + + static Object wrapNull(Object x) { + return x == null ? RESOLVED_TO_NULL : x; + } + + static Object unwrapNull(Object x) { + assert(x != null); + return x == RESOLVED_TO_NULL ? null : x; + } + + // secret sentinel for an actual null resolved value, in the cache + static final Object RESOLVED_TO_NULL = new Object(); + + // secret sentinel for a "hole" in the cache: + static final Object NOT_PRESENT = new Object(); + + } + + /** Skeleton implementation of BootstrapCallInfo. */ + static + class BSCIWithCache extends WithCache implements BootstrapCallInfo { + private final MethodHandle bsm; + private final String name; + private final T type; + + @Override public String toString() { + return bsm+"/"+name+":"+type+super.toString(); + } + + BSCIWithCache(MethodHandle bsm, String name, T type, int size) { + super(size); + this.type = type; + this.bsm = bsm; + this.name = name; + assert(type instanceof Class || type instanceof MethodType); + } + + @Override public MethodHandle bootstrapMethod() { return bsm; } + @Override public String invocationName() { return name; } + @Override public T invocationType() { return type; } + } +} diff --git a/src/java.base/share/classes/java/lang/invoke/BootstrapCallInfo.java b/src/java.base/share/classes/java/lang/invoke/BootstrapCallInfo.java new file mode 100644 index 00000000000..2ddcaad33a2 --- /dev/null +++ b/src/java.base/share/classes/java/lang/invoke/BootstrapCallInfo.java @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package java.lang.invoke; + +import java.lang.invoke.MethodHandles.Lookup; + +/** + * An interface providing full static information about a particular + * call to a + * bootstrap method of an + * dynamic call site or dynamic constant. + * This information includes the method itself, the associated + * name and type, and any associated static arguments. + *

            + * If a bootstrap method declares exactly two arguments, and is + * not of variable arity, then it is fed only two arguments by + * the JVM, the {@linkplain Lookup lookup object} and an instance + * of {@code BootstrapCallInfo} which supplies the rest of the + * information about the call. + *

            + * The API for accessing the static arguments allows the bootstrap + * method to reorder the resolution (in the constant pool) of the + * static arguments, and to catch errors resulting from the resolution. + * This mode of evaluation pulls bootstrap parameters from + * the JVM under control of the bootstrap method, as opposed to + * the JVM pushing parameters to a bootstrap method + * by resolving them all before the bootstrap method is called. + * @apiNote + *

            + * The {@linkplain Lookup lookup object} is not included in this + * bundle of information, so as not to obscure the access control + * logic of the program. + * In cases where there are many thousands of parameters, it may + * be preferable to pull their resolved values, either singly or in + * batches, rather than wait until all of them have been resolved + * before a constant or call site can be used. + *

            + * A push mode bootstrap method can be adapted to a pull mode + * bootstrap method, and vice versa. For example, this generic + * adapter pops a push-mode bootstrap method from the beginning + * of the static argument list, eagerly resolves all the remaining + * static arguments, and invokes the popped method in push mode. + * The callee has no way of telling that it was not called directly + * from the JVM. + *

            {@code
            +static Object genericBSM(Lookup lookup, BootstrapCallInfo bsci)
            +    throws Throwable {
            +  ArrayList args = new ArrayList<>();
            +  args.add(lookup);
            +  args.add(bsci.invocationName());
            +  args.add(bsci.invocationType());
            +  MethodHandle bsm = (MethodHandle) bsci.get(0);
            +  List restOfArgs = bsci.asList().subList(1, bsci.size();
            +  // the next line eagerly resolves all remaining static arguments:
            +  args.addAll(restOfArgs);
            +  return bsm.invokeWithArguments(args);
            +}
            + * }
            + *
            + * 

            + * In the other direction, here is a combinator which pops + * a pull-mode bootstrap method from the beginning of a list of + * static argument values (already resolved), reformats all of + * the arguments into a pair of a lookup and a {@code BootstrapCallInfo}, + * and invokes the popped method. Again the callee has no way of + * telling it was not called directly by the JVM, except that + * all of the constant values will appear as resolved. + * Put another way, if any constant fails to resolve, the + * callee will not be able to catch the resulting error, + * since the error will be thrown by the JVM before the + * bootstrap method is entered. + *

            {@code
            +static Object genericBSM(Lookup lookup, String name, Object type,
            +                         MethodHandle bsm, Object... args)
            +    throws Throwable {
            +  ConstantGroup cons = ConstantGroup.makeConstantGroup(Arrays.asList(args));
            +  BootstrapCallInfo bsci = makeBootstrapCallInfo(bsm, name, type, cons);
            +  return bsm.invoke(lookup, bsci);
            +}
            + * }
            + *
            + * @since 1.10
            + */
            +// public
            +interface BootstrapCallInfo extends ConstantGroup {
            +    /** Returns the bootstrap method for this call.
            +     * @return the bootstrap method
            +     */
            +    MethodHandle bootstrapMethod();
            +
            +    /** Returns the method name or constant name for this call.
            +     * @return the method name or constant name
            +     */
            +    String invocationName();
            +
            +    /** Returns the method type or constant type for this call.
            +     * @return the method type or constant type
            +     */
            +    T invocationType();
            +
            +    /**
            +     * Make a new bootstrap call descriptor with the given components.
            +     * @param bsm bootstrap method
            +     * @param name invocation name
            +     * @param type invocation type
            +     * @param constants the additional static arguments for the bootstrap method
            +     * @param  the type of the invocation type, either {@link MethodHandle} or {@link Class}
            +     * @return a new bootstrap call descriptor with the given components
            +     */
            +    static  BootstrapCallInfo makeBootstrapCallInfo(MethodHandle bsm,
            +                                                          String name,
            +                                                          T type,
            +                                                          ConstantGroup constants) {
            +        AbstractConstantGroup.BSCIWithCache bsci = new AbstractConstantGroup.BSCIWithCache<>(bsm, name, type, constants.size());
            +        final Object NP = AbstractConstantGroup.BSCIWithCache.NOT_PRESENT;
            +        bsci.initializeCache(constants.asList(NP), NP);
            +        return bsci;
            +    }
            +}
            diff --git a/src/java.base/share/classes/java/lang/invoke/BootstrapMethodInvoker.java b/src/java.base/share/classes/java/lang/invoke/BootstrapMethodInvoker.java
            new file mode 100644
            index 00000000000..1419bf8c319
            --- /dev/null
            +++ b/src/java.base/share/classes/java/lang/invoke/BootstrapMethodInvoker.java
            @@ -0,0 +1,366 @@
            +/*
            + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
            + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
            + *
            + * This code is free software; you can redistribute it and/or modify it
            + * under the terms of the GNU General Public License version 2 only, as
            + * published by the Free Software Foundation.  Oracle designates this
            + * particular file as subject to the "Classpath" exception as provided
            + * by Oracle in the LICENSE file that accompanied this code.
            + *
            + * This code is distributed in the hope that it will be useful, but WITHOUT
            + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
            + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
            + * version 2 for more details (a copy is included in the LICENSE file that
            + * accompanied this code).
            + *
            + * You should have received a copy of the GNU General Public License version
            + * 2 along with this work; if not, write to the Free Software Foundation,
            + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
            + *
            + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
            + * or visit www.oracle.com if you need additional information or have any
            + * questions.
            + */
            +package java.lang.invoke;
            +
            +import sun.invoke.util.Wrapper;
            +
            +import java.lang.invoke.AbstractConstantGroup.BSCIWithCache;
            +import java.util.Arrays;
            +
            +import static java.lang.invoke.BootstrapCallInfo.makeBootstrapCallInfo;
            +import static java.lang.invoke.ConstantGroup.makeConstantGroup;
            +import static java.lang.invoke.MethodHandleNatives.*;
            +import static java.lang.invoke.MethodHandleStatics.TRACE_METHOD_LINKAGE;
            +import static java.lang.invoke.MethodHandles.Lookup;
            +import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
            +
            +final class BootstrapMethodInvoker {
            +    /**
            +     * Factored code for invoking a bootstrap method for invokedynamic
            +     * or a dynamic constant.
            +     * @param resultType the expected return type (either CallSite or a constant type)
            +     * @param bootstrapMethod the BSM to call
            +     * @param name the method name or constant name
            +     * @param type the method type or constant type
            +     * @param info information passed up from the JVM, to derive static arguments
            +     * @param callerClass the class containing the resolved method call or constant load
            +     * @param  the expected return type
            +     * @return the expected value, either a CallSite or a constant value
            +     */
            +    static  T invoke(Class resultType,
            +                        MethodHandle bootstrapMethod,
            +                        // Callee information:
            +                        String name, Object type,
            +                        // Extra arguments for BSM, if any:
            +                        Object info,
            +                        // Caller information:
            +                        Class callerClass) {
            +        MethodHandles.Lookup caller = IMPL_LOOKUP.in(callerClass);
            +        Object result;
            +        boolean pullMode = isPullModeBSM(bootstrapMethod);  // default value is false
            +        boolean vmIsPushing = !staticArgumentsPulled(info); // default value is true
            +        MethodHandle pullModeBSM;
            +        // match the VM with the BSM
            +        if (vmIsPushing) {
            +            // VM is pushing arguments at us
            +            pullModeBSM = null;
            +            if (pullMode) {
            +                bootstrapMethod = Adapters.pushMePullYou(bootstrapMethod, true);
            +            }
            +        } else {
            +            // VM wants us to pull args from it
            +            pullModeBSM = pullMode ? bootstrapMethod :
            +                    Adapters.pushMePullYou(bootstrapMethod, false);
            +            bootstrapMethod = null;
            +        }
            +        try {
            +            info = maybeReBox(info);
            +            if (info == null) {
            +                // VM is allowed to pass up a null meaning no BSM args
            +                result = bootstrapMethod.invoke(caller, name, type);
            +            }
            +            else if (!info.getClass().isArray()) {
            +                // VM is allowed to pass up a single BSM arg directly
            +                result = bootstrapMethod.invoke(caller, name, type, info);
            +            }
            +            else if (info.getClass() == int[].class) {
            +                // VM is allowed to pass up a pair {argc, index}
            +                // referring to 'argc' BSM args at some place 'index'
            +                // in the guts of the VM (associated with callerClass).
            +                // The format of this index pair is private to the
            +                // handshake between the VM and this class only.
            +                // This supports "pulling" of arguments.
            +                // The VM is allowed to do this for any reason.
            +                // The code in this method makes up for any mismatches.
            +                BootstrapCallInfo bsci
            +                    = new VM_BSCI<>(bootstrapMethod, name, type, caller, (int[])info);
            +                // Pull-mode API is (Lookup, BootstrapCallInfo) -> Object
            +                result = pullModeBSM.invoke(caller, bsci);
            +            }
            +            else {
            +                // VM is allowed to pass up a full array of resolved BSM args
            +                Object[] argv = (Object[]) info;
            +                maybeReBoxElements(argv);
            +                switch (argv.length) {
            +                    case 0:
            +                        result = bootstrapMethod.invoke(caller, name, type);
            +                        break;
            +                    case 1:
            +                        result = bootstrapMethod.invoke(caller, name, type,
            +                                                        argv[0]);
            +                        break;
            +                    case 2:
            +                        result = bootstrapMethod.invoke(caller, name, type,
            +                                                        argv[0], argv[1]);
            +                        break;
            +                    case 3:
            +                        result = bootstrapMethod.invoke(caller, name, type,
            +                                                        argv[0], argv[1], argv[2]);
            +                        break;
            +                    case 4:
            +                        result = bootstrapMethod.invoke(caller, name, type,
            +                                                        argv[0], argv[1], argv[2], argv[3]);
            +                        break;
            +                    case 5:
            +                        result = bootstrapMethod.invoke(caller, name, type,
            +                                                        argv[0], argv[1], argv[2], argv[3], argv[4]);
            +                        break;
            +                    case 6:
            +                        result = bootstrapMethod.invoke(caller, name, type,
            +                                                        argv[0], argv[1], argv[2], argv[3], argv[4], argv[5]);
            +                        break;
            +                    default:
            +                        final int NON_SPREAD_ARG_COUNT = 3;  // (caller, name, type)
            +                        final int MAX_SAFE_SIZE = MethodType.MAX_MH_ARITY / 2 - NON_SPREAD_ARG_COUNT;
            +                        if (argv.length >= MAX_SAFE_SIZE) {
            +                            // to be on the safe side, use invokeWithArguments which handles jumbo lists
            +                            Object[] newargv = new Object[NON_SPREAD_ARG_COUNT + argv.length];
            +                            newargv[0] = caller;
            +                            newargv[1] = name;
            +                            newargv[2] = type;
            +                            System.arraycopy(argv, 0, newargv, NON_SPREAD_ARG_COUNT, argv.length);
            +                            result = bootstrapMethod.invokeWithArguments(newargv);
            +                            break;
            +                        }
            +                        MethodType invocationType = MethodType.genericMethodType(NON_SPREAD_ARG_COUNT + argv.length);
            +                        MethodHandle typedBSM = bootstrapMethod.asType(invocationType);
            +                        MethodHandle spreader = invocationType.invokers().spreadInvoker(NON_SPREAD_ARG_COUNT);
            +                        result = spreader.invokeExact(typedBSM, (Object) caller, (Object) name, type, argv);
            +                }
            +            }
            +            if (resultType.isPrimitive()) {
            +                // Non-reference conversions are more than just plain casts.
            +                // By pushing the value through a funnel of the form (T x)->x,
            +                // the boxed result can be widened as needed.  See MH::asType.
            +                MethodHandle funnel = MethodHandles.identity(resultType);
            +                result = funnel.invoke(result);
            +                // Now it is the wrapper type for resultType.
            +                resultType = Wrapper.asWrapperType(resultType);
            +            }
            +            return resultType.cast(result);
            +        }
            +        catch (Error e) {
            +            // Pass through an Error, including BootstrapMethodError, any other
            +            // form of linkage error, such as IllegalAccessError if the bootstrap
            +            // method is inaccessible, or say ThreadDeath/OutOfMemoryError
            +            // See the "Linking Exceptions" section for the invokedynamic
            +            // instruction in JVMS 6.5.
            +            throw e;
            +        }
            +        catch (Throwable ex) {
            +            // Wrap anything else in BootstrapMethodError
            +            throw new BootstrapMethodError("bootstrap method initialization exception", ex);
            +        }
            +    }
            +
            +    /** The JVM produces java.lang.Integer values to box
            +     *  CONSTANT_Integer boxes but does not intern them.
            +     *  Let's intern them.  This is slightly wrong for
            +     *  a {@code CONSTANT_Dynamic} which produces an
            +     *  un-interned integer (e.g., {@code new Integer(0)}).
            +     */
            +    private static Object maybeReBox(Object x) {
            +        if (x instanceof Integer) {
            +            int xi = (int) x;
            +            if (xi == (byte) xi)
            +                x = xi;  // must rebox; see JLS 5.1.7
            +        }
            +        return x;
            +    }
            +
            +    private static void maybeReBoxElements(Object[] xa) {
            +        for (int i = 0; i < xa.length; i++) {
            +            xa[i] = maybeReBox(xa[i]);
            +        }
            +    }
            +
            +    /** Canonical VM-aware implementation of BootstrapCallInfo.
            +     * Knows how to dig into the JVM for lazily resolved (pull-mode) constants.
            +     */
            +    private static final class VM_BSCI extends BSCIWithCache {
            +        private final int[] indexInfo;
            +        private final Class caller;  // for index resolution only
            +
            +        VM_BSCI(MethodHandle bsm, String name, T type,
            +                Lookup lookup, int[] indexInfo) {
            +            super(bsm, name, type, indexInfo[0]);
            +            if (!lookup.hasPrivateAccess())  //D.I.D.
            +                throw new AssertionError("bad Lookup object");
            +            this.caller = lookup.lookupClass();
            +            this.indexInfo = indexInfo;
            +            // scoop up all the easy stuff right away:
            +            prefetchIntoCache(0, size());
            +        }
            +
            +        @Override Object fillCache(int i) {
            +            Object[] buf = { null };
            +            copyConstants(i, i+1, buf, 0);
            +            Object res = wrapNull(buf[0]);
            +            cache[i] = res;
            +            int next = i + 1;
            +            if (next < cache.length && cache[next] == null)
            +                maybePrefetchIntoCache(next, false);  // try to prefetch
            +            return res;
            +        }
            +
            +        @Override public int copyConstants(int start, int end,
            +                                           Object[] buf, int pos) {
            +            int i = start, bufi = pos;
            +            while (i < end) {
            +                Object x = cache[i];
            +                if (x == null)  break;
            +                buf[bufi++] = unwrapNull(x);
            +                i++;
            +            }
            +            // give up at first null and grab the rest in one big block
            +            if (i >= end)  return i;
            +            Object[] temp = new Object[end - i];
            +            if (TRACE_METHOD_LINKAGE)
            +                System.out.println("resolving more BSM arguments: "+
            +                        Arrays.asList(caller.getSimpleName(), Arrays.toString(indexInfo), i, end));
            +            copyOutBootstrapArguments(caller, indexInfo,
            +                                      i, end, temp, 0,
            +                                      true, null);
            +            for (Object x : temp) {
            +                x = maybeReBox(x);
            +                buf[bufi++] = x;
            +                cache[i++] = wrapNull(x);
            +            }
            +            if (end < cache.length && cache[end] == null)
            +                maybePrefetchIntoCache(end, true);  // try to prefetch
            +            return i;
            +        }
            +
            +        private static final int MIN_PF = 4;
            +        private void maybePrefetchIntoCache(int i, boolean bulk) {
            +            int len = cache.length;
            +            assert(0 <= i && i <= len);
            +            int pfLimit = i;
            +            if (bulk)  pfLimit += i;  // exponential prefetch expansion
            +            // try to prefetch at least MIN_PF elements
            +            if (pfLimit < i + MIN_PF)  pfLimit = i + MIN_PF;
            +            if (pfLimit > len || pfLimit < 0)  pfLimit = len;
            +            // stop prefetching where cache is more full than empty
            +            int empty = 0, nonEmpty = 0, lastEmpty = i;
            +            for (int j = i; j < pfLimit; j++) {
            +                if (cache[j] == null) {
            +                    empty++;
            +                    lastEmpty = j;
            +                } else {
            +                    nonEmpty++;
            +                    if (nonEmpty > empty) {
            +                        pfLimit = lastEmpty + 1;
            +                        break;
            +                    }
            +                    if (pfLimit < len)  pfLimit++;
            +                }
            +            }
            +            if (bulk && empty < MIN_PF && pfLimit < len)
            +                return;  // not worth the effort
            +            prefetchIntoCache(i, pfLimit);
            +        }
            +
            +        private void prefetchIntoCache(int i, int pfLimit) {
            +            if (pfLimit <= i)  return;  // corner case
            +            Object[] temp = new Object[pfLimit - i];
            +            if (TRACE_METHOD_LINKAGE)
            +                System.out.println("prefetching BSM arguments: "+
            +                        Arrays.asList(caller.getSimpleName(), Arrays.toString(indexInfo), i, pfLimit));
            +            copyOutBootstrapArguments(caller, indexInfo,
            +                                      i, pfLimit, temp, 0,
            +                                      false, NOT_PRESENT);
            +            for (Object x : temp) {
            +                if (x != NOT_PRESENT && cache[i] == null) {
            +                    cache[i] = wrapNull(maybeReBox(x));
            +                }
            +                i++;
            +            }
            +        }
            +    }
            +
            +    /*non-public*/ static final
            +    class Adapters {
            +        // skeleton for push-mode BSM which wraps a pull-mode BSM:
            +        static Object pushToBootstrapMethod(MethodHandle pullModeBSM,
            +                                            MethodHandles.Lookup lookup, String name, Object type,
            +                                            Object... arguments) throws Throwable {
            +            ConstantGroup cons = makeConstantGroup(Arrays.asList(arguments));
            +            BootstrapCallInfo bsci = makeBootstrapCallInfo(pullModeBSM, name, type, cons);
            +            if (TRACE_METHOD_LINKAGE)
            +                System.out.println("pull-mode BSM gets pushed arguments from fake BSCI");
            +            return pullModeBSM.invoke(lookup, bsci);
            +        }
            +
            +        // skeleton for pull-mode BSM which wraps a push-mode BSM:
            +        static Object pullFromBootstrapMethod(MethodHandle pushModeBSM,
            +                                              MethodHandles.Lookup lookup, BootstrapCallInfo bsci)
            +                throws Throwable {
            +            int argc = bsci.size();
            +            Object arguments[] = new Object[3 + argc];
            +            arguments[0] = lookup;
            +            arguments[1] = bsci.invocationName();
            +            arguments[2] = bsci.invocationType();
            +            bsci.copyConstants(0, argc, arguments, 3);
            +            if (TRACE_METHOD_LINKAGE)
            +                System.out.println("pulled arguments from VM for push-mode BSM");
            +            return pushModeBSM.invokeWithArguments(arguments);
            +        }
            +        static final MethodHandle MH_pushToBootstrapMethod;
            +        static final MethodHandle MH_pullFromBootstrapMethod;
            +        static {
            +            final Class THIS_CLASS = Adapters.class;
            +            try {
            +                MH_pushToBootstrapMethod = IMPL_LOOKUP
            +                    .findStatic(THIS_CLASS, "pushToBootstrapMethod",
            +                                MethodType.methodType(Object.class, MethodHandle.class,
            +                                        Lookup.class, String.class, Object.class, Object[].class));
            +                MH_pullFromBootstrapMethod = IMPL_LOOKUP
            +                    .findStatic(THIS_CLASS, "pullFromBootstrapMethod",
            +                                MethodType.methodType(Object.class, MethodHandle.class,
            +                                        Lookup.class, BootstrapCallInfo.class));
            +            } catch (Throwable ex) {
            +                throw new InternalError(ex);
            +            }
            +        }
            +
            +        /** Given a push-mode BSM (taking one argument) convert it to a
            +         *  pull-mode BSM (taking N pre-resolved arguments).
            +         *  This method is used when, in fact, the JVM is passing up
            +         *  pre-resolved arguments, but the BSM is expecting lazy stuff.
            +         *  Or, when goToPushMode is true, do the reverse transform.
            +         *  (The two transforms are exactly inverse.)
            +         */
            +        static MethodHandle pushMePullYou(MethodHandle bsm, boolean goToPushMode) {
            +            if (TRACE_METHOD_LINKAGE)
            +                System.out.println("converting BSM to "+(goToPushMode ? "push mode" : "pull mode"));
            +            assert(isPullModeBSM(bsm) == goToPushMode);  //there must be a change
            +            if (goToPushMode) {
            +                return Adapters.MH_pushToBootstrapMethod.bindTo(bsm).withVarargs(true);
            +            } else {
            +                return Adapters.MH_pullFromBootstrapMethod.bindTo(bsm).withVarargs(false);
            +            }
            +        }
            +    }
            +}
            diff --git a/src/java.base/share/classes/java/lang/invoke/CallSite.java b/src/java.base/share/classes/java/lang/invoke/CallSite.java
            index 5dc06fd8dcb..faa31125430 100644
            --- a/src/java.base/share/classes/java/lang/invoke/CallSite.java
            +++ b/src/java.base/share/classes/java/lang/invoke/CallSite.java
            @@ -302,65 +302,10 @@ public class CallSite {
                                          Object info,
                                          // Caller information:
                                          Class callerClass) {
            -        MethodHandles.Lookup caller = IMPL_LOOKUP.in(callerClass);
                     CallSite site;
                     try {
            -            Object binding;
            -            info = maybeReBox(info);
            -            if (info == null) {
            -                binding = bootstrapMethod.invoke(caller, name, type);
            -            } else if (!info.getClass().isArray()) {
            -                binding = bootstrapMethod.invoke(caller, name, type, info);
            -            } else {
            -                Object[] argv = (Object[]) info;
            -                maybeReBoxElements(argv);
            -                switch (argv.length) {
            -                    case 0:
            -                        binding = bootstrapMethod.invoke(caller, name, type);
            -                        break;
            -                    case 1:
            -                        binding = bootstrapMethod.invoke(caller, name, type,
            -                                                         argv[0]);
            -                        break;
            -                    case 2:
            -                        binding = bootstrapMethod.invoke(caller, name, type,
            -                                                         argv[0], argv[1]);
            -                        break;
            -                    case 3:
            -                        binding = bootstrapMethod.invoke(caller, name, type,
            -                                                         argv[0], argv[1], argv[2]);
            -                        break;
            -                    case 4:
            -                        binding = bootstrapMethod.invoke(caller, name, type,
            -                                                         argv[0], argv[1], argv[2], argv[3]);
            -                        break;
            -                    case 5:
            -                        binding = bootstrapMethod.invoke(caller, name, type,
            -                                                         argv[0], argv[1], argv[2], argv[3], argv[4]);
            -                        break;
            -                    case 6:
            -                        binding = bootstrapMethod.invoke(caller, name, type,
            -                                                         argv[0], argv[1], argv[2], argv[3], argv[4], argv[5]);
            -                        break;
            -                    default:
            -                        final int NON_SPREAD_ARG_COUNT = 3;  // (caller, name, type)
            -                        final int MAX_SAFE_SIZE = MethodType.MAX_MH_ARITY / 2 - NON_SPREAD_ARG_COUNT;
            -                        if (argv.length >= MAX_SAFE_SIZE) {
            -                            // to be on the safe side, use invokeWithArguments which handles jumbo lists
            -                            Object[] newargv = new Object[NON_SPREAD_ARG_COUNT + argv.length];
            -                            newargv[0] = caller;
            -                            newargv[1] = name;
            -                            newargv[2] = type;
            -                            System.arraycopy(argv, 0, newargv, NON_SPREAD_ARG_COUNT, argv.length);
            -                            binding = bootstrapMethod.invokeWithArguments(newargv);
            -                        } else {
            -                            MethodType invocationType = MethodType.genericMethodType(NON_SPREAD_ARG_COUNT + argv.length);
            -                            MethodHandle typedBSM = bootstrapMethod.asType(invocationType);
            -                            MethodHandle spreader = invocationType.invokers().spreadInvoker(NON_SPREAD_ARG_COUNT);
            -                            binding = spreader.invokeExact(typedBSM, (Object) caller, (Object) name, (Object) type, argv);
            -                        }
            -                }
            -            }
            +            Object binding = BootstrapMethodInvoker.invoke(
            +                    CallSite.class, bootstrapMethod, name, type, info, callerClass);
                         if (binding instanceof CallSite) {
                             site = (CallSite) binding;
                         } else {
            @@ -369,7 +314,7 @@ public class CallSite {
                             // Throws a runtime exception defining the cause that is then
                             // in the "catch (Throwable ex)" a few lines below wrapped in
                             // BootstrapMethodError
            -                throw new ClassCastException("bootstrap method failed to produce a CallSite");
            +                throw new ClassCastException("CallSite bootstrap method failed to produce an instance of CallSite");
                         }
                         if (!site.getTarget().type().equals(type)) {
                             // See the "Linking Exceptions" section for the invokedynamic
            @@ -388,22 +333,8 @@ public class CallSite {
                         throw e;
                     } catch (Throwable ex) {
                         // Wrap anything else in BootstrapMethodError
            -            throw new BootstrapMethodError("call site initialization exception", ex);
            +            throw new BootstrapMethodError("CallSite bootstrap method initialization exception", ex);
                     }
                     return site;
                 }
            -
            -    private static Object maybeReBox(Object x) {
            -        if (x instanceof Integer) {
            -            int xi = (int) x;
            -            if (xi == (byte) xi)
            -                x = xi;  // must rebox; see JLS 5.1.7
            -        }
            -        return x;
            -    }
            -    private static void maybeReBoxElements(Object[] xa) {
            -        for (int i = 0; i < xa.length; i++) {
            -            xa[i] = maybeReBox(xa[i]);
            -        }
            -    }
             }
            diff --git a/src/java.base/share/classes/java/lang/invoke/ConstantBootstraps.java b/src/java.base/share/classes/java/lang/invoke/ConstantBootstraps.java
            new file mode 100644
            index 00000000000..42299264491
            --- /dev/null
            +++ b/src/java.base/share/classes/java/lang/invoke/ConstantBootstraps.java
            @@ -0,0 +1,346 @@
            +/*
            + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
            + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
            + *
            + * This code is free software; you can redistribute it and/or modify it
            + * under the terms of the GNU General Public License version 2 only, as
            + * published by the Free Software Foundation.  Oracle designates this
            + * particular file as subject to the "Classpath" exception as provided
            + * by Oracle in the LICENSE file that accompanied this code.
            + *
            + * This code is distributed in the hope that it will be useful, but WITHOUT
            + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
            + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
            + * version 2 for more details (a copy is included in the LICENSE file that
            + * accompanied this code).
            + *
            + * You should have received a copy of the GNU General Public License version
            + * 2 along with this work; if not, write to the Free Software Foundation,
            + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
            + *
            + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
            + * or visit www.oracle.com if you need additional information or have any
            + * questions.
            + */
            +package java.lang.invoke;
            +
            +import sun.invoke.util.Wrapper;
            +
            +import static java.lang.invoke.MethodHandleNatives.mapLookupExceptionToError;
            +import static java.util.Objects.requireNonNull;
            +
            +/**
            + * Bootstrap methods for dynamically-computed constants.
            + *
            + * 

            The bootstrap methods in this class will throw a + * {@code NullPointerException} for any reference argument that is {@code null}, + * unless the argument is specified to be unused or specified to accept a + * {@code null} value. + * + * @since 11 + */ +public final class ConstantBootstraps { + // implements the upcall from the JVM, MethodHandleNatives.linkDynamicConstant: + /*non-public*/ + static Object makeConstant(MethodHandle bootstrapMethod, + // Callee information: + String name, Class type, + // Extra arguments for BSM, if any: + Object info, + // Caller information: + Class callerClass) { + // BSMI.invoke handles all type checking and exception translation. + // If type is not a reference type, the JVM is expecting a boxed + // version, and will manage unboxing on the other side. + return BootstrapMethodInvoker.invoke( + type, bootstrapMethod, name, type, info, callerClass); + } + + /** + * Returns a {@code null} object reference for the reference type specified + * by {@code type}. + * + * @param lookup unused + * @param name unused + * @param type a reference type + * @return a {@code null} value + * @throws IllegalArgumentException if {@code type} is not a reference type + */ + public static Object nullConstant(MethodHandles.Lookup lookup, String name, Class type) { + if (requireNonNull(type).isPrimitive()) { + throw new IllegalArgumentException(String.format("not reference: %s", type)); + } + + return null; + } + + /** + * Returns a {@link Class} mirror for the primitive type whose type + * descriptor is specified by {@code name}. + * + * @param lookup unused + * @param name the descriptor (JVMS 4.3) of the desired primitive type + * @param type the required result type (must be {@code Class.class}) + * @return the {@link Class} mirror + * @throws IllegalArgumentException if the name is not a descriptor for a + * primitive type or the type is not {@code Class.class} + */ + public static Class primitiveClass(MethodHandles.Lookup lookup, String name, Class type) { + requireNonNull(name); + requireNonNull(type); + if (type != Class.class) { + throw new IllegalArgumentException(); + } + if (name.length() == 0 || name.length() > 1) { + throw new IllegalArgumentException(String.format("not primitive: %s", name)); + } + + return Wrapper.forPrimitiveType(name.charAt(0)).primitiveType(); + } + + /** + * Returns an {@code enum} constant of the type specified by {@code type} + * with the name specified by {@code name}. + * + * @param lookup the lookup context describing the class performing the + * operation (normally stacked by the JVM) + * @param type the {@code Class} object describing the enum type for which + * a constant is to be returned + * @param name the name of the constant to return, which must exactly match + * an enum constant in the specified type. + * @param The enum type for which a constant value is to be returned + * @return the enum constant of the specified enum type with the + * specified name + * @throws IllegalAccessError if the declaring class or the field is not + * accessible to the class performing the operation + * @throws IllegalArgumentException if the specified enum type has + * no constant with the specified name, or the specified + * class object does not represent an enum type + * @see Enum#valueOf(Class, String) + */ + public static > E enumConstant(MethodHandles.Lookup lookup, String name, Class type) { + requireNonNull(lookup); + requireNonNull(name); + requireNonNull(type); + validateClassAccess(lookup, type); + + return Enum.valueOf(type, name); + } + + /** + * Returns the value of a static final field. + * + * @param lookup the lookup context describing the class performing the + * operation (normally stacked by the JVM) + * @param name the name of the field + * @param type the type of the field + * @param declaringClass the class in which the field is declared + * @return the value of the field + * @throws IllegalAccessError if the declaring class or the field is not + * accessible to the class performing the operation + * @throws NoSuchFieldError if the specified field does not exist + * @throws IncompatibleClassChangeError if the specified field is not + * {@code final} + */ + public static Object getStaticFinal(MethodHandles.Lookup lookup, String name, Class type, + Class declaringClass) { + requireNonNull(lookup); + requireNonNull(name); + requireNonNull(type); + requireNonNull(declaringClass); + + MethodHandle mh; + try { + mh = lookup.findStaticGetter(declaringClass, name, type); + MemberName member = mh.internalMemberName(); + if (!member.isFinal()) { + throw new IncompatibleClassChangeError("not a final field: " + name); + } + } + catch (ReflectiveOperationException ex) { + throw mapLookupExceptionToError(ex); + } + + // Since mh is a handle to a static field only instances of + // VirtualMachineError are anticipated to be thrown, such as a + // StackOverflowError or an InternalError from the j.l.invoke code + try { + return mh.invoke(); + } + catch (RuntimeException | Error e) { + throw e; + } + catch (Throwable e) { + throw new LinkageError("Unexpected throwable", e); + } + } + + /** + * Returns the value of a static final field declared in the class which + * is the same as the field's type (or, for primitive-valued fields, + * declared in the wrapper class.) This is a simplified form of + * {@link #getStaticFinal(MethodHandles.Lookup, String, Class, Class)} + * for the case where a class declares distinguished constant instances of + * itself. + * + * @param lookup the lookup context describing the class performing the + * operation (normally stacked by the JVM) + * @param name the name of the field + * @param type the type of the field + * @return the value of the field + * @throws IllegalAccessError if the declaring class or the field is not + * accessible to the class performing the operation + * @throws NoSuchFieldError if the specified field does not exist + * @throws IncompatibleClassChangeError if the specified field is not + * {@code final} + * @see #getStaticFinal(MethodHandles.Lookup, String, Class, Class) + */ + public static Object getStaticFinal(MethodHandles.Lookup lookup, String name, Class type) { + requireNonNull(type); + + Class declaring = type.isPrimitive() + ? Wrapper.forPrimitiveType(type).wrapperType() + : type; + return getStaticFinal(lookup, name, type, declaring); + } + + + /** + * Returns the result of invoking a method handle with the provided + * arguments. + * + * @param lookup the lookup context describing the class performing the + * operation (normally stacked by the JVM) + * @param name unused + * @param type the type of the value to be returned, which must be + * compatible with the return type of the method handle + * @param handle the method handle to be invoked + * @param args the arguments to pass to the method handle, as if with + * {@link MethodHandle#invokeWithArguments}. Each argument may be + * {@code null}. + * @return the result of invoking the method handle + * @throws WrongMethodTypeException if the handle's return type cannot be + * adjusted to the desired type + * @throws ClassCastException if an argument cannot be converted by + * reference casting + * @throws Throwable anything thrown by the method handle invocation + */ + public static Object invoke(MethodHandles.Lookup lookup, String name, Class type, + MethodHandle handle, Object... args) throws Throwable { + requireNonNull(type); + requireNonNull(handle); + requireNonNull(args); + + if (type != handle.type().returnType()) { + // Adjust the return type of the handle to be invoked while + // preserving variable arity if present + handle = handle.asType(handle.type().changeReturnType(type)). + withVarargs(handle.isVarargsCollector()); + } + + return handle.invokeWithArguments(args); + } + + /** + * Finds a {@link VarHandle} for an instance field. + * + * @param lookup the lookup context describing the class performing the + * operation (normally stacked by the JVM) + * @param name the name of the field + * @param type the required result type (must be {@code Class}) + * @param declaringClass the class in which the field is declared + * @param fieldType the type of the field + * @return the {@link VarHandle} + * @throws IllegalAccessError if the declaring class or the field is not + * accessible to the class performing the operation + * @throws NoSuchFieldError if the specified field does not exist + * @throws IllegalArgumentException if the type is not {@code VarHandle} + */ + public static VarHandle fieldVarHandle(MethodHandles.Lookup lookup, String name, Class type, + Class declaringClass, Class fieldType) { + requireNonNull(lookup); + requireNonNull(name); + requireNonNull(type); + requireNonNull(declaringClass); + requireNonNull(fieldType); + if (type != VarHandle.class) { + throw new IllegalArgumentException(); + } + + try { + return lookup.findVarHandle(declaringClass, name, fieldType); + } + catch (ReflectiveOperationException e) { + throw mapLookupExceptionToError(e); + } + } + + /** + * Finds a {@link VarHandle} for a static field. + * + * @param lookup the lookup context describing the class performing the + * operation (normally stacked by the JVM) + * @param name the name of the field + * @param type the required result type (must be {@code Class}) + * @param declaringClass the class in which the field is declared + * @param fieldType the type of the field + * @return the {@link VarHandle} + * @throws IllegalAccessError if the declaring class or the field is not + * accessible to the class performing the operation + * @throws NoSuchFieldError if the specified field does not exist + * @throws IllegalArgumentException if the type is not {@code VarHandle} + */ + public static VarHandle staticFieldVarHandle(MethodHandles.Lookup lookup, String name, Class type, + Class declaringClass, Class fieldType) { + requireNonNull(lookup); + requireNonNull(name); + requireNonNull(type); + requireNonNull(declaringClass); + requireNonNull(fieldType); + if (type != VarHandle.class) { + throw new IllegalArgumentException(); + } + + try { + return lookup.findStaticVarHandle(declaringClass, name, fieldType); + } + catch (ReflectiveOperationException e) { + throw mapLookupExceptionToError(e); + } + } + + /** + * Finds a {@link VarHandle} for an array type. + * + * @param lookup the lookup context describing the class performing the + * operation (normally stacked by the JVM) + * @param name unused + * @param type the required result type (must be {@code Class}) + * @param arrayClass the type of the array + * @return the {@link VarHandle} + * @throws IllegalAccessError if the component type of the array is not + * accessible to the class performing the operation + * @throws IllegalArgumentException if the type is not {@code VarHandle} + */ + public static VarHandle arrayVarHandle(MethodHandles.Lookup lookup, String name, Class type, + Class arrayClass) { + requireNonNull(lookup); + requireNonNull(type); + requireNonNull(arrayClass); + if (type != VarHandle.class) { + throw new IllegalArgumentException(); + } + + return MethodHandles.arrayElementVarHandle(validateClassAccess(lookup, arrayClass)); + } + + private static Class validateClassAccess(MethodHandles.Lookup lookup, Class type) { + try { + lookup.accessClass(type); + return type; + } + catch (ReflectiveOperationException ex) { + throw mapLookupExceptionToError(ex); + } + } +} diff --git a/src/java.base/share/classes/java/lang/invoke/ConstantGroup.java b/src/java.base/share/classes/java/lang/invoke/ConstantGroup.java new file mode 100644 index 00000000000..7755b1dfe6a --- /dev/null +++ b/src/java.base/share/classes/java/lang/invoke/ConstantGroup.java @@ -0,0 +1,287 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package java.lang.invoke; + +import java.util.List; +import java.util.NoSuchElementException; +import java.util.function.IntFunction; + +/** + * An ordered sequence of constants, some of which may not yet + * be present. This type is used by {@link BootstrapCallInfo} + * to represent the sequence of bootstrap arguments associated + * with a bootstrap method, without forcing their immediate + * resolution. + *

            + * If you use the + * {@linkplain ConstantGroup#get(int) simple get method}, + * the constant will be resolved, if this has not already + * happened. An occasional side effect of resolution is a + * {@code LinkageError}, which happens if the system + * could not resolve the constant in question. + *

            + * In order to peek at a constant without necessarily + * resolving it, use the + * {@linkplain ConstantGroup#get(int,Object) + * non-throwing get method}. + * This method will never throw a resolution error. + * Instead, if the resolution would result in an error, + * or if the implementation elects not to attempt + * resolution at this point, then the method will + * return the user-supplied sentinel value. + *

            + * To iterate through the constants, resolving as you go, + * use the iterator provided on the {@link List}-typed view. + * If you supply a sentinel, resolution will be suppressed. + *

            + * Typically the constant is drawn from a constant pool entry + * in the virtual machine. Constant pool entries undergo a + * one-time state transition from unresolved to resolved, + * with a permanently recorded result. Usually that result + * is the desired constant value, but it may also be an error. + * In any case, the results displayed by a {@code ConstantGroup} + * are stable in the same way. If a query to a particular + * constant in a {@code ConstantGroup} throws an exception once, + * it will throw the same kind of exception forever after. + * If the query returns a constant value once, it will return + * the same value forever after. + *

            + * The only possible change in the status of a constant is + * from the unresolved to the resolved state, and that + * happens exactly once. A constant will never revert to + * an unlinked state. However, from the point of view of + * this interface, constants may appear to spontaneously + * resolve. This is so because constant pools are global + * structures shared across threads, and because + * prefetching of some constants may occur, there are no + * strong guarantees when the virtual machine may resolve + * constants. + *

            + * When choosing sentinel values, be aware that a constant + * pool which has {@code CONSTANT_Dynamic} entries + * can contain potentially any representable value, + * and arbitrary implementations of {@code ConstantGroup} + * are also free to produce arbitrary values. + * This means some obvious choices for sentinel values, + * such as {@code null}, may sometimes fail to distinguish + * a resolved from an unresolved constant in the group. + * The most reliable sentinel is a privately created object, + * or perhaps the {@code ConstantGroup} itself. + * @since 1.10 + */ +// public +interface ConstantGroup { + /// Access + + /** + * Returns the number of constants in this group. + * This value never changes, for any particular group. + * @return the number of constants in this group + */ + int size(); + + /** + * Returns the selected constant, resolving it if necessary. + * Throws a linkage error if resolution proves impossible. + * @param index which constant to select + * @return the selected constant + * @throws LinkageError if the selected constant needs resolution and cannot be resolved + */ + Object get(int index) throws LinkageError; + + /** + * Returns the selected constant, + * or the given sentinel value if there is none available. + * If the constant cannot be resolved, the sentinel will be returned. + * If the constant can (perhaps) be resolved, but has not yet been resolved, + * then the sentinel may be returned, at the implementation's discretion. + * To force resolution (and a possible exception), call {@link #get(int)}. + * @param index the selected constant + * @param ifNotPresent the sentinel value to return if the constant is not present + * @return the selected constant, if available, else the sentinel value + */ + Object get(int index, Object ifNotPresent); + + /** + * Returns an indication of whether a constant may be available. + * If it returns {@code true}, it will always return true in the future, + * and a call to {@link #get(int)} will never throw an exception. + *

            + * After a normal return from {@link #get(int)} or a present + * value is reported from {@link #get(int,Object)}, this method + * must always return true. + *

            + * If this method returns {@code false}, nothing in particular + * can be inferred, since the query only concerns the internal + * logic of the {@code ConstantGroup} object which ensures that + a successful * query to a constant will always remain successful. + * The only way to force a permanent decision about whether + * a constant is available is to call {@link #get(int)} and + * be ready for an exception if the constant is unavailable. + * @param index the selected constant + * @return {@code true} if the selected constant is known by + * this object to be present, {@code false} if it is known + * not to be present or + */ + boolean isPresent(int index); + + /// Views + + /** + * Create a view on this group as a {@link List} view. + * Any request for a constant through this view will + * force resolution. + * @return a {@code List} view on this group which will force resolution + */ + default List asList() { + return new AbstractConstantGroup.AsList(this, 0, size()); + } + + /** + * Create a view on this group as a {@link List} view. + * Any request for a constant through this view will + * return the given sentinel value, if the corresponding + * call to {@link #get(int,Object)} would do so. + * @param ifNotPresent the sentinel value to return if a constant is not present + * @return a {@code List} view on this group which will not force resolution + */ + default List asList(Object ifNotPresent) { + return new AbstractConstantGroup.AsList(this, 0, size(), ifNotPresent); + } + + /** + * Create a view on a sub-sequence of this group. + * @param start the index to begin the view + * @param end the index to end the view + * @return a view on the selected sub-group + */ + default ConstantGroup subGroup(int start, int end) { + return new AbstractConstantGroup.SubGroup(this, start, end); + } + + /// Bulk operations + + /** + * Copy a sequence of constant values into a given buffer. + * This is equivalent to {@code end-offset} separate calls to {@code get}, + * for each index in the range from {@code offset} up to but not including {@code end}. + * For the first constant that cannot be resolved, + * a {@code LinkageError} is thrown, but only after + * preceding constant value have been stored. + * @param start index of first constant to retrieve + * @param end limiting index of constants to retrieve + * @param buf array to receive the requested values + * @param pos position in the array to offset storing the values + * @return the limiting index, {@code end} + * @throws LinkageError if a constant cannot be resolved + */ + default int copyConstants(int start, int end, + Object[] buf, int pos) + throws LinkageError + { + int bufBase = pos - start; // buf[bufBase + i] = get(i) + for (int i = start; i < end; i++) { + buf[bufBase + i] = get(i); + } + return end; + } + + /** + * Copy a sequence of constant values into a given buffer. + * This is equivalent to {@code end-offset} separate calls to {@code get}, + * for each index in the range from {@code offset} up to but not including {@code end}. + * Any constants that cannot be resolved are replaced by the + * given sentinel value. + * @param start index of first constant to retrieve + * @param end limiting index of constants to retrieve + * @param buf array to receive the requested values + * @param pos position in the array to offset storing the values + * @param ifNotPresent sentinel value to store if a value is not available + * @return the limiting index, {@code end} + * @throws LinkageError if {@code resolve} is true and a constant cannot be resolved + */ + default int copyConstants(int start, int end, + Object[] buf, int pos, + Object ifNotPresent) { + int bufBase = pos - start; // buf[bufBase + i] = get(i) + for (int i = start; i < end; i++) { + buf[bufBase + i] = get(i, ifNotPresent); + } + return end; + } + + /** + * Make a new constant group with the given constants. + * The value of {@code ifNotPresent} may be any reference. + * If this value is encountered as an element of the + * {@code constants} list, the new constant group will + * regard that element of the list as logically missing. + * If the new constant group is called upon to resolve + * a missing element of the group, it will refer to the + * given {@code constantProvider}, by calling it on the + * index of the missing element. + * The {@code constantProvider} must be stable, in the sense + * that the outcome of calling it on the same index twice + * will produce equivalent results. + * If {@code constantProvider} is the null reference, then + * it will be treated as if it were a function which raises + * {@link NoSuchElementException}. + * @param constants the elements of this constant group + * @param ifNotPresent sentinel value provided instead of a missing constant + * @param constantProvider function to call when a missing constant is resolved + * @return a new constant group with the given constants and resolution behavior + */ + static ConstantGroup makeConstantGroup(List constants, + Object ifNotPresent, + IntFunction constantProvider) { + class Impl extends AbstractConstantGroup.WithCache { + Impl() { + super(constants.size()); + initializeCache(constants, ifNotPresent); + } + @Override + Object fillCache(int index) { + if (constantProvider == null) super.fillCache(index); + return constantProvider.apply(index); + } + } + return new Impl(); + } + + /** + * Make a new constant group with the given constant values. + * The constants will be copied from the given list into the + * new constant group, forcing resolution if any are missing. + * @param constants the constants of this constant group + * @return a new constant group with the given constants + */ + static ConstantGroup makeConstantGroup(List constants) { + final Object NP = AbstractConstantGroup.WithCache.NOT_PRESENT; + assert(!constants.contains(NP)); // secret value + return makeConstantGroup(constants, NP, null); + } + +} diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandle.java b/src/java.base/share/classes/java/lang/invoke/MethodHandle.java index 27c70b68964..ede758307d7 100644 --- a/src/java.base/share/classes/java/lang/invoke/MethodHandle.java +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandle.java @@ -1667,6 +1667,7 @@ assertEquals("[three, thee, tee]", asListFix.invoke((Object)argv).toString()); /** Craft a LambdaForm customized for this particular MethodHandle */ /*non-public*/ void customize() { + final LambdaForm form = this.form; if (form.customized == null) { LambdaForm newForm = form.customize(this); updateForm(newForm); diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java b/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java index 110369fb13e..21599ee94ae 100644 --- a/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java @@ -65,6 +65,12 @@ class MethodHandleNatives { static native void setCallSiteTargetNormal(CallSite site, MethodHandle target); static native void setCallSiteTargetVolatile(CallSite site, MethodHandle target); + static native void copyOutBootstrapArguments(Class caller, int[] indexInfo, + int start, int end, + Object[] buf, int pos, + boolean resolve, + Object ifNotAvailable); + /** Represents a context to track nmethod dependencies on CallSite instance target. */ static class CallSiteContext implements Runnable { //@Injected JVM_nmethodBucket* vmdependencies; @@ -228,6 +234,7 @@ class MethodHandleNatives { * The JVM is linking an invokedynamic instruction. Create a reified call site for it. */ static MemberName linkCallSite(Object callerObj, + int indexInCP, Object bootstrapMethodObj, Object nameObj, Object typeObj, Object staticArguments, @@ -268,9 +275,7 @@ class MethodHandleNatives { Object[] appendixResult) { Object bsmReference = bootstrapMethod.internalMemberName(); if (bsmReference == null) bsmReference = bootstrapMethod; - Object staticArglist = (staticArguments instanceof Object[] ? - java.util.Arrays.asList((Object[]) staticArguments) : - staticArguments); + String staticArglist = staticArglistForTrace(staticArguments); System.out.println("linkCallSite "+caller.getName()+" "+ bsmReference+" "+ name+type+"/"+staticArglist); @@ -280,11 +285,89 @@ class MethodHandleNatives { System.out.println("linkCallSite => "+res+" + "+appendixResult[0]); return res; } catch (Throwable ex) { + ex.printStackTrace(); // print now in case exception is swallowed System.out.println("linkCallSite => throw "+ex); throw ex; } } + // this implements the upcall from the JVM, MethodHandleNatives.linkDynamicConstant: + static Object linkDynamicConstant(Object callerObj, + int indexInCP, + Object bootstrapMethodObj, + Object nameObj, Object typeObj, + Object staticArguments) { + MethodHandle bootstrapMethod = (MethodHandle)bootstrapMethodObj; + Class caller = (Class)callerObj; + String name = nameObj.toString().intern(); + Class type = (Class)typeObj; + if (!TRACE_METHOD_LINKAGE) + return linkDynamicConstantImpl(caller, bootstrapMethod, name, type, staticArguments); + return linkDynamicConstantTracing(caller, bootstrapMethod, name, type, staticArguments); + } + + static Object linkDynamicConstantImpl(Class caller, + MethodHandle bootstrapMethod, + String name, Class type, + Object staticArguments) { + return ConstantBootstraps.makeConstant(bootstrapMethod, name, type, staticArguments, caller); + } + + private static String staticArglistForTrace(Object staticArguments) { + if (staticArguments instanceof Object[]) + return "BSA="+java.util.Arrays.asList((Object[]) staticArguments); + if (staticArguments instanceof int[]) + return "BSA@"+java.util.Arrays.toString((int[]) staticArguments); + if (staticArguments == null) + return "BSA0=null"; + return "BSA1="+staticArguments; + } + + // Tracing logic: + static Object linkDynamicConstantTracing(Class caller, + MethodHandle bootstrapMethod, + String name, Class type, + Object staticArguments) { + Object bsmReference = bootstrapMethod.internalMemberName(); + if (bsmReference == null) bsmReference = bootstrapMethod; + String staticArglist = staticArglistForTrace(staticArguments); + System.out.println("linkDynamicConstant "+caller.getName()+" "+ + bsmReference+" "+ + name+type+"/"+staticArglist); + try { + Object res = linkDynamicConstantImpl(caller, bootstrapMethod, name, type, staticArguments); + System.out.println("linkDynamicConstantImpl => "+res); + return res; + } catch (Throwable ex) { + ex.printStackTrace(); // print now in case exception is swallowed + System.out.println("linkDynamicConstant => throw "+ex); + throw ex; + } + } + + /** The JVM is requesting pull-mode bootstrap when it provides + * a tuple of the form int[]{ argc, vmindex }. + * The BSM is expected to call back to the JVM using the caller + * class and vmindex to resolve the static arguments. + */ + static boolean staticArgumentsPulled(Object staticArguments) { + return staticArguments instanceof int[]; + } + + /** A BSM runs in pull-mode if and only if its sole arguments + * are (Lookup, BootstrapCallInfo), or can be converted pairwise + * to those types, and it is not of variable arity. + * Excluding error cases, we can just test that the arity is a constant 2. + * + * NOTE: This method currently returns false, since pulling is not currently + * exposed to a BSM. When pull mode is supported the method block will be + * replaced with currently commented out code. + */ + static boolean isPullModeBSM(MethodHandle bsm) { + return false; +// return bsm.type().parameterCount() == 2 && !bsm.isVarargsCollector(); + } + /** * The JVM wants a pointer to a MethodType. Oblige it by finding or creating one. */ @@ -506,34 +589,43 @@ class MethodHandleNatives { Lookup lookup = IMPL_LOOKUP.in(callerClass); assert(refKindIsValid(refKind)); return lookup.linkMethodHandleConstant((byte) refKind, defc, name, type); - } catch (IllegalAccessException ex) { + } catch (ReflectiveOperationException ex) { + throw mapLookupExceptionToError(ex); + } + } + + /** + * Map a reflective exception to a linkage error. + */ + static LinkageError mapLookupExceptionToError(ReflectiveOperationException ex) { + LinkageError err; + if (ex instanceof IllegalAccessException) { Throwable cause = ex.getCause(); if (cause instanceof AbstractMethodError) { - throw (AbstractMethodError) cause; + return (AbstractMethodError) cause; } else { - Error err = new IllegalAccessError(ex.getMessage()); - throw initCauseFrom(err, ex); + err = new IllegalAccessError(ex.getMessage()); } - } catch (NoSuchMethodException ex) { - Error err = new NoSuchMethodError(ex.getMessage()); - throw initCauseFrom(err, ex); - } catch (NoSuchFieldException ex) { - Error err = new NoSuchFieldError(ex.getMessage()); - throw initCauseFrom(err, ex); - } catch (ReflectiveOperationException ex) { - Error err = new IncompatibleClassChangeError(); - throw initCauseFrom(err, ex); + } else if (ex instanceof NoSuchMethodException) { + err = new NoSuchMethodError(ex.getMessage()); + } else if (ex instanceof NoSuchFieldException) { + err = new NoSuchFieldError(ex.getMessage()); + } else { + err = new IncompatibleClassChangeError(); } + return initCauseFrom(err, ex); } /** * Use best possible cause for err.initCause(), substituting the * cause for err itself if the cause has the same (or better) type. */ - private static Error initCauseFrom(Error err, Exception ex) { + static E initCauseFrom(E err, Exception ex) { Throwable th = ex.getCause(); - if (err.getClass().isInstance(th)) - return (Error) th; + @SuppressWarnings("unchecked") + final Class Eclass = (Class) err.getClass(); + if (Eclass.isInstance(th)) + return Eclass.cast(th); err.initCause(th == null ? ex : th); return err; } diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandleStatics.java b/src/java.base/share/classes/java/lang/invoke/MethodHandleStatics.java index f05cdda8166..833f763d134 100644 --- a/src/java.base/share/classes/java/lang/invoke/MethodHandleStatics.java +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleStatics.java @@ -142,4 +142,13 @@ import java.util.Properties; if (obj != null || obj2 != null) message = message + ": " + obj + ", " + obj2; return message; } + /*non-public*/ static void rangeCheck2(int start, int end, int size) { + if (0 > start || start > end || end > size) + throw new IndexOutOfBoundsException(start+".."+end); + } + /*non-public*/ static int rangeCheck1(int index, int size) { + if (0 > index || index >= size) + throw new IndexOutOfBoundsException(index); + return index; + } } diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java index bad45f6e336..e9f1061d9be 100644 --- a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java @@ -98,12 +98,6 @@ public class MethodHandles { *

            * This method is caller sensitive, which means that it may return different * values to different callers. - *

            - * For any given caller class {@code C}, the lookup object returned by this call - * has equivalent capabilities to any lookup object - * supplied by the JVM to the bootstrap method of an - * invokedynamic instruction - * executing in the same caller class {@code C}. * @return a lookup object for the caller of this method, with private access */ @CallerSensitive @@ -3766,6 +3760,7 @@ assertEquals("xy", h3.invoke("x", "y", 1, "a", "b", "c")); * specified in the elements of the {@code filters} array. * The first element of the filter array corresponds to the {@code pos} * argument of the target, and so on in sequence. + * The filter functions are invoked in left to right order. *

            * Null arguments in the array are treated as identity functions, * and the corresponding arguments left unchanged. @@ -3836,11 +3831,12 @@ assertEquals("XY", (String) f2.invokeExact("x", "y")); // XY MethodHandle filterArguments(MethodHandle target, int pos, MethodHandle... filters) { filterArgumentsCheckArity(target, pos, filters); MethodHandle adapter = target; - int curPos = pos-1; // pre-incremented - for (MethodHandle filter : filters) { - curPos += 1; + // process filters in reverse order so that the invocation of + // the resulting adapter will invoke the filters in left-to-right order + for (int i = filters.length - 1; i >= 0; --i) { + MethodHandle filter = filters[i]; if (filter == null) continue; // ignore null elements of filters - adapter = filterArgument(adapter, curPos, filter); + adapter = filterArgument(adapter, pos + i, filter); } return adapter; } diff --git a/src/java.base/share/classes/java/lang/invoke/package-info.java b/src/java.base/share/classes/java/lang/invoke/package-info.java index 3de98385a15..48c24f8a4cb 100644 --- a/src/java.base/share/classes/java/lang/invoke/package-info.java +++ b/src/java.base/share/classes/java/lang/invoke/package-info.java @@ -24,13 +24,12 @@ */ /** - * The {@code java.lang.invoke} package contains dynamic language support provided directly by - * the Java core class libraries and virtual machine. + * The {@code java.lang.invoke} package provides low-level primitives for interacting + * with the Java Virtual Machine. * *

            - * As described in the Java Virtual Machine Specification, - * certain types in this package have special relations to dynamic - * language support in the virtual machine: + * As described in the Java Virtual Machine Specification, certain types in this package + * are given special treatment by the virtual machine: *

              *
            • The classes {@link java.lang.invoke.MethodHandle MethodHandle} * {@link java.lang.invoke.VarHandle VarHandle} contain @@ -40,77 +39,106 @@ *
            • * *
            • The JVM bytecode format supports immediate constants of - * the classes {@link java.lang.invoke.MethodHandle MethodHandle} and {@link java.lang.invoke.MethodType MethodType}. + * the classes {@link java.lang.invoke.MethodHandle MethodHandle} and + * {@link java.lang.invoke.MethodType MethodType}. + *
            • + * + *
            • The {@code invokedynamic} instruction makes use of bootstrap {@code MethodHandle} + * constants to dynamically resolve {@code CallSite} objects for custom method invocation + * behavior. + *
            • + * + *
            • The {@code ldc} instruction makes use of bootstrap {@code MethodHandle} constants + * to dynamically resolve custom constant values. *
            • *
            * - *

            Summary of relevant Java Virtual Machine changes

            + *

            Dynamic resolution of call sites and constants

            * The following low-level information summarizes relevant parts of the * Java Virtual Machine specification. For full details, please see the * current version of that specification. * - * Each occurrence of an {@code invokedynamic} instruction is called a dynamic call site. - *

            {@code invokedynamic} instructions

            - * A dynamic call site is originally in an unlinked state. In this state, there is - * no target method for the call site to invoke. + *

            Dynamically-computed call sites

            + * An {@code invokedynamic} instruction is originally in an unlinked state. + * In this state, there is no target method for the instruction to invoke. *

            - * Before the JVM can execute a dynamic call site (an {@code invokedynamic} instruction), - * the call site must first be linked. + * Before the JVM can execute an {@code invokedynamic} instruction, + * the instruction must first be linked. * Linking is accomplished by calling a bootstrap method - * which is given the static information content of the call site, - * and which must produce a {@link java.lang.invoke.MethodHandle method handle} - * that gives the behavior of the call site. + * which is given the static information content of the call, + * and which must produce a {@link java.lang.invoke.CallSite} + * that gives the behavior of the invocation. *

            * Each {@code invokedynamic} instruction statically specifies its own * bootstrap method as a constant pool reference. - * The constant pool reference also specifies the call site's name and type descriptor, - * just like {@code invokevirtual} and the other invoke instructions. + * The constant pool reference also specifies the invocation's name and method type descriptor, + * just like {@code invokestatic} and the other invoke instructions. + * + *

            Dynamically-computed constants

            + * The constant pool may contain constants tagged {@code CONSTANT_Dynamic}, + * equipped with bootstrap methods which perform their resolution. + * Such a dynamic constant is originally in an unresolved state. + * Before the JVM can use a dynamically-computed constant, it must first be resolved. + * Dynamically-computed constant resolution is accomplished by calling a bootstrap method + * which is given the static information content of the constant, + * and which must produce a value of the constant's statically declared type. *

            - * Linking starts with resolving the constant pool entry for the - * bootstrap method, and resolving a {@link java.lang.invoke.MethodType MethodType} object for - * the type descriptor of the dynamic call site. - * This resolution process may trigger class loading. - * It may therefore throw an error if a class fails to load. - * This error becomes the abnormal termination of the dynamic - * call site execution. - * Linkage does not trigger class initialization. - *

            - * The bootstrap method is invoked on at least three values: + * Each dynamically-computed constant statically specifies its own + * bootstrap method as a constant pool reference. + * The constant pool reference also specifies the constant's name and field type descriptor, + * just like {@code getstatic} and the other field reference instructions. + * (Roughly speaking, a dynamically-computed constant is to a dynamically-computed call site + * as a {@code CONSTANT_Fieldref} is to a {@code CONSTANT_Methodref}.) + * + *

            Execution of bootstrap methods

            + * Resolving a dynamically-computed call site or constant + * starts with resolving constants from the constant pool for the + * following items: *
              - *
            • a {@code MethodHandles.Lookup}, a lookup object on the caller class - * in which dynamic call site occurs
            • - *
            • a {@code String}, the method name mentioned in the call site
            • - *
            • a {@code MethodType}, the resolved type descriptor of the call
            • - *
            • optionally, any number of additional static arguments taken from the constant pool
            • + *
            • the bootstrap method, a {@code CONSTANT_MethodHandle}
            • + *
            • the {@code Class} or {@code MethodType} derived from + * type component of the {@code CONSTANT_NameAndType} descriptor
            • + *
            • static arguments, if any (note that static arguments can themselves be + * dynamically-computed constants)
            • *
            *

            - * In all cases, bootstrap method invocation is as if by - * {@link java.lang.invoke.MethodHandle#invokeWithArguments MethodHandle.invokeWithArguments}, - * (This is also equivalent to - * {@linkplain java.lang.invoke.MethodHandle#invoke generic invocation} - * if the number of arguments is small enough.) + * The bootstrap method is then invoked, as if by + * {@link java.lang.invoke.MethodHandle#invoke MethodHandle.invoke}, + * with the following arguments: + *

              + *
            • a {@code MethodHandles.Lookup}, which is a lookup object on the caller class + * in which dynamically-computed constant or call site occurs
            • + *
            • a {@code String}, the name mentioned in the {@code CONSTANT_NameAndType}
            • + *
            • a {@code MethodType} or {@code Class}, the resolved type descriptor of the {@code CONSTANT_NameAndType}
            • + *
            • a {@code Class}, the resolved type descriptor of the constant, if it is a dynamic constant
            • + *
            • the additional resolved static arguments, if any
            • + *
            *

            - * For an {@code invokedynamic} instruction, the - * returned result must be convertible to a non-null reference to a + * For a dynamically-computed call site, the returned result must be a non-null reference to a * {@link java.lang.invoke.CallSite CallSite}. - * If the returned result cannot be converted to the expected type, - * {@link java.lang.BootstrapMethodError BootstrapMethodError} is thrown. * The type of the call site's target must be exactly equal to the type - * derived from the dynamic call site's type descriptor and passed to - * the bootstrap method, otherwise a {@code BootstrapMethodError} is thrown. - * On success the call site then becomes permanently linked to the dynamic call - * site. + * derived from the invocation's type descriptor and passed to + * the bootstrap method. If these conditions are not met, a {@code BootstrapMethodError} is thrown. + * On success the call site then becomes permanently linked to the {@code invokedynamic} + * instruction. *

            - * If an exception, {@code E} say, occurs when linking the call site then the - * linkage fails and terminates abnormally. {@code E} is rethrown if the type of + * For a dynamically-computed constant, the result of the bootstrap method is cached + * as the resolved constant value. + *

            + * If an exception, {@code E} say, occurs during execution of the bootstrap method, then + * resolution fails and terminates abnormally. {@code E} is rethrown if the type of * {@code E} is {@code Error} or a subclass, otherwise a * {@code BootstrapMethodError} that wraps {@code E} is thrown. - * If this happens, the same {@code Error} or subclass will the thrown for all - * subsequent attempts to execute the dynamic call site. - *

            timing of linkage

            - * A dynamic call site is linked just before its first execution. + * If this happens, the same error will be thrown for all + * subsequent attempts to execute the {@code invokedynamic} instruction or load the + * dynamically-computed constant. + * + *

            Timing of resolution

            + * An {@code invokedynamic} instruction is linked just before its first execution. + * A dynamically-computed constant is resolved just before the first time it is used + * (by pushing it on the stack or linking it as a bootstrap method parameter). * The bootstrap method call implementing the linkage occurs within - * a thread that is attempting a first execution. + * a thread that is attempting a first execution or first use. *

            * If there are several such threads, the bootstrap method may be * invoked in several threads concurrently. @@ -119,7 +147,7 @@ * In any case, every {@code invokedynamic} instruction is either * unlinked or linked to a unique {@code CallSite} object. *

            - * In an application which requires dynamic call sites with individually + * In an application which requires {@code invokedynamic} instructions with individually * mutable behaviors, their bootstrap methods should produce distinct * {@link java.lang.invoke.CallSite CallSite} objects, one for each linkage request. * Alternatively, an application can link a single {@code CallSite} object @@ -127,53 +155,46 @@ * a change to the target method will become visible at each of * the instructions. *

            - * If several threads simultaneously execute a bootstrap method for a single dynamic - * call site, the JVM must choose one {@code CallSite} object and install it visibly to + * If several threads simultaneously execute a bootstrap method for a single dynamically-computed + * call site or constant, the JVM must choose one bootstrap method result and install it visibly to * all threads. Any other bootstrap method calls are allowed to complete, but their - * results are ignored, and their dynamic call site invocations proceed with the originally - * chosen target object. + * results are ignored. *

            * Discussion: - * These rules do not enable the JVM to duplicate dynamic call sites, + * These rules do not enable the JVM to share call sites, * or to issue “causeless” bootstrap method calls. - * Every dynamic call site transitions at most once from unlinked to linked, + * Every {@code invokedynamic} instruction transitions at most once from unlinked to linked, * just before its first invocation. * There is no way to undo the effect of a completed bootstrap method call. * - *

            types of bootstrap methods

            - * As long as each bootstrap method can be correctly invoked - * by {@code MethodHandle.invoke}, its detailed type is arbitrary. + *

            Types of bootstrap methods

            + * For a dynamically-computed call site, the bootstrap method is invoked with parameter + * types {@code MethodHandles.Lookup}, {@code String}, {@code MethodType}, and the types + * of any static arguments; the return type is {@code CallSite}. For a + * dynamically-computed constant, the bootstrap method is invoked with parameter types + * {@code MethodHandles.Lookup}, {@code String}, {@code Class}, and the types of any + * static arguments; the return type is the type represented by the {@code Class}. + * + * Because {@link java.lang.invoke.MethodHandle#invoke MethodHandle.invoke} allows for + * adaptations between the invoked method type and the method handle's method type, + * there is flexibility in the declaration of the bootstrap method. * For example, the first argument could be {@code Object} * instead of {@code MethodHandles.Lookup}, and the return type * could also be {@code Object} instead of {@code CallSite}. * (Note that the types and number of the stacked arguments limit * the legal kinds of bootstrap methods to appropriately typed - * static methods and constructors of {@code CallSite} subclasses.) + * static methods and constructors.) *

            - * If a given {@code invokedynamic} instruction specifies no static arguments, - * the instruction's bootstrap method will be invoked on three arguments, - * conveying the instruction's caller class, name, and method type. - * If the {@code invokedynamic} instruction specifies one or more static arguments, - * those values will be passed as additional arguments to the method handle. - * (Note that because there is a limit of 255 arguments to any method, - * at most 251 extra arguments can be supplied to a non-varargs bootstrap method, - * since the bootstrap method - * handle itself and its first three arguments must also be stacked.) - * The bootstrap method will be invoked as if by {@code MethodHandle.invokeWithArguments}. - * A variable-arity bootstrap method can accept thousands of static arguments, - * subject only by limits imposed by the class-file format. - *

            - * The normal argument conversion rules for {@code MethodHandle.invoke} apply to all stacked arguments. - * For example, if a pushed value is a primitive type, it may be converted to a reference by boxing conversion. + * If a pushed value is a primitive type, it may be converted to a reference by boxing conversion. * If the bootstrap method is a variable arity method (its modifier bit {@code 0x0080} is set), * then some or all of the arguments specified here may be collected into a trailing array parameter. * (This is not a special rule, but rather a useful consequence of the interaction * between {@code CONSTANT_MethodHandle} constants, the modifier bit for variable arity methods, * and the {@link java.lang.invoke.MethodHandle#asVarargsCollector asVarargsCollector} transformation.) *

            - * Given these rules, here are examples of legal bootstrap method declarations, - * given various numbers {@code N} of extra arguments. + * Given these rules, here are examples of legal bootstrap method declarations for + * dynamically-computed call sites, given various numbers {@code N} of extra arguments. * The first row (marked {@code *}) will work for any number of extra arguments. *

            Version
            Date @@ -1980,7 +2004,7 @@ typedef struct { - +
            @@ -1993,18 +2017,22 @@ typedef struct {
            - - - + + + + + - - - + + + + + +
            java.class.versionJava class format version number
            java.class.pathJava class path
            Java class path (refer to + * {@link ClassLoader#getSystemClassLoader()} for details)
            java.library.pathList of paths to search when loading libraries
            java.io.tmpdir
            * @@ -208,28 +229,27 @@ * {@code String}. * The other examples work with all types of extra arguments. *

            - * As noted above, the actual method type of the bootstrap method can vary. - * For example, the fourth argument could be {@code MethodHandle}, - * if that is the type of the corresponding constant in - * the {@code CONSTANT_InvokeDynamic} entry. - * In that case, the {@code MethodHandle.invoke} call will pass the extra method handle - * constant as an {@code Object}, but the type matching machinery of {@code MethodHandle.invoke} - * will cast the reference back to {@code MethodHandle} before invoking the bootstrap method. - * (If a string constant were passed instead, by badly generated code, that cast would then fail, - * resulting in a {@code BootstrapMethodError}.) - *

            - * Note that, as a consequence of the above rules, the bootstrap method may accept a primitive - * argument, if it can be represented by a constant pool entry. + * Since dynamically-computed constants can be provided as static arguments to bootstrap + * methods, there are no limitations on the types of bootstrap arguments. * However, arguments of type {@code boolean}, {@code byte}, {@code short}, or {@code char} - * cannot be created for bootstrap methods, since such constants cannot be directly - * represented in the constant pool, and the invocation of the bootstrap method will + * cannot be directly supplied by {@code CONSTANT_Integer} + * constant pool entries, since the {@code asType} conversions do * not perform the necessary narrowing primitive conversions. *

            - * Extra bootstrap method arguments are intended to allow language implementors - * to safely and compactly encode metadata. - * In principle, the name and extra arguments are redundant, - * since each call site could be given its own unique bootstrap method. - * Such a practice would be likely to produce large class files and constant pools. + * In the above examples, the return type is always {@code CallSite}, + * but that is not a necessary feature of bootstrap methods. + * In the case of a dynamically-computed call site, the only requirement is that + * the return type of the bootstrap method must be convertible + * (using the {@code asType} conversions) to {@code CallSite}, which + * means the bootstrap method return type might be {@code Object} or + * {@code ConstantCallSite}. + * In the case of a dynamically-resolved constant, the return type of the bootstrap + * method must be convertible to the type of the constant, as + * represented by its field type descriptor. For example, if the + * dynamic constant has a field type descriptor of {@code "C"} + * ({@code char}) then the bootstrap method return type could be + * {@code Object}, {@code Character}, or {@code char}, but not + * {@code int} or {@code Integer}. * * @author John Rose, JSR 292 EG * @since 1.7 diff --git a/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java b/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java index 7a4ace8dd6b..626c5200606 100644 --- a/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java +++ b/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java @@ -2521,7 +2521,7 @@ public class ModuleDescriptor * the {@code packageFinder} throws an {@link UncheckedIOException} then * {@link IOException} cause will be re-thrown.

            * - *

            The module descriptor is read from the buffer stating at index + *

            The module descriptor is read from the buffer starting at index * {@code p}, where {@code p} is the buffer's {@link ByteBuffer#position() * position} when this method is invoked. Upon return the buffer's position * will be equal to {@code p + n} where {@code n} is the number of bytes diff --git a/src/java.base/share/classes/java/lang/ref/Reference.java b/src/java.base/share/classes/java/lang/ref/Reference.java index 5125e7cb553..2ead79fb636 100644 --- a/src/java.base/share/classes/java/lang/ref/Reference.java +++ b/src/java.base/share/classes/java/lang/ref/Reference.java @@ -140,14 +140,6 @@ public abstract class Reference { } } - /* - * system property to disable clearing before enqueuing. - */ - private static final class ClearBeforeEnqueue { - static final boolean DISABLE = - Boolean.getBoolean("jdk.lang.ref.disableClearBeforeEnqueue"); - } - /* * Atomically get and clear (set to null) the VM's pending list. */ @@ -299,8 +291,7 @@ public abstract class Reference { * it was not registered with a queue when it was created */ public boolean enqueue() { - if (!ClearBeforeEnqueue.DISABLE) - this.referent = null; + this.referent = null; return this.queue.enqueue(this); } diff --git a/src/java.base/share/classes/java/net/AbstractPlainDatagramSocketImpl.java b/src/java.base/share/classes/java/net/AbstractPlainDatagramSocketImpl.java index d4414560fe6..2a7f5ead5a7 100644 --- a/src/java.base/share/classes/java/net/AbstractPlainDatagramSocketImpl.java +++ b/src/java.base/share/classes/java/net/AbstractPlainDatagramSocketImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,11 +26,11 @@ package java.net; import java.io.FileDescriptor; import java.io.IOException; -import java.security.AccessController; -import sun.net.ResourceManager; -import java.util.Set; -import java.util.HashSet; import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +import sun.net.ResourceManager; import sun.security.action.GetPropertyAction; /** @@ -115,6 +115,7 @@ abstract class AbstractPlainDatagramSocketImpl extends DatagramSocketImpl fd = new FileDescriptor(); try { datagramSocketCreate(); + SocketCleanable.register(fd); } catch (SocketException ioe) { ResourceManager.afterUdpClose(); fd = null; @@ -265,6 +266,7 @@ abstract class AbstractPlainDatagramSocketImpl extends DatagramSocketImpl */ protected void close() { if (fd != null) { + SocketCleanable.unregister(fd); datagramSocketClose(); ResourceManager.afterUdpClose(); fd = null; @@ -275,11 +277,6 @@ abstract class AbstractPlainDatagramSocketImpl extends DatagramSocketImpl return (fd == null) ? true : false; } - @SuppressWarnings("deprecation") - protected void finalize() { - close(); - } - /** * set a value - since we only support (setting) binary options * here, o must be a Boolean diff --git a/src/java.base/share/classes/java/net/AbstractPlainSocketImpl.java b/src/java.base/share/classes/java/net/AbstractPlainSocketImpl.java index e66bbdc61aa..f66eda1c721 100644 --- a/src/java.base/share/classes/java/net/AbstractPlainSocketImpl.java +++ b/src/java.base/share/classes/java/net/AbstractPlainSocketImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,17 +25,18 @@ package java.net; +import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.io.FileDescriptor; + +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; import sun.net.ConnectionResetException; import sun.net.NetHooks; import sun.net.ResourceManager; -import java.util.Set; -import java.util.HashSet; -import java.util.Collections; /** * Default Socket Implementation. This implementation does @@ -136,6 +137,7 @@ abstract class AbstractPlainSocketImpl extends SocketImpl fd = new FileDescriptor(); try { socketCreate(false); + SocketCleanable.register(fd); } catch (IOException ioe) { ResourceManager.afterUdpClose(); fd = null; @@ -144,6 +146,7 @@ abstract class AbstractPlainSocketImpl extends SocketImpl } else { fd = new FileDescriptor(); socketCreate(true); + SocketCleanable.register(fd); } if (socket != null) socket.setCreated(); @@ -643,14 +646,6 @@ abstract class AbstractPlainSocketImpl extends SocketImpl socketSendUrgentData (data); } - /** - * Cleans up if the user forgets to close it. - */ - @SuppressWarnings("deprecation") - protected void finalize() throws IOException { - close(); - } - /* * "Acquires" and returns the FileDescriptor for this impl * @@ -748,6 +743,7 @@ abstract class AbstractPlainSocketImpl extends SocketImpl * Close the socket (and release the file descriptor). */ protected void socketClose() throws IOException { + SocketCleanable.unregister(fd); socketClose0(false); } diff --git a/src/java.base/share/classes/java/net/Inet6Address.java b/src/java.base/share/classes/java/net/Inet6Address.java index 0b612798f7c..8e1b0858bd4 100644 --- a/src/java.base/share/classes/java/net/Inet6Address.java +++ b/src/java.base/share/classes/java/net/Inet6Address.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -595,7 +595,7 @@ class Inet6Address extends InetAddress { } ObjectInputStream.GetField gf = s.readFields(); - byte[] ipaddress = (byte[])gf.get("ipaddress", null); + byte[] ipaddress = (byte[])gf.get("ipaddress", new byte[0]); int scope_id = gf.get("scope_id", -1); boolean scope_id_set = gf.get("scope_id_set", false); boolean scope_ifname_set = gf.get("scope_ifname_set", false); diff --git a/src/java.base/share/classes/java/net/InetSocketAddress.java b/src/java.base/share/classes/java/net/InetSocketAddress.java index 52517bd5ff9..bc37087a833 100644 --- a/src/java.base/share/classes/java/net/InetSocketAddress.java +++ b/src/java.base/share/classes/java/net/InetSocketAddress.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -317,10 +317,9 @@ public class InetSocketAddress } /** - * * Gets the {@code InetAddress}. * - * @return the InetAdress or {@code null} if it is unresolved. + * @return the InetAddress or {@code null} if it is unresolved. */ public final InetAddress getAddress() { return holder.getAddress(); diff --git a/src/java.base/share/classes/java/net/ServerSocket.java b/src/java.base/share/classes/java/net/ServerSocket.java index 256c9a6e2ee..92a8b8ca8fd 100644 --- a/src/java.base/share/classes/java/net/ServerSocket.java +++ b/src/java.base/share/classes/java/net/ServerSocket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -549,6 +549,7 @@ class ServerSocket implements java.io.Closeable { si.address = new InetAddress(); si.fd = new FileDescriptor(); getImpl().accept(si); + SocketCleanable.register(si.fd); // raw fd has been set SecurityManager security = System.getSecurityManager(); if (security != null) { diff --git a/src/java.base/share/classes/java/net/SocketCleanable.java b/src/java.base/share/classes/java/net/SocketCleanable.java new file mode 100644 index 00000000000..d8b917aac48 --- /dev/null +++ b/src/java.base/share/classes/java/net/SocketCleanable.java @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package java.net; + +import jdk.internal.misc.JavaIOFileDescriptorAccess; +import jdk.internal.misc.SharedSecrets; +import jdk.internal.ref.CleanerFactory; +import jdk.internal.ref.PhantomCleanable; + +import java.io.FileDescriptor; +import java.io.IOException; +import java.io.UncheckedIOException; +import java.lang.ref.Cleaner; + + +/** + * Cleanup for a socket/datagramsocket FileDescriptor when it becomes phantom reachable. + * Create a cleanup if the raw fd != -1. Windows closes sockets using the fd. + * Subclassed from {@code PhantomCleanable} so that {@code clear} can be + * called to disable the cleanup when the socket fd is closed by any means + * other than calling {@link FileDescriptor#close}. + * Otherwise, it would incorrectly close the handle or fd after it has been reused. + */ +final class SocketCleanable extends PhantomCleanable { + + // Access to FileDescriptor internals + private static final JavaIOFileDescriptorAccess fdAccess = + SharedSecrets.getJavaIOFileDescriptorAccess(); + + // Native function to call NET_SocketClose(fd) + private static native void cleanupClose0(int fd) throws IOException; + + // The raw fd to close + private final int fd; + + /** + * Register a socket specific Cleanable with the FileDescriptor + * if the FileDescriptor is non-null and the raw fd is != -1. + * + * @param fdo the FileDescriptor; may be null + */ + static void register(FileDescriptor fdo) { + if (fdo != null) { + int fd = fdAccess.get(fdo); + if (fd != -1) { + fdAccess.registerCleanup(fdo, + new SocketCleanable(fdo, CleanerFactory.cleaner(), fd)); + } + } + } + + /** + * Unregister a Cleanable from the FileDescriptor. + * @param fdo the FileDescriptor; may be null + */ + static void unregister(FileDescriptor fdo) { + if (fdo != null) { + fdAccess.unregisterCleanup(fdo); + } + } + + /** + * Constructor for a phantom cleanable reference. + * + * @param obj the object to monitor + * @param cleaner the cleaner + * @param fd file descriptor to close + */ + private SocketCleanable(Object obj, Cleaner cleaner, int fd) { + super(obj, cleaner); + this.fd = fd; + } + + /** + * Close the native handle or fd. + */ + @Override + protected void performCleanup() { + try { + cleanupClose0(fd); + } catch (IOException ioe) { + throw new UncheckedIOException("close", ioe); + } + } +} diff --git a/src/java.base/share/classes/java/nio/Bits.java b/src/java.base/share/classes/java/nio/Bits.java index dfe6a8f13a7..fff84e9e58d 100644 --- a/src/java.base/share/classes/java/nio/Bits.java +++ b/src/java.base/share/classes/java/nio/Bits.java @@ -63,38 +63,38 @@ class Bits { // package-private // -- Unsafe access -- - private static final Unsafe unsafe = Unsafe.getUnsafe(); + private static final Unsafe UNSAFE = Unsafe.getUnsafe(); static Unsafe unsafe() { - return unsafe; + return UNSAFE; } // -- Processor and memory-system properties -- - private static final ByteOrder byteOrder - = unsafe.isBigEndian() ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN; + private static final ByteOrder BYTE_ORDER + = UNSAFE.isBigEndian() ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN; static ByteOrder byteOrder() { - return byteOrder; + return BYTE_ORDER; } - private static int pageSize = -1; + private static int PAGE_SIZE = -1; static int pageSize() { - if (pageSize == -1) - pageSize = unsafe().pageSize(); - return pageSize; + if (PAGE_SIZE == -1) + PAGE_SIZE = unsafe().pageSize(); + return PAGE_SIZE; } static int pageCount(long size) { return (int)(size + (long)pageSize() - 1L) / pageSize(); } - private static boolean unaligned = unsafe.unalignedAccess(); + private static boolean UNALIGNED = UNSAFE.unalignedAccess(); static boolean unaligned() { - return unaligned; + return UNALIGNED; } @@ -103,11 +103,11 @@ class Bits { // package-private // A user-settable upper limit on the maximum amount of allocatable // direct buffer memory. This value may be changed during VM // initialization if it is launched with "-XX:MaxDirectMemorySize=". - private static volatile long maxMemory = VM.maxDirectMemory(); - private static final AtomicLong reservedMemory = new AtomicLong(); - private static final AtomicLong totalCapacity = new AtomicLong(); - private static final AtomicLong count = new AtomicLong(); - private static volatile boolean memoryLimitSet; + private static volatile long MAX_MEMORY = VM.maxDirectMemory(); + private static final AtomicLong RESERVED_MEMORY = new AtomicLong(); + private static final AtomicLong TOTAL_CAPACITY = new AtomicLong(); + private static final AtomicLong COUNT = new AtomicLong(); + private static volatile boolean MEMORY_LIMIT_SET; // max. number of sleeps during try-reserving with exponentially // increasing delay before throwing OutOfMemoryError: @@ -120,9 +120,9 @@ class Bits { // package-private // which a process may access. All sizes are specified in bytes. static void reserveMemory(long size, int cap) { - if (!memoryLimitSet && VM.initLevel() >= 1) { - maxMemory = VM.maxDirectMemory(); - memoryLimitSet = true; + if (!MEMORY_LIMIT_SET && VM.initLevel() >= 1) { + MAX_MEMORY = VM.maxDirectMemory(); + MEMORY_LIMIT_SET = true; } // optimist! @@ -200,10 +200,10 @@ class Bits { // package-private // actual memory usage, which will differ when buffers are page // aligned. long totalCap; - while (cap <= maxMemory - (totalCap = totalCapacity.get())) { - if (totalCapacity.compareAndSet(totalCap, totalCap + cap)) { - reservedMemory.addAndGet(size); - count.incrementAndGet(); + while (cap <= MAX_MEMORY - (totalCap = TOTAL_CAPACITY.get())) { + if (TOTAL_CAPACITY.compareAndSet(totalCap, totalCap + cap)) { + RESERVED_MEMORY.addAndGet(size); + COUNT.incrementAndGet(); return true; } } @@ -213,9 +213,9 @@ class Bits { // package-private static void unreserveMemory(long size, int cap) { - long cnt = count.decrementAndGet(); - long reservedMem = reservedMemory.addAndGet(-size); - long totalCap = totalCapacity.addAndGet(-cap); + long cnt = COUNT.decrementAndGet(); + long reservedMem = RESERVED_MEMORY.addAndGet(-size); + long totalCap = TOTAL_CAPACITY.addAndGet(-cap); assert cnt >= 0 && reservedMem >= 0 && totalCap >= 0; } @@ -234,15 +234,15 @@ class Bits { // package-private } @Override public long getCount() { - return Bits.count.get(); + return Bits.COUNT.get(); } @Override public long getTotalCapacity() { - return Bits.totalCapacity.get(); + return Bits.TOTAL_CAPACITY.get(); } @Override public long getMemoryUsed() { - return Bits.reservedMemory.get(); + return Bits.RESERVED_MEMORY.get(); } }; } diff --git a/src/java.base/share/classes/java/nio/Buffer.java b/src/java.base/share/classes/java/nio/Buffer.java index 1f6bef17960..1217ca78a74 100644 --- a/src/java.base/share/classes/java/nio/Buffer.java +++ b/src/java.base/share/classes/java/nio/Buffer.java @@ -26,6 +26,7 @@ package java.nio; import jdk.internal.HotSpotIntrinsicCandidate; +import jdk.internal.misc.Unsafe; import java.util.Spliterator; @@ -181,6 +182,8 @@ import java.util.Spliterator; */ public abstract class Buffer { + // Cached unsafe-access object + static final Unsafe UNSAFE = Bits.unsafe(); /** * The characteristics of Spliterators that traverse and split elements @@ -616,6 +619,14 @@ public abstract class Buffer { // -- Package-private methods for bounds checking, etc. -- + /** + * + * @return the base reference, paired with the address + * field, which in combination can be used for unsafe access into a heap + * buffer or direct byte buffer (and views of). + */ + abstract Object base(); + /** * Checks the current position against the limit, throwing a {@link * BufferUnderflowException} if it is not smaller than the limit, and then diff --git a/src/java.base/share/classes/java/nio/BufferMismatch.java b/src/java.base/share/classes/java/nio/BufferMismatch.java new file mode 100644 index 00000000000..c1260f62a19 --- /dev/null +++ b/src/java.base/share/classes/java/nio/BufferMismatch.java @@ -0,0 +1,198 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package java.nio; + +import jdk.internal.util.ArraysSupport; + +/** + * Mismatch methods for buffers + */ +final class BufferMismatch { + + static int mismatch(ByteBuffer a, int aOff, ByteBuffer b, int bOff, int length) { + int i = 0; + if (length > 7) { + i = ArraysSupport.vectorizedMismatch( + a.base(), a.address + aOff, + b.base(), b.address + bOff, + length, + ArraysSupport.LOG2_ARRAY_BYTE_INDEX_SCALE); + if (i >= 0) return i; + i = length - ~i; + } + for (; i < length; i++) { + if (a.get(aOff + i) != b.get(bOff + i)) + return i; + } + return -1; + } + + static int mismatch(CharBuffer a, int aOff, CharBuffer b, int bOff, int length) { + int i = 0; + // Ensure only heap or off-heap buffer instances use the + // vectorized mismatch. If either buffer is a StringCharBuffer + // (order is null) then the slow path is taken + if (length > 3 && a.charRegionOrder() == b.charRegionOrder() + && a.charRegionOrder() != null && b.charRegionOrder() != null) { + i = ArraysSupport.vectorizedMismatch( + a.base(), a.address + (aOff << ArraysSupport.LOG2_ARRAY_CHAR_INDEX_SCALE), + b.base(), b.address + (bOff << ArraysSupport.LOG2_ARRAY_CHAR_INDEX_SCALE), + length, + ArraysSupport.LOG2_ARRAY_CHAR_INDEX_SCALE); + if (i >= 0) return i; + i = length - ~i; + } + for (; i < length; i++) { + if (a.get(aOff + i) != b.get(bOff + i)) + return i; + } + return -1; + } + + static int mismatch(ShortBuffer a, int aOff, ShortBuffer b, int bOff, int length) { + int i = 0; + if (length > 3 && a.order() == b.order()) { + i = ArraysSupport.vectorizedMismatch( + a.base(), a.address + (aOff << ArraysSupport.LOG2_ARRAY_SHORT_INDEX_SCALE), + b.base(), b.address + (bOff << ArraysSupport.LOG2_ARRAY_SHORT_INDEX_SCALE), + length, + ArraysSupport.LOG2_ARRAY_SHORT_INDEX_SCALE); + if (i >= 0) return i; + i = length - ~i; + } + for (; i < length; i++) { + if (a.get(aOff + i) != b.get(bOff + i)) + return i; + } + return -1; + } + + static int mismatch(IntBuffer a, int aOff, IntBuffer b, int bOff, int length) { + int i = 0; + if (length > 1 && a.order() == b.order()) { + i = ArraysSupport.vectorizedMismatch( + a.base(), a.address + (aOff << ArraysSupport.LOG2_ARRAY_INT_INDEX_SCALE), + b.base(), b.address + (bOff << ArraysSupport.LOG2_ARRAY_INT_INDEX_SCALE), + length, + ArraysSupport.LOG2_ARRAY_INT_INDEX_SCALE); + if (i >= 0) return i; + i = length - ~i; + } + for (; i < length; i++) { + if (a.get(aOff + i) != b.get(bOff + i)) + return i; + } + return -1; + } + + static int mismatch(FloatBuffer a, int aOff, FloatBuffer b, int bOff, int length) { + int i = 0; + if (length > 1 && a.order() == b.order()) { + i = ArraysSupport.vectorizedMismatch( + a.base(), a.address + (aOff << ArraysSupport.LOG2_ARRAY_FLOAT_INDEX_SCALE), + b.base(), b.address + (bOff << ArraysSupport.LOG2_ARRAY_FLOAT_INDEX_SCALE), + length, + ArraysSupport.LOG2_ARRAY_FLOAT_INDEX_SCALE); + // Mismatched + if (i >= 0) { + // Check if mismatch is not associated with two NaN values; and + // is not associated with +0 and -0 + float av = a.get(aOff + i); + float bv = b.get(bOff + i); + if (av != bv && (!Float.isNaN(av) || !Float.isNaN(bv))) + return i; + + // Fall back to slow mechanism + // ISSUE: Consider looping over vectorizedMismatch adjusting ranges + // However, requires that returned value be relative to input ranges + i++; + } + // Matched + else { + i = length - ~i; + } + } + for (; i < length; i++) { + float av = a.get(aOff + i); + float bv = b.get(bOff + i); + if (av != bv && (!Float.isNaN(av) || !Float.isNaN(bv))) + return i; + } + return -1; + } + + static int mismatch(LongBuffer a, int aOff, LongBuffer b, int bOff, int length) { + int i = 0; + if (length > 0 && a.order() == b.order()) { + i = ArraysSupport.vectorizedMismatch( + a.base(), a.address + (aOff << ArraysSupport.LOG2_ARRAY_LONG_INDEX_SCALE), + b.base(), b.address + (bOff << ArraysSupport.LOG2_ARRAY_LONG_INDEX_SCALE), + length, + ArraysSupport.LOG2_ARRAY_LONG_INDEX_SCALE); + return i >= 0 ? i : -1; + } + for (; i < length; i++) { + if (a.get(aOff + i) != b.get(bOff + i)) + return i; + } + return -1; + } + + static int mismatch(DoubleBuffer a, int aOff, DoubleBuffer b, int bOff, int length) { + int i = 0; + if (length > 0 && a.order() == b.order()) { + i = ArraysSupport.vectorizedMismatch( + a.base(), a.address + (aOff << ArraysSupport.LOG2_ARRAY_DOUBLE_INDEX_SCALE), + b.base(), b.address + (bOff << ArraysSupport.LOG2_ARRAY_DOUBLE_INDEX_SCALE), + length, + ArraysSupport.LOG2_ARRAY_DOUBLE_INDEX_SCALE); + // Mismatched + if (i >= 0) { + // Check if mismatch is not associated with two NaN values; and + // is not associated with +0 and -0 + double av = a.get(aOff + i); + double bv = b.get(bOff + i); + if (av != bv && (!Double.isNaN(av) || !Double.isNaN(bv))) + return i; + + // Fall back to slow mechanism + // ISSUE: Consider looping over vectorizedMismatch adjusting ranges + // However, requires that returned value be relative to input ranges + i++; + } + // Matched + else { + return -1; + } + } + for (; i < length; i++) { + double av = a.get(aOff + i); + double bv = b.get(bOff + i); + if (av != bv && (!Double.isNaN(av) || !Double.isNaN(bv))) + return i; + } + return -1; + } +} diff --git a/src/java.base/share/classes/java/nio/ByteBufferAs-X-Buffer.java.template b/src/java.base/share/classes/java/nio/ByteBufferAs-X-Buffer.java.template index 3ceb4122b62..b390448b110 100644 --- a/src/java.base/share/classes/java/nio/ByteBufferAs-X-Buffer.java.template +++ b/src/java.base/share/classes/java/nio/ByteBufferAs-X-Buffer.java.template @@ -36,9 +36,6 @@ class ByteBufferAs$Type$Buffer$RW$$BO$ // package-private #if[rw] - // Cached unsafe-access object - private static final Unsafe unsafe = Bits.unsafe(); - protected final ByteBuffer bb; #end[rw] @@ -74,6 +71,11 @@ class ByteBufferAs$Type$Buffer$RW$$BO$ // package-private #end[rw] } + @Override + Object base() { + return bb.hb; + } + public $Type$Buffer slice() { int pos = this.position(); int lim = this.limit(); @@ -117,20 +119,20 @@ class ByteBufferAs$Type$Buffer$RW$$BO$ // package-private } public $type$ get() { - $memtype$ x = unsafe.get$Memtype$Unaligned(bb.hb, byteOffset(nextGetIndex()), + $memtype$ x = UNSAFE.get$Memtype$Unaligned(bb.hb, byteOffset(nextGetIndex()), {#if[boB]?true:false}); return $fromBits$(x); } public $type$ get(int i) { - $memtype$ x = unsafe.get$Memtype$Unaligned(bb.hb, byteOffset(checkIndex(i)), + $memtype$ x = UNSAFE.get$Memtype$Unaligned(bb.hb, byteOffset(checkIndex(i)), {#if[boB]?true:false}); return $fromBits$(x); } #if[streamableType] $type$ getUnchecked(int i) { - $memtype$ x = unsafe.get$Memtype$Unaligned(bb.hb, byteOffset(i), + $memtype$ x = UNSAFE.get$Memtype$Unaligned(bb.hb, byteOffset(i), {#if[boB]?true:false}); return $fromBits$(x); } @@ -141,7 +143,7 @@ class ByteBufferAs$Type$Buffer$RW$$BO$ // package-private public $Type$Buffer put($type$ x) { #if[rw] $memtype$ y = $toBits$(x); - unsafe.put$Memtype$Unaligned(bb.hb, byteOffset(nextPutIndex()), y, + UNSAFE.put$Memtype$Unaligned(bb.hb, byteOffset(nextPutIndex()), y, {#if[boB]?true:false}); return this; #else[rw] @@ -152,7 +154,7 @@ class ByteBufferAs$Type$Buffer$RW$$BO$ // package-private public $Type$Buffer put(int i, $type$ x) { #if[rw] $memtype$ y = $toBits$(x); - unsafe.put$Memtype$Unaligned(bb.hb, byteOffset(checkIndex(i)), y, + UNSAFE.put$Memtype$Unaligned(bb.hb, byteOffset(checkIndex(i)), y, {#if[boB]?true:false}); return this; #else[rw] @@ -241,4 +243,9 @@ class ByteBufferAs$Type$Buffer$RW$$BO$ // package-private #end[boL] } +#if[char] + ByteOrder charRegionOrder() { + return order(); + } +#end[char] } diff --git a/src/java.base/share/classes/java/nio/Direct-X-Buffer-bin.java.template b/src/java.base/share/classes/java/nio/Direct-X-Buffer-bin.java.template index 6179776100d..cacadb101df 100644 --- a/src/java.base/share/classes/java/nio/Direct-X-Buffer-bin.java.template +++ b/src/java.base/share/classes/java/nio/Direct-X-Buffer-bin.java.template @@ -32,7 +32,7 @@ class XXX { #if[rw] private $type$ get$Type$(long a) { - $memtype$ x = unsafe.get$Memtype$Unaligned(null, a, bigEndian); + $memtype$ x = UNSAFE.get$Memtype$Unaligned(null, a, bigEndian); return $fromBits$(x); } @@ -49,7 +49,7 @@ class XXX { private ByteBuffer put$Type$(long a, $type$ x) { #if[rw] $memtype$ y = $toBits$(x); - unsafe.put$Memtype$Unaligned(null, a, y, bigEndian); + UNSAFE.put$Memtype$Unaligned(null, a, y, bigEndian); return this; #else[rw] throw new ReadOnlyBufferException(); @@ -81,7 +81,7 @@ class XXX { int rem = (off <= lim ? lim - off : 0); int size = rem >> $LG_BYTES_PER_VALUE$; - if (!unaligned && ((address + off) % $BYTES_PER_VALUE$ != 0)) { + if (!UNALIGNED && ((address + off) % $BYTES_PER_VALUE$ != 0)) { return (bigEndian ? ($Type$Buffer)(new ByteBufferAs$Type$Buffer$RW$B(this, -1, diff --git a/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template b/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template index 68ec8340e0d..5fa9be47b20 100644 --- a/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template +++ b/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template @@ -28,7 +28,6 @@ package java.nio; import java.io.FileDescriptor; -import jdk.internal.misc.Unsafe; import jdk.internal.misc.VM; import jdk.internal.ref.Cleaner; import sun.nio.ch.DirectBuffer; @@ -45,14 +44,11 @@ class Direct$Type$Buffer$RW$$BO$ #if[rw] - // Cached unsafe-access object - protected static final Unsafe unsafe = Bits.unsafe(); - // Cached array base offset - private static final long arrayBaseOffset = (long)unsafe.arrayBaseOffset($type$[].class); + private static final long ARRAY_BASE_OFFSET = UNSAFE.arrayBaseOffset($type$[].class); // Cached unaligned-access capability - protected static final boolean unaligned = Bits.unaligned(); + protected static final boolean UNALIGNED = Bits.unaligned(); // Base address, used in all indexing calculations // NOTE: moved up to Buffer.java for speed in JNI GetDirectBufferAddress @@ -73,8 +69,6 @@ class Direct$Type$Buffer$RW$$BO$ implements Runnable { - private static Unsafe unsafe = Unsafe.getUnsafe(); - private long address; private long size; private int capacity; @@ -91,7 +85,7 @@ class Direct$Type$Buffer$RW$$BO$ // Paranoia return; } - unsafe.freeMemory(address); + UNSAFE.freeMemory(address); address = 0; Bits.unreserveMemory(size, capacity); } @@ -124,12 +118,12 @@ class Direct$Type$Buffer$RW$$BO$ long base = 0; try { - base = unsafe.allocateMemory(size); + base = UNSAFE.allocateMemory(size); } catch (OutOfMemoryError x) { Bits.unreserveMemory(size, cap); throw x; } - unsafe.setMemory(base, size, (byte) 0); + UNSAFE.setMemory(base, size, (byte) 0); if (pa && (base % ps != 0)) { // Round up to page boundary address = base + ps - (base & (ps - 1)); @@ -206,6 +200,11 @@ class Direct$Type$Buffer$RW$$BO$ #end[rw] } + @Override + Object base() { + return null; + } + public $Type$Buffer slice() { int pos = this.position(); int lim = this.limit(); @@ -258,16 +257,16 @@ class Direct$Type$Buffer$RW$$BO$ } public $type$ get() { - return $fromBits$($swap$(unsafe.get$Swaptype$(ix(nextGetIndex())))); + return $fromBits$($swap$(UNSAFE.get$Swaptype$(ix(nextGetIndex())))); } public $type$ get(int i) { - return $fromBits$($swap$(unsafe.get$Swaptype$(ix(checkIndex(i))))); + return $fromBits$($swap$(UNSAFE.get$Swaptype$(ix(checkIndex(i))))); } #if[streamableType] $type$ getUnchecked(int i) { - return $fromBits$($swap$(unsafe.get$Swaptype$(ix(i)))); + return $fromBits$($swap$(UNSAFE.get$Swaptype$(ix(i)))); } #end[streamableType] @@ -282,10 +281,10 @@ class Direct$Type$Buffer$RW$$BO$ if (length > rem) throw new BufferUnderflowException(); - long dstOffset = arrayBaseOffset + ((long)offset << $LG_BYTES_PER_VALUE$); + long dstOffset = ARRAY_BASE_OFFSET + ((long)offset << $LG_BYTES_PER_VALUE$); #if[!byte] if (order() != ByteOrder.nativeOrder()) - unsafe.copySwapMemory(null, + UNSAFE.copySwapMemory(null, ix(pos), dst, dstOffset, @@ -293,7 +292,7 @@ class Direct$Type$Buffer$RW$$BO$ (long)1 << $LG_BYTES_PER_VALUE$); else #end[!byte] - unsafe.copyMemory(null, + UNSAFE.copyMemory(null, ix(pos), dst, dstOffset, @@ -312,7 +311,7 @@ class Direct$Type$Buffer$RW$$BO$ public $Type$Buffer put($type$ x) { #if[rw] - unsafe.put$Swaptype$(ix(nextPutIndex()), $swap$($toBits$(x))); + UNSAFE.put$Swaptype$(ix(nextPutIndex()), $swap$($toBits$(x))); return this; #else[rw] throw new ReadOnlyBufferException(); @@ -321,7 +320,7 @@ class Direct$Type$Buffer$RW$$BO$ public $Type$Buffer put(int i, $type$ x) { #if[rw] - unsafe.put$Swaptype$(ix(checkIndex(i)), $swap$($toBits$(x))); + UNSAFE.put$Swaptype$(ix(checkIndex(i)), $swap$($toBits$(x))); return this; #else[rw] throw new ReadOnlyBufferException(); @@ -347,7 +346,7 @@ class Direct$Type$Buffer$RW$$BO$ if (srem > rem) throw new BufferOverflowException(); - unsafe.copyMemory(sb.ix(spos), ix(pos), (long)srem << $LG_BYTES_PER_VALUE$); + UNSAFE.copyMemory(sb.ix(spos), ix(pos), (long)srem << $LG_BYTES_PER_VALUE$); sb.position(spos + srem); position(pos + srem); } else if (src.hb != null) { @@ -380,10 +379,10 @@ class Direct$Type$Buffer$RW$$BO$ if (length > rem) throw new BufferOverflowException(); - long srcOffset = arrayBaseOffset + ((long)offset << $LG_BYTES_PER_VALUE$); + long srcOffset = ARRAY_BASE_OFFSET + ((long)offset << $LG_BYTES_PER_VALUE$); #if[!byte] if (order() != ByteOrder.nativeOrder()) - unsafe.copySwapMemory(src, + UNSAFE.copySwapMemory(src, srcOffset, null, ix(pos), @@ -391,7 +390,7 @@ class Direct$Type$Buffer$RW$$BO$ (long)1 << $LG_BYTES_PER_VALUE$); else #end[!byte] - unsafe.copyMemory(src, + UNSAFE.copyMemory(src, srcOffset, null, ix(pos), @@ -413,7 +412,7 @@ class Direct$Type$Buffer$RW$$BO$ assert (pos <= lim); int rem = (pos <= lim ? lim - pos : 0); - unsafe.copyMemory(ix(pos), ix(0), (long)rem << $LG_BYTES_PER_VALUE$); + UNSAFE.copyMemory(ix(pos), ix(0), (long)rem << $LG_BYTES_PER_VALUE$); position(rem); limit(capacity()); discardMark(); @@ -490,17 +489,22 @@ class Direct$Type$Buffer$RW$$BO$ #end[!byte] +#if[char] + ByteOrder charRegionOrder() { + return order(); + } +#end[char] #if[byte] byte _get(int i) { // package-private - return unsafe.getByte(address + i); + return UNSAFE.getByte(address + i); } void _put(int i, byte b) { // package-private #if[rw] - unsafe.putByte(address + i, b); + UNSAFE.putByte(address + i, b); #else[rw] throw new ReadOnlyBufferException(); #end[rw] diff --git a/src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template b/src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template index 69e65a099c7..7f2a2597ba3 100644 --- a/src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template +++ b/src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template @@ -27,8 +27,6 @@ package java.nio; -import jdk.internal.misc.Unsafe; - /** #if[rw] * A read/write Heap$Type$Buffer. @@ -43,6 +41,11 @@ import jdk.internal.misc.Unsafe; class Heap$Type$Buffer$RW$ extends {#if[ro]?Heap}$Type$Buffer { + // Cached array base offset + private static final long ARRAY_BASE_OFFSET = UNSAFE.arrayBaseOffset($type$[].class); + + // Cached array base offset + private static final long ARRAY_INDEX_SCALE = UNSAFE.arrayIndexScale($type$[].class); // For speed these fields are actually declared in X-Buffer; // these declarations are here as documentation @@ -53,16 +56,6 @@ class Heap$Type$Buffer$RW$ #end[rw] */ -#if[byte] - - // Cached unsafe-access object - private static final Unsafe unsafe = Bits.unsafe(); - - // Cached array base offset - private static final long arrayBaseOffset = unsafe.arrayBaseOffset($type$[].class); - -#end[byte] - Heap$Type$Buffer$RW$(int cap, int lim) { // package-private #if[rw] super(-1, 0, lim, cap, new $type$[cap], 0); @@ -70,13 +63,11 @@ class Heap$Type$Buffer$RW$ hb = new $type$[cap]; offset = 0; */ + this.address = ARRAY_BASE_OFFSET; #else[rw] super(cap, lim); this.isReadOnly = true; #end[rw] -#if[byte] - this.address = arrayBaseOffset; -#end[byte] } Heap$Type$Buffer$RW$($type$[] buf, int off, int len) { // package-private @@ -86,13 +77,11 @@ class Heap$Type$Buffer$RW$ hb = buf; offset = 0; */ + this.address = ARRAY_BASE_OFFSET; #else[rw] super(buf, off, len); this.isReadOnly = true; #end[rw] -#if[byte] - this.address = arrayBaseOffset; -#end[byte] } protected Heap$Type$Buffer$RW$($type$[] buf, @@ -105,13 +94,11 @@ class Heap$Type$Buffer$RW$ hb = buf; offset = off; */ + this.address = ARRAY_BASE_OFFSET + off * ARRAY_INDEX_SCALE; #else[rw] super(buf, mark, pos, lim, cap, off); this.isReadOnly = true; #end[rw] -#if[byte] - this.address = arrayBaseOffset + off; -#end[byte] } public $Type$Buffer slice() { @@ -296,18 +283,18 @@ class Heap$Type$Buffer$RW$ #if[rw] public char getChar() { - return unsafe.getCharUnaligned(hb, byteOffset(nextGetIndex(2)), bigEndian); + return UNSAFE.getCharUnaligned(hb, byteOffset(nextGetIndex(2)), bigEndian); } public char getChar(int i) { - return unsafe.getCharUnaligned(hb, byteOffset(checkIndex(i, 2)), bigEndian); + return UNSAFE.getCharUnaligned(hb, byteOffset(checkIndex(i, 2)), bigEndian); } #end[rw] public $Type$Buffer putChar(char x) { #if[rw] - unsafe.putCharUnaligned(hb, byteOffset(nextPutIndex(2)), x, bigEndian); + UNSAFE.putCharUnaligned(hb, byteOffset(nextPutIndex(2)), x, bigEndian); return this; #else[rw] throw new ReadOnlyBufferException(); @@ -316,7 +303,7 @@ class Heap$Type$Buffer$RW$ public $Type$Buffer putChar(int i, char x) { #if[rw] - unsafe.putCharUnaligned(hb, byteOffset(checkIndex(i, 2)), x, bigEndian); + UNSAFE.putCharUnaligned(hb, byteOffset(checkIndex(i, 2)), x, bigEndian); return this; #else[rw] throw new ReadOnlyBufferException(); @@ -347,18 +334,18 @@ class Heap$Type$Buffer$RW$ #if[rw] public short getShort() { - return unsafe.getShortUnaligned(hb, byteOffset(nextGetIndex(2)), bigEndian); + return UNSAFE.getShortUnaligned(hb, byteOffset(nextGetIndex(2)), bigEndian); } public short getShort(int i) { - return unsafe.getShortUnaligned(hb, byteOffset(checkIndex(i, 2)), bigEndian); + return UNSAFE.getShortUnaligned(hb, byteOffset(checkIndex(i, 2)), bigEndian); } #end[rw] public $Type$Buffer putShort(short x) { #if[rw] - unsafe.putShortUnaligned(hb, byteOffset(nextPutIndex(2)), x, bigEndian); + UNSAFE.putShortUnaligned(hb, byteOffset(nextPutIndex(2)), x, bigEndian); return this; #else[rw] throw new ReadOnlyBufferException(); @@ -367,7 +354,7 @@ class Heap$Type$Buffer$RW$ public $Type$Buffer putShort(int i, short x) { #if[rw] - unsafe.putShortUnaligned(hb, byteOffset(checkIndex(i, 2)), x, bigEndian); + UNSAFE.putShortUnaligned(hb, byteOffset(checkIndex(i, 2)), x, bigEndian); return this; #else[rw] throw new ReadOnlyBufferException(); @@ -398,18 +385,18 @@ class Heap$Type$Buffer$RW$ #if[rw] public int getInt() { - return unsafe.getIntUnaligned(hb, byteOffset(nextGetIndex(4)), bigEndian); + return UNSAFE.getIntUnaligned(hb, byteOffset(nextGetIndex(4)), bigEndian); } public int getInt(int i) { - return unsafe.getIntUnaligned(hb, byteOffset(checkIndex(i, 4)), bigEndian); + return UNSAFE.getIntUnaligned(hb, byteOffset(checkIndex(i, 4)), bigEndian); } #end[rw] public $Type$Buffer putInt(int x) { #if[rw] - unsafe.putIntUnaligned(hb, byteOffset(nextPutIndex(4)), x, bigEndian); + UNSAFE.putIntUnaligned(hb, byteOffset(nextPutIndex(4)), x, bigEndian); return this; #else[rw] throw new ReadOnlyBufferException(); @@ -418,7 +405,7 @@ class Heap$Type$Buffer$RW$ public $Type$Buffer putInt(int i, int x) { #if[rw] - unsafe.putIntUnaligned(hb, byteOffset(checkIndex(i, 4)), x, bigEndian); + UNSAFE.putIntUnaligned(hb, byteOffset(checkIndex(i, 4)), x, bigEndian); return this; #else[rw] throw new ReadOnlyBufferException(); @@ -449,18 +436,18 @@ class Heap$Type$Buffer$RW$ #if[rw] public long getLong() { - return unsafe.getLongUnaligned(hb, byteOffset(nextGetIndex(8)), bigEndian); + return UNSAFE.getLongUnaligned(hb, byteOffset(nextGetIndex(8)), bigEndian); } public long getLong(int i) { - return unsafe.getLongUnaligned(hb, byteOffset(checkIndex(i, 8)), bigEndian); + return UNSAFE.getLongUnaligned(hb, byteOffset(checkIndex(i, 8)), bigEndian); } #end[rw] public $Type$Buffer putLong(long x) { #if[rw] - unsafe.putLongUnaligned(hb, byteOffset(nextPutIndex(8)), x, bigEndian); + UNSAFE.putLongUnaligned(hb, byteOffset(nextPutIndex(8)), x, bigEndian); return this; #else[rw] throw new ReadOnlyBufferException(); @@ -469,7 +456,7 @@ class Heap$Type$Buffer$RW$ public $Type$Buffer putLong(int i, long x) { #if[rw] - unsafe.putLongUnaligned(hb, byteOffset(checkIndex(i, 8)), x, bigEndian); + UNSAFE.putLongUnaligned(hb, byteOffset(checkIndex(i, 8)), x, bigEndian); return this; #else[rw] throw new ReadOnlyBufferException(); @@ -500,12 +487,12 @@ class Heap$Type$Buffer$RW$ #if[rw] public float getFloat() { - int x = unsafe.getIntUnaligned(hb, byteOffset(nextGetIndex(4)), bigEndian); + int x = UNSAFE.getIntUnaligned(hb, byteOffset(nextGetIndex(4)), bigEndian); return Float.intBitsToFloat(x); } public float getFloat(int i) { - int x = unsafe.getIntUnaligned(hb, byteOffset(checkIndex(i, 4)), bigEndian); + int x = UNSAFE.getIntUnaligned(hb, byteOffset(checkIndex(i, 4)), bigEndian); return Float.intBitsToFloat(x); } @@ -514,7 +501,7 @@ class Heap$Type$Buffer$RW$ public $Type$Buffer putFloat(float x) { #if[rw] int y = Float.floatToRawIntBits(x); - unsafe.putIntUnaligned(hb, byteOffset(nextPutIndex(4)), y, bigEndian); + UNSAFE.putIntUnaligned(hb, byteOffset(nextPutIndex(4)), y, bigEndian); return this; #else[rw] throw new ReadOnlyBufferException(); @@ -524,7 +511,7 @@ class Heap$Type$Buffer$RW$ public $Type$Buffer putFloat(int i, float x) { #if[rw] int y = Float.floatToRawIntBits(x); - unsafe.putIntUnaligned(hb, byteOffset(checkIndex(i, 4)), y, bigEndian); + UNSAFE.putIntUnaligned(hb, byteOffset(checkIndex(i, 4)), y, bigEndian); return this; #else[rw] throw new ReadOnlyBufferException(); @@ -555,12 +542,12 @@ class Heap$Type$Buffer$RW$ #if[rw] public double getDouble() { - long x = unsafe.getLongUnaligned(hb, byteOffset(nextGetIndex(8)), bigEndian); + long x = UNSAFE.getLongUnaligned(hb, byteOffset(nextGetIndex(8)), bigEndian); return Double.longBitsToDouble(x); } public double getDouble(int i) { - long x = unsafe.getLongUnaligned(hb, byteOffset(checkIndex(i, 8)), bigEndian); + long x = UNSAFE.getLongUnaligned(hb, byteOffset(checkIndex(i, 8)), bigEndian); return Double.longBitsToDouble(x); } @@ -569,7 +556,7 @@ class Heap$Type$Buffer$RW$ public $Type$Buffer putDouble(double x) { #if[rw] long y = Double.doubleToRawLongBits(x); - unsafe.putLongUnaligned(hb, byteOffset(nextPutIndex(8)), y, bigEndian); + UNSAFE.putLongUnaligned(hb, byteOffset(nextPutIndex(8)), y, bigEndian); return this; #else[rw] throw new ReadOnlyBufferException(); @@ -579,7 +566,7 @@ class Heap$Type$Buffer$RW$ public $Type$Buffer putDouble(int i, double x) { #if[rw] long y = Double.doubleToRawLongBits(x); - unsafe.putLongUnaligned(hb, byteOffset(checkIndex(i, 8)), y, bigEndian); + UNSAFE.putLongUnaligned(hb, byteOffset(checkIndex(i, 8)), y, bigEndian); return this; #else[rw] throw new ReadOnlyBufferException(); @@ -643,7 +630,11 @@ class Heap$Type$Buffer$RW$ public ByteOrder order() { return ByteOrder.nativeOrder(); } - #end[!byte] +#if[char] + ByteOrder charRegionOrder() { + return order(); + } +#end[char] } diff --git a/src/java.base/share/classes/java/nio/MappedByteBuffer.java b/src/java.base/share/classes/java/nio/MappedByteBuffer.java index 0439afbffca..2f84cbf4549 100644 --- a/src/java.base/share/classes/java/nio/MappedByteBuffer.java +++ b/src/java.base/share/classes/java/nio/MappedByteBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -90,12 +90,6 @@ public abstract class MappedByteBuffer this.fd = null; } - private void checkMapped() { - if (fd == null) - // Can only happen if a luser explicitly casts a direct byte buffer - throw new UnsupportedOperationException(); - } - // Returns the distance (in bytes) of the buffer from the page aligned address // of the mapping. Computed each time to avoid storing in every direct buffer. private long mappingOffset() { @@ -131,7 +125,9 @@ public abstract class MappedByteBuffer * is resident in physical memory */ public final boolean isLoaded() { - checkMapped(); + if (fd == null) { + return true; + } if ((address == 0) || (capacity() == 0)) return true; long offset = mappingOffset(); @@ -153,7 +149,9 @@ public abstract class MappedByteBuffer * @return This buffer */ public final MappedByteBuffer load() { - checkMapped(); + if (fd == null) { + return this; + } if ((address == 0) || (capacity() == 0)) return this; long offset = mappingOffset(); @@ -197,7 +195,9 @@ public abstract class MappedByteBuffer * @return This buffer */ public final MappedByteBuffer force() { - checkMapped(); + if (fd == null) { + return this; + } if ((address != 0) && (capacity() != 0)) { long offset = mappingOffset(); force0(fd, mappingAddress(offset), mappingLength(offset)); diff --git a/src/java.base/share/classes/java/nio/StringCharBuffer.java b/src/java.base/share/classes/java/nio/StringCharBuffer.java index 71f4b368d29..26b355bc819 100644 --- a/src/java.base/share/classes/java/nio/StringCharBuffer.java +++ b/src/java.base/share/classes/java/nio/StringCharBuffer.java @@ -127,4 +127,30 @@ class StringCharBuffer // package-private return ByteOrder.nativeOrder(); } + ByteOrder charRegionOrder() { + return null; + } + + public boolean equals(Object ob) { + if (this == ob) + return true; + if (!(ob instanceof CharBuffer)) + return false; + CharBuffer that = (CharBuffer)ob; + if (this.remaining() != that.remaining()) + return false; + return BufferMismatch.mismatch(this, this.position(), + that, that.position(), + this.remaining()) < 0; + } + + public int compareTo(CharBuffer that) { + int i = BufferMismatch.mismatch(this, this.position(), + that, that.position(), + Math.min(this.remaining(), that.remaining())); + if (i >= 0) { + return Character.compare(this.get(this.position() + i), that.get(this.position() + i)); + } + return this.remaining() - that.remaining(); + } } diff --git a/src/java.base/share/classes/java/nio/X-Buffer.java.template b/src/java.base/share/classes/java/nio/X-Buffer.java.template index 0a39543a88e..96e05d6a663 100644 --- a/src/java.base/share/classes/java/nio/X-Buffer.java.template +++ b/src/java.base/share/classes/java/nio/X-Buffer.java.template @@ -36,6 +36,8 @@ import java.util.stream.StreamSupport; import java.util.stream.$Streamtype$Stream; #end[streamableType] +import jdk.internal.util.ArraysSupport; + /** * $A$ $type$ buffer. * @@ -287,6 +289,11 @@ public abstract class $Type$Buffer this(mark, pos, lim, cap, null, 0); } + @Override + Object base() { + return hb; + } + #if[byte] /** @@ -1297,19 +1304,9 @@ public abstract class $Type$Buffer $Type$Buffer that = ($Type$Buffer)ob; if (this.remaining() != that.remaining()) return false; - int p = this.position(); - for (int i = this.limit() - 1, j = that.limit() - 1; i >= p; i--, j--) - if (!equals(this.get(i), that.get(j))) - return false; - return true; - } - - private static boolean equals($type$ x, $type$ y) { -#if[floatingPointType] - return (x == y) || ($Fulltype$.isNaN(x) && $Fulltype$.isNaN(y)); -#else[floatingPointType] - return x == y; -#end[floatingPointType] + return BufferMismatch.mismatch(this, this.position(), + that, that.position(), + this.remaining()) < 0; } /** @@ -1336,11 +1333,11 @@ public abstract class $Type$Buffer * is less than, equal to, or greater than the given buffer */ public int compareTo($Type$Buffer that) { - int n = this.position() + Math.min(this.remaining(), that.remaining()); - for (int i = this.position(), j = that.position(); i < n; i++, j++) { - int cmp = compare(this.get(i), that.get(j)); - if (cmp != 0) - return cmp; + int i = BufferMismatch.mismatch(this, this.position(), + that, that.position(), + Math.min(this.remaining(), that.remaining())); + if (i >= 0) { + return compare(this.get(this.position() + i), that.get(this.position() + i)); } return this.remaining() - that.remaining(); } @@ -1571,6 +1568,12 @@ public abstract class $Type$Buffer #end[!byte] +#if[char] + // The order or null if the buffer does not cover a memory region, + // such as StringCharBuffer + abstract ByteOrder charRegionOrder(); +#end[char] + #if[byte] boolean bigEndian // package-private diff --git a/src/java.base/share/classes/java/nio/channels/SelectableChannel.java b/src/java.base/share/classes/java/nio/channels/SelectableChannel.java index cbb77dab86d..f0030fb13e3 100644 --- a/src/java.base/share/classes/java/nio/channels/SelectableChannel.java +++ b/src/java.base/share/classes/java/nio/channels/SelectableChannel.java @@ -121,7 +121,7 @@ public abstract class SelectableChannel // keySet, may be empty but is never null, typ. a tiny array // boolean isRegistered, protected by key set // regLock, lock object to prevent duplicate registrations - // boolean isBlocking, protected by regLock + // blocking mode, protected by regLock /** * Tells whether or not this channel is currently registered with any diff --git a/src/java.base/share/classes/java/nio/channels/spi/AbstractSelectableChannel.java b/src/java.base/share/classes/java/nio/channels/spi/AbstractSelectableChannel.java index cb3ced9111d..df5b1fb6ace 100644 --- a/src/java.base/share/classes/java/nio/channels/spi/AbstractSelectableChannel.java +++ b/src/java.base/share/classes/java/nio/channels/spi/AbstractSelectableChannel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,14 @@ package java.nio.channels.spi; import java.io.IOException; -import java.nio.channels.*; +import java.nio.channels.CancelledKeyException; +import java.nio.channels.ClosedChannelException; +import java.nio.channels.ClosedSelectorException; +import java.nio.channels.IllegalBlockingModeException; +import java.nio.channels.IllegalSelectorException; +import java.nio.channels.SelectableChannel; +import java.nio.channels.SelectionKey; +import java.nio.channels.Selector; /** @@ -67,8 +74,8 @@ public abstract class AbstractSelectableChannel // Lock for registration and configureBlocking operations private final Object regLock = new Object(); - // Blocking mode, protected by regLock - boolean blocking = true; + // True when non-blocking, need regLock to change; + private volatile boolean nonBlocking; /** * Initializes a new instance of this class. @@ -197,7 +204,7 @@ public abstract class AbstractSelectableChannel throw new ClosedChannelException(); if ((ops & ~validOps()) != 0) throw new IllegalArgumentException(); - if (blocking) + if (isBlocking()) throw new IllegalBlockingModeException(); SelectionKey k = findKey(sel); if (k != null) { @@ -264,9 +271,7 @@ public abstract class AbstractSelectableChannel // -- Blocking -- public final boolean isBlocking() { - synchronized (regLock) { - return blocking; - } + return !nonBlocking; } public final Object blockingLock() { @@ -287,12 +292,13 @@ public abstract class AbstractSelectableChannel synchronized (regLock) { if (!isOpen()) throw new ClosedChannelException(); - if (blocking == block) - return this; - if (block && haveValidKeys()) - throw new IllegalBlockingModeException(); - implConfigureBlocking(block); - blocking = block; + boolean blocking = !nonBlocking; + if (block != blocking) { + if (block && haveValidKeys()) + throw new IllegalBlockingModeException(); + implConfigureBlocking(block); + nonBlocking = !block; + } } return this; } diff --git a/src/java.base/share/classes/java/nio/file/Files.java b/src/java.base/share/classes/java/nio/file/Files.java index c7e0dcf9938..41ac57fa3cf 100644 --- a/src/java.base/share/classes/java/nio/file/Files.java +++ b/src/java.base/share/classes/java/nio/file/Files.java @@ -2954,22 +2954,6 @@ public final class Files { return newBufferedWriter(path, StandardCharsets.UTF_8, options); } - /** - * Reads all bytes from an input stream and writes them to an output stream. - */ - private static long copy(InputStream source, OutputStream sink) - throws IOException - { - long nread = 0L; - byte[] buf = new byte[BUFFER_SIZE]; - int n; - while ((n = source.read(buf)) > 0) { - sink.write(buf, 0, n); - nread += n; - } - return nread; - } - /** * Copies all bytes from an input stream to a file. On return, the input * stream will be at end of stream. @@ -3082,7 +3066,7 @@ public final class Files { // do the copy try (OutputStream out = ostream) { - return copy(in, out); + return in.transferTo(out); } } @@ -3124,7 +3108,7 @@ public final class Files { Objects.requireNonNull(out); try (InputStream in = newInputStream(source)) { - return copy(in, out); + return in.transferTo(out); } } diff --git a/src/java.base/share/classes/java/text/DateFormatSymbols.java b/src/java.base/share/classes/java/text/DateFormatSymbols.java index 774b64ca1b5..7fecda24ca8 100644 --- a/src/java.base/share/classes/java/text/DateFormatSymbols.java +++ b/src/java.base/share/classes/java/text/DateFormatSymbols.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -394,6 +394,12 @@ public class DateFormatSymbols implements Serializable, Cloneable { /** * Gets month strings. For example: "January", "February", etc. + * An array with either 12 or 13 elements will be returned depending + * on whether or not {@link java.util.Calendar#UNDECIMBER Calendar.UNDECIMBER} + * is supported. Use + * {@link java.util.Calendar#JANUARY Calendar.JANUARY}, + * {@link java.util.Calendar#FEBRUARY Calendar.FEBRUARY}, + * etc. to index the result array. * *

            If the language requires different forms for formatting and * stand-alone usages, this method returns month names in the @@ -405,10 +411,9 @@ public class DateFormatSymbols implements Serializable, Cloneable { * Calendar Elements in the Unicode Locale Data Markup Language * (LDML) specification for more details. * - * @return the month strings. Use - * {@link java.util.Calendar#JANUARY Calendar.JANUARY}, - * {@link java.util.Calendar#FEBRUARY Calendar.FEBRUARY}, - * etc. to index the result array. + * @implSpec This method returns 13 elements since + * {@link java.util.Calendar#UNDECIMBER Calendar.UNDECIMBER} is supported. + * @return the month strings. */ public String[] getMonths() { return Arrays.copyOf(months, months.length); @@ -427,6 +432,12 @@ public class DateFormatSymbols implements Serializable, Cloneable { /** * Gets short month strings. For example: "Jan", "Feb", etc. + * An array with either 12 or 13 elements will be returned depending + * on whether or not {@link java.util.Calendar#UNDECIMBER Calendar.UNDECIMBER} + * is supported. Use + * {@link java.util.Calendar#JANUARY Calendar.JANUARY}, + * {@link java.util.Calendar#FEBRUARY Calendar.FEBRUARY}, + * etc. to index the result array. * *

            If the language requires different forms for formatting and * stand-alone usages, this method returns short month names in @@ -438,10 +449,9 @@ public class DateFormatSymbols implements Serializable, Cloneable { * Calendar Elements in the Unicode Locale Data Markup Language * (LDML) specification for more details. * - * @return the short month strings. Use - * {@link java.util.Calendar#JANUARY Calendar.JANUARY}, - * {@link java.util.Calendar#FEBRUARY Calendar.FEBRUARY}, - * etc. to index the result array. + * @implSpec This method returns 13 elements since + * {@link java.util.Calendar#UNDECIMBER Calendar.UNDECIMBER} is supported. + * @return the short month strings. */ public String[] getShortMonths() { return Arrays.copyOf(shortMonths, shortMonths.length); diff --git a/src/java.base/share/classes/java/time/Instant.java b/src/java.base/share/classes/java/time/Instant.java index 6e0dba1d506..27dd3fdf2c8 100644 --- a/src/java.base/share/classes/java/time/Instant.java +++ b/src/java.base/share/classes/java/time/Instant.java @@ -610,7 +610,7 @@ public final class Instant *

            * The epoch second count is a simple incrementing count of seconds where * second 0 is 1970-01-01T00:00:00Z. - * The nanosecond part of the day is returned by {@link #getNano}. + * The nanosecond part is returned by {@link #getNano}. * * @return the seconds from the epoch of 1970-01-01T00:00:00Z */ diff --git a/src/java.base/share/classes/java/time/temporal/IsoFields.java b/src/java.base/share/classes/java/time/temporal/IsoFields.java index 1294bb1e8be..5a0d52555a3 100644 --- a/src/java.base/share/classes/java/time/temporal/IsoFields.java +++ b/src/java.base/share/classes/java/time/temporal/IsoFields.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -708,9 +708,8 @@ public final class IsoFields { return (R) temporal.with(WEEK_BASED_YEAR, Math.addExact(temporal.get(WEEK_BASED_YEAR), amount)); case QUARTER_YEARS: - // no overflow (256 is multiple of 4) - return (R) temporal.plus(amount / 256, YEARS) - .plus((amount % 256) * 3, MONTHS); + return (R) temporal.plus(amount / 4, YEARS) + .plus((amount % 4) * 3, MONTHS); default: throw new IllegalStateException("Unreachable"); } diff --git a/src/java.base/share/classes/java/util/ArrayList.java b/src/java.base/share/classes/java/util/ArrayList.java index 53d2a05f61b..c57ccf73778 100644 --- a/src/java.base/share/classes/java/util/ArrayList.java +++ b/src/java.base/share/classes/java/util/ArrayList.java @@ -1143,6 +1143,23 @@ public class ArrayList extends AbstractList return modified; } + public Object[] toArray() { + checkForComodification(); + return Arrays.copyOfRange(root.elementData, offset, offset + size); + } + + @SuppressWarnings("unchecked") + public T[] toArray(T[] a) { + checkForComodification(); + if (a.length < size) + return (T[]) Arrays.copyOfRange( + root.elementData, offset, offset + size, a.getClass()); + System.arraycopy(root.elementData, offset, a, 0, size); + if (a.length > size) + a[size] = null; + return a; + } + public Iterator iterator() { return listIterator(); } @@ -1550,7 +1567,6 @@ public class ArrayList extends AbstractList setBit(deathRow, i - beg); if (modCount != expectedModCount) throw new ConcurrentModificationException(); - expectedModCount++; modCount++; int w = beg; for (i = beg; i < end; i++) diff --git a/src/java.base/share/classes/java/util/Arrays.java b/src/java.base/share/classes/java/util/Arrays.java index e1571cc613f..74011566f26 100644 --- a/src/java.base/share/classes/java/util/Arrays.java +++ b/src/java.base/share/classes/java/util/Arrays.java @@ -26,6 +26,7 @@ package java.util; import jdk.internal.HotSpotIntrinsicCandidate; +import jdk.internal.util.ArraysSupport; import java.lang.reflect.Array; import java.util.concurrent.ForkJoinPool; diff --git a/src/java.base/share/classes/java/util/Base64.java b/src/java.base/share/classes/java/util/Base64.java index 0973a63844c..398dee43dba 100644 --- a/src/java.base/share/classes/java/util/Base64.java +++ b/src/java.base/share/classes/java/util/Base64.java @@ -116,8 +116,8 @@ public class Base64 { * * @param lineLength * the length of each output line (rounded down to nearest multiple - * of 4). If {@code lineLength <= 0} the output will not be separated - * in lines + * of 4). If the rounded down line length is not a positive value, + * the output will not be separated in lines * @param lineSeparator * the line separator for each output line * @@ -135,10 +135,12 @@ public class Base64 { throw new IllegalArgumentException( "Illegal base64 line separator character 0x" + Integer.toString(b, 16)); } + // round down to nearest multiple of 4 + lineLength &= ~0b11; if (lineLength <= 0) { return Encoder.RFC4648; } - return new Encoder(false, lineSeparator, lineLength >> 2 << 2, true); + return new Encoder(false, lineSeparator, lineLength, true); } /** diff --git a/src/java.base/share/classes/java/util/Locale.java b/src/java.base/share/classes/java/util/Locale.java index d22183874d7..eeb238fa183 100644 --- a/src/java.base/share/classes/java/util/Locale.java +++ b/src/java.base/share/classes/java/util/Locale.java @@ -808,17 +808,26 @@ public final class Locale implements Cloneable, Serializable { } static Locale getInstance(BaseLocale baseloc, LocaleExtensions extensions) { - LocaleKey key = new LocaleKey(baseloc, extensions); - return LOCALECACHE.get(key); + if (extensions == null) { + return LOCALECACHE.get(baseloc); + } else { + LocaleKey key = new LocaleKey(baseloc, extensions); + return LOCALECACHE.get(key); + } } - private static class Cache extends LocaleObjectCache { + private static class Cache extends LocaleObjectCache { private Cache() { } @Override - protected Locale createObject(LocaleKey key) { - return new Locale(key.base, key.exts); + protected Locale createObject(Object key) { + if (key instanceof BaseLocale) { + return new Locale((BaseLocale)key, null); + } else { + LocaleKey lk = (LocaleKey)key; + return new Locale(lk.base, lk.exts); + } } } diff --git a/src/java.base/share/classes/java/util/Vector.java b/src/java.base/share/classes/java/util/Vector.java index fac073b1116..bb80cba55b6 100644 --- a/src/java.base/share/classes/java/util/Vector.java +++ b/src/java.base/share/classes/java/util/Vector.java @@ -1023,7 +1023,6 @@ public class Vector setBit(deathRow, i - beg); if (modCount != expectedModCount) throw new ConcurrentModificationException(); - expectedModCount++; modCount++; int w = beg; for (i = beg; i < end; i++) diff --git a/src/java.base/share/classes/java/util/concurrent/AbstractExecutorService.java b/src/java.base/share/classes/java/util/concurrent/AbstractExecutorService.java index e4d22357190..a2068671fab 100644 --- a/src/java.base/share/classes/java/util/concurrent/AbstractExecutorService.java +++ b/src/java.base/share/classes/java/util/concurrent/AbstractExecutorService.java @@ -245,8 +245,7 @@ public abstract class AbstractExecutorService implements ExecutorService { Future f = futures.get(i); if (!f.isDone()) { try { f.get(); } - catch (CancellationException ignore) {} - catch (ExecutionException ignore) {} + catch (CancellationException | ExecutionException ignore) {} } } return futures; @@ -283,8 +282,7 @@ public abstract class AbstractExecutorService implements ExecutorService { Future f = futures.get(j); if (!f.isDone()) { try { f.get(deadline - System.nanoTime(), NANOSECONDS); } - catch (CancellationException ignore) {} - catch (ExecutionException ignore) {} + catch (CancellationException | ExecutionException ignore) {} catch (TimeoutException timedOut) { break timedOut; } diff --git a/src/java.base/share/classes/java/util/concurrent/ArrayBlockingQueue.java b/src/java.base/share/classes/java/util/concurrent/ArrayBlockingQueue.java index 03f77879b2c..11052994b2f 100644 --- a/src/java.base/share/classes/java/util/concurrent/ArrayBlockingQueue.java +++ b/src/java.base/share/classes/java/util/concurrent/ArrayBlockingQueue.java @@ -1584,34 +1584,40 @@ public class ArrayBlockingQueue extends AbstractQueue void checkInvariants() { // meta-assertions // assert lock.isHeldByCurrentThread(); - try { - // Unlike ArrayDeque, we have a count field but no spare slot. - // We prefer ArrayDeque's strategy (and the names of its fields!), - // but our field layout is baked into the serial form, and so is - // too annoying to change. - // - // putIndex == takeIndex must be disambiguated by checking count. - int capacity = items.length; - // assert capacity > 0; - // assert takeIndex >= 0 && takeIndex < capacity; - // assert putIndex >= 0 && putIndex < capacity; - // assert count <= capacity; - // assert takeIndex == putIndex || items[takeIndex] != null; - // assert count == capacity || items[putIndex] == null; - // assert takeIndex == putIndex || items[dec(putIndex, capacity)] != null; - } catch (Throwable t) { - System.err.printf("takeIndex=%d putIndex=%d count=%d capacity=%d%n", - takeIndex, putIndex, count, items.length); - System.err.printf("items=%s%n", - Arrays.toString(items)); - throw t; + if (!invariantsSatisfied()) { + String detail = String.format( + "takeIndex=%d putIndex=%d count=%d capacity=%d items=%s", + takeIndex, putIndex, count, items.length, + Arrays.toString(items)); + System.err.println(detail); + throw new AssertionError(detail); } } + private boolean invariantsSatisfied() { + // Unlike ArrayDeque, we have a count field but no spare slot. + // We prefer ArrayDeque's strategy (and the names of its fields!), + // but our field layout is baked into the serial form, and so is + // too annoying to change. + // + // putIndex == takeIndex must be disambiguated by checking count. + int capacity = items.length; + return capacity > 0 + && items.getClass() == Object[].class + && (takeIndex | putIndex | count) >= 0 + && takeIndex < capacity + && putIndex < capacity + && count <= capacity + && (putIndex - takeIndex - count) % capacity == 0 + && (count == 0 || items[takeIndex] != null) + && (count == capacity || items[putIndex] == null) + && (count == 0 || items[dec(putIndex, capacity)] != null); + } + /** - * Deserializes this queue and then checks some invariants. + * Reconstitutes this queue from a stream (that is, deserializes it). * - * @param s the input stream + * @param s the stream * @throws ClassNotFoundException if the class of a serialized object * could not be found * @throws java.io.InvalidObjectException if invariants are violated @@ -1623,15 +1629,7 @@ public class ArrayBlockingQueue extends AbstractQueue // Read in items array and various fields s.defaultReadObject(); - // Check invariants over count and index fields. Note that - // if putIndex==takeIndex, count can be either 0 or items.length. - if (items.length == 0 || - takeIndex < 0 || takeIndex >= items.length || - putIndex < 0 || putIndex >= items.length || - count < 0 || count > items.length || - Math.floorMod(putIndex - takeIndex, items.length) != - Math.floorMod(count, items.length)) { + if (!invariantsSatisfied()) throw new java.io.InvalidObjectException("invariants violated"); - } } } diff --git a/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java b/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java index 03ed2fa2974..383253eddc4 100644 --- a/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java +++ b/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java @@ -717,12 +717,12 @@ public class ConcurrentHashMap extends AbstractMap */ static Class comparableClassFor(Object x) { if (x instanceof Comparable) { - Class c; Type[] ts, as; Type t; ParameterizedType p; + Class c; Type[] ts, as; ParameterizedType p; if ((c = x.getClass()) == String.class) // bypass checks return c; if ((ts = c.getGenericInterfaces()) != null) { - for (int i = 0; i < ts.length; ++i) { - if (((t = ts[i]) instanceof ParameterizedType) && + for (Type t : ts) { + if ((t instanceof ParameterizedType) && ((p = (ParameterizedType)t).getRawType() == Comparable.class) && (as = p.getActualTypeArguments()) != null && @@ -2328,15 +2328,15 @@ public class ConcurrentHashMap extends AbstractMap * @param check if <0, don't check resize, if <= 1 only check if uncontended */ private final void addCount(long x, int check) { - CounterCell[] as; long b, s; - if ((as = counterCells) != null || + CounterCell[] cs; long b, s; + if ((cs = counterCells) != null || !U.compareAndSetLong(this, BASECOUNT, b = baseCount, s = b + x)) { - CounterCell a; long v; int m; + CounterCell c; long v; int m; boolean uncontended = true; - if (as == null || (m = as.length - 1) < 0 || - (a = as[ThreadLocalRandom.getProbe() & m]) == null || + if (cs == null || (m = cs.length - 1) < 0 || + (c = cs[ThreadLocalRandom.getProbe() & m]) == null || !(uncontended = - U.compareAndSetLong(a, CELLVALUE, v = a.value, v + x))) { + U.compareAndSetLong(c, CELLVALUE, v = c.value, v + x))) { fullAddCount(x, uncontended); return; } @@ -2574,13 +2574,12 @@ public class ConcurrentHashMap extends AbstractMap } final long sumCount() { - CounterCell[] as = counterCells; CounterCell a; + CounterCell[] cs = counterCells; long sum = baseCount; - if (as != null) { - for (int i = 0; i < as.length; ++i) { - if ((a = as[i]) != null) - sum += a.value; - } + if (cs != null) { + for (CounterCell c : cs) + if (c != null) + sum += c.value; } return sum; } @@ -2595,9 +2594,9 @@ public class ConcurrentHashMap extends AbstractMap } boolean collide = false; // True if last slot nonempty for (;;) { - CounterCell[] as; CounterCell a; int n; long v; - if ((as = counterCells) != null && (n = as.length) > 0) { - if ((a = as[(n - 1) & h]) == null) { + CounterCell[] cs; CounterCell c; int n; long v; + if ((cs = counterCells) != null && (n = cs.length) > 0) { + if ((c = cs[(n - 1) & h]) == null) { if (cellsBusy == 0) { // Try to attach new Cell CounterCell r = new CounterCell(x); // Optimistic create if (cellsBusy == 0 && @@ -2623,21 +2622,17 @@ public class ConcurrentHashMap extends AbstractMap } else if (!wasUncontended) // CAS already known to fail wasUncontended = true; // Continue after rehash - else if (U.compareAndSetLong(a, CELLVALUE, v = a.value, v + x)) + else if (U.compareAndSetLong(c, CELLVALUE, v = c.value, v + x)) break; - else if (counterCells != as || n >= NCPU) + else if (counterCells != cs || n >= NCPU) collide = false; // At max size or stale else if (!collide) collide = true; else if (cellsBusy == 0 && U.compareAndSetInt(this, CELLSBUSY, 0, 1)) { try { - if (counterCells == as) {// Expand table unless stale - CounterCell[] rs = new CounterCell[n << 1]; - for (int i = 0; i < n; ++i) - rs[i] = as[i]; - counterCells = rs; - } + if (counterCells == cs) // Expand table unless stale + counterCells = Arrays.copyOf(cs, n << 1); } finally { cellsBusy = 0; } @@ -2646,11 +2641,11 @@ public class ConcurrentHashMap extends AbstractMap } h = ThreadLocalRandom.advanceProbe(h); } - else if (cellsBusy == 0 && counterCells == as && + else if (cellsBusy == 0 && counterCells == cs && U.compareAndSetInt(this, CELLSBUSY, 0, 1)) { boolean init = false; try { // Initialize table - if (counterCells == as) { + if (counterCells == cs) { CounterCell[] rs = new CounterCell[2]; rs[h & 1] = new CounterCell(x); counterCells = rs; diff --git a/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListMap.java b/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListMap.java index 96afa4c32c8..b0db2794026 100644 --- a/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListMap.java +++ b/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListMap.java @@ -2204,9 +2204,7 @@ public class ConcurrentSkipListMap extends AbstractMap Collection c = (Collection) o; try { return containsAll(c) && c.containsAll(this); - } catch (ClassCastException unused) { - return false; - } catch (NullPointerException unused) { + } catch (ClassCastException | NullPointerException unused) { return false; } } @@ -2331,9 +2329,7 @@ public class ConcurrentSkipListMap extends AbstractMap Collection c = (Collection) o; try { return containsAll(c) && c.containsAll(this); - } catch (ClassCastException unused) { - return false; - } catch (NullPointerException unused) { + } catch (ClassCastException | NullPointerException unused) { return false; } } @@ -2453,9 +2449,7 @@ public class ConcurrentSkipListMap extends AbstractMap if (k == null) // pass by markers and headers return true; int c = cpr(cmp, k, hi); - if (c > 0 || (c == 0 && !hiInclusive)) - return false; - return true; + return c < 0 || (c == 0 && hiInclusive); } /** diff --git a/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListSet.java b/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListSet.java index 82e4b987781..9b6330238d7 100644 --- a/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListSet.java +++ b/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListSet.java @@ -309,9 +309,7 @@ public class ConcurrentSkipListSet Collection c = (Collection) o; try { return containsAll(c) && c.containsAll(this); - } catch (ClassCastException unused) { - return false; - } catch (NullPointerException unused) { + } catch (ClassCastException | NullPointerException unused) { return false; } } diff --git a/src/java.base/share/classes/java/util/concurrent/CopyOnWriteArrayList.java b/src/java.base/share/classes/java/util/concurrent/CopyOnWriteArrayList.java index ad66f47e277..fb6a4e9b832 100644 --- a/src/java.base/share/classes/java/util/concurrent/CopyOnWriteArrayList.java +++ b/src/java.base/share/classes/java/util/concurrent/CopyOnWriteArrayList.java @@ -508,7 +508,7 @@ public class CopyOnWriteArrayList public boolean remove(Object o) { Object[] snapshot = getArray(); int index = indexOf(o, snapshot, 0, snapshot.length); - return (index < 0) ? false : remove(o, snapshot, index); + return index >= 0 && remove(o, snapshot, index); } /** @@ -587,8 +587,8 @@ public class CopyOnWriteArrayList */ public boolean addIfAbsent(E e) { Object[] snapshot = getArray(); - return indexOf(e, snapshot, 0, snapshot.length) >= 0 ? false : - addIfAbsent(e, snapshot); + return indexOf(e, snapshot, 0, snapshot.length) < 0 + && addIfAbsent(e, snapshot); } /** @@ -980,13 +980,10 @@ public class CopyOnWriteArrayList List list = (List)o; Iterator it = list.iterator(); - Object[] elements = getArray(); - for (int i = 0, len = elements.length; i < len; i++) - if (!it.hasNext() || !Objects.equals(elements[i], it.next())) + for (Object element : getArray()) + if (!it.hasNext() || !Objects.equals(element, it.next())) return false; - if (it.hasNext()) - return false; - return true; + return !it.hasNext(); } /** diff --git a/src/java.base/share/classes/java/util/concurrent/Executors.java b/src/java.base/share/classes/java/util/concurrent/Executors.java index 732edde1a6e..759365dfd63 100644 --- a/src/java.base/share/classes/java/util/concurrent/Executors.java +++ b/src/java.base/share/classes/java/util/concurrent/Executors.java @@ -35,6 +35,7 @@ package java.util.concurrent; +import static java.lang.ref.Reference.reachabilityFence; import java.security.AccessControlContext; import java.security.AccessControlException; import java.security.AccessController; @@ -185,9 +186,7 @@ public class Executors { * returned executor is guaranteed not to be reconfigurable to use * additional threads. * - * @param threadFactory the factory to use when creating new - * threads - * + * @param threadFactory the factory to use when creating new threads * @return the newly created single-threaded Executor * @throws NullPointerException if threadFactory is null */ @@ -226,6 +225,7 @@ public class Executors { * will reuse previously constructed threads when they are * available, and uses the provided * ThreadFactory to create new threads when needed. + * * @param threadFactory the factory to use when creating new threads * @return the newly created thread pool * @throws NullPointerException if threadFactory is null @@ -248,6 +248,7 @@ public class Executors { * given time. Unlike the otherwise equivalent * {@code newScheduledThreadPool(1)} the returned executor is * guaranteed not to be reconfigurable to use additional threads. + * * @return the newly created scheduled executor */ public static ScheduledExecutorService newSingleThreadScheduledExecutor() { @@ -266,9 +267,9 @@ public class Executors { * equivalent {@code newScheduledThreadPool(1, threadFactory)} * the returned executor is guaranteed not to be reconfigurable to * use additional threads. - * @param threadFactory the factory to use when creating new - * threads - * @return a newly created scheduled executor + * + * @param threadFactory the factory to use when creating new threads + * @return the newly created scheduled executor * @throws NullPointerException if threadFactory is null */ public static ScheduledExecutorService newSingleThreadScheduledExecutor(ThreadFactory threadFactory) { @@ -281,7 +282,7 @@ public class Executors { * given delay, or to execute periodically. * @param corePoolSize the number of threads to keep in the pool, * even if they are idle - * @return a newly created scheduled thread pool + * @return the newly created scheduled thread pool * @throws IllegalArgumentException if {@code corePoolSize < 0} */ public static ScheduledExecutorService newScheduledThreadPool(int corePoolSize) { @@ -295,7 +296,7 @@ public class Executors { * even if they are idle * @param threadFactory the factory to use when the executor * creates a new thread - * @return a newly created scheduled thread pool + * @return the newly created scheduled thread pool * @throws IllegalArgumentException if {@code corePoolSize < 0} * @throws NullPointerException if threadFactory is null */ @@ -678,44 +679,76 @@ public class Executors { * of an ExecutorService implementation. */ private static class DelegatedExecutorService - extends AbstractExecutorService { + implements ExecutorService { private final ExecutorService e; DelegatedExecutorService(ExecutorService executor) { e = executor; } - public void execute(Runnable command) { e.execute(command); } + public void execute(Runnable command) { + try { + e.execute(command); + } finally { reachabilityFence(this); } + } public void shutdown() { e.shutdown(); } - public List shutdownNow() { return e.shutdownNow(); } - public boolean isShutdown() { return e.isShutdown(); } - public boolean isTerminated() { return e.isTerminated(); } + public List shutdownNow() { + try { + return e.shutdownNow(); + } finally { reachabilityFence(this); } + } + public boolean isShutdown() { + try { + return e.isShutdown(); + } finally { reachabilityFence(this); } + } + public boolean isTerminated() { + try { + return e.isTerminated(); + } finally { reachabilityFence(this); } + } public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { - return e.awaitTermination(timeout, unit); + try { + return e.awaitTermination(timeout, unit); + } finally { reachabilityFence(this); } } public Future submit(Runnable task) { - return e.submit(task); + try { + return e.submit(task); + } finally { reachabilityFence(this); } } public Future submit(Callable task) { - return e.submit(task); + try { + return e.submit(task); + } finally { reachabilityFence(this); } } public Future submit(Runnable task, T result) { - return e.submit(task, result); + try { + return e.submit(task, result); + } finally { reachabilityFence(this); } } public List> invokeAll(Collection> tasks) throws InterruptedException { - return e.invokeAll(tasks); + try { + return e.invokeAll(tasks); + } finally { reachabilityFence(this); } } public List> invokeAll(Collection> tasks, long timeout, TimeUnit unit) throws InterruptedException { - return e.invokeAll(tasks, timeout, unit); + try { + return e.invokeAll(tasks, timeout, unit); + } finally { reachabilityFence(this); } } public T invokeAny(Collection> tasks) throws InterruptedException, ExecutionException { - return e.invokeAny(tasks); + try { + return e.invokeAny(tasks); + } finally { reachabilityFence(this); } } public T invokeAny(Collection> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { - return e.invokeAny(tasks, timeout, unit); + try { + return e.invokeAny(tasks, timeout, unit); + } finally { reachabilityFence(this); } } } diff --git a/src/java.base/share/classes/java/util/concurrent/LinkedBlockingDeque.java b/src/java.base/share/classes/java/util/concurrent/LinkedBlockingDeque.java index 82c522690ec..9bac335693c 100644 --- a/src/java.base/share/classes/java/util/concurrent/LinkedBlockingDeque.java +++ b/src/java.base/share/classes/java/util/concurrent/LinkedBlockingDeque.java @@ -1353,17 +1353,16 @@ public class LinkedBlockingDeque @SuppressWarnings("unchecked") private boolean bulkRemove(Predicate filter) { boolean removed = false; - Node p = null; final ReentrantLock lock = this.lock; + Node p = null; Node[] nodes = null; int n, len = 0; do { // 1. Extract batch of up to 64 elements while holding the lock. - long deathRow = 0; // "bitset" of size 64 lock.lock(); try { - if (nodes == null) { - if (p == null) p = first; + if (nodes == null) { // first batch; initialize + p = first; for (Node q = p; q != null; q = succ(q)) if (q.item != null && ++len == 64) break; @@ -1376,6 +1375,7 @@ public class LinkedBlockingDeque } // 2. Run the filter on the elements while lock is free. + long deathRow = 0L; // "bitset" of size 64 for (int i = 0; i < n; i++) { final E e; if ((e = nodes[i].item) != null && filter.test(e)) @@ -1393,6 +1393,7 @@ public class LinkedBlockingDeque unlink(q); removed = true; } + nodes[i] = null; // help GC } } finally { lock.unlock(); diff --git a/src/java.base/share/classes/java/util/concurrent/LinkedBlockingQueue.java b/src/java.base/share/classes/java/util/concurrent/LinkedBlockingQueue.java index 368f6014dfa..96029f670b0 100644 --- a/src/java.base/share/classes/java/util/concurrent/LinkedBlockingQueue.java +++ b/src/java.base/share/classes/java/util/concurrent/LinkedBlockingQueue.java @@ -323,10 +323,8 @@ public class LinkedBlockingQueue extends AbstractQueue */ public void put(E e) throws InterruptedException { if (e == null) throw new NullPointerException(); - // Note: convention in all put/take/etc is to preset local var - // holding count negative to indicate failure unless set. - int c = -1; - Node node = new Node(e); + final int c; + final Node node = new Node(e); final ReentrantLock putLock = this.putLock; final AtomicInteger count = this.count; putLock.lockInterruptibly(); @@ -367,7 +365,7 @@ public class LinkedBlockingQueue extends AbstractQueue if (e == null) throw new NullPointerException(); long nanos = unit.toNanos(timeout); - int c = -1; + final int c; final ReentrantLock putLock = this.putLock; final AtomicInteger count = this.count; putLock.lockInterruptibly(); @@ -405,28 +403,28 @@ public class LinkedBlockingQueue extends AbstractQueue final AtomicInteger count = this.count; if (count.get() == capacity) return false; - int c = -1; - Node node = new Node(e); + final int c; + final Node node = new Node(e); final ReentrantLock putLock = this.putLock; putLock.lock(); try { - if (count.get() < capacity) { - enqueue(node); - c = count.getAndIncrement(); - if (c + 1 < capacity) - notFull.signal(); - } + if (count.get() == capacity) + return false; + enqueue(node); + c = count.getAndIncrement(); + if (c + 1 < capacity) + notFull.signal(); } finally { putLock.unlock(); } if (c == 0) signalNotEmpty(); - return c >= 0; + return true; } public E take() throws InterruptedException { - E x; - int c = -1; + final E x; + final int c; final AtomicInteger count = this.count; final ReentrantLock takeLock = this.takeLock; takeLock.lockInterruptibly(); @@ -447,8 +445,8 @@ public class LinkedBlockingQueue extends AbstractQueue } public E poll(long timeout, TimeUnit unit) throws InterruptedException { - E x = null; - int c = -1; + final E x; + final int c; long nanos = unit.toNanos(timeout); final AtomicInteger count = this.count; final ReentrantLock takeLock = this.takeLock; @@ -475,17 +473,17 @@ public class LinkedBlockingQueue extends AbstractQueue final AtomicInteger count = this.count; if (count.get() == 0) return null; - E x = null; - int c = -1; + final E x; + final int c; final ReentrantLock takeLock = this.takeLock; takeLock.lock(); try { - if (count.get() > 0) { - x = dequeue(); - c = count.getAndDecrement(); - if (c > 1) - notEmpty.signal(); - } + if (count.get() == 0) + return null; + x = dequeue(); + c = count.getAndDecrement(); + if (c > 1) + notEmpty.signal(); } finally { takeLock.unlock(); } @@ -495,6 +493,7 @@ public class LinkedBlockingQueue extends AbstractQueue } public E peek() { + final AtomicInteger count = this.count; if (count.get() == 0) return null; final ReentrantLock takeLock = this.takeLock; @@ -1060,11 +1059,10 @@ public class LinkedBlockingQueue extends AbstractQueue int n, len = 0; do { // 1. Extract batch of up to 64 elements while holding the lock. - long deathRow = 0; // "bitset" of size 64 fullyLock(); try { - if (nodes == null) { - if (p == null) p = head.next; + if (nodes == null) { // first batch; initialize + p = head.next; for (Node q = p; q != null; q = succ(q)) if (q.item != null && ++len == 64) break; @@ -1077,6 +1075,7 @@ public class LinkedBlockingQueue extends AbstractQueue } // 2. Run the filter on the elements while lock is free. + long deathRow = 0L; // "bitset" of size 64 for (int i = 0; i < n; i++) { final E e; if ((e = nodes[i].item) != null && filter.test(e)) @@ -1095,6 +1094,7 @@ public class LinkedBlockingQueue extends AbstractQueue unlink(q, ancestor); removed = true; } + nodes[i] = null; // help GC } } finally { fullyUnlock(); diff --git a/src/java.base/share/classes/java/util/concurrent/LinkedTransferQueue.java b/src/java.base/share/classes/java/util/concurrent/LinkedTransferQueue.java index e9f0120eecf..137bd872a87 100644 --- a/src/java.base/share/classes/java/util/concurrent/LinkedTransferQueue.java +++ b/src/java.base/share/classes/java/util/concurrent/LinkedTransferQueue.java @@ -772,9 +772,8 @@ public class LinkedTransferQueue extends AbstractQueue Node first = null; restartFromHead: for (;;) { Node h = head, p = h; - for (; p != null;) { - final Object item; - if ((item = p.item) != null) { + while (p != null) { + if (p.item != null) { if (p.isData) { first = p; break; @@ -1602,8 +1601,7 @@ public class LinkedTransferQueue extends AbstractQueue // Read in elements until trailing null sentinel found Node h = null, t = null; for (Object item; (item = s.readObject()) != null; ) { - @SuppressWarnings("unchecked") - Node newNode = new Node((E) item); + Node newNode = new Node(item); if (h == null) h = t = newNode; else diff --git a/src/java.base/share/classes/java/util/concurrent/PriorityBlockingQueue.java b/src/java.base/share/classes/java/util/concurrent/PriorityBlockingQueue.java index 8b0b3fec285..ae2927c96f9 100644 --- a/src/java.base/share/classes/java/util/concurrent/PriorityBlockingQueue.java +++ b/src/java.base/share/classes/java/util/concurrent/PriorityBlockingQueue.java @@ -269,8 +269,8 @@ public class PriorityBlockingQueue extends AbstractQueue if (a.getClass() != Object[].class) a = Arrays.copyOf(a, n, Object[].class); if (screen && (n == 1 || this.comparator != null)) { - for (int i = 0; i < n; ++i) - if (a[i] == null) + for (Object elt : a) + if (elt == null) throw new NullPointerException(); } this.queue = a; diff --git a/src/java.base/share/classes/java/util/concurrent/SubmissionPublisher.java b/src/java.base/share/classes/java/util/concurrent/SubmissionPublisher.java index 713c3fbd395..8fd33c69d32 100644 --- a/src/java.base/share/classes/java/util/concurrent/SubmissionPublisher.java +++ b/src/java.base/share/classes/java/util/concurrent/SubmissionPublisher.java @@ -753,8 +753,10 @@ public class SubmissionPublisher implements Publisher, else pred.next = next; } - else + else { subs.add(b.subscriber); + pred = b; + } } } return subs; diff --git a/src/java.base/share/classes/java/util/concurrent/ThreadLocalRandom.java b/src/java.base/share/classes/java/util/concurrent/ThreadLocalRandom.java index 371ac7d9d33..c20d2b3488f 100644 --- a/src/java.base/share/classes/java/util/concurrent/ThreadLocalRandom.java +++ b/src/java.base/share/classes/java/util/concurrent/ThreadLocalRandom.java @@ -67,7 +67,7 @@ import jdk.internal.misc.VM; * {@code ThreadLocalRandom.current().nextX(...)} (where * {@code X} is {@code Int}, {@code Long}, etc). * When all usages are of this form, it is never possible to - * accidently share a {@code ThreadLocalRandom} across multiple threads. + * accidentally share a {@code ThreadLocalRandom} across multiple threads. * *

            This class also provides additional commonly used bounded random * generation methods. diff --git a/src/java.base/share/classes/java/util/concurrent/ThreadPoolExecutor.java b/src/java.base/share/classes/java/util/concurrent/ThreadPoolExecutor.java index e4f05649b24..2c5ea168c64 100644 --- a/src/java.base/share/classes/java/util/concurrent/ThreadPoolExecutor.java +++ b/src/java.base/share/classes/java/util/concurrent/ThreadPoolExecutor.java @@ -35,9 +35,6 @@ package java.util.concurrent; -import java.security.AccessControlContext; -import java.security.AccessController; -import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.ConcurrentModificationException; import java.util.HashSet; @@ -264,13 +261,12 @@ import java.util.concurrent.locks.ReentrantLock; * assist in storage reclamation when large numbers of queued tasks * become cancelled. * - *

            Finalization
            + *
            Reclamation
            * *
            A pool that is no longer referenced in a program AND - * has no remaining threads will be {@code shutdown} automatically. If - * you would like to ensure that unreferenced pools are reclaimed even - * if users forget to call {@link #shutdown}, then you must arrange - * that unused threads eventually die, by setting appropriate + * has no remaining threads may be reclaimed (garbage collected) + * without being explicitly shutdown. You can configure a pool to + * allow all unused threads to eventually die by setting appropriate * keep-alive times, using a lower bound of zero core threads and/or * setting {@link #allowCoreThreadTimeOut(boolean)}.
            * @@ -361,7 +357,7 @@ public class ThreadPoolExecutor extends AbstractExecutorService { * time, but need not hit each state. The transitions are: * * RUNNING -> SHUTDOWN - * On invocation of shutdown(), perhaps implicitly in finalize() + * On invocation of shutdown() * (RUNNING or SHUTDOWN) -> STOP * On invocation of shutdownNow() * SHUTDOWN -> TIDYING @@ -581,9 +577,6 @@ public class ThreadPoolExecutor extends AbstractExecutorService { private static final RuntimePermission shutdownPerm = new RuntimePermission("modifyThread"); - /** The context to be used when executing the finalizer, or null. */ - private final AccessControlContext acc; - /** * Class Worker mainly maintains interrupt control state for * threads running tasks, along with other minor bookkeeping. @@ -1300,9 +1293,6 @@ public class ThreadPoolExecutor extends AbstractExecutorService { throw new IllegalArgumentException(); if (workQueue == null || threadFactory == null || handler == null) throw new NullPointerException(); - this.acc = (System.getSecurityManager() == null) - ? null - : AccessController.getContext(); this.corePoolSize = corePoolSize; this.maximumPoolSize = maximumPoolSize; this.workQueue = workQueue; @@ -1469,32 +1459,17 @@ public class ThreadPoolExecutor extends AbstractExecutorService { } } + // Override without "throws Throwable" for compatibility with subclasses + // whose finalize method invokes super.finalize() (as is recommended). + // Before JDK 11, finalize() had a non-empty method body. + /** - * Invokes {@code shutdown} when this executor is no longer - * referenced and it has no threads. - * - *

            This method is invoked with privileges that are restricted by - * the security context of the caller that invokes the constructor. - * - * @deprecated The {@code finalize} method has been deprecated. - * Subclasses that override {@code finalize} in order to perform cleanup - * should be modified to use alternative cleanup mechanisms and - * to remove the overriding {@code finalize} method. - * When overriding the {@code finalize} method, its implementation must explicitly - * ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}. - * See the specification for {@link Object#finalize()} for further - * information about migration options. + * @implNote Previous versions of this class had a finalize method + * that shut down this executor, but in this version, finalize + * does nothing. */ @Deprecated(since="9") - protected void finalize() { - SecurityManager sm = System.getSecurityManager(); - if (sm == null || acc == null) { - shutdown(); - } else { - PrivilegedAction pa = () -> { shutdown(); return null; }; - AccessController.doPrivileged(pa, acc); - } - } + protected void finalize() {} /** * Sets the thread factory used to create new threads. diff --git a/src/java.base/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java b/src/java.base/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java index ea89380a1cf..e7aae9ce86f 100644 --- a/src/java.base/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java +++ b/src/java.base/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java @@ -320,7 +320,9 @@ public abstract class AbstractQueuedLongSynchronizer // predNext is the apparent node to unsplice. CASes below will // fail if not, in which case, we lost race vs another cancel - // or signal, so no further action is necessary. + // or signal, so no further action is necessary, although with + // a possibility that a cancelled node may transiently remain + // reachable. Node predNext = pred.next; // Can use unconditional write instead of CAS here. @@ -912,13 +914,13 @@ public abstract class AbstractQueuedLongSynchronizer * at any time, a {@code true} return does not guarantee that any * other thread will ever acquire. * - *

            In this implementation, this operation returns in - * constant time. - * * @return {@code true} if there may be other threads waiting to acquire */ public final boolean hasQueuedThreads() { - return head != tail; + for (Node p = tail, h = head; p != h && p != null; p = p.prev) + if (p.waitStatus <= 0) + return true; + return false; } /** @@ -1067,17 +1069,21 @@ public abstract class AbstractQueuedLongSynchronizer * @since 1.7 */ public final boolean hasQueuedPredecessors() { - // The correctness of this depends on head being initialized - // before tail and on head.next being accurate if the current - // thread is first in queue. - Node t = tail; // Read fields in reverse initialization order - Node h = head; - Node s; - return h != t && - ((s = h.next) == null || s.thread != Thread.currentThread()); + Node h, s; + if ((h = head) != null) { + if ((s = h.next) == null || s.waitStatus > 0) { + s = null; // traverse in case of concurrent cancellation + for (Node p = tail; p != h && p != null; p = p.prev) { + if (p.waitStatus <= 0) + s = p; + } + } + if (s != null && s.thread != Thread.currentThread()) + return true; + } + return false; } - // Instrumentation and monitoring methods /** diff --git a/src/java.base/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java b/src/java.base/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java index 347796c4f7a..ce701cf0bb4 100644 --- a/src/java.base/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java +++ b/src/java.base/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java @@ -800,7 +800,9 @@ public abstract class AbstractQueuedSynchronizer // predNext is the apparent node to unsplice. CASes below will // fail if not, in which case, we lost race vs another cancel - // or signal, so no further action is necessary. + // or signal, so no further action is necessary, although with + // a possibility that a cancelled node may transiently remain + // reachable. Node predNext = pred.next; // Can use unconditional write instead of CAS here. @@ -1392,13 +1394,13 @@ public abstract class AbstractQueuedSynchronizer * at any time, a {@code true} return does not guarantee that any * other thread will ever acquire. * - *

            In this implementation, this operation returns in - * constant time. - * * @return {@code true} if there may be other threads waiting to acquire */ public final boolean hasQueuedThreads() { - return head != tail; + for (Node p = tail, h = head; p != h && p != null; p = p.prev) + if (p.waitStatus <= 0) + return true; + return false; } /** @@ -1547,17 +1549,21 @@ public abstract class AbstractQueuedSynchronizer * @since 1.7 */ public final boolean hasQueuedPredecessors() { - // The correctness of this depends on head being initialized - // before tail and on head.next being accurate if the current - // thread is first in queue. - Node t = tail; // Read fields in reverse initialization order - Node h = head; - Node s; - return h != t && - ((s = h.next) == null || s.thread != Thread.currentThread()); + Node h, s; + if ((h = head) != null) { + if ((s = h.next) == null || s.waitStatus > 0) { + s = null; // traverse in case of concurrent cancellation + for (Node p = tail; p != h && p != null; p = p.prev) { + if (p.waitStatus <= 0) + s = p; + } + } + if (s != null && s.thread != Thread.currentThread()) + return true; + } + return false; } - // Instrumentation and monitoring methods /** diff --git a/src/java.base/share/classes/java/util/regex/Pattern.java b/src/java.base/share/classes/java/util/regex/Pattern.java index 5ddf3f609ac..898cfb2135c 100644 --- a/src/java.base/share/classes/java/util/regex/Pattern.java +++ b/src/java.base/share/classes/java/util/regex/Pattern.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -782,12 +782,9 @@ public final class Pattern * arguments, they can also be passed as inline modifiers. * For example, the following statements have the same effect. *

            -     * RegExp r1 = RegExp.compile("abc", Pattern.I|Pattern.M);
            -     * RegExp r2 = RegExp.compile("(?im)abc", 0);
            +     * Pattern p1 = Pattern.compile("abc", Pattern.CASE_INSENSITIVE|Pattern.MULTILINE);
            +     * Pattern p2 = Pattern.compile("(?im)abc", 0);
                  * 
            - * - * The flags are duplicated so that the familiar Perl match flag - * names are available. */ /** @@ -953,6 +950,12 @@ public final class Pattern */ private int flags; + /** + * The temporary pattern flags used during compiling. The flags might be turn + * on and off by embedded flag. + */ + private transient int flags0; + /** * Boolean indicating this Pattern is compiled; this is necessary in order * to lazily compile deserialized Patterns. @@ -1137,7 +1140,7 @@ public final class Pattern * @return The match flags specified when this pattern was compiled */ public int flags() { - return flags; + return flags0; } /** @@ -1369,6 +1372,9 @@ public final class Pattern // Read in all fields s.defaultReadObject(); + // reset the flags + flags0 = flags; + // Initialize counts capturingGroupCount = 1; localCount = 0; @@ -1400,6 +1406,9 @@ public final class Pattern if ((flags & UNICODE_CHARACTER_CLASS) != 0) flags |= UNICODE_CASE; + // 'flags' for compiling + flags0 = flags; + // Reset group index count capturingGroupCount = 1; localCount = 0; @@ -1841,7 +1850,7 @@ loop: for(int x=0, offset=0; x does not exit"); + throw error("named capturing group <" + name + "> does not exist"); if (create) { hasGroupRef = true; if (has(CASE_INSENSITIVE)) @@ -2718,7 +2727,7 @@ loop: for(int x=0, offset=0; x'"); return sb.toString(); @@ -2931,7 +2938,7 @@ loop: for(int x=0, offset=0; x cleanable); + public void unregisterCleanup(FileDescriptor fdo); // Only valid on Windows public void setHandle(FileDescriptor fdo, long handle); diff --git a/src/java.base/share/classes/jdk/internal/module/ModuleInfo.java b/src/java.base/share/classes/jdk/internal/module/ModuleInfo.java index 942af76b69d..230695206f0 100644 --- a/src/java.base/share/classes/jdk/internal/module/ModuleInfo.java +++ b/src/java.base/share/classes/jdk/internal/module/ModuleInfo.java @@ -64,7 +64,7 @@ import static jdk.internal.module.ClassFileConstants.*; public final class ModuleInfo { private final int JAVA_MIN_SUPPORTED_VERSION = 53; - private final int JAVA_MAX_SUPPORTED_VERSION = 54; + private final int JAVA_MAX_SUPPORTED_VERSION = 55; private static final JavaLangModuleAccess JLMA = SharedSecrets.getJavaLangModuleAccess(); diff --git a/src/java.base/share/classes/jdk/internal/org/objectweb/asm/ClassReader.java b/src/java.base/share/classes/jdk/internal/org/objectweb/asm/ClassReader.java index 47e1f6d4b15..ca3f525b056 100644 --- a/src/java.base/share/classes/jdk/internal/org/objectweb/asm/ClassReader.java +++ b/src/java.base/share/classes/jdk/internal/org/objectweb/asm/ClassReader.java @@ -185,7 +185,7 @@ public class ClassReader { public ClassReader(final byte[] b, final int off, final int len) { this.b = b; // checks the class version - if (readShort(off + 6) > Opcodes.V10) { + if (readShort(off + 6) > Opcodes.V11) { throw new IllegalArgumentException(); } // parses the constant pool @@ -205,6 +205,10 @@ public class ClassReader { case ClassWriter.FLOAT: case ClassWriter.NAME_TYPE: case ClassWriter.INDY: + // @@@ ClassWriter.CONDY + // Enables MethodHandles.lookup().defineClass to function correctly + // when it reads the class name + case 17: size = 5; break; case ClassWriter.LONG: diff --git a/src/java.base/share/classes/jdk/internal/org/objectweb/asm/Opcodes.java b/src/java.base/share/classes/jdk/internal/org/objectweb/asm/Opcodes.java index 7ce9d9210c8..8b3ab18626c 100644 --- a/src/java.base/share/classes/jdk/internal/org/objectweb/asm/Opcodes.java +++ b/src/java.base/share/classes/jdk/internal/org/objectweb/asm/Opcodes.java @@ -90,6 +90,7 @@ public interface Opcodes { int V1_8 = 0 << 16 | 52; int V9 = 0 << 16 | 53; int V10 = 0 << 16 | 54; + int V11 = 0 << 16 | 55; // access flags diff --git a/src/java.base/share/classes/jdk/internal/org/xml/sax/SAXException.java b/src/java.base/share/classes/jdk/internal/org/xml/sax/SAXException.java index 72ea612725a..bee9caf892d 100644 --- a/src/java.base/share/classes/jdk/internal/org/xml/sax/SAXException.java +++ b/src/java.base/share/classes/jdk/internal/org/xml/sax/SAXException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,6 +30,12 @@ package jdk.internal.org.xml.sax; +import java.io.IOException; +import java.io.InvalidClassException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.ObjectStreamField; + /** * Encapsulate a general SAX error or warning. * @@ -68,7 +74,6 @@ public class SAXException extends Exception { public SAXException () { super(); - this.exception = null; } @@ -79,7 +84,6 @@ public class SAXException extends Exception { */ public SAXException (String message) { super(message); - this.exception = null; } @@ -94,8 +98,7 @@ public class SAXException extends Exception { */ public SAXException (Exception e) { - super(); - this.exception = e; + super(e); } @@ -110,8 +113,7 @@ public class SAXException extends Exception { */ public SAXException (String message, Exception e) { - super(message); - this.exception = e; + super(message, e); } @@ -127,15 +129,15 @@ public class SAXException extends Exception { public String getMessage () { String message = super.getMessage(); + Throwable cause = super.getCause(); - if (message == null && exception != null) { - return exception.getMessage(); + if (message == null && cause != null) { + return cause.getMessage(); } else { return message; } } - /** * Return the embedded exception, if any. * @@ -143,7 +145,7 @@ public class SAXException extends Exception { */ public Exception getException () { - return exception; + return getExceptionInternal(); } /** @@ -152,7 +154,7 @@ public class SAXException extends Exception { * @return Return the cause of the exception */ public Throwable getCause() { - return exception; + return super.getCause(); } /** @@ -162,6 +164,7 @@ public class SAXException extends Exception { */ public String toString () { + Throwable exception = super.getCause(); if (exception != null) { return super.toString() + "\n" + exception.toString(); } else { @@ -175,11 +178,59 @@ public class SAXException extends Exception { // Internal state. ////////////////////////////////////////////////////////////////////// + private static final ObjectStreamField[] serialPersistentFields = { + new ObjectStreamField( "exception", Exception.class ) + }; /** - * @serial The embedded exception if tunnelling, or null. + * Writes "exception" field to the stream. + * + * @param out stream used for serialization. + * @throws IOException thrown by ObjectOutputStream */ - private Exception exception; + private void writeObject(ObjectOutputStream out) + throws IOException { + ObjectOutputStream.PutField fields = out.putFields(); + fields.put("exception", getExceptionInternal()); + out.writeFields(); + } + + /** + * Reads the "exception" field from the stream. + * And initializes the "exception" if it wasn't + * done before. + * + * @param in stream used for deserialization + * @throws IOException thrown by ObjectInputStream + * @throws ClassNotFoundException thrown by ObjectInputStream + */ + private void readObject(ObjectInputStream in) + throws IOException, ClassNotFoundException { + ObjectInputStream.GetField fields = in.readFields(); + Exception exception = (Exception) fields.get("exception", null); + Throwable superCause = super.getCause(); + + // if super.getCause() and 'exception' fields present then always use + // getCause() value. Otherwise, use 'exception' to initialize cause + if (superCause == null && exception != null) { + try { + super.initCause(exception); + } catch (IllegalStateException e) { + throw new InvalidClassException("Inconsistent state: two causes"); + } + } + } + + // Internal method to guard against overriding of public getException + // method by SAXException subclasses + private Exception getExceptionInternal() { + Throwable cause = super.getCause(); + if (cause instanceof Exception) { + return (Exception) cause; + } else { + return null; + } + } // Added serialVersionUID to preserve binary compatibility static final long serialVersionUID = 583241635256073760L; diff --git a/src/java.base/share/classes/jdk/internal/reflect/Reflection.java b/src/java.base/share/classes/jdk/internal/reflect/Reflection.java index 384b67734a3..c05273c3a07 100644 --- a/src/java.base/share/classes/jdk/internal/reflect/Reflection.java +++ b/src/java.base/share/classes/jdk/internal/reflect/Reflection.java @@ -64,14 +64,6 @@ public class Reflection { @HotSpotIntrinsicCandidate public static native Class getCallerClass(); - /** - * @deprecated This method will be removed. - * This method is a private JDK API and retained temporarily to - * simplify the implementation of sun.misc.Reflection.getCallerClass. - */ - @Deprecated(forRemoval=true) - public static native Class getCallerClass(int depth); - /** Retrieves the access flags written to the class file. For inner classes these flags may differ from those returned by Class.getModifiers(), which searches the InnerClasses diff --git a/src/java.base/share/classes/java/util/ArraysSupport.java b/src/java.base/share/classes/jdk/internal/util/ArraysSupport.java similarity index 83% rename from src/java.base/share/classes/java/util/ArraysSupport.java rename to src/java.base/share/classes/jdk/internal/util/ArraysSupport.java index 31612a7d4f8..cc051df7d31 100644 --- a/src/java.base/share/classes/java/util/ArraysSupport.java +++ b/src/java.base/share/classes/jdk/internal/util/ArraysSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package java.util; +package jdk.internal.util; import jdk.internal.HotSpotIntrinsicCandidate; import jdk.internal.misc.Unsafe; @@ -50,19 +50,19 @@ import jdk.internal.misc.Unsafe; * responsibility of the caller (direct or otherwise) to perform such checks * before calling this method. */ -class ArraysSupport { +public class ArraysSupport { static final Unsafe U = Unsafe.getUnsafe(); private static final boolean BIG_ENDIAN = U.isBigEndian(); - private static final int LOG2_ARRAY_BOOLEAN_INDEX_SCALE = exactLog2(Unsafe.ARRAY_BOOLEAN_INDEX_SCALE); - private static final int LOG2_ARRAY_BYTE_INDEX_SCALE = exactLog2(Unsafe.ARRAY_BYTE_INDEX_SCALE); - private static final int LOG2_ARRAY_CHAR_INDEX_SCALE = exactLog2(Unsafe.ARRAY_CHAR_INDEX_SCALE); - private static final int LOG2_ARRAY_SHORT_INDEX_SCALE = exactLog2(Unsafe.ARRAY_SHORT_INDEX_SCALE); - private static final int LOG2_ARRAY_INT_INDEX_SCALE = exactLog2(Unsafe.ARRAY_INT_INDEX_SCALE); - private static final int LOG2_ARRAY_LONG_INDEX_SCALE = exactLog2(Unsafe.ARRAY_LONG_INDEX_SCALE); - private static final int LOG2_ARRAY_FLOAT_INDEX_SCALE = exactLog2(Unsafe.ARRAY_FLOAT_INDEX_SCALE); - private static final int LOG2_ARRAY_DOUBLE_INDEX_SCALE = exactLog2(Unsafe.ARRAY_DOUBLE_INDEX_SCALE); + public static final int LOG2_ARRAY_BOOLEAN_INDEX_SCALE = exactLog2(Unsafe.ARRAY_BOOLEAN_INDEX_SCALE); + public static final int LOG2_ARRAY_BYTE_INDEX_SCALE = exactLog2(Unsafe.ARRAY_BYTE_INDEX_SCALE); + public static final int LOG2_ARRAY_CHAR_INDEX_SCALE = exactLog2(Unsafe.ARRAY_CHAR_INDEX_SCALE); + public static final int LOG2_ARRAY_SHORT_INDEX_SCALE = exactLog2(Unsafe.ARRAY_SHORT_INDEX_SCALE); + public static final int LOG2_ARRAY_INT_INDEX_SCALE = exactLog2(Unsafe.ARRAY_INT_INDEX_SCALE); + public static final int LOG2_ARRAY_LONG_INDEX_SCALE = exactLog2(Unsafe.ARRAY_LONG_INDEX_SCALE); + public static final int LOG2_ARRAY_FLOAT_INDEX_SCALE = exactLog2(Unsafe.ARRAY_FLOAT_INDEX_SCALE); + public static final int LOG2_ARRAY_DOUBLE_INDEX_SCALE = exactLog2(Unsafe.ARRAY_DOUBLE_INDEX_SCALE); private static final int LOG2_BYTE_BIT_SIZE = exactLog2(Byte.SIZE); @@ -107,10 +107,10 @@ class ArraysSupport { * the tail of the two arrays. */ @HotSpotIntrinsicCandidate - static int vectorizedMismatch(Object a, long aOffset, - Object b, long bOffset, - int length, - int log2ArrayIndexScale) { + public static int vectorizedMismatch(Object a, long aOffset, + Object b, long bOffset, + int length, + int log2ArrayIndexScale) { // assert a.getClass().isArray(); // assert b.getClass().isArray(); // assert 0 <= length <= sizeOf(a) @@ -161,9 +161,9 @@ class ArraysSupport { // Booleans // Each boolean element takes up one byte - static int mismatch(boolean[] a, - boolean[] b, - int length) { + public static int mismatch(boolean[] a, + boolean[] b, + int length) { int i = 0; if (length > 7) { i = vectorizedMismatch( @@ -181,9 +181,9 @@ class ArraysSupport { return -1; } - static int mismatch(boolean[] a, int aFromIndex, - boolean[] b, int bFromIndex, - int length) { + public static int mismatch(boolean[] a, int aFromIndex, + boolean[] b, int bFromIndex, + int length) { int i = 0; if (length > 7) { int aOffset = Unsafe.ARRAY_BOOLEAN_BASE_OFFSET + aFromIndex; @@ -219,9 +219,9 @@ class ArraysSupport { * no mismatch. The index will be within the range of (inclusive) 0 to * (exclusive) the smaller of the two array lengths. */ - static int mismatch(byte[] a, - byte[] b, - int length) { + public static int mismatch(byte[] a, + byte[] b, + int length) { // ISSUE: defer to index receiving methods if performance is good // assert length <= a.length // assert length <= b.length @@ -264,9 +264,9 @@ class ArraysSupport { * otherwise -1 if no mismatch. The index will be within the range of * (inclusive) 0 to (exclusive) the smaller of the two array bounds. */ - static int mismatch(byte[] a, int aFromIndex, - byte[] b, int bFromIndex, - int length) { + public static int mismatch(byte[] a, int aFromIndex, + byte[] b, int bFromIndex, + int length) { // assert 0 <= aFromIndex < a.length // assert 0 <= aFromIndex + length <= a.length // assert 0 <= bFromIndex < b.length @@ -295,9 +295,9 @@ class ArraysSupport { // Chars - static int mismatch(char[] a, - char[] b, - int length) { + public static int mismatch(char[] a, + char[] b, + int length) { int i = 0; if (length > 3) { i = vectorizedMismatch( @@ -315,9 +315,9 @@ class ArraysSupport { return -1; } - static int mismatch(char[] a, int aFromIndex, - char[] b, int bFromIndex, - int length) { + public static int mismatch(char[] a, int aFromIndex, + char[] b, int bFromIndex, + int length) { int i = 0; if (length > 3) { int aOffset = Unsafe.ARRAY_CHAR_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_CHAR_INDEX_SCALE); @@ -340,9 +340,9 @@ class ArraysSupport { // Shorts - static int mismatch(short[] a, - short[] b, - int length) { + public static int mismatch(short[] a, + short[] b, + int length) { int i = 0; if (length > 3) { i = vectorizedMismatch( @@ -360,9 +360,9 @@ class ArraysSupport { return -1; } - static int mismatch(short[] a, int aFromIndex, - short[] b, int bFromIndex, - int length) { + public static int mismatch(short[] a, int aFromIndex, + short[] b, int bFromIndex, + int length) { int i = 0; if (length > 3) { int aOffset = Unsafe.ARRAY_SHORT_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_SHORT_INDEX_SCALE); @@ -385,9 +385,9 @@ class ArraysSupport { // Ints - static int mismatch(int[] a, - int[] b, - int length) { + public static int mismatch(int[] a, + int[] b, + int length) { int i = 0; if (length > 1) { i = vectorizedMismatch( @@ -405,9 +405,9 @@ class ArraysSupport { return -1; } - static int mismatch(int[] a, int aFromIndex, - int[] b, int bFromIndex, - int length) { + public static int mismatch(int[] a, int aFromIndex, + int[] b, int bFromIndex, + int length) { int i = 0; if (length > 1) { int aOffset = Unsafe.ARRAY_INT_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_INT_INDEX_SCALE); @@ -430,15 +430,15 @@ class ArraysSupport { // Floats - static int mismatch(float[] a, - float[] b, - int length) { + public static int mismatch(float[] a, + float[] b, + int length) { return mismatch(a, 0, b, 0, length); } - static int mismatch(float[] a, int aFromIndex, - float[] b, int bFromIndex, - int length) { + public static int mismatch(float[] a, int aFromIndex, + float[] b, int bFromIndex, + int length) { int i = 0; if (length > 1) { int aOffset = Unsafe.ARRAY_FLOAT_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_FLOAT_INDEX_SCALE); @@ -475,9 +475,9 @@ class ArraysSupport { // Long - static int mismatch(long[] a, - long[] b, - int length) { + public static int mismatch(long[] a, + long[] b, + int length) { if (length == 0) { return -1; } @@ -488,9 +488,9 @@ class ArraysSupport { return i >= 0 ? i : -1; } - static int mismatch(long[] a, int aFromIndex, - long[] b, int bFromIndex, - int length) { + public static int mismatch(long[] a, int aFromIndex, + long[] b, int bFromIndex, + int length) { if (length == 0) { return -1; } @@ -506,15 +506,15 @@ class ArraysSupport { // Double - static int mismatch(double[] a, - double[] b, - int length) { + public static int mismatch(double[] a, + double[] b, + int length) { return mismatch(a, 0, b, 0, length); } - static int mismatch(double[] a, int aFromIndex, - double[] b, int bFromIndex, - int length) { + public static int mismatch(double[] a, int aFromIndex, + double[] b, int bFromIndex, + int length) { if (length == 0) { return -1; } diff --git a/src/java.base/share/classes/module-info.java b/src/java.base/share/classes/module-info.java index 7e06bf0b8ac..3b1f998b4b1 100644 --- a/src/java.base/share/classes/module-info.java +++ b/src/java.base/share/classes/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -142,7 +142,7 @@ module java.base { java.instrument, java.logging; exports jdk.internal.jmod to - jdk.compiler, // reflective dependency + jdk.compiler, jdk.jlink; exports jdk.internal.logger to java.logging; @@ -172,7 +172,7 @@ module java.base { java.xml, jdk.attach, jdk.charsets, - jdk.compiler, // reflective dependency + jdk.compiler, jdk.incubator.httpclient, jdk.jdeps, jdk.jlink, diff --git a/src/java.base/share/classes/sun/invoke/util/Wrapper.java b/src/java.base/share/classes/sun/invoke/util/Wrapper.java index 9f1f31218b4..a9005ed421d 100644 --- a/src/java.base/share/classes/sun/invoke/util/Wrapper.java +++ b/src/java.base/share/classes/sun/invoke/util/Wrapper.java @@ -273,6 +273,25 @@ public enum Wrapper { throw newIllegalArgumentException("not primitive: "+type); } + /** Return the wrapper that corresponds to the provided basic type char. + * The basic type char must be for one of the eight primitive types, or void. + * @throws IllegalArgumentException for unexpected types + */ + public static Wrapper forPrimitiveType(char basicTypeChar) { + switch (basicTypeChar) { + case 'I': return INT; + case 'J': return LONG; + case 'S': return SHORT; + case 'B': return BYTE; + case 'C': return CHAR; + case 'F': return FLOAT; + case 'D': return DOUBLE; + case 'Z': return BOOLEAN; + case 'V': return VOID; + default: throw newIllegalArgumentException("not primitive: " + basicTypeChar); + } + } + static Wrapper findPrimitiveType(Class type) { Wrapper w = FROM_PRIM[hashPrim(type)]; if (w != null && w.primitiveType == type) { diff --git a/src/java.base/share/classes/sun/nio/ch/AsynchronousFileChannelImpl.java b/src/java.base/share/classes/sun/nio/ch/AsynchronousFileChannelImpl.java index 5b96c18b82d..2ca1f8a87b8 100644 --- a/src/java.base/share/classes/sun/nio/ch/AsynchronousFileChannelImpl.java +++ b/src/java.base/share/classes/sun/nio/ch/AsynchronousFileChannelImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -136,7 +136,7 @@ abstract class AsynchronousFileChannelImpl if (fileLockTable == null) { synchronized (this) { if (fileLockTable == null) { - fileLockTable = FileLockTable.newSharedFileLockTable(this, fdObj); + fileLockTable = new FileLockTable(this, fdObj); } } } diff --git a/src/java.base/share/classes/sun/nio/ch/DatagramChannelImpl.java b/src/java.base/share/classes/sun/nio/ch/DatagramChannelImpl.java index c4d508070d4..77a0d593ff3 100644 --- a/src/java.base/share/classes/sun/nio/ch/DatagramChannelImpl.java +++ b/src/java.base/share/classes/sun/nio/ch/DatagramChannelImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,11 +27,32 @@ package sun.nio.ch; import java.io.FileDescriptor; import java.io.IOException; -import java.net.*; +import java.net.DatagramSocket; +import java.net.Inet4Address; +import java.net.Inet6Address; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.NetworkInterface; +import java.net.PortUnreachableException; +import java.net.ProtocolFamily; +import java.net.SocketAddress; +import java.net.SocketOption; +import java.net.StandardProtocolFamily; +import java.net.StandardSocketOptions; import java.nio.ByteBuffer; -import java.nio.channels.*; -import java.nio.channels.spi.*; -import java.util.*; +import java.nio.channels.AlreadyBoundException; +import java.nio.channels.ClosedChannelException; +import java.nio.channels.DatagramChannel; +import java.nio.channels.MembershipKey; +import java.nio.channels.NotYetConnectedException; +import java.nio.channels.SelectionKey; +import java.nio.channels.UnsupportedAddressTypeException; +import java.nio.channels.spi.SelectorProvider; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.locks.ReentrantLock; + import sun.net.ResourceManager; import sun.net.ext.ExtendedSocketOptions; @@ -49,9 +70,6 @@ class DatagramChannelImpl // Our file descriptor private final FileDescriptor fd; - - // fd value needed for dev/poll. This value will remain valid - // even after the value in the file descriptor object has been set to -1 private final int fdVal; // The protocol family of the socket @@ -67,10 +85,10 @@ class DatagramChannelImpl private int cachedSenderPort; // Lock held by current reading or connecting thread - private final Object readLock = new Object(); + private final ReentrantLock readLock = new ReentrantLock(); // Lock held by current writing or connecting thread - private final Object writeLock = new Object(); + private final ReentrantLock writeLock = new ReentrantLock(); // Lock held by any thread that modifies the state fields declared below // DO NOT invoke a blocking I/O operation while holding this lock! @@ -103,7 +121,6 @@ class DatagramChannelImpl // -- End of fields protected by stateLock - public DatagramChannelImpl(SelectorProvider sp) throws IOException { @@ -138,16 +155,27 @@ class DatagramChannelImpl throw new UnsupportedOperationException("IPv6 not available"); } } - this.family = family; - this.fd = Net.socket(family, false); - this.fdVal = IOUtil.fdVal(fd); - this.state = ST_UNCONNECTED; + + ResourceManager.beforeUdpCreate(); + try { + this.family = family; + this.fd = Net.socket(family, false); + this.fdVal = IOUtil.fdVal(fd); + this.state = ST_UNCONNECTED; + } catch (IOException ioe) { + ResourceManager.afterUdpClose(); + throw ioe; + } } public DatagramChannelImpl(SelectorProvider sp, FileDescriptor fd) throws IOException { super(sp); + + // increment UDP count to match decrement when closing + ResourceManager.beforeUdpCreate(); + this.family = Net.isIPv6Available() ? StandardProtocolFamily.INET6 : StandardProtocolFamily.INET; this.fd = fd; @@ -328,7 +356,8 @@ class DatagramChannelImpl public SocketAddress receive(ByteBuffer dst) throws IOException { if (dst.isReadOnly()) throw new IllegalArgumentException("Read-only buffer"); - synchronized (readLock) { + readLock.lock(); + try { ensureOpen(); // Socket was not bound before attempting receive if (localAddress() == null) @@ -348,6 +377,8 @@ class DatagramChannelImpl if (n == IOStatus.UNAVAILABLE) return null; } else { + // Cannot receive into user's buffer when running with a + // security manager and not connected bb = Util.getTemporaryDirectBuffer(dst.remaining()); for (;;) { do { @@ -379,6 +410,8 @@ class DatagramChannelImpl end((n > 0) || (n == IOStatus.UNAVAILABLE)); assert IOStatus.check(n); } + } finally { + readLock.unlock(); } } @@ -425,7 +458,8 @@ class DatagramChannelImpl if (src == null) throw new NullPointerException(); - synchronized (writeLock) { + writeLock.lock(); + try { ensureOpen(); InetSocketAddress isa = Net.checkAddress(target); InetAddress ia = isa.getAddress(); @@ -474,6 +508,8 @@ class DatagramChannelImpl end((n > 0) || (n == IOStatus.UNAVAILABLE)); assert IOStatus.check(n); } + } finally { + writeLock.unlock(); } } @@ -534,7 +570,8 @@ class DatagramChannelImpl public int read(ByteBuffer buf) throws IOException { if (buf == null) throw new NullPointerException(); - synchronized (readLock) { + readLock.lock(); + try { synchronized (stateLock) { ensureOpen(); if (!isConnected()) @@ -555,6 +592,8 @@ class DatagramChannelImpl end((n > 0) || (n == IOStatus.UNAVAILABLE)); assert IOStatus.check(n); } + } finally { + readLock.unlock(); } } @@ -563,7 +602,8 @@ class DatagramChannelImpl { if ((offset < 0) || (length < 0) || (offset > dsts.length - length)) throw new IndexOutOfBoundsException(); - synchronized (readLock) { + readLock.lock(); + try { synchronized (stateLock) { ensureOpen(); if (!isConnected()) @@ -584,13 +624,16 @@ class DatagramChannelImpl end((n > 0) || (n == IOStatus.UNAVAILABLE)); assert IOStatus.check(n); } + } finally { + readLock.unlock(); } } public int write(ByteBuffer buf) throws IOException { if (buf == null) throw new NullPointerException(); - synchronized (writeLock) { + writeLock.lock(); + try { synchronized (stateLock) { ensureOpen(); if (!isConnected()) @@ -611,6 +654,8 @@ class DatagramChannelImpl end((n > 0) || (n == IOStatus.UNAVAILABLE)); assert IOStatus.check(n); } + } finally { + writeLock.unlock(); } } @@ -619,7 +664,8 @@ class DatagramChannelImpl { if ((offset < 0) || (length < 0) || (offset > srcs.length - length)) throw new IndexOutOfBoundsException(); - synchronized (writeLock) { + writeLock.lock(); + try { synchronized (stateLock) { ensureOpen(); if (!isConnected()) @@ -640,6 +686,8 @@ class DatagramChannelImpl end((n > 0) || (n == IOStatus.UNAVAILABLE)); assert IOStatus.check(n); } + } finally { + writeLock.unlock(); } } @@ -661,8 +709,10 @@ class DatagramChannelImpl @Override public DatagramChannel bind(SocketAddress local) throws IOException { - synchronized (readLock) { - synchronized (writeLock) { + readLock.lock(); + try { + writeLock.lock(); + try { synchronized (stateLock) { ensureOpen(); if (localAddress != null) @@ -692,7 +742,11 @@ class DatagramChannelImpl Net.bind(family, fd, isa.getAddress(), isa.getPort()); localAddress = Net.localAddress(fd); } + } finally { + writeLock.unlock(); } + } finally { + readLock.unlock(); } return this; } @@ -714,8 +768,10 @@ class DatagramChannelImpl @Override public DatagramChannel connect(SocketAddress sa) throws IOException { - synchronized(readLock) { - synchronized(writeLock) { + readLock.lock(); + try { + writeLock.lock(); + try { synchronized (stateLock) { ensureOpenAndUnconnected(); InetSocketAddress isa = Net.checkAddress(sa); @@ -741,10 +797,9 @@ class DatagramChannelImpl localAddress = Net.localAddress(fd); // flush any packets already received. - boolean blocking = false; synchronized (blockingLock()) { + boolean blocking = isBlocking(); try { - blocking = isBlocking(); ByteBuffer tmpBuf = ByteBuffer.allocate(100); if (blocking) { configureBlocking(false); @@ -759,14 +814,20 @@ class DatagramChannelImpl } } } + } finally { + writeLock.unlock(); } + } finally { + readLock.unlock(); } return this; } public DatagramChannel disconnect() throws IOException { - synchronized(readLock) { - synchronized(writeLock) { + readLock.lock(); + try { + writeLock.lock(); + try { synchronized (stateLock) { if (!isConnected() || !isOpen()) return this; @@ -783,7 +844,11 @@ class DatagramChannelImpl // refresh local address localAddress = Net.localAddress(fd); } + } finally { + writeLock.unlock(); } + } finally { + readLock.unlock(); } return this; } @@ -1087,7 +1152,8 @@ class DatagramChannelImpl int poll(int events, long timeout) throws IOException { assert Thread.holdsLock(blockingLock()) && !isBlocking(); - synchronized (readLock) { + readLock.lock(); + try { int n = 0; try { begin(); @@ -1102,6 +1168,8 @@ class DatagramChannelImpl end(n > 0); } return n; + } finally { + readLock.unlock(); } } diff --git a/src/java.base/share/classes/sun/nio/ch/DatagramSocketAdaptor.java b/src/java.base/share/classes/sun/nio/ch/DatagramSocketAdaptor.java index fa1eae73d59..0747a496ec9 100644 --- a/src/java.base/share/classes/sun/nio/ch/DatagramSocketAdaptor.java +++ b/src/java.base/share/classes/sun/nio/ch/DatagramSocketAdaptor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,10 +25,22 @@ package sun.nio.ch; -import java.io.*; -import java.net.*; -import java.nio.*; -import java.nio.channels.*; +import java.io.IOException; +import java.net.DatagramPacket; +import java.net.DatagramSocket; +import java.net.DatagramSocketImpl; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.NetworkInterface; +import java.net.SocketAddress; +import java.net.SocketException; +import java.net.SocketOption; +import java.net.SocketTimeoutException; +import java.net.StandardSocketOptions; +import java.nio.ByteBuffer; +import java.nio.channels.ClosedChannelException; +import java.nio.channels.DatagramChannel; +import java.nio.channels.IllegalBlockingModeException; // Make a datagram-socket channel look like a datagram socket. @@ -178,7 +190,6 @@ public class DatagramSocketAdaptor dc.configureBlocking(false); try { - int n; SocketAddress sender; if ((sender = dc.receive(bb)) != null) return sender; @@ -188,19 +199,18 @@ public class DatagramSocketAdaptor throw new ClosedChannelException(); long st = System.currentTimeMillis(); int result = dc.poll(Net.POLLIN, to); - if (result > 0 && - ((result & Net.POLLIN) != 0)) { + if (result > 0 && ((result & Net.POLLIN) != 0)) { if ((sender = dc.receive(bb)) != null) return sender; } to -= System.currentTimeMillis() - st; if (to <= 0) throw new SocketTimeoutException(); - } } finally { - if (dc.isOpen()) + try { dc.configureBlocking(true); + } catch (ClosedChannelException e) { } } } diff --git a/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java b/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java index 274a17851e2..1ffb1ea0bfb 100644 --- a/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java +++ b/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1083,49 +1083,19 @@ public class FileChannelImpl // -- Locks -- - - // keeps track of locks on this file private volatile FileLockTable fileLockTable; - // indicates if file locks are maintained system-wide (as per spec) - private static boolean isSharedFileLockTable; - - // indicates if the disableSystemWideOverlappingFileLockCheck property - // has been checked - private static volatile boolean propertyChecked; - - // The lock list in J2SE 1.4/5.0 was local to each FileChannel instance so - // the overlap check wasn't system wide when there were multiple channels to - // the same file. This property is used to get 1.4/5.0 behavior if desired. - private static boolean isSharedFileLockTable() { - if (!propertyChecked) { - synchronized (FileChannelImpl.class) { - if (!propertyChecked) { - String value = GetPropertyAction.privilegedGetProperty( - "sun.nio.ch.disableSystemWideOverlappingFileLockCheck"); - isSharedFileLockTable = ((value == null) || value.equals("false")); - propertyChecked = true; - } - } - } - return isSharedFileLockTable; - } - private FileLockTable fileLockTable() throws IOException { if (fileLockTable == null) { synchronized (this) { if (fileLockTable == null) { - if (isSharedFileLockTable()) { - int ti = threads.add(); - try { - ensureOpen(); - fileLockTable = FileLockTable.newSharedFileLockTable(this, fd); - } finally { - threads.remove(ti); - } - } else { - fileLockTable = new SimpleFileLockTable(); + int ti = threads.add(); + try { + ensureOpen(); + fileLockTable = new FileLockTable(this, fd); + } finally { + threads.remove(ti); } } } @@ -1229,59 +1199,6 @@ public class FileChannelImpl fileLockTable.remove(fli); } - // -- File lock support -- - - /** - * A simple file lock table that maintains a list of FileLocks obtained by a - * FileChannel. Use to get 1.4/5.0 behaviour. - */ - private static class SimpleFileLockTable extends FileLockTable { - // synchronize on list for access - private final List lockList = new ArrayList(2); - - public SimpleFileLockTable() { - } - - private void checkList(long position, long size) - throws OverlappingFileLockException - { - assert Thread.holdsLock(lockList); - for (FileLock fl: lockList) { - if (fl.overlaps(position, size)) { - throw new OverlappingFileLockException(); - } - } - } - - public void add(FileLock fl) throws OverlappingFileLockException { - synchronized (lockList) { - checkList(fl.position(), fl.size()); - lockList.add(fl); - } - } - - public void remove(FileLock fl) { - synchronized (lockList) { - lockList.remove(fl); - } - } - - public List removeAll() { - synchronized(lockList) { - List result = new ArrayList(lockList); - lockList.clear(); - return result; - } - } - - public void replace(FileLock fl1, FileLock fl2) { - synchronized (lockList) { - lockList.remove(fl1); - lockList.add(fl2); - } - } - } - // -- Native methods -- // Creates a new mapping diff --git a/src/java.base/share/classes/sun/nio/ch/FileLockTable.java b/src/java.base/share/classes/sun/nio/ch/FileLockTable.java index e77e1c4cec7..9b7b7081f94 100644 --- a/src/java.base/share/classes/sun/nio/ch/FileLockTable.java +++ b/src/java.base/share/classes/sun/nio/ch/FileLockTable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,64 +25,27 @@ package sun.nio.ch; -import java.nio.channels.*; -import java.util.*; -import java.util.concurrent.ConcurrentHashMap; -import java.lang.ref.*; import java.io.FileDescriptor; import java.io.IOException; - -abstract class FileLockTable { - protected FileLockTable() { - } - - /** - * Creates and returns a file lock table for a channel that is connected to - * the a system-wide map of all file locks for the Java virtual machine. - */ - public static FileLockTable newSharedFileLockTable(Channel channel, - FileDescriptor fd) - throws IOException - { - return new SharedFileLockTable(channel, fd); - } - - /** - * Adds a file lock to the table. - * - * @throws OverlappingFileLockException if the file lock overlaps - * with an existing file lock in the table - */ - public abstract void add(FileLock fl) throws OverlappingFileLockException; - - /** - * Remove an existing file lock from the table. - */ - public abstract void remove(FileLock fl); - - /** - * Removes all file locks from the table. - * - * @return The list of file locks removed - */ - public abstract List removeAll(); - - /** - * Replaces an existing file lock in the table. - */ - public abstract void replace(FileLock fl1, FileLock fl2); -} - +import java.lang.ref.ReferenceQueue; +import java.lang.ref.WeakReference; +import java.nio.channels.Channel; +import java.nio.channels.FileLock; +import java.nio.channels.OverlappingFileLockException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; /** * A file lock table that is over a system-wide map of all file locks. */ -class SharedFileLockTable extends FileLockTable { - +class FileLockTable { /** * A weak reference to a FileLock. *

            - * SharedFileLockTable uses a list of file lock references to avoid keeping the + * FileLockTable uses a list of file lock references to avoid keeping the * FileLock (and FileChannel) alive. */ private static class FileLockReference extends WeakReference { @@ -115,13 +78,20 @@ class SharedFileLockTable extends FileLockTable { // File key for the file that this channel is connected to private final FileKey fileKey; - SharedFileLockTable(Channel channel, FileDescriptor fd) throws IOException { + // Locks obtained for this channel + private final Set locks; + + /** + * Creates a file lock table for a channel that is connected to the + * system-wide map of all file locks for the Java virtual machine. + */ + FileLockTable(Channel channel, FileDescriptor fd) throws IOException { this.channel = channel; this.fileKey = FileKey.create(fd); + this.locks = new HashSet(); } - @Override - public void add(FileLock fl) throws OverlappingFileLockException { + void add(FileLock fl) throws OverlappingFileLockException { List list = lockMap.get(fileKey); for (;;) { @@ -135,6 +105,7 @@ class SharedFileLockTable extends FileLockTable { if (prev == null) { // we successfully created the key so we add the file lock list.add(new FileLockReference(fl, queue, fileKey)); + locks.add(fl); break; } } @@ -151,6 +122,7 @@ class SharedFileLockTable extends FileLockTable { if (list == current) { checkList(list, fl.position(), fl.size()); list.add(new FileLockReference(fl, queue, fileKey)); + locks.add(fl); break; } list = current; @@ -170,8 +142,7 @@ class SharedFileLockTable extends FileLockTable { } } - @Override - public void remove(FileLock fl) { + void remove(FileLock fl) { assert fl != null; // the lock must exist so the list of locks must be present @@ -187,6 +158,7 @@ class SharedFileLockTable extends FileLockTable { assert (lock != null) && (lock.acquiredBy() == channel); ref.clear(); list.remove(index); + locks.remove(fl); break; } index++; @@ -194,8 +166,7 @@ class SharedFileLockTable extends FileLockTable { } } - @Override - public List removeAll() { + List removeAll() { List result = new ArrayList(); List list = lockMap.get(fileKey); if (list != null) { @@ -220,13 +191,14 @@ class SharedFileLockTable extends FileLockTable { // once the lock list is empty we remove it from the map removeKeyIfEmpty(fileKey, list); + + locks.clear(); } } return result; } - @Override - public void replace(FileLock fromLock, FileLock toLock) { + void replace(FileLock fromLock, FileLock toLock) { // the lock must exist so there must be a list List list = lockMap.get(fileKey); assert list != null; @@ -238,6 +210,8 @@ class SharedFileLockTable extends FileLockTable { if (lock == fromLock) { ref.clear(); list.set(index, new FileLockReference(toLock, queue, fileKey)); + locks.remove(fromLock); + locks.add(toLock); break; } } diff --git a/src/java.base/share/classes/sun/nio/ch/IOUtil.java b/src/java.base/share/classes/sun/nio/ch/IOUtil.java index cb30ca32efe..fd5a6d33182 100644 --- a/src/java.base/share/classes/sun/nio/ch/IOUtil.java +++ b/src/java.base/share/classes/sun/nio/ch/IOUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -78,7 +78,7 @@ public class IOUtil { src.position(pos); int n = writeFromNativeBuffer(fd, bb, position, - directIO, alignment, nd); + directIO, alignment, nd); if (n > 0) { // now update src src.position(pos + n); @@ -161,8 +161,7 @@ public class IOUtil { if (!(buf instanceof DirectBuffer)) { ByteBuffer shadow; if (directIO) - shadow = Util.getTemporaryAlignedDirectBuffer(rem, - alignment); + shadow = Util.getTemporaryAlignedDirectBuffer(rem, alignment); else shadow = Util.getTemporaryDirectBuffer(rem); shadow.put(buf); @@ -241,8 +240,7 @@ public class IOUtil { int rem = dst.remaining(); if (directIO) { Util.checkRemainingBufferSizeAligned(rem, alignment); - bb = Util.getTemporaryAlignedDirectBuffer(rem, - alignment); + bb = Util.getTemporaryAlignedDirectBuffer(rem, alignment); } else { bb = Util.getTemporaryDirectBuffer(rem); } @@ -277,8 +275,7 @@ public class IOUtil { return 0; int n = 0; if (position != -1) { - n = nd.pread(fd, ((DirectBuffer)bb).address() + pos, - rem, position); + n = nd.pread(fd, ((DirectBuffer)bb).address() + pos, rem, position); } else { n = nd.read(fd, ((DirectBuffer)bb).address() + pos, rem); } @@ -332,8 +329,7 @@ public class IOUtil { if (!(buf instanceof DirectBuffer)) { ByteBuffer shadow; if (directIO) { - shadow = Util.getTemporaryAlignedDirectBuffer(rem, - alignment); + shadow = Util.getTemporaryAlignedDirectBuffer(rem, alignment); } else { shadow = Util.getTemporaryDirectBuffer(rem); } diff --git a/src/java.base/share/classes/sun/nio/ch/ServerSocketAdaptor.java b/src/java.base/share/classes/sun/nio/ch/ServerSocketAdaptor.java index 11d16b6068f..9069d6b73a6 100644 --- a/src/java.base/share/classes/sun/nio/ch/ServerSocketAdaptor.java +++ b/src/java.base/share/classes/sun/nio/ch/ServerSocketAdaptor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,9 +25,20 @@ package sun.nio.ch; -import java.io.*; -import java.net.*; -import java.nio.channels.*; +import java.io.IOException; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.ServerSocket; +import java.net.Socket; +import java.net.SocketAddress; +import java.net.SocketException; +import java.net.SocketTimeoutException; +import java.net.StandardSocketOptions; +import java.nio.channels.ClosedChannelException; +import java.nio.channels.IllegalBlockingModeException; +import java.nio.channels.NotYetBoundException; +import java.nio.channels.ServerSocketChannel; +import java.nio.channels.SocketChannel; // Make a server-socket channel look like a server socket. @@ -37,7 +48,7 @@ import java.nio.channels.*; // class. // -public class ServerSocketAdaptor // package-private +class ServerSocketAdaptor // package-private extends ServerSocket { @@ -96,13 +107,18 @@ public class ServerSocketAdaptor // package-private try { if (!ssc.isBound()) throw new NotYetBoundException(); + if (timeout == 0) { + // for compatibility reasons: accept connection if available + // when configured non-blocking SocketChannel sc = ssc.accept(); if (sc == null && !ssc.isBlocking()) throw new IllegalBlockingModeException(); return sc.socket(); } + if (!ssc.isBlocking()) + throw new IllegalBlockingModeException(); ssc.configureBlocking(false); try { SocketChannel sc; @@ -121,10 +137,10 @@ public class ServerSocketAdaptor // package-private throw new SocketTimeoutException(); } } finally { - if (ssc.isOpen()) + try { ssc.configureBlocking(true); + } catch (ClosedChannelException e) { } } - } catch (Exception x) { Net.translateException(x); assert false; @@ -178,8 +194,7 @@ public class ServerSocketAdaptor // package-private if (!isBound()) return "ServerSocket[unbound]"; return "ServerSocket[addr=" + getInetAddress() + - // ",port=" + getPort() + - ",localport=" + getLocalPort() + "]"; + ",localport=" + getLocalPort() + "]"; } public void setReceiveBufferSize(int size) throws SocketException { diff --git a/src/java.base/share/classes/sun/nio/ch/ServerSocketChannelImpl.java b/src/java.base/share/classes/sun/nio/ch/ServerSocketChannelImpl.java index 9cfe7c43c4d..45bef138fc8 100644 --- a/src/java.base/share/classes/sun/nio/ch/ServerSocketChannelImpl.java +++ b/src/java.base/share/classes/sun/nio/ch/ServerSocketChannelImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,10 +27,25 @@ package sun.nio.ch; import java.io.FileDescriptor; import java.io.IOException; -import java.net.*; -import java.nio.channels.*; -import java.nio.channels.spi.*; -import java.util.*; +import java.net.InetSocketAddress; +import java.net.ProtocolFamily; +import java.net.ServerSocket; +import java.net.SocketAddress; +import java.net.SocketOption; +import java.net.StandardProtocolFamily; +import java.net.StandardSocketOptions; +import java.nio.channels.AlreadyBoundException; +import java.nio.channels.ClosedChannelException; +import java.nio.channels.NotYetBoundException; +import java.nio.channels.SelectionKey; +import java.nio.channels.ServerSocketChannel; +import java.nio.channels.SocketChannel; +import java.nio.channels.spi.SelectorProvider; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.locks.ReentrantLock; + import sun.net.NetHooks; /** @@ -47,16 +62,13 @@ class ServerSocketChannelImpl // Our file descriptor private final FileDescriptor fd; - - // fd value needed for dev/poll. This value will remain valid - // even after the value in the file descriptor object has been set to -1 - private int fdVal; + private final int fdVal; // ID of native thread currently blocked in this channel, for signalling private volatile long thread; // Lock held by thread currently blocked in this channel - private final Object lock = new Object(); + private final ReentrantLock acceptLock = new ReentrantLock(); // Lock held by any thread that modifies the state fields declared below // DO NOT invoke a blocking I/O operation while holding this lock! @@ -77,7 +89,7 @@ class ServerSocketChannelImpl private boolean isReuseAddress; // Our socket adaptor, if any - ServerSocket socket; + private ServerSocket socket; // -- End of fields protected by stateLock @@ -211,7 +223,8 @@ class ServerSocketChannelImpl @Override public ServerSocketChannel bind(SocketAddress local, int backlog) throws IOException { - synchronized (lock) { + acceptLock.lock(); + try { if (!isOpen()) throw new ClosedChannelException(); if (isBound()) @@ -227,12 +240,15 @@ class ServerSocketChannelImpl synchronized (stateLock) { localAddress = Net.localAddress(fd); } + } finally { + acceptLock.unlock(); } return this; } public SocketChannel accept() throws IOException { - synchronized (lock) { + acceptLock.lock(); + try { if (!isOpen()) throw new ClosedChannelException(); if (!isBound()) @@ -278,6 +294,8 @@ class ServerSocketChannelImpl } return sc; + } finally { + acceptLock.unlock(); } } @@ -353,7 +371,8 @@ class ServerSocketChannelImpl int poll(int events, long timeout) throws IOException { assert Thread.holdsLock(blockingLock()) && !isBlocking(); - synchronized (lock) { + acceptLock.lock(); + try { int n = 0; try { begin(); @@ -368,6 +387,8 @@ class ServerSocketChannelImpl end(n > 0); } return n; + } finally { + acceptLock.unlock(); } } diff --git a/src/java.base/share/classes/sun/nio/ch/SocketAdaptor.java b/src/java.base/share/classes/sun/nio/ch/SocketAdaptor.java index 68d795b3441..60466f845e7 100644 --- a/src/java.base/share/classes/sun/nio/ch/SocketAdaptor.java +++ b/src/java.base/share/classes/sun/nio/ch/SocketAdaptor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,10 +25,23 @@ package sun.nio.ch; -import java.io.*; -import java.net.*; -import java.nio.*; -import java.nio.channels.*; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.Socket; +import java.net.SocketAddress; +import java.net.SocketException; +import java.net.SocketImpl; +import java.net.SocketOption; +import java.net.SocketTimeoutException; +import java.net.StandardSocketOptions; +import java.nio.ByteBuffer; +import java.nio.channels.Channels; +import java.nio.channels.ClosedChannelException; +import java.nio.channels.IllegalBlockingModeException; +import java.nio.channels.SocketChannel; import java.security.AccessController; import java.security.PrivilegedExceptionAction; import java.util.concurrent.TimeUnit; @@ -45,7 +58,7 @@ import java.util.concurrent.TimeUnit; // java.net.Socket so as to simplify tracking future changes to that class. // -public class SocketAdaptor +class SocketAdaptor extends Socket { @@ -89,7 +102,6 @@ public class SocketAdaptor throw new IllegalBlockingModeException(); try { - if (timeout == 0) { sc.connect(remote); return; @@ -119,8 +131,9 @@ public class SocketAdaptor } } } finally { - if (sc.isOpen()) + try { sc.configureBlocking(true); + } catch (ClosedChannelException e) { } } } catch (Exception x) { @@ -188,10 +201,11 @@ public class SocketAdaptor synchronized (sc.blockingLock()) { if (!sc.isBlocking()) throw new IllegalBlockingModeException(); + if (timeout == 0) return sc.read(bb); - sc.configureBlocking(false); + sc.configureBlocking(false); try { int n; if ((n = sc.read(bb)) != 0) @@ -213,10 +227,10 @@ public class SocketAdaptor throw new SocketTimeoutException(); } } finally { - if (sc.isOpen()) + try { sc.configureBlocking(true); + } catch (ClosedChannelException e) { } } - } } } diff --git a/src/java.base/share/classes/sun/nio/ch/SocketChannelImpl.java b/src/java.base/share/classes/sun/nio/ch/SocketChannelImpl.java index 8e21e522079..134fb813c71 100644 --- a/src/java.base/share/classes/sun/nio/ch/SocketChannelImpl.java +++ b/src/java.base/share/classes/sun/nio/ch/SocketChannelImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,11 +27,30 @@ package sun.nio.ch; import java.io.FileDescriptor; import java.io.IOException; -import java.net.*; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.ProtocolFamily; +import java.net.Socket; +import java.net.SocketAddress; +import java.net.SocketOption; +import java.net.StandardProtocolFamily; +import java.net.StandardSocketOptions; import java.nio.ByteBuffer; -import java.nio.channels.*; -import java.nio.channels.spi.*; -import java.util.*; +import java.nio.channels.AlreadyBoundException; +import java.nio.channels.AlreadyConnectedException; +import java.nio.channels.AsynchronousCloseException; +import java.nio.channels.ClosedChannelException; +import java.nio.channels.ConnectionPendingException; +import java.nio.channels.NoConnectionPendingException; +import java.nio.channels.NotYetConnectedException; +import java.nio.channels.SelectionKey; +import java.nio.channels.SocketChannel; +import java.nio.channels.spi.SelectorProvider; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.locks.ReentrantLock; + import sun.net.NetHooks; import sun.net.ext.ExtendedSocketOptions; @@ -49,9 +68,6 @@ class SocketChannelImpl // Our file descriptor object private final FileDescriptor fd; - - // fd value needed for dev/poll. This value will remain valid - // even after the value in the file descriptor object has been set to -1 private final int fdVal; // IDs of native threads doing reads and writes, for signalling @@ -59,10 +75,10 @@ class SocketChannelImpl private volatile long writerThread; // Lock held by current reading or connecting thread - private final Object readLock = new Object(); + private final ReentrantLock readLock = new ReentrantLock(); // Lock held by current writing or connecting thread - private final Object writeLock = new Object(); + private final ReentrantLock writeLock = new ReentrantLock(); // Lock held by any thread that modifies the state fields declared below // DO NOT invoke a blocking I/O operation while holding this lock! @@ -89,7 +105,6 @@ class SocketChannelImpl // Input/Output open private boolean isInputOpen = true; private boolean isOutputOpen = true; - private boolean readyToConnect = false; // Socket adaptor, created on demand private Socket socket; @@ -298,7 +313,8 @@ class SocketChannelImpl if (buf == null) throw new NullPointerException(); - synchronized (readLock) { + readLock.lock(); + try { if (!ensureReadOpen()) return -1; int n = 0; @@ -418,6 +434,8 @@ class SocketChannelImpl assert IOStatus.check(n); } + } finally { + readLock.unlock(); } } @@ -426,7 +444,8 @@ class SocketChannelImpl { if ((offset < 0) || (length < 0) || (offset > dsts.length - length)) throw new IndexOutOfBoundsException(); - synchronized (readLock) { + readLock.lock(); + try { if (!ensureReadOpen()) return -1; long n = 0; @@ -453,13 +472,16 @@ class SocketChannelImpl } assert IOStatus.check(n); } + } finally { + readLock.unlock(); } } public int write(ByteBuffer buf) throws IOException { if (buf == null) throw new NullPointerException(); - synchronized (writeLock) { + writeLock.lock(); + try { ensureWriteOpen(); int n = 0; try { @@ -484,6 +506,8 @@ class SocketChannelImpl } assert IOStatus.check(n); } + } finally { + writeLock.unlock(); } } @@ -492,7 +516,8 @@ class SocketChannelImpl { if ((offset < 0) || (length < 0) || (offset > srcs.length - length)) throw new IndexOutOfBoundsException(); - synchronized (writeLock) { + writeLock.lock(); + try { ensureWriteOpen(); long n = 0; try { @@ -517,12 +542,15 @@ class SocketChannelImpl } assert IOStatus.check(n); } + } finally { + writeLock.unlock(); } } // package-private int sendOutOfBandData(byte b) throws IOException { - synchronized (writeLock) { + writeLock.lock(); + try { ensureWriteOpen(); int n = 0; try { @@ -547,6 +575,8 @@ class SocketChannelImpl } assert IOStatus.check(n); } + } finally { + writeLock.unlock(); } } @@ -568,8 +598,10 @@ class SocketChannelImpl @Override public SocketChannel bind(SocketAddress local) throws IOException { - synchronized (readLock) { - synchronized (writeLock) { + readLock.lock(); + try { + writeLock.lock(); + try { synchronized (stateLock) { if (!isOpen()) throw new ClosedChannelException(); @@ -587,7 +619,11 @@ class SocketChannelImpl Net.bind(fd, isa.getAddress(), isa.getPort()); localAddress = Net.localAddress(fd); } + } finally { + writeLock.unlock(); } + } finally { + readLock.unlock(); } return this; } @@ -616,14 +652,16 @@ class SocketChannelImpl } public boolean connect(SocketAddress sa) throws IOException { - synchronized (readLock) { - synchronized (writeLock) { + readLock.lock(); + try { + writeLock.lock(); + try { ensureOpenAndUnconnected(); InetSocketAddress isa = Net.checkAddress(sa); SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkConnect(isa.getAddress().getHostAddress(), - isa.getPort()); + isa.getPort()); synchronized (blockingLock()) { int n = 0; try { @@ -636,8 +674,8 @@ class SocketChannelImpl // notify hook only if unbound if (localAddress == null) { NetHooks.beforeTcpConnect(fd, - isa.getAddress(), - isa.getPort()); + isa.getAddress(), + isa.getPort()); } readerThread = NativeThread.current(); } @@ -646,10 +684,9 @@ class SocketChannelImpl if (ia.isAnyLocalAddress()) ia = InetAddress.getLocalHost(); n = Net.connect(fd, - ia, - isa.getPort()); - if ( (n == IOStatus.INTERRUPTED) - && isOpen()) + ia, + isa.getPort()); + if ((n == IOStatus.INTERRUPTED) && isOpen()) continue; break; } @@ -686,13 +723,19 @@ class SocketChannelImpl } } return false; + } finally { + writeLock.unlock(); } + } finally { + readLock.unlock(); } } public boolean finishConnect() throws IOException { - synchronized (readLock) { - synchronized (writeLock) { + readLock.lock(); + try { + writeLock.lock(); + try { synchronized (stateLock) { if (!isOpen()) throw new ClosedChannelException(); @@ -714,24 +757,20 @@ class SocketChannelImpl } if (!isBlocking()) { for (;;) { - n = checkConnect(fd, false, - readyToConnect); - if ( (n == IOStatus.INTERRUPTED) - && isOpen()) + n = checkConnect(fd, false); + if ((n == IOStatus.INTERRUPTED) && isOpen()) continue; break; } } else { for (;;) { - n = checkConnect(fd, true, - readyToConnect); + n = checkConnect(fd, true); if (n == 0) { // Loop in case of // spurious notifications continue; } - if ( (n == IOStatus.INTERRUPTED) - && isOpen()) + if ((n == IOStatus.INTERRUPTED) && isOpen()) continue; break; } @@ -769,7 +808,11 @@ class SocketChannelImpl return true; } return false; + } finally { + writeLock.unlock(); } + } finally { + readLock.unlock(); } } @@ -903,9 +946,6 @@ class SocketChannelImpl if ((ops & (Net.POLLERR | Net.POLLHUP)) != 0) { newOps = intOps; sk.nioReadyOps(newOps); - // No need to poll again in checkConnect, - // the error will be detected there - readyToConnect = true; return (newOps & ~oldOps) != 0; } @@ -918,7 +958,6 @@ class SocketChannelImpl ((intOps & SelectionKey.OP_CONNECT) != 0) && ((state == ST_UNCONNECTED) || (state == ST_PENDING))) { newOps |= SelectionKey.OP_CONNECT; - readyToConnect = true; } if (((ops & Net.POLLOUT) != 0) && @@ -942,7 +981,8 @@ class SocketChannelImpl int poll(int events, long timeout) throws IOException { assert Thread.holdsLock(blockingLock()) && !isBlocking(); - synchronized (readLock) { + readLock.lock(); + try { int n = 0; try { begin(); @@ -957,6 +997,8 @@ class SocketChannelImpl end(n > 0); } return n; + } finally { + readLock.unlock(); } } @@ -1024,8 +1066,7 @@ class SocketChannelImpl // -- Native methods -- - private static native int checkConnect(FileDescriptor fd, - boolean block, boolean ready) + private static native int checkConnect(FileDescriptor fd, boolean block) throws IOException; private static native int sendOutOfBandData(FileDescriptor fd, byte data) diff --git a/src/java.base/share/classes/sun/nio/cs/DoubleByte.java b/src/java.base/share/classes/sun/nio/cs/DoubleByte.java index 9f8d97fdb39..e31c0264d28 100644 --- a/src/java.base/share/classes/sun/nio/cs/DoubleByte.java +++ b/src/java.base/share/classes/sun/nio/cs/DoubleByte.java @@ -236,10 +236,8 @@ public class DoubleByte { int b2 = src[sp++] & 0xff; if (b2 < b2Min || b2 > b2Max || (c = b2c[b1][b2 - b2Min]) == UNMAPPABLE_DECODING) { - if (b2c[b1] == B2C_UNMAPPABLE || // isNotLeadingByte - b2c[b2] != B2C_UNMAPPABLE || // isLeadingByte - decodeSingle(b2) != UNMAPPABLE_DECODING) { - sp--; + if (crMalformedOrUnmappable(b1, b2).length() == 1) { + sp--; } } } @@ -472,6 +470,13 @@ public class DoubleByte { b2cSB_UNMAPPABLE = new char[0x100]; Arrays.fill(b2cSB_UNMAPPABLE, UNMAPPABLE_DECODING); } + + // always returns unmappableForLenth(2) for doublebyte_only + @Override + protected CoderResult crMalformedOrUnmappable(int b1, int b2) { + return CoderResult.unmappableForLength(2); + } + public Decoder_DBCSONLY(Charset cs, char[][] b2c, char[] b2cSB, int b2Min, int b2Max, boolean isASCIICompatible) { super(cs, 0.5f, 1.0f, b2c, b2cSB_UNMAPPABLE, b2Min, b2Max, isASCIICompatible); diff --git a/src/java.base/share/classes/sun/security/provider/PolicyFile.java b/src/java.base/share/classes/sun/security/provider/PolicyFile.java index ee761d754f5..fb7e7cceafc 100644 --- a/src/java.base/share/classes/sun/security/provider/PolicyFile.java +++ b/src/java.base/share/classes/sun/security/provider/PolicyFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -580,8 +580,8 @@ public class PolicyFile extends java.security.Policy { k.add(policy); return k; }); - Object[] source = {policy, pe.getLocalizedMessage()}; - System.err.println(LocalizedMessage.getMessage + Object[] source = {policy, pe.getNonlocalizedMessage()}; + System.err.println(LocalizedMessage.getNonlocalized (POLICY + ".error.parsing.policy.message", source)); if (debug != null) { pe.printStackTrace(); @@ -808,14 +808,14 @@ public class PolicyFile extends java.security.Policy { Object[] source = {pe.permission, ite.getTargetException().toString()}; System.err.println( - LocalizedMessage.getMessage( + LocalizedMessage.getNonlocalized( POLICY + ".error.adding.Permission.perm.message", source)); } catch (Exception e) { Object[] source = {pe.permission, e.toString()}; System.err.println( - LocalizedMessage.getMessage( + LocalizedMessage.getNonlocalized( POLICY + ".error.adding.Permission.perm.message", source)); } @@ -826,7 +826,7 @@ public class PolicyFile extends java.security.Policy { } catch (Exception e) { Object[] source = {e.toString()}; System.err.println( - LocalizedMessage.getMessage( + LocalizedMessage.getNonlocalized( POLICY + ".error.adding.Entry.message", source)); } @@ -1803,7 +1803,7 @@ public class PolicyFile extends java.security.Policy { if (colonIndex == -1) { Object[] source = {pe.name}; throw new Exception( - LocalizedMessage.getMessage( + LocalizedMessage.getNonlocalized( "alias.name.not.provided.pe.name.", source)); } @@ -1811,7 +1811,7 @@ public class PolicyFile extends java.security.Policy { if ((suffix = getDN(suffix, keystore)) == null) { Object[] source = {value.substring(colonIndex+1)}; throw new Exception( - LocalizedMessage.getMessage( + LocalizedMessage.getNonlocalized( "unable.to.perform.substitution.on.alias.suffix", source)); } @@ -1821,7 +1821,7 @@ public class PolicyFile extends java.security.Policy { } else { Object[] source = {prefix}; throw new Exception( - LocalizedMessage.getMessage( + LocalizedMessage.getNonlocalized( "substitution.value.prefix.unsupported", source)); } @@ -2037,7 +2037,7 @@ public class PolicyFile extends java.security.Policy { super(type); if (type == null) { throw new NullPointerException - (LocalizedMessage.getMessage("type.can.t.be.null")); + (LocalizedMessage.getNonlocalized("type.can.t.be.null")); } this.type = type; this.name = name; diff --git a/src/java.base/share/classes/sun/security/provider/PolicyParser.java b/src/java.base/share/classes/sun/security/provider/PolicyParser.java index 564eec1f577..017f667698f 100644 --- a/src/java.base/share/classes/sun/security/provider/PolicyParser.java +++ b/src/java.base/share/classes/sun/security/provider/PolicyParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -205,8 +205,8 @@ public class PolicyParser { if (!domainEntries.containsKey(domainName)) { domainEntries.put(domainName, de); } else { - LocalizedMessage localizedMsg = - new LocalizedMessage("duplicate.keystore.domain.name"); + LocalizedMessage localizedMsg = new LocalizedMessage( + "duplicate.keystore.domain.name"); Object[] source = {domainName}; String msg = "duplicate keystore domain name: " + domainName; @@ -220,7 +220,7 @@ public class PolicyParser { } if (keyStoreUrlString == null && storePassURL != null) { - throw new ParsingException(LocalizedMessage.getMessage + throw new ParsingException(LocalizedMessage.getNonlocalized ("keystorePasswordURL.can.not.be.specified.without.also.specifying.keystore")); } } @@ -362,7 +362,7 @@ public class PolicyParser { keyStoreType = match("quoted string"); } else { throw new ParsingException(st.lineno(), - LocalizedMessage.getMessage("expected.keystore.type")); + LocalizedMessage.getNonlocalized("expected.keystore.type")); } // parse keystore provider @@ -375,7 +375,7 @@ public class PolicyParser { keyStoreProvider = match("quoted string"); } else { throw new ParsingException(st.lineno(), - LocalizedMessage.getMessage("expected.keystore.provider")); + LocalizedMessage.getNonlocalized("expected.keystore.provider")); } } @@ -425,7 +425,7 @@ public class PolicyParser { if (e.codeBase != null) throw new ParsingException( st.lineno(), - LocalizedMessage.getMessage + LocalizedMessage.getNonlocalized ("multiple.Codebase.expressions")); e.codeBase = match("quoted string"); peekAndMatch(","); @@ -433,7 +433,7 @@ public class PolicyParser { if (e.signedBy != null) throw new ParsingException( st.lineno(), - LocalizedMessage.getMessage + LocalizedMessage.getNonlocalized ("multiple.SignedBy.expressions")); e.signedBy = match("quoted string"); @@ -452,7 +452,7 @@ public class PolicyParser { if (actr <= cctr) throw new ParsingException( st.lineno(), - LocalizedMessage.getMessage + LocalizedMessage.getNonlocalized ("SignedBy.has.empty.alias")); peekAndMatch(","); @@ -495,7 +495,7 @@ public class PolicyParser { } throw new ParsingException (st.lineno(), - LocalizedMessage.getMessage + LocalizedMessage.getNonlocalized ("can.not.specify.Principal.with.a.wildcard.class.without.a.wildcard.name")); } } @@ -532,7 +532,7 @@ public class PolicyParser { } else { throw new ParsingException(st.lineno(), - LocalizedMessage.getMessage + LocalizedMessage.getNonlocalized ("expected.codeBase.or.SignedBy.or.Principal")); } } @@ -556,7 +556,7 @@ public class PolicyParser { } else { throw new ParsingException(st.lineno(), - LocalizedMessage.getMessage + LocalizedMessage.getNonlocalized ("expected.permission.entry")); } } @@ -733,7 +733,7 @@ public class PolicyParser { switch (lookahead) { case StreamTokenizer.TT_NUMBER: throw new ParsingException(st.lineno(), expect, - LocalizedMessage.getMessage("number.") + + LocalizedMessage.getNonlocalized("number.") + String.valueOf(st.nval)); case StreamTokenizer.TT_EOF: LocalizedMessage localizedMsg = new LocalizedMessage @@ -826,10 +826,10 @@ public class PolicyParser { switch (lookahead) { case StreamTokenizer.TT_NUMBER: throw new ParsingException(st.lineno(), ";", - LocalizedMessage.getMessage("number.") + + LocalizedMessage.getNonlocalized("number.") + String.valueOf(st.nval)); case StreamTokenizer.TT_EOF: - throw new ParsingException(LocalizedMessage.getMessage + throw new ParsingException(LocalizedMessage.getNonlocalized ("expected.read.end.of.file.")); default: lookahead = st.nextToken(); @@ -987,7 +987,7 @@ public class PolicyParser { */ public PrincipalEntry(String principalClass, String principalName) { if (principalClass == null || principalName == null) - throw new NullPointerException(LocalizedMessage.getMessage + throw new NullPointerException(LocalizedMessage.getNonlocalized ("null.principalClass.or.principalName")); this.principalClass = principalClass; this.principalName = principalName; @@ -1339,8 +1339,6 @@ public class PolicyParser { public ParsingException(int line, String msg) { super("line " + line + ": " + msg); - // don't call form.format unless getLocalizedMessage is called - // to avoid unnecessary permission checks localizedMsg = new LocalizedMessage("line.number.msg"); source = new Object[] {line, msg}; } @@ -1348,16 +1346,14 @@ public class PolicyParser { public ParsingException(int line, String expect, String actual) { super("line " + line + ": expected [" + expect + "], found [" + actual + "]"); - // don't call form.format unless getLocalizedMessage is called - // to avoid unnecessary permission checks localizedMsg = new LocalizedMessage ("line.number.expected.expect.found.actual."); source = new Object[] {line, expect, actual}; } - @Override - public String getLocalizedMessage() { - return i18nMessage != null ? i18nMessage : localizedMsg.format(source); + public String getNonlocalizedMessage() { + return i18nMessage != null ? i18nMessage : + localizedMsg.formatNonlocalized(source); } } diff --git a/src/java.base/share/classes/sun/security/tools/keytool/Main.java b/src/java.base/share/classes/sun/security/tools/keytool/Main.java index b927bf29689..4413458d408 100644 --- a/src/java.base/share/classes/sun/security/tools/keytool/Main.java +++ b/src/java.base/share/classes/sun/security/tools/keytool/Main.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -523,9 +523,11 @@ public final class Main { if (c != null) { command = c; - } else if (collator.compare(flags, "-help") == 0 || - collator.compare(flags, "-h") == 0 || - collator.compare(flags, "-?") == 0) { + } else if (collator.compare(flags, "--help") == 0 || + collator.compare(flags, "-h") == 0 || + collator.compare(flags, "-?") == 0 || + // -help: legacy. + collator.compare(flags, "-help") == 0) { help = true; } else if (collator.compare(flags, "-conf") == 0) { i++; @@ -4608,6 +4610,8 @@ public final class Main { System.err.printf(" %-20s%s\n", c, rb.getString(c.description)); } System.err.println(); + System.err.println(rb.getString( + "Use.keytool.help.for.all.available.commands")); System.err.println(rb.getString( "Use.keytool.command.name.help.for.usage.of.command.name")); } diff --git a/src/java.base/share/classes/sun/security/tools/keytool/Resources.java b/src/java.base/share/classes/sun/security/tools/keytool/Resources.java index 485129086c7..699a086c7ea 100644 --- a/src/java.base/share/classes/sun/security/tools/keytool/Resources.java +++ b/src/java.base/share/classes/sun/security/tools/keytool/Resources.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,12 +45,12 @@ public class Resources extends java.util.ListResourceBundle { {"option.1.set.twice", "The %s option is specified multiple times. All except the last one will be ignored."}, {"multiple.commands.1.2", "Only one command is allowed: both %1$s and %2$s were specified."}, {"Use.keytool.help.for.all.available.commands", - "Use \"keytool -help\" for all available commands"}, + "Use \"keytool -?, -h, or --help\" for this help message"}, {"Key.and.Certificate.Management.Tool", "Key and Certificate Management Tool"}, {"Commands.", "Commands:"}, {"Use.keytool.command.name.help.for.usage.of.command.name", - "Use \"keytool -command_name -help\" for usage of command_name.\n" + + "Use \"keytool -command_name --help\" for usage of command_name.\n" + "Use the -conf option to specify a pre-configured options file."}, // keytool: help: commands {"Generates.a.certificate.request", @@ -462,7 +462,7 @@ public class Resources extends java.util.ListResourceBundle { {"with.weak", "%s (weak)"}, {"key.bit", "%1$d-bit %2$s key"}, {"key.bit.weak", "%1$d-bit %2$s key (weak)"}, - {"unknown.size.1", "unknown size %s key"}, + {"unknown.size.1", "%s key of unknown size"}, {".PATTERN.printX509Cert.with.weak", "Owner: {0}\nIssuer: {1}\nSerial number: {2}\nValid from: {3} until: {4}\nCertificate fingerprints:\n\t SHA1: {5}\n\t SHA256: {6}\nSignature algorithm name: {7}\nSubject Public Key Algorithm: {8}\nVersion: {9}"}, {"PKCS.10.with.weak", diff --git a/src/java.base/share/classes/sun/security/util/LocalizedMessage.java b/src/java.base/share/classes/sun/security/util/LocalizedMessage.java index a605dfca2c6..99742b3b80f 100644 --- a/src/java.base/share/classes/sun/security/util/LocalizedMessage.java +++ b/src/java.base/share/classes/sun/security/util/LocalizedMessage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ package sun.security.util; public class LocalizedMessage { - private static final Resources resources = new Resources(); + private static final Resources RESOURCES = new Resources(); private final String key; @@ -59,16 +59,28 @@ public class LocalizedMessage { /** * Return a localized string corresponding to the key stored in this - * object, formatted with the provided arguments. When the VM is booted, - * this method will obtain the correct localized message and format it - * using java.text.MessageFormat. Otherwise, a non-localized string is - * returned, and the formatting is performed by simplified formatting code. + * object, formatted with the provided arguments. This method should only + * be called when the VM is booted and all resources needed to obtain + * and format the localized message are loaded (or can be loaded). * * @param arguments The arguments that should be placed in the message * @return A formatted message string */ - public String format(Object... arguments) { - return getMessage(key, arguments); + public String formatLocalized(Object... arguments) { + return getLocalized(key, arguments); + } + + /** + * Return a non-localized string corresponding to the key stored in this + * object, formatted with the provided arguments. All strings are obtained + * from sun.security.util.Resources, and the formatting only supports + * simple positional argument replacement (e.g. {1}). + * + * @param arguments The arguments that should be placed in the message + * @return A formatted message string + */ + public String formatNonlocalized(Object... arguments) { + return getNonlocalized(key, arguments); } /** @@ -81,10 +93,10 @@ public class LocalizedMessage { * @param arguments The arguments that should be placed in the message * @return A formatted message string */ - public static String getMessageUnbooted(String key, - Object... arguments) { + public static String getNonlocalized(String key, + Object... arguments) { - String value = resources.getString(key); + String value = RESOURCES.getString(key); if (arguments == null || arguments.length == 0) { return value; } @@ -110,8 +122,7 @@ public class LocalizedMessage { try { int index = Integer.parseInt(indexStr); sb.append(arguments[index]); - } - catch(NumberFormatException e) { + } catch (NumberFormatException e) { // argument index is not an integer throw new RuntimeException("not an integer: " + indexStr); } @@ -123,29 +134,22 @@ public class LocalizedMessage { /** * Return a localized string corresponding to the provided key, and - * formatted with the provided arguments. When the VM is booted, this - * method will obtain the correct localized message and format it using - * java.text.MessageFormat. Otherwise, a non-localized string is returned, - * and the formatting is performed by simplified formatting code. + * formatted with the provided arguments. This method should only be + * called when the VM is booted and all resources needed to obtain + * and format the localized message are loaded (or can be loaded). * * @param key The key of the desired string in the security resource bundle * @param arguments The arguments that should be placed in the message * @return A formatted message string */ - public static String getMessage(String key, - Object... arguments) { + public static String getLocalized(String key, Object... arguments) { - if (jdk.internal.misc.VM.isBooted()) { - // Localization and formatting resources are available - String value = ResourcesMgr.getString(key); - if (arguments == null) { - return value; - } - java.text.MessageFormat form = new java.text.MessageFormat(value); - return form.format(arguments); - } else { - return getMessageUnbooted(key, arguments); + String value = ResourcesMgr.getString(key); + if (arguments == null) { + return value; } + java.text.MessageFormat form = new java.text.MessageFormat(value); + return form.format(arguments); } } diff --git a/src/java.base/share/classes/sun/util/locale/BaseLocale.java b/src/java.base/share/classes/sun/util/locale/BaseLocale.java index 62420d23351..3f4c5f1db6c 100644 --- a/src/java.base/share/classes/sun/util/locale/BaseLocale.java +++ b/src/java.base/share/classes/sun/util/locale/BaseLocale.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,8 +31,8 @@ */ package sun.util.locale; -import java.lang.ref.SoftReference; +import java.lang.ref.SoftReference; import java.util.StringJoiner; public final class BaseLocale { @@ -48,26 +48,28 @@ public final class BaseLocale { private volatile int hash; - // This method must be called only when creating the Locale.* constants. - private BaseLocale(String language, String region) { - this.language = language; - this.script = ""; - this.region = region; - this.variant = ""; - } - - private BaseLocale(String language, String script, String region, String variant) { - this.language = (language != null) ? LocaleUtils.toLowerString(language).intern() : ""; - this.script = (script != null) ? LocaleUtils.toTitleString(script).intern() : ""; - this.region = (region != null) ? LocaleUtils.toUpperString(region).intern() : ""; - this.variant = (variant != null) ? variant.intern() : ""; + // This method must be called with normalize = false only when creating the + // Locale.* constants and non-normalized BaseLocale$Keys used for lookup. + private BaseLocale(String language, String script, String region, String variant, + boolean normalize) { + if (normalize) { + this.language = LocaleUtils.toLowerString(language).intern(); + this.script = LocaleUtils.toTitleString(script).intern(); + this.region = LocaleUtils.toUpperString(region).intern(); + this.variant = variant.intern(); + } else { + this.language = language; + this.script = script; + this.region = region; + this.variant = variant; + } } // Called for creating the Locale.* constants. No argument // validation is performed. public static BaseLocale createInstance(String language, String region) { - BaseLocale base = new BaseLocale(language, region); - CACHE.put(new Key(language, region), base); + BaseLocale base = new BaseLocale(language, "", region, "", false); + CACHE.put(new Key(base), base); return base; } @@ -84,7 +86,7 @@ public final class BaseLocale { } } - Key key = new Key(language, script, region, variant); + Key key = new Key(language, script, region, variant, false); BaseLocale baseLocale = CACHE.get(key); return baseLocale; } @@ -123,16 +125,16 @@ public final class BaseLocale { @Override public String toString() { StringJoiner sj = new StringJoiner(", "); - if (language.length() > 0) { + if (!language.isEmpty()) { sj.add("language=" + language); } - if (script.length() > 0) { + if (!script.isEmpty()) { sj.add("script=" + script); } - if (region.length() > 0) { + if (!region.isEmpty()) { sj.add("region=" + region); } - if (variant.length() > 0) { + if (!variant.isEmpty()) { sj.add("variant=" + variant); } return sj.toString(); @@ -155,10 +157,17 @@ public final class BaseLocale { } private static final class Key { - private final SoftReference lang; - private final SoftReference scrt; - private final SoftReference regn; - private final SoftReference vart; + /** + * Keep a SoftReference to the Key data if normalized (actually used + * as a cache key) and not initialized via the constant creation path. + * + * This allows us to avoid creating SoftReferences on lookup Keys + * (which are short-lived) and for Locales created via + * Locale#createConstant. + */ + private final SoftReference holderRef; + private final BaseLocale holder; + private final boolean normalized; private final int hash; @@ -166,15 +175,16 @@ public final class BaseLocale { * Creates a Key. language and region must be normalized * (intern'ed in the proper case). */ - private Key(String language, String region) { - assert language.intern() == language - && region.intern() == region; - - lang = new SoftReference<>(language); - scrt = new SoftReference<>(""); - regn = new SoftReference<>(region); - vart = new SoftReference<>(""); + private Key(BaseLocale locale) { + this.holder = locale; + this.holderRef = null; this.normalized = true; + String language = locale.getLanguage(); + String region = locale.getRegion(); + assert LocaleUtils.toLowerString(language).intern() == language + && LocaleUtils.toUpperString(region).intern() == region + && locale.getVariant() == "" + && locale.getScript() == ""; int h = language.hashCode(); if (region != "") { @@ -186,51 +196,64 @@ public final class BaseLocale { hash = h; } - public Key(String language, String script, String region, String variant) { - this(language, script, region, variant, false); + private Key(String language, String script, String region, + String variant, boolean normalize) { + if (language == null) { + language = ""; + } + if (script == null) { + script = ""; + } + if (region == null) { + region = ""; + } + if (variant == null) { + variant = ""; + } + + BaseLocale locale = new BaseLocale(language, script, region, variant, normalize); + this.normalized = normalize; + if (normalized) { + this.holderRef = new SoftReference<>(locale); + this.holder = null; + } else { + this.holderRef = null; + this.holder = locale; + } + this.hash = hashCode(locale); } - private Key(String language, String script, String region, - String variant, boolean normalized) { + public int hashCode() { + return hash; + } + + private int hashCode(BaseLocale locale) { int h = 0; - if (language != null) { - lang = new SoftReference<>(language); - int len = language.length(); - for (int i = 0; i < len; i++) { - h = 31*h + LocaleUtils.toLower(language.charAt(i)); - } - } else { - lang = new SoftReference<>(""); + String lang = locale.getLanguage(); + int len = lang.length(); + for (int i = 0; i < len; i++) { + h = 31*h + LocaleUtils.toLower(lang.charAt(i)); } - if (script != null) { - scrt = new SoftReference<>(script); - int len = script.length(); - for (int i = 0; i < len; i++) { - h = 31*h + LocaleUtils.toLower(script.charAt(i)); - } - } else { - scrt = new SoftReference<>(""); + String scrt = locale.getScript(); + len = scrt.length(); + for (int i = 0; i < len; i++) { + h = 31*h + LocaleUtils.toLower(scrt.charAt(i)); } - if (region != null) { - regn = new SoftReference<>(region); - int len = region.length(); - for (int i = 0; i < len; i++) { - h = 31*h + LocaleUtils.toLower(region.charAt(i)); - } - } else { - regn = new SoftReference<>(""); + String regn = locale.getRegion(); + len = regn.length(); + for (int i = 0; i < len; i++) { + h = 31*h + LocaleUtils.toLower(regn.charAt(i)); } - if (variant != null) { - vart = new SoftReference<>(variant); - int len = variant.length(); - for (int i = 0; i < len; i++) { - h = 31*h + variant.charAt(i); - } - } else { - vart = new SoftReference<>(""); + String vart = locale.getVariant(); + len = vart.length(); + for (int i = 0; i < len; i++) { + h = 31*h + vart.charAt(i); } - hash = h; - this.normalized = normalized; + return h; + } + + private BaseLocale getBaseLocale() { + return (holder == null) ? holderRef.get() : holder; } @Override @@ -238,46 +261,31 @@ public final class BaseLocale { if (this == obj) { return true; } - if (obj instanceof Key && this.hash == ((Key)obj).hash) { - String tl = this.lang.get(); - String ol = ((Key)obj).lang.get(); - if (tl != null && ol != null && - LocaleUtils.caseIgnoreMatch(ol, tl)) { - String ts = this.scrt.get(); - String os = ((Key)obj).scrt.get(); - if (ts != null && os != null && - LocaleUtils.caseIgnoreMatch(os, ts)) { - String tr = this.regn.get(); - String or = ((Key)obj).regn.get(); - if (tr != null && or != null && - LocaleUtils.caseIgnoreMatch(or, tr)) { - String tv = this.vart.get(); - String ov = ((Key)obj).vart.get(); - return (ov != null && ov.equals(tv)); - } - } + BaseLocale other = ((Key) obj).getBaseLocale(); + BaseLocale locale = this.getBaseLocale(); + if (other != null && locale != null + && LocaleUtils.caseIgnoreMatch(other.getLanguage(), locale.getLanguage()) + && LocaleUtils.caseIgnoreMatch(other.getScript(), locale.getScript()) + && LocaleUtils.caseIgnoreMatch(other.getRegion(), locale.getRegion()) + // variant is case sensitive in JDK! + && other.getVariant().equals(locale.getVariant())) { + return true; } } return false; } - @Override - public int hashCode() { - return hash; - } - public static Key normalize(Key key) { if (key.normalized) { return key; } - String lang = LocaleUtils.toLowerString(key.lang.get()).intern(); - String scrt = LocaleUtils.toTitleString(key.scrt.get()).intern(); - String regn = LocaleUtils.toUpperString(key.regn.get()).intern(); - String vart = key.vart.get().intern(); // preserve upper/lower cases - - return new Key(lang, scrt, regn, vart, true); + // Only normalized keys may be softly referencing the data holder + assert (key.holder != null && key.holderRef == null); + BaseLocale locale = key.holder; + return new Key(locale.getLanguage(), locale.getScript(), + locale.getRegion(), locale.getVariant(), true); } } @@ -288,18 +296,12 @@ public final class BaseLocale { @Override protected Key normalizeKey(Key key) { - assert key.lang.get() != null && - key.scrt.get() != null && - key.regn.get() != null && - key.vart.get() != null; - return Key.normalize(key); } @Override protected BaseLocale createObject(Key key) { - return new BaseLocale(key.lang.get(), key.scrt.get(), - key.regn.get(), key.vart.get()); + return Key.normalize(key).getBaseLocale(); } } } diff --git a/src/java.base/share/classes/sun/util/locale/LocaleObjectCache.java b/src/java.base/share/classes/sun/util/locale/LocaleObjectCache.java index eae1480882b..50a1c2406ae 100644 --- a/src/java.base/share/classes/sun/util/locale/LocaleObjectCache.java +++ b/src/java.base/share/classes/sun/util/locale/LocaleObjectCache.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,8 +37,8 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; public abstract class LocaleObjectCache { - private ConcurrentMap> map; - private ReferenceQueue queue = new ReferenceQueue<>(); + private final ConcurrentMap> map; + private final ReferenceQueue queue = new ReferenceQueue<>(); public LocaleObjectCache() { this(16, 0.75f, 16); @@ -57,17 +57,14 @@ public abstract class LocaleObjectCache { value = entry.get(); } if (value == null) { - V newVal = createObject(key); - // make sure key is normalized *after* the object creation - // so that newVal is assured to be created from a valid key. key = normalizeKey(key); + V newVal = createObject(key); if (key == null || newVal == null) { // subclass must return non-null key/value object return null; } CacheEntry newEntry = new CacheEntry<>(key, newVal, queue); - entry = map.putIfAbsent(key, newEntry); if (entry == null) { value = newVal; @@ -92,7 +89,7 @@ public abstract class LocaleObjectCache { private void cleanStaleEntries() { CacheEntry entry; while ((entry = (CacheEntry)queue.poll()) != null) { - map.remove(entry.getKey()); + map.remove(entry.getKey(), entry); } } diff --git a/src/java.base/share/conf/security/java.security b/src/java.base/share/conf/security/java.security index 851651465e0..b7766158830 100644 --- a/src/java.base/share/conf/security/java.security +++ b/src/java.base/share/conf/security/java.security @@ -812,14 +812,14 @@ jdk.tls.legacyAlgorithms= \ # limited: These policy files contain more restricted cryptographic # strengths # -# The default setting is determined by the value of the “crypto.policy†+# The default setting is determined by the value of the "crypto.policy" # Security property below. If your country or usage requires the -# traditional restrictive policy, the “limited†Java cryptographic +# traditional restrictive policy, the "limited" Java cryptographic # policy is still available and may be appropriate for your environment. # # If you have restrictions that do not fit either use case mentioned # above, Java provides the capability to customize these policy files. -# The “crypto.policy†security property points to a subdirectory +# The "crypto.policy" security property points to a subdirectory # within /conf/security/policy/ which can be customized. # Please see the /conf/security/policy/README.txt file or consult # the Java Security Guide/JCA documentation for more information. diff --git a/src/java.base/share/conf/security/policy/README.txt b/src/java.base/share/conf/security/policy/README.txt index e9138e79a4b..fdf77d3e3a4 100644 --- a/src/java.base/share/conf/security/policy/README.txt +++ b/src/java.base/share/conf/security/policy/README.txt @@ -8,7 +8,7 @@ Import and export control rules on cryptographic software vary from country to country. The Java Cryptography Extension (JCE) architecture allows flexible cryptographic key strength to be configured via the -jurisdiction policy files which are referenced by the “crypto.policy†+jurisdiction policy files which are referenced by the "crypto.policy" security property in the /conf/security/java.security file. By default, Java provides two different sets of cryptographic policy @@ -20,8 +20,8 @@ files: limited: These policy files contain more restricted cryptographic strengths -These files reside in /conf/security/policy in the “unlimited†-or “limited†subdirectories respectively. +These files reside in /conf/security/policy in the "unlimited" +or "limited" subdirectories respectively. Each subdirectory contains a complete policy configuration, and subdirectories can be added/edited/removed to reflect your diff --git a/src/java.base/share/lib/security/default.policy b/src/java.base/share/lib/security/default.policy index 6495d080dfb..a23b72d78bf 100644 --- a/src/java.base/share/lib/security/default.policy +++ b/src/java.base/share/lib/security/default.policy @@ -8,17 +8,11 @@ // ${java.home}/conf/security/java.policy. // -grant codeBase "jrt:/java.activation" { - permission java.security.AllPermission; -}; grant codeBase "jrt:/java.compiler" { permission java.security.AllPermission; }; -grant codeBase "jrt:/java.corba" { - permission java.security.AllPermission; -}; grant codeBase "jrt:/java.scripting" { permission java.security.AllPermission; @@ -65,9 +59,6 @@ grant codeBase "jrt:/java.sql.rowset" { permission java.security.AllPermission; }; -grant codeBase "jrt:/java.xml.bind" { - permission java.security.AllPermission; -}; grant codeBase "jrt:/java.xml.crypto" { permission java.lang.RuntimePermission @@ -90,9 +81,6 @@ grant codeBase "jrt:/java.xml.crypto" { "accessClassInPackage.com.sun.org.apache.xpath.internal.*"; }; -grant codeBase "jrt:/java.xml.ws" { - permission java.security.AllPermission; -}; grant codeBase "jrt:/jdk.accessibility" { permission java.lang.RuntimePermission "accessClassInPackage.sun.awt"; diff --git a/src/java.base/share/native/include/classfile_constants.h b/src/java.base/share/native/include/classfile_constants.h deleted file mode 100644 index 3b63f31c6e8..00000000000 --- a/src/java.base/share/native/include/classfile_constants.h +++ /dev/null @@ -1,581 +0,0 @@ -/* - * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#ifndef CLASSFILE_CONSTANTS_H -#define CLASSFILE_CONSTANTS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* Classfile version number for this information */ -#define JVM_CLASSFILE_MAJOR_VERSION 54 -#define JVM_CLASSFILE_MINOR_VERSION 0 - -/* Flags */ - -enum { - JVM_ACC_PUBLIC = 0x0001, - JVM_ACC_PRIVATE = 0x0002, - JVM_ACC_PROTECTED = 0x0004, - JVM_ACC_STATIC = 0x0008, - JVM_ACC_FINAL = 0x0010, - JVM_ACC_SYNCHRONIZED = 0x0020, - JVM_ACC_SUPER = 0x0020, - JVM_ACC_VOLATILE = 0x0040, - JVM_ACC_BRIDGE = 0x0040, - JVM_ACC_TRANSIENT = 0x0080, - JVM_ACC_VARARGS = 0x0080, - JVM_ACC_NATIVE = 0x0100, - JVM_ACC_INTERFACE = 0x0200, - JVM_ACC_ABSTRACT = 0x0400, - JVM_ACC_STRICT = 0x0800, - JVM_ACC_SYNTHETIC = 0x1000, - JVM_ACC_ANNOTATION = 0x2000, - JVM_ACC_ENUM = 0x4000, - JVM_ACC_MODULE = 0x8000 -}; - -#define JVM_ACC_PUBLIC_BIT 0 -#define JVM_ACC_PRIVATE_BIT 1 -#define JVM_ACC_PROTECTED_BIT 2 -#define JVM_ACC_STATIC_BIT 3 -#define JVM_ACC_FINAL_BIT 4 -#define JVM_ACC_SYNCHRONIZED_BIT 5 -#define JVM_ACC_SUPER_BIT 5 -#define JVM_ACC_VOLATILE_BIT 6 -#define JVM_ACC_BRIDGE_BIT 6 -#define JVM_ACC_TRANSIENT_BIT 7 -#define JVM_ACC_VARARGS_BIT 7 -#define JVM_ACC_NATIVE_BIT 8 -#define JVM_ACC_INTERFACE_BIT 9 -#define JVM_ACC_ABSTRACT_BIT 10 -#define JVM_ACC_STRICT_BIT 11 -#define JVM_ACC_SYNTHETIC_BIT 12 -#define JVM_ACC_ANNOTATION_BIT 13 -#define JVM_ACC_ENUM_BIT 14 - -/* Used in newarray instruction. */ - -enum { - JVM_T_BOOLEAN = 4, - JVM_T_CHAR = 5, - JVM_T_FLOAT = 6, - JVM_T_DOUBLE = 7, - JVM_T_BYTE = 8, - JVM_T_SHORT = 9, - JVM_T_INT = 10, - JVM_T_LONG = 11 -}; - -/* Constant Pool Entries */ - -enum { - JVM_CONSTANT_Utf8 = 1, - JVM_CONSTANT_Unicode = 2, /* unused */ - JVM_CONSTANT_Integer = 3, - JVM_CONSTANT_Float = 4, - JVM_CONSTANT_Long = 5, - JVM_CONSTANT_Double = 6, - JVM_CONSTANT_Class = 7, - JVM_CONSTANT_String = 8, - JVM_CONSTANT_Fieldref = 9, - JVM_CONSTANT_Methodref = 10, - JVM_CONSTANT_InterfaceMethodref = 11, - JVM_CONSTANT_NameAndType = 12, - JVM_CONSTANT_MethodHandle = 15, // JSR 292 - JVM_CONSTANT_MethodType = 16, // JSR 292 - JVM_CONSTANT_InvokeDynamic = 18, - JVM_CONSTANT_ExternalMax = 18 -}; - -/* JVM_CONSTANT_MethodHandle subtypes */ -enum { - JVM_REF_getField = 1, - JVM_REF_getStatic = 2, - JVM_REF_putField = 3, - JVM_REF_putStatic = 4, - JVM_REF_invokeVirtual = 5, - JVM_REF_invokeStatic = 6, - JVM_REF_invokeSpecial = 7, - JVM_REF_newInvokeSpecial = 8, - JVM_REF_invokeInterface = 9 -}; - -/* StackMapTable type item numbers */ - -enum { - JVM_ITEM_Top = 0, - JVM_ITEM_Integer = 1, - JVM_ITEM_Float = 2, - JVM_ITEM_Double = 3, - JVM_ITEM_Long = 4, - JVM_ITEM_Null = 5, - JVM_ITEM_UninitializedThis = 6, - JVM_ITEM_Object = 7, - JVM_ITEM_Uninitialized = 8 -}; - -/* Type signatures */ - -enum { - JVM_SIGNATURE_ARRAY = '[', - JVM_SIGNATURE_BYTE = 'B', - JVM_SIGNATURE_CHAR = 'C', - JVM_SIGNATURE_CLASS = 'L', - JVM_SIGNATURE_ENDCLASS = ';', - JVM_SIGNATURE_ENUM = 'E', - JVM_SIGNATURE_FLOAT = 'F', - JVM_SIGNATURE_DOUBLE = 'D', - JVM_SIGNATURE_FUNC = '(', - JVM_SIGNATURE_ENDFUNC = ')', - JVM_SIGNATURE_INT = 'I', - JVM_SIGNATURE_LONG = 'J', - JVM_SIGNATURE_SHORT = 'S', - JVM_SIGNATURE_VOID = 'V', - JVM_SIGNATURE_BOOLEAN = 'Z' -}; - -/* Opcodes */ - -enum { - JVM_OPC_nop = 0, - JVM_OPC_aconst_null = 1, - JVM_OPC_iconst_m1 = 2, - JVM_OPC_iconst_0 = 3, - JVM_OPC_iconst_1 = 4, - JVM_OPC_iconst_2 = 5, - JVM_OPC_iconst_3 = 6, - JVM_OPC_iconst_4 = 7, - JVM_OPC_iconst_5 = 8, - JVM_OPC_lconst_0 = 9, - JVM_OPC_lconst_1 = 10, - JVM_OPC_fconst_0 = 11, - JVM_OPC_fconst_1 = 12, - JVM_OPC_fconst_2 = 13, - JVM_OPC_dconst_0 = 14, - JVM_OPC_dconst_1 = 15, - JVM_OPC_bipush = 16, - JVM_OPC_sipush = 17, - JVM_OPC_ldc = 18, - JVM_OPC_ldc_w = 19, - JVM_OPC_ldc2_w = 20, - JVM_OPC_iload = 21, - JVM_OPC_lload = 22, - JVM_OPC_fload = 23, - JVM_OPC_dload = 24, - JVM_OPC_aload = 25, - JVM_OPC_iload_0 = 26, - JVM_OPC_iload_1 = 27, - JVM_OPC_iload_2 = 28, - JVM_OPC_iload_3 = 29, - JVM_OPC_lload_0 = 30, - JVM_OPC_lload_1 = 31, - JVM_OPC_lload_2 = 32, - JVM_OPC_lload_3 = 33, - JVM_OPC_fload_0 = 34, - JVM_OPC_fload_1 = 35, - JVM_OPC_fload_2 = 36, - JVM_OPC_fload_3 = 37, - JVM_OPC_dload_0 = 38, - JVM_OPC_dload_1 = 39, - JVM_OPC_dload_2 = 40, - JVM_OPC_dload_3 = 41, - JVM_OPC_aload_0 = 42, - JVM_OPC_aload_1 = 43, - JVM_OPC_aload_2 = 44, - JVM_OPC_aload_3 = 45, - JVM_OPC_iaload = 46, - JVM_OPC_laload = 47, - JVM_OPC_faload = 48, - JVM_OPC_daload = 49, - JVM_OPC_aaload = 50, - JVM_OPC_baload = 51, - JVM_OPC_caload = 52, - JVM_OPC_saload = 53, - JVM_OPC_istore = 54, - JVM_OPC_lstore = 55, - JVM_OPC_fstore = 56, - JVM_OPC_dstore = 57, - JVM_OPC_astore = 58, - JVM_OPC_istore_0 = 59, - JVM_OPC_istore_1 = 60, - JVM_OPC_istore_2 = 61, - JVM_OPC_istore_3 = 62, - JVM_OPC_lstore_0 = 63, - JVM_OPC_lstore_1 = 64, - JVM_OPC_lstore_2 = 65, - JVM_OPC_lstore_3 = 66, - JVM_OPC_fstore_0 = 67, - JVM_OPC_fstore_1 = 68, - JVM_OPC_fstore_2 = 69, - JVM_OPC_fstore_3 = 70, - JVM_OPC_dstore_0 = 71, - JVM_OPC_dstore_1 = 72, - JVM_OPC_dstore_2 = 73, - JVM_OPC_dstore_3 = 74, - JVM_OPC_astore_0 = 75, - JVM_OPC_astore_1 = 76, - JVM_OPC_astore_2 = 77, - JVM_OPC_astore_3 = 78, - JVM_OPC_iastore = 79, - JVM_OPC_lastore = 80, - JVM_OPC_fastore = 81, - JVM_OPC_dastore = 82, - JVM_OPC_aastore = 83, - JVM_OPC_bastore = 84, - JVM_OPC_castore = 85, - JVM_OPC_sastore = 86, - JVM_OPC_pop = 87, - JVM_OPC_pop2 = 88, - JVM_OPC_dup = 89, - JVM_OPC_dup_x1 = 90, - JVM_OPC_dup_x2 = 91, - JVM_OPC_dup2 = 92, - JVM_OPC_dup2_x1 = 93, - JVM_OPC_dup2_x2 = 94, - JVM_OPC_swap = 95, - JVM_OPC_iadd = 96, - JVM_OPC_ladd = 97, - JVM_OPC_fadd = 98, - JVM_OPC_dadd = 99, - JVM_OPC_isub = 100, - JVM_OPC_lsub = 101, - JVM_OPC_fsub = 102, - JVM_OPC_dsub = 103, - JVM_OPC_imul = 104, - JVM_OPC_lmul = 105, - JVM_OPC_fmul = 106, - JVM_OPC_dmul = 107, - JVM_OPC_idiv = 108, - JVM_OPC_ldiv = 109, - JVM_OPC_fdiv = 110, - JVM_OPC_ddiv = 111, - JVM_OPC_irem = 112, - JVM_OPC_lrem = 113, - JVM_OPC_frem = 114, - JVM_OPC_drem = 115, - JVM_OPC_ineg = 116, - JVM_OPC_lneg = 117, - JVM_OPC_fneg = 118, - JVM_OPC_dneg = 119, - JVM_OPC_ishl = 120, - JVM_OPC_lshl = 121, - JVM_OPC_ishr = 122, - JVM_OPC_lshr = 123, - JVM_OPC_iushr = 124, - JVM_OPC_lushr = 125, - JVM_OPC_iand = 126, - JVM_OPC_land = 127, - JVM_OPC_ior = 128, - JVM_OPC_lor = 129, - JVM_OPC_ixor = 130, - JVM_OPC_lxor = 131, - JVM_OPC_iinc = 132, - JVM_OPC_i2l = 133, - JVM_OPC_i2f = 134, - JVM_OPC_i2d = 135, - JVM_OPC_l2i = 136, - JVM_OPC_l2f = 137, - JVM_OPC_l2d = 138, - JVM_OPC_f2i = 139, - JVM_OPC_f2l = 140, - JVM_OPC_f2d = 141, - JVM_OPC_d2i = 142, - JVM_OPC_d2l = 143, - JVM_OPC_d2f = 144, - JVM_OPC_i2b = 145, - JVM_OPC_i2c = 146, - JVM_OPC_i2s = 147, - JVM_OPC_lcmp = 148, - JVM_OPC_fcmpl = 149, - JVM_OPC_fcmpg = 150, - JVM_OPC_dcmpl = 151, - JVM_OPC_dcmpg = 152, - JVM_OPC_ifeq = 153, - JVM_OPC_ifne = 154, - JVM_OPC_iflt = 155, - JVM_OPC_ifge = 156, - JVM_OPC_ifgt = 157, - JVM_OPC_ifle = 158, - JVM_OPC_if_icmpeq = 159, - JVM_OPC_if_icmpne = 160, - JVM_OPC_if_icmplt = 161, - JVM_OPC_if_icmpge = 162, - JVM_OPC_if_icmpgt = 163, - JVM_OPC_if_icmple = 164, - JVM_OPC_if_acmpeq = 165, - JVM_OPC_if_acmpne = 166, - JVM_OPC_goto = 167, - JVM_OPC_jsr = 168, - JVM_OPC_ret = 169, - JVM_OPC_tableswitch = 170, - JVM_OPC_lookupswitch = 171, - JVM_OPC_ireturn = 172, - JVM_OPC_lreturn = 173, - JVM_OPC_freturn = 174, - JVM_OPC_dreturn = 175, - JVM_OPC_areturn = 176, - JVM_OPC_return = 177, - JVM_OPC_getstatic = 178, - JVM_OPC_putstatic = 179, - JVM_OPC_getfield = 180, - JVM_OPC_putfield = 181, - JVM_OPC_invokevirtual = 182, - JVM_OPC_invokespecial = 183, - JVM_OPC_invokestatic = 184, - JVM_OPC_invokeinterface = 185, - JVM_OPC_invokedynamic = 186, - JVM_OPC_new = 187, - JVM_OPC_newarray = 188, - JVM_OPC_anewarray = 189, - JVM_OPC_arraylength = 190, - JVM_OPC_athrow = 191, - JVM_OPC_checkcast = 192, - JVM_OPC_instanceof = 193, - JVM_OPC_monitorenter = 194, - JVM_OPC_monitorexit = 195, - JVM_OPC_wide = 196, - JVM_OPC_multianewarray = 197, - JVM_OPC_ifnull = 198, - JVM_OPC_ifnonnull = 199, - JVM_OPC_goto_w = 200, - JVM_OPC_jsr_w = 201, - JVM_OPC_MAX = 201 -}; - -/* Opcode length initializer, use with something like: - * unsigned char opcode_length[JVM_OPC_MAX+1] = JVM_OPCODE_LENGTH_INITIALIZER; - */ -#define JVM_OPCODE_LENGTH_INITIALIZER { \ - 1, /* nop */ \ - 1, /* aconst_null */ \ - 1, /* iconst_m1 */ \ - 1, /* iconst_0 */ \ - 1, /* iconst_1 */ \ - 1, /* iconst_2 */ \ - 1, /* iconst_3 */ \ - 1, /* iconst_4 */ \ - 1, /* iconst_5 */ \ - 1, /* lconst_0 */ \ - 1, /* lconst_1 */ \ - 1, /* fconst_0 */ \ - 1, /* fconst_1 */ \ - 1, /* fconst_2 */ \ - 1, /* dconst_0 */ \ - 1, /* dconst_1 */ \ - 2, /* bipush */ \ - 3, /* sipush */ \ - 2, /* ldc */ \ - 3, /* ldc_w */ \ - 3, /* ldc2_w */ \ - 2, /* iload */ \ - 2, /* lload */ \ - 2, /* fload */ \ - 2, /* dload */ \ - 2, /* aload */ \ - 1, /* iload_0 */ \ - 1, /* iload_1 */ \ - 1, /* iload_2 */ \ - 1, /* iload_3 */ \ - 1, /* lload_0 */ \ - 1, /* lload_1 */ \ - 1, /* lload_2 */ \ - 1, /* lload_3 */ \ - 1, /* fload_0 */ \ - 1, /* fload_1 */ \ - 1, /* fload_2 */ \ - 1, /* fload_3 */ \ - 1, /* dload_0 */ \ - 1, /* dload_1 */ \ - 1, /* dload_2 */ \ - 1, /* dload_3 */ \ - 1, /* aload_0 */ \ - 1, /* aload_1 */ \ - 1, /* aload_2 */ \ - 1, /* aload_3 */ \ - 1, /* iaload */ \ - 1, /* laload */ \ - 1, /* faload */ \ - 1, /* daload */ \ - 1, /* aaload */ \ - 1, /* baload */ \ - 1, /* caload */ \ - 1, /* saload */ \ - 2, /* istore */ \ - 2, /* lstore */ \ - 2, /* fstore */ \ - 2, /* dstore */ \ - 2, /* astore */ \ - 1, /* istore_0 */ \ - 1, /* istore_1 */ \ - 1, /* istore_2 */ \ - 1, /* istore_3 */ \ - 1, /* lstore_0 */ \ - 1, /* lstore_1 */ \ - 1, /* lstore_2 */ \ - 1, /* lstore_3 */ \ - 1, /* fstore_0 */ \ - 1, /* fstore_1 */ \ - 1, /* fstore_2 */ \ - 1, /* fstore_3 */ \ - 1, /* dstore_0 */ \ - 1, /* dstore_1 */ \ - 1, /* dstore_2 */ \ - 1, /* dstore_3 */ \ - 1, /* astore_0 */ \ - 1, /* astore_1 */ \ - 1, /* astore_2 */ \ - 1, /* astore_3 */ \ - 1, /* iastore */ \ - 1, /* lastore */ \ - 1, /* fastore */ \ - 1, /* dastore */ \ - 1, /* aastore */ \ - 1, /* bastore */ \ - 1, /* castore */ \ - 1, /* sastore */ \ - 1, /* pop */ \ - 1, /* pop2 */ \ - 1, /* dup */ \ - 1, /* dup_x1 */ \ - 1, /* dup_x2 */ \ - 1, /* dup2 */ \ - 1, /* dup2_x1 */ \ - 1, /* dup2_x2 */ \ - 1, /* swap */ \ - 1, /* iadd */ \ - 1, /* ladd */ \ - 1, /* fadd */ \ - 1, /* dadd */ \ - 1, /* isub */ \ - 1, /* lsub */ \ - 1, /* fsub */ \ - 1, /* dsub */ \ - 1, /* imul */ \ - 1, /* lmul */ \ - 1, /* fmul */ \ - 1, /* dmul */ \ - 1, /* idiv */ \ - 1, /* ldiv */ \ - 1, /* fdiv */ \ - 1, /* ddiv */ \ - 1, /* irem */ \ - 1, /* lrem */ \ - 1, /* frem */ \ - 1, /* drem */ \ - 1, /* ineg */ \ - 1, /* lneg */ \ - 1, /* fneg */ \ - 1, /* dneg */ \ - 1, /* ishl */ \ - 1, /* lshl */ \ - 1, /* ishr */ \ - 1, /* lshr */ \ - 1, /* iushr */ \ - 1, /* lushr */ \ - 1, /* iand */ \ - 1, /* land */ \ - 1, /* ior */ \ - 1, /* lor */ \ - 1, /* ixor */ \ - 1, /* lxor */ \ - 3, /* iinc */ \ - 1, /* i2l */ \ - 1, /* i2f */ \ - 1, /* i2d */ \ - 1, /* l2i */ \ - 1, /* l2f */ \ - 1, /* l2d */ \ - 1, /* f2i */ \ - 1, /* f2l */ \ - 1, /* f2d */ \ - 1, /* d2i */ \ - 1, /* d2l */ \ - 1, /* d2f */ \ - 1, /* i2b */ \ - 1, /* i2c */ \ - 1, /* i2s */ \ - 1, /* lcmp */ \ - 1, /* fcmpl */ \ - 1, /* fcmpg */ \ - 1, /* dcmpl */ \ - 1, /* dcmpg */ \ - 3, /* ifeq */ \ - 3, /* ifne */ \ - 3, /* iflt */ \ - 3, /* ifge */ \ - 3, /* ifgt */ \ - 3, /* ifle */ \ - 3, /* if_icmpeq */ \ - 3, /* if_icmpne */ \ - 3, /* if_icmplt */ \ - 3, /* if_icmpge */ \ - 3, /* if_icmpgt */ \ - 3, /* if_icmple */ \ - 3, /* if_acmpeq */ \ - 3, /* if_acmpne */ \ - 3, /* goto */ \ - 3, /* jsr */ \ - 2, /* ret */ \ - 99, /* tableswitch */ \ - 99, /* lookupswitch */ \ - 1, /* ireturn */ \ - 1, /* lreturn */ \ - 1, /* freturn */ \ - 1, /* dreturn */ \ - 1, /* areturn */ \ - 1, /* return */ \ - 3, /* getstatic */ \ - 3, /* putstatic */ \ - 3, /* getfield */ \ - 3, /* putfield */ \ - 3, /* invokevirtual */ \ - 3, /* invokespecial */ \ - 3, /* invokestatic */ \ - 5, /* invokeinterface */ \ - 5, /* invokedynamic */ \ - 3, /* new */ \ - 2, /* newarray */ \ - 3, /* anewarray */ \ - 1, /* arraylength */ \ - 1, /* athrow */ \ - 3, /* checkcast */ \ - 3, /* instanceof */ \ - 1, /* monitorenter */ \ - 1, /* monitorexit */ \ - 0, /* wide */ \ - 4, /* multianewarray */ \ - 3, /* ifnull */ \ - 3, /* ifnonnull */ \ - 5, /* goto_w */ \ - 5 /* jsr_w */ \ -} - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ - -#endif /* CLASSFILE_CONSTANTS */ diff --git a/src/java.base/share/native/include/classfile_constants.h.template b/src/java.base/share/native/include/classfile_constants.h.template new file mode 100644 index 00000000000..d4d0c28fda5 --- /dev/null +++ b/src/java.base/share/native/include/classfile_constants.h.template @@ -0,0 +1,582 @@ +/* + * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef CLASSFILE_CONSTANTS_H +#define CLASSFILE_CONSTANTS_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Classfile version number for this information */ +#define JVM_CLASSFILE_MAJOR_VERSION @@VERSION_CLASSFILE_MAJOR@@ +#define JVM_CLASSFILE_MINOR_VERSION @@VERSION_CLASSFILE_MINOR@@ + +/* Flags */ + +enum { + JVM_ACC_PUBLIC = 0x0001, + JVM_ACC_PRIVATE = 0x0002, + JVM_ACC_PROTECTED = 0x0004, + JVM_ACC_STATIC = 0x0008, + JVM_ACC_FINAL = 0x0010, + JVM_ACC_SYNCHRONIZED = 0x0020, + JVM_ACC_SUPER = 0x0020, + JVM_ACC_VOLATILE = 0x0040, + JVM_ACC_BRIDGE = 0x0040, + JVM_ACC_TRANSIENT = 0x0080, + JVM_ACC_VARARGS = 0x0080, + JVM_ACC_NATIVE = 0x0100, + JVM_ACC_INTERFACE = 0x0200, + JVM_ACC_ABSTRACT = 0x0400, + JVM_ACC_STRICT = 0x0800, + JVM_ACC_SYNTHETIC = 0x1000, + JVM_ACC_ANNOTATION = 0x2000, + JVM_ACC_ENUM = 0x4000, + JVM_ACC_MODULE = 0x8000 +}; + +#define JVM_ACC_PUBLIC_BIT 0 +#define JVM_ACC_PRIVATE_BIT 1 +#define JVM_ACC_PROTECTED_BIT 2 +#define JVM_ACC_STATIC_BIT 3 +#define JVM_ACC_FINAL_BIT 4 +#define JVM_ACC_SYNCHRONIZED_BIT 5 +#define JVM_ACC_SUPER_BIT 5 +#define JVM_ACC_VOLATILE_BIT 6 +#define JVM_ACC_BRIDGE_BIT 6 +#define JVM_ACC_TRANSIENT_BIT 7 +#define JVM_ACC_VARARGS_BIT 7 +#define JVM_ACC_NATIVE_BIT 8 +#define JVM_ACC_INTERFACE_BIT 9 +#define JVM_ACC_ABSTRACT_BIT 10 +#define JVM_ACC_STRICT_BIT 11 +#define JVM_ACC_SYNTHETIC_BIT 12 +#define JVM_ACC_ANNOTATION_BIT 13 +#define JVM_ACC_ENUM_BIT 14 + +/* Used in newarray instruction. */ + +enum { + JVM_T_BOOLEAN = 4, + JVM_T_CHAR = 5, + JVM_T_FLOAT = 6, + JVM_T_DOUBLE = 7, + JVM_T_BYTE = 8, + JVM_T_SHORT = 9, + JVM_T_INT = 10, + JVM_T_LONG = 11 +}; + +/* Constant Pool Entries */ + +enum { + JVM_CONSTANT_Utf8 = 1, + JVM_CONSTANT_Unicode = 2, /* unused */ + JVM_CONSTANT_Integer = 3, + JVM_CONSTANT_Float = 4, + JVM_CONSTANT_Long = 5, + JVM_CONSTANT_Double = 6, + JVM_CONSTANT_Class = 7, + JVM_CONSTANT_String = 8, + JVM_CONSTANT_Fieldref = 9, + JVM_CONSTANT_Methodref = 10, + JVM_CONSTANT_InterfaceMethodref = 11, + JVM_CONSTANT_NameAndType = 12, + JVM_CONSTANT_MethodHandle = 15, // JSR 292 + JVM_CONSTANT_MethodType = 16, // JSR 292 + JVM_CONSTANT_Dynamic = 17, + JVM_CONSTANT_InvokeDynamic = 18, + JVM_CONSTANT_ExternalMax = 18 +}; + +/* JVM_CONSTANT_MethodHandle subtypes */ +enum { + JVM_REF_getField = 1, + JVM_REF_getStatic = 2, + JVM_REF_putField = 3, + JVM_REF_putStatic = 4, + JVM_REF_invokeVirtual = 5, + JVM_REF_invokeStatic = 6, + JVM_REF_invokeSpecial = 7, + JVM_REF_newInvokeSpecial = 8, + JVM_REF_invokeInterface = 9 +}; + +/* StackMapTable type item numbers */ + +enum { + JVM_ITEM_Top = 0, + JVM_ITEM_Integer = 1, + JVM_ITEM_Float = 2, + JVM_ITEM_Double = 3, + JVM_ITEM_Long = 4, + JVM_ITEM_Null = 5, + JVM_ITEM_UninitializedThis = 6, + JVM_ITEM_Object = 7, + JVM_ITEM_Uninitialized = 8 +}; + +/* Type signatures */ + +enum { + JVM_SIGNATURE_ARRAY = '[', + JVM_SIGNATURE_BYTE = 'B', + JVM_SIGNATURE_CHAR = 'C', + JVM_SIGNATURE_CLASS = 'L', + JVM_SIGNATURE_ENDCLASS = ';', + JVM_SIGNATURE_ENUM = 'E', + JVM_SIGNATURE_FLOAT = 'F', + JVM_SIGNATURE_DOUBLE = 'D', + JVM_SIGNATURE_FUNC = '(', + JVM_SIGNATURE_ENDFUNC = ')', + JVM_SIGNATURE_INT = 'I', + JVM_SIGNATURE_LONG = 'J', + JVM_SIGNATURE_SHORT = 'S', + JVM_SIGNATURE_VOID = 'V', + JVM_SIGNATURE_BOOLEAN = 'Z' +}; + +/* Opcodes */ + +enum { + JVM_OPC_nop = 0, + JVM_OPC_aconst_null = 1, + JVM_OPC_iconst_m1 = 2, + JVM_OPC_iconst_0 = 3, + JVM_OPC_iconst_1 = 4, + JVM_OPC_iconst_2 = 5, + JVM_OPC_iconst_3 = 6, + JVM_OPC_iconst_4 = 7, + JVM_OPC_iconst_5 = 8, + JVM_OPC_lconst_0 = 9, + JVM_OPC_lconst_1 = 10, + JVM_OPC_fconst_0 = 11, + JVM_OPC_fconst_1 = 12, + JVM_OPC_fconst_2 = 13, + JVM_OPC_dconst_0 = 14, + JVM_OPC_dconst_1 = 15, + JVM_OPC_bipush = 16, + JVM_OPC_sipush = 17, + JVM_OPC_ldc = 18, + JVM_OPC_ldc_w = 19, + JVM_OPC_ldc2_w = 20, + JVM_OPC_iload = 21, + JVM_OPC_lload = 22, + JVM_OPC_fload = 23, + JVM_OPC_dload = 24, + JVM_OPC_aload = 25, + JVM_OPC_iload_0 = 26, + JVM_OPC_iload_1 = 27, + JVM_OPC_iload_2 = 28, + JVM_OPC_iload_3 = 29, + JVM_OPC_lload_0 = 30, + JVM_OPC_lload_1 = 31, + JVM_OPC_lload_2 = 32, + JVM_OPC_lload_3 = 33, + JVM_OPC_fload_0 = 34, + JVM_OPC_fload_1 = 35, + JVM_OPC_fload_2 = 36, + JVM_OPC_fload_3 = 37, + JVM_OPC_dload_0 = 38, + JVM_OPC_dload_1 = 39, + JVM_OPC_dload_2 = 40, + JVM_OPC_dload_3 = 41, + JVM_OPC_aload_0 = 42, + JVM_OPC_aload_1 = 43, + JVM_OPC_aload_2 = 44, + JVM_OPC_aload_3 = 45, + JVM_OPC_iaload = 46, + JVM_OPC_laload = 47, + JVM_OPC_faload = 48, + JVM_OPC_daload = 49, + JVM_OPC_aaload = 50, + JVM_OPC_baload = 51, + JVM_OPC_caload = 52, + JVM_OPC_saload = 53, + JVM_OPC_istore = 54, + JVM_OPC_lstore = 55, + JVM_OPC_fstore = 56, + JVM_OPC_dstore = 57, + JVM_OPC_astore = 58, + JVM_OPC_istore_0 = 59, + JVM_OPC_istore_1 = 60, + JVM_OPC_istore_2 = 61, + JVM_OPC_istore_3 = 62, + JVM_OPC_lstore_0 = 63, + JVM_OPC_lstore_1 = 64, + JVM_OPC_lstore_2 = 65, + JVM_OPC_lstore_3 = 66, + JVM_OPC_fstore_0 = 67, + JVM_OPC_fstore_1 = 68, + JVM_OPC_fstore_2 = 69, + JVM_OPC_fstore_3 = 70, + JVM_OPC_dstore_0 = 71, + JVM_OPC_dstore_1 = 72, + JVM_OPC_dstore_2 = 73, + JVM_OPC_dstore_3 = 74, + JVM_OPC_astore_0 = 75, + JVM_OPC_astore_1 = 76, + JVM_OPC_astore_2 = 77, + JVM_OPC_astore_3 = 78, + JVM_OPC_iastore = 79, + JVM_OPC_lastore = 80, + JVM_OPC_fastore = 81, + JVM_OPC_dastore = 82, + JVM_OPC_aastore = 83, + JVM_OPC_bastore = 84, + JVM_OPC_castore = 85, + JVM_OPC_sastore = 86, + JVM_OPC_pop = 87, + JVM_OPC_pop2 = 88, + JVM_OPC_dup = 89, + JVM_OPC_dup_x1 = 90, + JVM_OPC_dup_x2 = 91, + JVM_OPC_dup2 = 92, + JVM_OPC_dup2_x1 = 93, + JVM_OPC_dup2_x2 = 94, + JVM_OPC_swap = 95, + JVM_OPC_iadd = 96, + JVM_OPC_ladd = 97, + JVM_OPC_fadd = 98, + JVM_OPC_dadd = 99, + JVM_OPC_isub = 100, + JVM_OPC_lsub = 101, + JVM_OPC_fsub = 102, + JVM_OPC_dsub = 103, + JVM_OPC_imul = 104, + JVM_OPC_lmul = 105, + JVM_OPC_fmul = 106, + JVM_OPC_dmul = 107, + JVM_OPC_idiv = 108, + JVM_OPC_ldiv = 109, + JVM_OPC_fdiv = 110, + JVM_OPC_ddiv = 111, + JVM_OPC_irem = 112, + JVM_OPC_lrem = 113, + JVM_OPC_frem = 114, + JVM_OPC_drem = 115, + JVM_OPC_ineg = 116, + JVM_OPC_lneg = 117, + JVM_OPC_fneg = 118, + JVM_OPC_dneg = 119, + JVM_OPC_ishl = 120, + JVM_OPC_lshl = 121, + JVM_OPC_ishr = 122, + JVM_OPC_lshr = 123, + JVM_OPC_iushr = 124, + JVM_OPC_lushr = 125, + JVM_OPC_iand = 126, + JVM_OPC_land = 127, + JVM_OPC_ior = 128, + JVM_OPC_lor = 129, + JVM_OPC_ixor = 130, + JVM_OPC_lxor = 131, + JVM_OPC_iinc = 132, + JVM_OPC_i2l = 133, + JVM_OPC_i2f = 134, + JVM_OPC_i2d = 135, + JVM_OPC_l2i = 136, + JVM_OPC_l2f = 137, + JVM_OPC_l2d = 138, + JVM_OPC_f2i = 139, + JVM_OPC_f2l = 140, + JVM_OPC_f2d = 141, + JVM_OPC_d2i = 142, + JVM_OPC_d2l = 143, + JVM_OPC_d2f = 144, + JVM_OPC_i2b = 145, + JVM_OPC_i2c = 146, + JVM_OPC_i2s = 147, + JVM_OPC_lcmp = 148, + JVM_OPC_fcmpl = 149, + JVM_OPC_fcmpg = 150, + JVM_OPC_dcmpl = 151, + JVM_OPC_dcmpg = 152, + JVM_OPC_ifeq = 153, + JVM_OPC_ifne = 154, + JVM_OPC_iflt = 155, + JVM_OPC_ifge = 156, + JVM_OPC_ifgt = 157, + JVM_OPC_ifle = 158, + JVM_OPC_if_icmpeq = 159, + JVM_OPC_if_icmpne = 160, + JVM_OPC_if_icmplt = 161, + JVM_OPC_if_icmpge = 162, + JVM_OPC_if_icmpgt = 163, + JVM_OPC_if_icmple = 164, + JVM_OPC_if_acmpeq = 165, + JVM_OPC_if_acmpne = 166, + JVM_OPC_goto = 167, + JVM_OPC_jsr = 168, + JVM_OPC_ret = 169, + JVM_OPC_tableswitch = 170, + JVM_OPC_lookupswitch = 171, + JVM_OPC_ireturn = 172, + JVM_OPC_lreturn = 173, + JVM_OPC_freturn = 174, + JVM_OPC_dreturn = 175, + JVM_OPC_areturn = 176, + JVM_OPC_return = 177, + JVM_OPC_getstatic = 178, + JVM_OPC_putstatic = 179, + JVM_OPC_getfield = 180, + JVM_OPC_putfield = 181, + JVM_OPC_invokevirtual = 182, + JVM_OPC_invokespecial = 183, + JVM_OPC_invokestatic = 184, + JVM_OPC_invokeinterface = 185, + JVM_OPC_invokedynamic = 186, + JVM_OPC_new = 187, + JVM_OPC_newarray = 188, + JVM_OPC_anewarray = 189, + JVM_OPC_arraylength = 190, + JVM_OPC_athrow = 191, + JVM_OPC_checkcast = 192, + JVM_OPC_instanceof = 193, + JVM_OPC_monitorenter = 194, + JVM_OPC_monitorexit = 195, + JVM_OPC_wide = 196, + JVM_OPC_multianewarray = 197, + JVM_OPC_ifnull = 198, + JVM_OPC_ifnonnull = 199, + JVM_OPC_goto_w = 200, + JVM_OPC_jsr_w = 201, + JVM_OPC_MAX = 201 +}; + +/* Opcode length initializer, use with something like: + * unsigned char opcode_length[JVM_OPC_MAX+1] = JVM_OPCODE_LENGTH_INITIALIZER; + */ +#define JVM_OPCODE_LENGTH_INITIALIZER { \ + 1, /* nop */ \ + 1, /* aconst_null */ \ + 1, /* iconst_m1 */ \ + 1, /* iconst_0 */ \ + 1, /* iconst_1 */ \ + 1, /* iconst_2 */ \ + 1, /* iconst_3 */ \ + 1, /* iconst_4 */ \ + 1, /* iconst_5 */ \ + 1, /* lconst_0 */ \ + 1, /* lconst_1 */ \ + 1, /* fconst_0 */ \ + 1, /* fconst_1 */ \ + 1, /* fconst_2 */ \ + 1, /* dconst_0 */ \ + 1, /* dconst_1 */ \ + 2, /* bipush */ \ + 3, /* sipush */ \ + 2, /* ldc */ \ + 3, /* ldc_w */ \ + 3, /* ldc2_w */ \ + 2, /* iload */ \ + 2, /* lload */ \ + 2, /* fload */ \ + 2, /* dload */ \ + 2, /* aload */ \ + 1, /* iload_0 */ \ + 1, /* iload_1 */ \ + 1, /* iload_2 */ \ + 1, /* iload_3 */ \ + 1, /* lload_0 */ \ + 1, /* lload_1 */ \ + 1, /* lload_2 */ \ + 1, /* lload_3 */ \ + 1, /* fload_0 */ \ + 1, /* fload_1 */ \ + 1, /* fload_2 */ \ + 1, /* fload_3 */ \ + 1, /* dload_0 */ \ + 1, /* dload_1 */ \ + 1, /* dload_2 */ \ + 1, /* dload_3 */ \ + 1, /* aload_0 */ \ + 1, /* aload_1 */ \ + 1, /* aload_2 */ \ + 1, /* aload_3 */ \ + 1, /* iaload */ \ + 1, /* laload */ \ + 1, /* faload */ \ + 1, /* daload */ \ + 1, /* aaload */ \ + 1, /* baload */ \ + 1, /* caload */ \ + 1, /* saload */ \ + 2, /* istore */ \ + 2, /* lstore */ \ + 2, /* fstore */ \ + 2, /* dstore */ \ + 2, /* astore */ \ + 1, /* istore_0 */ \ + 1, /* istore_1 */ \ + 1, /* istore_2 */ \ + 1, /* istore_3 */ \ + 1, /* lstore_0 */ \ + 1, /* lstore_1 */ \ + 1, /* lstore_2 */ \ + 1, /* lstore_3 */ \ + 1, /* fstore_0 */ \ + 1, /* fstore_1 */ \ + 1, /* fstore_2 */ \ + 1, /* fstore_3 */ \ + 1, /* dstore_0 */ \ + 1, /* dstore_1 */ \ + 1, /* dstore_2 */ \ + 1, /* dstore_3 */ \ + 1, /* astore_0 */ \ + 1, /* astore_1 */ \ + 1, /* astore_2 */ \ + 1, /* astore_3 */ \ + 1, /* iastore */ \ + 1, /* lastore */ \ + 1, /* fastore */ \ + 1, /* dastore */ \ + 1, /* aastore */ \ + 1, /* bastore */ \ + 1, /* castore */ \ + 1, /* sastore */ \ + 1, /* pop */ \ + 1, /* pop2 */ \ + 1, /* dup */ \ + 1, /* dup_x1 */ \ + 1, /* dup_x2 */ \ + 1, /* dup2 */ \ + 1, /* dup2_x1 */ \ + 1, /* dup2_x2 */ \ + 1, /* swap */ \ + 1, /* iadd */ \ + 1, /* ladd */ \ + 1, /* fadd */ \ + 1, /* dadd */ \ + 1, /* isub */ \ + 1, /* lsub */ \ + 1, /* fsub */ \ + 1, /* dsub */ \ + 1, /* imul */ \ + 1, /* lmul */ \ + 1, /* fmul */ \ + 1, /* dmul */ \ + 1, /* idiv */ \ + 1, /* ldiv */ \ + 1, /* fdiv */ \ + 1, /* ddiv */ \ + 1, /* irem */ \ + 1, /* lrem */ \ + 1, /* frem */ \ + 1, /* drem */ \ + 1, /* ineg */ \ + 1, /* lneg */ \ + 1, /* fneg */ \ + 1, /* dneg */ \ + 1, /* ishl */ \ + 1, /* lshl */ \ + 1, /* ishr */ \ + 1, /* lshr */ \ + 1, /* iushr */ \ + 1, /* lushr */ \ + 1, /* iand */ \ + 1, /* land */ \ + 1, /* ior */ \ + 1, /* lor */ \ + 1, /* ixor */ \ + 1, /* lxor */ \ + 3, /* iinc */ \ + 1, /* i2l */ \ + 1, /* i2f */ \ + 1, /* i2d */ \ + 1, /* l2i */ \ + 1, /* l2f */ \ + 1, /* l2d */ \ + 1, /* f2i */ \ + 1, /* f2l */ \ + 1, /* f2d */ \ + 1, /* d2i */ \ + 1, /* d2l */ \ + 1, /* d2f */ \ + 1, /* i2b */ \ + 1, /* i2c */ \ + 1, /* i2s */ \ + 1, /* lcmp */ \ + 1, /* fcmpl */ \ + 1, /* fcmpg */ \ + 1, /* dcmpl */ \ + 1, /* dcmpg */ \ + 3, /* ifeq */ \ + 3, /* ifne */ \ + 3, /* iflt */ \ + 3, /* ifge */ \ + 3, /* ifgt */ \ + 3, /* ifle */ \ + 3, /* if_icmpeq */ \ + 3, /* if_icmpne */ \ + 3, /* if_icmplt */ \ + 3, /* if_icmpge */ \ + 3, /* if_icmpgt */ \ + 3, /* if_icmple */ \ + 3, /* if_acmpeq */ \ + 3, /* if_acmpne */ \ + 3, /* goto */ \ + 3, /* jsr */ \ + 2, /* ret */ \ + 99, /* tableswitch */ \ + 99, /* lookupswitch */ \ + 1, /* ireturn */ \ + 1, /* lreturn */ \ + 1, /* freturn */ \ + 1, /* dreturn */ \ + 1, /* areturn */ \ + 1, /* return */ \ + 3, /* getstatic */ \ + 3, /* putstatic */ \ + 3, /* getfield */ \ + 3, /* putfield */ \ + 3, /* invokevirtual */ \ + 3, /* invokespecial */ \ + 3, /* invokestatic */ \ + 5, /* invokeinterface */ \ + 5, /* invokedynamic */ \ + 3, /* new */ \ + 2, /* newarray */ \ + 3, /* anewarray */ \ + 1, /* arraylength */ \ + 1, /* athrow */ \ + 3, /* checkcast */ \ + 3, /* instanceof */ \ + 1, /* monitorenter */ \ + 1, /* monitorexit */ \ + 0, /* wide */ \ + 4, /* multianewarray */ \ + 3, /* ifnull */ \ + 3, /* ifnonnull */ \ + 5, /* goto_w */ \ + 5 /* jsr_w */ \ +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* CLASSFILE_CONSTANTS */ diff --git a/src/java.base/share/native/libjava/Reflection.c b/src/java.base/share/native/libjava/Reflection.c index 0a5327eb1fa..b634726c500 100644 --- a/src/java.base/share/native/libjava/Reflection.c +++ b/src/java.base/share/native/libjava/Reflection.c @@ -30,13 +30,7 @@ JNIEXPORT jclass JNICALL Java_jdk_internal_reflect_Reflection_getCallerClass__(JNIEnv *env, jclass unused) { - return JVM_GetCallerClass(env, JVM_CALLER_DEPTH); -} - -JNIEXPORT jclass JNICALL -Java_jdk_internal_reflect_Reflection_getCallerClass__I(JNIEnv *env, jclass unused, jint depth) -{ - return JVM_GetCallerClass(env, depth); + return JVM_GetCallerClass(env); } JNIEXPORT jint JNICALL diff --git a/src/java.base/share/native/libjava/System.c b/src/java.base/share/native/libjava/System.c index 8dfe41fcb45..06fe6319344 100644 --- a/src/java.base/share/native/libjava/System.c +++ b/src/java.base/share/native/libjava/System.c @@ -119,9 +119,6 @@ Java_java_lang_System_identityHashCode(JNIEnv *env, jobject this, jobject x) #define VENDOR_URL_BUG "http://bugreport.java.com/bugreport/" #endif -#define JAVA_MAX_SUPPORTED_VERSION 54 -#define JAVA_MAX_SUPPORTED_MINOR_VERSION 0 - #ifdef JAVA_SPECIFICATION_VENDOR /* Third party may NOT overwrite this. */ #error "ERROR: No override of JAVA_SPECIFICATION_VENDOR is allowed" #else @@ -227,8 +224,8 @@ Java_java_lang_System_initProperties(JNIEnv *env, jclass cla, jobject props) PUTPROP(props, "java.vendor.url", VENDOR_URL); PUTPROP(props, "java.vendor.url.bug", VENDOR_URL_BUG); - jio_snprintf(buf, sizeof(buf), "%d.%d", JAVA_MAX_SUPPORTED_VERSION, - JAVA_MAX_SUPPORTED_MINOR_VERSION); + jio_snprintf(buf, sizeof(buf), "%d.%d", JVM_CLASSFILE_MAJOR_VERSION, + JVM_CLASSFILE_MINOR_VERSION); PUTPROP(props, "java.class.version", buf); if (sprops->awt_toolkit) { diff --git a/src/java.base/unix/classes/java/io/FileDescriptor.java b/src/java.base/unix/classes/java/io/FileDescriptor.java index 5e0b80eb625..7f3404115e7 100644 --- a/src/java.base/unix/classes/java/io/FileDescriptor.java +++ b/src/java.base/unix/classes/java/io/FileDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -91,6 +91,14 @@ public final class FileDescriptor { fdo.registerCleanup(); } + public void registerCleanup(FileDescriptor fdo, PhantomCleanable cleanup) { + fdo.registerCleanup(cleanup); + } + + public void unregisterCleanup(FileDescriptor fdo) { + fdo.unregisterCleanup(); + } + public void setHandle(FileDescriptor fdo, long handle) { throw new UnsupportedOperationException(); } @@ -105,7 +113,7 @@ public final class FileDescriptor { /** * Cleanup in case FileDescriptor is not explicitly closed. */ - private FDCleanup cleanup; + private PhantomCleanable cleanup; /** * Constructs an (invalid) FileDescriptor @@ -206,16 +214,44 @@ public final class FileDescriptor { } /** - * Register a cleanup for the current raw fd. + * Register a cleanup for the current handle. * Used directly in java.io and indirectly via fdAccess. - * The cleanup should be registered after the fd is set in the FileDescriptor. + * The cleanup should be registered after the handle is set in the FileDescriptor. */ @SuppressWarnings("unchecked") - synchronized void registerCleanup() { + void registerCleanup() { + registerCleanup(null); + } + + /** + * Register a cleanup for the current handle. + * Used directly in java.io and indirectly via fdAccess. + * The cleanup should be registered after the handle is set in the FileDescriptor. + * @param newCleanable a PhantomCleanable to register + */ + @SuppressWarnings("unchecked") + synchronized void registerCleanup(PhantomCleanable newCleanable) { if (cleanup != null) { cleanup.clear(); } - cleanup = FDCleanup.create(this); + cleanup = (newCleanable == null) ? FDCleanup.create(this) : newCleanable; + } + + /** + * Unregister a cleanup for the current raw fd. + * Used directly in java.io and indirectly via fdAccess. + * Normally {@link #close()} should be used except in cases where + * it is certain the caller will close the raw fd and the cleanup + * must not close the raw fd. {@link #unregisterCleanup()} must be + * called before the raw fd is closed to prevent a race that makes + * it possible for the fd to be reallocated to another use and later + * the cleanup might be invoked. + */ + synchronized void unregisterCleanup() { + if (cleanup != null) { + cleanup.clear(); + } + cleanup = null; } /** diff --git a/src/java.base/unix/classes/sun/nio/ch/SinkChannelImpl.java b/src/java.base/unix/classes/sun/nio/ch/SinkChannelImpl.java index 69e71c05f57..0bfda3b8631 100644 --- a/src/java.base/unix/classes/sun/nio/ch/SinkChannelImpl.java +++ b/src/java.base/unix/classes/sun/nio/ch/SinkChannelImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,10 +25,14 @@ package sun.nio.ch; -import java.io.*; +import java.io.FileDescriptor; +import java.io.IOException; import java.nio.ByteBuffer; -import java.nio.channels.*; -import java.nio.channels.spi.*; +import java.nio.channels.ClosedChannelException; +import java.nio.channels.Pipe; +import java.nio.channels.SelectionKey; +import java.nio.channels.spi.SelectorProvider; +import java.util.concurrent.locks.ReentrantLock; class SinkChannelImpl @@ -40,17 +44,17 @@ class SinkChannelImpl private static final NativeDispatcher nd = new FileDispatcherImpl(); // The file descriptor associated with this channel - FileDescriptor fd; + private final FileDescriptor fd; // fd value needed for dev/poll. This value will remain valid // even after the value in the file descriptor object has been set to -1 - int fdVal; + private final int fdVal; // ID of native thread doing write, for signalling private volatile long thread; - // Lock held by current reading thread - private final Object lock = new Object(); + // Lock held by current writing thread + private final ReentrantLock writeLock = new ReentrantLock(); // Lock held by any thread that modifies the state fields declared below // DO NOT invoke a blocking I/O operation while holding this lock! @@ -155,8 +159,9 @@ class SinkChannelImpl } public int write(ByteBuffer src) throws IOException { - ensureOpen(); - synchronized (lock) { + writeLock.lock(); + try { + ensureOpen(); int n = 0; try { begin(); @@ -172,14 +177,18 @@ class SinkChannelImpl end((n > 0) || (n == IOStatus.UNAVAILABLE)); assert IOStatus.check(n); } + } finally { + writeLock.unlock(); } } public long write(ByteBuffer[] srcs) throws IOException { if (srcs == null) throw new NullPointerException(); - ensureOpen(); - synchronized (lock) { + + writeLock.lock(); + try { + ensureOpen(); long n = 0; try { begin(); @@ -195,6 +204,8 @@ class SinkChannelImpl end((n > 0) || (n == IOStatus.UNAVAILABLE)); assert IOStatus.check(n); } + } finally { + writeLock.unlock(); } } diff --git a/src/java.base/unix/classes/sun/nio/ch/SourceChannelImpl.java b/src/java.base/unix/classes/sun/nio/ch/SourceChannelImpl.java index 7eea3ca0b72..438f66d2a73 100644 --- a/src/java.base/unix/classes/sun/nio/ch/SourceChannelImpl.java +++ b/src/java.base/unix/classes/sun/nio/ch/SourceChannelImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,10 +25,14 @@ package sun.nio.ch; -import java.io.*; +import java.io.FileDescriptor; +import java.io.IOException; import java.nio.ByteBuffer; -import java.nio.channels.*; -import java.nio.channels.spi.*; +import java.nio.channels.ClosedChannelException; +import java.nio.channels.Pipe; +import java.nio.channels.SelectionKey; +import java.nio.channels.spi.SelectorProvider; +import java.util.concurrent.locks.ReentrantLock; class SourceChannelImpl @@ -40,17 +44,17 @@ class SourceChannelImpl private static final NativeDispatcher nd = new FileDispatcherImpl(); // The file descriptor associated with this channel - FileDescriptor fd; + private final FileDescriptor fd; // fd value needed for dev/poll. This value will remain valid // even after the value in the file descriptor object has been set to -1 - int fdVal; + private final int fdVal; // ID of native thread doing read, for signalling private volatile long thread; // Lock held by current reading thread - private final Object lock = new Object(); + private final ReentrantLock readLock = new ReentrantLock(); // Lock held by any thread that modifies the state fields declared below // DO NOT invoke a blocking I/O operation while holding this lock! @@ -155,8 +159,10 @@ class SourceChannelImpl } public int read(ByteBuffer dst) throws IOException { - ensureOpen(); - synchronized (lock) { + + readLock.lock(); + try { + ensureOpen(); int n = 0; try { begin(); @@ -172,6 +178,8 @@ class SourceChannelImpl end((n > 0) || (n == IOStatus.UNAVAILABLE)); assert IOStatus.check(n); } + } finally { + readLock.unlock(); } } @@ -186,8 +194,10 @@ class SourceChannelImpl public long read(ByteBuffer[] dsts) throws IOException { if (dsts == null) throw new NullPointerException(); - ensureOpen(); - synchronized (lock) { + + readLock.lock(); + try { + ensureOpen(); long n = 0; try { begin(); @@ -203,6 +213,8 @@ class SourceChannelImpl end((n > 0) || (n == IOStatus.UNAVAILABLE)); assert IOStatus.check(n); } + } finally { + readLock.unlock(); } } } diff --git a/src/java.base/unix/native/libnet/SocketImpl.c b/src/java.base/unix/native/libnet/SocketImpl.c index 3427b0ef405..849a7effb4b 100644 --- a/src/java.base/unix/native/libnet/SocketImpl.c +++ b/src/java.base/unix/native/libnet/SocketImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ #include #include "net_util.h" +#include "java_net_SocketCleanable.h" JNIEXPORT jboolean JNICALL Java_java_net_AbstractPlainSocketImpl_isReusePortAvailable0(JNIEnv* env, jclass c1) @@ -45,3 +46,15 @@ Java_jdk_net_Sockets_isReusePortAvailable0(JNIEnv* env, jclass c1) { return (reuseport_available()) ? JNI_TRUE : JNI_FALSE; } + +/* + * Class: java_net_SocketCleanable + * Method: cleanupClose0 + * Signature: (I)V + */ +JNIEXPORT void JNICALL +Java_java_net_SocketCleanable_cleanupClose0(JNIEnv *env, jclass c1, jint fd) +{ + NET_SocketClose(fd); +} + diff --git a/src/java.base/unix/native/libnio/ch/SocketChannelImpl.c b/src/java.base/unix/native/libnio/ch/SocketChannelImpl.c index 66c32543adb..2d8370c9763 100644 --- a/src/java.base/unix/native/libnio/ch/SocketChannelImpl.c +++ b/src/java.base/unix/native/libnio/ch/SocketChannelImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,8 +47,7 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_SocketChannelImpl_checkConnect(JNIEnv *env, jobject this, - jobject fdo, jboolean block, - jboolean ready) + jobject fdo, jboolean block) { int error = 0; socklen_t n = sizeof(int); @@ -56,19 +55,16 @@ Java_sun_nio_ch_SocketChannelImpl_checkConnect(JNIEnv *env, jobject this, int result = 0; struct pollfd poller; - poller.revents = 1; - if (!ready) { - poller.fd = fd; - poller.events = POLLOUT; - poller.revents = 0; - result = poll(&poller, 1, block ? -1 : 0); - if (result < 0) { - JNU_ThrowIOExceptionWithLastError(env, "Poll failed"); - return IOS_THROWN; - } - if (!block && (result == 0)) - return IOS_UNAVAILABLE; + poller.fd = fd; + poller.events = POLLOUT; + poller.revents = 0; + result = poll(&poller, 1, block ? -1 : 0); + if (result < 0) { + JNU_ThrowIOExceptionWithLastError(env, "Poll failed"); + return IOS_THROWN; } + if (!block && (result == 0)) + return IOS_UNAVAILABLE; if (poller.revents) { errno = 0; diff --git a/src/java.base/windows/classes/java/io/FileDescriptor.java b/src/java.base/windows/classes/java/io/FileDescriptor.java index ecc1934795d..7f49da1979c 100644 --- a/src/java.base/windows/classes/java/io/FileDescriptor.java +++ b/src/java.base/windows/classes/java/io/FileDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -90,7 +90,15 @@ public final class FileDescriptor { } public void registerCleanup(FileDescriptor fdo) { - fdo.registerCleanup(); + fdo.registerCleanup(null); + } + + public void registerCleanup(FileDescriptor fdo, PhantomCleanable cleanup) { + fdo.registerCleanup(cleanup); + } + + public void unregisterCleanup(FileDescriptor fdo) { + fdo.unregisterCleanup(); } public void setHandle(FileDescriptor fdo, long handle) { @@ -107,7 +115,7 @@ public final class FileDescriptor { /** * Cleanup in case FileDescriptor is not explicitly closed. */ - private FDCleanup cleanup; + private PhantomCleanable cleanup; /** * Constructs an (invalid) FileDescriptor @@ -217,11 +225,39 @@ public final class FileDescriptor { * The cleanup should be registered after the handle is set in the FileDescriptor. */ @SuppressWarnings("unchecked") - synchronized void registerCleanup() { + void registerCleanup() { + registerCleanup(null); + } + + /** + * Register a cleanup for the current handle. + * Used directly in java.io and indirectly via fdAccess. + * The cleanup should be registered after the handle is set in the FileDescriptor. + * @param newCleanable a PhantomCleanable to register + */ + @SuppressWarnings("unchecked") + synchronized void registerCleanup(PhantomCleanable newCleanable) { if (cleanup != null) { cleanup.clear(); } - cleanup = FDCleanup.create(this); + cleanup = (newCleanable == null) ? FDCleanup.create(this) : newCleanable; + } + + /** + * Unregister a cleanup for the current raw fd. + * Used directly in java.io and indirectly via fdAccess. + * Normally {@link #close()} should be used except in cases where + * it is certain the caller will close the raw fd and the cleanup + * must not close the raw fd. {@link #unregisterCleanup()} must be + * called before the raw fd is closed to prevent a race that makes + * it possible for the fd to be reallocated to another use and later + * the cleanup might be invoked. + */ + synchronized void unregisterCleanup() { + if (cleanup != null) { + cleanup.clear(); + } + cleanup = null; } /** @@ -319,16 +355,21 @@ public final class FileDescriptor { /** * Cleanup for a FileDescriptor when it becomes phantom reachable. * Create a cleanup if handle != -1. + * Windows closes files using handles and sockets via the fd. + * Network FileDescriptors using socket fd must provide their + * own PhantomCleanable to {@link #registerCleanup}. + * This implementation only clears thehandles. + *

            * Subclassed from {@code PhantomCleanable} so that {@code clear} can be - * called to disable the cleanup when the fd is closed by any means other + * called to disable the cleanup when the handle is closed by any means other * than calling {@link FileDescriptor#close}. - * Otherwise, it may close the handle after it has been reused. + * Otherwise, it may incorrectly close the handle after it has been reused. */ static final class FDCleanup extends PhantomCleanable { private final long handle; static FDCleanup create(FileDescriptor fdo) { - return fdo.handle == -1 + return fdo.handle == -1L ? null : new FDCleanup(fdo, CleanerFactory.cleaner(), fdo.handle); } diff --git a/src/java.base/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java b/src/java.base/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java index 7198b49671e..333b7422e0c 100644 --- a/src/java.base/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java +++ b/src/java.base/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java @@ -86,6 +86,7 @@ class TwoStacksPlainDatagramSocketImpl extends AbstractPlainDatagramSocketImpl fd1 = new FileDescriptor(); try { super.create(); + SocketCleanable.register(fd1); } catch (SocketException e) { fd1 = null; throw e; @@ -160,6 +161,8 @@ class TwoStacksPlainDatagramSocketImpl extends AbstractPlainDatagramSocketImpl protected void close() { if (fd != null || fd1 != null) { + SocketCleanable.unregister(fd); + SocketCleanable.unregister(fd1); datagramSocketClose(); ResourceManager.afterUdpClose(); fd = null; diff --git a/src/java.base/windows/classes/sun/nio/ch/SinkChannelImpl.java b/src/java.base/windows/classes/sun/nio/ch/SinkChannelImpl.java index 57e88ac38cf..8501ab50128 100644 --- a/src/java.base/windows/classes/sun/nio/ch/SinkChannelImpl.java +++ b/src/java.base/windows/classes/sun/nio/ch/SinkChannelImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,7 +44,7 @@ class SinkChannelImpl implements SelChImpl { // The SocketChannel assoicated with this pipe - SocketChannel sc; + final SocketChannel sc; public FileDescriptor getFD() { return ((SocketChannelImpl)sc).getFD(); diff --git a/src/java.base/windows/classes/sun/nio/ch/SourceChannelImpl.java b/src/java.base/windows/classes/sun/nio/ch/SourceChannelImpl.java index 2605d61b47c..57fb48ba1df 100644 --- a/src/java.base/windows/classes/sun/nio/ch/SourceChannelImpl.java +++ b/src/java.base/windows/classes/sun/nio/ch/SourceChannelImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,7 @@ class SourceChannelImpl implements SelChImpl { // The SocketChannel assoicated with this pipe - SocketChannel sc; + private final SocketChannel sc; public FileDescriptor getFD() { return ((SocketChannelImpl) sc).getFD(); diff --git a/src/java.base/windows/native/libnet/SocketImpl.c b/src/java.base/windows/native/libnet/SocketImpl.c index 8e5745de8d3..c5f51821312 100644 --- a/src/java.base/windows/native/libnet/SocketImpl.c +++ b/src/java.base/windows/native/libnet/SocketImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,8 @@ */ #include +#include "net_util.h" +#include "java_net_SocketCleanable.h" JNIEXPORT jboolean JNICALL Java_java_net_AbstractPlainSocketImpl_isReusePortAvailable0(JNIEnv* env, jclass c1) @@ -45,3 +47,15 @@ Java_jdk_net_Sockets_isReusePortAvailable0(JNIEnv* env, jclass c1) // SO_REUSEPORT is not supported on Windows return JNI_FALSE; } + +/* + * Class: java_net_SocketCleanable + * Method: cleanupClose0 + * Signature: (I)V + */ +JNIEXPORT void JNICALL +Java_java_net_SocketCleanable_cleanupClose0(JNIEnv *env, jclass c1, jint fd) +{ + NET_SocketClose(fd); +} + diff --git a/src/java.base/windows/native/libnet/net_util_md.c b/src/java.base/windows/native/libnet/net_util_md.c index e9ad96f37ac..a3328855f6c 100644 --- a/src/java.base/windows/native/libnet/net_util_md.c +++ b/src/java.base/windows/native/libnet/net_util_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -525,7 +525,7 @@ NET_SocketClose(int fd) { int len = sizeof (l); if (getsockopt(fd, SOL_SOCKET, SO_LINGER, (char *)&l, &len) == 0) { if (l.l_onoff == 0) { - WSASendDisconnect(fd, NULL); + shutdown(fd, SD_SEND); } } ret = closesocket (fd); diff --git a/src/java.base/windows/native/libnio/ch/SocketChannelImpl.c b/src/java.base/windows/native/libnio/ch/SocketChannelImpl.c index 4ba86a942e9..d1d529f52d2 100644 --- a/src/java.base/windows/native/libnio/ch/SocketChannelImpl.c +++ b/src/java.base/windows/native/libnio/ch/SocketChannelImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -55,8 +55,7 @@ handleSocketError(JNIEnv *env, int errorValue) JNIEXPORT jint JNICALL Java_sun_nio_ch_SocketChannelImpl_checkConnect(JNIEnv *env, jobject this, - jobject fdo, jboolean block, - jboolean ready) + jobject fdo, jboolean block) { int optError = 0; int lastError = 0; diff --git a/src/java.base/windows/native/libnio/ch/SocketDispatcher.c b/src/java.base/windows/native/libnio/ch/SocketDispatcher.c index e2361d4a1ff..a4430114421 100644 --- a/src/java.base/windows/native/libnio/ch/SocketDispatcher.c +++ b/src/java.base/windows/native/libnio/ch/SocketDispatcher.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -272,7 +272,7 @@ Java_sun_nio_ch_SocketDispatcher_preClose0(JNIEnv *env, jclass clazz, int len = sizeof(l); if (getsockopt(fd, SOL_SOCKET, SO_LINGER, (char *)&l, &len) == 0) { if (l.l_onoff == 0) { - WSASendDisconnect(fd, NULL); + shutdown(fd, SD_SEND); } } } diff --git a/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java b/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java index 6ab21d602da..b5f2a6f9a5a 100644 --- a/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java +++ b/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java @@ -57,6 +57,7 @@ public enum SourceVersion { * 1.8: lambda expressions and default methods * 9: modules, small cleanups to 1.7 and 1.8 changes * 10: local-variable type inference (var) + * 11: to be determined changes */ /** @@ -162,7 +163,15 @@ public enum SourceVersion { * * @since 10 */ - RELEASE_10; + RELEASE_10, + + /** + * The version recognized by the Java Platform, Standard Edition + * 11. + * + * @since 11 + */ + RELEASE_11; // Note that when adding constants for newer releases, the // behavior of latest() and latestSupported() must be updated too. @@ -173,7 +182,7 @@ public enum SourceVersion { * @return the latest source version that can be modeled */ public static SourceVersion latest() { - return RELEASE_10; + return RELEASE_11; } private static final SourceVersion latestSupported = getLatestSupported(); @@ -183,6 +192,8 @@ public enum SourceVersion { String specVersion = System.getProperty("java.specification.version"); switch (specVersion) { + case "11": + return RELEASE_11; case "10": return RELEASE_10; case "9": diff --git a/src/java.compiler/share/classes/javax/tools/FileManagerUtils.java b/src/java.compiler/share/classes/javax/tools/FileManagerUtils.java deleted file mode 100644 index 1fe7783f638..00000000000 --- a/src/java.compiler/share/classes/javax/tools/FileManagerUtils.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package javax.tools; - -import java.io.File; -import java.nio.file.Path; -import java.util.Iterator; - -/** - * Package-private utility methods to convert between files and paths. - * - * @since 9 - */ -class FileManagerUtils { - private FileManagerUtils() { } - - static Iterable asPaths(final Iterable files) { - return () -> new Iterator() { - Iterator iter = files.iterator(); - - @Override - public boolean hasNext() { - return iter.hasNext(); - } - - @Override - public Path next() { - return iter.next().toPath(); - } - }; - } - - static Iterable asFiles(final Iterable paths) { - return () -> new Iterator() { - Iterator iter = paths.iterator(); - - @Override - public boolean hasNext() { - return iter.hasNext(); - } - - @Override - public File next() { - Path p = iter.next(); - try { - return p.toFile(); - } catch (UnsupportedOperationException e) { - throw new IllegalArgumentException(p.toString(), e); - } - } - }; - } -} diff --git a/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java b/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java index aeb17169c56..1e9612f62f1 100644 --- a/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java +++ b/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,8 +30,7 @@ import java.io.IOException; import java.nio.file.Path; import java.util.Arrays; import java.util.Collection; - -import static javax.tools.FileManagerUtils.*; +import java.util.Iterator; /** * File manager based on {@linkplain File java.io.File} and {@linkplain Path java.nio.file.Path}. @@ -447,4 +446,42 @@ public interface StandardJavaFileManager extends JavaFileManager { * @since 9 */ default void setPathFactory(PathFactory f) { } + + + private static Iterable asPaths(final Iterable files) { + return () -> new Iterator() { + Iterator iter = files.iterator(); + + @Override + public boolean hasNext() { + return iter.hasNext(); + } + + @Override + public Path next() { + return iter.next().toPath(); + } + }; + } + + private static Iterable asFiles(final Iterable paths) { + return () -> new Iterator() { + Iterator iter = paths.iterator(); + + @Override + public boolean hasNext() { + return iter.hasNext(); + } + + @Override + public File next() { + Path p = iter.next(); + try { + return p.toFile(); + } catch (UnsupportedOperationException e) { + throw new IllegalArgumentException(p.toString(), e); + } + } + }; + } } diff --git a/src/java.corba/share/classes/com/sun/corba/se/GiopIDL/GIOP.idl b/src/java.corba/share/classes/com/sun/corba/se/GiopIDL/GIOP.idl deleted file mode 100644 index 7f2d54fcd16..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/GiopIDL/GIOP.idl +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#include "IOP.idl" - -module GIOP { // IDL extended for version 1.1 and 1.2 - - struct Version { - octet major; - octet minor; - }; - - - // GIOP 1.0 - - struct MessageHeader_1_0 { // Renamed from MessageHeader - char magic [4]; - Version GIOP_version; - boolean byte_order; - octet message_type; - unsigned long message_size; - }; - - // GIOP 1.1 - - struct MessageHeader_1_1 { - char magic [4]; - Version GIOP_version; - octet flags; // GIOP 1.1 change - octet message_type; - unsigned long message_size; - }; - - // GIOP 1.2 - // Same Header contents for 1.1 and 1.2 - typedef MessageHeader_1_1 MessageHeader_1_2; - - - // GIOP 1.0 - struct RequestHeader_1_0 { // Renamed from RequestHeader - IOP::ServiceContextList service_context; - unsigned long request_id; - boolean response_expected; - sequence object_key; - string operation; - sequence requesting_principal; - }; - - // GIOP 1.1 - struct RequestHeader_1_1 { - IOP::ServiceContextList service_context; - unsigned long request_id; - boolean response_expected; - octet reserved[3]; // Added in GIOP 1.1 - sequence object_key; - string operation; - sequence requesting_principal; - }; - - // GIOP 1.2 - typedef short AddressingDisposition; - const short KeyAddr = 0; - const short ProfileAddr = 1; - const short ReferenceAddr = 2; - struct IORAddressingInfo { - unsigned long selected_profile_index; - IOP::IOR ior; - }; - union TargetAddress switch (AddressingDisposition) { - case KeyAddr: sequence object_key; - case ProfileAddr: IOP::TaggedProfile profile; - case ReferenceAddr: IORAddressingInfo ior; - }; - struct RequestHeader_1_2 { - unsigned long request_id; - octet response_flags; - octet reserved[3]; - TargetAddress target; - string operation; - IOP::ServiceContextList service_context; - // Principal not in GIOP 1.2 - }; - - - #ifndef GIOP_1_2 //We're supporting all versions - - // GIOP 1.0 and 1.1 - enum ReplyStatusType_1_0 { // Renamed from ReplyStatusType - NO_EXCEPTION, - USER_EXCEPTION, - SYSTEM_EXCEPTION, - LOCATION_FORWARD - }; - - // GIOP 1.0 - struct ReplyHeader_1_0 { // Renamed from ReplyHeader - IOP::ServiceContextList service_context; - unsigned long request_id; - ReplyStatusType_1_0 reply_status; - }; - - // GIOP 1.1 - // Same Header contents for 1.0 and 1.1 - typedef ReplyHeader_1_0 ReplyHeader_1_1; - - #else - - // GIOP 1.2 - enum ReplyStatusType_1_2 { - NO_EXCEPTION, - USER_EXCEPTION, - SYSTEM_EXCEPTION, - LOCATION_FORWARD, - LOCATION_FORWARD_PERM,// new value for 1.2 - NEEDS_ADDRESSING_MODE // new value for 1.2 - }; - - struct ReplyHeader_1_2 { - unsigned long request_id; - ReplyStatusType_1_2 reply_status; - IOP::ServiceContextList service_context; - }; - - #endif // GIOP_1_2 - - - struct SystemExceptionReplyBody { - string exception_id; - unsigned long minor_code_value; - unsigned long completion_status; - }; - - - - struct CancelRequestHeader { - unsigned long request_id; - }; - - - - // GIOP 1.0 - struct LocateRequestHeader_1_0 { // Renamed LocationRequestHeader - unsigned long request_id; - sequence object_key; - }; - - // GIOP 1.1 - // Same Header contents for 1.0 and 1.1 - typedef LocateRequestHeader_1_0 LocateRequestHeader_1_1; - - // GIOP 1.2 - struct LocateRequestHeader_1_2 { - unsigned long request_id; - TargetAddress target; - }; - - - #ifndef GIOP_1_2 // We're supporting all versions - - // GIOP 1.0 and 1.1 - enum LocateStatusType_1_0 { // Renamed from LocateStatusType - UNKNOWN_OBJECT, - OBJECT_HERE, - OBJECT_FORWARD - }; - - - // GIOP 1.0 - struct LocateReplyHeader_1_0 { // Renamed from LocateReplyHeader - unsigned long request_id; - LocateStatusType_1_0 locate_status; - }; - - // GIOP 1.1 - // same Header contents for 1.0 and 1.1 - typedef LocateReplyHeader_1_0 LocateReplyHeader_1_1; - - #else - - // GIOP 1.2 - enum LocateStatusType_1_2 { - UNKNOWN_OBJECT, - OBJECT_HERE, - OBJECT_FORWARD, - OBJECT_FORWARD_PERM, // new value for GIOP 1.2 - LOC_SYSTEM_EXCEPTION, // new value for GIOP 1.2 - LOC_NEEDS_ADDRESSING_MODE // new value for GIOP 1.2 - }; - - struct LocateReplyHeader_1_2 { - unsigned long request_id; - LocateStatusType_1_2 locate_status; - }; - - #endif // GIOP_1_2 - - - // GIOP 1.2 - struct FragmentHeader_1_2 { - unsigned long request_id; - }; -}; diff --git a/src/java.corba/share/classes/com/sun/corba/se/GiopIDL/messages.idl b/src/java.corba/share/classes/com/sun/corba/se/GiopIDL/messages.idl deleted file mode 100644 index c9b0ddf2b57..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/GiopIDL/messages.idl +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @(#)GIOP.idl 1.0 00/05/21 - * - */ - -#include "IOP.idl" - -module messages { - - typedef short AddressingDisposition; - const short KeyAddr = 0; - const short ProfileAddr = 1; - const short ReferenceAddr = 2; - struct IORAddressingInfo { - unsigned long selected_profile_index; - IOP::IOR ior; - }; - union TargetAddress switch (AddressingDisposition) { - case KeyAddr: sequence object_key; - case ProfileAddr: IOP::TaggedProfile profile; - case ReferenceAddr: IORAddressingInfo ior; - }; -}; diff --git a/src/java.corba/share/classes/com/sun/corba/se/PortableActivationIDL/activation.idl b/src/java.corba/share/classes/com/sun/corba/se/PortableActivationIDL/activation.idl deleted file mode 100644 index 9ca22d79365..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/PortableActivationIDL/activation.idl +++ /dev/null @@ -1,408 +0,0 @@ -/* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#include "Interceptors.idl" - -module PortableActivationIDL { - /** Possible values for endpointType argument on Server.getEndpoint() - * If you change the value of this constant then update - * core.EndPoint accordingly. It has a duplicate definition - * to avoid a compilation dependency. - */ - const string IIOP_CLEAR_TEXT = "IIOP_CLEAR_TEXT"; - - /** Raised if getEndpoint is called on a server callback object for - * an invalid endpoint type - */ - exception NoSuchEndPoint {} ; - - /** Raised if an attempt is made to retrieve ports corresponding to - * non-registered ORB - */ - exception InvalidORBid {} ; - - /** Raised if an operation is attempted against an invalid server ID. - */ - exception ServerNotRegistered { - PortableInterceptor::ServerId serverId ; - }; - - /** Raised if an operation is attempted for a server that is not running, - * and the server is required to be running for the operation. - */ - exception ServerNotActive { - PortableInterceptor::ServerId serverId ; - }; - - /** Raised if an operation is attempted against a server that is in a - * hold down state. A server becomes held down if it fails to activate - * within 10 seconds. - */ - exception ServerHeldDown { - PortableInterceptor::ServerId serverId ; - }; - - /** Raised if an attempt is made to activate a server that is already - * running. - */ - exception ServerAlreadyActive{ - PortableInterceptor::ServerId serverId ; - }; - - /** Raised if an attempt is made to register a serverdef with the - * same applicationName as an existing serverdef. - */ - exception ServerAlreadyRegistered { - PortableInterceptor::ServerId serverId; - }; - - /** Raised if an attempt is made to install a server that is currently - * installed. Note that a newly created server starts out in an uninstalled - * state. - */ - exception ServerAlreadyInstalled { - PortableInterceptor::ServerId serverId; - } ; - - /** Raised if an attempt is made to uninstall a server that is currently - * uninstalled. Note that a newly created server starts out in an - * uninstalled - * state. - */ - exception ServerAlreadyUninstalled { - PortableInterceptor::ServerId serverId; - } ; - - /** Raised if an attempt is made to register an invalid serverdef. - */ - exception BadServerDefinition { - string reason; - }; - - /** Raised if an attempt is made to register endpoints for the - * same ORB again - */ - exception ORBAlreadyRegistered { - PortableInterceptor::ORBId orbId; - }; - - /** Type of TCP port number, used in structures that describe - * transport endpoints. The valid range is actually 0-65535, but - * we use a long here to avoid signed/unsigned conversion headaches - * in Java. - */ - typedef long TCPPort ; - - /** Sequence of server Ids, used for queries about servers. - */ - typedef sequence ServerIds; - - /** End point information for one particular kind of port associated with an - * an ORB. This is only used in the - * Activator interface, which must always run on the same host as the daemon, - * therefore we do not need the host name here. - */ - struct EndPointInfo { - string endpointType; - TCPPort port; - }; - - /** A list of endpoint information for a particular ORB. - */ - typedef sequence EndpointInfoList; - - /** struct contain ORB and port info for a particular type of endpoint. - * This is only used in the - * Activator interface, which must always run on the same host as the daemon, - * therefore we do not need the host name here. - */ - struct ORBPortInfo { - PortableInterceptor::ORBId orbId; - TCPPort port; - }; - - /** A list of ORB and port information for a particular endpoint type. - */ - typedef sequence ORBPortInfoList; - - /** A list of ORB IDs. - */ - typedef sequence ORBidList; - - /** Server callback interface, passed to Activator in registerServer method. - */ - interface ServerProxy { - /** Shutdown this server. Returns after orb.shutdown() completes. - */ - void shutdown(); - - /** Install the server. Returns after the install hook completes - * execution in the server. - */ - void install(); - - /** Uninstall the server. Returns after the uninstall hook - * completes execution. - */ - void uninstall(); - }; - - /** ORB callback interface, passed to Activator in registerORB method. - */ - interface ORBProxy { - /** Method used to cause ORB to activate the named adapter, if possible. - * This will cause the named POA to register itself with the activator as - * a side effect. This should always happen before this call can complete. - * This method returns true if adapter activation succeeded, otherwise it - * returns false. - */ - boolean activate_adapter( in PortableInterceptor::AdapterName name ) ; - } ; - - interface Activator { - /******************************************************* - * Server State Change Methods - ********************************************************/ - - /** A new ORB started server registers itself with the Activator - */ - void registerServer(in PortableInterceptor::ServerId serverId, in ServerProxy serverObj) - raises (ServerNotRegistered); - - /** A server is shutting down that was started by this activator. - * Complete termination of the server is detected by the death of the - * process implementing the server. - */ - void serverGoingDown( in PortableInterceptor::ServerId serverId ) ; - - /** Called whenever an ORB instance is created. This registers - * the transport endpoints and the ORB proxy callback object. - * Note that we cannot detect when an ORB shuts down, although - * all of the POA shutdowns should still be reported. - */ - void registerORB( in PortableInterceptor::ServerId serverId, in PortableInterceptor::ORBId orbId, - in ORBProxy orb, in EndpointInfoList endPointInfo) - raises (ServerNotRegistered,NoSuchEndPoint, ORBAlreadyRegistered) ; - - /** Construct or find an ORBD object template corresponding to the - * server's object template and return it. Called whenever a - * persistent POA is created. - */ - PortableInterceptor::ObjectReferenceTemplate registerPOA( - in PortableInterceptor::ServerId serverId, in PortableInterceptor::ORBId orbId, - in PortableInterceptor::ObjectReferenceTemplate poaTemplate ) ; - - /** Called whenever a POA is destroyed. - */ - void poaDestroyed( - in PortableInterceptor::ServerId serverId, in PortableInterceptor::ORBId orbId, - in PortableInterceptor::ObjectReferenceTemplate poaTemplate ) ; - - /******************************************************* - * Server Control Methods - ********************************************************/ - - /** If the server is not running, start it up. This is allowed - * whether or not the server has been installed. - */ - void activate(in PortableInterceptor::ServerId serverId) - raises (ServerAlreadyActive, ServerNotRegistered, ServerHeldDown); - - /** If the server is running, shut it down - */ - void shutdown(in PortableInterceptor::ServerId serverId) - raises (ServerNotActive, ServerNotRegistered); - - /** Invoke the server install hook. If the server is not - * currently running, this method will activate it. - */ - void install(in PortableInterceptor::ServerId serverId) - raises (ServerNotRegistered, ServerHeldDown, - ServerAlreadyInstalled); - - /** Invoke the server uninstall hook. If the server is not - * currently running, this method will activate it. - * After this hook completes, the server may still be running. - */ - void uninstall(in PortableInterceptor::ServerId serverId) - raises (ServerNotRegistered, ServerHeldDown, - ServerAlreadyUninstalled); - - /******************************************************* - * Accessors - ********************************************************/ - - /** list active servers - */ - ServerIds getActiveServers(); - - /** list all registered ORBs for a server - */ - ORBidList getORBNames(in PortableInterceptor::ServerId serverId) - raises (ServerNotRegistered); - - /** Find the server template that corresponds to the ORBD's - * adapter id. - */ - PortableInterceptor::ObjectReferenceTemplate lookupPOATemplate( - in PortableInterceptor::ServerId serverId, in PortableInterceptor::ORBId orbId, - in PortableInterceptor::AdapterName orbAdapterName ) ; - }; - - interface Locator { - /** struct to return the list of endpoints for a server for a specific - * endpoint type. - */ - struct ServerLocationPerType { - string hostname; - ORBPortInfoList ports; - }; - - /** struct to return the list of endpoints for a server for a specific - * ORB - */ - struct ServerLocationPerORB { - string hostname; - EndpointInfoList ports; - }; - - /** locate server - returns the port with a specific type for all registered - * ORBs of an active server. - * Starts the server if it is not already running. - */ - ServerLocationPerType locateServer( - in PortableInterceptor::ServerId serverId, - in string endPoint) - raises(NoSuchEndPoint, ServerNotRegistered, ServerHeldDown); - - /** locate server - returns all ports registered with a specified ORB for - * an active server - * Starts the server if it is not already running. - */ - ServerLocationPerORB locateServerForORB( - in PortableInterceptor::ServerId serverId, - in PortableInterceptor::ORBId orbId) - raises(InvalidORBid, ServerNotRegistered, ServerHeldDown); - - /** get the port for the endpoint of the locator - */ - TCPPort getEndpoint(in string endPointType) - raises(NoSuchEndPoint); - - /** Useful from external BadServerIdHandlers which need - * to pick a particular port type. - */ - TCPPort getServerPortForType( - in ServerLocationPerORB location, - in string endPointType) - raises(NoSuchEndPoint); - }; - - /** Interface used to combine the Activator and Locator when both are - * implemented together in the same process, as is currently the case - * for our implementation. - */ - interface ServerManager : Activator, Locator { }; - - /** Interface used to support binding references in the bootstrap name - * service. - */ - interface InitialNameService { - exception NameAlreadyBound {}; - - /** bind initial name - */ - void bind ( - in string name, - in Object obj, - in boolean isPersistant) raises (NameAlreadyBound); - }; - - interface Repository { - /** server program definition. - */ - struct ServerDef { - string applicationName; // alias used for servers with identical - // serverName values. - string serverName; // Class name of server's main class. - string serverClassPath; // class path used to run the server. - string serverArgs; // arguments passed to the server - string serverVmArgs; // arguments passed to the server's Java VM1 - boolean isInstalled; // Whether or not the server has been installed - }; - - /** register server definition. - * This returns the serverId of the server. A newly created server is - * always uninstalled. - */ - PortableInterceptor::ServerId registerServer (in ServerDef serverDef) - raises (ServerAlreadyRegistered, BadServerDefinition); - - /** unregister server definition - */ - void unregisterServer (in PortableInterceptor::ServerId serverId) - raises (ServerNotRegistered); - - /** get server definition - */ - ServerDef getServer(in PortableInterceptor::ServerId serverId) - raises (ServerNotRegistered); - - /** Return whether the server has been installed - */ - boolean isInstalled( in PortableInterceptor::ServerId serverId ) - raises (ServerNotRegistered); - - /** Mark the server as being installed. Raises ServerAlreadyInstalled - * if the server is currently marked as installed. - */ - void install( in PortableInterceptor::ServerId serverId ) - raises (ServerNotRegistered, ServerAlreadyInstalled) ; - - /** Mark the server as being uninstalled. Raises ServerAlreadyUninstalled - * if the server is currently marked as uninstalled. - */ - void uninstall( in PortableInterceptor::ServerId serverId ) - raises (ServerNotRegistered, ServerAlreadyUninstalled) ; - - /** list registered servers - */ - ServerIds listRegisteredServers (); - - /** Type used for a list of application names - */ - typedef sequence AppNames ; - - /** Returns list of ALL applicationNames defined in ServerDefs of registered - * servers. - */ - AppNames getApplicationNames(); - - /** Find the ServerID associated with the given application name. - */ - PortableInterceptor::ServerId getServerID( in string applicationName ) - raises (ServerNotRegistered) ; - }; -}; diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/activation/CommandHandler.java b/src/java.corba/share/classes/com/sun/corba/se/impl/activation/CommandHandler.java deleted file mode 100644 index d307a0f3949..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/activation/CommandHandler.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.activation; - -import org.omg.CORBA.ORB; - -import java.io.PrintStream; - -/** - * @author Rohit Garg - * @since JDK1.2 - */ - -public interface CommandHandler -{ - String getCommandName(); - - public final static boolean shortHelp = true; - public final static boolean longHelp = false; - - void printCommandHelp(PrintStream out, boolean helpType); - - public final static boolean parseError = true; - public final static boolean commandDone = false; - - boolean processCommand(String[] cmd, ORB orb, PrintStream out); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/activation/NameServiceStartThread.java b/src/java.corba/share/classes/com/sun/corba/se/impl/activation/NameServiceStartThread.java deleted file mode 100644 index d4d2cf4b127..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/activation/NameServiceStartThread.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.activation; - - -import java.io.File; - -import org.omg.CosNaming.NamingContext; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.impl.naming.pcosnaming.NameService; -import com.sun.corba.se.impl.orbutil.ORBConstants; - -// REVISIT: After Merlin to see if we can get rid of this Thread and -// make the registration of PNameService for INS and BootStrap neat. -public class NameServiceStartThread extends java.lang.Thread -{ - private ORB orb; - private File dbDir; - - public NameServiceStartThread( ORB theOrb, File theDir ) - { - orb = theOrb; - dbDir = theDir; - } - - public void run( ) - { - try { - // start Name Service - NameService nameService = new NameService(orb, dbDir ); - NamingContext rootContext = nameService.initialNamingContext(); - orb.register_initial_reference( - ORBConstants.PERSISTENT_NAME_SERVICE_NAME, rootContext ); - } catch( Exception e ) { - System.err.println( - "NameService did not start successfully" ); - e.printStackTrace( ); - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/activation/ORBD.java b/src/java.corba/share/classes/com/sun/corba/se/impl/activation/ORBD.java deleted file mode 100644 index 6a3fd5ca305..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/activation/ORBD.java +++ /dev/null @@ -1,352 +0,0 @@ -/* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.activation; - -import java.io.File; -import java.util.Properties; - -import org.omg.CORBA.INITIALIZE; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.CompletionStatus; -import org.omg.CosNaming.NamingContext; -import org.omg.PortableServer.POA; - -import com.sun.corba.se.pept.transport.Acceptor; - -import com.sun.corba.se.spi.activation.Repository; -import com.sun.corba.se.spi.activation.RepositoryPackage.ServerDef; -import com.sun.corba.se.spi.activation.Locator; -import com.sun.corba.se.spi.activation.LocatorHelper; -import com.sun.corba.se.spi.activation.Activator; -import com.sun.corba.se.spi.activation.ActivatorHelper; -import com.sun.corba.se.spi.activation.ServerAlreadyRegistered; -import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketEndPointInfo; -import com.sun.corba.se.spi.transport.SocketInfo; -import com.sun.corba.se.spi.orb.ORB; - -import com.sun.corba.se.impl.legacy.connection.SocketFactoryAcceptorImpl; -import com.sun.corba.se.impl.naming.cosnaming.TransientNameService; -import com.sun.corba.se.impl.naming.pcosnaming.NameService; -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.impl.orbutil.CorbaResourceUtil; -import com.sun.corba.se.impl.transport.SocketOrChannelAcceptorImpl; - -/** - * - * @author Rohit Garg - * @since JDK1.2 - */ -public class ORBD -{ - private int initSvcPort; - - protected void initializeBootNaming(ORB orb) - { - // create a bootstrap server - initSvcPort = orb.getORBData().getORBInitialPort(); - - Acceptor acceptor; - // REVISIT: see ORBConfigurator. use factory in TransportDefault. - if (orb.getORBData().getLegacySocketFactory() == null) { - acceptor = - new SocketOrChannelAcceptorImpl( - orb, - initSvcPort, - LegacyServerSocketEndPointInfo.BOOT_NAMING, - SocketInfo.IIOP_CLEAR_TEXT); - } else { - acceptor = - new SocketFactoryAcceptorImpl( - orb, - initSvcPort, - LegacyServerSocketEndPointInfo.BOOT_NAMING, - SocketInfo.IIOP_CLEAR_TEXT); - } - orb.getCorbaTransportManager().registerAcceptor(acceptor); - } - - protected ORB createORB(String[] args) - { - Properties props = System.getProperties(); - - // For debugging. - //props.put( ORBConstants.DEBUG_PROPERTY, "naming" ) ; - //props.put( ORBConstants.DEBUG_PROPERTY, "transport,giop,naming" ) ; - - props.put( ORBConstants.SERVER_ID_PROPERTY, "1000" ) ; - props.put( ORBConstants.PERSISTENT_SERVER_PORT_PROPERTY, - props.getProperty( ORBConstants.ORBD_PORT_PROPERTY, - Integer.toString( - ORBConstants.DEFAULT_ACTIVATION_PORT ) ) ) ; - - // See Bug 4396928 for more information about why we are initializing - // the ORBClass to PIORB (now ORBImpl, but should check the bugid). - props.put("org.omg.CORBA.ORBClass", - "com.sun.corba.se.impl.orb.ORBImpl"); - - return (ORB) ORB.init(args, props); - } - - private void run(String[] args) - { - try { - // parse the args and try setting the values for these - // properties - processArgs(args); - - ORB orb = createORB(args); - - if (orb.orbdDebugFlag) - System.out.println( "ORBD begins initialization." ) ; - - boolean firstRun = createSystemDirs( ORBConstants.DEFAULT_DB_DIR ); - - startActivationObjects(orb); - - if (firstRun) // orbd is being run the first time - installOrbServers(getRepository(), getActivator()); - - if (orb.orbdDebugFlag) { - System.out.println( "ORBD is ready." ) ; - System.out.println("ORBD serverid: " + - System.getProperty(ORBConstants.SERVER_ID_PROPERTY)); - System.out.println("activation dbdir: " + - System.getProperty(ORBConstants.DB_DIR_PROPERTY)); - System.out.println("activation port: " + - System.getProperty(ORBConstants.ORBD_PORT_PROPERTY)); - - String pollingTime = System.getProperty( - ORBConstants.SERVER_POLLING_TIME); - if( pollingTime == null ) { - pollingTime = Integer.toString( - ORBConstants.DEFAULT_SERVER_POLLING_TIME ); - } - System.out.println("activation Server Polling Time: " + - pollingTime + " milli-seconds "); - - String startupDelay = System.getProperty( - ORBConstants.SERVER_STARTUP_DELAY); - if( startupDelay == null ) { - startupDelay = Integer.toString( - ORBConstants.DEFAULT_SERVER_STARTUP_DELAY ); - } - System.out.println("activation Server Startup Delay: " + - startupDelay + " milli-seconds " ); - } - - // The following two lines start the Persistent NameService - NameServiceStartThread theThread = - new NameServiceStartThread( orb, dbDir ); - theThread.start( ); - - orb.run(); - } catch( org.omg.CORBA.COMM_FAILURE cex ) { - System.out.println( CorbaResourceUtil.getText("orbd.commfailure")); - System.out.println( cex ); - cex.printStackTrace(); - } catch( org.omg.CORBA.INTERNAL iex ) { - System.out.println( CorbaResourceUtil.getText( - "orbd.internalexception")); - System.out.println( iex ); - iex.printStackTrace(); - } catch (Exception ex) { - System.out.println(CorbaResourceUtil.getText( - "orbd.usage", "orbd")); - System.out.println( ex ); - ex.printStackTrace(); - } - } - - private void processArgs(String[] args) - { - Properties props = System.getProperties(); - for (int i=0; i < args.length; i++) { - if (args[i].equals("-port")) { - if ((i+1) < args.length) { - props.put(ORBConstants.ORBD_PORT_PROPERTY, args[++i]); - } else { - System.out.println(CorbaResourceUtil.getText( - "orbd.usage", "orbd")); - } - } else if (args[i].equals("-defaultdb")) { - if ((i+1) < args.length) { - props.put(ORBConstants.DB_DIR_PROPERTY, args[++i]); - } else { - System.out.println(CorbaResourceUtil.getText( - "orbd.usage", "orbd")); - } - } else if (args[i].equals("-serverid")) { - if ((i+1) < args.length) { - props.put(ORBConstants.SERVER_ID_PROPERTY, args[++i]); - } else { - System.out.println(CorbaResourceUtil.getText( - "orbd.usage", "orbd")); - } - } else if (args[i].equals("-serverPollingTime")) { - if ((i+1) < args.length) { - props.put(ORBConstants.SERVER_POLLING_TIME, args[++i]); - } else { - System.out.println(CorbaResourceUtil.getText( - "orbd.usage", "orbd")); - } - } else if (args[i].equals("-serverStartupDelay")) { - if ((i+1) < args.length) { - props.put(ORBConstants.SERVER_STARTUP_DELAY, args[++i]); - } else { - System.out.println(CorbaResourceUtil.getText( - "orbd.usage", "orbd")); - } - } - } - } - - /** - * Ensure that the Db directory exists. If not, create the Db - * and the log directory and return true. Otherwise return false. - */ - protected boolean createSystemDirs(String defaultDbDir) - { - boolean dirCreated = false; - Properties props = System.getProperties(); - String fileSep = props.getProperty("file.separator"); - - // determine the ORB db directory - dbDir = new File (props.getProperty( ORBConstants.DB_DIR_PROPERTY, - props.getProperty("user.dir") + fileSep + defaultDbDir)); - - // create the db and the logs directories - dbDirName = dbDir.getAbsolutePath(); - props.put(ORBConstants.DB_DIR_PROPERTY, dbDirName); - if (!dbDir.exists()) { - dbDir.mkdir(); - dirCreated = true; - } - - File logDir = new File (dbDir, ORBConstants.SERVER_LOG_DIR ) ; - if (!logDir.exists()) logDir.mkdir(); - - return dirCreated; - } - - protected File dbDir; - protected File getDbDir() - { - return dbDir; - } - - private String dbDirName; - protected String getDbDirName() - { - return dbDirName; - } - - protected void startActivationObjects(ORB orb) throws Exception - { - // create Initial Name Service object - initializeBootNaming(orb); - - // create Repository object - repository = new RepositoryImpl(orb, dbDir, orb.orbdDebugFlag ); - orb.register_initial_reference( ORBConstants.SERVER_REPOSITORY_NAME, repository ); - - // create Locator and Activator objects - ServerManagerImpl serverMgr = - new ServerManagerImpl( orb, - orb.getCorbaTransportManager(), - repository, - getDbDirName(), - orb.orbdDebugFlag ); - - locator = LocatorHelper.narrow(serverMgr); - orb.register_initial_reference( ORBConstants.SERVER_LOCATOR_NAME, locator ); - - activator = ActivatorHelper.narrow(serverMgr); - orb.register_initial_reference( ORBConstants.SERVER_ACTIVATOR_NAME, activator ); - - // start Name Service - TransientNameService nameService = new TransientNameService(orb, - ORBConstants.TRANSIENT_NAME_SERVICE_NAME); - } - - protected Locator locator; - protected Locator getLocator() - { - return locator; - } - - protected Activator activator; - protected Activator getActivator() - { - return activator; - } - - protected RepositoryImpl repository; - protected RepositoryImpl getRepository() - { - return repository; - } - - /** - * Go through the list of ORB Servers and initialize and start - * them up. - */ - protected void installOrbServers(RepositoryImpl repository, - Activator activator) - { - int serverId; - String[] server; - ServerDef serverDef; - - for (int i=0; i < orbServers.length; i++) { - try { - server = orbServers[i]; - serverDef = new ServerDef(server[1], server[2], - server[3], server[4], server[5] ); - - serverId = Integer.valueOf(orbServers[i][0]).intValue(); - - repository.registerServer(serverDef, serverId); - - activator.activate(serverId); - - } catch (Exception ex) {} - } - } - - public static void main(String[] args) { - ORBD orbd = new ORBD(); - orbd.run(args); - } - - /** - * List of servers to be auto registered and started by the ORBd. - * - * Each server entry is of the form {id, name, path, args, vmargs}. - */ - private static String[][] orbServers = { - {""} - }; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/activation/ProcessMonitorThread.java b/src/java.corba/share/classes/com/sun/corba/se/impl/activation/ProcessMonitorThread.java deleted file mode 100644 index c7caabadbc4..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/activation/ProcessMonitorThread.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.activation; - -import java.util.*; -import com.sun.corba.se.impl.orbutil.ORBConstants; - -/** ProcessMonitorThread is started when ServerManager is instantiated. The - * thread wakes up every minute (This can be changed by setting sleepTime) and - * makes sure that all the processes (Servers) registered with the ServerTool - * are healthy. If not the state in ServerTableEntry will be changed to - * De-Activated. - * Note: This thread can be killed from the main thread by calling - * interrupThread() - */ -public class ProcessMonitorThread extends java.lang.Thread { - private HashMap serverTable; - private int sleepTime; - private static ProcessMonitorThread instance = null; - - private ProcessMonitorThread( HashMap ServerTable, int SleepTime ) { - serverTable = ServerTable; - sleepTime = SleepTime; - } - - public void run( ) { - while( true ) { - try { - // Sleep's for a specified time, before checking - // the Servers health. This will repeat as long as - // the ServerManager (ORBD) is up and running. - Thread.sleep( sleepTime ); - } catch( java.lang.InterruptedException e ) { - break; - } - Iterator serverList; - synchronized ( serverTable ) { - // Check each ServerTableEntry to make sure that they - // are in the right state. - serverList = serverTable.values().iterator(); - } - try { - checkServerHealth( serverList ); - } catch( ConcurrentModificationException e ) { - break; - } - } - } - - private void checkServerHealth( Iterator serverList ) { - if( serverList == null ) return; - while (serverList.hasNext( ) ) { - ServerTableEntry entry = (ServerTableEntry) serverList.next(); - entry.checkProcessHealth( ); - } - } - - static void start( HashMap serverTable ) { - int sleepTime = ORBConstants.DEFAULT_SERVER_POLLING_TIME; - - String pollingTime = System.getProperties().getProperty( - ORBConstants.SERVER_POLLING_TIME ); - - if ( pollingTime != null ) { - try { - sleepTime = Integer.parseInt( pollingTime ); - } catch (Exception e ) { - // Too late to complain, Just use the default - // sleepTime - } - } - - instance = new ProcessMonitorThread( serverTable, - sleepTime ); - instance.setDaemon( true ); - instance.start(); - } - - static void interruptThread( ) { - instance.interrupt(); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/activation/RepositoryImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/activation/RepositoryImpl.java deleted file mode 100644 index 768ae1623a0..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/activation/RepositoryImpl.java +++ /dev/null @@ -1,474 +0,0 @@ -/* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.activation; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; -import java.util.Properties; -import java.util.Hashtable; -import java.util.Enumeration; -import java.util.Vector; - -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.INITIALIZE; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.SystemException; - -import com.sun.corba.se.spi.activation.BadServerDefinition; -import com.sun.corba.se.spi.activation.RepositoryPackage.ServerDef; -import com.sun.corba.se.spi.activation._RepositoryImplBase; -import com.sun.corba.se.spi.activation.ServerAlreadyRegistered; -import com.sun.corba.se.spi.activation.ServerAlreadyInstalled; -import com.sun.corba.se.spi.activation.ServerAlreadyUninstalled; -import com.sun.corba.se.spi.activation.ServerNotRegistered; -import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketEndPointInfo; -import com.sun.corba.se.spi.transport.SocketOrChannelAcceptor; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.impl.orbutil.ORBConstants; - -import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.impl.logging.ActivationSystemException; - -/** - * - * @author Rohit Garg - * @since JDK1.2 - */ -public class RepositoryImpl extends _RepositoryImplBase - implements Serializable -{ - - // added serialver computed by the tool - private static final long serialVersionUID = 8458417785209341858L; - - RepositoryImpl(ORB orb, File dbDir, boolean debug) - { - this.debug = debug ; - this.orb = orb; - wrapper = ActivationSystemException.get( orb, CORBALogDomains.ORBD_REPOSITORY ) ; - - // if databse does not exist, create it otherwise read it in - File dbFile = new File(dbDir, "servers.db"); - if (!dbFile.exists()) { - db = new RepositoryDB(dbFile); - db.flush(); - } else { - try { - FileInputStream fis = new FileInputStream(dbFile); - ObjectInputStream ois = new ObjectInputStream(fis); - db = (RepositoryDB) ois.readObject(); - ois.close(); - } catch (Exception e) { - throw wrapper.cannotReadRepositoryDb( e ) ; - } - } - - // export the repository - orb.connect(this); - } - - private String printServerDef( ServerDef sd ) - { - return "ServerDef[applicationName=" + sd.applicationName + - " serverName=" + sd.serverName + - " serverClassPath=" + sd.serverClassPath + - " serverArgs=" + sd. serverArgs + - " serverVmArgs=" + sd.serverVmArgs + - "]" ; - } - - public int registerServer(ServerDef serverDef, int theServerId) - throws ServerAlreadyRegistered - { - int serverId; - DBServerDef server = null; - - synchronized (db) { - - // check if server already registered - Enumeration enumeration = db.serverTable.elements(); - while (enumeration.hasMoreElements()) { - server = (DBServerDef) enumeration.nextElement(); - if (serverDef.applicationName.equals(server.applicationName)) { - if (debug) - System.out.println( - "RepositoryImpl: registerServer called " + - "to register ServerDef " + - printServerDef( serverDef ) + - " with " + ((theServerId==illegalServerId) ? - "a new server Id" : ("server Id " + theServerId)) + - " FAILED because it is already registered." ) ; - - throw (new ServerAlreadyRegistered(server.id)); - } - } - - // generate a new server id - if (theServerId == illegalServerId) - serverId = db.incrementServerIdCounter(); - else - serverId = theServerId; - - // add server def to the database - server = new DBServerDef(serverDef, serverId); - db.serverTable.put(new Integer(serverId), server); - db.flush(); - - if (debug) - if (theServerId==illegalServerId) - System.out.println( "RepositoryImpl: registerServer called " + - "to register ServerDef " + printServerDef( serverDef ) + - " with new serverId " + serverId ) ; - else - System.out.println( "RepositoryImpl: registerServer called " + - "to register ServerDef " + printServerDef( serverDef ) + - " with assigned serverId " + serverId ) ; - - return serverId; - } - } - - public int registerServer(ServerDef serverDef) - throws ServerAlreadyRegistered, BadServerDefinition - { - // verify that the entry is valid - LegacyServerSocketEndPointInfo endpoint = - orb.getLegacyServerSocketManager() - .legacyGetEndpoint(LegacyServerSocketEndPointInfo.BOOT_NAMING); - int initSvcPort = ((SocketOrChannelAcceptor)endpoint) - .getServerSocket().getLocalPort(); - ServerTableEntry entry = new ServerTableEntry( wrapper, - illegalServerId, serverDef, (int) initSvcPort, "", true, debug ); - - switch (entry.verify()) { - case ServerMain.OK: - break; - case ServerMain.MAIN_CLASS_NOT_FOUND: - throw new BadServerDefinition("main class not found."); - case ServerMain.NO_MAIN_METHOD: - throw new BadServerDefinition("no main method found."); - case ServerMain.APPLICATION_ERROR: - throw new BadServerDefinition("server application error."); - default: - throw new BadServerDefinition("unknown Exception."); - } - - return registerServer(serverDef, illegalServerId); - } - - public void unregisterServer(int serverId) throws ServerNotRegistered { - - DBServerDef server = null; - Integer id = new Integer(serverId); - - synchronized (db) { - - // check to see if the server is registered - server = (DBServerDef) db.serverTable.get(id); - if (server == null) { - if (debug) - System.out.println( - "RepositoryImpl: unregisterServer for serverId " + - serverId + " called: server not registered" ) ; - - throw (new ServerNotRegistered()); - } - - // remove server from the database - db.serverTable.remove(id); - db.flush(); - } - - if (debug) - System.out.println( - "RepositoryImpl: unregisterServer for serverId " + serverId + - " called" ) ; - } - - private DBServerDef getDBServerDef(int serverId) throws ServerNotRegistered - { - Integer id = new Integer(serverId); - DBServerDef server = (DBServerDef) db.serverTable.get(id); - - if (server == null) - throw new ServerNotRegistered( serverId ); - - return server ; - } - - public ServerDef getServer(int serverId) throws ServerNotRegistered - { - DBServerDef server = getDBServerDef( serverId ) ; - - ServerDef serverDef = new ServerDef(server.applicationName, server.name, - server.classPath, server.args, server.vmArgs); - - if (debug) - System.out.println( - "RepositoryImpl: getServer for serverId " + serverId + - " returns " + printServerDef( serverDef ) ) ; - - return serverDef; - } - - public boolean isInstalled(int serverId) throws ServerNotRegistered { - DBServerDef server = getDBServerDef( serverId ) ; - return server.isInstalled ; - } - - public void install( int serverId ) - throws ServerNotRegistered, ServerAlreadyInstalled - { - DBServerDef server = getDBServerDef( serverId ) ; - - if (server.isInstalled) - throw new ServerAlreadyInstalled( serverId ) ; - else { - server.isInstalled = true ; - db.flush() ; - } - } - - public void uninstall( int serverId ) - throws ServerNotRegistered, ServerAlreadyUninstalled - { - DBServerDef server = getDBServerDef( serverId ) ; - - if (!server.isInstalled) - throw new ServerAlreadyUninstalled( serverId ) ; - else { - server.isInstalled = false ; - db.flush() ; - } - } - - public int[] listRegisteredServers() { - synchronized (db) { - int i=0; - - int servers[] = new int[db.serverTable.size()]; - - Enumeration enumeration = db.serverTable.elements(); - - while (enumeration.hasMoreElements()) { - DBServerDef server = (DBServerDef) enumeration.nextElement(); - servers[i++] = server.id; - } - - if (debug) { - StringBuffer sb = new StringBuffer() ; - for (int ctr=0; ctr "); - - try { - int i = 0; - String cmd[] = null; - - String cmdLine = in.readLine(); - - if (cmdLine != null) { - StringTokenizer st = new StringTokenizer(cmdLine); - if (st.countTokens() != 0) { - cmd = new String[st.countTokens()]; - while (st.hasMoreTokens()) cmd[i++] = st.nextToken(); - } - } - - return cmd; - } catch (Exception ex) { - System.out.println(CorbaResourceUtil.getText("servertool.usage", "servertool")); - System.out.println(); - ex.printStackTrace(); - } - - return null; - } - - void printAvailableCommands() - { - CommandHandler handler; - - // print short help - System.out.println(CorbaResourceUtil.getText("servertool.shorthelp")); - - for (int i=0; i < handlers.size(); i++) { - handler = (CommandHandler) handlers.elementAt(i); - System.out.print("\t" + handler.getCommandName()); - for (int j=handler.getCommandName().length(); - j < maxNameLen; j++) System.out.print(" "); - System.out.print(" - "); - handler.printCommandHelp(System.out, - CommandHandler.shortHelp); - } - - System.out.println(); - } - - void executeCommand(String[] cmd) - { - boolean result; - CommandHandler handler; - - // handle the help command - if (cmd[0].equals(helpCommand)) { - if (cmd.length == 1) printAvailableCommands(); - else { - // print long help for a specific command - for (int i=0; i < handlers.size(); i++) { - handler = (CommandHandler) handlers.elementAt(i); - if (handler.getCommandName().equals(cmd[1])) { - handler.printCommandHelp(System.out, - CommandHandler.longHelp); - } - } - } - - return; - } - - // determine the subcommand and execute it - for (int i=0; i < handlers.size(); i++) { - handler = (CommandHandler) handlers.elementAt(i); - if (handler.getCommandName().equals(cmd[0])) { - String[] cmdArgs = new String[cmd.length - 1]; - - // construct args to the command - for (int j=0; j < cmdArgs.length; j++) - cmdArgs[j] = cmd[j+1]; - - // execute the command - try { - System.out.println(); - - result = handler.processCommand(cmdArgs, orb, System.out); - - if (result == CommandHandler.parseError) { - handler.printCommandHelp(System.out, - CommandHandler.longHelp); - } - - System.out.println(); - - } catch (Exception ex) {} - - return; - } - } - - // unknown command - print available commands - printAvailableCommands(); - } - - final private static boolean debug = false; - - ORB orb = null; - - static Vector handlers; - static int maxNameLen; - - static { - handlers = new Vector(); - handlers.addElement(new RegisterServer()); - handlers.addElement(new UnRegisterServer()); - handlers.addElement(new GetServerID()); - handlers.addElement(new ListServers()); - handlers.addElement(new ListAliases()); - handlers.addElement(new ListActiveServers()); - handlers.addElement(new LocateServer()); - handlers.addElement(new LocateServerForORB()); - handlers.addElement(new ListORBs()); - handlers.addElement(new ShutdownServer()); - handlers.addElement(new StartServer()); - handlers.addElement(new Help()); - handlers.addElement(new Quit()); - - // determine longest command name - maxNameLen = 0; - int cmdNameLen; - for (int i=0; i < handlers.size(); i++) { - CommandHandler handler = (CommandHandler) handlers.elementAt(i); - cmdNameLen = handler.getCommandName().length(); - if (cmdNameLen > maxNameLen) maxNameLen = cmdNameLen; - } - } -} - -class RegisterServer implements CommandHandler -{ - public String getCommandName() {return "register";} - - public void printCommandHelp(PrintStream out, boolean helpType) - { - if (helpType == longHelp) { - out.println(CorbaResourceUtil.getText("servertool.register")); - } else { - out.println(CorbaResourceUtil.getText("servertool.register1")); - } - } - - public boolean processCommand(String[] cmdArgs, ORB orb, PrintStream out) - { - int i=0; - String applicationName = ""; - String name = ""; - String classpath = ""; - String args = ""; - String vmargs = ""; - int serverId = 0; - - // parse register server command - String arg; - while (i < cmdArgs.length) { - - arg = cmdArgs[i++]; - - if (arg.equals("-server")) { - if (i < cmdArgs.length) name = cmdArgs[i++]; - else return parseError; - } else if (arg.equals("-applicationName")) { - if (i < cmdArgs.length) applicationName = cmdArgs[i++]; - else return parseError; - } else if (arg.equals("-classpath")) { - if (i < cmdArgs.length) classpath = cmdArgs[i++]; - else return parseError; - } else if (arg.equals("-args")) { - while ((i < cmdArgs.length) && !cmdArgs[i].equals("-vmargs")){ - args = args.equals("") ? cmdArgs[i] : - args + " " + cmdArgs[i]; - i++; - } - if (args.equals("")) return parseError; - } else if (arg.equals("-vmargs")) { - while ((i < cmdArgs.length) && !cmdArgs[i].equals("-args")){ - vmargs = vmargs.equals("") ? cmdArgs[i] : - vmargs + " " + cmdArgs[i]; - i++; - } - if (vmargs.equals("")) return parseError; - } else return parseError; - } - - // minimally the server class name has to be specified - if (name.equals("")) return parseError; - - // register server and activate it - try { - // register the server with the repository - Repository repository = RepositoryHelper.narrow( - orb.resolve_initial_references( ORBConstants.SERVER_REPOSITORY_NAME )); - - ServerDef server = new ServerDef(applicationName, name, classpath, args, vmargs); - serverId = repository.registerServer(server); - - // activate the server - Activator activator = ActivatorHelper.narrow( - orb.resolve_initial_references( ORBConstants.SERVER_ACTIVATOR_NAME )); - activator.activate(serverId); - activator.install(serverId); - - // print success message - out.println(CorbaResourceUtil.getText("servertool.register2", serverId)); - } catch (ServerNotRegistered ex) { - } catch (ServerAlreadyActive ex) { - } catch (ServerHeldDown ex) { - out.println(CorbaResourceUtil.getText("servertool.register3", serverId)); - } catch (ServerAlreadyRegistered ex) { - out.println(CorbaResourceUtil.getText("servertool.register4", serverId)); - } catch (BadServerDefinition ex) { - out.println(CorbaResourceUtil.getText("servertool.baddef", ex.reason)); - } catch (Exception ex) { - ex.printStackTrace(); - } - - return commandDone; - } -} - -class UnRegisterServer implements CommandHandler -{ - public String getCommandName() {return "unregister";} - - public void printCommandHelp(PrintStream out, boolean helpType) - { - if (helpType == longHelp) { - out.println(CorbaResourceUtil.getText("servertool.unregister")); - } else { - out.println(CorbaResourceUtil.getText("servertool.unregister1")); - } -} - - final static int illegalServerId = -1; - - public boolean processCommand(String[] cmdArgs, ORB orb, PrintStream out) - { - int serverId = illegalServerId; - - try { - if (cmdArgs.length == 2) { - if (cmdArgs[0].equals("-serverid")) - serverId = (Integer.valueOf(cmdArgs[1])).intValue(); - else if (cmdArgs[0].equals("-applicationName")) - serverId = ServerTool.getServerIdForAlias( orb, cmdArgs[1] ) ; - } - - // the server id has to be specified - if (serverId == illegalServerId) - return parseError; - - // deactivate server, hold it down and and unregister it - // deactivate the server - try { - Activator activator = ActivatorHelper.narrow( - orb.resolve_initial_references( ORBConstants.SERVER_ACTIVATOR_NAME )); - activator.uninstall(serverId); - } catch (ServerHeldDown ex) {} - - // unregister the server from the repository - Repository repository = RepositoryHelper.narrow( - orb.resolve_initial_references( ORBConstants.SERVER_REPOSITORY_NAME )); - repository.unregisterServer(serverId); - - // print success message - out.println(CorbaResourceUtil.getText("servertool.unregister2")); - } catch (ServerNotRegistered ex) { - out.println(CorbaResourceUtil.getText("servertool.nosuchserver")); - } catch (Exception ex) { - ex.printStackTrace(); - } - - return commandDone; - } -} - -class LocateServer implements CommandHandler -{ - public String getCommandName() {return "locate";} - - public void printCommandHelp(PrintStream out, boolean helpType) - { - if (helpType == longHelp) { - out.println(CorbaResourceUtil.getText("servertool.locate")); - } else { - out.println(CorbaResourceUtil.getText("servertool.locate1")); - } - } - - final static int illegalServerId = -1; - - public boolean processCommand(String[] cmdArgs, ORB orb, PrintStream out) - { - int serverId = illegalServerId; - - String endPointType = IIOP_CLEAR_TEXT.value; - try { - - // parse command - String arg; - int i = 0; - while (i < cmdArgs.length) { - - arg = cmdArgs[i++]; - - if (arg.equals("-serverid")) { - if (i < cmdArgs.length) - serverId = (Integer.valueOf(cmdArgs[i++])).intValue(); - else - return parseError; - } else if (arg.equals("-applicationName")) { - if (i < cmdArgs.length) - serverId = ServerTool.getServerIdForAlias( orb, cmdArgs[i++] ) ; - else - return parseError; - } else if (arg.equals("-endpointType")) { - if (i < cmdArgs.length) - endPointType = cmdArgs[i++]; - } - } - - // the server id has to be specified - if (serverId == illegalServerId) - return parseError; - - // locate the server - // deactivate the server - Locator locator = LocatorHelper.narrow( - orb.resolve_initial_references( ORBConstants.SERVER_LOCATOR_NAME )); - - ServerLocation location = locator.locateServer(serverId, endPointType); - - // print success message - out.println(CorbaResourceUtil.getText("servertool.locate2", location.hostname)); - int numEntries = location.ports.length; - for (i = 0; i < numEntries; i++) { - ORBPortInfo orbPort = location.ports[i]; - out.println("\t\t"+ orbPort.port + "\t\t" + endPointType + "\t\t" + orbPort.orbId ); - } - } catch (NoSuchEndPoint ex) { - } catch (ServerHeldDown ex) { - out.println(CorbaResourceUtil.getText("servertool.helddown")); - } catch (ServerNotRegistered ex) { - out.println(CorbaResourceUtil.getText("servertool.nosuchserver")); - } catch (Exception ex) { - ex.printStackTrace(); - } - - return commandDone; - } -} - -class LocateServerForORB implements CommandHandler -{ - public String getCommandName() {return "locateperorb";} - - public void printCommandHelp(PrintStream out, boolean helpType) - { - if (helpType == longHelp) { - out.println(CorbaResourceUtil.getText("servertool.locateorb")); - } else { - out.println(CorbaResourceUtil.getText("servertool.locateorb1")); - } - } - - final static int illegalServerId = -1; - - public boolean processCommand(String[] cmdArgs, ORB orb, PrintStream out) - { - int serverId = illegalServerId; - - String orbId = ""; - try { - - // parse command - String arg; - int i = 0; - while (i < cmdArgs.length) { - - arg = cmdArgs[i++]; - - if (arg.equals("-serverid")) { - if (i < cmdArgs.length) - serverId = (Integer.valueOf(cmdArgs[i++])).intValue(); - else - return parseError; - } else if (arg.equals("-applicationName")) { - if (i < cmdArgs.length) - serverId = ServerTool.getServerIdForAlias( orb, cmdArgs[i++] ) ; - else - return parseError; - } else if (arg.equals("-orbid")) { - if (i < cmdArgs.length) - orbId = cmdArgs[i++]; - } - } - - // the server id has to be specified - if (serverId == illegalServerId) - return parseError; - - // locate the server - // deactivate the server - Locator locator = LocatorHelper.narrow( - orb.resolve_initial_references( ORBConstants.SERVER_LOCATOR_NAME )); - - ServerLocationPerORB location = locator.locateServerForORB(serverId, - orbId); - - // print success message - out.println(CorbaResourceUtil.getText("servertool.locateorb2", location.hostname)); - int numEntries = location.ports.length; - for (i = 0; i < numEntries; i++) { - EndPointInfo Port = location.ports[i]; - out.println("\t\t"+ Port.port + "\t\t" + Port.endpointType + "\t\t" + orbId ); - } - } catch (InvalidORBid ex) { - out.println(CorbaResourceUtil.getText("servertool.nosuchorb")); - } catch (ServerHeldDown ex) { - out.println(CorbaResourceUtil.getText("servertool.helddown")); - } catch (ServerNotRegistered ex) { - out.println(CorbaResourceUtil.getText("servertool.nosuchserver")); - } catch (Exception ex) { - ex.printStackTrace(); - } - - return commandDone; - } -} - -class GetServerID implements CommandHandler -{ - public String getCommandName() {return "getserverid" ; } - - public void printCommandHelp( PrintStream out, boolean helpType ) - { - if (helpType == longHelp) { - out.println(CorbaResourceUtil.getText("servertool.getserverid")); - } else { - out.println(CorbaResourceUtil.getText("servertool.getserverid1")); - } - } - - public boolean processCommand( String[] cmdArgs, ORB orb, PrintStream out ) - { - if ((cmdArgs.length == 2) && cmdArgs[0].equals( "-applicationName" )) { - String str = (String)cmdArgs[1] ; - - try { - Repository repository = RepositoryHelper.narrow( - orb.resolve_initial_references( ORBConstants.SERVER_REPOSITORY_NAME )); - - try { - int result = repository.getServerID( str ) ; - out.println() ; - out.println(CorbaResourceUtil.getText("servertool.getserverid2", str, Integer.toString(result))); - out.println() ; - } catch (ServerNotRegistered e) { - out.println(CorbaResourceUtil.getText("servertool.nosuchserver")); - } - } catch (Exception ex) { - ex.printStackTrace() ; - } - - return commandDone ; - } else - return parseError ; - } -} - -class ListServers implements CommandHandler -{ - public String getCommandName() {return "list";} - - public void printCommandHelp(PrintStream out, boolean helpType) - { - if (helpType == longHelp) { - out.println(CorbaResourceUtil.getText("servertool.list")); - } else { - out.println(CorbaResourceUtil.getText("servertool.list1")); - } - } - - final static int illegalServerId = -1; - - public boolean processCommand(String[] cmdArgs, ORB orb, PrintStream out) - { - int serverId = illegalServerId; - boolean listOneServer = false; - ServerDef serverDef; - - // determine if list single server or all servers - listOneServer = (cmdArgs.length!=0) ; - if ((cmdArgs.length == 2) && cmdArgs[0].equals("-serverid")) - serverId = (Integer.valueOf(cmdArgs[1])).intValue(); - - if ((serverId == illegalServerId) && listOneServer) - return parseError; - - // process the list server command - try { - Repository repository = RepositoryHelper.narrow( - orb.resolve_initial_references( ORBConstants.SERVER_REPOSITORY_NAME )); - - if (listOneServer) { - - try { - serverDef = repository.getServer(serverId); - out.println(); - printServerDef(serverDef, serverId, out); - out.println(); - } catch (ServerNotRegistered e) { - out.println(CorbaResourceUtil.getText("servertool.nosuchserver")); - } - - } else { - int[] servers = repository.listRegisteredServers(); - out.println(CorbaResourceUtil.getText("servertool.list2")); - - sortServers(servers); - for (int i=0; i < servers.length; i++) { - try { - serverDef = repository.getServer(servers[i]); - out.println("\t " + servers[i] + "\t\t" + - serverDef.serverName + "\t\t" - + serverDef.applicationName); - } catch (ServerNotRegistered e) {} - } - - } - } catch (Exception ex) { - ex.printStackTrace(); - } - - return commandDone; - } - -static void printServerDef(ServerDef serverDef, int serverId, - PrintStream out) -{ - out.println(CorbaResourceUtil.getText("servertool.appname", serverDef.applicationName)); - out.println(CorbaResourceUtil.getText("servertool.name", serverDef.serverName)); - out.println(CorbaResourceUtil.getText("servertool.classpath", serverDef.serverClassPath)); - out.println(CorbaResourceUtil.getText("servertool.args", serverDef.serverArgs)); - out.println(CorbaResourceUtil.getText("servertool.vmargs", serverDef.serverVmArgs)); - out.println(CorbaResourceUtil.getText("servertool.serverid", serverId)); -} - -/** - * Do a simple bubble sort to sort the server ids in ascending - * order. - */ -static void sortServers(int[] serverIds) -{ - int size = serverIds.length; - int lowest; - - for (int i=0; i < size; i++) { - - lowest = i; - - for (int j=i+1; j < size; j++) { - if (serverIds[j] < serverIds[lowest]) lowest = j; - } - - if (lowest != i) { - int temp = serverIds[i]; - serverIds[i] = serverIds[lowest]; - serverIds[lowest] = temp; - } - } -} -} - -class ListActiveServers implements CommandHandler -{ - public String getCommandName() {return "listactive";} - - public void printCommandHelp(PrintStream out, boolean helpType) - { - if (helpType == longHelp) { - out.println(CorbaResourceUtil.getText("servertool.listactive")); - } else { - out.println(CorbaResourceUtil.getText("servertool.listactive1")); - } - } - - public boolean processCommand(String[] cmdArgs, ORB orb, PrintStream out) - { - ServerDef serverDef; - - // process the list active servers command - try { - Repository repository = RepositoryHelper.narrow( - orb.resolve_initial_references( ORBConstants.SERVER_REPOSITORY_NAME )); - - Activator activator = ActivatorHelper.narrow( - orb.resolve_initial_references( ORBConstants.SERVER_ACTIVATOR_NAME )); - - int[] servers = activator.getActiveServers(); - - out.println(CorbaResourceUtil.getText("servertool.list2")); - - ListServers.sortServers(servers); - for (int i=0; i < servers.length; i++) { - try { - serverDef = repository.getServer(servers[i]); - out.println("\t " + servers[i] + "\t\t" + - serverDef.serverName + "\t\t" + - serverDef.applicationName); - } catch (ServerNotRegistered e) {} - } - } catch (Exception ex) { - ex.printStackTrace(); - } - - return commandDone; - } -} - -class ListAliases implements CommandHandler -{ - public String getCommandName() {return "listappnames";} - - public void printCommandHelp(PrintStream out, boolean helpType) - { - if (helpType == longHelp) { - out.println(CorbaResourceUtil.getText("servertool.listappnames")); - } else { - out.println(CorbaResourceUtil.getText("servertool.listappnames1")); - } - } - - public boolean processCommand(String[] cmdArgs, ORB orb, PrintStream out) - { - try { - Repository repository = RepositoryHelper.narrow( - orb.resolve_initial_references( ORBConstants.SERVER_REPOSITORY_NAME )); - - String[] applicationNames = repository.getApplicationNames(); - - out.println(CorbaResourceUtil.getText("servertool.listappnames2")); - out.println(); - for (int i=0; i < applicationNames.length; i++) - out.println( "\t" + applicationNames[i] ) ; - } catch (Exception ex) { - ex.printStackTrace(); - } - - return commandDone; - } -} - -class ShutdownServer implements CommandHandler -{ - public String getCommandName() {return "shutdown";} - - public void printCommandHelp(PrintStream out, boolean helpType) - { - if (helpType == longHelp) { - out.println(CorbaResourceUtil.getText("servertool.shutdown")); - } else { - out.println(CorbaResourceUtil.getText("servertool.shutdown1")); - } - } - - final static int illegalServerId = -1; - - public boolean processCommand(String[] cmdArgs, ORB orb, PrintStream out) - { - int serverId = illegalServerId; - - try { - // determine the server id - if (cmdArgs.length == 2) - if (cmdArgs[0].equals("-serverid")) - serverId = (Integer.valueOf(cmdArgs[1])).intValue(); - else if (cmdArgs[0].equals("-applicationName")) - serverId = ServerTool.getServerIdForAlias( orb, cmdArgs[1] ) ; - - if (serverId == illegalServerId) - return parseError; - - // shutdown the server - Activator activator = ActivatorHelper.narrow( - orb.resolve_initial_references( ORBConstants.SERVER_ACTIVATOR_NAME )); - activator.shutdown(serverId); - - out.println(CorbaResourceUtil.getText("servertool.shutdown2")); - } catch (ServerNotActive ex) { - out.println(CorbaResourceUtil.getText("servertool.servernotrunning")); - } catch (ServerNotRegistered ex) { - out.println(CorbaResourceUtil.getText("servertool.nosuchserver")); - } catch (Exception ex) { - ex.printStackTrace(); - } - - return commandDone; - } -} - -class StartServer implements CommandHandler -{ - public String getCommandName() {return "startup";} - - public void printCommandHelp(PrintStream out, boolean helpType) - { - if (helpType == longHelp) { - out.println(CorbaResourceUtil.getText("servertool.startserver")); - } else { - out.println(CorbaResourceUtil.getText("servertool.startserver1")); - } - } - - final static int illegalServerId = -1; - - public boolean processCommand(String[] cmdArgs, ORB orb, PrintStream out) - { - int serverId = illegalServerId; - - try { - // determine the server id - if (cmdArgs.length == 2) - if (cmdArgs[0].equals("-serverid")) - serverId = (Integer.valueOf(cmdArgs[1])).intValue(); - else if (cmdArgs[0].equals("-applicationName")) - serverId = ServerTool.getServerIdForAlias( orb, cmdArgs[1] ) ; - - if (serverId == illegalServerId) - return parseError; - - // startup the server - Activator activator = ActivatorHelper.narrow( - orb.resolve_initial_references( ORBConstants.SERVER_ACTIVATOR_NAME )); - activator.activate(serverId); - - out.println(CorbaResourceUtil.getText("servertool.startserver2")); - } catch (ServerNotRegistered ex) { - out.println(CorbaResourceUtil.getText("servertool.nosuchserver")); - } catch (ServerAlreadyActive ex) { - out.println(CorbaResourceUtil.getText("servertool.serverup")); - } catch (ServerHeldDown ex) { - out.println(CorbaResourceUtil.getText("servertool.helddown")); - } catch (Exception ex) { - ex.printStackTrace(); - } - return commandDone; - } -} - -class Quit implements CommandHandler -{ - public String getCommandName() {return "quit";} - - public void printCommandHelp(PrintStream out, boolean helpType) - { - if (helpType == longHelp) { - out.println(CorbaResourceUtil.getText("servertool.quit")); - } else { - out.println(CorbaResourceUtil.getText("servertool.quit1")); - } - } - - public boolean processCommand(String[] cmdArgs, ORB orb, PrintStream out) - { - System.exit(0); - - return commandDone; - } -} - -class Help implements CommandHandler -{ - public String getCommandName() {return "help";} - - public void printCommandHelp(PrintStream out, boolean helpType) - { - if (helpType == longHelp) { - out.println(CorbaResourceUtil.getText("servertool.help")); - } else { - out.println(CorbaResourceUtil.getText("servertool.help1")); - } - } - - public boolean processCommand(String[] cmdArgs, ORB orb, PrintStream out) - { - return commandDone; - } -} - -class ListORBs implements CommandHandler -{ - public String getCommandName() {return "orblist";} - - public void printCommandHelp(PrintStream out, boolean helpType) - { - if (helpType == longHelp) { - out.println(CorbaResourceUtil.getText("servertool.orbidmap")); - } else { - out.println(CorbaResourceUtil.getText("servertool.orbidmap1")); - } - } - - final static int illegalServerId = -1; - - public boolean processCommand(String[] cmdArgs, ORB orb, PrintStream out) - { - - int serverId = illegalServerId; - - try { - if (cmdArgs.length == 2) { - if (cmdArgs[0].equals("-serverid")) - serverId = (Integer.valueOf(cmdArgs[1])).intValue(); - else if (cmdArgs[0].equals("-applicationName")) - serverId = ServerTool.getServerIdForAlias( orb, cmdArgs[1] ) ; - } - - // the server id has to be specified - if (serverId == illegalServerId) - return parseError; - // activate the server - Activator activator = ActivatorHelper.narrow( - orb.resolve_initial_references( ORBConstants.SERVER_ACTIVATOR_NAME )); - - String[] orbList = activator.getORBNames(serverId); - - out.println(CorbaResourceUtil.getText("servertool.orbidmap2")); - - for (int i = 0; i < orbList.length ; i++) { - out.println("\t "+ orbList[i]); - } - } catch (ServerNotRegistered ex) { - out.println("\tno such server found."); - } catch (Exception ex) { - ex.printStackTrace(); - } - - return commandDone; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/copyobject/CopierManagerImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/copyobject/CopierManagerImpl.java deleted file mode 100644 index d55e13dcd0f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/copyobject/CopierManagerImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.copyobject ; - -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.impl.orbutil.DenseIntMapImpl ; - -import com.sun.corba.se.spi.copyobject.ObjectCopierFactory ; -import com.sun.corba.se.spi.copyobject.CopierManager ; -import com.sun.corba.se.spi.copyobject.ObjectCopierFactory ; - -public class CopierManagerImpl implements CopierManager -{ - private int defaultId ; - private DenseIntMapImpl map ; - private ORB orb ; - - public CopierManagerImpl( ORB orb ) - { - defaultId = 0 ; - map = new DenseIntMapImpl() ; - this.orb = orb ; - } - - public void setDefaultId( int id ) - { - defaultId = id ; - } - - public int getDefaultId() - { - return defaultId ; - } - - public ObjectCopierFactory getObjectCopierFactory( int id ) - { - return (ObjectCopierFactory)(map.get( id )) ; - } - - public ObjectCopierFactory getDefaultObjectCopierFactory() - { - return (ObjectCopierFactory)(map.get( defaultId )) ; - } - - public void registerObjectCopierFactory( ObjectCopierFactory factory, int id ) - { - map.set( id, factory ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/copyobject/FallbackObjectCopierImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/copyobject/FallbackObjectCopierImpl.java deleted file mode 100644 index 0a5c30f785c..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/copyobject/FallbackObjectCopierImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.copyobject ; - -import com.sun.corba.se.spi.copyobject.ObjectCopier ; -import com.sun.corba.se.spi.copyobject.ReflectiveCopyException ; - -/** Trys a first ObjectCopier. If the first throws a ReflectiveCopyException, - * falls back and tries a second ObjectCopier. - */ -public class FallbackObjectCopierImpl implements ObjectCopier -{ - private ObjectCopier first ; - private ObjectCopier second ; - - public FallbackObjectCopierImpl( ObjectCopier first, - ObjectCopier second ) - { - this.first = first ; - this.second = second ; - } - - public Object copy( Object src ) throws ReflectiveCopyException - { - try { - return first.copy( src ) ; - } catch (ReflectiveCopyException rce ) { - // XXX log this fallback at a low level - return second.copy( src ) ; - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/copyobject/JavaStreamObjectCopierImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/copyobject/JavaStreamObjectCopierImpl.java deleted file mode 100644 index 6b4118f362e..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/copyobject/JavaStreamObjectCopierImpl.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.copyobject ; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import java.io.Serializable; -import java.rmi.Remote; -import java.rmi.MarshalException; - -import java.io.InputStream ; -import java.io.OutputStream ; -import java.io.ByteArrayInputStream ; -import java.io.ByteArrayOutputStream ; -import java.io.ObjectInputStream ; -import java.io.ObjectOutputStream ; - -import org.omg.CORBA.ORB ; - -import com.sun.corba.se.spi.copyobject.ObjectCopier ; -import com.sun.corba.se.impl.util.Utility; - -public class JavaStreamObjectCopierImpl implements ObjectCopier { - - public JavaStreamObjectCopierImpl( ORB orb ) - { - this.orb = orb ; - } - - public Object copy(Object obj) { - if (obj instanceof Remote) { - // Yes, so make sure it is connected and converted - // to a stub (if needed)... - return Utility.autoConnect(obj,orb,true); - } - - try { - ByteArrayOutputStream os = new ByteArrayOutputStream( 10000 ) ; - ObjectOutputStream oos = new ObjectOutputStream( os ) ; - oos.writeObject( obj ) ; - - byte[] arr = os.toByteArray() ; - InputStream is = new ByteArrayInputStream( arr ) ; - ObjectInputStream ois = new ObjectInputStream( is ) ; - - return ois.readObject(); - } catch (Exception exc) { - System.out.println( "Failed with exception:" + exc ) ; - return null ; - } - } - - private ORB orb; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/copyobject/ORBStreamObjectCopierImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/copyobject/ORBStreamObjectCopierImpl.java deleted file mode 100644 index d1526ba1da5..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/copyobject/ORBStreamObjectCopierImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.copyobject ; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import java.io.Serializable; -import java.rmi.Remote; -import java.rmi.MarshalException; - -import org.omg.CORBA_2_3.portable.InputStream; -import org.omg.CORBA_2_3.portable.OutputStream; -import org.omg.CORBA.ORB ; - -import com.sun.corba.se.spi.copyobject.ObjectCopier ; -import com.sun.corba.se.impl.util.Utility; - -public class ORBStreamObjectCopierImpl implements ObjectCopier { - - public ORBStreamObjectCopierImpl( ORB orb ) - { - this.orb = orb ; - } - - public Object copy(Object obj) { - if (obj instanceof Remote) { - // Yes, so make sure it is connected and converted - // to a stub (if needed)... - return Utility.autoConnect(obj,orb,true); - } - - OutputStream out = (OutputStream)orb.create_output_stream(); - out.write_value((Serializable)obj); - InputStream in = (InputStream)out.create_input_stream(); - return in.read_value(); - } - - private ORB orb; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/copyobject/ReferenceObjectCopierImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/copyobject/ReferenceObjectCopierImpl.java deleted file mode 100644 index a1e5c8336ed..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/copyobject/ReferenceObjectCopierImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.copyobject ; - -import com.sun.corba.se.spi.copyobject.ObjectCopier ; - -public class ReferenceObjectCopierImpl implements ObjectCopier -{ - public Object copy( Object obj ) - { - return obj ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java deleted file mode 100644 index f4af63423c0..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java +++ /dev/null @@ -1,1351 +0,0 @@ -/* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.corba; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.List ; -import java.util.ArrayList ; - -import org.omg.CORBA.Principal ; -import org.omg.CORBA.TypeCode ; -import org.omg.CORBA.Any ; -import org.omg.CORBA.CompletionStatus ; -import org.omg.CORBA.TCKind ; - -import org.omg.CORBA.portable.Streamable; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; -import org.omg.CORBA.TypeCodePackage.BadKind; -import org.omg.CORBA.TypeCodePackage.Bounds; - -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.orb.ORBVersionFactory; -import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.spi.presentation.rmi.StubAdapter; - -import com.sun.corba.se.impl.encoding.CDRInputStream; -import com.sun.corba.se.impl.encoding.EncapsInputStream; -import com.sun.corba.se.impl.encoding.EncapsOutputStream; -import com.sun.corba.se.impl.io.ValueUtility; -import com.sun.corba.se.impl.orbutil.RepositoryIdFactory; -import com.sun.corba.se.impl.orbutil.RepositoryIdStrings; -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.logging.ORBUtilSystemException; - -// subclasses must provide a matching helper class -public class AnyImpl extends Any -{ - private static final class AnyInputStream extends EncapsInputStream - { - public AnyInputStream(EncapsInputStream theStream ) - { - super( theStream ); - } - } - - private static final class AnyOutputStream extends EncapsOutputStream - { - public AnyOutputStream(ORB orb) - { - super((ORB)orb); - } - - public org.omg.CORBA.portable.InputStream create_input_stream() { - final org.omg.CORBA.portable.InputStream is = super - .create_input_stream(); - AnyInputStream aIS = AccessController - .doPrivileged(new PrivilegedAction() { - @Override - public AnyInputStream run() { - return new AnyInputStream( - (com.sun.corba.se.impl.encoding.EncapsInputStream) is); - } - }); - return aIS; - } - } - - // - // Always valid. - // - private TypeCodeImpl typeCode; - protected ORB orb; - private ORBUtilSystemException wrapper ; - - // - // Validity depends upon typecode. The 'value' and 'object' instance - // members are used to hold immutable types as defined by the - // isStreamed[] table below. Otherwise, 'stream' is non-null and - // holds the value in CDR marshaled format. As an optimization, the - // stream type is an Any extension of CDR stream that is used to - // detect an optimization in read_value(). - // - private CDRInputStream stream; - private long value; - private java.lang.Object object; - - // Setting the typecode via the type() accessor wipes out the value. - // An attempt to extract before the value is set will result - // in a BAD_OPERATION exception being raised. - private boolean isInitialized = false; - - private static final int DEFAULT_BUFFER_SIZE = 32; - - /* - * This boolean array tells us if a given typecode must be - * streamed. Objects that are immutable don't have to be streamed. - */ - static boolean isStreamed[] = { - false, // null - false, // void - false, // short - false, // long - false, // ushort - false, // ulong - false, // float - false, // double - false, // boolean - false, // char - false, // octet - false, // any - false, // TypeCode - true, // Principal - false, // objref - true, // struct - true, // union - false, // enum - false, // string - true, // sequence - true, // array - true, // alias - true, // except - false, // longlong - false, // ulonglong - false, // longdouble - false, // wchar - false, // wstring - false, // fixed - false, // value - false, // value_box (used to be true) - false, // native - false // abstract interface - }; - - static AnyImpl convertToNative(ORB orb, Any any) { - if (any instanceof AnyImpl) { - return (AnyImpl)any; - } else { - AnyImpl anyImpl = new AnyImpl(orb, any); - anyImpl.typeCode = TypeCodeImpl.convertToNative(orb, anyImpl.typeCode); - return anyImpl; - } - } - - /////////////////////////////////////////////////////////////////////////// - // Constructors - - /** - * A constructor that sets the Any to contain a null. It also marks - * the value as being invalid so that extractions throw an exception - * until an insertion has been performed. - */ - public AnyImpl(ORB orb) - { - this.orb = orb; - wrapper = ORBUtilSystemException.get( (com.sun.corba.se.spi.orb.ORB)orb, - CORBALogDomains.RPC_PRESENTATION ) ; - - typeCode = orb.get_primitive_tc(TCKind._tk_null); - stream = null; - object = null; - value = 0; - // null is a valid value - isInitialized = true; - } - - // - // Create a new AnyImpl which is a copy of obj. - // - public AnyImpl(ORB orb, Any obj) { - this(orb); - - if ((obj instanceof AnyImpl)) { - AnyImpl objImpl = (AnyImpl)obj; - typeCode = objImpl.typeCode; - value = objImpl.value; - object = objImpl.object; - isInitialized = objImpl.isInitialized; - - if (objImpl.stream != null) - stream = objImpl.stream.dup(); - - } else { - read_value(obj.create_input_stream(), obj.type()); - } - } - - /////////////////////////////////////////////////////////////////////////// - // basic accessors - - /** - * returns the type of the element contained in the Any. - * - * @return the TypeCode for the element in the Any - */ - public TypeCode type() { - return typeCode; - } - - private TypeCode realType() { - return realType(typeCode); - } - - private TypeCode realType(TypeCode aType) { - TypeCode realType = aType; - try { - // Note: Indirect types are handled in kind() method - while (realType.kind().value() == TCKind._tk_alias) { - realType = realType.content_type(); - } - } catch (BadKind bad) { // impossible - throw wrapper.badkindCannotOccur( bad ) ; - } - return realType; - } - - /** - * sets the type of the element to be contained in the Any. - * - * @param tc the TypeCode for the element in the Any - */ - public void type(TypeCode tc) - { - //debug.log ("type2"); - // set the typecode - typeCode = TypeCodeImpl.convertToNative(orb, tc); - - stream = null; - value = 0; - object = null; - // null is the only legal value this Any can have after resetting the type code - isInitialized = (tc.kind().value() == TCKind._tk_null); - } - - /** - * checks for equality between Anys. - * - * @param otherAny the Any to be compared with. - * @return true if the Anys are equal, false otherwise. - */ - public boolean equal(Any otherAny) - { - //debug.log ("equal"); - - if (otherAny == this) - return true; - - // first check for typecode equality. - // note that this will take aliases into account - if (!typeCode.equal(otherAny.type())) - return false; - - // Resolve aliases here - TypeCode realType = realType(); - - // _REVISIT_ Possible optimization for the case where - // otherAny is a AnyImpl and the endianesses match. - // Need implementation of CDRInputStream.equals() - // For now we disable this to encourage testing the generic, - // unoptimized code below. - // Unfortunately this generic code needs to copy the whole stream - // at least once. - // if (AnyImpl.isStreamed[realType.kind().value()]) { - // if (otherAny instanceof AnyImpl) { - // return ((AnyImpl)otherAny).stream.equals(stream); - // } - // } - switch (realType.kind().value()) { - // handle primitive types - case TCKind._tk_null: - case TCKind._tk_void: - return true; - case TCKind._tk_short: - return (extract_short() == otherAny.extract_short()); - case TCKind._tk_long: - return (extract_long() == otherAny.extract_long()); - case TCKind._tk_ushort: - return (extract_ushort() == otherAny.extract_ushort()); - case TCKind._tk_ulong: - return (extract_ulong() == otherAny.extract_ulong()); - case TCKind._tk_float: - return (extract_float() == otherAny.extract_float()); - case TCKind._tk_double: - return (extract_double() == otherAny.extract_double()); - case TCKind._tk_boolean: - return (extract_boolean() == otherAny.extract_boolean()); - case TCKind._tk_char: - return (extract_char() == otherAny.extract_char()); - case TCKind._tk_wchar: - return (extract_wchar() == otherAny.extract_wchar()); - case TCKind._tk_octet: - return (extract_octet() == otherAny.extract_octet()); - case TCKind._tk_any: - return extract_any().equal(otherAny.extract_any()); - case TCKind._tk_TypeCode: - return extract_TypeCode().equal(otherAny.extract_TypeCode()); - case TCKind._tk_string: - return extract_string().equals(otherAny.extract_string()); - case TCKind._tk_wstring: - return (extract_wstring().equals(otherAny.extract_wstring())); - case TCKind._tk_longlong: - return (extract_longlong() == otherAny.extract_longlong()); - case TCKind._tk_ulonglong: - return (extract_ulonglong() == otherAny.extract_ulonglong()); - - case TCKind._tk_objref: - return (extract_Object().equals(otherAny.extract_Object())); - case TCKind._tk_Principal: - return (extract_Principal().equals(otherAny.extract_Principal())); - - case TCKind._tk_enum: - return (extract_long() == otherAny.extract_long()); - case TCKind._tk_fixed: - return (extract_fixed().compareTo(otherAny.extract_fixed()) == 0); - case TCKind._tk_except: - case TCKind._tk_struct: - case TCKind._tk_union: - case TCKind._tk_sequence: - case TCKind._tk_array: - InputStream copyOfMyStream = this.create_input_stream(); - InputStream copyOfOtherStream = otherAny.create_input_stream(); - return equalMember(realType, copyOfMyStream, copyOfOtherStream); - - // Too complicated to handle value types the way we handle - // other complex types above. Don't try to decompose it here - // for faster comparison, just use Object.equals(). - case TCKind._tk_value: - case TCKind._tk_value_box: - return extract_Value().equals(otherAny.extract_Value()); - - case TCKind._tk_alias: - throw wrapper.errorResolvingAlias() ; - - case TCKind._tk_longdouble: - // Unspecified for Java - throw wrapper.tkLongDoubleNotSupported() ; - - default: - throw wrapper.typecodeNotSupported() ; - } - } - - // Needed for equal() in order to achieve linear performance for complex types. - // Uses up (recursively) copies of the InputStream in both Anys that got created in equal(). - private boolean equalMember(TypeCode memberType, InputStream myStream, InputStream otherStream) { - // Resolve aliases here - TypeCode realType = realType(memberType); - - try { - switch (realType.kind().value()) { - // handle primitive types - case TCKind._tk_null: - case TCKind._tk_void: - return true; - case TCKind._tk_short: - return (myStream.read_short() == otherStream.read_short()); - case TCKind._tk_long: - return (myStream.read_long() == otherStream.read_long()); - case TCKind._tk_ushort: - return (myStream.read_ushort() == otherStream.read_ushort()); - case TCKind._tk_ulong: - return (myStream.read_ulong() == otherStream.read_ulong()); - case TCKind._tk_float: - return (myStream.read_float() == otherStream.read_float()); - case TCKind._tk_double: - return (myStream.read_double() == otherStream.read_double()); - case TCKind._tk_boolean: - return (myStream.read_boolean() == otherStream.read_boolean()); - case TCKind._tk_char: - return (myStream.read_char() == otherStream.read_char()); - case TCKind._tk_wchar: - return (myStream.read_wchar() == otherStream.read_wchar()); - case TCKind._tk_octet: - return (myStream.read_octet() == otherStream.read_octet()); - case TCKind._tk_any: - return myStream.read_any().equal(otherStream.read_any()); - case TCKind._tk_TypeCode: - return myStream.read_TypeCode().equal(otherStream.read_TypeCode()); - case TCKind._tk_string: - return myStream.read_string().equals(otherStream.read_string()); - case TCKind._tk_wstring: - return (myStream.read_wstring().equals(otherStream.read_wstring())); - case TCKind._tk_longlong: - return (myStream.read_longlong() == otherStream.read_longlong()); - case TCKind._tk_ulonglong: - return (myStream.read_ulonglong() == otherStream.read_ulonglong()); - - case TCKind._tk_objref: - return (myStream.read_Object().equals(otherStream.read_Object())); - case TCKind._tk_Principal: - return (myStream.read_Principal().equals(otherStream.read_Principal())); - - case TCKind._tk_enum: - return (myStream.read_long() == otherStream.read_long()); - case TCKind._tk_fixed: - return (myStream.read_fixed().compareTo(otherStream.read_fixed()) == 0); - case TCKind._tk_except: - case TCKind._tk_struct: { - int length = realType.member_count(); - for (int i=0; i() { - @Override - public AnyOutputStream run() { - return new AnyOutputStream(finalorb); - } - }); - } - - /** - * returns an input stream that an Any value can be marshaled out of. - * - * @return the InputStream to marshal value of Any out of. - */ - public org.omg.CORBA.portable.InputStream create_input_stream() - { - // - // We create a new InputStream so that multiple threads can call here - // and read the streams in parallel without thread safety problems. - // - //debug.log ("create_input_stream"); - if (AnyImpl.isStreamed[realType().kind().value()]) { - return stream.dup(); - } else { - OutputStream os = (OutputStream)orb.create_output_stream(); - TCUtility.marshalIn(os, realType(), value, object); - - return os.create_input_stream(); - } - } - - /////////////////////////////////////////////////////////////////////////// - // marshaling/unmarshaling routines - - // - // If the InputStream is a CDRInputStream then we can copy the bytes - // since it is in our format and does not have alignment issues. - // - public void read_value(org.omg.CORBA.portable.InputStream in, TypeCode tc) - { - //debug.log ("read_value"); - // - // Assume that someone isn't going to think they can keep reading - // from this stream after calling us. That would be likely for - // an IIOPInputStream but if it is an AnyInputStream then they - // presumably obtained it via our create_output_stream() so they could - // write the contents of an IDL data type to it and then call - // create_input_stream() for us to read it. This is how Helper classes - // typically implement the insert() method. - // We should probably document this behavior in the 1.1 revision - // task force. - // - - typeCode = TypeCodeImpl.convertToNative(orb, tc); - int kind = realType().kind().value(); - if (kind >= isStreamed.length) { - throw wrapper.invalidIsstreamedTckind( CompletionStatus.COMPLETED_MAYBE, - new Integer(kind)) ; - } - - if (AnyImpl.isStreamed[kind]) { - if ( in instanceof AnyInputStream ) { - // could only have been created here - stream = (CDRInputStream)in; - } else { - org.omg.CORBA_2_3.portable.OutputStream out = - (org.omg.CORBA_2_3.portable.OutputStream)orb.create_output_stream(); - typeCode.copy((org.omg.CORBA_2_3.portable.InputStream)in, out); - stream = (CDRInputStream)out.create_input_stream(); - } - } else { - java.lang.Object[] objholder = new java.lang.Object[1]; - objholder[0] = object; - long[] longholder = new long[1]; - TCUtility.unmarshalIn(in, realType(), longholder, objholder); - value = longholder[0]; - object = objholder[0]; - stream = null; - } - isInitialized = true; - } - - - // - // We could optimize this by noticing whether the target stream - // has ever had anything marshaled on it that required an - // alignment of greater than 4 (was write_double() ever called on it). - // If not, then we can just do a byte array copy without having to - // drive the remarshaling through typecode interpretation. - // - public void write_value(OutputStream out) - { - //debug.log ("write_value"); - if (AnyImpl.isStreamed[realType().kind().value()]) { - typeCode.copy(stream.dup(), out); - } else { - // _REVISIT_ check isInitialized whether all we write is TypeCode! - TCUtility.marshalIn(out, realType(), value, object); - } - } - - /** - * takes a streamable and inserts its reference into the any - * - * @param s the streamable to insert - */ - public void insert_Streamable(Streamable s) - { - //debug.log ("insert_Streamable"); - typeCode = TypeCodeImpl.convertToNative(orb, s._type()); - object = s; - isInitialized = true; - } - - public Streamable extract_Streamable() - { - //debug.log( "extract_Streamable" ) ; - return (Streamable)object; - } - - /////////////////////////////////////////////////////////////////////////// - // insertion/extraction/replacement for all basic types - - /** - * See the description of the general Any operations. - */ - public void insert_short(short s) - { - //debug.log ("insert_short"); - typeCode = orb.get_primitive_tc(TCKind._tk_short); - value = s; - isInitialized = true; - } - - private String getTCKindName( int tc ) - { - if ((tc >= 0) && (tc < TypeCodeImpl.kindNames.length)) - return TypeCodeImpl.kindNames[tc] ; - else - return "UNKNOWN(" + tc + ")" ; - } - - private void checkExtractBadOperation( int expected ) - { - if (!isInitialized) - throw wrapper.extractNotInitialized() ; - - int tc = realType().kind().value() ; - if (tc != expected) { - String tcName = getTCKindName( tc ) ; - String expectedName = getTCKindName( expected ) ; - throw wrapper.extractWrongType( expectedName, tcName ) ; - } - } - - private void checkExtractBadOperationList( int[] expected ) - { - if (!isInitialized) - throw wrapper.extractNotInitialized() ; - - int tc = realType().kind().value() ; - for (int ctr=0; ctrgeneral Any operations. - */ - public short extract_short() - { - //debug.log ("extract_short"); - checkExtractBadOperation( TCKind._tk_short ) ; - return (short)value; - } - - /** - * See the description of the general Any operations. - */ - public void insert_long(int l) - { - //debug.log ("insert_long"); - // A long value is applicable to enums as well, so don't erase the enum type code - // in case it was initialized that way before. - int kind = realType().kind().value(); - if (kind != TCKind._tk_long && kind != TCKind._tk_enum) { - typeCode = orb.get_primitive_tc(TCKind._tk_long); - } - value = l; - isInitialized = true; - } - - /** - * See the description of the general Any operations. - */ - public int extract_long() - { - //debug.log ("extract_long"); - checkExtractBadOperationList( new int[] { TCKind._tk_long, TCKind._tk_enum } ) ; - return (int)value; - } - - /** - * See the description of the general Any operations. - */ - public void insert_ushort(short s) - { - //debug.log ("insert_ushort"); - typeCode = orb.get_primitive_tc(TCKind._tk_ushort); - value = s; - isInitialized = true; - } - - /** - * See the description of the general Any operations. - */ - public short extract_ushort() - { - //debug.log ("extract_ushort"); - checkExtractBadOperation( TCKind._tk_ushort ) ; - return (short)value; - } - - /** - * See the description of the general Any operations. - */ - public void insert_ulong(int l) - { - //debug.log ("insert_ulong"); - typeCode = orb.get_primitive_tc(TCKind._tk_ulong); - value = l; - isInitialized = true; - } - - /** - * See the description of the general Any operations. - */ - public int extract_ulong() - { - //debug.log ("extract_ulong"); - checkExtractBadOperation( TCKind._tk_ulong ) ; - return (int)value; - } - - /** - * See the description of the general Any operations. - */ - public void insert_float(float f) - { - //debug.log ("insert_float"); - typeCode = orb.get_primitive_tc(TCKind._tk_float); - value = Float.floatToIntBits(f); - isInitialized = true; - } - - /** - * See the description of the general Any operations. - */ - public float extract_float() - { - //debug.log ("extract_float"); - checkExtractBadOperation( TCKind._tk_float ) ; - return Float.intBitsToFloat((int)value); - } - - /** - * See the description of the general Any operations. - */ - public void insert_double(double d) - { - //debug.log ("insert_double"); - typeCode = orb.get_primitive_tc(TCKind._tk_double); - value = Double.doubleToLongBits(d); - isInitialized = true; - } - - /** - * See the description of the general Any operations. - */ - public double extract_double() - { - //debug.log ("extract_double"); - checkExtractBadOperation( TCKind._tk_double ) ; - return Double.longBitsToDouble(value); - } - - /** - * See the description of the general Any operations. - */ - public void insert_longlong(long l) - { - //debug.log ("insert_longlong"); - typeCode = orb.get_primitive_tc(TCKind._tk_longlong); - value = l; - isInitialized = true; - } - - /** - * See the description of the general Any operations. - */ - public long extract_longlong() - { - //debug.log ("extract_longlong"); - checkExtractBadOperation( TCKind._tk_longlong ) ; - return value; - } - - /** - * See the description of the general Any operations. - */ - public void insert_ulonglong(long l) - { - //debug.log ("insert_ulonglong"); - typeCode = orb.get_primitive_tc(TCKind._tk_ulonglong); - value = l; - isInitialized = true; - } - - /** - * See the description of the general Any operations. - */ - public long extract_ulonglong() - { - //debug.log ("extract_ulonglong"); - checkExtractBadOperation( TCKind._tk_ulonglong ) ; - return value; - } - - /** - * See the description of the general Any operations. - */ - public void insert_boolean(boolean b) - { - //debug.log ("insert_boolean"); - typeCode = orb.get_primitive_tc(TCKind._tk_boolean); - value = (b)? 1:0; - isInitialized = true; - } - - /** - * See the description of the general Any operations. - */ - public boolean extract_boolean() - { - //debug.log ("extract_boolean"); - checkExtractBadOperation( TCKind._tk_boolean ) ; - return (value == 0)? false: true; - } - - /** - * See the description of the general Any operations. - */ - public void insert_char(char c) - { - //debug.log ("insert_char"); - typeCode = orb.get_primitive_tc(TCKind._tk_char); - value = c; - isInitialized = true; - } - - /** - * See the description of the general Any operations. - */ - public char extract_char() - { - //debug.log ("extract_char"); - checkExtractBadOperation( TCKind._tk_char ) ; - return (char)value; - } - - /** - * See the description of the general Any operations. - */ - public void insert_wchar(char c) - { - //debug.log ("insert_wchar"); - typeCode = orb.get_primitive_tc(TCKind._tk_wchar); - value = c; - isInitialized = true; - } - - /** - * See the description of the general Any operations. - */ - public char extract_wchar() - { - //debug.log ("extract_wchar"); - checkExtractBadOperation( TCKind._tk_wchar ) ; - return (char)value; - } - - - /** - * See the description of the general Any operations. - */ - public void insert_octet(byte b) - { - //debug.log ("insert_octet"); - typeCode = orb.get_primitive_tc(TCKind._tk_octet); - value = b; - isInitialized = true; - } - - /** - * See the description of the general Any operations. - */ - public byte extract_octet() - { - //debug.log ("extract_octet"); - checkExtractBadOperation( TCKind._tk_octet ) ; - return (byte)value; - } - - /** - * See the description of the general Any operations. - */ - public void insert_string(String s) - { - //debug.log ("insert_string"); - // Make sure type code information for bounded strings is not erased - if (typeCode.kind() == TCKind.tk_string) { - int length = 0; - try { - length = typeCode.length(); - } catch (BadKind bad) { - throw wrapper.badkindCannotOccur() ; - } - - // Check if bounded strings length is not exceeded - if (length != 0 && s != null && s.length() > length) { - throw wrapper.badStringBounds( new Integer(s.length()), - new Integer(length) ) ; - } - } else { - typeCode = orb.get_primitive_tc(TCKind._tk_string); - } - object = s; - isInitialized = true; - } - - /** - * See the description of the general Any operations. - */ - public String extract_string() - { - //debug.log ("extract_string"); - checkExtractBadOperation( TCKind._tk_string ) ; - return (String)object; - } - - /** - * See the description of the general Any operations. - */ - public void insert_wstring(String s) - { - //debug.log ("insert_wstring"); - // Make sure type code information for bounded strings is not erased - if (typeCode.kind() == TCKind.tk_wstring) { - int length = 0; - try { - length = typeCode.length(); - } catch (BadKind bad) { - throw wrapper.badkindCannotOccur() ; - } - - // Check if bounded strings length is not exceeded - if (length != 0 && s != null && s.length() > length) { - throw wrapper.badStringBounds( new Integer(s.length()), - new Integer(length) ) ; - } - } else { - typeCode = orb.get_primitive_tc(TCKind._tk_wstring); - } - object = s; - isInitialized = true; - } - - /** - * See the description of the general Any operations. - */ - public String extract_wstring() - { - //debug.log ("extract_wstring"); - checkExtractBadOperation( TCKind._tk_wstring ) ; - return (String)object; - } - - /** - * See the description of the general Any operations. - */ - public void insert_any(Any a) - { - //debug.log ("insert_any"); - typeCode = orb.get_primitive_tc(TCKind._tk_any); - object = a; - stream = null; - isInitialized = true; - } - - /** - * See the description of the general Any operations. - */ - public Any extract_any() - { - //debug.log ("extract_any"); - checkExtractBadOperation( TCKind._tk_any ) ; - return (Any)object; - } - - /** - * See the description of the general Any operations. - */ - public void insert_Object(org.omg.CORBA.Object o) - { - //debug.log ("insert_Object"); - if ( o == null ) { - typeCode = orb.get_primitive_tc(TCKind._tk_objref); - } else { - if (StubAdapter.isStub(o)) { - String[] ids = StubAdapter.getTypeIds( o ) ; - typeCode = new TypeCodeImpl(orb, TCKind._tk_objref, ids[0], ""); - } else { - throw wrapper.badInsertobjParam( - CompletionStatus.COMPLETED_MAYBE, o.getClass().getName() ) ; - } - } - - object = o; - isInitialized = true; - } - - /** - * A variant of the insertion operation that takes a typecode - * argument as well. - */ - public void insert_Object(org.omg.CORBA.Object o, TypeCode tc) - { - //debug.log ("insert_Object2"); - try { - if ( tc.id().equals("IDL:omg.org/CORBA/Object:1.0") || o._is_a(tc.id()) ) - { - typeCode = TypeCodeImpl.convertToNative(orb, tc); - object = o; - } - else { - throw wrapper.insertObjectIncompatible() ; - } - } catch ( Exception ex ) { - throw wrapper.insertObjectFailed(ex) ; - } - isInitialized = true; - } - - /** - * See the description of the general Any operations. - */ - public org.omg.CORBA.Object extract_Object() - { - //debug.log ("extract_Object"); - if (!isInitialized) - throw wrapper.extractNotInitialized() ; - - // Check if the object contained here is of the type in typeCode - org.omg.CORBA.Object obj = null; - try { - obj = (org.omg.CORBA.Object) object; - if (typeCode.id().equals("IDL:omg.org/CORBA/Object:1.0") || obj._is_a(typeCode.id())) { - return obj; - } else { - throw wrapper.extractObjectIncompatible() ; - } - } catch ( Exception ex ) { - throw wrapper.extractObjectFailed(ex); - } - } - - /** - * See the description of the general Any operations. - */ - public void insert_TypeCode(TypeCode tc) - { - //debug.log ("insert_TypeCode"); - typeCode = orb.get_primitive_tc(TCKind._tk_TypeCode); - object = tc; - isInitialized = true; - } - - /** - * See the description of the general Any operations. - */ - public TypeCode extract_TypeCode() - { - //debug.log ("extract_TypeCode"); - checkExtractBadOperation( TCKind._tk_TypeCode ) ; - return (TypeCode)object; - } - - /** - * @deprecated - */ - @Deprecated - public void insert_Principal(Principal p) - { - typeCode = orb.get_primitive_tc(TCKind._tk_Principal); - object = p; - isInitialized = true; - } - - /** - * @deprecated - */ - @Deprecated - public Principal extract_Principal() - { - checkExtractBadOperation( TCKind._tk_Principal ) ; - return (Principal)object; - } - - /** - * Note that the Serializable really should be an IDLEntity of - * some kind. It shouldn't just be an RMI-IIOP type. Currently, - * we accept and will produce RMI repIds with the latest - * calculations if given a non-IDLEntity Serializable. - */ - public Serializable extract_Value() - { - //debug.log ("extract_Value"); - checkExtractBadOperationList( new int[] { TCKind._tk_value, - TCKind._tk_value_box, TCKind._tk_abstract_interface } ) ; - return (Serializable)object; - } - - public void insert_Value(Serializable v) - { - //debug.log ("insert_Value"); - object = v; - - TypeCode tc; - - if ( v == null ) { - tc = orb.get_primitive_tc (TCKind.tk_value); - } else { - // See note in getPrimitiveTypeCodeForClass. We - // have to use the latest type code fixes in this - // case since there is no way to know what ORB will - // actually send this Any. In RMI-IIOP, when using - // Util.writeAny, we can do the versioning correctly, - // and use the insert_Value(Serializable, TypeCode) - // method. - // - // The ORB singleton uses the latest version. - tc = createTypeCodeForClass (v.getClass(), (ORB)ORB.init()); - } - - typeCode = TypeCodeImpl.convertToNative(orb, tc); - isInitialized = true; - } - - public void insert_Value(Serializable v, org.omg.CORBA.TypeCode t) - { - //debug.log ("insert_Value2"); - object = v; - typeCode = TypeCodeImpl.convertToNative(orb, t); - isInitialized = true; - } - - public void insert_fixed(java.math.BigDecimal value) { - typeCode = TypeCodeImpl.convertToNative(orb, - orb.create_fixed_tc(TypeCodeImpl.digits(value), TypeCodeImpl.scale(value))); - object = value; - isInitialized = true; - } - - public void insert_fixed(java.math.BigDecimal value, org.omg.CORBA.TypeCode type) - { - try { - if (TypeCodeImpl.digits(value) > type.fixed_digits() || - TypeCodeImpl.scale(value) > type.fixed_scale()) - { - throw wrapper.fixedNotMatch() ; - } - } catch (org.omg.CORBA.TypeCodePackage.BadKind bk) { - // type isn't even of kind fixed - throw wrapper.fixedBadTypecode( bk ) ; - } - typeCode = TypeCodeImpl.convertToNative(orb, type); - object = value; - isInitialized = true; - } - - public java.math.BigDecimal extract_fixed() { - checkExtractBadOperation( TCKind._tk_fixed ) ; - return (BigDecimal)object; - } - - /** - * Utility method for insert_Value and Util.writeAny. - * - * The ORB passed in should have the desired ORBVersion. It - * is used to generate the type codes. - */ - public TypeCode createTypeCodeForClass (java.lang.Class c, ORB tcORB) - { - // Look in the cache first - TypeCodeImpl classTC = tcORB.getTypeCodeForClass(c); - if (classTC != null) - return classTC; - - // All cases need to be able to create repository IDs. - // - // See bug 4391648 for more info about the tcORB in this - // case. - RepositoryIdStrings repStrs - = RepositoryIdFactory.getRepIdStringsFactory(); - - - // Assertion: c instanceof Serializable? - - if ( c.isArray() ) { - // Arrays - may recurse for multi-dimensional arrays - Class componentClass = c.getComponentType(); - TypeCode embeddedType; - if ( componentClass.isPrimitive() ) { - embeddedType = getPrimitiveTypeCodeForClass(componentClass, - tcORB); - } else { - embeddedType = createTypeCodeForClass (componentClass, - tcORB); - } - TypeCode t = tcORB.create_sequence_tc (0, embeddedType); - - String id = repStrs.createForJavaType(c); - - return tcORB.create_value_box_tc (id, "Sequence", t); - } else if ( c == java.lang.String.class ) { - // Strings - TypeCode t = tcORB.create_string_tc (0); - - String id = repStrs.createForJavaType(c); - - return tcORB.create_value_box_tc (id, "StringValue", t); - } - - // Anything else - // We know that this is a TypeCodeImpl since it is our ORB - classTC = (TypeCodeImpl)ValueUtility.createTypeCodeForClass( - tcORB, c, ORBUtility.createValueHandler()); - // Intruct classTC to store its buffer - classTC.setCaching(true); - // Update the cache - tcORB.setTypeCodeForClass(c, classTC); - return classTC; - } - - /** - * It looks like this was copied from io.ValueUtility at some - * point. - * - * It's used by createTypeCodeForClass. The tcORB passed in - * should have the desired ORB version, and is used to - * create the type codes. - */ - private TypeCode getPrimitiveTypeCodeForClass (Class c, ORB tcORB) - { - //debug.log ("getPrimitiveTypeCodeForClass"); - - if (c == Integer.TYPE) { - return tcORB.get_primitive_tc (TCKind.tk_long); - } else if (c == Byte.TYPE) { - return tcORB.get_primitive_tc (TCKind.tk_octet); - } else if (c == Long.TYPE) { - return tcORB.get_primitive_tc (TCKind.tk_longlong); - } else if (c == Float.TYPE) { - return tcORB.get_primitive_tc (TCKind.tk_float); - } else if (c == Double.TYPE) { - return tcORB.get_primitive_tc (TCKind.tk_double); - } else if (c == Short.TYPE) { - return tcORB.get_primitive_tc (TCKind.tk_short); - } else if (c == Character.TYPE) { - // For Merlin or later JDKs, or for foreign ORBs, - // we correctly say that a Java char maps to a - // CORBA wchar. For backwards compatibility - // with our older ORBs, we say it maps to a - // CORBA char. This is only used in RMI-IIOP - // in our javax.rmi.CORBA.Util delegate's - // writeAny method. In Java IDL, there's no way - // to know the ORB version that the Any will be - // sent out with -- it could be different than - // the one used to create the Any -- so we use the - // most recent version (see insert_Value). - if (ORBVersionFactory.getFOREIGN().compareTo(tcORB.getORBVersion()) == 0 || - ORBVersionFactory.getNEWER().compareTo(tcORB.getORBVersion()) <= 0) - return tcORB.get_primitive_tc(TCKind.tk_wchar); - else - return tcORB.get_primitive_tc(TCKind.tk_char); - } else if (c == Boolean.TYPE) { - return tcORB.get_primitive_tc (TCKind.tk_boolean); - } else { - // _REVISIT_ Not sure if this is right. - return tcORB.get_primitive_tc (TCKind.tk_any); - } - } - - // Extracts a member value according to the given TypeCode from the given complex Any - // (at the Anys current internal stream position, consuming the anys stream on the way) - // and returns it wrapped into a new Any - public Any extractAny(TypeCode memberType, ORB orb) { - Any returnValue = orb.create_any(); - OutputStream out = returnValue.create_output_stream(); - TypeCodeImpl.convertToNative(orb, memberType).copy((InputStream)stream, out); - returnValue.read_value(out.create_input_stream(), memberType); - return returnValue; - } - - // This method could very well be moved into TypeCodeImpl or a common utility class, - // but is has to be in this package. - static public Any extractAnyFromStream(TypeCode memberType, InputStream input, ORB orb) { - Any returnValue = orb.create_any(); - OutputStream out = returnValue.create_output_stream(); - TypeCodeImpl.convertToNative(orb, memberType).copy(input, out); - returnValue.read_value(out.create_input_stream(), memberType); - return returnValue; - } - - // There is no other way for DynAnys to find out whether the Any is initialized. - public boolean isInitialized() { - return isInitialized; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/AnyImplHelper.java b/src/java.corba/share/classes/com/sun/corba/se/impl/corba/AnyImplHelper.java deleted file mode 100644 index 06668c39ab2..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/AnyImplHelper.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.corba; - -abstract public class AnyImplHelper -{ - private static String _id = "IDL:omg.org/CORBA/Any:1.0"; - - public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.Any that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static org.omg.CORBA.Any extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_any); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static org.omg.CORBA.Any read (org.omg.CORBA.portable.InputStream istream) - { - return istream.read_any (); - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.Any value) - { - ostream.write_any (value); - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/AsynchInvoke.java b/src/java.corba/share/classes/com/sun/corba/se/impl/corba/AsynchInvoke.java deleted file mode 100644 index 59adaef5778..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/AsynchInvoke.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.corba; - -import com.sun.corba.se.spi.orb.ORB ; - -/////////////////////////////////////////////////////////////////////////// -// helper class for deferred invocations - -/* - * The AsynchInvoke class allows for the support of asynchronous - * invocations. Instances of these are created with a request object, - * and when run, perform an invocation. The instance is also - * responsible for waking up a client that might be waiting on the - * 'get_response' method. - */ - -public class AsynchInvoke implements Runnable { - - private RequestImpl _req; - private ORB _orb; - private boolean _notifyORB; - - public AsynchInvoke (ORB o, RequestImpl reqToInvokeOn, boolean n) - { - _orb = o; - _req = reqToInvokeOn; - _notifyORB = n; - }; - - - /* - * The run operation calls the invocation on the request object, - * updates the RequestImpl state to indicate that the asynchronous - * invocation is complete, and wakes up any client that might be - * waiting on a 'get_response' call. - * - */ - - public void run() - { - // do the actual invocation - _req.doInvocation(); - - // for the asynchronous case, note that the response has been - // received. - synchronized (_req) - { - // update local boolean indicator - _req.gotResponse = true; - - // notify any client waiting on a 'get_response' - _req.notify(); - } - - if (_notifyORB == true) { - _orb.notifyORB() ; - } - } - -}; - -/////////////////////////////////////////////////////////////////////////// diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/CORBAObjectImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/corba/CORBAObjectImpl.java deleted file mode 100644 index fc02f8c9a55..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/CORBAObjectImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.corba; - -// -// Bare implementation of CORBA Object. -// -public class CORBAObjectImpl extends org.omg.CORBA_2_3.portable.ObjectImpl { - public String[] _ids() { - String[] typeids = new String[1]; - typeids[0] = "IDL:omg.org/CORBA/Object:1.0"; - return typeids; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/ContextImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/corba/ContextImpl.java deleted file mode 100644 index 4856a13e145..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/ContextImpl.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.corba; - -import org.omg.CORBA.Any; -import org.omg.CORBA.Context; -import org.omg.CORBA.NO_IMPLEMENT; -import org.omg.CORBA.SystemException; -import org.omg.CORBA.NVList; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -public final class ContextImpl extends Context { - - private org.omg.CORBA.ORB _orb; - private ORBUtilSystemException wrapper ; - - public ContextImpl(org.omg.CORBA.ORB orb) - { - _orb = orb; - wrapper = ORBUtilSystemException.get( - (com.sun.corba.se.spi.orb.ORB)orb, - CORBALogDomains.RPC_PRESENTATION ) ; - } - - public ContextImpl(Context parent) - { - throw wrapper.contextNotImplemented() ; - } - - public String context_name() - { - throw wrapper.contextNotImplemented() ; - } - - public Context parent() - { - throw wrapper.contextNotImplemented() ; - } - - public Context create_child(String name) - { - throw wrapper.contextNotImplemented() ; - } - - public void set_one_value(String propName, Any propValue) - { - throw wrapper.contextNotImplemented() ; - } - - public void set_values(NVList values) - { - throw wrapper.contextNotImplemented() ; - } - - - public void delete_values(String propName) - { - throw wrapper.contextNotImplemented() ; - } - - public NVList get_values(String startScope, - int opFlags, - String propName) - { - throw wrapper.contextNotImplemented() ; - } -}; diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/ContextListImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/corba/ContextListImpl.java deleted file mode 100644 index 23a5b6f862b..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/ContextListImpl.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 1996, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.corba; - -import java.util.Vector; -import org.omg.CORBA.ContextList; -import org.omg.CORBA.Bounds; -import org.omg.CORBA.ORB; - -public class ContextListImpl extends ContextList -{ - private final int INITIAL_CAPACITY = 2; - private final int CAPACITY_INCREMENT = 2; - - private org.omg.CORBA.ORB _orb; - private Vector _contexts; - - public ContextListImpl(org.omg.CORBA.ORB orb) - { - // Note: This orb could be an instanceof ORBSingleton or ORB - _orb = orb; - _contexts = new Vector(INITIAL_CAPACITY, CAPACITY_INCREMENT); - } - - public int count() - { - return _contexts.size(); - } - - public void add(String ctxt) - { - _contexts.addElement(ctxt); - } - - public String item(int index) - throws Bounds - { - try { - return (String) _contexts.elementAt(index); - } catch (ArrayIndexOutOfBoundsException e) { - throw new Bounds(); - } - } - - public void remove(int index) - throws Bounds - { - try { - _contexts.removeElementAt(index); - } catch (ArrayIndexOutOfBoundsException e) { - throw new Bounds(); - } - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/EnvironmentImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/corba/EnvironmentImpl.java deleted file mode 100644 index 368aa620d14..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/EnvironmentImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 1996, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.corba; - -import org.omg.CORBA.Environment; -import org.omg.CORBA.UserException; -import org.omg.CORBA.ORB; - -public class EnvironmentImpl extends Environment { - - private Exception _exc; - - public EnvironmentImpl() - { - } - - public Exception exception() - { - return _exc; - } - - public void exception(Exception exc) - { - _exc = exc; - } - - public void clear() - { - _exc = null; - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/ExceptionListImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/corba/ExceptionListImpl.java deleted file mode 100644 index 169425417a7..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/ExceptionListImpl.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 1996, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.corba; - -import java.util.Vector; - -import org.omg.CORBA.Bounds; -import org.omg.CORBA.ExceptionList; -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.ORB; - - -public class ExceptionListImpl extends ExceptionList { - - private final int INITIAL_CAPACITY = 2; - private final int CAPACITY_INCREMENT = 2; - - private Vector _exceptions; - - public ExceptionListImpl() { - _exceptions = new Vector(INITIAL_CAPACITY, CAPACITY_INCREMENT); - } - - public int count() - { - return _exceptions.size(); - } - - public void add(TypeCode tc) - { - _exceptions.addElement(tc); - } - - public TypeCode item(int index) - throws Bounds - { - try { - return (TypeCode) _exceptions.elementAt(index); - } catch (ArrayIndexOutOfBoundsException e) { - throw new Bounds(); - } - } - - public void remove(int index) - throws Bounds - { - try { - _exceptions.removeElementAt(index); - } catch (ArrayIndexOutOfBoundsException e) { - throw new Bounds(); - } - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/NVListImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/corba/NVListImpl.java deleted file mode 100644 index d5cbb202199..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/NVListImpl.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.corba; - -import java.util.Vector; - -import org.omg.CORBA.Any; -import org.omg.CORBA.Bounds; -import org.omg.CORBA.NVList; -import org.omg.CORBA.NamedValue; - -import com.sun.corba.se.spi.orb.ORB ; - -public class NVListImpl extends NVList -{ - private final int INITIAL_CAPACITY = 4; - private final int CAPACITY_INCREMENT = 2; - - private Vector _namedValues; - private ORB orb; - - public NVListImpl(ORB orb) - { - // Note: This orb could be an instanceof ORBSingleton or ORB - this.orb = orb; - _namedValues = new Vector(INITIAL_CAPACITY, CAPACITY_INCREMENT); - } - - public NVListImpl(ORB orb, int size) - { - this.orb = orb; - - // Note: the size arg is only a hint of the size of the NVList. - _namedValues = new Vector(size); - } - - - public int count() - { - return _namedValues.size(); - } - - public NamedValue add(int flags) - { - NamedValue tmpVal = new NamedValueImpl(orb, "", new AnyImpl(orb), flags); - _namedValues.addElement(tmpVal); - return tmpVal; - } - - public NamedValue add_item(String itemName, int flags) - { - NamedValue tmpVal = new NamedValueImpl(orb, itemName, new AnyImpl(orb), - flags); - _namedValues.addElement(tmpVal); - return tmpVal; - } - - public NamedValue add_value(String itemName, Any val, int flags) - { - NamedValue tmpVal = new NamedValueImpl(orb, itemName, val, flags); - _namedValues.addElement(tmpVal); - return tmpVal; - } - - public NamedValue item(int index) - throws Bounds - { - try { - return (NamedValue) _namedValues.elementAt(index); - } catch (ArrayIndexOutOfBoundsException e) { - throw new Bounds(); - } - } - - public void remove(int index) - throws Bounds - { - try { - _namedValues.removeElementAt(index); - } catch (ArrayIndexOutOfBoundsException e) { - throw new Bounds(); - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/NamedValueImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/corba/NamedValueImpl.java deleted file mode 100644 index 43f6c688031..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/NamedValueImpl.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.corba; - -import org.omg.CORBA.NamedValue; -import org.omg.CORBA.Any; - -import com.sun.corba.se.spi.orb.ORB ; - -public class NamedValueImpl extends NamedValue -{ - private String _name; - private Any _value; - private int _flags; - private ORB _orb; - - public NamedValueImpl(ORB orb) - { - // Note: This orb could be an instanceof ORBSingleton or ORB - _orb = orb; - _value = new AnyImpl(_orb); - } - - public NamedValueImpl(ORB orb, - String name, - Any value, - int flags) - { - // Note: This orb could be an instanceof ORBSingleton or ORB - _orb = orb; - _name = name; - _value = value; - _flags = flags; - } - - public String name() - { - return _name; - } - - public Any value() - { - return _value; - } - - public int flags() - { - return _flags; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/PrincipalImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/corba/PrincipalImpl.java deleted file mode 100644 index e969a418437..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/PrincipalImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.corba; - - -public class PrincipalImpl extends org.omg.CORBA.Principal -{ - private byte[] value; - - public void name(byte[] value) - { - this.value = value; - } - - public byte[] name() - { - return value; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/RequestImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/corba/RequestImpl.java deleted file mode 100644 index 69b58393d95..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/RequestImpl.java +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.corba; - - -import org.omg.CORBA.Any; -import org.omg.CORBA.ARG_IN; -import org.omg.CORBA.ARG_OUT; -import org.omg.CORBA.ARG_INOUT; -import org.omg.CORBA.Context; -import org.omg.CORBA.ContextList; -import org.omg.CORBA.Environment; -import org.omg.CORBA.ExceptionList; -import org.omg.CORBA.NVList; -import org.omg.CORBA.NamedValue; -import org.omg.CORBA.Request; -import org.omg.CORBA.SystemException; -import org.omg.CORBA.TCKind; -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.TypeCodePackage.BadKind; -import org.omg.CORBA.UnknownUserException; -import org.omg.CORBA.Bounds; -import org.omg.CORBA.UNKNOWN; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.NO_IMPLEMENT; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.WrongTransaction; - -import org.omg.CORBA.portable.ApplicationException ; -import org.omg.CORBA.portable.RemarshalException ; -import org.omg.CORBA.portable.InputStream ; -import org.omg.CORBA.portable.OutputStream ; - -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.presentation.rmi.StubAdapter; -import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.impl.logging.ORBUtilSystemException; -import com.sun.corba.se.impl.corba.AsynchInvoke; - -public class RequestImpl - extends Request -{ - /////////////////////////////////////////////////////////////////////////// - // data members - - protected org.omg.CORBA.Object _target; - protected String _opName; - protected NVList _arguments; - protected ExceptionList _exceptions; - private NamedValue _result; - protected Environment _env; - private Context _ctx; - private ContextList _ctxList; - protected ORB _orb; - private ORBUtilSystemException _wrapper; - - // invocation-specific stuff - protected boolean _isOneWay = false; - private int[] _paramCodes; - private long[] _paramLongs; - private java.lang.Object[] _paramObjects; - - // support for deferred invocations. - // protected instead of private since it needs to be set by the - // thread object doing the asynchronous invocation. - protected boolean gotResponse = false; - - /////////////////////////////////////////////////////////////////////////// - // constructor - - // REVISIT - used to be protected. Now public so it can be - // accessed from xgiop. - public RequestImpl (ORB orb, - org.omg.CORBA.Object targetObject, - Context ctx, - String operationName, - NVList argumentList, - NamedValue resultContainer, - ExceptionList exceptionList, - ContextList ctxList) - { - - // initialize the orb - _orb = orb; - _wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.OA_INVOCATION ) ; - - // initialize target, context and operation name - _target = targetObject; - _ctx = ctx; - _opName = operationName; - - // initialize argument list if not passed in - if (argumentList == null) - _arguments = new NVListImpl(_orb); - else - _arguments = argumentList; - - // set result container. - _result = resultContainer; - - // initialize exception list if not passed in - if (exceptionList == null) - _exceptions = new ExceptionListImpl(); - else - _exceptions = exceptionList; - - // initialize context list if not passed in - if (ctxList == null) - _ctxList = new ContextListImpl(_orb); - else - _ctxList = ctxList; - - // initialize environment - _env = new EnvironmentImpl(); - - } - - public org.omg.CORBA.Object target() - { - return _target; - } - - public String operation() - { - return _opName; - } - - public NVList arguments() - { - return _arguments; - } - - public NamedValue result() - { - return _result; - } - - public Environment env() - { - return _env; - } - - public ExceptionList exceptions() - { - return _exceptions; - } - - public ContextList contexts() - { - return _ctxList; - } - - public synchronized Context ctx() - { - if (_ctx == null) - _ctx = new ContextImpl(_orb); - return _ctx; - } - - public synchronized void ctx(Context newCtx) - { - _ctx = newCtx; - } - - public synchronized Any add_in_arg() - { - return _arguments.add(org.omg.CORBA.ARG_IN.value).value(); - } - - public synchronized Any add_named_in_arg(String name) - { - return _arguments.add_item(name, org.omg.CORBA.ARG_IN.value).value(); - } - - public synchronized Any add_inout_arg() - { - return _arguments.add(org.omg.CORBA.ARG_INOUT.value).value(); - } - - public synchronized Any add_named_inout_arg(String name) - { - return _arguments.add_item(name, org.omg.CORBA.ARG_INOUT.value).value(); - } - - public synchronized Any add_out_arg() - { - return _arguments.add(org.omg.CORBA.ARG_OUT.value).value(); - } - - public synchronized Any add_named_out_arg(String name) - { - return _arguments.add_item(name, org.omg.CORBA.ARG_OUT.value).value(); - } - - public synchronized void set_return_type(TypeCode tc) - { - if (_result == null) - _result = new NamedValueImpl(_orb); - _result.value().type(tc); - } - - public synchronized Any return_value() - { - if (_result == null) - _result = new NamedValueImpl(_orb); - return _result.value(); - } - - public synchronized void add_exception(TypeCode exceptionType) - { - _exceptions.add(exceptionType); - } - - public synchronized void invoke() - { - doInvocation(); - } - - public synchronized void send_oneway() - { - _isOneWay = true; - doInvocation(); - } - - public synchronized void send_deferred() - { - AsynchInvoke invokeObject = new AsynchInvoke(_orb, this, false); - new Thread(null, invokeObject, "Async-Request-Invoker-Thread", 0, false).start(); - } - - public synchronized boolean poll_response() - { - // this method has to be synchronized even though it seems - // "readonly" since the thread object doing the asynchronous - // invocation can potentially update this variable in parallel. - // updates are currently simply synchronized againt the request - // object. - return gotResponse; - } - - public synchronized void get_response() - throws org.omg.CORBA.WrongTransaction - { - while (gotResponse == false) { - // release the lock. wait to be notified by the thread that is - // doing the asynchronous invocation. - try { - wait(); - } - catch (InterruptedException e) {} - } - } - - /////////////////////////////////////////////////////////////////////////// - // private helper methods - - /* - * The doInvocation operation is where the real mechanics of - * performing the request invocation is done. - */ - protected void doInvocation() - { - org.omg.CORBA.portable.Delegate delegate = StubAdapter.getDelegate( - _target ) ; - - // Initiate Client Portable Interceptors. Inform the PIHandler that - // this is a DII request so that it knows to ignore the second - // inevitable call to initiateClientPIRequest in createRequest. - // Also, save the RequestImpl object for later use. - _orb.getPIHandler().initiateClientPIRequest( true ); - _orb.getPIHandler().setClientPIInfo( this ); - - InputStream $in = null; - try { - OutputStream $out = delegate.request(null, _opName, !_isOneWay); - // Marshal args - try { - for (int i=0; i<_arguments.count() ; i++) { - NamedValue nv = _arguments.item(i); - switch (nv.flags()) { - case ARG_IN.value: - nv.value().write_value($out); - break; - case ARG_OUT.value: - break; - case ARG_INOUT.value: - nv.value().write_value($out); - break; - } - } - } catch ( org.omg.CORBA.Bounds ex ) { - throw _wrapper.boundsErrorInDiiRequest( ex ) ; - } - - $in = delegate.invoke(null, $out); - } catch (ApplicationException e) { - // REVISIT - minor code. - // This is already handled in subcontract. - // REVISIT - uncomment. - //throw new INTERNAL(); - } catch (RemarshalException e) { - doInvocation(); - } catch( SystemException ex ) { - _env.exception(ex); - // NOTE: The exception should not be thrown. - // However, JDK 1.4 and earlier threw the exception, - // so we keep the behavior to be compatible. - throw ex; - } finally { - delegate.releaseReply(null, $in); - } - } - - // REVISIT - make protected after development - so xgiop can get it. - public void unmarshalReply(InputStream is) - { - // First unmarshal the return value if it is not void - if ( _result != null ) { - Any returnAny = _result.value(); - TypeCode returnType = returnAny.type(); - if ( returnType.kind().value() != TCKind._tk_void ) - returnAny.read_value(is, returnType); - } - - // Now unmarshal the out/inout args - try { - for ( int i=0; i<_arguments.count() ; i++) { - NamedValue nv = _arguments.item(i); - switch( nv.flags() ) { - case ARG_IN.value: - break; - case ARG_OUT.value: - case ARG_INOUT.value: - Any any = nv.value(); - any.read_value(is, any.type()); - break; - } - } - } - catch ( org.omg.CORBA.Bounds ex ) { - // Cannot happen since we only iterate till _arguments.count() - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/ServerRequestImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/corba/ServerRequestImpl.java deleted file mode 100644 index c77802f1776..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/ServerRequestImpl.java +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Copyright (c) 1996, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.corba; - -import org.omg.CORBA.Any; -import org.omg.CORBA.Context; -import org.omg.CORBA.NamedValue; -import org.omg.CORBA.NVList; -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.TCKind; -import org.omg.CORBA.ServerRequest; -import org.omg.CORBA.Bounds; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; -import org.omg.CORBA.CompletionStatus; - -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -public class ServerRequestImpl extends ServerRequest { - - /////////////////////////////////////////////////////////////////////////// - // data members - - private ORB _orb = null; - private ORBUtilSystemException _wrapper = null; - private String _opName = null; - private NVList _arguments = null; - private Context _ctx = null; - private InputStream _ins = null; - - // booleans to check for various operation invocation restrictions - private boolean _paramsCalled = false; - private boolean _resultSet = false; - private boolean _exceptionSet = false; - private Any _resultAny = null; - private Any _exception = null; - - - public ServerRequestImpl (CorbaMessageMediator req, ORB orb) { - _opName = req.getOperationName(); - _ins = (InputStream)req.getInputObject(); - _ctx = null; // if we support contexts, this would - // presumably also be available on - // the server invocation - _orb = orb; - _wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.OA_INVOCATION ) ; - } - - public String operation() { - return _opName; - } - - public void arguments(NVList args) - { - if (_paramsCalled) - throw _wrapper.argumentsCalledMultiple() ; - - if (_exceptionSet) - throw _wrapper.argumentsCalledAfterException() ; - - if (args == null ) - throw _wrapper.argumentsCalledNullArgs() ; - - _paramsCalled = true; - - NamedValue arg = null; - for (int i=0; i < args.count() ; i++) { - try { - arg = args.item(i); - } catch (Bounds e) { - throw _wrapper.boundsCannotOccur(e) ; - } - - try { - if ((arg.flags() == org.omg.CORBA.ARG_IN.value) || - (arg.flags() == org.omg.CORBA.ARG_INOUT.value)) { - // unmarshal the value into the Any - arg.value().read_value(_ins, arg.value().type()); - } - } catch ( Exception ex ) { - throw _wrapper.badArgumentsNvlist( ex ) ; - } - } - - // hang on to the NVList for marshaling the result - _arguments = args; - - _orb.getPIHandler().setServerPIInfo( _arguments ); - _orb.getPIHandler().invokeServerPIIntermediatePoint(); - } - - public void set_result(Any res) { - // check for invocation restrictions - if (!_paramsCalled) - throw _wrapper.argumentsNotCalled() ; - if (_resultSet) - throw _wrapper.setResultCalledMultiple() ; - if (_exceptionSet) - throw _wrapper.setResultAfterException() ; - if ( res == null ) - throw _wrapper.setResultCalledNullArgs() ; - - _resultAny = res; - _resultSet = true; - - // Notify portable interceptors of the result so that - // ServerRequestInfo.result() functions as desired. - _orb.getPIHandler().setServerPIInfo( _resultAny ); - - // actual marshaling of the reply msg header and params takes place - // after the DSI returns control to the ORB. - } - - public void set_exception(Any exc) - { - // except can be called by the DIR at any time (CORBA 2.2 section 6.3). - - if ( exc == null ) - throw _wrapper.setExceptionCalledNullArgs() ; - - // Ensure that the Any contains a SystemException or a - // UserException. If the UserException is not a declared exception, - // the client will get an UNKNOWN exception. - TCKind kind = exc.type().kind(); - if ( kind != TCKind.tk_except ) - throw _wrapper.setExceptionCalledBadType() ; - - _exception = exc; - - // Inform Portable interceptors of the exception that was set - // so sending_exception can return the right value. - _orb.getPIHandler().setServerPIExceptionInfo( _exception ); - - // The user can only call arguments once and not at all after - // set_exception. (internal flags ensure this). However, the user - // can call set_exception multiple times. Therefore, we only - // invoke receive_request the first time set_exception is - // called (if they haven't already called arguments). - if( !_exceptionSet && !_paramsCalled ) { - // We need to invoke intermediate points here. - _orb.getPIHandler().invokeServerPIIntermediatePoint(); - } - - _exceptionSet = true; - - // actual marshaling of the reply msg header and exception takes place - // after the DSI returns control to the ORB. - } - - - /** This is called from the ORB after the DynamicImplementation.invoke - * returns. Here we set the result if result() has not already been called. - * @return the exception if there is one (then ORB will not call - * marshalReplyParams()) otherwise return null. - */ - public Any checkResultCalled() - { - // Two things to be checked (CORBA 2.2 spec, section 6.3): - // 1. Unless it calls set_exception(), the DIR must call arguments() - // exactly once, even if the operation signature contains - // no parameters. - // 2. Unless set_exception() is called, if the invoked operation has a - // non-void result type, set_result() must be called exactly once - // before the DIR returns. - - if ( _paramsCalled && _resultSet ) // normal invocation return - return null; - else if ( _paramsCalled && !_resultSet && !_exceptionSet ) { - try { - // Neither a result nor an exception has been set. - // Assume that the return type is void. If this is not so, - // the client will throw a MARSHAL exception while - // unmarshaling the return value. - TypeCode result_tc = _orb.get_primitive_tc( - org.omg.CORBA.TCKind.tk_void); - _resultAny = _orb.create_any(); - _resultAny.type(result_tc); - _resultSet = true; - - return null; - } catch ( Exception ex ) { - throw _wrapper.dsiResultException( - CompletionStatus.COMPLETED_MAYBE, ex ) ; - } - } else if ( _exceptionSet ) - return _exception; - else { - throw _wrapper.dsimethodNotcalled( - CompletionStatus.COMPLETED_MAYBE ) ; - } - } - - /** This is called from the ORB after the DynamicImplementation.invoke - * returns. Here we marshal the return value and inout/out params. - */ - public void marshalReplyParams(OutputStream os) - { - // marshal the operation return value - _resultAny.write_value(os); - - // marshal the inouts/outs - NamedValue arg = null; - - for (int i=0; i < _arguments.count() ; i++) { - try { - arg = _arguments.item(i); - } catch (Bounds e) {} - - if ((arg.flags() == org.omg.CORBA.ARG_OUT.value) || - (arg.flags() == org.omg.CORBA.ARG_INOUT.value)) { - arg.value().write_value(os); - } - } - } - - public Context ctx() - { - if ( !_paramsCalled || _resultSet || _exceptionSet ) - throw _wrapper.contextCalledOutOfOrder() ; - - throw _wrapper.contextNotImplemented() ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/TCUtility.java b/src/java.corba/share/classes/com/sun/corba/se/impl/corba/TCUtility.java deleted file mode 100644 index b167081a170..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/TCUtility.java +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.corba; - -import org.omg.CORBA.SystemException; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.UserException; -import org.omg.CORBA.TCKind; -import org.omg.CORBA.UNKNOWN; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.NO_IMPLEMENT; -import org.omg.CORBA.Any; -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.Principal; -import org.omg.CORBA_2_3.portable.InputStream; -import org.omg.CORBA_2_3.portable.OutputStream; -import org.omg.CORBA.portable.Streamable; -import org.omg.CORBA.TypeCodePackage.BadKind; -import java.util.Hashtable; -import java.util.Enumeration; -import java.util.NoSuchElementException; - -import com.sun.corba.se.impl.encoding.CDRInputStream; -import com.sun.corba.se.impl.encoding.CDROutputStream; -import java.io.Serializable; -import java.math.BigDecimal; -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -/** - * Static functions for TypeCode interpretation. - */ -public final class TCUtility { - - static void marshalIn(org.omg.CORBA.portable.OutputStream s, TypeCode typeCode, long l, Object o) { - switch (typeCode.kind().value()) { - case TCKind._tk_null: - case TCKind._tk_void: - case TCKind._tk_native: - // nothing to write - break; - - case TCKind._tk_short: - s.write_short((short)(l & 0xFFFFL)); - break; - - case TCKind._tk_ushort: - s.write_ushort((short)(l & 0xFFFFL)); - break; - - case TCKind._tk_enum: - case TCKind._tk_long: - s.write_long((int)(l & 0xFFFFFFFFL)); - break; - - case TCKind._tk_ulong: - s.write_ulong((int)(l & 0xFFFFFFFFL)); - break; - - case TCKind._tk_float: - s.write_float(Float.intBitsToFloat((int)(l & 0xFFFFFFFFL))); - break; - - case TCKind._tk_double: - s.write_double(Double.longBitsToDouble(l)); - break; - - case TCKind._tk_boolean: - if ( l == 0 ) - s.write_boolean(false); - else - s.write_boolean(true); - break; - - case TCKind._tk_char: - s.write_char((char)(l & 0xFFFFL)); - break; - - case TCKind._tk_octet: - s.write_octet((byte)(l & 0xFFL)); - break; - - case TCKind._tk_any: - s.write_any((Any)o); - break; - - case TCKind._tk_TypeCode: - s.write_TypeCode((TypeCode)o); - break; - - case TCKind._tk_Principal: - s.write_Principal((Principal)o); - break; - - case TCKind._tk_objref: - s.write_Object((org.omg.CORBA.Object)o); - break; - - case TCKind._tk_longlong: - s.write_longlong(l); - break; - - case TCKind._tk_ulonglong: - s.write_ulonglong(l); - break; - - case TCKind._tk_wchar: - s.write_wchar((char)(l & 0xFFFFL)); - break; - - case TCKind._tk_string: - s.write_string((String)o); - break; - - case TCKind._tk_wstring: - s.write_wstring((String)o); - break; - - case TCKind._tk_value: - case TCKind._tk_value_box: - ((org.omg.CORBA_2_3.portable.OutputStream)s).write_value((Serializable)o); - break; - - case TCKind._tk_fixed: - // _REVISIT_ As soon as the java-rtf adds digits and scale parameters to - // OutputStream, this check will be unnecessary - if (s instanceof CDROutputStream) { - try { - ((CDROutputStream)s).write_fixed((BigDecimal)o, - typeCode.fixed_digits(), - typeCode.fixed_scale()); - } catch (BadKind badKind) { // impossible - } - } else { - s.write_fixed((BigDecimal)o); - } - break; - - case TCKind._tk_struct: - case TCKind._tk_union: - case TCKind._tk_sequence: - case TCKind._tk_array: - case TCKind._tk_alias: - case TCKind._tk_except: - ((Streamable)o)._write(s); - break; - - case TCKind._tk_abstract_interface: - ((org.omg.CORBA_2_3.portable.OutputStream)s).write_abstract_interface(o); - break; - - case TCKind._tk_longdouble: - // Unspecified for Java - default: - ORBUtilSystemException wrapper = ORBUtilSystemException.get( - (com.sun.corba.se.spi.orb.ORB)s.orb(), - CORBALogDomains.RPC_PRESENTATION ) ; - throw wrapper.typecodeNotSupported() ; - } - } - - static void unmarshalIn(org.omg.CORBA.portable.InputStream s, TypeCode typeCode, long[] la, Object[] oa) - { - int type = typeCode.kind().value(); - long l=0; - Object o=oa[0]; - - switch (type) { - case TCKind._tk_null: - case TCKind._tk_void: - case TCKind._tk_native: - // Nothing to read - break; - - case TCKind._tk_short: - l = s.read_short() & 0xFFFFL; - break; - - case TCKind._tk_ushort: - l = s.read_ushort() & 0xFFFFL; - break; - - case TCKind._tk_enum: - case TCKind._tk_long: - l = s.read_long() & 0xFFFFFFFFL; - break; - - case TCKind._tk_ulong: - l = s.read_ulong() & 0xFFFFFFFFL; - break; - - case TCKind._tk_float: - l = Float.floatToIntBits(s.read_float()) & 0xFFFFFFFFL; - break; - - case TCKind._tk_double: - l = Double.doubleToLongBits(s.read_double()); - break; - - case TCKind._tk_char: - l = s.read_char() & 0xFFFFL; - break; - - case TCKind._tk_octet: - l = s.read_octet() & 0xFFL; - break; - - case TCKind._tk_boolean: - if ( s.read_boolean() ) - l = 1; - else - l = 0; - break; - - case TCKind._tk_any: - o = s.read_any(); - break; - - case TCKind._tk_TypeCode: - o = s.read_TypeCode(); - break; - - case TCKind._tk_Principal: - o = s.read_Principal(); - break; - - case TCKind._tk_objref: - if (o instanceof Streamable) - ((Streamable)o)._read(s); - else - o = s.read_Object(); - break; - - case TCKind._tk_longlong: - l = s.read_longlong(); - break; - - case TCKind._tk_ulonglong: - l = s.read_ulonglong(); - break; - - case TCKind._tk_wchar: - l = s.read_wchar() & 0xFFFFL; - break; - - case TCKind._tk_string: - o = s.read_string(); - break; - - case TCKind._tk_wstring: - o = s.read_wstring(); - break; - - case TCKind._tk_value: - case TCKind._tk_value_box: - o = ((org.omg.CORBA_2_3.portable.InputStream)s).read_value (); - break; - - case TCKind._tk_fixed: - try { - // _REVISIT_ As soon as the java-rtf adds digits and scale parameters to - // InputStream, this check will be unnecessary - if (s instanceof CDRInputStream) { - o = ((CDRInputStream)s).read_fixed(typeCode.fixed_digits(), - typeCode.fixed_scale()); - } else { - BigDecimal bigDecimal = s.read_fixed(); - o = bigDecimal.movePointLeft((int)typeCode.fixed_scale()); - } - } catch (BadKind badKind) { // impossible - } - break; - - case TCKind._tk_struct: - case TCKind._tk_union: - case TCKind._tk_sequence: - case TCKind._tk_array: - case TCKind._tk_alias: - case TCKind._tk_except: - ((Streamable)o)._read(s); - break; - - case TCKind._tk_abstract_interface: - o = ((org.omg.CORBA_2_3.portable.InputStream)s).read_abstract_interface(); - break; - - case TCKind._tk_longdouble: - // Unspecified for Java - default: - ORBUtilSystemException wrapper = ORBUtilSystemException.get( - (com.sun.corba.se.spi.orb.ORB)s.orb(), - CORBALogDomains.RPC_PRESENTATION ) ; - throw wrapper.typecodeNotSupported() ; - } - - oa[0] = o; - la[0] = l; - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/TypeCodeFactory.java b/src/java.corba/share/classes/com/sun/corba/se/impl/corba/TypeCodeFactory.java deleted file mode 100644 index 62646eb9ac9..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/TypeCodeFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.corba; - -public interface TypeCodeFactory { - void setTypeCode(String id, TypeCodeImpl code); - - TypeCodeImpl getTypeCode(String id); - - void setTypeCodeForClass( Class c, TypeCodeImpl tcimpl ) ; - - TypeCodeImpl getTypeCodeForClass( Class c ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/TypeCodeImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/corba/TypeCodeImpl.java deleted file mode 100644 index 4e90f7f2a32..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/corba/TypeCodeImpl.java +++ /dev/null @@ -1,2413 +0,0 @@ -/* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.corba; - -import java.util.HashMap; -import java.util.Map; -import java.util.Iterator; -import java.util.List; -import java.util.Collections; -import java.util.ArrayList; -import java.io.IOException; -import java.io.PrintStream; -import java.io.ByteArrayOutputStream; -import java.math.BigDecimal; -import java.math.BigInteger; - -import org.omg.CORBA.TypeCode ; -import org.omg.CORBA.StructMember ; -import org.omg.CORBA.UnionMember ; -import org.omg.CORBA.ValueMember ; -import org.omg.CORBA.TCKind ; -import org.omg.CORBA.Any ; -import org.omg.CORBA.Principal ; -import org.omg.CORBA.BAD_TYPECODE ; -import org.omg.CORBA.BAD_PARAM ; -import org.omg.CORBA.BAD_OPERATION ; -import org.omg.CORBA.INTERNAL ; -import org.omg.CORBA.MARSHAL ; -import org.omg.CORBA.TypeCodePackage.BadKind ; -import org.omg.CORBA_2_3.portable.InputStream; -import org.omg.CORBA_2_3.portable.OutputStream; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.logging.CORBALogDomains; - -import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry; -import com.sun.corba.se.impl.encoding.MarshalInputStream; -import com.sun.corba.se.impl.encoding.CodeSetConversion; -import com.sun.corba.se.impl.encoding.CDRInputStream; -import com.sun.corba.se.impl.encoding.CDROutputStream; -import com.sun.corba.se.impl.encoding.TypeCodeInputStream; -import com.sun.corba.se.impl.encoding.TypeCodeOutputStream; -import com.sun.corba.se.impl.encoding.TypeCodeReader; -import com.sun.corba.se.impl.encoding.WrapperInputStream; - -import com.sun.corba.se.impl.logging.ORBUtilSystemException; - -// no chance of subclasses, so no problems with runtime helper lookup -public final class TypeCodeImpl extends TypeCode -{ - //static final boolean debug = false; - - // the indirection TCKind, needed for recursive typecodes. - protected static final int tk_indirect = 0xFFFFFFFF; - - // typecode encodings have three different categories that determine - // how the encoding should be done. - - private static final int EMPTY = 0; // no parameters - private static final int SIMPLE = 1; // simple parameters. - private static final int COMPLEX = 2; // complex parameters. need to - // use CDR encapsulation for - // parameters - - // a table storing the encoding category for the various typecodes. - - private static final int typeTable[] = { - EMPTY, // tk_null - EMPTY, // tk_void - EMPTY, // tk_short - EMPTY, // tk_long - EMPTY, // tk_ushort - EMPTY, // tk_ulong - EMPTY, // tk_float - EMPTY, // tk_double - EMPTY, // tk_boolean - EMPTY, // tk_char - EMPTY, // tk_octet - EMPTY, // tk_any - EMPTY, // tk_typecode - EMPTY, // tk_principal - COMPLEX, // tk_objref - COMPLEX, // tk_struct - COMPLEX, // tk_union - COMPLEX, // tk_enum - SIMPLE, // tk_string - COMPLEX, // tk_sequence - COMPLEX, // tk_array - COMPLEX, // tk_alias - COMPLEX, // tk_except - EMPTY, // tk_longlong - EMPTY, // tk_ulonglong - EMPTY, // tk_longdouble - EMPTY, // tk_wchar - SIMPLE, // tk_wstring - SIMPLE, // tk_fixed - COMPLEX, // tk_value - COMPLEX, // tk_value_box - COMPLEX, // tk_native - COMPLEX // tk_abstract_interface - }; - - // Maps TCKind values to names - // This is also used in AnyImpl. - static final String[] kindNames = { - "null", - "void", - "short", - "long", - "ushort", - "ulong", - "float", - "double", - "boolean", - "char", - "octet", - "any", - "typecode", - "principal", - "objref", - "struct", - "union", - "enum", - "string", - "sequence", - "array", - "alias", - "exception", - "longlong", - "ulonglong", - "longdouble", - "wchar", - "wstring", - "fixed", - "value", - "valueBox", - "native", - "abstractInterface" - }; - - private int _kind = 0; // the typecode kind - - // data members for representing the various kinds of typecodes. - private String _id = ""; // the typecode repository id - private String _name = ""; // the typecode name - private int _memberCount = 0; // member count - private String _memberNames[] = null; // names of members - private TypeCodeImpl _memberTypes[] = null; // types of members - private AnyImpl _unionLabels[] = null; // values of union labels - private TypeCodeImpl _discriminator = null; // union discriminator type - private int _defaultIndex = -1; // union default index - private int _length = 0; // string/seq/array length - private TypeCodeImpl _contentType = null; // seq/array/alias type - // fixed - private short _digits = 0; - private short _scale = 0; - // value type - // _REVISIT_ We might want to keep references to the ValueMember classes - // passed in at initialization instead of copying the relevant data. - // Is the data immutable? What about StructMember, UnionMember etc.? - private short _type_modifier = -1; // VM_NONE, VM_CUSTOM, - // VM_ABSTRACT, VM_TRUNCATABLE - private TypeCodeImpl _concrete_base = null; // concrete base type - private short _memberAccess[] = null; // visibility of ValueMember - // recursive sequence support - private TypeCodeImpl _parent = null; // the enclosing type code - private int _parentOffset = 0; // the level of enclosure - // recursive type code support - private TypeCodeImpl _indirectType = null; - - // caches the byte buffer written in write_value for quick remarshaling... - private byte[] outBuffer = null; - // ... but only if caching is enabled - private boolean cachingEnabled = false; - - // the ORB instance: may be instanceof ORBSingleton or ORB - private ORB _orb; - private ORBUtilSystemException wrapper ; - - /////////////////////////////////////////////////////////////////////////// - // Constructors... - - public TypeCodeImpl(ORB orb) - { - // initialized to tk_null - _orb = orb; - wrapper = ORBUtilSystemException.get( - (com.sun.corba.se.spi.orb.ORB)orb, CORBALogDomains.RPC_PRESENTATION ) ; - } - - public TypeCodeImpl(ORB orb, TypeCode tc) - // to handle conversion of "remote" typecodes into "native" style. - // also see the 'convertToNative(ORB orb, TypeCode tc)' function - { - this(orb) ; - - // This is a protection against misuse of this constructor. - // Should only be used if tc is not an instance of this class! - // Otherwise we run into problems with recursive/indirect type codes. - // _REVISIT_ We should make this constructor private - if (tc instanceof TypeCodeImpl) { - TypeCodeImpl tci = (TypeCodeImpl)tc; - if (tci._kind == tk_indirect) - throw wrapper.badRemoteTypecode() ; - if (tci._kind == TCKind._tk_sequence && tci._contentType == null) - throw wrapper.badRemoteTypecode() ; - } - - // set up kind - _kind = tc.kind().value(); - - try { - // set up parameters - switch (_kind) { - case TCKind._tk_value: - _type_modifier = tc.type_modifier(); - // concrete base may be null - TypeCode tccb = tc.concrete_base_type(); - if (tccb != null) { - _concrete_base = convertToNative(_orb, tccb); - } else { - _concrete_base = null; - } - //_memberAccess = tc._memberAccess; - // Need to reconstruct _memberAccess using member_count() and member_visibility() - _memberAccess = new short[tc.member_count()]; - for (int i=0; i < tc.member_count(); i++) { - _memberAccess[i] = tc.member_visibility(i); - } - case TCKind._tk_except: - case TCKind._tk_struct: - case TCKind._tk_union: - // set up member types - _memberTypes = new TypeCodeImpl[tc.member_count()]; - for (int i=0; i < tc.member_count(); i++) { - _memberTypes[i] = convertToNative(_orb, tc.member_type(i)); - _memberTypes[i].setParent(this); - } - case TCKind._tk_enum: - // set up member names - _memberNames = new String[tc.member_count()]; - for (int i=0; i < tc.member_count(); i++) { - _memberNames[i] = tc.member_name(i); - } - // set up member count - _memberCount = tc.member_count(); - case TCKind._tk_objref: - case TCKind._tk_alias: - case TCKind._tk_value_box: - case TCKind._tk_native: - case TCKind._tk_abstract_interface: - setId(tc.id()); - _name = tc.name(); - break; - } - - // set up stuff for unions - switch (_kind) { - case TCKind._tk_union: - _discriminator = convertToNative(_orb, tc.discriminator_type()); - _defaultIndex = tc.default_index(); - _unionLabels = new AnyImpl[_memberCount]; - for (int i=0; i < _memberCount; i++) - _unionLabels[i] = new AnyImpl(_orb, tc.member_label(i)); - break; - } - - // set up length - switch (_kind) { - case TCKind._tk_string: - case TCKind._tk_wstring: - case TCKind._tk_sequence: - case TCKind._tk_array: - _length = tc.length(); - } - - // set up content type - switch (_kind) { - case TCKind._tk_sequence: - case TCKind._tk_array: - case TCKind._tk_alias: - case TCKind._tk_value_box: - _contentType = convertToNative(_orb, tc.content_type()); - } - } catch (org.omg.CORBA.TypeCodePackage.Bounds e) {} catch (BadKind e) {} - // dont have to worry about these since code ensures we dont step - // out of bounds. - } - - public TypeCodeImpl(ORB orb, int creationKind) - // for primitive types - { - this(orb); - - // private API. dont bother checking that - // (creationKind < 0 || creationKind > typeTable.length) - - _kind = creationKind; - - // do initialization for special cases - switch (_kind) { - case TCKind._tk_objref: - { - // this is being used to create typecode for CORBA::Object - setId("IDL:omg.org/CORBA/Object:1.0"); - _name = "Object"; - break; - } - - case TCKind._tk_string: - case TCKind._tk_wstring: - { - _length =0; - break; - } - - case TCKind._tk_value: - { - _concrete_base = null; - break; - } - } - } - - public TypeCodeImpl(ORB orb, - int creationKind, - String id, - String name, - StructMember[] members) - // for structs and exceptions - { - this(orb); - - if ((creationKind == TCKind._tk_struct) || (creationKind == TCKind._tk_except)) { - _kind = creationKind; - setId(id); - _name = name; - _memberCount = members.length; - - _memberNames = new String[_memberCount]; - _memberTypes = new TypeCodeImpl[_memberCount]; - - for (int i = 0 ; i < _memberCount ; i++) { - _memberNames[i] = members[i].name; - _memberTypes[i] = convertToNative(_orb, members[i].type); - _memberTypes[i].setParent(this); - } - } // else initializes to null - } - - public TypeCodeImpl(ORB orb, - int creationKind, - String id, - String name, - TypeCode discriminator_type, - UnionMember[] members) - // for unions - { - this(orb) ; - - if (creationKind == TCKind._tk_union) { - _kind = creationKind; - setId(id); - _name = name; - _memberCount = members.length; - _discriminator = convertToNative(_orb, discriminator_type); - - _memberNames = new String[_memberCount]; - _memberTypes = new TypeCodeImpl[_memberCount]; - _unionLabels = new AnyImpl[_memberCount]; - - for (int i = 0 ; i < _memberCount ; i++) { - _memberNames[i] = members[i].name; - _memberTypes[i] = convertToNative(_orb, members[i].type); - _memberTypes[i].setParent(this); - _unionLabels[i] = new AnyImpl(_orb, members[i].label); - // check whether this is the default branch. - if (_unionLabels[i].type().kind() == TCKind.tk_octet) { - if (_unionLabels[i].extract_octet() == (byte)0) { - _defaultIndex = i; - } - } - } - } // else initializes to null - } - - public TypeCodeImpl(ORB orb, - int creationKind, - String id, - String name, - short type_modifier, - TypeCode concrete_base, - ValueMember[] members) - // for value types - { - this(orb) ; - - if (creationKind == TCKind._tk_value) { - _kind = creationKind; - setId(id); - _name = name; - _type_modifier = type_modifier; - if (concrete_base != null) { - _concrete_base = convertToNative(_orb, concrete_base); - } - _memberCount = members.length; - - _memberNames = new String[_memberCount]; - _memberTypes = new TypeCodeImpl[_memberCount]; - _memberAccess = new short[_memberCount]; - - for (int i = 0 ; i < _memberCount ; i++) { - _memberNames[i] = members[i].name; - _memberTypes[i] = convertToNative(_orb, members[i].type); - _memberTypes[i].setParent(this); - _memberAccess[i] = members[i].access; - } - } // else initializes to null - } - - - public TypeCodeImpl(ORB orb, - int creationKind, - String id, - String name, - String[] members) - // for enums - { - this(orb) ; - - if (creationKind == TCKind._tk_enum) - { - _kind = creationKind; - setId(id); - _name = name; - _memberCount = members.length; - - _memberNames = new String[_memberCount]; - - for (int i = 0 ; i < _memberCount ; i++) - _memberNames[i] = members[i]; - } // else initializes to null - } - - public TypeCodeImpl(ORB orb, - int creationKind, - String id, - String name, - TypeCode original_type) - // for aliases and value boxes - { - this(orb) ; - - if ( creationKind == TCKind._tk_alias || creationKind == TCKind._tk_value_box ) - { - _kind = creationKind; - setId(id); - _name = name; - _contentType = convertToNative(_orb, original_type); - } - // else initializes to null - - } - - public TypeCodeImpl(ORB orb, - int creationKind, - String id, - String name) - { - this(orb) ; - - if (creationKind == TCKind._tk_objref || - creationKind == TCKind._tk_native || - creationKind == TCKind._tk_abstract_interface) - { - _kind = creationKind; - setId(id); - _name = name; - } // else initializes to null - } - - - public TypeCodeImpl(ORB orb, - int creationKind, - int bound) - // for strings - { - this(orb) ; - - if (bound < 0) - throw wrapper.negativeBounds() ; - - if ((creationKind == TCKind._tk_string) || (creationKind == TCKind._tk_wstring)) { - _kind = creationKind; - _length = bound; - } // else initializes to null - } - - public TypeCodeImpl(ORB orb, - int creationKind, - int bound, - TypeCode element_type) - // for sequences and arrays - { - this(orb) ; - - if ( creationKind == TCKind._tk_sequence || creationKind == TCKind._tk_array ) { - _kind = creationKind; - _length = bound; - _contentType = convertToNative(_orb, element_type); - } // else initializes to null - } - - public TypeCodeImpl(ORB orb, - int creationKind, - int bound, - int offset) - // for recursive sequences - { - this(orb) ; - - if (creationKind == TCKind._tk_sequence) { - _kind = creationKind; - _length = bound; - _parentOffset = offset; - } // else initializes to null - } - - public TypeCodeImpl(ORB orb, - String id) - // for recursive type codes - { - this(orb) ; - - _kind = tk_indirect; - // This is the type code of the type we stand in for, not our own. - _id = id; - // Try to resolve it now. May return null in which case - // we try again later (see indirectType()). - tryIndirectType(); - } - - public TypeCodeImpl(ORB orb, - int creationKind, - short digits, - short scale) - // for fixed - { - this(orb) ; - - //if (digits < 1 || digits > 31) - //throw new BAD_TYPECODE(); - - if (creationKind == TCKind._tk_fixed) { - _kind = creationKind; - _digits = digits; - _scale = scale; - } // else initializes to null - } - - /////////////////////////////////////////////////////////////////////////// - // Other creation functions... - - // Optimization: - // If we checked for and returned constant primitive typecodes - // here we could reduce object creation and also enable more - // efficient typecode comparisons for primitive typecodes. - // - protected static TypeCodeImpl convertToNative(ORB orb, - TypeCode tc) - { - if (tc instanceof TypeCodeImpl) - return (TypeCodeImpl) tc; - else - return new TypeCodeImpl(orb, tc); - } - - public static CDROutputStream newOutputStream(ORB orb) { - TypeCodeOutputStream tcos = - sun.corba.OutputStreamFactory.newTypeCodeOutputStream(orb); - //if (debug) System.out.println("Created TypeCodeOutputStream " + tcos + - // " with no parent"); - return tcos; - } - - // Support for indirect/recursive type codes - - private TypeCodeImpl indirectType() { - _indirectType = tryIndirectType(); - if (_indirectType == null) { - // Nothing we can do about that. - throw wrapper.unresolvedRecursiveTypecode() ; - } - return _indirectType; - } - - private TypeCodeImpl tryIndirectType() { - // Assert that _kind == tk_indirect - if (_indirectType != null) - return _indirectType; - - setIndirectType(_orb.getTypeCode(_id)); - - return _indirectType; - } - - private void setIndirectType(TypeCodeImpl newType) { - _indirectType = newType; - if (_indirectType != null) { - try { - _id = _indirectType.id(); - } catch (BadKind e) { - // can't happen - throw wrapper.badkindCannotOccur() ; - } - } - } - - private void setId(String newID) { - _id = newID; - if (_orb instanceof TypeCodeFactory) { - ((TypeCodeFactory)_orb).setTypeCode(_id, this); - } - // check whether return value != this which would indicate that the - // repository id isn't unique. - } - - private void setParent(TypeCodeImpl parent) { - _parent = parent; - } - - private TypeCodeImpl getParentAtLevel(int level) { - if (level == 0) - return this; - - if (_parent == null) - throw wrapper.unresolvedRecursiveTypecode() ; - - return _parent.getParentAtLevel(level - 1); - } - - private TypeCodeImpl lazy_content_type() { - if (_contentType == null) { - if (_kind == TCKind._tk_sequence && _parentOffset > 0 && _parent != null) { - // This is an unresolved recursive sequence tc. - // Try to resolve it now if the hierarchy is complete. - TypeCodeImpl realParent = getParentAtLevel(_parentOffset); - if (realParent != null && realParent._id != null) { - // Create a recursive type code object as the content type. - // This is when the recursive sequence typecode morphes - // into a sequence typecode containing a recursive typecode. - _contentType = new TypeCodeImpl((ORB)_orb, realParent._id); - } - } - } - return _contentType; - } - - // Other private functions - - private TypeCode realType(TypeCode aType) { - TypeCode realType = aType; - try { - // Note: Indirect types are handled in kind() method - while (realType.kind().value() == TCKind._tk_alias) { - realType = realType.content_type(); - } - } catch (BadKind bad) { - // impossible - throw wrapper.badkindCannotOccur() ; - } - return realType; - } - - /////////////////////////////////////////////////////////////////////////// - // TypeCode operations - - public final boolean equal(TypeCode tc) - // _REVISIT_ for all optional names/ids, we might want to check that - // they are equal in case both are non-nil. - { - if (tc == this) - return true; - - try { - - if (_kind == tk_indirect) { - //return indirectType().equal(tc); - if (_id != null && tc.id() != null) - return _id.equals(tc.id()); - return (_id == null && tc.id() == null); - } - - // make sure kinds are identical. - if (_kind != tc.kind().value()) { - return false; - } - - switch (typeTable[_kind]) { - case EMPTY: - // no parameters to check. - return true; - - case SIMPLE: - switch (_kind) { - case TCKind._tk_string: - case TCKind._tk_wstring: - // check for bound. - return (_length == tc.length()); - - case TCKind._tk_fixed: - return (_digits == tc.fixed_digits() && _scale == tc.fixed_scale()); - default: - return false; - } - - case COMPLEX: - - switch(_kind) { - - case TCKind._tk_objref: - { - // check for logical id. - if (_id.compareTo(tc.id()) == 0) { - return true; - } - - if (_id.compareTo( - (_orb.get_primitive_tc(_kind)).id()) == 0) - { - return true; - } - - if (tc.id().compareTo( - (_orb.get_primitive_tc(_kind)).id()) == 0) - { - return true; - } - - return false; - } - - case TCKind._tk_native: - case TCKind._tk_abstract_interface: - { - // check for logical id. - if (_id.compareTo(tc.id()) != 0) { - return false; - - } - // ignore name since its optional. - return true; - } - - case TCKind._tk_struct: - case TCKind._tk_except: - { - // check for member count - if (_memberCount != tc.member_count()) - return false; - // check for repository id - if (_id.compareTo(tc.id()) != 0) - return false; - // check for member types. - for (int i = 0 ; i < _memberCount ; i++) - if (! _memberTypes[i].equal(tc.member_type(i))) - return false; - // ignore id and names since those are optional. - return true; - } - - case TCKind._tk_union: - { - // check for member count - if (_memberCount != tc.member_count()) - return false; - // check for repository id - if (_id.compareTo(tc.id()) != 0) - return false; - // check for default index - if (_defaultIndex != tc.default_index()) - return false; - // check for discriminator type - if (!_discriminator.equal(tc.discriminator_type())) - return false; - // check for label types and values - for (int i = 0 ; i < _memberCount ; i++) - if (! _unionLabels[i].equal(tc.member_label(i))) - return false; - // check for branch types - for (int i = 0 ; i < _memberCount ; i++) - if (! _memberTypes[i].equal(tc.member_type(i))) - return false; - // ignore id and names since those are optional. - return true; - } - - case TCKind._tk_enum: - { - // check for repository id - if (_id.compareTo(tc.id()) != 0) - return false; - // check member count - if (_memberCount != tc.member_count()) - return false; - // ignore names since those are optional. - return true; - } - - case TCKind._tk_sequence: - case TCKind._tk_array: - { - // check bound/length - if (_length != tc.length()) { - return false; - } - // check content type - if (! lazy_content_type().equal(tc.content_type())) { - return false; - } - // ignore id and name since those are optional. - return true; - } - - case TCKind._tk_value: - { - // check for member count - if (_memberCount != tc.member_count()) - return false; - // check for repository id - if (_id.compareTo(tc.id()) != 0) - return false; - // check for member types. - for (int i = 0 ; i < _memberCount ; i++) - if (_memberAccess[i] != tc.member_visibility(i) || - ! _memberTypes[i].equal(tc.member_type(i))) - return false; - if (_type_modifier == tc.type_modifier()) - return false; - // concrete_base may be null - TypeCode tccb = tc.concrete_base_type(); - if ((_concrete_base == null && tccb != null) || - (_concrete_base != null && tccb == null) || - ! _concrete_base.equal(tccb)) - { - return false; - } - // ignore id and names since those are optional. - return true; - } - - case TCKind._tk_alias: - case TCKind._tk_value_box: - { - // check for repository id - if (_id.compareTo(tc.id()) != 0) { - return false; - } - // check for equality with the true type - return _contentType.equal(tc.content_type()); - } - } - } - } catch (org.omg.CORBA.TypeCodePackage.Bounds e) {} catch (BadKind e) {} - // dont have to worry about these since the code ensures these dont - // arise. - return false; - } - - /** - * The equivalent operation is used by the ORB when determining type equivalence - * for values stored in an IDL any. - */ - public boolean equivalent(TypeCode tc) { - if (tc == this) { - return true; - } - - // If the result of the kind operation on either TypeCode is tk_alias, recursively - // replace the TypeCode with the result of calling content_type, until the kind - // is no longer tk_alias. - // Note: Always resolve indirect types first! - TypeCode myRealType = (_kind == tk_indirect ? indirectType() : this); - myRealType = realType(myRealType); - TypeCode otherRealType = realType(tc); - - // If results of the kind operation on each typecode differ, - // equivalent returns false. - if (myRealType.kind().value() != otherRealType.kind().value()) { - return false; - } - - String myID = null; - String otherID = null; - try { - myID = this.id(); - otherID = tc.id(); - // At this point the id operation is valid for both TypeCodes. - - // Return true if the results of id for both TypeCodes are non-empty strings - // and both strings are equal. - // If both ids are non-empty but are not equal, then equivalent returns FALSE. - if (myID != null && otherID != null) { - return (myID.equals(otherID)); - } - } catch (BadKind e) { - // id operation is not valid for either or both TypeCodes - } - - // If either or both id is an empty string, or the TypeCode kind does not support - // the id operation, perform a structural comparison of the TypeCodes. - - int myKind = myRealType.kind().value(); - try { - if (myKind == TCKind._tk_struct || - myKind == TCKind._tk_union || - myKind == TCKind._tk_enum || - myKind == TCKind._tk_except || - myKind == TCKind._tk_value) - { - if (myRealType.member_count() != otherRealType.member_count()) - return false; - } - if (myKind == TCKind._tk_union) - { - if (myRealType.default_index() != otherRealType.default_index()) - return false; - } - if (myKind == TCKind._tk_string || - myKind == TCKind._tk_wstring || - myKind == TCKind._tk_sequence || - myKind == TCKind._tk_array) - { - if (myRealType.length() != otherRealType.length()) - return false; - } - if (myKind == TCKind._tk_fixed) - { - if (myRealType.fixed_digits() != otherRealType.fixed_digits() || - myRealType.fixed_scale() != otherRealType.fixed_scale()) - return false; - } - if (myKind == TCKind._tk_union) - { - for (int i=0; i typeTable.length) && _kind != tk_indirect) { - throw wrapper.cannotMarshalBadTckind() ; - } - - // Don't do any work if this is native - if (_kind == TCKind._tk_native) - throw wrapper.cannotMarshalNative() ; - - // We have to remember the stream and position for EVERY type code - // in case some recursive or indirect type code references it. - TypeCodeReader topStream = tcis.getTopLevelStream(); - - if (_kind == tk_indirect) { - int streamOffset = tcis.read_long(); - if (streamOffset > -4) - throw wrapper.invalidIndirection( new Integer(streamOffset) ) ; - - // The encoding used for indirection is the same as that used for recursive , - // TypeCodes i.e., a 0xffffffff indirection marker followed by a long offset - // (in units of octets) from the beginning of the long offset. - int topPos = tcis.getTopLevelPosition(); - // substract 4 to get back to the beginning of the long offset. - int indirectTypePosition = topPos - 4 + streamOffset; - - // Now we have to find the referenced type - // by its indirectTypePosition within topStream. - //if (debug) System.out.println( - // "TypeCodeImpl looking up indirection at position topPos " + - //topPos + " - 4 + offset " + streamOffset + " = " + indirectTypePosition); - TypeCodeImpl type = topStream.getTypeCodeAtPosition(indirectTypePosition); - if (type == null) - throw wrapper.indirectionNotFound( new Integer(indirectTypePosition) ) ; - setIndirectType(type); - return false; - } - - topStream.addTypeCodeAtPosition(this, myPosition); - return true; - } - - void read_value_kind(InputStream is) { - // unmarshal the kind - _kind = is.read_long(); - - // check validity of kind - if ((_kind < 0 || _kind > typeTable.length) && _kind != tk_indirect) { - throw wrapper.cannotMarshalBadTckind() ; - } - // Don't do any work if this is native - if (_kind == TCKind._tk_native) - throw wrapper.cannotMarshalNative() ; - - if (_kind == tk_indirect) { - throw wrapper.recursiveTypecodeError() ; - } - } - - void read_value_body(InputStream is) { - // start unmarshaling the rest of the typecode, based on the - // encoding (empty, simple or complex). - - switch (typeTable[_kind]) { - case EMPTY: - // nothing to unmarshal - break; - - case SIMPLE: - switch (_kind) { - case TCKind._tk_string: - case TCKind._tk_wstring: - _length = is.read_long(); - break; - case TCKind._tk_fixed: - _digits = is.read_ushort(); - _scale = is.read_short(); - break; - default: - throw wrapper.invalidSimpleTypecode() ; - } - break; - - case COMPLEX: - { - TypeCodeInputStream _encap = TypeCodeInputStream.readEncapsulation(is, - is.orb()); - - switch(_kind) { - - case TCKind._tk_objref: - case TCKind._tk_abstract_interface: - { - // get the repository id - setId(_encap.read_string()); - // get the name - _name = _encap.read_string(); - } - break; - - case TCKind._tk_union: - { - // get the repository id - setId(_encap.read_string()); - - // get the name - _name = _encap.read_string(); - - // discriminant typecode - _discriminator = new TypeCodeImpl((ORB)is.orb()); - _discriminator.read_value_recursive(_encap); - - // default index - _defaultIndex = _encap.read_long(); - - // get the number of members - _memberCount = _encap.read_long(); - - // create arrays for the label values, names and types of members - _unionLabels = new AnyImpl[_memberCount]; - _memberNames = new String[_memberCount]; - _memberTypes = new TypeCodeImpl[_memberCount]; - - // read off label values, names and types - for (int i=0; i < _memberCount; i++) { - _unionLabels[i] = new AnyImpl((ORB)is.orb()); - if (i == _defaultIndex) - // for the default case, read off the zero octet - _unionLabels[i].insert_octet(_encap.read_octet()); - else { - switch (realType(_discriminator).kind().value()) { - case TCKind._tk_short: - _unionLabels[i].insert_short(_encap.read_short()); - break; - case TCKind._tk_long: - _unionLabels[i].insert_long(_encap.read_long()); - break; - case TCKind._tk_ushort: - _unionLabels[i].insert_ushort(_encap.read_short()); - break; - case TCKind._tk_ulong: - _unionLabels[i].insert_ulong(_encap.read_long()); - break; - case TCKind._tk_float: - _unionLabels[i].insert_float(_encap.read_float()); - break; - case TCKind._tk_double: - _unionLabels[i].insert_double(_encap.read_double()); - break; - case TCKind._tk_boolean: - _unionLabels[i].insert_boolean(_encap.read_boolean()); - break; - case TCKind._tk_char: - _unionLabels[i].insert_char(_encap.read_char()); - break; - case TCKind._tk_enum: - _unionLabels[i].type(_discriminator); - _unionLabels[i].insert_long(_encap.read_long()); - break; - case TCKind._tk_longlong: - _unionLabels[i].insert_longlong(_encap.read_longlong()); - break; - case TCKind._tk_ulonglong: - _unionLabels[i].insert_ulonglong(_encap.read_longlong()); - break; - // _REVISIT_ figure out long double mapping - // case TCKind.tk_longdouble: - // _unionLabels[i].insert_longdouble(_encap.getDouble()); - // break; - case TCKind._tk_wchar: - _unionLabels[i].insert_wchar(_encap.read_wchar()); - break; - default: - throw wrapper.invalidComplexTypecode() ; - } - } - _memberNames[i] = _encap.read_string(); - _memberTypes[i] = new TypeCodeImpl((ORB)is.orb()); - _memberTypes[i].read_value_recursive(_encap); - _memberTypes[i].setParent(this); - } - } - break; - - case TCKind._tk_enum: - { - // get the repository id - setId(_encap.read_string()); - - // get the name - _name = _encap.read_string(); - - // get the number of members - _memberCount = _encap.read_long(); - - // create arrays for the identifier names - _memberNames = new String[_memberCount]; - - // read off identifier names - for (int i=0; i < _memberCount; i++) - _memberNames[i] = _encap.read_string(); - } - break; - - case TCKind._tk_sequence: - { - // get the type of the sequence - _contentType = new TypeCodeImpl((ORB)is.orb()); - _contentType.read_value_recursive(_encap); - - // get the bound on the length of the sequence - _length = _encap.read_long(); - } - break; - - case TCKind._tk_array: - { - // get the type of the array - _contentType = new TypeCodeImpl((ORB)is.orb()); - _contentType.read_value_recursive(_encap); - - // get the length of the array - _length = _encap.read_long(); - } - break; - - case TCKind._tk_alias: - case TCKind._tk_value_box: - { - // get the repository id - setId(_encap.read_string()); - - // get the name - _name = _encap.read_string(); - - // get the type aliased - _contentType = new TypeCodeImpl((ORB)is.orb()); - _contentType.read_value_recursive(_encap); - } - break; - - case TCKind._tk_except: - case TCKind._tk_struct: - { - // get the repository id - setId(_encap.read_string()); - - // get the name - _name = _encap.read_string(); - - // get the number of members - _memberCount = _encap.read_long(); - - // create arrays for the names and types of members - _memberNames = new String[_memberCount]; - _memberTypes = new TypeCodeImpl[_memberCount]; - - // read off member names and types - for (int i=0; i < _memberCount; i++) { - _memberNames[i] = _encap.read_string(); - _memberTypes[i] = new TypeCodeImpl((ORB)is.orb()); - //if (debug) System.out.println("TypeCode " + _name + - // " reading member " + _memberNames[i]); - _memberTypes[i].read_value_recursive(_encap); - _memberTypes[i].setParent(this); - } - } - break; - - case TCKind._tk_value: - { - // get the repository id - setId(_encap.read_string()); - - // get the name - _name = _encap.read_string(); - - // get the type modifier - _type_modifier = _encap.read_short(); - - // get the type aliased - _concrete_base = new TypeCodeImpl((ORB)is.orb()); - _concrete_base.read_value_recursive(_encap); - if (_concrete_base.kind().value() == TCKind._tk_null) { - _concrete_base = null; - } - - // get the number of members - _memberCount = _encap.read_long(); - - // create arrays for the names, types and visibility of members - _memberNames = new String[_memberCount]; - _memberTypes = new TypeCodeImpl[_memberCount]; - _memberAccess = new short[_memberCount]; - - // read off value member visibilities - for (int i=0; i < _memberCount; i++) { - _memberNames[i] = _encap.read_string(); - _memberTypes[i] = new TypeCodeImpl((ORB)is.orb()); - //if (debug) System.out.println("TypeCode " + _name + - // " reading member " + _memberNames[i]); - _memberTypes[i].read_value_recursive(_encap); - _memberTypes[i].setParent(this); - _memberAccess[i] = _encap.read_short(); - } - } - break; - - default: - throw wrapper.invalidTypecodeKindMarshal() ; - } - break; - } - } - } - - public void write_value(OutputStream os) { - // Wrap OutputStream into TypeCodeOutputStream. - // This test shouldn't be necessary according to the Java language spec. - if (os instanceof TypeCodeOutputStream) { - this.write_value((TypeCodeOutputStream)os); - } else { - TypeCodeOutputStream wrapperOutStream = null; - - if (outBuffer == null) { - wrapperOutStream = TypeCodeOutputStream.wrapOutputStream(os); - this.write_value(wrapperOutStream); - if (cachingEnabled) { - // Cache the buffer for repeated writes - outBuffer = wrapperOutStream.getTypeCodeBuffer(); - //if (outBuffer != null) - //System.out.println("Caching outBuffer with length = " + - //outBuffer.length + " for id = " + _id); - } - } else { - //System.out.println("Using cached outBuffer: length = " + outBuffer.length + - //", id = " + _id); - } - // Write the first 4 bytes first to trigger alignment. - // We know that it is the kind. - if (cachingEnabled && outBuffer != null) { - os.write_long(_kind); - os.write_octet_array(outBuffer, 0, outBuffer.length); - } else { - //System.out.println("Buffer is empty for " + _id); - wrapperOutStream.writeRawBuffer(os, _kind); - } - } - } - - public void write_value(TypeCodeOutputStream tcos) { - - // Don't do any work if this is native - if (_kind == TCKind._tk_native) - throw wrapper.cannotMarshalNative() ; - - TypeCodeOutputStream topStream = tcos.getTopLevelStream(); - //if (debug) tcos.printBuffer(); - - if (_kind == tk_indirect) { - //if (debug) System.out.println("Writing indirection " + _name + "to " + _id); - // The encoding used for indirection is the same as that used for recursive , - // TypeCodes i.e., a 0xffffffff indirection marker followed by a long offset - // (in units of octets) from the beginning of the long offset. - int pos = topStream.getPositionForID(_id); - int topPos = tcos.getTopLevelPosition(); - //if (debug) System.out.println("TypeCodeImpl " + tcos + - // " writing indirection " + _id + - //" to position " + pos + " at position " + topPos); - tcos.writeIndirection(tk_indirect, pos); - // All that gets written is _kind and offset. - return; - } - - // The original approach changed for 5034649 - // topStream.addIDAtPosition(_id, tcos.getTopLevelPosition()); - - // marshal the kind - tcos.write_long(_kind); - - //if (debug) System.out.println("Writing " + _name + " with id " + _id); - // We have to remember the stream and position for EVERY type code - // in case some recursive or indirect type code references it. - // - // Bug fix 5034649: - // Do this AFTER the write of the _kind in case the alignment - // for the long changes the position. - topStream.addIDAtPosition(_id, tcos.getTopLevelPosition()-4); - - switch (typeTable[_kind]) { - case EMPTY: - // nothing more to marshal - break; - - case SIMPLE: - switch (_kind) { - case TCKind._tk_string: - case TCKind._tk_wstring: - // marshal the bound on string length - tcos.write_long(_length); - break; - case TCKind._tk_fixed: - tcos.write_ushort(_digits); - tcos.write_short(_scale); - break; - default: - // unknown typecode kind - throw wrapper.invalidSimpleTypecode() ; - } - break; - - case COMPLEX: - { - // create an encapsulation - TypeCodeOutputStream _encap = tcos.createEncapsulation(tcos.orb()); - - switch(_kind) { - - case TCKind._tk_objref: - case TCKind._tk_abstract_interface: - { - // put the repository id - _encap.write_string(_id); - - // put the name - _encap.write_string(_name); - } - break; - - case TCKind._tk_union: - { - // put the repository id - _encap.write_string(_id); - - // put the name - _encap.write_string(_name); - - // discriminant typecode - _discriminator.write_value(_encap); - - // default index - _encap.write_long(_defaultIndex); - - // put the number of members - _encap.write_long(_memberCount); - - // marshal label values, names and types - for (int i=0; i < _memberCount; i++) { - - // for the default case, marshal the zero octet - if (i == _defaultIndex) - _encap.write_octet(_unionLabels[i].extract_octet()); - - else { - switch (realType(_discriminator).kind().value()) { - case TCKind._tk_short: - _encap.write_short(_unionLabels[i].extract_short()); - break; - case TCKind._tk_long: - _encap.write_long(_unionLabels[i].extract_long()); - break; - case TCKind._tk_ushort: - _encap.write_short(_unionLabels[i].extract_ushort()); - break; - case TCKind._tk_ulong: - _encap.write_long(_unionLabels[i].extract_ulong()); - break; - case TCKind._tk_float: - _encap.write_float(_unionLabels[i].extract_float()); - break; - case TCKind._tk_double: - _encap.write_double(_unionLabels[i].extract_double()); - break; - case TCKind._tk_boolean: - _encap.write_boolean(_unionLabels[i].extract_boolean()); - break; - case TCKind._tk_char: - _encap.write_char(_unionLabels[i].extract_char()); - break; - case TCKind._tk_enum: - _encap.write_long(_unionLabels[i].extract_long()); - break; - case TCKind._tk_longlong: - _encap.write_longlong(_unionLabels[i].extract_longlong()); - break; - case TCKind._tk_ulonglong: - _encap.write_longlong(_unionLabels[i].extract_ulonglong()); - break; - // _REVISIT_ figure out long double mapping - // case TCKind.tk_longdouble: - // _encap.putDouble(_unionLabels[i].extract_longdouble()); - // break; - case TCKind._tk_wchar: - _encap.write_wchar(_unionLabels[i].extract_wchar()); - break; - default: - throw wrapper.invalidComplexTypecode() ; - } - } - _encap.write_string(_memberNames[i]); - _memberTypes[i].write_value(_encap); - } - } - break; - - case TCKind._tk_enum: - { - // put the repository id - _encap.write_string(_id); - - // put the name - _encap.write_string(_name); - - // put the number of members - _encap.write_long(_memberCount); - - // marshal identifier names - for (int i=0; i < _memberCount; i++) - _encap.write_string(_memberNames[i]); - } - break; - - case TCKind._tk_sequence: - { - // put the type of the sequence - lazy_content_type().write_value(_encap); - - // put the bound on the length of the sequence - _encap.write_long(_length); - } - break; - - case TCKind._tk_array: - { - // put the type of the array - _contentType.write_value(_encap); - - // put the length of the array - _encap.write_long(_length); - } - break; - - case TCKind._tk_alias: - case TCKind._tk_value_box: - { - // put the repository id - _encap.write_string(_id); - - // put the name - _encap.write_string(_name); - - // put the type aliased - _contentType.write_value(_encap); - } - break; - - case TCKind._tk_struct: - case TCKind._tk_except: - { - // put the repository id - _encap.write_string(_id); - - // put the name - _encap.write_string(_name); - - // put the number of members - _encap.write_long(_memberCount); - - // marshal member names and types - for (int i=0; i < _memberCount; i++) { - _encap.write_string(_memberNames[i]); - //if (debug) System.out.println("TypeCode " + _name + - // " writing member " + _memberNames[i]); - _memberTypes[i].write_value(_encap); - } - } - break; - - case TCKind._tk_value: - { - // put the repository id - _encap.write_string(_id); - - // put the name - _encap.write_string(_name); - - // put the type modifier - _encap.write_short(_type_modifier); - - // put the type aliased - if (_concrete_base == null) { - _orb.get_primitive_tc(TCKind._tk_null).write_value(_encap); - } else { - _concrete_base.write_value(_encap); - } - - // put the number of members - _encap.write_long(_memberCount); - - // marshal member names and types - for (int i=0; i < _memberCount; i++) { - _encap.write_string(_memberNames[i]); - //if (debug) System.out.println("TypeCode " + _name + - // " writing member " + _memberNames[i]); - _memberTypes[i].write_value(_encap); - _encap.write_short(_memberAccess[i]); - } - } - break; - - default: - throw wrapper.invalidTypecodeKindMarshal() ; - } - - // marshal the encapsulation - _encap.writeOctetSequenceTo(tcos); - break; - } - } - } - - /** - * This is not a copy of the TypeCodeImpl objects, but instead it - * copies the value this type code is representing. - * See AnyImpl read_value and write_value for usage. - * The state of this TypeCodeImpl instance isn't changed, only used - * by the Any to do the correct copy. - */ - protected void copy(org.omg.CORBA.portable.InputStream src, - org.omg.CORBA.portable.OutputStream dst) - { - switch (_kind) { - - case TCKind._tk_null: - case TCKind._tk_void: - case TCKind._tk_native: - case TCKind._tk_abstract_interface: - break; - - case TCKind._tk_short: - case TCKind._tk_ushort: - dst.write_short(src.read_short()); - break; - - case TCKind._tk_long: - case TCKind._tk_ulong: - dst.write_long(src.read_long()); - break; - - case TCKind._tk_float: - dst.write_float(src.read_float()); - break; - - case TCKind._tk_double: - dst.write_double(src.read_double()); - break; - - case TCKind._tk_longlong: - case TCKind._tk_ulonglong: - dst.write_longlong(src.read_longlong()); - break; - - case TCKind._tk_longdouble: - throw wrapper.tkLongDoubleNotSupported() ; - - case TCKind._tk_boolean: - dst.write_boolean(src.read_boolean()); - break; - - case TCKind._tk_char: - dst.write_char(src.read_char()); - break; - - case TCKind._tk_wchar: - dst.write_wchar(src.read_wchar()); - break; - - case TCKind._tk_octet: - dst.write_octet(src.read_octet()); - break; - - case TCKind._tk_string: - { - String s; - s = src.read_string(); - // make sure length bound in typecode is not violated - if ((_length != 0) && (s.length() > _length)) - throw wrapper.badStringBounds( new Integer(s.length()), - new Integer(_length) ) ; - dst.write_string(s); - } - break; - - case TCKind._tk_wstring: - { - String s; - s = src.read_wstring(); - // make sure length bound in typecode is not violated - if ((_length != 0) && (s.length() > _length)) - throw wrapper.badStringBounds( new Integer(s.length()), - new Integer(_length) ) ; - dst.write_wstring(s); - } - break; - - case TCKind._tk_fixed: - { - dst.write_ushort(src.read_ushort()); - dst.write_short(src.read_short()); - } - break; - - case TCKind._tk_any: - { - //Any tmp = new AnyImpl(_orb); - Any tmp = ((CDRInputStream)src).orb().create_any(); - TypeCodeImpl t = new TypeCodeImpl((ORB)dst.orb()); - t.read_value((org.omg.CORBA_2_3.portable.InputStream)src); - t.write_value((org.omg.CORBA_2_3.portable.OutputStream)dst); - tmp.read_value(src, t); - tmp.write_value(dst); - break; - } - - case TCKind._tk_TypeCode: - { - dst.write_TypeCode(src.read_TypeCode()); - break; - } - - case TCKind._tk_Principal: - { - dst.write_Principal(src.read_Principal()); - break; - } - - case TCKind._tk_objref: - { - dst.write_Object(src.read_Object()); - break; - } - - case TCKind._tk_except: - // Copy repositoryId - dst.write_string(src.read_string()); - - // Fall into ... - // _REVISIT_ what about the inherited members of this values concrete base type? - case TCKind._tk_value: - case TCKind._tk_struct: - { - // copy each element, using the corresponding member type - for (int i=0; i < _memberTypes.length; i++) { - _memberTypes[i].copy(src, dst); - } - break; - } - case TCKind._tk_union: - /* _REVISIT_ More generic code? - { - Any discriminator = new AnyImpl(_orb); - discriminator.read_value(src, _discriminator); - discriminator.write_value(dst); - int labelIndex = currentUnionMemberIndex(discriminator); - if (labelIndex == -1) { - // check if label has not been found - if (_defaultIndex == -1) - // throw exception if default was not expected - throw new MARSHAL(); - else - // must be of the default branch type - _memberTypes[_defaultIndex].copy(src, dst); - } else { - _memberTypes[labelIndex].copy(src, dst); - } - } - */ - { - Any tagValue = new AnyImpl( (ORB)src.orb()); - - switch (realType(_discriminator).kind().value()) { - case TCKind._tk_short: - { - short value = src.read_short(); - tagValue.insert_short(value); - dst.write_short(value); - break; - } - case TCKind._tk_long: - { - int value = src.read_long(); - tagValue.insert_long(value); - dst.write_long(value); - break; - } - case TCKind._tk_ushort: - { - short value = src.read_short(); - tagValue.insert_ushort(value); - dst.write_short(value); - break; - } - case TCKind._tk_ulong: - { - int value = src.read_long(); - tagValue.insert_ulong(value); - dst.write_long(value); - break; - } - case TCKind._tk_float: - { - float value = src.read_float(); - tagValue.insert_float(value); - dst.write_float(value); - break; - } - case TCKind._tk_double: - { - double value = src.read_double(); - tagValue.insert_double(value); - dst.write_double(value); - break; - } - case TCKind._tk_boolean: - { - boolean value = src.read_boolean(); - tagValue.insert_boolean(value); - dst.write_boolean(value); - break; - } - case TCKind._tk_char: - { - char value = src.read_char(); - tagValue.insert_char(value); - dst.write_char(value); - break; - } - case TCKind._tk_enum: - { - int value = src.read_long(); - tagValue.type(_discriminator); - tagValue.insert_long(value); - dst.write_long(value); - break; - } - case TCKind._tk_longlong: - { - long value = src.read_longlong(); - tagValue.insert_longlong(value); - dst.write_longlong(value); - break; - } - case TCKind._tk_ulonglong: - { - long value = src.read_longlong(); - tagValue.insert_ulonglong(value); - dst.write_longlong(value); - break; - } - // _REVISIT_ figure out long double mapping - // case TCKind.tk_longdouble: - // { - // double value = src.read_double(); - // tagValue.insert_longdouble(value); - // dst.putDouble(value); - // break; - //} - case TCKind._tk_wchar: - { - char value = src.read_wchar(); - tagValue.insert_wchar(value); - dst.write_wchar(value); - break; - } - default: - throw wrapper.illegalUnionDiscriminatorType() ; - } - - // using the value of the tag, find out the type of the value - // following. - - int labelIndex; - for (labelIndex = 0; labelIndex < _unionLabels.length; labelIndex++) { - // use equality over anys - if (tagValue.equal(_unionLabels[labelIndex])) { - _memberTypes[labelIndex].copy(src, dst); - break; - } - } - - if (labelIndex == _unionLabels.length) { - // check if label has not been found - if (_defaultIndex != -1) - // must be of the default branch type - _memberTypes[_defaultIndex].copy(src, dst); - } - break; - } - - case TCKind._tk_enum: - dst.write_long(src.read_long()); - break; - - case TCKind._tk_sequence: - // get the length of the sequence - int seqLength = src.read_long(); - - // check for sequence bound violated - if ((_length != 0) && (seqLength > _length)) - throw wrapper.badSequenceBounds( new Integer(seqLength), - new Integer(_length) ) ; - - // write the length of the sequence - dst.write_long(seqLength); - - // copy each element of the seq using content type - lazy_content_type(); // make sure it's resolved - for (int i=0; i < seqLength; i++) - _contentType.copy(src, dst); - break; - - case TCKind._tk_array: - // copy each element of the array using content type - for (int i=0; i < _length; i++) - _contentType.copy(src, dst); - break; - - case TCKind._tk_alias: - case TCKind._tk_value_box: - // follow the alias - _contentType.copy(src, dst); - break; - - case tk_indirect: - // need to follow offset, get unmarshal typecode from that - // offset, and use that to do the copy - // Don't need to read type code before using it to do the copy. - // It should be fully usable. - indirectType().copy(src, dst); - break; - - default: - throw wrapper.invalidTypecodeKindMarshal() ; - } - } - - - static protected short digits(java.math.BigDecimal value) { - if (value == null) - return 0; - short length = (short)value.unscaledValue().toString().length(); - if (value.signum() == -1) - length--; - return length; - } - - static protected short scale(java.math.BigDecimal value) { - if (value == null) - return 0; - return (short)value.scale(); - } - - // Utility methods - - // Only for union type. Returns the index of the union member - // corresponding to the discriminator. If not found returns the - // default index or -1 if there is no default index. - int currentUnionMemberIndex(Any discriminatorValue) throws BadKind { - if (_kind != TCKind._tk_union) - throw new BadKind(); - - try { - for (int i=0; i"); - s.println(" " + _memberNames[i] + ";"); - } - s.print(indent(level) + "}"); - break; - - case TCKind._tk_union: - s.print("union " + _name + "..."); - break; - - case TCKind._tk_enum: - s.print("enum " + _name + "..."); - break; - - case TCKind._tk_string: - if (_length == 0) - s.print("unbounded string " + _name); - else - s.print("bounded string(" + _length + ") " + _name); - break; - - case TCKind._tk_sequence: - case TCKind._tk_array: - s.println(kindNames[_kind] + "[" + _length + "] " + _name + " = {"); - s.print(indent(level + 1)); - if (lazy_content_type() != null) { - lazy_content_type().printStream(s, level + 1); - } - s.println(indent(level) + "}"); - break; - - case TCKind._tk_alias: - s.print("alias " + _name + " = " + - (_contentType != null ? _contentType._name : "")); - break; - - case TCKind._tk_wstring: - s.print("wstring[" + _length + "] " + _name); - break; - - case TCKind._tk_fixed: - s.print("fixed(" + _digits + ", " + _scale + ") " + _name); - break; - - case TCKind._tk_value_box: - s.print("valueBox " + _name + "..."); - break; - - case TCKind._tk_abstract_interface: - s.print("abstractInterface " + _name + "..."); - break; - - default: - s.print(""); - break; - } - } - - private String indent(int level) { - String indent = ""; - for(int i=0; i create config data - b. parse props -> create config data -> create components - - However, long-term bean persistence can be used in either model. Separation of - concerns (and the large size of the ORB class) argues for separating data from - components. - -2. get configuration out of ORB (except for finding config class) - ORB responsibility: - - gather all property, arg data together and make it available - - load the ORB configurator and let it process the data, generate a config object - - ORB is central registry, so ORB configurator store config data in ORB - -3. Extensibility is required - - The ORB will have large subsystems that are pluggable components (examples: aobject adaptors, - transport plugins). Individual instances of these frameworks will have their own configuration - data. To solve this, the ORB class will provide (read-only perhaps?) access to the collected - properties. - - While the component config data is not needed in the ORB, it is needed in the ORB config data - so that bean persistence can be used to create an XML version of the data. - - problem: properties vs. config data: same or not? - - properties: easier to use, also necessary to indicate where to get config data if not default - config data: more powerful - -4. Basic principle: A parser performs an action A based on a value V when it matches a property P. - Actions can be: - - configObject.setP( V ) - configObject.setP( A(V) ) - A(V) - -5. ParserActions are composable - - Basic action: Object parse( String arg, String value ) - which nicely handles prefix parsing and sharing of actions across multiple keys - - interface Operation { - Object operate( String arg, String value ) - } - - interface OperationFactory { - Operation booleanAction() ; - - Operation integerAction() ; - - Operation stringAction() ; - - Operation integerRangeAction( int min, int max ) ; - - Operation listAction( char sep, Operation act ) ; - } - - interface ParserAction { - void parse( String arg, String value ) ; - } - - interface ParserActionFactory { - ParserAction setFieldAction( String fieldName ) ; - - ParserAction setFieldAction( String fieldName, Operation op ) ; - - ParserAction operationAction( Operation op ) ; - } - -6. Parsers are created incrementally: - - Constructor: - new Parser( Class configurationDataClass ) - - has the parser class available for useful defaults - - interface PropertyParser { - /** Option must look like a standard property name, which we require here to - * be ( JavaIdent "." ) * JavaIdent. The last java ident we will call the tail. - * If tail starts with "ORB", this option will be used in augmentWithArguments. - * This match operates as follows: - * Let name = tail stripped of its ORB prefix. - * (e.g. if tail = ORBLowWaterMark, name = LowWaterMark). - * Then if option is matched, a conversion to the result type of the method named - * get is performed, and set is called on the data object to set the - * result. - */ - void addMatch( String option ) ; - - void addMatch( String option, ParserAction pa ) - - void addPrefixMatch( String prefix, ParserAction pa ) - - /** First constructs a new property object that has props as its default, - * then enters args into new property object that correspond to property - * names registered in match() calls. - */ - Properties augmentWithArguments( Properties props, String[] args ) ; - - /** Parse all matched properties in props, updating data as required - * by the actions. - */ - void parse( Properties props, ORBConfigurationData data ) ; - } - -7. A useful model: - - Provide - - abstract class ConfigDataBase { - ConfigDataBase( Properties props ) - { - ... - } - } - - and then a specific class - - public class ORBConfigData extends ConfigDataBase { - ORBConfigData( Properties props ) - { - super( props ) ; - } - - private int foo1 = fooDefault ; - private String foo2 = fooDefault2 ; - private boolean foo3 = fooDefault3 ; - private SomeObject foo4 = fooDefault4 ; - - public int getFoo1() { return foo1 ; } - // and similarly - } - - The constructor then uses reflection to automatically handle all of these variables with a number of - assumptions: - a. Standard names: - private foo { = } - public getFoo() { return foo ; } - as argument: -ORBfoo - as property: com.sun.CORBA.foo (problems here) - b. type specific parsing - int: from Integer - String: no-op - boolean: true/false (from Boolean) - Class: must be able to load class - class XXX: XXX must have a public XXX( String ) constructor - - Custom parsing? - - What are valid prefixes? - 1. provide com.sun.corba.prefix.XXX where XXX defines a prefix to look for - (some security implications) - 2. Extend security model to ORB implementation (I like this approach best so far) - -8. ORB config - - public interface ORBConfigurator { - /** This method is called from ORB.init after all ORB properties have been - * collected. The corba.ORB constructor will make sure that all required - * registries are initialized and empty. This constructor will also initialize - * some data used in the corba ORB public API, such as support for deferred - * asynchronous invocation. However, all regisitration including things like - * the dyanmic any factory should take place in the configurator. This method - * is resonsible for making PI ORBInitializer calls, if PI is configured. - */ - void configure( com.sun.corba.se.impl.core.ORB orb ) ; - } - - The ORB will have a default configurator named - - com.sun.corba.se.impl.core.ORBConfiguratorImpl - - and also a property - - com.sun.CORBA.ORBConfiguratorClass - - than can be set to the name of the ORB configurator class to use. Note that this - implementation can either be a straight Java implementation, or something more - interpretive, such as an XML-based config description. - -9. We need to construct a list of all properties, and then make sure that security is respected. - The basic security check is just: - - SecurityManager sman = System.getSecurityManager() ; - if (sman != null) - sman.checkPropertyAccess( key ) - - and also - - sman.checkPropertiesAccess() - - We can construct a list of all properties as we do now, which allows the ORB - to call System.getProperties() inside a doPrivileged() block. Then we create - a subclass of java.util.Properties that overrides getProperty to - do the checkPropertyAccess( key ) call. We also need to overload the - enumerate method, either to make it illegal, call sman.checkPropertiesAccess, - or just filter it to include only the accessible properties. - And we also need to overload store, because it does not call enumerate internally. - - This allows us to provide all properties to an ORBConfigurator, while still preserving - the security model. Then anyone that needs security can set up property permissions - like com.foo.corba.* to allow access to only the properties they care about. - -10. ORB APIs - - The ORB needs registry support including: - getSubcontractRegistry - getServiceContextRegistry - - The ORB needs to provide access to a basic (and extensible) ORB configuration object, - which supports at a minimum all of the standard CORBA defined properties. - - Also need registries for: - ObjectAdapter (actually already in SubcontractRegistry, but needs extensions to - ObjectAdapterFactory to work fully) - TaggedComponentFactory - TaggedProfileFactory - - What does an empty ORB provide? - - Registration of all ORB components - - Request dispatching to object adapters - - Access to ORB properties data (as secure Properties object) - - Access to ORB arguments - - Access to ORB configuration data (base class, plus collections of base config - data for plugins such as OAs and transports) - - shutdown support (separate tracking of invocations vs. OA tracking in POA case? - How should this be designed?) - - INS support? (perhaps this could be pluggable too?) - - How does create_output_stream get plugged in? - - Can we separate the current IIOP transport into a TransportPluging? - - PI support - - CORBA::ORB API - - NVList, DII - - object <-> string (which includes INS?) - - (dis)connect API for TOA (move all impl to TOAImpl?) - - typecode/any - - FVD - - initial services registry - - value factory registry - - logging, other M&M support as needed - -ORB classes: - - core.ORB: abstract class providing internal interface - corba.ORBImpl: internal implementation of CORBA APIs - corba.ORBSingleton: the singleton ORB (not much change needed) - corba.ConfigurationDataCollector: collects all source of config data and canonicalizes it - Interceptor.PIHandler: the interface for PI - Interceptor.PIHandlerImpl: standard implementation of PIHandler - corba.ORBConfigurationData: extensible bean containing all ORB config data - -11. RequestHandler and ORB - - The RH interface is currently implemented in the ORB class, but might better be a separate - class. The API is currently almost the same as a ServerSubcontract. Should we regularize - this? Also, the API would need to be extended to handle shutdown properly. - - Extended API: - - void run(): does not return until shutdown(boolean) is called. - - shutdown(boolean) needs to be here so that requests can be - synchhronized with shutdown. This is also a point where OAs - need to be included (currently in shutdownServants) - diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/dynamicany/DynAnyBasicImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/dynamicany/DynAnyBasicImpl.java deleted file mode 100644 index 6a366cc6720..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/dynamicany/DynAnyBasicImpl.java +++ /dev/null @@ -1,636 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.dynamicany; - -import org.omg.CORBA.Any; -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.TypeCodePackage.BadKind; -import org.omg.CORBA.TCKind; - -import org.omg.DynamicAny.*; -import org.omg.DynamicAny.DynAnyPackage.TypeMismatch; -import org.omg.DynamicAny.DynAnyPackage.InvalidValue; -import org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode; - -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -public class DynAnyBasicImpl extends DynAnyImpl -{ - // - // Constructors - // - - private DynAnyBasicImpl() { - this(null, (Any)null, false); - } - - protected DynAnyBasicImpl(ORB orb, Any any, boolean copyValue) { - super(orb, any, copyValue); - // set the current position to 0 if any has components, otherwise to -1. - index = NO_INDEX; - } - - protected DynAnyBasicImpl(ORB orb, TypeCode typeCode) { - super(orb, typeCode); - // set the current position to 0 if any has components, otherwise to -1. - index = NO_INDEX; - } - - // - // DynAny interface methods - // - - public void assign (org.omg.DynamicAny.DynAny dyn_any) - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - super.assign(dyn_any); - index = NO_INDEX; - } - - public void from_any (org.omg.CORBA.Any value) - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - super.from_any(value); - index = NO_INDEX; - } - - // Spec: Returns a copy of the internal Any - public org.omg.CORBA.Any to_any() { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - return DynAnyUtil.copy(any, orb); - } - - public boolean equal (org.omg.DynamicAny.DynAny dyn_any) { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (dyn_any == this) { - return true; - } - // If the other DynAny is a constructed one we don't want it to have - // to create its Any representation just for this test. - if ( ! any.type().equal(dyn_any.type())) { - return false; - } - //System.out.println("Comparing anys"); - return any.equal(getAny(dyn_any)); - } - - public void destroy() { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (status == STATUS_DESTROYABLE) { - status = STATUS_DESTROYED; - } - } - - public org.omg.DynamicAny.DynAny copy() { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - // The flag "true" indicates copying the Any value - try { - return DynAnyUtil.createMostDerivedDynAny(any, orb, true); - } catch (InconsistentTypeCode ictc) { - return null; // impossible - } - } - - public org.omg.DynamicAny.DynAny current_component() - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch - { - return null; - } - - public int component_count() { - return 0; - } - - public boolean next() { - return false; - } - - public boolean seek(int index) { - return false; - } - - public void rewind() { - } - - public void insert_boolean(boolean value) - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_boolean) - throw new TypeMismatch(); - any.insert_boolean(value); - } - - public void insert_octet(byte value) - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_octet) - throw new TypeMismatch(); - any.insert_octet(value); - } - - public void insert_char(char value) - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_char) - throw new TypeMismatch(); - any.insert_char(value); - } - - public void insert_short(short value) - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_short) - throw new TypeMismatch(); - any.insert_short(value); - } - - public void insert_ushort(short value) - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_ushort) - throw new TypeMismatch(); - any.insert_ushort(value); - } - - public void insert_long(int value) - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_long) - throw new TypeMismatch(); - any.insert_long(value); - } - - public void insert_ulong(int value) - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_ulong) - throw new TypeMismatch(); - any.insert_ulong(value); - } - - public void insert_float(float value) - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_float) - throw new TypeMismatch(); - any.insert_float(value); - } - - public void insert_double(double value) - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_double) - throw new TypeMismatch(); - any.insert_double(value); - } - - public void insert_string(String value) - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_string) - throw new TypeMismatch(); - if (value == null) - throw new InvalidValue(); - // Throw InvalidValue if this is a bounded string and the length is exceeded - try { - if (any.type().length() > 0 && any.type().length() < value.length()) - throw new InvalidValue(); - } catch (BadKind bad) { // impossible - } - any.insert_string(value); - } - - public void insert_reference(org.omg.CORBA.Object value) - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_objref) - throw new TypeMismatch(); - any.insert_Object(value); - } - - public void insert_typecode(org.omg.CORBA.TypeCode value) - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_TypeCode) - throw new TypeMismatch(); - any.insert_TypeCode(value); - } - - public void insert_longlong(long value) - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_longlong) - throw new TypeMismatch(); - any.insert_longlong(value); - } - - public void insert_ulonglong(long value) - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_ulonglong) - throw new TypeMismatch(); - any.insert_ulonglong(value); - } - - public void insert_wchar(char value) - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_wchar) - throw new TypeMismatch(); - any.insert_wchar(value); - } - - public void insert_wstring(String value) - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_wstring) - throw new TypeMismatch(); - if (value == null) - throw new InvalidValue(); - // Throw InvalidValue if this is a bounded string and the length is exceeded - try { - if (any.type().length() > 0 && any.type().length() < value.length()) - throw new InvalidValue(); - } catch (BadKind bad) { // impossible - } - any.insert_wstring(value); - } - - public void insert_any(org.omg.CORBA.Any value) - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_any) - throw new TypeMismatch(); - any.insert_any(value); - } - - public void insert_dyn_any (org.omg.DynamicAny.DynAny value) - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_any) - throw new TypeMismatch(); - // _REVISIT_ Copy value here? - any.insert_any(value.to_any()); - } - - public void insert_val(java.io.Serializable value) - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - int kind = any.type().kind().value(); - if (kind != TCKind._tk_value && kind != TCKind._tk_value_box) - throw new TypeMismatch(); - any.insert_Value(value); - } - - public java.io.Serializable get_val() - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - int kind = any.type().kind().value(); - if (kind != TCKind._tk_value && kind != TCKind._tk_value_box) - throw new TypeMismatch(); - return any.extract_Value(); - } - - public boolean get_boolean() - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_boolean) - throw new TypeMismatch(); - return any.extract_boolean(); - } - - public byte get_octet() - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_octet) - throw new TypeMismatch(); - return any.extract_octet(); - } - - public char get_char() - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_char) - throw new TypeMismatch(); - return any.extract_char(); - } - - public short get_short() - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_short) - throw new TypeMismatch(); - return any.extract_short(); - } - - public short get_ushort() - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_ushort) - throw new TypeMismatch(); - return any.extract_ushort(); - } - - public int get_long() - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_long) - throw new TypeMismatch(); - return any.extract_long(); - } - - public int get_ulong() - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_ulong) - throw new TypeMismatch(); - return any.extract_ulong(); - } - - public float get_float() - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_float) - throw new TypeMismatch(); - return any.extract_float(); - } - - public double get_double() - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_double) - throw new TypeMismatch(); - return any.extract_double(); - } - - public String get_string() - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_string) - throw new TypeMismatch(); - return any.extract_string(); - } - - public org.omg.CORBA.Object get_reference() - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_objref) - throw new TypeMismatch(); - return any.extract_Object(); - } - - public org.omg.CORBA.TypeCode get_typecode() - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_TypeCode) - throw new TypeMismatch(); - return any.extract_TypeCode(); - } - - public long get_longlong() - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_longlong) - throw new TypeMismatch(); - return any.extract_longlong(); - } - - public long get_ulonglong() - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_ulonglong) - throw new TypeMismatch(); - return any.extract_ulonglong(); - } - - public char get_wchar() - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_wchar) - throw new TypeMismatch(); - return any.extract_wchar(); - } - - public String get_wstring() - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_wstring) - throw new TypeMismatch(); - return any.extract_wstring(); - } - - public org.omg.CORBA.Any get_any() - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_any) - throw new TypeMismatch(); - return any.extract_any(); - } - - public org.omg.DynamicAny.DynAny get_dyn_any() - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (any.type().kind().value() != TCKind._tk_any) - throw new TypeMismatch(); - // _REVISIT_ Copy value here? - try { - return DynAnyUtil.createMostDerivedDynAny(any.extract_any(), orb, true); - } catch (InconsistentTypeCode ictc) { - // The spec doesn't allow us to throw back this exception - // incase the anys any if of type Principal, native or abstract interface. - return null; - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/dynamicany/DynAnyCollectionImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/dynamicany/DynAnyCollectionImpl.java deleted file mode 100644 index 7643563be80..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/dynamicany/DynAnyCollectionImpl.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.dynamicany; - -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.Any; -import org.omg.CORBA.NO_IMPLEMENT; -import org.omg.CORBA.TypeCodePackage.BadKind; -import org.omg.CORBA.TypeCodePackage.Bounds; -import org.omg.DynamicAny.*; -import org.omg.DynamicAny.DynAnyPackage.TypeMismatch; -import org.omg.DynamicAny.DynAnyPackage.InvalidValue; -import org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode; - -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -abstract class DynAnyCollectionImpl extends DynAnyConstructedImpl -{ - // - // Instance variables - // - - // Keep in sync with DynAny[] components at all times. - Any[] anys = null; - - // - // Constructors - // - - private DynAnyCollectionImpl() { - this(null, (Any)null, false); - } - - protected DynAnyCollectionImpl(ORB orb, Any any, boolean copyValue) { - super(orb, any, copyValue); - } - - protected DynAnyCollectionImpl(ORB orb, TypeCode typeCode) { - super(orb, typeCode); - } - - // - // Utility methods - // - - protected void createDefaultComponentAt(int i, TypeCode contentType) { - try { - components[i] = DynAnyUtil.createMostDerivedDynAny(contentType, orb); - } catch (InconsistentTypeCode itc) { // impossible - } - // get a hold of the default initialized Any without copying - anys[i] = getAny(components[i]); - } - - protected TypeCode getContentType() { - try { - return any.type().content_type(); - } catch (BadKind badKind) { // impossible - return null; - } - } - - // This method has a different meaning for sequence and array: - // For sequence value of 0 indicates an unbounded sequence, - // values > 0 indicate a bounded sequence. - // For array any value indicates the boundary. - protected int getBound() { - try { - return any.type().length(); - } catch (BadKind badKind) { // impossible - return 0; - } - } - - // - // DynAny interface methods - // - - // _REVISIT_ More efficient copy operation - - // - // Collection methods - // - - public org.omg.CORBA.Any[] get_elements () { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - return (checkInitComponents() ? anys : null); - } - - protected abstract void checkValue(Object[] value) - throws org.omg.DynamicAny.DynAnyPackage.InvalidValue; - - // Initializes the elements of the ordered collection. - // If value does not contain the same number of elements as the array dimension, - // the operation raises InvalidValue. - // If one or more elements have a type that is inconsistent with the collections TypeCode, - // the operation raises TypeMismatch. - // This operation does not change the current position. - public void set_elements (org.omg.CORBA.Any[] value) - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - checkValue(value); - - components = new DynAny[value.length]; - anys = value; - - // We know that this is of kind tk_sequence or tk_array - TypeCode expectedTypeCode = getContentType(); - for (int i=0; i= names.length) { - throw new InvalidValue(); - } - return names[index]; - } - - public TCKind current_member_kind () - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if( ! checkInitComponents() || index < 0 || index >= components.length) { - throw new InvalidValue(); - } - return components[index].type().kind(); - } - - // Creates references to the parameter instead of copying it. - public void set_members (org.omg.DynamicAny.NameValuePair[] value) - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (value == null || value.length == 0) { - clearData(); - return; - } - - Any memberAny; - DynAny memberDynAny = null; - String memberName; - // We know that this is of kind tk_struct - TypeCode expectedTypeCode = any.type(); - - int expectedMemberCount = 0; - try { - expectedMemberCount = expectedTypeCode.member_count(); - } catch (BadKind badKind) { // impossible - } - if (expectedMemberCount != value.length) { - clearData(); - throw new InvalidValue(); - } - - allocComponents(value); - - for (int i=0; i= 0 && index < components.length) { - return true; - } else { - index = NO_INDEX; - return false; - } - } - - public boolean seek(int newIndex) { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - if (newIndex < 0) { - this.index = NO_INDEX; - return false; - } - if (checkInitComponents() == false) { - return false; - } - if (newIndex < components.length) { - index = newIndex; - return true; - } - return false; - } - - public void rewind() { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - this.seek(0); - } - - // - // Utility methods - // - - protected void clearData() { - super.clearData(); - // _REVISIT_ What about status? - components = emptyComponents; - index = NO_INDEX; - representations = REPRESENTATION_NONE; - } - - protected void writeAny(OutputStream out) { - // If all we got is TypeCode representation (no value) - // then we don't want to force creating a default value - //System.out.println(this + " checkInitAny before writeAny"); - checkInitAny(); - super.writeAny(out); - } - - // Makes sure that the components representation is initialized - protected boolean checkInitComponents() { - if ((representations & REPRESENTATION_COMPONENTS) == 0) { - if ((representations & REPRESENTATION_ANY) != 0) { - if (initializeComponentsFromAny()) { - representations |= REPRESENTATION_COMPONENTS; - } else { - return false; - } - } else if ((representations & REPRESENTATION_TYPECODE) != 0) { - if (initializeComponentsFromTypeCode()) { - representations |= REPRESENTATION_COMPONENTS; - } else { - return false; - } - } - } - return true; - } - - // Makes sure that the Any representation is initialized - protected void checkInitAny() { - if ((representations & REPRESENTATION_ANY) == 0) { - //System.out.println(this + " checkInitAny: reps does not have REPRESENTATION_ANY"); - if ((representations & REPRESENTATION_COMPONENTS) != 0) { - //System.out.println(this + " checkInitAny: reps has REPRESENTATION_COMPONENTS"); - if (initializeAnyFromComponents()) { - representations |= REPRESENTATION_ANY; - } - } else if ((representations & REPRESENTATION_TYPECODE) != 0) { - //System.out.println(this + " checkInitAny: reps has REPRESENTATION_TYPECODE"); - if (representations == REPRESENTATION_TYPECODE && isRecursive()) - return; - if (initializeComponentsFromTypeCode()) { - representations |= REPRESENTATION_COMPONENTS; - } - if (initializeAnyFromComponents()) { - representations |= REPRESENTATION_ANY; - } - } - } else { - //System.out.println(this + " checkInitAny: reps != REPRESENTATION_ANY"); - } - return; - } - - protected abstract boolean initializeComponentsFromAny(); - protected abstract boolean initializeComponentsFromTypeCode(); - - // Collapses the whole DynAny hierarchys values into one single streamed Any - protected boolean initializeAnyFromComponents() { - //System.out.println(this + " initializeAnyFromComponents"); - OutputStream out = any.create_output_stream(); - for (int i=0; i= memberCount()) { - throw new InvalidValue(); - } - currentEnumeratorIndex = value; - any.insert_long(value); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/dynamicany/DynFixedImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/dynamicany/DynFixedImpl.java deleted file mode 100644 index 5486f9b7048..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/dynamicany/DynFixedImpl.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.dynamicany; - -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.Any; -import org.omg.CORBA.NO_IMPLEMENT; -import org.omg.DynamicAny.*; -import org.omg.DynamicAny.DynAnyPackage.*; -import java.math.BigDecimal; -import java.math.BigInteger; -import org.omg.CORBA.TypeCodePackage.BadKind; - -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -public class DynFixedImpl extends DynAnyBasicImpl implements DynFixed -{ - // - // Constructors - // - - private DynFixedImpl() { - this(null, (Any)null, false); - } - - protected DynFixedImpl(ORB orb, Any any, boolean copyValue) { - super(orb, any, copyValue); - } - - // Sets the current position to -1 and the value to zero. - protected DynFixedImpl(ORB orb, TypeCode typeCode) { - super(orb, typeCode); - index = NO_INDEX; - } - - // - // DynAny interface methods - // -/* - public int component_count() { - return 0; - } -*/ - // - // DynFixed interface methods - // - - public String get_value () { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - return any.extract_fixed().toString(); - } - - // Initializes the value of the DynFixed. - // The val string must contain a fixed string constant in the same format - // as used for IDL fixed-point literals. - // - // It may consist of an integer part, an optional decimal point, - // a fraction part and an optional letter d or D. - // The integer and fraction parts both must be sequences of decimal (base 10) digits. - // Either the integer part or the fraction part, but not both, may be missing. - // - // If val contains a value whose scale exceeds that of the DynFixed or is not initialized, - // the operation raises InvalidValue. - // The return value is true if val can be represented as the DynFixed without loss of precision. - // If val has more fractional digits than can be represented in the DynFixed, - // fractional digits are truncated and the return value is false. - // If val does not contain a valid fixed-point literal or contains extraneous characters - // other than leading or trailing white space, the operation raises TypeMismatch. - // - public boolean set_value (String val) - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - int digits = 0; - int scale = 0; - boolean preservedPrecision = true; - try { - digits = any.type().fixed_digits(); - scale = any.type().fixed_scale(); - } catch (BadKind ex) { // impossible - } - // First get rid of leading or trailing whitespace which is allowed - String string = val.trim(); - if (string.length() == 0) - throw new TypeMismatch(); - // Now scan for the sign - String sign = ""; - if (string.charAt(0) == '-') { - sign = "-"; - string = string.substring(1); - } else if (string.charAt(0) == '+') { - sign = "+"; - string = string.substring(1); - } - // Now get rid of the letter d or D. - int dIndex = string.indexOf('d'); - if (dIndex == -1) { - dIndex = string.indexOf('D'); - } - if (dIndex != -1) { - string = string.substring(0, dIndex); - } - // Just to be sure - if (string.length() == 0) - throw new TypeMismatch(); - // Now look for the dot to determine the integer part - String integerPart; - String fractionPart; - int currentScale; - int currentDigits; - int dotIndex = string.indexOf('.'); - if (dotIndex == -1) { - integerPart = string; - fractionPart = null; - currentScale = 0; - currentDigits = integerPart.length(); - } else if (dotIndex == 0 ) { - integerPart = null; - fractionPart = string; - currentScale = fractionPart.length(); - currentDigits = currentScale; - } else { - integerPart = string.substring(0, dotIndex); - fractionPart = string.substring(dotIndex + 1); - currentScale = fractionPart.length(); - currentDigits = integerPart.length() + currentScale; - } - // Let's see if we have to drop some precision - if (currentDigits > digits) { - preservedPrecision = false; - // truncate the fraction part - if (integerPart.length() < digits) { - fractionPart = fractionPart.substring(0, digits - integerPart.length()); - } else if (integerPart.length() == digits) { - // currentScale > 0 - // drop the fraction completely - fractionPart = null; - } else { - // integerPart.length() > digits - // unable to truncate fraction part - throw new InvalidValue(); - } - } - // If val contains a value whose scale exceeds that of the DynFixed or is not initialized, - // the operation raises InvalidValue. - // Reinterpreted to mean raise InvalidValue only if the integer part exceeds precision, - // which is handled above (integerPart.length() > digits) -/* - if (currentScale > scale) { - throw new InvalidValue("Scale exceeds " + scale); - } -*/ - // Now check whether both parts are valid numbers - BigDecimal result; - try { - new BigInteger(integerPart); - if (fractionPart == null) { - result = new BigDecimal(sign + integerPart); - } else { - new BigInteger(fractionPart); - result = new BigDecimal(sign + integerPart + "." + fractionPart); - } - } catch (NumberFormatException nfe) { - throw new TypeMismatch(); - } - any.insert_fixed(result, any.type()); - return preservedPrecision; - } - - public String toString() { - int digits = 0; - int scale = 0; - try { - digits = any.type().fixed_digits(); - scale = any.type().fixed_scale(); - } catch (BadKind ex) { // impossible - } - return "DynFixed with value=" + this.get_value() + ", digits=" + digits + ", scale=" + scale; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/dynamicany/DynSequenceImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/dynamicany/DynSequenceImpl.java deleted file mode 100644 index 1cf5303f444..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/dynamicany/DynSequenceImpl.java +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.dynamicany; - -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.Any; -import org.omg.CORBA.BAD_OPERATION; -import org.omg.CORBA.TypeCodePackage.BadKind; -import org.omg.CORBA.TypeCodePackage.Bounds; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; -import org.omg.DynamicAny.*; -import org.omg.DynamicAny.DynAnyPackage.TypeMismatch; -import org.omg.DynamicAny.DynAnyPackage.InvalidValue; -import org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode; - -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -// _REVIST_ Could make this a subclass of DynArrayImpl -// But that would mean that an object that implements DynSequence also implements DynArray -// which the spec doesn't mention (it also doesn't forbid it). -public class DynSequenceImpl extends DynAnyCollectionImpl implements DynSequence -{ - // - // Constructors - // - - private DynSequenceImpl() { - this(null, (Any)null, false); - } - - protected DynSequenceImpl(ORB orb, Any any, boolean copyValue) { - super(orb, any, copyValue); - } - - // Sets the current position to -1 and creates an empty sequence. - protected DynSequenceImpl(ORB orb, TypeCode typeCode) { - super(orb, typeCode); - } - - // Initializes components and anys representation - // from the Any representation - protected boolean initializeComponentsFromAny() { - // This typeCode is of kind tk_sequence. - TypeCode typeCode = any.type(); - int length; - TypeCode contentType = getContentType(); - InputStream input; - - try { - input = any.create_input_stream(); - } catch (BAD_OPERATION e) { - return false; - } - - length = input.read_long(); - components = new DynAny[length]; - anys = new Any[length]; - - for (int i=0; i 0 && len > bound) { - throw new InvalidValue(); - } - - checkInitComponents(); - - int oldLength = components.length; - if (len > oldLength) { - // Increase length - DynAny[] newComponents = new DynAny[len]; - Any[] newAnys = new Any[len]; - System.arraycopy(components, 0, newComponents, 0, oldLength); - System.arraycopy(anys, 0, newAnys, 0, oldLength); - components = newComponents; - anys = newAnys; - - // Newly added elements are default-initialized - TypeCode contentType = getContentType(); - for (int i=oldLength; i= len) { - index = NO_INDEX; - } - } else { - // Length unchanged - // Maybe components is now default initialized from type code - if (index == NO_INDEX && len > 0) { - index = 0; - } - } - } - - // Initializes the elements of the sequence. - // The length of the DynSequence is set to the length of value. - // The current position is set to zero if value has non-zero length - // and to -1 if value is a zero-length sequence. - // If the length of value exceeds the bound of a bounded sequence, - // the operation raises InvalidValue. - // If value contains one or more elements whose TypeCode is not equivalent - // to the element TypeCode of the DynSequence, the operation raises TypeMismatch. -/* - public void set_elements(org.omg.CORBA.Any[] value) - throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, - org.omg.DynamicAny.DynAnyPackage.InvalidValue; -*/ - - // - // Utility methods - // - - protected void checkValue(Object[] value) - throws org.omg.DynamicAny.DynAnyPackage.InvalidValue - { - if (value == null || value.length == 0) { - clearData(); - index = NO_INDEX; - return; - } else { - index = 0; - } - int bound = getBound(); - if (bound > 0 && value.length > bound) { - throw new InvalidValue(); - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/dynamicany/DynStructImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/dynamicany/DynStructImpl.java deleted file mode 100644 index 43145e25c9a..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/dynamicany/DynStructImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.dynamicany; - -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.TCKind; -import org.omg.CORBA.Any; -import org.omg.CORBA.TypeCodePackage.BadKind; -import org.omg.CORBA.TypeCodePackage.Bounds; -import org.omg.DynamicAny.*; -import org.omg.DynamicAny.DynAnyPackage.TypeMismatch; -import org.omg.DynamicAny.DynAnyPackage.InvalidValue; -import org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode; - -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -public class DynStructImpl extends DynAnyComplexImpl implements DynStruct -{ - // - // Constructors - // - - private DynStructImpl() { - this(null, (Any)null, false); - } - - protected DynStructImpl(ORB orb, Any any, boolean copyValue) { - // We can be sure that typeCode is of kind tk_struct - super(orb, any, copyValue); - // Initialize components lazily, on demand. - // This is an optimization in case the user is only interested in storing Anys. - } - - protected DynStructImpl(ORB orb, TypeCode typeCode) { - // We can be sure that typeCode is of kind tk_struct - super(orb, typeCode); - // For DynStruct, the operation sets the current position to -1 - // for empty exceptions and to zero for all other TypeCodes. - // The members (if any) are (recursively) initialized to their default values. - index = 0; - } - - // - // Methods differing from DynValues - // - - public org.omg.DynamicAny.NameValuePair[] get_members () { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - checkInitComponents(); - return nameValuePairs; - } - - public org.omg.DynamicAny.NameDynAnyPair[] get_members_as_dyn_any () { - if (status == STATUS_DESTROYED) { - throw wrapper.dynAnyDestroyed() ; - } - checkInitComponents(); - return nameDynAnyPairs; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/dynamicany/DynUnionImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/dynamicany/DynUnionImpl.java deleted file mode 100644 index 51a44b56cdd..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/dynamicany/DynUnionImpl.java +++ /dev/null @@ -1,385 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.dynamicany; - -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.TCKind; -import org.omg.CORBA.Any; -import org.omg.CORBA.TypeCodePackage.BadKind; -import org.omg.CORBA.TypeCodePackage.Bounds; -import org.omg.CORBA.portable.InputStream; -import org.omg.DynamicAny.*; -import org.omg.DynamicAny.DynAnyPackage.TypeMismatch; -import org.omg.DynamicAny.DynAnyPackage.InvalidValue; -import org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode; - -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -public class DynUnionImpl extends DynAnyConstructedImpl implements DynUnion -{ - // - // Instance variables - // - - DynAny discriminator = null; - // index either points to the discriminator or the named member is it exists. - // The currently active member, which is of the same type as the discriminator. - DynAny currentMember = null; - int currentMemberIndex = NO_INDEX; - - // - // Constructors - // - - private DynUnionImpl() { - this(null, (Any)null, false); - } - - protected DynUnionImpl(ORB orb, Any any, boolean copyValue) { - // We can be sure that typeCode is of kind tk_union - super(orb, any, copyValue); - } - - protected DynUnionImpl(ORB orb, TypeCode typeCode) { - // We can be sure that typeCode is of kind tk_union - super(orb, typeCode); - } - - protected boolean initializeComponentsFromAny() { - try { - InputStream input = any.create_input_stream(); - Any discriminatorAny = DynAnyUtil.extractAnyFromStream(discriminatorType(), input, orb); - discriminator = DynAnyUtil.createMostDerivedDynAny(discriminatorAny, orb, false); - currentMemberIndex = currentUnionMemberIndex(discriminatorAny); - Any memberAny = DynAnyUtil.extractAnyFromStream(memberType(currentMemberIndex), input, orb); - currentMember = DynAnyUtil.createMostDerivedDynAny(memberAny, orb, false); - components = new DynAny[] {discriminator, currentMember}; - } catch (InconsistentTypeCode ictc) { // impossible - } - return true; - } - - // Sets the current position to zero. - // The discriminator value is set to a value consistent with the first named member - // of the union. That member is activated and (recursively) initialized to its default value. - protected boolean initializeComponentsFromTypeCode() { - //System.out.println(this + " initializeComponentsFromTypeCode"); - try { - // We can be sure that memberCount() > 0 according to the IDL language spec - discriminator = DynAnyUtil.createMostDerivedDynAny(memberLabel(0), orb, false); - index = 0; - currentMemberIndex = 0; - currentMember = DynAnyUtil.createMostDerivedDynAny(memberType(0), orb); - components = new DynAny[] {discriminator, currentMember}; - } catch (InconsistentTypeCode ictc) { // impossible - } - return true; - } - - // - // Convenience methods - // - - private TypeCode discriminatorType() { - TypeCode discriminatorType = null; - try { - discriminatorType = any.type().discriminator_type(); - } catch (BadKind bad) { - } - return discriminatorType; - } - - private int memberCount() { - int memberCount = 0; - try { - memberCount = any.type().member_count(); - } catch (BadKind bad) { - } - return memberCount; - } - - private Any memberLabel(int i) { - Any memberLabel = null; - try { - memberLabel = any.type().member_label(i); - } catch (BadKind bad) { - } catch (Bounds bounds) { - } - return memberLabel; - } - - private TypeCode memberType(int i) { - TypeCode memberType = null; - try { - memberType = any.type().member_type(i); - } catch (BadKind bad) { - } catch (Bounds bounds) { - } - return memberType; - } - - private String memberName(int i) { - String memberName = null; - try { - memberName = any.type().member_name(i); - } catch (BadKind bad) { - } catch (Bounds bounds) { - } - return memberName; - } - - private int defaultIndex() { - int defaultIndex = -1; - try { - defaultIndex = any.type().default_index(); - } catch (BadKind bad) { - } - return defaultIndex; - } - - private int currentUnionMemberIndex(Any discriminatorValue) { - int memberCount = memberCount(); - Any memberLabel; - for (int i=0; i 0; - } - - /** - * Returns the correct buffer size for this type of - * buffer manager as set in the ORB. - */ - public int getBufferSize() { - return orb.getORBData().getGIOPFragmentSize(); - } - - public void overflow (ByteBufferWithInfo bbwi) - { - // Set the fragment's moreFragments field to true - MessageBase.setFlag(bbwi.byteBuffer, Message.MORE_FRAGMENTS_BIT); - - try { - sendFragment(false); - } catch(SystemException se){ - orb.getPIHandler().invokeClientPIEndingPoint( - ReplyMessage.SYSTEM_EXCEPTION, se); - throw se; - } - - // Reuse the old buffer - - // REVISIT - need to account for case when needed > available - // even after fragmenting. This is the large array case, so - // the caller should retry when it runs out of space. - bbwi.position(0); - bbwi.buflen = bbwi.byteBuffer.limit(); - bbwi.fragmented = true; - - // Now we must marshal in the fragment header/GIOP header - - // REVISIT - we can optimize this by not creating the fragment message - // each time. - - FragmentMessage header = ((CDROutputObject)outputObject).getMessageHeader().createFragmentMessage(); - - header.write(((CDROutputObject)outputObject)); - } - - private void sendFragment(boolean isLastFragment) - { - Connection conn = ((OutputObject)outputObject).getMessageMediator().getConnection(); - - // REVISIT: need an ORB - //System.out.println("sendFragment: last?: " + isLastFragment); - conn.writeLock(); - - try { - // Send the fragment - conn.sendWithoutLock(((OutputObject)outputObject)); - - fragmentCount++; - - } finally { - - conn.writeUnlock(); - } - - } - - // Sends the last fragment - public void sendMessage () - { - sendFragment(true); - - sentFullMessage = true; - } - - /** - * Close the BufferManagerWrite and do any outstanding cleanup. - * - * No work to do for a BufferManagerWriteStream - */ - public void close(){}; - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/BufferQueue.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/BufferQueue.java deleted file mode 100644 index 92618bcb1ca..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/BufferQueue.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.encoding; - -import java.util.LinkedList; -import java.util.NoSuchElementException; -import java.util.LinkedList; - -/** - * Simple unsynchronized queue implementation for ByteBufferWithInfos. - */ -// XREVISIT - Should be in orbutil or package private -public class BufferQueue -{ - private LinkedList list = new LinkedList(); - - public void enqueue(ByteBufferWithInfo item) - { - list.addLast(item); - } - - public ByteBufferWithInfo dequeue() throws NoSuchElementException - { - return (ByteBufferWithInfo)list.removeFirst(); - } - - public int size() - { - return list.size(); - } - - // Adds the given ByteBufferWithInfo to the front - // of the queue. - public void push(ByteBufferWithInfo item) - { - list.addFirst(item); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/ByteBufferWithInfo.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/ByteBufferWithInfo.java deleted file mode 100644 index 490fd60cdf2..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/ByteBufferWithInfo.java +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.encoding; - -import java.nio.ByteBuffer; - - -import com.sun.corba.se.impl.encoding.BufferManagerWrite; -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.pept.transport.ByteBufferPool; -import com.sun.corba.se.spi.orb.ORB; - - -// Notes about the class. -// Assumptions, the ByteBuffer's position is set by the constructor's -// index variable and the ByteBuffer's limit points to the end of the -// data. Also, since the index variable tracks the current empty -// position in the buffer, the ByteBuffer's position is updated -// any time there's a call to this class's position(). -// Although, a ByteBuffer's length is it's capacity(), the context in -// which length is used in this object, this.buflen is actually the -// ByteBuffer limit(). - -public class ByteBufferWithInfo -{ - private ORB orb; - private boolean debug; - // REVISIT - index should eventually be replaced with byteBuffer.position() - private int index; // Current empty position in buffer. - // REVISIT - CHANGE THESE TO PRIVATE - public ByteBuffer byteBuffer;// Marshal buffer. - public int buflen; // Total length of buffer. // Unnecessary... - public int needed; // How many more bytes are needed on overflow. - public boolean fragmented; // Did the overflow operation fragment? - - public ByteBufferWithInfo(org.omg.CORBA.ORB orb, - ByteBuffer byteBuffer, - int index) - { - this.orb = (com.sun.corba.se.spi.orb.ORB)orb; - debug = this.orb.transportDebugFlag; - this.byteBuffer = byteBuffer; - if (byteBuffer != null) - { - this.buflen = byteBuffer.limit(); - } - position(index); - this.needed = 0; - this.fragmented = false; - } - - public ByteBufferWithInfo(org.omg.CORBA.ORB orb, ByteBuffer byteBuffer) - { - this(orb, byteBuffer, 0); - } - - public ByteBufferWithInfo(org.omg.CORBA.ORB orb, - BufferManagerWrite bufferManager) - { - this(orb, bufferManager, true); - } - - // Right now, EncapsOutputStream's do not use pooled byte buffers. - // EncapsOutputStream's is the only one that does not use pooled - // byte buffers. Hence, the reason for the boolean 'usePooledByteBuffers'. - // See EncapsOutputStream for additional information. - - public ByteBufferWithInfo(org.omg.CORBA.ORB orb, - BufferManagerWrite bufferManager, - boolean usePooledByteBuffers) - { - this.orb = (com.sun.corba.se.spi.orb.ORB)orb; - debug = this.orb.transportDebugFlag; - - int bufferSize = bufferManager.getBufferSize(); - - if (usePooledByteBuffers) - { - ByteBufferPool byteBufferPool = this.orb.getByteBufferPool(); - this.byteBuffer = byteBufferPool.getByteBuffer(bufferSize); - - if (debug) - { - // print address of ByteBuffer gotten from pool - int bbAddress = System.identityHashCode(byteBuffer); - StringBuffer sb = new StringBuffer(80); - sb.append("constructor (ORB, BufferManagerWrite) - got ") - .append("ByteBuffer id (").append(bbAddress) - .append(") from ByteBufferPool."); - String msgStr = sb.toString(); - dprint(msgStr); - } - } - else - { - // don't allocate from pool, allocate non-direct ByteBuffer - this.byteBuffer = ByteBuffer.allocate(bufferSize); - } - - position(0); - this.buflen = bufferSize; - this.byteBuffer.limit(this.buflen); - this.needed = 0; - this.fragmented = false; - } - - // Shallow copy constructor - public ByteBufferWithInfo (ByteBufferWithInfo bbwi) - { - this.orb = bbwi.orb; - this.debug = bbwi.debug; - this.byteBuffer = bbwi.byteBuffer; - this.buflen = bbwi.buflen; - this.byteBuffer.limit(this.buflen); - position(bbwi.position()); - this.needed = bbwi.needed; - this.fragmented = bbwi.fragmented; - } - - // So IIOPOutputStream seems more intuitive - public int getSize() - { - return position(); - } - - // accessor to buflen - public int getLength() - { - return buflen; - } - - // get position in this buffer - public int position() - { - // REVISIT - This should be changed to return the - // value of byteBuffer.position() rather - // than this.index. But, byteBuffer.position - // is manipulated via ByteBuffer writes, reads, - // gets and puts. These locations need to be - // investigated and updated before - // byteBuffer.position() can be returned here. - // return byteBuffer.position(); - return index; - } - - // set position in this buffer - public void position(int newPosition) - { - // REVISIT - This should be changed to set only the - // value of byteBuffer.position rather - // than this.index. This change should be made - // in conjunction with the change to this.position(). - byteBuffer.position(newPosition); - index = newPosition; - } - - // mutator to buflen - public void setLength(int theLength) - { - buflen = theLength; - byteBuffer.limit(buflen); - } - - // Grow byteBuffer to a size larger than position() + needed - public void growBuffer(com.sun.corba.se.spi.orb.ORB orb) - { - // This code used to live directly in CDROutputStream.grow. - - // Recall that the byteBuffer size is 'really' the limit or - // buflen. - - int newLength = byteBuffer.limit() * 2; - - while (position() + needed >= newLength) - newLength = newLength * 2; - - ByteBufferPool byteBufferPool = orb.getByteBufferPool(); - ByteBuffer newBB = byteBufferPool.getByteBuffer(newLength); - - if (debug) - { - // print address of ByteBuffer just gotten - int newbbAddress = System.identityHashCode(newBB); - StringBuffer sb = new StringBuffer(80); - sb.append("growBuffer() - got ByteBuffer id ("); - sb.append(newbbAddress).append(") from ByteBufferPool."); - String msgStr = sb.toString(); - dprint(msgStr); - } - - byteBuffer.position(0); - newBB.put(byteBuffer); - - // return 'old' byteBuffer reference to the ByteBuffer pool - if (debug) - { - // print address of ByteBuffer being released - int bbAddress = System.identityHashCode(byteBuffer); - StringBuffer sb = new StringBuffer(80); - sb.append("growBuffer() - releasing ByteBuffer id ("); - sb.append(bbAddress).append(") to ByteBufferPool."); - String msgStr2 = sb.toString(); - dprint(msgStr2); - } - byteBufferPool.releaseByteBuffer(byteBuffer); - - // update the byteBuffer with a larger ByteBuffer - byteBuffer = newBB; - - // limit and buflen must be set to newLength. - buflen = newLength; - byteBuffer.limit(buflen); - } - - public String toString() - { - StringBuffer str = new StringBuffer("ByteBufferWithInfo:"); - - str.append(" buflen = " + buflen); - str.append(" byteBuffer.limit = " + byteBuffer.limit()); - str.append(" index = " + index); - str.append(" position = " + position()); - str.append(" needed = " + needed); - str.append(" byteBuffer = " + (byteBuffer == null ? "null" : "not null")); - str.append(" fragmented = " + fragmented); - - return str.toString(); - } - - protected void dprint(String msg) - { - ORBUtility.dprint("ByteBufferWithInfo", msg); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDRInputObject.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDRInputObject.java deleted file mode 100644 index 039484b0464..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDRInputObject.java +++ /dev/null @@ -1,267 +0,0 @@ -/* - * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.encoding; - -import java.nio.ByteBuffer; - -import com.sun.org.omg.SendingContext.CodeBase; - -import com.sun.corba.se.pept.encoding.InputObject; - -import com.sun.corba.se.spi.logging.CORBALogDomains; - -import com.sun.corba.se.spi.orb.ORB; - -import com.sun.corba.se.spi.transport.CorbaConnection; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; - -import com.sun.corba.se.impl.encoding.BufferManagerFactory; -import com.sun.corba.se.impl.encoding.CodeSetComponentInfo; -import com.sun.corba.se.impl.encoding.CodeSetConversion; -import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry; -import com.sun.corba.se.impl.encoding.CDRInputStream; - -import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; - -import com.sun.corba.se.impl.logging.ORBUtilSystemException; -import com.sun.corba.se.impl.logging.OMGSystemException; - -import com.sun.corba.se.impl.orbutil.ORBUtility; - -/** - * @author Harold Carr - */ -public class CDRInputObject extends CDRInputStream - implements - InputObject -{ - private CorbaConnection corbaConnection; - private Message header; - private boolean unmarshaledHeader; - private ORB orb ; - private ORBUtilSystemException wrapper ; - private OMGSystemException omgWrapper ; - - public CDRInputObject(ORB orb, - CorbaConnection corbaConnection, - ByteBuffer byteBuffer, - Message header) - { - super(orb, byteBuffer, header.getSize(), header.isLittleEndian(), - header.getGIOPVersion(), header.getEncodingVersion(), - BufferManagerFactory.newBufferManagerRead( - header.getGIOPVersion(), - header.getEncodingVersion(), - orb)); - - this.corbaConnection = corbaConnection; - this.orb = orb ; - this.wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_ENCODING ) ; - this.omgWrapper = OMGSystemException.get( orb, - CORBALogDomains.RPC_ENCODING ) ; - - if (orb.transportDebugFlag) { - dprint(".CDRInputObject constructor:"); - } - - getBufferManager().init(header); - - this.header = header; - - unmarshaledHeader = false; - - setIndex(Message.GIOPMessageHeaderLength); - - setBufferLength(header.getSize()); - } - - // REVISIT - think about this some more. - // This connection normally is accessed from the message mediator. - // However, giop input needs to get code set info from the connetion - // *before* the message mediator is available. - public final CorbaConnection getConnection() - { - return corbaConnection; - } - - // XREVISIT - Should the header be kept in the stream or the - // message mediator? Or should we not have a header and - // have the information stored in the message mediator - // directly? - public Message getMessageHeader() - { - return header; - } - - /** - * Unmarshal the extended GIOP header - * NOTE: May be fragmented, so should not be called by the ReaderThread. - * See CorbaResponseWaitingRoomImpl.waitForResponse. It is done - * there in the client thread. - */ - public void unmarshalHeader() - { - // Unmarshal the extended GIOP message from the buffer. - - if (!unmarshaledHeader) { - try { - if (((ORB)orb()).transportDebugFlag) { - dprint(".unmarshalHeader->: " + getMessageHeader()); - } - getMessageHeader().read(this); - unmarshaledHeader= true; - } catch (RuntimeException e) { - if (((ORB)orb()).transportDebugFlag) { - dprint(".unmarshalHeader: !!ERROR!!: " - + getMessageHeader() - + ": " + e); - } - throw e; - } finally { - if (((ORB)orb()).transportDebugFlag) { - dprint(".unmarshalHeader<-: " + getMessageHeader()); - } - } - } - } - - public final boolean unmarshaledHeader() - { - return unmarshaledHeader; - } - - /** - * Override the default CDR factory behavior to get the - * negotiated code sets from the connection. - * - * These are only called once per message, the first time needed. - * - * In the local case, there is no Connection, so use the - * local code sets. - */ - protected CodeSetConversion.BTCConverter createCharBTCConverter() { - CodeSetComponentInfo.CodeSetContext codesets = getCodeSets(); - - // If the connection doesn't have its negotiated - // code sets by now, fall back on the defaults defined - // in CDRInputStream. - if (codesets == null) - return super.createCharBTCConverter(); - - OSFCodeSetRegistry.Entry charSet - = OSFCodeSetRegistry.lookupEntry(codesets.getCharCodeSet()); - - if (charSet == null) - throw wrapper.unknownCodeset( charSet ) ; - - return CodeSetConversion.impl().getBTCConverter(charSet, isLittleEndian()); - } - - protected CodeSetConversion.BTCConverter createWCharBTCConverter() { - - CodeSetComponentInfo.CodeSetContext codesets = getCodeSets(); - - // If the connection doesn't have its negotiated - // code sets by now, we have to throw an exception. - // See CORBA formal 00-11-03 13.9.2.6. - if (codesets == null) { - if (getConnection().isServer()) - throw omgWrapper.noClientWcharCodesetCtx() ; - else - throw omgWrapper.noServerWcharCodesetCmp() ; - } - - OSFCodeSetRegistry.Entry wcharSet - = OSFCodeSetRegistry.lookupEntry(codesets.getWCharCodeSet()); - - if (wcharSet == null) - throw wrapper.unknownCodeset( wcharSet ) ; - - // For GIOP 1.2 and UTF-16, use big endian if there is no byte - // order marker. (See issue 3405b) - // - // For GIOP 1.1 and UTF-16, use the byte order the stream if - // there isn't (and there shouldn't be) a byte order marker. - // - // GIOP 1.0 doesn't have wchars. If we're talking to a legacy ORB, - // we do what our old ORBs did. - if (wcharSet == OSFCodeSetRegistry.UTF_16) { - if (getGIOPVersion().equals(GIOPVersion.V1_2)) - return CodeSetConversion.impl().getBTCConverter(wcharSet, false); - } - - return CodeSetConversion.impl().getBTCConverter(wcharSet, isLittleEndian()); - } - - // If we're local and don't have a Connection, use the - // local code sets, otherwise get them from the connection. - // If the connection doesn't have negotiated code sets - // yet, then we use ISO8859-1 for char/string and wchar/wstring - // are illegal. - private CodeSetComponentInfo.CodeSetContext getCodeSets() { - if (getConnection() == null) - return CodeSetComponentInfo.LOCAL_CODE_SETS; - else - return getConnection().getCodeSetContext(); - } - - public final CodeBase getCodeBase() { - if (getConnection() == null) - return null; - else - return getConnection().getCodeBase(); - } - - // ----------------------------------------------------------- - // Below this point are commented out methods with features - // from the old stream. We must find ways to address - // these issues in the future. - // ----------------------------------------------------------- - - // XREVISIT -// private XIIOPInputStream(XIIOPInputStream stream) { -// super(stream); - -// this.conn = stream.conn; -// this.msg = stream.msg; -// this.unmarshaledHeader = stream.unmarshaledHeader; -// } - - public CDRInputStream dup() { - // XREVISIT - return null; - // return new XIIOPInputStream(this); - } - - protected void dprint(String msg) - { - ORBUtility.dprint("CDRInputObject", msg); - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream.java deleted file mode 100644 index 2202014230e..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream.java +++ /dev/null @@ -1,544 +0,0 @@ -/* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.encoding; - -import java.io.IOException; -import java.io.Serializable; -import java.math.BigDecimal; -import java.nio.ByteBuffer; - -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.Principal; -import org.omg.CORBA.Any; - -import com.sun.org.omg.SendingContext.CodeBase; - -import com.sun.corba.se.pept.protocol.MessageMediator; - -import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; - -import com.sun.corba.se.impl.logging.ORBUtilSystemException; -import com.sun.corba.se.impl.encoding.CodeSetConversion; -import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry; -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; - -/** - * This is delegates to the real implementation. - * - * NOTE: - * - * Before using the stream for valuetype unmarshaling, one must call - * performORBVersionSpecificInit(). - */ -public abstract class CDRInputStream - extends org.omg.CORBA_2_3.portable.InputStream - implements com.sun.corba.se.impl.encoding.MarshalInputStream, - org.omg.CORBA.DataInputStream, org.omg.CORBA.portable.ValueInputStream -{ - protected CorbaMessageMediator messageMediator; - private CDRInputStreamBase impl; - - // We can move this out somewhere later. For now, it serves its purpose - // to create a concrete CDR delegate based on the GIOP version. - private static class InputStreamFactory { - - public static CDRInputStreamBase newInputStream( - ORB orb, GIOPVersion version, byte encodingVersion) { - switch(version.intValue()) { - case GIOPVersion.VERSION_1_0: - return new CDRInputStream_1_0(); - case GIOPVersion.VERSION_1_1: - return new CDRInputStream_1_1(); - case GIOPVersion.VERSION_1_2: - if (encodingVersion != Message.CDR_ENC_VERSION) { - return - new IDLJavaSerializationInputStream(encodingVersion); - } - return new CDRInputStream_1_2(); - // else fall through and report exception. - default: - ORBUtilSystemException wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_ENCODING ) ; - throw wrapper.unsupportedGiopVersion( version ) ; - } - } - } - - // Required for the case when a ClientResponseImpl is - // created with a SystemException due to a dead server/closed - // connection with no warning. Note that the stream will - // not be initialized in this case. - // - // Probably also required by ServerRequestImpl. - // - // REVISIT. - public CDRInputStream() { - } - - public CDRInputStream(CDRInputStream is) { - impl = is.impl.dup(); - impl.setParent(this); - } - - public CDRInputStream(org.omg.CORBA.ORB orb, - ByteBuffer byteBuffer, - int size, - boolean littleEndian, - GIOPVersion version, - byte encodingVersion, - BufferManagerRead bufMgr) - { - impl = InputStreamFactory.newInputStream((ORB)orb, version, - encodingVersion); - - impl.init(orb, byteBuffer, size, littleEndian, bufMgr); - - impl.setParent(this); - } - - // org.omg.CORBA.portable.InputStream - public final boolean read_boolean() { - return impl.read_boolean(); - } - - public final char read_char() { - return impl.read_char(); - } - - public final char read_wchar() { - return impl.read_wchar(); - } - - public final byte read_octet() { - return impl.read_octet(); - } - - public final short read_short() { - return impl.read_short(); - } - - public final short read_ushort() { - return impl.read_ushort(); - } - - public final int read_long() { - return impl.read_long(); - } - - public final int read_ulong() { - return impl.read_ulong(); - } - - public final long read_longlong() { - return impl.read_longlong(); - } - - public final long read_ulonglong() { - return impl.read_ulonglong(); - } - - public final float read_float() { - return impl.read_float(); - } - - public final double read_double() { - return impl.read_double(); - } - - public final String read_string() { - return impl.read_string(); - } - - public final String read_wstring() { - return impl.read_wstring(); - } - - public final void read_boolean_array(boolean[] value, int offset, int length) { - impl.read_boolean_array(value, offset, length); - } - - public final void read_char_array(char[] value, int offset, int length) { - impl.read_char_array(value, offset, length); - } - - public final void read_wchar_array(char[] value, int offset, int length) { - impl.read_wchar_array(value, offset, length); - } - - public final void read_octet_array(byte[] value, int offset, int length) { - impl.read_octet_array(value, offset, length); - } - - public final void read_short_array(short[] value, int offset, int length) { - impl.read_short_array(value, offset, length); - } - - public final void read_ushort_array(short[] value, int offset, int length) { - impl.read_ushort_array(value, offset, length); - } - - public final void read_long_array(int[] value, int offset, int length) { - impl.read_long_array(value, offset, length); - } - - public final void read_ulong_array(int[] value, int offset, int length) { - impl.read_ulong_array(value, offset, length); - } - - public final void read_longlong_array(long[] value, int offset, int length) { - impl.read_longlong_array(value, offset, length); - } - - public final void read_ulonglong_array(long[] value, int offset, int length) { - impl.read_ulonglong_array(value, offset, length); - } - - public final void read_float_array(float[] value, int offset, int length) { - impl.read_float_array(value, offset, length); - } - - public final void read_double_array(double[] value, int offset, int length) { - impl.read_double_array(value, offset, length); - } - - public final org.omg.CORBA.Object read_Object() { - return impl.read_Object(); - } - - public final TypeCode read_TypeCode() { - return impl.read_TypeCode(); - } - public final Any read_any() { - return impl.read_any(); - } - - public final Principal read_Principal() { - return impl.read_Principal(); - } - - public final int read() throws java.io.IOException { - return impl.read(); - } - - public final java.math.BigDecimal read_fixed() { - return impl.read_fixed(); - } - - public final org.omg.CORBA.Context read_Context() { - return impl.read_Context(); - } - - public final org.omg.CORBA.Object read_Object(java.lang.Class clz) { - return impl.read_Object(clz); - } - - public final org.omg.CORBA.ORB orb() { - return impl.orb(); - } - - // org.omg.CORBA_2_3.portable.InputStream - public final java.io.Serializable read_value() { - return impl.read_value(); - } - - public final java.io.Serializable read_value(java.lang.Class clz) { - return impl.read_value(clz); - } - - public final java.io.Serializable read_value(org.omg.CORBA.portable.BoxedValueHelper factory) { - return impl.read_value(factory); - } - - public final java.io.Serializable read_value(java.lang.String rep_id) { - return impl.read_value(rep_id); - } - - public final java.io.Serializable read_value(java.io.Serializable value) { - return impl.read_value(value); - } - - public final java.lang.Object read_abstract_interface() { - return impl.read_abstract_interface(); - } - - public final java.lang.Object read_abstract_interface(java.lang.Class clz) { - return impl.read_abstract_interface(clz); - } - // com.sun.corba.se.impl.encoding.MarshalInputStream - - public final void consumeEndian() { - impl.consumeEndian(); - } - - public final int getPosition() { - return impl.getPosition(); - } - - // org.omg.CORBA.DataInputStream - - public final java.lang.Object read_Abstract () { - return impl.read_Abstract(); - } - - public final java.io.Serializable read_Value () { - return impl.read_Value(); - } - - public final void read_any_array (org.omg.CORBA.AnySeqHolder seq, int offset, int length) { - impl.read_any_array(seq, offset, length); - } - - public final void read_boolean_array (org.omg.CORBA.BooleanSeqHolder seq, int offset, int length) { - impl.read_boolean_array(seq, offset, length); - } - - public final void read_char_array (org.omg.CORBA.CharSeqHolder seq, int offset, int length) { - impl.read_char_array(seq, offset, length); - } - - public final void read_wchar_array (org.omg.CORBA.WCharSeqHolder seq, int offset, int length) { - impl.read_wchar_array(seq, offset, length); - } - - public final void read_octet_array (org.omg.CORBA.OctetSeqHolder seq, int offset, int length) { - impl.read_octet_array(seq, offset, length); - } - - public final void read_short_array (org.omg.CORBA.ShortSeqHolder seq, int offset, int length) { - impl.read_short_array(seq, offset, length); - } - - public final void read_ushort_array (org.omg.CORBA.UShortSeqHolder seq, int offset, int length) { - impl.read_ushort_array(seq, offset, length); - } - - public final void read_long_array (org.omg.CORBA.LongSeqHolder seq, int offset, int length) { - impl.read_long_array(seq, offset, length); - } - - public final void read_ulong_array (org.omg.CORBA.ULongSeqHolder seq, int offset, int length) { - impl.read_ulong_array(seq, offset, length); - } - - public final void read_ulonglong_array (org.omg.CORBA.ULongLongSeqHolder seq, int offset, int length) { - impl.read_ulonglong_array(seq, offset, length); - } - - public final void read_longlong_array (org.omg.CORBA.LongLongSeqHolder seq, int offset, int length) { - impl.read_longlong_array(seq, offset, length); - } - - public final void read_float_array (org.omg.CORBA.FloatSeqHolder seq, int offset, int length) { - impl.read_float_array(seq, offset, length); - } - - public final void read_double_array (org.omg.CORBA.DoubleSeqHolder seq, int offset, int length) { - impl.read_double_array(seq, offset, length); - } - - // org.omg.CORBA.portable.ValueBase - public final String[] _truncatable_ids() { - return impl._truncatable_ids(); - } - - // java.io.InputStream - public final int read(byte b[]) throws IOException { - return impl.read(b); - } - - public final int read(byte b[], int off, int len) throws IOException { - return impl.read(b, off, len); - } - - public final long skip(long n) throws IOException { - return impl.skip(n); - } - - public final int available() throws IOException { - return impl.available(); - } - - public final void close() throws IOException { - impl.close(); - } - - public final void mark(int readlimit) { - impl.mark(readlimit); - } - - public final void reset() { - impl.reset(); - } - - public final boolean markSupported() { - return impl.markSupported(); - } - - public abstract CDRInputStream dup(); - - // Needed by TCUtility - public final java.math.BigDecimal read_fixed(short digits, short scale) { - return impl.read_fixed(digits, scale); - } - - public final boolean isLittleEndian() { - return impl.isLittleEndian(); - } - - protected final ByteBuffer getByteBuffer() { - return impl.getByteBuffer(); - } - - protected final void setByteBuffer(ByteBuffer byteBuffer) { - impl.setByteBuffer(byteBuffer); - } - - protected final void setByteBufferWithInfo(ByteBufferWithInfo bbwi) { - impl.setByteBufferWithInfo(bbwi); - } - - /** - * return true if our ByteBuffer is sharing/equal to bb - */ - protected final boolean isSharing(ByteBuffer bb) { - return (getByteBuffer() == bb); - } - - public final int getBufferLength() { - return impl.getBufferLength(); - } - - protected final void setBufferLength(int value) { - impl.setBufferLength(value); - } - - protected final int getIndex() { - return impl.getIndex(); - } - - protected final void setIndex(int value) { - impl.setIndex(value); - } - - public final void orb(org.omg.CORBA.ORB orb) { - impl.orb(orb); - } - - public final GIOPVersion getGIOPVersion() { - return impl.getGIOPVersion(); - } - - public final BufferManagerRead getBufferManager() { - return impl.getBufferManager(); - } - - // This should be overridden by any stream (ex: IIOPInputStream) - // which wants to read values. Thus, TypeCodeInputStream doesn't - // have to do this. - public CodeBase getCodeBase() { - return null; - } - - // Use Latin-1 for GIOP 1.0 or when code set negotiation was not - // performed. - protected CodeSetConversion.BTCConverter createCharBTCConverter() { - return CodeSetConversion.impl().getBTCConverter(OSFCodeSetRegistry.ISO_8859_1, - impl.isLittleEndian()); - } - - // Subclasses must decide what to do here. It's inconvenient to - // make the class and this method abstract because of dup(). - protected abstract CodeSetConversion.BTCConverter createWCharBTCConverter(); - - // Prints the current buffer in a human readable form - void printBuffer() { - impl.printBuffer(); - } - - /** - * Aligns the current position on the given octet boundary - * if there are enough bytes available to do so. Otherwise, - * it just returns. This is used for some (but not all) - * GIOP 1.2 message headers. - */ - public void alignOnBoundary(int octetBoundary) { - impl.alignOnBoundary(octetBoundary); - } - - // Needed by request and reply messages for GIOP versions >= 1.2 only. - public void setHeaderPadding(boolean headerPadding) { - impl.setHeaderPadding(headerPadding); - } - - /** - * This must be called after determining the proper ORB version, - * and setting it on the stream's ORB instance. It can be called - * after reading the service contexts, since that is the only place - * we can get the ORB version info. - * - * Trying to unmarshal things requiring repository IDs before calling - * this will result in NullPtrExceptions. - */ - public void performORBVersionSpecificInit() { - // In the case of SystemExceptions, a stream is created - // with its default constructor (and thus no impl is set). - if (impl != null) - impl.performORBVersionSpecificInit(); - } - - /** - * Resets any internal references to code set converters. - * This is useful for forcing the CDR stream to reacquire - * converters (probably from its subclasses) when state - * has changed. - */ - public void resetCodeSetConverters() { - impl.resetCodeSetConverters(); - } - - public void setMessageMediator(MessageMediator messageMediator) - { - this.messageMediator = (CorbaMessageMediator) messageMediator; - } - - public MessageMediator getMessageMediator() - { - return messageMediator; - } - - // ValueInputStream ----------------------------- - - public void start_value() { - impl.start_value(); - } - - public void end_value() { - impl.end_value(); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDRInputStreamBase.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDRInputStreamBase.java deleted file mode 100644 index 1f0eedbaf7f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDRInputStreamBase.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.encoding; - -import java.io.IOException; -import java.io.Serializable; -import java.math.BigDecimal; -import java.nio.ByteBuffer; - -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.Principal; -import org.omg.CORBA.Any; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.org.omg.SendingContext.CodeBase; - -/** - * Describes CDRInputStream delegates and provides some - * implementation. Non-default constructors are avoided in - * the delegation to separate instantiation from initialization, - * so we use init methods. - */ -abstract class CDRInputStreamBase extends java.io.InputStream -{ - protected CDRInputStream parent; - - public void setParent(CDRInputStream parent) { - this.parent = parent; - } - - public abstract void init(org.omg.CORBA.ORB orb, - ByteBuffer byteBuffer, - int size, - boolean littleEndian, - BufferManagerRead bufferManager); - - // org.omg.CORBA.portable.InputStream - public abstract boolean read_boolean(); - public abstract char read_char(); - public abstract char read_wchar(); - public abstract byte read_octet(); - public abstract short read_short(); - public abstract short read_ushort(); - public abstract int read_long(); - public abstract int read_ulong(); - public abstract long read_longlong(); - public abstract long read_ulonglong(); - public abstract float read_float(); - public abstract double read_double(); - public abstract String read_string(); - public abstract String read_wstring(); - public abstract void read_boolean_array(boolean[] value, int offset, int length); - public abstract void read_char_array(char[] value, int offset, int length); - public abstract void read_wchar_array(char[] value, int offset, int length); - public abstract void read_octet_array(byte[] value, int offset, int length); - public abstract void read_short_array(short[] value, int offset, int length); - public abstract void read_ushort_array(short[] value, int offset, int length); - public abstract void read_long_array(int[] value, int offset, int length); - public abstract void read_ulong_array(int[] value, int offset, int length); - public abstract void read_longlong_array(long[] value, int offset, int length); - public abstract void read_ulonglong_array(long[] value, int offset, int length); - public abstract void read_float_array(float[] value, int offset, int length); - public abstract void read_double_array(double[] value, int offset, int length); - public abstract org.omg.CORBA.Object read_Object(); - public abstract TypeCode read_TypeCode(); - public abstract Any read_any(); - public abstract Principal read_Principal(); - public int read() throws java.io.IOException { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - public abstract java.math.BigDecimal read_fixed(); - public org.omg.CORBA.Context read_Context() { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - public abstract org.omg.CORBA.Object read_Object(java.lang.Class clz); - public abstract org.omg.CORBA.ORB orb(); - - // org.omg.CORBA_2_3.portable.InputStream - public abstract java.io.Serializable read_value(); - public abstract java.io.Serializable read_value(java.lang.Class clz); - public abstract java.io.Serializable read_value(org.omg.CORBA.portable.BoxedValueHelper factory); - public abstract java.io.Serializable read_value(java.lang.String rep_id); - public abstract java.io.Serializable read_value(java.io.Serializable value); - public abstract java.lang.Object read_abstract_interface(); - public abstract java.lang.Object read_abstract_interface(java.lang.Class clz); - - // com.sun.corba.se.impl.encoding.MarshalInputStream - public abstract void consumeEndian(); - public abstract int getPosition(); - - // org.omg.CORBA.DataInputStream - public abstract java.lang.Object read_Abstract (); - public abstract java.io.Serializable read_Value (); - public abstract void read_any_array (org.omg.CORBA.AnySeqHolder seq, int offset, int length); - public abstract void read_boolean_array (org.omg.CORBA.BooleanSeqHolder seq, int offset, int length); - public abstract void read_char_array (org.omg.CORBA.CharSeqHolder seq, int offset, int length); - public abstract void read_wchar_array (org.omg.CORBA.WCharSeqHolder seq, int offset, int length); - public abstract void read_octet_array (org.omg.CORBA.OctetSeqHolder seq, int offset, int length); - public abstract void read_short_array (org.omg.CORBA.ShortSeqHolder seq, int offset, int length); - public abstract void read_ushort_array (org.omg.CORBA.UShortSeqHolder seq, int offset, int length); - public abstract void read_long_array (org.omg.CORBA.LongSeqHolder seq, int offset, int length); - public abstract void read_ulong_array (org.omg.CORBA.ULongSeqHolder seq, int offset, int length); - public abstract void read_ulonglong_array (org.omg.CORBA.ULongLongSeqHolder seq, int offset, int length); - public abstract void read_longlong_array (org.omg.CORBA.LongLongSeqHolder seq, int offset, int length); - public abstract void read_float_array (org.omg.CORBA.FloatSeqHolder seq, int offset, int length); - public abstract void read_double_array (org.omg.CORBA.DoubleSeqHolder seq, int offset, int length); - - // org.omg.CORBA.portable.ValueBase - public abstract String[] _truncatable_ids(); - - // java.io.InputStream - // REVISIT - should we make these throw UnsupportedOperationExceptions? - // Right now, they'll go up to the java.io versions! - -// public abstract int read(byte b[]) throws IOException; -// public abstract int read(byte b[], int off, int len) throws IOException -// public abstract long skip(long n) throws IOException; -// public abstract int available() throws IOException; -// public abstract void close() throws IOException; - public abstract void mark(int readlimit); - public abstract void reset(); - - // This should return false so that outside users (people using the JDK) - // don't have any guarantees that mark/reset will work in their - // custom marshaling code. This is necessary since they could do things - // like expect obj1a == obj1b in the following code: - // - // is.mark(10000); - // Object obj1a = is.readObject(); - // is.reset(); - // Object obj1b = is.readObject(); - // - public boolean markSupported() { return false; } - - // Needed by AnyImpl and ServiceContexts - public abstract CDRInputStreamBase dup(); - - // Needed by TCUtility - public abstract java.math.BigDecimal read_fixed(short digits, short scale); - - // Needed by TypeCodeImpl - public abstract boolean isLittleEndian(); - - // Needed by request and reply messages for GIOP versions >= 1.2 only. - abstract void setHeaderPadding(boolean headerPadding); - - // Needed by IIOPInputStream and other subclasses - - public abstract ByteBuffer getByteBuffer(); - public abstract void setByteBuffer(ByteBuffer byteBuffer); - - public abstract void setByteBufferWithInfo(ByteBufferWithInfo bbwi); - - public abstract int getBufferLength(); - public abstract void setBufferLength(int value); - - public abstract int getIndex(); - public abstract void setIndex(int value); - - public abstract void orb(org.omg.CORBA.ORB orb); - - public abstract BufferManagerRead getBufferManager(); - public abstract GIOPVersion getGIOPVersion(); - - abstract CodeBase getCodeBase(); - - abstract void printBuffer(); - - abstract void alignOnBoundary(int octetBoundary); - - abstract void performORBVersionSpecificInit(); - - public abstract void resetCodeSetConverters(); - - // ValueInputStream ------------------------- - public abstract void start_value(); - public abstract void end_value(); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_0.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_0.java deleted file mode 100644 index 81a81df2acd..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_0.java +++ /dev/null @@ -1,2399 +0,0 @@ -/* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.encoding; - -import java.io.IOException; -import java.io.Serializable; -import java.io.ByteArrayInputStream; -import java.io.ObjectInputStream; -import java.io.IOException; -import java.io.StreamCorruptedException; -import java.io.OptionalDataException; -import java.io.IOException; - -import java.util.Stack; - -import java.net.URL; -import java.net.MalformedURLException; - -import java.nio.ByteBuffer; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -import java.math.BigDecimal; - -import java.rmi.Remote; -import java.rmi.StubNotFoundException; - -import java.security.AccessController; -import java.security.PrivilegedExceptionAction; -import java.security.PrivilegedActionException; - -import org.omg.CORBA.SystemException; -import org.omg.CORBA.Object; -import org.omg.CORBA.Principal; -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.Any; -import org.omg.CORBA.portable.Delegate; -import org.omg.CORBA.portable.ValueBase; -import org.omg.CORBA.portable.IndirectionException; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.TCKind; -import org.omg.CORBA.TypeCodePackage.BadKind; -import org.omg.CORBA.CustomMarshal; -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.Principal; -import org.omg.CORBA.Any; -import org.omg.CORBA.portable.BoxedValueHelper; -import org.omg.CORBA.portable.ValueFactory; -import org.omg.CORBA.portable.CustomValue; -import org.omg.CORBA.portable.StreamableValue; -import org.omg.CORBA.MARSHAL; -import org.omg.CORBA.portable.IDLEntity; - -import javax.rmi.PortableRemoteObject; -import javax.rmi.CORBA.Tie; -import javax.rmi.CORBA.Util; -import javax.rmi.CORBA.ValueHandler; - -import com.sun.corba.se.pept.protocol.MessageMediator; -import com.sun.corba.se.pept.transport.ByteBufferPool; - -import com.sun.corba.se.spi.protocol.RequestDispatcherRegistry; -import com.sun.corba.se.spi.protocol.CorbaClientDelegate; - -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.IORFactories; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; - -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.orb.ORBVersionFactory; -import com.sun.corba.se.spi.orb.ORBVersion; - -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; - -import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.spi.presentation.rmi.PresentationManager; -import com.sun.corba.se.spi.presentation.rmi.StubAdapter; -import com.sun.corba.se.spi.presentation.rmi.PresentationDefaults; - -import com.sun.corba.se.impl.logging.ORBUtilSystemException; -import com.sun.corba.se.impl.logging.OMGSystemException; - -import com.sun.corba.se.impl.corba.PrincipalImpl; -import com.sun.corba.se.impl.corba.TypeCodeImpl; -import com.sun.corba.se.impl.corba.CORBAObjectImpl; - -import com.sun.corba.se.impl.encoding.CDROutputObject; -import com.sun.corba.se.impl.encoding.CodeSetConversion; - -import com.sun.corba.se.impl.util.Utility; -import com.sun.corba.se.impl.util.RepositoryId; - -import com.sun.corba.se.impl.orbutil.RepositoryIdStrings; -import com.sun.corba.se.impl.orbutil.RepositoryIdInterface; -import com.sun.corba.se.impl.orbutil.RepositoryIdUtility; -import com.sun.corba.se.impl.orbutil.RepositoryIdFactory; - -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.orbutil.CacheTable; - - -import com.sun.org.omg.CORBA.portable.ValueHelper; - -import com.sun.org.omg.SendingContext.CodeBase; - -public class CDRInputStream_1_0 extends CDRInputStreamBase - implements RestorableInputStream -{ - private static final String kReadMethod = "read"; - private static final int maxBlockLength = 0x7fffff00; - - protected BufferManagerRead bufferManagerRead; - protected ByteBufferWithInfo bbwi; - - // Set to the ORB's transportDebugFlag value. This value is - // used if the ORB is null. - private boolean debug = false; - - protected boolean littleEndian; - protected ORB orb; - protected ORBUtilSystemException wrapper ; - protected OMGSystemException omgWrapper ; - protected ValueHandler valueHandler = null; - - // Value cache - private CacheTable valueCache = null; - - // Repository ID cache - private CacheTable repositoryIdCache = null; - - // codebase cache - private CacheTable codebaseCache = null; - - // Current Class Stack (repository Ids of current class being read) - // private Stack currentStack = null; - - // Length of current chunk, or a large positive number if not in a chunk - protected int blockLength = maxBlockLength; - - // Read end flag (value nesting depth) - protected int end_flag = 0; - - // Beginning with the resolution to interop issue 3526 (4328?), - // only enclosing chunked valuetypes are taken into account - // when computing the nesting level. However, we still need - // the old computation around for interoperability with our - // older ORBs. - private int chunkedValueNestingLevel = 0; - - // Flag used to determine whether blocksize was zero - // private int checkForNullBlock = -1; - - // In block flag - // private boolean inBlock = false; - - // Indicates whether we are inside a value - // private boolean outerValueDone = true; - - // Int used by read_value(Serializable) that is set by this class - // before calling ValueFactory.read_value - protected int valueIndirection = 0; - - // Int set by readStringOrIndirection to communicate the actual - // offset of the string length field back to the caller - protected int stringIndirection = 0; - - // Flag indicating whether we are unmarshalling a chunked value - protected boolean isChunked = false; - - // Repository ID handlers - private RepositoryIdUtility repIdUtil; - private RepositoryIdStrings repIdStrs; - - // Code set converters (created when first needed) - private CodeSetConversion.BTCConverter charConverter; - private CodeSetConversion.BTCConverter wcharConverter; - - // RMI-IIOP stream format version 2 case in which we know - // that there is no more optional data available. If the - // Serializable's readObject method tries to read anything, - // we must throw a MARSHAL with the special minor code - // so that the ValueHandler can give the correct exception - // to readObject. The state is cleared when the ValueHandler - // calls end_value after the readObject method exits. - private boolean specialNoOptionalDataState = false; - - // Template method - public CDRInputStreamBase dup() - { - CDRInputStreamBase result = null ; - - try { - result = (CDRInputStreamBase)this.getClass().newInstance(); - } catch (Exception e) { - throw wrapper.couldNotDuplicateCdrInputStream( e ) ; - } - result.init(this.orb, - this.bbwi.byteBuffer, - this.bbwi.buflen, - this.littleEndian, - this.bufferManagerRead); - - ((CDRInputStream_1_0)result).bbwi.position(this.bbwi.position()); - // To ensure we keep bbwi.byteBuffer.limit in sync with bbwi.buflen. - ((CDRInputStream_1_0)result).bbwi.byteBuffer.limit(this.bbwi.buflen); - - return result; - } - - /** - * NOTE: size passed to init means buffer size - */ - public void init(org.omg.CORBA.ORB orb, - ByteBuffer byteBuffer, - int size, - boolean littleEndian, - BufferManagerRead bufferManager) - { - this.orb = (ORB)orb; - this.wrapper = ORBUtilSystemException.get( (ORB)orb, - CORBALogDomains.RPC_ENCODING ) ; - this.omgWrapper = OMGSystemException.get( (ORB)orb, - CORBALogDomains.RPC_ENCODING ) ; - this.littleEndian = littleEndian; - this.bufferManagerRead = bufferManager; - this.bbwi = new ByteBufferWithInfo(orb,byteBuffer,0); - this.bbwi.buflen = size; - this.bbwi.byteBuffer.limit(bbwi.buflen); - this.markAndResetHandler = bufferManagerRead.getMarkAndResetHandler(); - - debug = ((ORB)orb).transportDebugFlag; - } - - // See description in CDRInputStream - void performORBVersionSpecificInit() { - createRepositoryIdHandlers(); - } - - private final void createRepositoryIdHandlers() - { - repIdUtil = RepositoryIdFactory.getRepIdUtility(); - repIdStrs = RepositoryIdFactory.getRepIdStringsFactory(); - } - - public GIOPVersion getGIOPVersion() { - return GIOPVersion.V1_0; - } - - // Called by Request and Reply message. Valid for GIOP versions >= 1.2 only. - // Illegal for GIOP versions < 1.2. - void setHeaderPadding(boolean headerPadding) { - throw wrapper.giopVersionError(); - } - - protected final int computeAlignment(int index, int align) { - if (align > 1) { - int incr = index & (align - 1); - if (incr != 0) - return align - incr; - } - - return 0; - } - - public int getSize() - { - return bbwi.position(); - } - - protected void checkBlockLength(int align, int dataSize) { - // Since chunks can end at arbitrary points (though not within - // primitive CDR types, arrays of primitives, strings, wstrings, - // or indirections), - // we must check here for termination of the current chunk. - if (!isChunked) - return; - - // RMI-IIOP stream format version 2 case in which we know - // that there is no more optional data available. If the - // Serializable's readObject method tries to read anything, - // we must throw a MARSHAL exception with the special minor code - // so that the ValueHandler can give the correct exception - // to readObject. The state is cleared when the ValueHandler - // calls end_value after the readObject method exits. - if (specialNoOptionalDataState) { - throw omgWrapper.rmiiiopOptionalDataIncompatible1() ; - } - - boolean checkForEndTag = false; - - // Are we at the end of the current chunk? If so, - // try to interpret the next long as a chunk length. - // (It has to be either a chunk length, end tag, - // or valuetag.) - // - // If it isn't a chunk length, blockLength will - // remain set to maxBlockLength. - if (blockLength == get_offset()) { - - blockLength = maxBlockLength; - start_block(); - - // What's next is either a valuetag or - // an end tag. If it's a valuetag, we're - // probably being called as part of the process - // to read the valuetag. If it's an end tag, - // then there isn't enough data left in - // this valuetype to read! - if (blockLength == maxBlockLength) - checkForEndTag = true; - - } else - if (blockLength < get_offset()) { - // Are we already past the end of the current chunk? - // This is always an error. - throw wrapper.chunkOverflow() ; - } - - // If what's next on the wire isn't a chunk length or - // what we want to read (which can't be split across chunks) - // won't fit in the current chunk, throw this exception. - // This probably means that we're in an RMI-IIOP - // Serializable's readObject method or a custom marshaled - // IDL type is reading too much/in an incorrect order - int requiredNumBytes = - computeAlignment(bbwi.position(), align) + dataSize; - - if (blockLength != maxBlockLength && - blockLength < get_offset() + requiredNumBytes) { - throw omgWrapper.rmiiiopOptionalDataIncompatible2() ; - } - - // REVISIT - We should look at using the built in advancement - // of using ByteBuffer.get() rather than explicitly - // advancing the ByteBuffer's position. - // This is true for anywhere we are incrementing - // the ByteBuffer's position. - if (checkForEndTag) { - int nextLong = read_long(); - bbwi.position(bbwi.position() - 4); - - // It was an end tag, so there wasn't enough data - // left in the valuetype's encoding on the wire - // to read what we wanted - if (nextLong < 0) - throw omgWrapper.rmiiiopOptionalDataIncompatible3() ; - } - } - - protected void alignAndCheck(int align, int n) { - - checkBlockLength(align, n); - - // WARNING: Must compute real alignment after calling - // checkBlockLength since it may move the position - int alignResult = computeAlignment(bbwi.position(), align); - bbwi.position(bbwi.position() + alignResult); - - if (bbwi.position() + n > bbwi.buflen) - grow(align, n); - } - - // - // This can be overridden.... - // - protected void grow(int align, int n) { - - bbwi.needed = n; - - bbwi = bufferManagerRead.underflow(bbwi); - - } - - // - // Marshal primitives. - // - - public final void consumeEndian() { - littleEndian = read_boolean(); - } - - // No such type in java - public final double read_longdouble() { - throw wrapper.longDoubleNotImplemented( CompletionStatus.COMPLETED_MAYBE); - } - - public final boolean read_boolean() { - return (read_octet() != 0); - } - - public final char read_char() { - alignAndCheck(1, 1); - - return getConvertedChars(1, getCharConverter())[0]; - } - - public char read_wchar() { - - // Don't allow transmission of wchar/wstring data with - // foreign ORBs since it's against the spec. - if (ORBUtility.isForeignORB((ORB)orb)) { - throw wrapper.wcharDataInGiop10( CompletionStatus.COMPLETED_MAYBE); - } - - // If we're talking to one of our legacy ORBs, do what - // they did: - int b1, b2; - - alignAndCheck(2, 2); - - if (littleEndian) { - b2 = bbwi.byteBuffer.get(bbwi.position()) & 0x00FF; - bbwi.position(bbwi.position() + 1); - b1 = bbwi.byteBuffer.get(bbwi.position()) & 0x00FF; - bbwi.position(bbwi.position() + 1); - } else { - b1 = bbwi.byteBuffer.get(bbwi.position()) & 0x00FF; - bbwi.position(bbwi.position() + 1); - b2 = bbwi.byteBuffer.get(bbwi.position()) & 0x00FF; - bbwi.position(bbwi.position() + 1); - } - - return (char)((b1 << 8) + (b2 << 0)); - } - - public final byte read_octet() { - - alignAndCheck(1, 1); - - byte b = bbwi.byteBuffer.get(bbwi.position()); - bbwi.position(bbwi.position() + 1); - - return b; - } - - public final short read_short() { - int b1, b2; - - alignAndCheck(2, 2); - - if (littleEndian) { - b2 = (bbwi.byteBuffer.get(bbwi.position()) << 0) & 0x000000FF; - bbwi.position(bbwi.position() + 1); - b1 = (bbwi.byteBuffer.get(bbwi.position()) << 8) & 0x0000FF00; - bbwi.position(bbwi.position() + 1); - } else { - b1 = (bbwi.byteBuffer.get(bbwi.position()) << 8) & 0x0000FF00; - bbwi.position(bbwi.position() + 1); - b2 = (bbwi.byteBuffer.get(bbwi.position()) << 0) & 0x000000FF; - bbwi.position(bbwi.position() + 1); - } - - return (short)(b1 | b2); - } - - public final short read_ushort() { - return read_short(); - } - - public final int read_long() { - int b1, b2, b3, b4; - - alignAndCheck(4, 4); - - int bufPos = bbwi.position(); - if (littleEndian) { - b4 = bbwi.byteBuffer.get(bufPos++) & 0xFF; - b3 = bbwi.byteBuffer.get(bufPos++) & 0xFF; - b2 = bbwi.byteBuffer.get(bufPos++) & 0xFF; - b1 = bbwi.byteBuffer.get(bufPos++) & 0xFF; - } else { - b1 = bbwi.byteBuffer.get(bufPos++) & 0xFF; - b2 = bbwi.byteBuffer.get(bufPos++) & 0xFF; - b3 = bbwi.byteBuffer.get(bufPos++) & 0xFF; - b4 = bbwi.byteBuffer.get(bufPos++) & 0xFF; - } - bbwi.position(bufPos); - - return (b1 << 24) | (b2 << 16) | (b3 << 8) | b4; - } - - public final int read_ulong() { - return read_long(); - } - - public final long read_longlong() { - long i1, i2; - - alignAndCheck(8, 8); - - if (littleEndian) { - i2 = read_long() & 0xFFFFFFFFL; - i1 = (long)read_long() << 32; - } else { - i1 = (long)read_long() << 32; - i2 = read_long() & 0xFFFFFFFFL; - } - - return (i1 | i2); - } - - public final long read_ulonglong() { - return read_longlong(); - } - - public final float read_float() { - return Float.intBitsToFloat(read_long()); - } - - public final double read_double() { - return Double.longBitsToDouble(read_longlong()); - } - - protected final void checkForNegativeLength(int length) { - if (length < 0) - throw wrapper.negativeStringLength( CompletionStatus.COMPLETED_MAYBE, - new Integer(length) ) ; - } - - protected final String readStringOrIndirection(boolean allowIndirection) { - - int len = read_long(); - - // - // Check for indirection - // - if (allowIndirection) { - if (len == 0xffffffff) - return null; - else - stringIndirection = get_offset() - 4; - } - - checkForNegativeLength(len); - - return internalReadString(len); - } - - private final String internalReadString(int len) { - // Workaround for ORBs which send string lengths of - // zero to mean empty string. - // - // IMPORTANT: Do not replace 'new String("")' with "", it may result - // in a Serialization bug (See serialization.zerolengthstring) and - // bug id: 4728756 for details - if (len == 0) - return new String(""); - - char[] result = getConvertedChars(len - 1, getCharConverter()); - - // Skip over the 1 byte null - read_octet(); - - return new String(result, 0, getCharConverter().getNumChars()); - } - - public final String read_string() { - return readStringOrIndirection(false); - } - - public String read_wstring() { - // Don't allow transmission of wchar/wstring data with - // foreign ORBs since it's against the spec. - if (ORBUtility.isForeignORB((ORB)orb)) { - throw wrapper.wcharDataInGiop10( CompletionStatus.COMPLETED_MAYBE); - } - - int len = read_long(); - - // - // Workaround for ORBs which send string lengths of - // zero to mean empty string. - // - // - // IMPORTANT: Do not replace 'new String("")' with "", it may result - // in a Serialization bug (See serialization.zerolengthstring) and - // bug id: 4728756 for details - if (len == 0) - return new String(""); - - checkForNegativeLength(len); - - len--; - char[] c = new char[len]; - - for (int i = 0; i < len; i++) - c[i] = read_wchar(); - - // skip the two null terminator bytes - read_wchar(); - // bbwi.position(bbwi.position() + 2); - - return new String(c); - } - - public final void read_octet_array(byte[] b, int offset, int length) { - if ( b == null ) - throw wrapper.nullParam() ; - - // Must call alignAndCheck at least once to ensure - // we aren't at the end of a chunk. Of course, we - // should only call it if we actually need to read - // something, otherwise we might end up with an - // exception at the end of the stream. - if (length == 0) - return; - - alignAndCheck(1, 1); - - int n = offset; - while (n < length+offset) { - int avail; - int bytes; - int wanted; - - avail = bbwi.buflen - bbwi.position(); - if (avail <= 0) { - grow(1, 1); - avail = bbwi.buflen - bbwi.position(); - } - wanted = (length + offset) - n; - bytes = (wanted < avail) ? wanted : avail; - // Microbenchmarks are showing a loop of ByteBuffer.get(int) being - // faster than ByteBuffer.get(byte[], int, int). - for (int i = 0; i < bytes; i++) { - b[n+i] = bbwi.byteBuffer.get(bbwi.position() + i); - } - - bbwi.position(bbwi.position() + bytes); - - n += bytes; - } - } - - public Principal read_Principal() { - int len = read_long(); - byte[] pvalue = new byte[len]; - read_octet_array(pvalue,0,len); - - Principal p = new PrincipalImpl(); - p.name(pvalue); - return p; - } - - public TypeCode read_TypeCode() { - TypeCodeImpl tc = new TypeCodeImpl(orb); - tc.read_value(parent); - return tc; - } - - public Any read_any() { - Any any = orb.create_any(); - TypeCodeImpl tc = new TypeCodeImpl(orb); - - // read off the typecode - - // REVISIT We could avoid this try-catch if we could peek the typecode - // kind off this stream and see if it is a tk_value. Looking at the - // code we know that for tk_value the Any.read_value() below - // ignores the tc argument anyway (except for the kind field). - // But still we would need to make sure that the whole typecode, - // including encapsulations, is read off. - try { - tc.read_value(parent); - } catch (MARSHAL ex) { - if (tc.kind().value() != TCKind._tk_value) - throw ex; - // We can be sure that the whole typecode encapsulation has been - // read off. - dprintThrowable(ex); - } - // read off the value of the any - any.read_value(parent, tc); - - return any; - } - - public org.omg.CORBA.Object read_Object() { - return read_Object(null); - } - - // ------------ RMI related methods -------------------------- - - // IDL to Java ptc-00-01-08 1.21.4.1 - // - // The clz argument to read_Object can be either a stub - // Class or the "Class object for the RMI/IDL interface type - // that is statically expected." - // This functions as follows: - // 1. If clz==null, just use the repository ID from the stub - // 2. If clz is a stub class, just use it as a static factory. - // clz is a stub class iff StubAdapter.isStubClass( clz ). - // In addition, clz is a IDL stub class iff - // IDLEntity.class.isAssignableFrom( clz ). - // 3. If clz is an interface, use it to create the appropriate - // stub factory. - - public org.omg.CORBA.Object read_Object(Class clz) - { - // In any case, we must first read the IOR. - IOR ior = IORFactories.makeIOR(parent) ; - if (ior.isNil()) { - return null ; - } - - PresentationManager.StubFactoryFactory sff = ORB.getStubFactoryFactory() ; - String codeBase = ior.getProfile().getCodebase() ; - PresentationManager.StubFactory stubFactory = null ; - - if (clz == null) { - RepositoryId rid = RepositoryId.cache.getId( ior.getTypeId() ) ; - String className = rid.getClassName() ; - orb.validateIORClass(className); - boolean isIDLInterface = rid.isIDLType() ; - - if (className == null || className.equals( "" )) - stubFactory = null ; - else - try { - stubFactory = sff.createStubFactory( className, - isIDLInterface, codeBase, (Class)null, - (ClassLoader)null ); - } catch (Exception exc) { - // Could not create stubFactory, so use null. - // XXX stubFactory handling is still too complex: - // Can we resolve the stubFactory question once in - // a single place? - stubFactory = null ; - } - } else if (StubAdapter.isStubClass( clz )) { - stubFactory = PresentationDefaults.makeStaticStubFactory( - clz ) ; - } else { - // clz is an interface class - boolean isIDL = IDLEntity.class.isAssignableFrom( clz ) ; - stubFactory = sff.createStubFactory( clz.getName(), - isIDL, codeBase, clz, clz.getClassLoader() ) ; - } - return internalIORToObject( ior, stubFactory, orb ) ; - } - - /* - * This is used as a general utility (e.g., the PortableInterceptor - * implementation uses it. If stubFactory is null, the ior's - * IIOPProfile must support getServant. - */ - public static org.omg.CORBA.Object internalIORToObject( - IOR ior, PresentationManager.StubFactory stubFactory, ORB orb) - { - ORBUtilSystemException wrapper = ORBUtilSystemException.get( - (ORB)orb, CORBALogDomains.RPC_ENCODING ) ; - - java.lang.Object servant = ior.getProfile().getServant() ; - if (servant != null ) { - if (servant instanceof Tie) { - String codebase = ior.getProfile().getCodebase(); - org.omg.CORBA.Object objref = (org.omg.CORBA.Object) - Utility.loadStub( (Tie)servant, stubFactory, codebase, - false); - - // If we managed to load a stub, return it, otherwise we - // must fail... - if (objref != null) { - return objref; - } else { - throw wrapper.readObjectException() ; - } - } else if (servant instanceof org.omg.CORBA.Object) { - if (!(servant instanceof - org.omg.CORBA.portable.InvokeHandler)) { - return (org.omg.CORBA.Object) servant; - } - } else - throw wrapper.badServantReadObject() ; - } - - CorbaClientDelegate del = ORBUtility.makeClientDelegate( ior ) ; - org.omg.CORBA.Object objref = null ; - try { - objref = stubFactory.makeStub() ; - } catch (Throwable e) { - wrapper.stubCreateError( e ) ; - - if (e instanceof ThreadDeath) { - throw (ThreadDeath) e; - } - - // Return the "default" stub... - objref = new CORBAObjectImpl() ; - } - - StubAdapter.setDelegate( objref, del ) ; - return objref; - } - - public java.lang.Object read_abstract_interface() - { - return read_abstract_interface(null); - } - - public java.lang.Object read_abstract_interface(java.lang.Class clz) - { - boolean object = read_boolean(); - - if (object) { - return read_Object(clz); - } else { - return read_value(); - } - } - - public Serializable read_value() - { - return read_value((Class)null); - } - - private Serializable handleIndirection() { - int indirection = read_long() + get_offset() - 4; - if (valueCache != null && valueCache.containsVal(indirection)) { - - java.io.Serializable cachedValue - = (java.io.Serializable)valueCache.getKey(indirection); - return cachedValue; - } else { - // In RMI-IIOP the ValueHandler will recognize this - // exception and use the provided indirection value - // to lookup a possible indirection to an object - // currently on the deserialization stack. - throw new IndirectionException(indirection); - } - } - - private String readRepositoryIds(int valueTag, - Class expectedType, - String expectedTypeRepId) { - return readRepositoryIds(valueTag, expectedType, - expectedTypeRepId, null); - } - - /** - * Examines the valuetag to see how many (if any) repository IDs - * are present on the wire. If no repository ID information - * is on the wire but the expectedType or expectedTypeRepId - * is known, it will return one of those (favoring the - * expectedType's repId). Failing that, it uses the supplied - * BoxedValueHelper to obtain the repository ID, as a last resort. - */ - private String readRepositoryIds(int valueTag, - Class expectedType, - String expectedTypeRepId, - BoxedValueHelper factory) { - switch(repIdUtil.getTypeInfo(valueTag)) { - case RepositoryIdUtility.NO_TYPE_INFO : - // Throw an exception if we have no repository ID info and - // no expectedType to work with. Otherwise, how would we - // know what to unmarshal? - if (expectedType == null) { - if (expectedTypeRepId != null) { - return expectedTypeRepId; - } else if (factory != null) { - return factory.get_id(); - } else { - throw wrapper.expectedTypeNullAndNoRepId( - CompletionStatus.COMPLETED_MAYBE); - } - } - return repIdStrs.createForAnyType(expectedType); - case RepositoryIdUtility.SINGLE_REP_TYPE_INFO : - return read_repositoryId(); - case RepositoryIdUtility.PARTIAL_LIST_TYPE_INFO : - return read_repositoryIds(); - default: - throw wrapper.badValueTag( CompletionStatus.COMPLETED_MAYBE, - Integer.toHexString(valueTag) ) ; - } - } - - public Serializable read_value(Class expectedType) { - - // Read value tag - int vType = readValueTag(); - - // Is value null? - if (vType == 0) - return null; - - // Is this an indirection to a previously - // read valuetype? - if (vType == 0xffffffff) - return handleIndirection(); - - // Save where this valuetype started so we - // can put it in the indirection valueCache - // later - int indirection = get_offset() - 4; - - // Need to save this special marker variable - // to restore its value during recursion - boolean saveIsChunked = isChunked; - - isChunked = repIdUtil.isChunkedEncoding(vType); - - java.lang.Object value = null; - - String codebase_URL = null; - if (repIdUtil.isCodeBasePresent(vType)) { - codebase_URL = read_codebase_URL(); - } - - // Read repository id(s) - String repositoryIDString - = readRepositoryIds(vType, expectedType, null); - - // If isChunked was determined to be true based - // on the valuetag, this will read a chunk length - start_block(); - - // Remember that end_flag keeps track of all nested - // valuetypes and is used for older ORBs - end_flag--; - if (isChunked) - chunkedValueNestingLevel--; - - if (repositoryIDString.equals(repIdStrs.getWStringValueRepId())) { - value = read_wstring(); - } else - if (repositoryIDString.equals(repIdStrs.getClassDescValueRepId())) { - // read in the class whether with the old ClassDesc or the - // new one - value = readClass(); - } else { - - Class valueClass = expectedType; - - // By this point, either the expectedType or repositoryIDString - // is guaranteed to be non-null. - if (expectedType == null || - !repositoryIDString.equals(repIdStrs.createForAnyType(expectedType))) { - - valueClass = getClassFromString(repositoryIDString, - codebase_URL, - expectedType); - } - - if (valueClass == null) { - // No point attempting to use value handler below, since the - // class information is not available. - throw wrapper.couldNotFindClass( - CompletionStatus.COMPLETED_MAYBE, - new ClassNotFoundException()); - } - - if (valueClass != null && - org.omg.CORBA.portable.IDLEntity.class.isAssignableFrom(valueClass)) { - - value = readIDLValue(indirection, - repositoryIDString, - valueClass, - codebase_URL); - - } else { - - // Must be some form of RMI-IIOP valuetype - - try { - if (valueHandler == null) - valueHandler = ORBUtility.createValueHandler(); - - value = valueHandler.readValue(parent, - indirection, - valueClass, - repositoryIDString, - getCodeBase()); - - } catch(SystemException sysEx) { - // Just rethrow any CORBA system exceptions - // that come out of the ValueHandler - throw sysEx; - } catch(Exception ex) { - throw wrapper.valuehandlerReadException( - CompletionStatus.COMPLETED_MAYBE, ex ) ; - } catch(Error e) { - throw wrapper.valuehandlerReadError( - CompletionStatus.COMPLETED_MAYBE, e ) ; - } - } - } - - // Skip any remaining chunks until we get to - // an end tag or a valuetag. If we see a valuetag, - // that means there was another valuetype in the sender's - // version of this class that we need to skip over. - handleEndOfValue(); - - // Read and process the end tag if we're chunking. - // Assumes that we're at the position of the end tag - // (handleEndOfValue should assure this) - readEndTag(); - - // Cache the valuetype that we read - if (valueCache == null) - valueCache = new CacheTable(orb,false); - valueCache.put(value, indirection); - - // Allow for possible continuation chunk. - // If we're a nested valuetype inside of a chunked - // valuetype, and that enclosing valuetype has - // more data to write, it will need to have this - // new chunk begin after we wrote our end tag. - isChunked = saveIsChunked; - start_block(); - - return (java.io.Serializable)value; - } - - public Serializable read_value(BoxedValueHelper factory) { - - // Read value tag - int vType = readValueTag(); - - if (vType == 0) - return null; // value is null - else if (vType == 0xffffffff) { // Indirection tag - int indirection = read_long() + get_offset() - 4; - if (valueCache != null && valueCache.containsVal(indirection)) - { - java.io.Serializable cachedValue = - (java.io.Serializable)valueCache.getKey(indirection); - return cachedValue; - } - else { - throw new IndirectionException(indirection); - } - } - else { - int indirection = get_offset() - 4; - - // end_block(); - - boolean saveIsChunked = isChunked; - isChunked = repIdUtil.isChunkedEncoding(vType); - - java.lang.Object value = null; - - String codebase_URL = null; - if (repIdUtil.isCodeBasePresent(vType)){ - codebase_URL = read_codebase_URL(); - } - - // Read repository id - String repositoryIDString - = readRepositoryIds(vType, null, null, factory); - - // Compare rep. ids to see if we should use passed helper - if (!repositoryIDString.equals(factory.get_id())) - factory = Utility.getHelper(null, codebase_URL, repositoryIDString); - - start_block(); - end_flag--; - if (isChunked) - chunkedValueNestingLevel--; - - if (factory instanceof ValueHelper) { - value = readIDLValueWithHelper((ValueHelper)factory, indirection); - } else { - valueIndirection = indirection; // for callback - value = factory.read_value(parent); - } - - handleEndOfValue(); - readEndTag(); - - // Put into valueCache - if (valueCache == null) - valueCache = new CacheTable(orb,false); - valueCache.put(value, indirection); - - // allow for possible continuation chunk - isChunked = saveIsChunked; - start_block(); - - return (java.io.Serializable)value; - } - } - - private boolean isCustomType(ValueHelper helper) { - try{ - TypeCode tc = helper.get_type(); - int kind = tc.kind().value(); - if (kind == TCKind._tk_value) { - return (tc.type_modifier() == org.omg.CORBA.VM_CUSTOM.value); - } - } catch(BadKind ex) { - throw wrapper.badKind(ex) ; - } - - return false; - } - - // This method is actually called indirectly by - // read_value(String repositoryId). - // Therefore, it is not a truly independent read call that handles - // header information itself. - public java.io.Serializable read_value(java.io.Serializable value) { - - // Put into valueCache using valueIndirection - if (valueCache == null) - valueCache = new CacheTable(orb,false); - valueCache.put(value, valueIndirection); - - if (value instanceof StreamableValue) - ((StreamableValue)value)._read(parent); - else if (value instanceof CustomValue) - ((CustomValue)value).unmarshal(parent); - - return value; - } - - public java.io.Serializable read_value(java.lang.String repositoryId) { - - // if (inBlock) - // end_block(); - - // Read value tag - int vType = readValueTag(); - - if (vType == 0) - return null; // value is null - else if (vType == 0xffffffff) { // Indirection tag - int indirection = read_long() + get_offset() - 4; - if (valueCache != null && valueCache.containsVal(indirection)) - { - java.io.Serializable cachedValue = - (java.io.Serializable)valueCache.getKey(indirection); - return cachedValue; - } - else { - throw new IndirectionException(indirection); - } - } - else { - int indirection = get_offset() - 4; - - // end_block(); - - boolean saveIsChunked = isChunked; - isChunked = repIdUtil.isChunkedEncoding(vType); - - java.lang.Object value = null; - - String codebase_URL = null; - if (repIdUtil.isCodeBasePresent(vType)){ - codebase_URL = read_codebase_URL(); - } - - // Read repository id - String repositoryIDString - = readRepositoryIds(vType, null, repositoryId); - - ValueFactory factory = - Utility.getFactory(null, codebase_URL, orb, repositoryIDString); - - start_block(); - end_flag--; - if (isChunked) - chunkedValueNestingLevel--; - - valueIndirection = indirection; // for callback - value = factory.read_value(parent); - - handleEndOfValue(); - readEndTag(); - - // Put into valueCache - if (valueCache == null) - valueCache = new CacheTable(orb,false); - valueCache.put(value, indirection); - - // allow for possible continuation chunk - isChunked = saveIsChunked; - start_block(); - - return (java.io.Serializable)value; - } - } - - private Class readClass() { - - String codebases = null, classRepId = null; - - if (orb == null || - ORBVersionFactory.getFOREIGN().equals(orb.getORBVersion()) || - ORBVersionFactory.getNEWER().compareTo(orb.getORBVersion()) <= 0) { - - codebases = (String)read_value(java.lang.String.class); - classRepId = (String)read_value(java.lang.String.class); - } else { - // Pre-Merlin/J2EE 1.3 ORBs wrote the repository ID - // and codebase strings in the wrong order. - classRepId = (String)read_value(java.lang.String.class); - codebases = (String)read_value(java.lang.String.class); - } - - if (debug) { - dprint("readClass codebases: " - + codebases - + " rep Id: " - + classRepId); - } - - Class cl = null; - - RepositoryIdInterface repositoryID - = repIdStrs.getFromString(classRepId); - - try { - cl = repositoryID.getClassFromType(codebases); - } catch(ClassNotFoundException cnfe) { - throw wrapper.cnfeReadClass( CompletionStatus.COMPLETED_MAYBE, - cnfe, repositoryID.getClassName() ) ; - } catch(MalformedURLException me) { - throw wrapper.malformedUrl( CompletionStatus.COMPLETED_MAYBE, - me, repositoryID.getClassName(), codebases ) ; - } - - return cl; - } - - private java.lang.Object readIDLValueWithHelper(ValueHelper helper, int indirection) - { - // look for two-argument static read method - Method readMethod; - try { - Class argTypes[] = {org.omg.CORBA.portable.InputStream.class, helper.get_class()}; - readMethod = helper.getClass().getDeclaredMethod(kReadMethod, argTypes); - } - catch(NoSuchMethodException nsme) { // must be boxed value helper - java.lang.Object result = helper.read_value(parent); - return result; - } - - // found two-argument read method, so must be non-boxed value... - // ...create a blank instance - java.lang.Object val = null; - try { - val = helper.get_class().newInstance(); - } catch(java.lang.InstantiationException ie) { - throw wrapper.couldNotInstantiateHelper( ie, - helper.get_class() ) ; - } catch(IllegalAccessException iae){ - // Value's constructor is protected or private - // - // So, use the helper to read the value. - // - // NOTE : This means that in this particular case a recursive ref. - // would fail. - return helper.read_value(parent); - } - - // add blank instance to cache table - if (valueCache == null) - valueCache = new CacheTable(orb,false); - valueCache.put(val, indirection); - - // if custom type, call unmarshal method - if (val instanceof CustomMarshal && isCustomType(helper)) { - ((CustomMarshal)val).unmarshal(parent); - return val; - } - - // call two-argument read method using reflection - try { - java.lang.Object args[] = {parent, val}; - readMethod.invoke(helper, args); - return val; - } catch(IllegalAccessException iae2) { - throw wrapper.couldNotInvokeHelperReadMethod( iae2, helper.get_class() ) ; - } catch(InvocationTargetException ite){ - throw wrapper.couldNotInvokeHelperReadMethod( ite, helper.get_class() ) ; - } - } - - private java.lang.Object readBoxedIDLEntity(Class clazz, String codebase) - { - Class cls = null ; - - try { - ClassLoader clazzLoader = (clazz == null ? null : clazz.getClassLoader()); - - cls = Utility.loadClassForClass(clazz.getName()+"Helper", codebase, - clazzLoader, clazz, clazzLoader); - final Class helperClass = cls ; - - final Class argTypes[] = {org.omg.CORBA.portable.InputStream.class}; - - // getDeclaredMethod requires RuntimePermission accessDeclaredMembers - // if a different class loader is used (even though the javadoc says otherwise) - Method readMethod = null; - try { - readMethod = (Method)AccessController.doPrivileged( - new PrivilegedExceptionAction() { - public java.lang.Object run() throws NoSuchMethodException { - return helperClass.getDeclaredMethod(kReadMethod, argTypes); - } - } - ); - } catch (PrivilegedActionException pae) { - // this gets caught below - throw (NoSuchMethodException)pae.getException(); - } - - java.lang.Object args[] = {parent}; - return readMethod.invoke(null, args); - - } catch (ClassNotFoundException cnfe) { - throw wrapper.couldNotInvokeHelperReadMethod( cnfe, cls ) ; - } catch(NoSuchMethodException nsme) { - throw wrapper.couldNotInvokeHelperReadMethod( nsme, cls ) ; - } catch(IllegalAccessException iae) { - throw wrapper.couldNotInvokeHelperReadMethod( iae, cls ) ; - } catch(InvocationTargetException ite) { - throw wrapper.couldNotInvokeHelperReadMethod( ite, cls ) ; - } - } - - private java.lang.Object readIDLValue(int indirection, String repId, - Class clazz, String codebase) - { - ValueFactory factory ; - - // Always try to find a ValueFactory first, as required by the spec. - // There are some complications here in the IDL 3.0 mapping (see 1.13.8), - // but basically we must always be able to override the DefaultFactory - // or Helper mappings that are also used. This appears to be the case - // even in the boxed value cases. The original code only did the lookup - // in the case of class implementing either StreamableValue or CustomValue, - // but abstract valuetypes only implement ValueBase, and really require - // the use of the repId to find a factory (including the DefaultFactory). - try { - // use new-style OBV support (factory object) - factory = Utility.getFactory(clazz, codebase, orb, repId); - } catch (MARSHAL marshal) { - // XXX log marshal at one of the INFO levels - - // Could not get a factory, so try alternatives - if (!StreamableValue.class.isAssignableFrom(clazz) && - !CustomValue.class.isAssignableFrom(clazz) && - ValueBase.class.isAssignableFrom(clazz)) { - // use old-style OBV support (helper object) - BoxedValueHelper helper = Utility.getHelper(clazz, codebase, repId); - if (helper instanceof ValueHelper) - return readIDLValueWithHelper((ValueHelper)helper, indirection); - else - return helper.read_value(parent); - } else { - // must be a boxed IDLEntity, so make a reflective call to the - // helper's static read method... - return readBoxedIDLEntity(clazz, codebase); - } - } - - // If there was no error in getting the factory, use it. - valueIndirection = indirection; // for callback - return factory.read_value(parent); - } - - /** - * End tags are only written for chunked valuetypes. - * - * Before Merlin, our ORBs wrote end tags which took into account - * all enclosing valuetypes. This was changed by an interop resolution - * (see details around chunkedValueNestingLevel) to only include - * enclosing chunked types. - * - * ORB versioning and end tag compaction are handled here. - */ - private void readEndTag() { - if (isChunked) { - - // Read the end tag - int anEndTag = read_long(); - - // End tags should always be negative, and the outermost - // enclosing chunked valuetype should have a -1 end tag. - // - // handleEndOfValue should have assured that we were - // at the end tag position! - if (anEndTag >= 0) { - throw wrapper.positiveEndTag( CompletionStatus.COMPLETED_MAYBE, - new Integer(anEndTag), new Integer( get_offset() - 4 ) ) ; - } - - // If the ORB is null, or if we're sure we're talking to - // a foreign ORB, Merlin, or something more recent, we - // use the updated end tag computation, and are more strenuous - // about the values. - if (orb == null || - ORBVersionFactory.getFOREIGN().equals(orb.getORBVersion()) || - ORBVersionFactory.getNEWER().compareTo(orb.getORBVersion()) <= 0) { - - // If the end tag we read was less than what we were expecting, - // then the sender must think it's sent more enclosing - // chunked valuetypes than we have. Throw an exception. - if (anEndTag < chunkedValueNestingLevel) - throw wrapper.unexpectedEnclosingValuetype( - CompletionStatus.COMPLETED_MAYBE, new Integer( anEndTag ), - new Integer( chunkedValueNestingLevel ) ) ; - - // If the end tag is bigger than what we expected, but - // still negative, then the sender has done some end tag - // compaction. We back up the stream 4 bytes so that the - // next time readEndTag is called, it will get down here - // again. Even with fragmentation, we'll always be able - // to do this. - if (anEndTag != chunkedValueNestingLevel) { - bbwi.position(bbwi.position() - 4); - } - - } else { - - // When talking to Kestrel or Ladybird, we use our old - // end tag rules and are less strict. If the end tag - // isn't what we expected, we back up, assuming - // compaction. - if (anEndTag != end_flag) { - bbwi.position(bbwi.position() - 4); - } - } - - // This only keeps track of the enclosing chunked - // valuetypes - chunkedValueNestingLevel++; - } - - // This keeps track of all enclosing valuetypes - end_flag++; - } - - protected int get_offset() { - return bbwi.position(); - } - - private void start_block() { - - // if (outerValueDone) - if (!isChunked) - return; - - // if called from alignAndCheck, need to reset blockLength - // to avoid an infinite recursion loop on read_long() call - blockLength = maxBlockLength; - - blockLength = read_long(); - - // Must remember where we began the chunk to calculate how far - // along we are. See notes above about chunkBeginPos. - - if (blockLength > 0 && blockLength < maxBlockLength) { - blockLength += get_offset(); // _REVISIT_ unsafe, should use a Java long - - // inBlock = true; - } else { - - // System.out.println("start_block snooped a " + Integer.toHexString(blockLength)); - - // not a chunk length field - blockLength = maxBlockLength; - - bbwi.position(bbwi.position() - 4); - } - } - - // Makes sure that if we were reading a chunked value, we end up - // at the right place in the stream, no matter how little the - // unmarshalling code read. - // - // After calling this method, if we are chunking, we should be - // in position to read the end tag. - private void handleEndOfValue() { - - // If we're not chunking, we don't have to worry about - // skipping remaining chunks or finding end tags - if (!isChunked) - return; - - // Skip any remaining chunks - while (blockLength != maxBlockLength) { - end_block(); - start_block(); - } - - // Now look for the end tag - - // This is a little wasteful since we're reading - // this long up to 3 times in the worst cases (once - // in start_block, once here, and once in readEndTag - // - // Peek next long - int nextLong = read_long(); - bbwi.position(bbwi.position() - 4); - - // We did find an end tag, so we're done. readEndTag - // should take care of making sure it's the correct - // end tag, etc. Remember that since end tags, - // chunk lengths, and valuetags have non overlapping - // ranges, we can tell by the value what the longs are. - if (nextLong < 0) - return; - - if (nextLong == 0 || nextLong >= maxBlockLength) { - - // A custom marshaled valuetype left extra data - // on the wire, and that data had another - // nested value inside of it. We've just - // read the value tag or null of that nested value. - // - // In an attempt to get by it, we'll try to call - // read_value() to get the nested value off of - // the wire. Afterwards, we must call handleEndOfValue - // recursively to read any further chunks that the containing - // valuetype might still have after the nested - // value. - read_value(); - handleEndOfValue(); - } else { - // This probably means that the code to skip chunks has - // an error, and ended up setting blockLength to something - // other than maxBlockLength even though we weren't - // starting a new chunk. - throw wrapper.couldNotSkipBytes( CompletionStatus.COMPLETED_MAYBE, - new Integer( nextLong ), new Integer( get_offset() ) ) ; - } - } - - private void end_block() { - - // if in a chunk, check for underflow or overflow - if (blockLength != maxBlockLength) { - if (blockLength == get_offset()) { - // Chunk ended correctly - blockLength = maxBlockLength; - } else { - // Skip over anything left by bad unmarshaling code (ex: - // a buggy custom unmarshaler). See handleEndOfValue. - if (blockLength > get_offset()) { - skipToOffset(blockLength); - } else { - throw wrapper.badChunkLength( new Integer( blockLength ), - new Integer( get_offset() ) ) ; - } - } - } - } - - private int readValueTag(){ - // outerValueDone = false; - return read_long(); - } - - public org.omg.CORBA.ORB orb() { - return orb; - } - - // ------------ End RMI related methods -------------------------- - - public final void read_boolean_array(boolean[] value, int offset, int length) { - for(int i=0; i < length; i++) { - value[i+offset] = read_boolean(); - } - } - - public final void read_char_array(char[] value, int offset, int length) { - for(int i=0; i < length; i++) { - value[i+offset] = read_char(); - } - } - - public final void read_wchar_array(char[] value, int offset, int length) { - for(int i=0; i < length; i++) { - value[i+offset] = read_wchar(); - } - } - - public final void read_short_array(short[] value, int offset, int length) { - for(int i=0; i < length; i++) { - value[i+offset] = read_short(); - } - } - - public final void read_ushort_array(short[] value, int offset, int length) { - read_short_array(value, offset, length); - } - - public final void read_long_array(int[] value, int offset, int length) { - for(int i=0; i < length; i++) { - value[i+offset] = read_long(); - } - } - - public final void read_ulong_array(int[] value, int offset, int length) { - read_long_array(value, offset, length); - } - - public final void read_longlong_array(long[] value, int offset, int length) { - for(int i=0; i < length; i++) { - value[i+offset] = read_longlong(); - } - } - - public final void read_ulonglong_array(long[] value, int offset, int length) { - read_longlong_array(value, offset, length); - } - - public final void read_float_array(float[] value, int offset, int length) { - for(int i=0; i < length; i++) { - value[i+offset] = read_float(); - } - } - - public final void read_double_array(double[] value, int offset, int length) { - for(int i=0; i < length; i++) { - value[i+offset] = read_double(); - } - } - - public final void read_any_array(org.omg.CORBA.Any[] value, int offset, int length) { - for(int i=0; i < length; i++) { - value[i+offset] = read_any(); - } - } - - //--------------------------------------------------------------------// - // CDRInputStream state management. - // - - /** - * Are we at the end of the input stream? - */ -// public final boolean isAtEnd() { -// return bbwi.position() == bbwi.buflen; -// } - -// public int available() throws IOException { -// return bbwi.buflen - bbwi.position(); -// } - - private String read_repositoryIds() { - - // Read # of repository ids - int numRepIds = read_long(); - if (numRepIds == 0xffffffff) { - int indirection = read_long() + get_offset() - 4; - if (repositoryIdCache != null && repositoryIdCache.containsOrderedVal(indirection)) - return (String)repositoryIdCache.getKey(indirection); - else - throw wrapper.unableToLocateRepIdArray( new Integer( indirection ) ) ; - } else { - - // read first array element and store it as an indirection to the whole array - int indirection = get_offset(); - String repID = read_repositoryId(); - if (repositoryIdCache == null) - repositoryIdCache = new CacheTable(orb,false); - repositoryIdCache.put(repID, indirection); - - // read and ignore the subsequent array elements, but put them in the - // indirection table in case there are later indirections back to them - for (int i = 1; i < numRepIds; i++) { - read_repositoryId(); - } - - return repID; - } - } - - private final String read_repositoryId() - { - String result = readStringOrIndirection(true); - - if (result == null) { // Indirection - int indirection = read_long() + get_offset() - 4; - - if (repositoryIdCache != null && repositoryIdCache.containsOrderedVal(indirection)) - return (String)repositoryIdCache.getKey(indirection); - else - throw wrapper.badRepIdIndirection( CompletionStatus.COMPLETED_MAYBE, - new Integer(bbwi.position()) ) ; - } else { - if (repositoryIdCache == null) - repositoryIdCache = new CacheTable(orb,false); - repositoryIdCache.put(result, stringIndirection); - } - - return result ; - } - - private final String read_codebase_URL() - { - String result = readStringOrIndirection(true); - - if (result == null) { // Indirection - int indirection = read_long() + get_offset() - 4; - - if (codebaseCache != null && codebaseCache.containsVal(indirection)) - return (String)codebaseCache.getKey(indirection); - else - throw wrapper.badCodebaseIndirection( - CompletionStatus.COMPLETED_MAYBE, - new Integer(bbwi.position()) ) ; - } else { - if (codebaseCache == null) - codebaseCache = new CacheTable(orb,false); - codebaseCache.put(result, stringIndirection); - } - - return result; - } - - /* DataInputStream methods */ - - public java.lang.Object read_Abstract () { - return read_abstract_interface(); - } - - public java.io.Serializable read_Value () { - return read_value(); - } - - public void read_any_array (org.omg.CORBA.AnySeqHolder seq, int offset, int length) { - read_any_array(seq.value, offset, length); - } - - public void read_boolean_array (org.omg.CORBA.BooleanSeqHolder seq, int offset, int length) { - read_boolean_array(seq.value, offset, length); - } - - public void read_char_array (org.omg.CORBA.CharSeqHolder seq, int offset, int length) { - read_char_array(seq.value, offset, length); - } - - public void read_wchar_array (org.omg.CORBA.WCharSeqHolder seq, int offset, int length) { - read_wchar_array(seq.value, offset, length); - } - - public void read_octet_array (org.omg.CORBA.OctetSeqHolder seq, int offset, int length) { - read_octet_array(seq.value, offset, length); - } - - public void read_short_array (org.omg.CORBA.ShortSeqHolder seq, int offset, int length) { - read_short_array(seq.value, offset, length); - } - - public void read_ushort_array (org.omg.CORBA.UShortSeqHolder seq, int offset, int length) { - read_ushort_array(seq.value, offset, length); - } - - public void read_long_array (org.omg.CORBA.LongSeqHolder seq, int offset, int length) { - read_long_array(seq.value, offset, length); - } - - public void read_ulong_array (org.omg.CORBA.ULongSeqHolder seq, int offset, int length) { - read_ulong_array(seq.value, offset, length); - } - - public void read_ulonglong_array (org.omg.CORBA.ULongLongSeqHolder seq, int offset, int length) { - read_ulonglong_array(seq.value, offset, length); - } - - public void read_longlong_array (org.omg.CORBA.LongLongSeqHolder seq, int offset, int length) { - read_longlong_array(seq.value, offset, length); - } - - public void read_float_array (org.omg.CORBA.FloatSeqHolder seq, int offset, int length) { - read_float_array(seq.value, offset, length); - } - - public void read_double_array (org.omg.CORBA.DoubleSeqHolder seq, int offset, int length) { - read_double_array(seq.value, offset, length); - } - - public java.math.BigDecimal read_fixed(short digits, short scale) { - // digits isn't really needed here - StringBuffer buffer = read_fixed_buffer(); - if (digits != buffer.length()) - throw wrapper.badFixed( new Integer(digits), - new Integer(buffer.length()) ) ; - buffer.insert(digits - scale, '.'); - return new BigDecimal(buffer.toString()); - } - - // This method is unable to yield the correct scale. - public java.math.BigDecimal read_fixed() { - return new BigDecimal(read_fixed_buffer().toString()); - } - - // Each octet contains (up to) two decimal digits. - // If the fixed type has an odd number of decimal digits, then the representation - // begins with the first (most significant) digit. - // Otherwise, this first half-octet is all zero, and the first digit - // is in the second half-octet. - // The sign configuration, in the last half-octet of the representation, - // is 0xD for negative numbers and 0xC for positive and zero values. - private StringBuffer read_fixed_buffer() { - StringBuffer buffer = new StringBuffer(64); - byte doubleDigit; - int firstDigit; - int secondDigit; - boolean wroteFirstDigit = false; - boolean more = true; - while (more) { - doubleDigit = this.read_octet(); - firstDigit = (int)((doubleDigit & 0xf0) >> 4); - secondDigit = (int)(doubleDigit & 0x0f); - if (wroteFirstDigit || firstDigit != 0) { - buffer.append(Character.forDigit(firstDigit, 10)); - wroteFirstDigit = true; - } - if (secondDigit == 12) { - // positive number or zero - if ( ! wroteFirstDigit) { - // zero - return new StringBuffer("0.0"); - } else { - // positive number - // done - } - more = false; - } else if (secondDigit == 13) { - // negative number - buffer.insert(0, '-'); - more = false; - } else { - buffer.append(Character.forDigit(secondDigit, 10)); - wroteFirstDigit = true; - } - } - return buffer; - } - - private final static String _id = "IDL:omg.org/CORBA/DataInputStream:1.0"; - private final static String[] _ids = { _id }; - - public String[] _truncatable_ids() { - if (_ids == null) - return null; - - return (String[])_ids.clone(); - } - - /* for debugging */ - - public void printBuffer() { - CDRInputStream_1_0.printBuffer(this.bbwi); - } - - public static void printBuffer(ByteBufferWithInfo bbwi) { - - System.out.println("----- Input Buffer -----"); - System.out.println(); - System.out.println("Current position: " + bbwi.position()); - System.out.println("Total length : " + bbwi.buflen); - System.out.println(); - - try { - - char[] charBuf = new char[16]; - - for (int i = 0; i < bbwi.buflen; i += 16) { - - int j = 0; - - // For every 16 bytes, there is one line - // of output. First, the hex output of - // the 16 bytes with each byte separated - // by a space. - while (j < 16 && j + i < bbwi.buflen) { - int k = bbwi.byteBuffer.get(i + j); - if (k < 0) - k = 256 + k; - String hex = Integer.toHexString(k); - if (hex.length() == 1) - hex = "0" + hex; - System.out.print(hex + " "); - j++; - } - - // Add any extra spaces to align the - // text column in case we didn't end - // at 16 - while (j < 16) { - System.out.print(" "); - j++; - } - - // Now output the ASCII equivalents. Non-ASCII - // characters are shown as periods. - int x = 0; - while (x < 16 && x + i < bbwi.buflen) { - if (ORBUtility.isPrintable((char)bbwi.byteBuffer.get(i + x))) - charBuf[x] = (char)bbwi.byteBuffer.get(i + x); - else - charBuf[x] = '.'; - x++; - } - System.out.println(new String(charBuf, 0, x)); - } - - } catch (Throwable t) { - t.printStackTrace(); - } - - System.out.println("------------------------"); - } - - public ByteBuffer getByteBuffer() { - ByteBuffer result = null; - if (bbwi != null) { - result = bbwi.byteBuffer; - } - return result; - } - - public int getBufferLength() { - return bbwi.buflen; - } - - public void setBufferLength(int value) { - bbwi.buflen = value; - bbwi.byteBuffer.limit(bbwi.buflen); - } - - public void setByteBufferWithInfo(ByteBufferWithInfo bbwi) { - this.bbwi = bbwi; - } - - public void setByteBuffer(ByteBuffer byteBuffer) { - bbwi.byteBuffer = byteBuffer; - } - - public int getIndex() { - return bbwi.position(); - } - - public void setIndex(int value) { - bbwi.position(value); - } - - public boolean isLittleEndian() { - return littleEndian; - } - - public void orb(org.omg.CORBA.ORB orb) { - this.orb = (ORB)orb; - } - - public BufferManagerRead getBufferManager() { - return bufferManagerRead; - } - - private void skipToOffset(int offset) { - - // Number of bytes to skip - int len = offset - get_offset(); - - int n = 0; - - while (n < len) { - int avail; - int bytes; - int wanted; - - avail = bbwi.buflen - bbwi.position(); - if (avail <= 0) { - grow(1, 1); - avail = bbwi.buflen - bbwi.position(); - } - - wanted = len - n; - bytes = (wanted < avail) ? wanted : avail; - bbwi.position(bbwi.position() + bytes); - n += bytes; - } - } - - - // Mark and reset ------------------------------------------------- - - protected MarkAndResetHandler markAndResetHandler = null; - - protected class StreamMemento - { - // These are the fields that may change after marking - // the stream position, so we need to save them. - private int blockLength_; - private int end_flag_; - private int chunkedValueNestingLevel_; - private int valueIndirection_; - private int stringIndirection_; - private boolean isChunked_; - private javax.rmi.CORBA.ValueHandler valueHandler_; - private ByteBufferWithInfo bbwi_; - private boolean specialNoOptionalDataState_; - - public StreamMemento() - { - blockLength_ = blockLength; - end_flag_ = end_flag; - chunkedValueNestingLevel_ = chunkedValueNestingLevel; - valueIndirection_ = valueIndirection; - stringIndirection_ = stringIndirection; - isChunked_ = isChunked; - valueHandler_ = valueHandler; - specialNoOptionalDataState_ = specialNoOptionalDataState; - bbwi_ = new ByteBufferWithInfo(bbwi); - } - } - - public java.lang.Object createStreamMemento() { - return new StreamMemento(); - } - - public void restoreInternalState(java.lang.Object streamMemento) { - - StreamMemento mem = (StreamMemento)streamMemento; - - blockLength = mem.blockLength_; - end_flag = mem.end_flag_; - chunkedValueNestingLevel = mem.chunkedValueNestingLevel_; - valueIndirection = mem.valueIndirection_; - stringIndirection = mem.stringIndirection_; - isChunked = mem.isChunked_; - valueHandler = mem.valueHandler_; - specialNoOptionalDataState = mem.specialNoOptionalDataState_; - bbwi = mem.bbwi_; - } - - public int getPosition() { - return get_offset(); - } - - public void mark(int readlimit) { - markAndResetHandler.mark(this); - } - - public void reset() { - markAndResetHandler.reset(); - } - - // ---------------------------------- end Mark and Reset - - // Provides a hook so subclasses of CDRInputStream can provide - // a CodeBase. This ultimately allows us to grab a Connection - // instance in IIOPInputStream, the only subclass where this - // is actually used. - CodeBase getCodeBase() { - return parent.getCodeBase(); - } - - /** - * Attempts to find the class described by the given - * repository ID string and expected type. The first - * attempt is to find the class locally, falling back - * on the URL that came with the value. The second - * attempt is to use a URL from the remote CodeBase. - */ - private Class getClassFromString(String repositoryIDString, - String codebaseURL, - Class expectedType) - { - RepositoryIdInterface repositoryID - = repIdStrs.getFromString(repositoryIDString); - - try { - try { - // First try to load the class locally, then use - // the provided URL (if it isn't null) - return repositoryID.getClassFromType(expectedType, - codebaseURL); - } catch (ClassNotFoundException cnfeOuter) { - - try { - - if (getCodeBase() == null) { - return null; // class cannot be loaded remotely. - } - - // Get a URL from the remote CodeBase and retry - codebaseURL = getCodeBase().implementation(repositoryIDString); - - // Don't bother trying to find it locally again if - // we got a null URL - if (codebaseURL == null) - return null; - - return repositoryID.getClassFromType(expectedType, - codebaseURL); - } catch (ClassNotFoundException cnfeInner) { - dprintThrowable(cnfeInner); - // Failed to load the class - return null; - } - } - } catch (MalformedURLException mue) { - // Always report a bad URL - throw wrapper.malformedUrl( CompletionStatus.COMPLETED_MAYBE, - mue, repositoryIDString, codebaseURL ) ; - } - } - - /** - * Attempts to find the class described by the given - * repository ID string. At most, three attempts are made: - * Try to find it locally, through the provided URL, and - * finally, via a URL from the remote CodeBase. - */ - private Class getClassFromString(String repositoryIDString, - String codebaseURL) - { - RepositoryIdInterface repositoryID - = repIdStrs.getFromString(repositoryIDString); - - for (int i = 0; i < 3; i++) { - - try { - - switch (i) - { - case 0: - // First try to load the class locally - return repositoryID.getClassFromType(); - case 1: - // Try to load the class using the provided - // codebase URL (falls out below) - break; - case 2: - // Try to load the class using a URL from the - // remote CodeBase - codebaseURL = getCodeBase().implementation(repositoryIDString); - break; - } - - // Don't bother if the codebaseURL is null - if (codebaseURL == null) - continue; - - return repositoryID.getClassFromType(codebaseURL); - - } catch(ClassNotFoundException cnfe) { - // Will ultimately return null if all three - // attempts fail, but don't do anything here. - } catch (MalformedURLException mue) { - throw wrapper.malformedUrl( CompletionStatus.COMPLETED_MAYBE, - mue, repositoryIDString, codebaseURL ) ; - } - } - - // If we get here, we have failed to load the class - dprint("getClassFromString failed with rep id " - + repositoryIDString - + " and codebase " - + codebaseURL); - - return null; - } - - // Utility method used to get chars from bytes - char[] getConvertedChars(int numBytes, - CodeSetConversion.BTCConverter converter) { - - // REVISIT - Look at CodeSetConversion.BTCConverter to see - // if it can work with an NIO ByteBuffer. We should - // avoid getting the bytes into an array if possible. - - // To be honest, I doubt this saves much real time - if (bbwi.buflen - bbwi.position() >= numBytes) { - // If the entire string is in this buffer, - // just convert directly from the bbwi rather than - // allocating and copying. - byte[] tmpBuf; - if (bbwi.byteBuffer.hasArray()) - { - tmpBuf = bbwi.byteBuffer.array(); - } - else - { - tmpBuf = new byte[bbwi.buflen]; - // Microbenchmarks are showing a loop of ByteBuffer.get(int) - // being faster than ByteBuffer.get(byte[], int, int). - for (int i = 0; i < bbwi.buflen; i++) - tmpBuf[i] = bbwi.byteBuffer.get(i); - } - char[] result = converter.getChars(tmpBuf,bbwi.position(),numBytes); - - bbwi.position(bbwi.position() + numBytes); - return result; - } else { - // Stretches across buffers. Unless we provide an - // incremental conversion interface, allocate and - // copy the bytes. - byte[] bytes = new byte[numBytes]; - read_octet_array(bytes, 0, bytes.length); - - return converter.getChars(bytes, 0, numBytes); - } - } - - protected CodeSetConversion.BTCConverter getCharConverter() { - if (charConverter == null) - charConverter = parent.createCharBTCConverter(); - - return charConverter; - } - - protected CodeSetConversion.BTCConverter getWCharConverter() { - if (wcharConverter == null) - wcharConverter = parent.createWCharBTCConverter(); - - return wcharConverter; - } - - protected void dprintThrowable(Throwable t) { - if (debug && t != null) - t.printStackTrace(); - } - - protected void dprint(String msg) { - if (debug) { - ORBUtility.dprint(this, msg); - } - } - - /** - * Aligns the current position on the given octet boundary - * if there are enough bytes available to do so. Otherwise, - * it just returns. This is used for some (but not all) - * GIOP 1.2 message headers. - */ - - void alignOnBoundary(int octetBoundary) { - int needed = computeAlignment(bbwi.position(), octetBoundary); - - if (bbwi.position() + needed <= bbwi.buflen) - { - bbwi.position(bbwi.position() + needed); - } - } - - public void resetCodeSetConverters() { - charConverter = null; - wcharConverter = null; - } - - public void start_value() { - // Read value tag - int vType = readValueTag(); - - if (vType == 0) { - // Stream needs to go into a state where it - // throws standard exception until end_value - // is called. This means the sender didn't - // send any custom data. If the reader here - // tries to read more, we need to throw an - // exception before reading beyond where - // we're supposed to - specialNoOptionalDataState = true; - - return; - } - - if (vType == 0xffffffff) { - // One should never indirect to a custom wrapper - throw wrapper.customWrapperIndirection( - CompletionStatus.COMPLETED_MAYBE); - } - - if (repIdUtil.isCodeBasePresent(vType)) { - throw wrapper.customWrapperWithCodebase( - CompletionStatus.COMPLETED_MAYBE); - } - - if (repIdUtil.getTypeInfo(vType) - != RepositoryIdUtility.SINGLE_REP_TYPE_INFO) { - throw wrapper.customWrapperNotSingleRepid( - CompletionStatus.COMPLETED_MAYBE); - } - - - // REVISIT - Could verify repository ID even though - // it isn't used elsewhere - read_repositoryId(); - - // Note: isChunked should be true here. Should have - // been set to true in the containing value's read_value - // method. - - start_block(); - end_flag--; - chunkedValueNestingLevel--; - } - - public void end_value() { - - if (specialNoOptionalDataState) { - specialNoOptionalDataState = false; - return; - } - - handleEndOfValue(); - readEndTag(); - - // Note that isChunked should still be true here. - // If the containing valuetype is the highest - // chunked value, it will get set to false - // at the end of read_value. - - // allow for possible continuation chunk - start_block(); - } - - public void close() throws IOException - { - - // tell BufferManagerRead to release any ByteBuffers - getBufferManager().close(bbwi); - - // It's possible bbwi.byteBuffer is shared between - // this InputStream and an OutputStream. Thus, we check - // if the Input/Output streams are using the same ByteBuffer. - // If they sharing the same ByteBuffer we need to ensure only - // one of those ByteBuffers are released to the ByteBufferPool. - - if (bbwi != null && getByteBuffer() != null) - { - MessageMediator messageMediator = parent.getMessageMediator(); - if (messageMediator != null) - { - CDROutputObject outputObj = - (CDROutputObject)messageMediator.getOutputObject(); - if (outputObj != null) - { - if (outputObj.isSharing(getByteBuffer())) - { - // Set OutputStream's ByteBuffer and bbwi to null - // so its ByteBuffer cannot be released to the pool - outputObj.setByteBuffer(null); - outputObj.setByteBufferWithInfo(null); - } - } - } - - // release this stream's ByteBuffer to the pool - ByteBufferPool byteBufferPool = orb.getByteBufferPool(); - if (debug) - { - // print address of ByteBuffer being released - int bbAddress = System.identityHashCode(bbwi.byteBuffer); - StringBuffer sb = new StringBuffer(80); - sb.append(".close - releasing ByteBuffer id ("); - sb.append(bbAddress).append(") to ByteBufferPool."); - String msg = sb.toString(); - dprint(msg); - } - byteBufferPool.releaseByteBuffer(bbwi.byteBuffer); - bbwi.byteBuffer = null; - bbwi = null; - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_1.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_1.java deleted file mode 100644 index 76bc2971650..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_1.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.encoding; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; - -public class CDRInputStream_1_1 extends CDRInputStream_1_0 -{ - // See notes in CDROutputStream - protected int fragmentOffset = 0; - - public GIOPVersion getGIOPVersion() { - return GIOPVersion.V1_1; - } - - // Template method - public CDRInputStreamBase dup() { - CDRInputStreamBase result = super.dup(); - - ((CDRInputStream_1_1)result).fragmentOffset = this.fragmentOffset; - - return result; - } - - protected int get_offset() { - return bbwi.position() + fragmentOffset; - } - - protected void alignAndCheck(int align, int n) { - - - checkBlockLength(align, n); - - // WARNING: Must compute real alignment after calling - // checkBlockLength since it may move the position - int alignment = computeAlignment(bbwi.position(), align); - - if (bbwi.position() + n + alignment > bbwi.buflen) { - - // Some other ORBs may have found a way to send 1.1 - // fragments which put alignment bytes at the end - // of a fragment - if (bbwi.position() + alignment == bbwi.buflen) - { - bbwi.position(bbwi.position() + alignment); - } - - grow(align, n); - - // We must recalculate the alignment after a possible - // fragmentation since the new bbwi.position() (after the header) - // may require a different alignment. - - alignment = computeAlignment(bbwi.position(), align); - } - - bbwi.position(bbwi.position() + alignment); - } - - // - // This can be overridden.... - // - protected void grow(int align, int n) { - - bbwi.needed = n; - - // Save the size of the current buffer for - // possible fragmentOffset calculation - int oldSize = bbwi.position(); - - bbwi = bufferManagerRead.underflow(bbwi); - - if (bbwi.fragmented) { - - // By this point we should be guaranteed to have - // a new fragment whose header has already been - // unmarshalled. bbwi.position() should point to the - // end of the header. - fragmentOffset += (oldSize - bbwi.position()); - - markAndResetHandler.fragmentationOccured(bbwi); - - // Clear the flag - bbwi.fragmented = false; - } - } - - // Mark/reset --------------------------------------- - - private class FragmentableStreamMemento extends StreamMemento - { - private int fragmentOffset_; - - public FragmentableStreamMemento() - { - super(); - - fragmentOffset_ = fragmentOffset; - } - } - - public java.lang.Object createStreamMemento() { - return new FragmentableStreamMemento(); - } - - public void restoreInternalState(java.lang.Object streamMemento) - { - super.restoreInternalState(streamMemento); - - fragmentOffset - = ((FragmentableStreamMemento)streamMemento).fragmentOffset_; - } - - // -------------------------------------------------- - - public char read_wchar() { - // In GIOP 1.1, interoperability with wchar is limited - // to 2 byte fixed width encodings. CORBA formal 99-10-07 15.3.1.6. - // WARNING: For UTF-16, this means that there can be no - // byte order marker, so it must default to big endian! - alignAndCheck(2, 2); - - // Because of the alignAndCheck, we should be guaranteed - // 2 bytes of real data. - char[] result = getConvertedChars(2, getWCharConverter()); - - // Did the provided bytes convert to more than one - // character? This may come up as more unicode values are - // assigned, and a single 16 bit Java char isn't enough. - // Better to use strings for i18n purposes. - if (getWCharConverter().getNumChars() > 1) - throw wrapper.btcResultMoreThanOneChar() ; - - return result[0]; - } - - public String read_wstring() { - // In GIOP 1.1, interoperability with wchar is limited - // to 2 byte fixed width encodings. CORBA formal 99-10-07 15.3.1.6. - int len = read_long(); - - // Workaround for ORBs which send string lengths of - // zero to mean empty string. - // - // IMPORTANT: Do not replace 'new String("")' with "", it may result - // in a Serialization bug (See serialization.zerolengthstring) and - // bug id: 4728756 for details - if (len == 0) - return new String(""); - - checkForNegativeLength(len); - - // Don't include the two byte null for the - // following computations. Remember that since we're limited - // to a 2 byte fixed width code set, the "length" was the - // number of such 2 byte code points plus a 2 byte null. - len = len - 1; - - char[] result = getConvertedChars(len * 2, getWCharConverter()); - - // Skip over the 2 byte null - read_short(); - - return new String(result, 0, getWCharConverter().getNumChars()); - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_2.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_2.java deleted file mode 100644 index 6b2ef382e8f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_2.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.encoding; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.impl.orbutil.ORBConstants; - -public class CDRInputStream_1_2 extends CDRInputStream_1_1 -{ - // Indicates whether the header is padded. In GIOP 1.2 and above, - // the body must be aligned on an 8-octet boundary, and so the header is - // padded appropriately. However, if there is no body to a request or reply - // message, there is no header padding, in the unfragmented case. - protected boolean headerPadding; - - // used to remember headerPadding flag when mark() and restore() are used. - protected boolean restoreHeaderPadding; - - // Called by RequestMessage_1_2 or ReplyMessage_1_2 classes only. - void setHeaderPadding(boolean headerPadding) { - this.headerPadding = headerPadding; - } - - // the mark and reset methods have been overridden to remember the - // headerPadding flag. - - public void mark(int readlimit) { - super.mark(readlimit); - restoreHeaderPadding = headerPadding; - } - - public void reset() { - super.reset(); - headerPadding = restoreHeaderPadding; - restoreHeaderPadding = false; - } - - // Template method - // This method has been overriden to ensure that the duplicated stream - // inherits the headerPadding flag, in case of GIOP 1.2 and above, streams. - public CDRInputStreamBase dup() { - CDRInputStreamBase result = super.dup(); - ((CDRInputStream_1_2)result).headerPadding = this.headerPadding; - return result; - } - - protected void alignAndCheck(int align, int n) { - - // headerPadding bit is set by read method of the RequestMessage_1_2 - // or ReplyMessage_1_2 classes. When set, the very first body read - // operation (from the stub code) would trigger an alignAndCheck - // method call, that would in turn skip the header padding that was - // inserted during the earlier write operation by the sender. The - // padding ensures that the body is aligned on an 8-octet boundary, - // for GIOP versions 1.2 and beyond. - if (headerPadding == true) { - headerPadding = false; - alignOnBoundary(ORBConstants.GIOP_12_MSG_BODY_ALIGNMENT); - } - - checkBlockLength(align, n); - - // WARNING: Must compute real alignment after calling - // checkBlockLength since it may move the position - - // In GIOP 1.2, a fragment may end with some alignment - // padding (which leads to all fragments ending perfectly - // on evenly divisible 8 byte boundaries). A new fragment - // never requires alignment with the header since it ends - // on an 8 byte boundary. - - int alignIncr = computeAlignment(bbwi.position(),align); - bbwi.position(bbwi.position() + alignIncr); - - if (bbwi.position() + n > bbwi.buflen) { - grow(1, n); - } - } - - public GIOPVersion getGIOPVersion() { - return GIOPVersion.V1_2; - } - - public char read_wchar() { - // In GIOP 1.2, a wchar is encoded as an unsigned octet length - // followed by the octets of the converted wchar. - int numBytes = read_octet(); - - char[] result = getConvertedChars(numBytes, getWCharConverter()); - - // Did the provided bytes convert to more than one - // character? This may come up as more unicode values are - // assigned, and a single 16 bit Java char isn't enough. - // Better to use strings for i18n purposes. - if (getWCharConverter().getNumChars() > 1) - throw wrapper.btcResultMoreThanOneChar() ; - - return result[0]; - } - - public String read_wstring() { - // In GIOP 1.2, wstrings are not terminated by a null. The - // length is the number of octets in the converted format. - // A zero length string is represented with the 4 byte length - // value of 0. - - int len = read_long(); - - // - // IMPORTANT: Do not replace 'new String("")' with "", it may result - // in a Serialization bug (See serialization.zerolengthstring) and - // bug id: 4728756 for details - if (len == 0) - return new String(""); - - checkForNegativeLength(len); - - return new String(getConvertedChars(len, getWCharConverter()), - 0, - getWCharConverter().getNumChars()); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDROutputObject.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDROutputObject.java deleted file mode 100644 index 4c91de2ef23..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDROutputObject.java +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.encoding; - -import java.io.IOException; -import java.nio.ByteBuffer; - -import org.omg.CORBA.Any; -import org.omg.CORBA.Principal; -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.portable.InputStream; - -import com.sun.corba.se.pept.encoding.OutputObject; -import com.sun.corba.se.pept.protocol.MessageMediator; - -import com.sun.corba.se.spi.encoding.CorbaOutputObject ; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; -import com.sun.corba.se.pept.transport.ByteBufferPool; -import com.sun.corba.se.spi.transport.CorbaConnection; -import com.sun.corba.se.spi.logging.CORBALogDomains; - -import com.sun.corba.se.spi.servicecontext.ServiceContexts; -import com.sun.corba.se.impl.encoding.BufferManagerFactory; -import com.sun.corba.se.impl.encoding.ByteBufferWithInfo; -import com.sun.corba.se.impl.encoding.CDROutputStream; -import com.sun.corba.se.impl.encoding.CDROutputStream_1_0; -import com.sun.corba.se.impl.encoding.CodeSetConversion; -import com.sun.corba.se.impl.encoding.CodeSetComponentInfo; -import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry; -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; -import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase; -import com.sun.corba.se.impl.logging.ORBUtilSystemException; -import com.sun.corba.se.impl.logging.OMGSystemException; - -/** - * @author Harold Carr - */ -public class CDROutputObject extends CorbaOutputObject -{ - private Message header; - private ORB orb; - private ORBUtilSystemException wrapper; - private OMGSystemException omgWrapper; - - // REVISIT - only used on sendCancelRequest. - private CorbaConnection connection; - - private CDROutputObject( - ORB orb, GIOPVersion giopVersion, Message header, - BufferManagerWrite manager, byte streamFormatVersion, - CorbaMessageMediator mediator) - { - super(orb, giopVersion, header.getEncodingVersion(), - false, manager, streamFormatVersion, - ((mediator != null && mediator.getConnection() != null) ? - ((CorbaConnection)mediator.getConnection()). - shouldUseDirectByteBuffers() : false)); - - this.header = header; - this.orb = orb; - this.wrapper = ORBUtilSystemException.get( orb, CORBALogDomains.RPC_ENCODING ) ; - this.omgWrapper = OMGSystemException.get( orb, CORBALogDomains.RPC_ENCODING ) ; - - getBufferManager().setOutputObject(this); - this.corbaMessageMediator = mediator; - } - - public CDROutputObject(ORB orb, - MessageMediator messageMediator, - Message header, - byte streamFormatVersion) - { - this( - orb, - ((CorbaMessageMediator)messageMediator).getGIOPVersion(), - header, - BufferManagerFactory.newBufferManagerWrite( - ((CorbaMessageMediator)messageMediator).getGIOPVersion(), - header.getEncodingVersion(), - orb), - streamFormatVersion, - (CorbaMessageMediator)messageMediator); - } - - // NOTE: - // Used in SharedCDR (i.e., must be grow). - // Used in msgtypes test. - public CDROutputObject(ORB orb, - MessageMediator messageMediator, - Message header, - byte streamFormatVersion, - int strategy) - { - this( - orb, - ((CorbaMessageMediator)messageMediator).getGIOPVersion(), - header, - BufferManagerFactory. - newBufferManagerWrite(strategy, - header.getEncodingVersion(), - orb), - streamFormatVersion, - (CorbaMessageMediator)messageMediator); - } - - // REVISIT - // Used on sendCancelRequest. - // Used for needs addressing mode. - public CDROutputObject(ORB orb, CorbaMessageMediator mediator, - GIOPVersion giopVersion, - CorbaConnection connection, Message header, - byte streamFormatVersion) - { - this( - orb, - giopVersion, - header, - BufferManagerFactory. - newBufferManagerWrite(giopVersion, - header.getEncodingVersion(), - orb), - streamFormatVersion, - mediator); - this.connection = connection ; - } - - // XREVISIT - // Header should only be in message mediator. - // Another possibility: merge header and message mediator. - // REVISIT - make protected once all encoding together - public Message getMessageHeader() { - return header; - } - - public final void finishSendingMessage() { - getBufferManager().sendMessage(); - } - - /** - * Write the contents of the CDROutputStream to the specified - * output stream. Has the side-effect of pushing any current - * Message onto the Message list. - * @param connection The output stream to write to. - */ - public void writeTo(CorbaConnection connection) - throws java.io.IOException - { - - // - // Update the GIOP MessageHeader size field. - // - - ByteBufferWithInfo bbwi = getByteBufferWithInfo(); - - getMessageHeader().setSize(bbwi.byteBuffer, bbwi.getSize()); - - if (orb() != null) { - if (((ORB)orb()).transportDebugFlag) { - dprint(".writeTo: " + connection); - } - if (((ORB)orb()).giopDebugFlag) { - CDROutputStream_1_0.printBuffer(bbwi); - } - } - bbwi.byteBuffer.position(0).limit(bbwi.getSize()); - connection.write(bbwi.byteBuffer); - } - - /** overrides create_input_stream from CDROutputStream */ - public org.omg.CORBA.portable.InputStream create_input_stream() - { - // XREVISIT - return null; - //return new XIIOPInputStream(orb(), getByteBuffer(), getIndex(), - //isLittleEndian(), getMessageHeader(), conn); - } - - public CorbaConnection getConnection() - { - // REVISIT - only set when doing sendCancelRequest. - if (connection != null) { - return connection; - } - return (CorbaConnection) corbaMessageMediator.getConnection(); - } - - // XREVISIT - If CDROutputObject doesn't live in the iiop - // package, it will need this, here, to give package access - // to xgiop. - // REVISIT - make protected once all encoding together - public final ByteBufferWithInfo getByteBufferWithInfo() { - return super.getByteBufferWithInfo(); - } - - // REVISIT - make protected once all encoding together - public final void setByteBufferWithInfo(ByteBufferWithInfo bbwi) { - super.setByteBufferWithInfo(bbwi); - } - - /** - * Override the default CDR factory behavior to get the - * negotiated code sets from the connection. - * - * These are only called once per message, the first time needed. - * - * In the local case, there is no Connection, so use the - * local code sets. - */ - protected CodeSetConversion.CTBConverter createCharCTBConverter() { - CodeSetComponentInfo.CodeSetContext codesets = getCodeSets(); - - // If the connection doesn't have its negotiated - // code sets by now, fall back on the defaults defined - // in CDRInputStream. - if (codesets == null) - return super.createCharCTBConverter(); - - OSFCodeSetRegistry.Entry charSet - = OSFCodeSetRegistry.lookupEntry(codesets.getCharCodeSet()); - - if (charSet == null) - throw wrapper.unknownCodeset( charSet ) ; - - return CodeSetConversion.impl().getCTBConverter(charSet, - isLittleEndian(), - false); - } - - protected CodeSetConversion.CTBConverter createWCharCTBConverter() { - - CodeSetComponentInfo.CodeSetContext codesets = getCodeSets(); - - // If the connection doesn't have its negotiated - // code sets by now, we have to throw an exception. - // See CORBA formal 00-11-03 13.9.2.6. - if (codesets == null) { - if (getConnection().isServer()) - throw omgWrapper.noClientWcharCodesetCtx() ; - else - throw omgWrapper.noServerWcharCodesetCmp() ; - } - - OSFCodeSetRegistry.Entry wcharSet - = OSFCodeSetRegistry.lookupEntry(codesets.getWCharCodeSet()); - - if (wcharSet == null) - throw wrapper.unknownCodeset( wcharSet ) ; - - boolean useByteOrderMarkers - = ((ORB)orb()).getORBData().useByteOrderMarkers(); - - // With UTF-16: - // - // For GIOP 1.2, we can put byte order markers if we want to, and - // use the default of big endian otherwise. (See issue 3405b) - // - // For GIOP 1.1, we don't use BOMs and use the endianness of - // the stream. - if (wcharSet == OSFCodeSetRegistry.UTF_16) { - if (getGIOPVersion().equals(GIOPVersion.V1_2)) { - return CodeSetConversion.impl().getCTBConverter(wcharSet, - false, - useByteOrderMarkers); - } - - if (getGIOPVersion().equals(GIOPVersion.V1_1)) { - return CodeSetConversion.impl().getCTBConverter(wcharSet, - isLittleEndian(), - false); - } - } - - // In the normal case, let the converter system handle it - return CodeSetConversion.impl().getCTBConverter(wcharSet, - isLittleEndian(), - useByteOrderMarkers); - } - - // If we're local and don't have a Connection, use the - // local code sets, otherwise get them from the connection. - // If the connection doesn't have negotiated code sets - // yet, then we use ISO8859-1 for char/string and wchar/wstring - // are illegal. - private CodeSetComponentInfo.CodeSetContext getCodeSets() { - if (getConnection() == null) - return CodeSetComponentInfo.LOCAL_CODE_SETS; - else - return getConnection().getCodeSetContext(); - } - - protected void dprint(String msg) - { - ORBUtility.dprint("CDROutputObject", msg); - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream.java deleted file mode 100644 index 2275dc5f0f4..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream.java +++ /dev/null @@ -1,438 +0,0 @@ -/* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.encoding; - -import java.io.IOException; -import java.io.Serializable; -import java.math.BigDecimal; -import java.nio.ByteBuffer; - -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.Principal; -import org.omg.CORBA.Any; - -import com.sun.corba.se.pept.protocol.MessageMediator; - -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; - -import com.sun.corba.se.impl.encoding.CodeSetConversion; -import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry; -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.impl.logging.ORBUtilSystemException; -import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; - -/** - * This is delegates to the real implementation. - */ -public abstract class CDROutputStream - extends org.omg.CORBA_2_3.portable.OutputStream - implements com.sun.corba.se.impl.encoding.MarshalOutputStream, - org.omg.CORBA.DataOutputStream, org.omg.CORBA.portable.ValueOutputStream -{ - private CDROutputStreamBase impl; - protected ORB orb ; - protected ORBUtilSystemException wrapper ; - protected CorbaMessageMediator corbaMessageMediator; - - - // We can move this out somewhere later. For now, it serves its purpose - // to create a concrete CDR delegate based on the GIOP version. - private static class OutputStreamFactory { - - public static CDROutputStreamBase newOutputStream( - ORB orb, GIOPVersion version, byte encodingVersion) { - switch(version.intValue()) { - case GIOPVersion.VERSION_1_0: - return new CDROutputStream_1_0(); - case GIOPVersion.VERSION_1_1: - return new CDROutputStream_1_1(); - case GIOPVersion.VERSION_1_2: - if (encodingVersion != Message.CDR_ENC_VERSION) { - return - new IDLJavaSerializationOutputStream(encodingVersion); - } - return new CDROutputStream_1_2(); - default: - ORBUtilSystemException wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_ENCODING ) ; - // REVISIT - what is appropriate? INTERNAL exceptions - // are really hard to track later. - throw wrapper.unsupportedGiopVersion( version ) ; - } - } - } - - // REVISIT - These two constructors should be re-factored to better hide - // the fact that someone extending this class 'can' construct a CDROutputStream - // that does not use pooled ByteBuffers. Right now, only EncapsOutputStream - // does _not_ use pooled ByteBuffers, see EncapsOutputStream. - - // NOTE: When a stream is constructed for non-channel-backed sockets - // it notifies the constructor not to use pooled (i.e, direct) - // ByteBuffers. - - public CDROutputStream(ORB orb, - GIOPVersion version, - byte encodingVersion, - boolean littleEndian, - BufferManagerWrite bufferManager, - byte streamFormatVersion, - boolean usePooledByteBuffers) - { - impl = OutputStreamFactory.newOutputStream(orb, version, - encodingVersion); - impl.init(orb, littleEndian, bufferManager, - streamFormatVersion, usePooledByteBuffers); - - impl.setParent(this); - this.orb = orb ; - this.wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_ENCODING ) ; - } - - public CDROutputStream(ORB orb, - GIOPVersion version, - byte encodingVersion, - boolean littleEndian, - BufferManagerWrite bufferManager, - byte streamFormatVersion) - { - this(orb, version, encodingVersion, littleEndian, - bufferManager, streamFormatVersion, true); - } - - // org.omg.CORBA.portable.OutputStream - - // Provided by IIOPOutputStream and EncapsOutputStream - public abstract org.omg.CORBA.portable.InputStream create_input_stream(); - - public final void write_boolean(boolean value) { - impl.write_boolean(value); - } - public final void write_char(char value) { - impl.write_char(value); - } - public final void write_wchar(char value) { - impl.write_wchar(value); - } - public final void write_octet(byte value) { - impl.write_octet(value); - } - public final void write_short(short value) { - impl.write_short(value); - } - public final void write_ushort(short value) { - impl.write_ushort(value); - } - public final void write_long(int value) { - impl.write_long(value); - } - public final void write_ulong(int value) { - impl.write_ulong(value); - } - public final void write_longlong(long value) { - impl.write_longlong(value); - } - public final void write_ulonglong(long value) { - impl.write_ulonglong(value); - } - public final void write_float(float value) { - impl.write_float(value); - } - public final void write_double(double value) { - impl.write_double(value); - } - public final void write_string(String value) { - impl.write_string(value); - } - public final void write_wstring(String value) { - impl.write_wstring(value); - } - - public final void write_boolean_array(boolean[] value, int offset, int length) { - impl.write_boolean_array(value, offset, length); - } - public final void write_char_array(char[] value, int offset, int length) { - impl.write_char_array(value, offset, length); - } - public final void write_wchar_array(char[] value, int offset, int length) { - impl.write_wchar_array(value, offset, length); - } - public final void write_octet_array(byte[] value, int offset, int length) { - impl.write_octet_array(value, offset, length); - } - public final void write_short_array(short[] value, int offset, int length) { - impl.write_short_array(value, offset, length); - } - public final void write_ushort_array(short[] value, int offset, int length){ - impl.write_ushort_array(value, offset, length); - } - public final void write_long_array(int[] value, int offset, int length) { - impl.write_long_array(value, offset, length); - } - public final void write_ulong_array(int[] value, int offset, int length) { - impl.write_ulong_array(value, offset, length); - } - public final void write_longlong_array(long[] value, int offset, int length) { - impl.write_longlong_array(value, offset, length); - } - public final void write_ulonglong_array(long[] value, int offset,int length) { - impl.write_ulonglong_array(value, offset, length); - } - public final void write_float_array(float[] value, int offset, int length) { - impl.write_float_array(value, offset, length); - } - public final void write_double_array(double[] value, int offset, int length) { - impl.write_double_array(value, offset, length); - } - public final void write_Object(org.omg.CORBA.Object value) { - impl.write_Object(value); - } - public final void write_TypeCode(TypeCode value) { - impl.write_TypeCode(value); - } - public final void write_any(Any value) { - impl.write_any(value); - } - - public final void write_Principal(Principal value) { - impl.write_Principal(value); - } - - public final void write(int b) throws java.io.IOException { - impl.write(b); - } - - public final void write_fixed(java.math.BigDecimal value) { - impl.write_fixed(value); - } - - public final void write_Context(org.omg.CORBA.Context ctx, - org.omg.CORBA.ContextList contexts) { - impl.write_Context(ctx, contexts); - } - - public final org.omg.CORBA.ORB orb() { - return impl.orb(); - } - - // org.omg.CORBA_2_3.portable.OutputStream - public final void write_value(java.io.Serializable value) { - impl.write_value(value); - } - - public final void write_value(java.io.Serializable value, java.lang.Class clz) { - impl.write_value(value, clz); - } - - public final void write_value(java.io.Serializable value, String repository_id) { - impl.write_value(value, repository_id); - } - - public final void write_value(java.io.Serializable value, - org.omg.CORBA.portable.BoxedValueHelper factory) { - impl.write_value(value, factory); - } - - public final void write_abstract_interface(java.lang.Object obj) { - impl.write_abstract_interface(obj); - } - - // java.io.OutputStream - public final void write(byte b[]) throws IOException { - impl.write(b); - } - - public final void write(byte b[], int off, int len) throws IOException { - impl.write(b, off, len); - } - - public final void flush() throws IOException { - impl.flush(); - } - - public final void close() throws IOException { - impl.close(); - } - - // com.sun.corba.se.impl.encoding.MarshalOutputStream - public final void start_block() { - impl.start_block(); - } - - public final void end_block() { - impl.end_block(); - } - - public final void putEndian() { - impl.putEndian(); - } - - public void writeTo(java.io.OutputStream s) - throws IOException - { - impl.writeTo(s); - } - - public final byte[] toByteArray() { - return impl.toByteArray(); - } - - // org.omg.CORBA.DataOutputStream - public final void write_Abstract (java.lang.Object value) { - impl.write_Abstract(value); - } - - public final void write_Value (java.io.Serializable value) { - impl.write_Value(value); - } - - public final void write_any_array(org.omg.CORBA.Any[] seq, int offset, int length) { - impl.write_any_array(seq, offset, length); - } - - public void setMessageMediator(MessageMediator messageMediator) - { - this.corbaMessageMediator = (CorbaMessageMediator) messageMediator; - } - - public MessageMediator getMessageMediator() - { - return corbaMessageMediator; - } - - // org.omg.CORBA.portable.ValueBase - public final String[] _truncatable_ids() { - return impl._truncatable_ids(); - } - - // Other - protected final int getSize() { - return impl.getSize(); - } - - protected final int getIndex() { - return impl.getIndex(); - } - - protected int getRealIndex(int index) { - // Used in indirections. Overridden by TypeCodeOutputStream. - return index; - } - - protected final void setIndex(int value) { - impl.setIndex(value); - } - - protected final ByteBuffer getByteBuffer() { - return impl.getByteBuffer(); - } - - protected final void setByteBuffer(ByteBuffer byteBuffer) { - impl.setByteBuffer(byteBuffer); - } - - /** - * return true if our ByteBuffer is sharing/equal to bb - */ - protected final boolean isSharing(ByteBuffer bb) { - return (getByteBuffer() == bb); - } - - public final boolean isLittleEndian() { - return impl.isLittleEndian(); - } - - // XREVISIT - return to final if possible - // REVISIT - was protected - need access from msgtypes test. - public ByteBufferWithInfo getByteBufferWithInfo() { - return impl.getByteBufferWithInfo(); - } - - protected void setByteBufferWithInfo(ByteBufferWithInfo bbwi) { - impl.setByteBufferWithInfo(bbwi); - } - - // REVISIT: was protected - but need to access from xgiop. - public final BufferManagerWrite getBufferManager() { - return impl.getBufferManager(); - } - - public final void write_fixed(java.math.BigDecimal bigDecimal, short digits, short scale) { - impl.write_fixed(bigDecimal, digits, scale); - } - - public final void writeOctetSequenceTo(org.omg.CORBA.portable.OutputStream s) { - impl.writeOctetSequenceTo(s); - } - - public final GIOPVersion getGIOPVersion() { - return impl.getGIOPVersion(); - } - - public final void writeIndirection(int tag, int posIndirectedTo) { - impl.writeIndirection(tag, posIndirectedTo); - } - - // Use Latin-1 for GIOP 1.0 or when code set negotiation was not - // performed. - protected CodeSetConversion.CTBConverter createCharCTBConverter() { - return CodeSetConversion.impl().getCTBConverter(OSFCodeSetRegistry.ISO_8859_1); - } - - // Subclasses must decide what to do here. It's inconvenient to - // make the class and this method abstract because of dup(). - protected abstract CodeSetConversion.CTBConverter createWCharCTBConverter(); - - protected final void freeInternalCaches() { - impl.freeInternalCaches(); - } - - void printBuffer() { - impl.printBuffer(); - } - - public void alignOnBoundary(int octetBoundary) { - impl.alignOnBoundary(octetBoundary); - } - - // Needed by request and reply messages for GIOP versions >= 1.2 only. - public void setHeaderPadding(boolean headerPadding) { - impl.setHeaderPadding(headerPadding); - } - - // ValueOutputStream ----------------------------- - - public void start_value(String rep_id) { - impl.start_value(rep_id); - } - - public void end_value() { - impl.end_value(); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDROutputStreamBase.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDROutputStreamBase.java deleted file mode 100644 index b4b1c687c5c..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDROutputStreamBase.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.encoding; - -import java.io.IOException; -import java.io.Serializable; -import java.math.BigDecimal; -import java.nio.ByteBuffer; - -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.Principal; -import org.omg.CORBA.Any; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.orb.ORB; - -/** - * Describes CDROutputStream delegates and provides some - * implementation. Non-default constructors are avoided in - * the delegation to separate instantiation from initialization, - * so we use init methods. - */ -abstract class CDROutputStreamBase extends java.io.OutputStream -{ - protected CDROutputStream parent; - - // Required by parent CDROutputStream - public void setParent(CDROutputStream parent) { - this.parent = parent; - } - - public void init(org.omg.CORBA.ORB orb, - BufferManagerWrite bufferManager, - byte streamFormatVersion) { - init(orb, false, bufferManager, streamFormatVersion, true); - } - - // See EncapsOutputStream, the only one that uses the - // non-pooled ByteBuffers, for additional info. - protected abstract void init(org.omg.CORBA.ORB orb, - boolean littleEndian, - BufferManagerWrite bufferManager, - byte streamFormatVersion, - boolean usePooledByteBuffers); - - public abstract void write_boolean(boolean value); - public abstract void write_char(char value); - public abstract void write_wchar(char value); - public abstract void write_octet(byte value); - public abstract void write_short(short value); - public abstract void write_ushort(short value); - public abstract void write_long(int value); - public abstract void write_ulong(int value); - public abstract void write_longlong(long value); - public abstract void write_ulonglong(long value); - public abstract void write_float(float value); - public abstract void write_double(double value); - public abstract void write_string(String value); - public abstract void write_wstring(String value); - public abstract void write_boolean_array(boolean[] value, int offset, int length); - public abstract void write_char_array(char[] value, int offset, int length); - public abstract void write_wchar_array(char[] value, int offset, int length); - public abstract void write_octet_array(byte[] value, int offset, int length); - public abstract void write_short_array(short[] value, int offset, int length); - public abstract void write_ushort_array(short[] value, int offset, int length); - public abstract void write_long_array(int[] value, int offset, int length); - public abstract void write_ulong_array(int[] value, int offset, int length); - public abstract void write_longlong_array(long[] value, int offset, int length); - public abstract void write_ulonglong_array(long[] value, int offset, int length); - public abstract void write_float_array(float[] value, int offset, int length); - public abstract void write_double_array(double[] value, int offset, int length); - public abstract void write_Object(org.omg.CORBA.Object value); - public abstract void write_TypeCode(TypeCode value); - public abstract void write_any(Any value); - public abstract void write_Principal(Principal value); - public void write(int b) throws java.io.IOException { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - public abstract void write_fixed(java.math.BigDecimal value); - public void write_Context(org.omg.CORBA.Context ctx, - org.omg.CORBA.ContextList contexts) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - public abstract org.omg.CORBA.ORB orb(); - - // org.omg.CORBA_2_3.portable.OutputStream - public abstract void write_value(java.io.Serializable value); - public abstract void write_value(java.io.Serializable value, java.lang.Class clz); - public abstract void write_value(java.io.Serializable value, String repository_id); - public abstract void write_value(java.io.Serializable value, - org.omg.CORBA.portable.BoxedValueHelper factory); - public abstract void write_abstract_interface(java.lang.Object obj); - - // java.io.OutputStream -// public abstract void write(byte b[]) throws IOException; -// public abstract void write(byte b[], int off, int len) throws IOException; -// public abstract void flush() throws IOException; -// public abstract void close() throws IOException; - - // com.sun.corba.se.impl.encoding.MarshalOutputStream - public abstract void start_block(); - public abstract void end_block(); - public abstract void putEndian(); - public abstract void writeTo(java.io.OutputStream s) - throws IOException; - public abstract byte[] toByteArray(); - - // org.omg.CORBA.DataOutputStream - public abstract void write_Abstract (java.lang.Object value); - public abstract void write_Value (java.io.Serializable value); - public abstract void write_any_array(org.omg.CORBA.Any[] seq, int offset, int length); - - // org.omg.CORBA.portable.ValueBase - public abstract String[] _truncatable_ids(); - - // Needed by request and reply messages for GIOP versions >= 1.2 only. - abstract void setHeaderPadding(boolean headerPadding); - - // Required by IIOPOutputStream and other subclasses - public abstract int getSize(); - - public abstract int getIndex(); - public abstract void setIndex(int value); - - public abstract ByteBuffer getByteBuffer(); - public abstract void setByteBuffer(ByteBuffer byteBuffer); - - public abstract boolean isLittleEndian(); - - public abstract ByteBufferWithInfo getByteBufferWithInfo(); - public abstract void setByteBufferWithInfo(ByteBufferWithInfo bbwi); - - public abstract BufferManagerWrite getBufferManager(); - - public abstract void write_fixed(java.math.BigDecimal bigDecimal, short digits, short scale); - public abstract void writeOctetSequenceTo(org.omg.CORBA.portable.OutputStream s); - - public abstract GIOPVersion getGIOPVersion(); - - public abstract void writeIndirection(int tag, int posIndirectedTo); - - abstract void freeInternalCaches(); - - abstract void printBuffer(); - - abstract void alignOnBoundary(int octetBoundary); - - // org.omg.CORBA.portable.ValueOutputStream - - public abstract void start_value(String rep_id); - - public abstract void end_value(); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_0.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_0.java deleted file mode 100644 index 3e60c4801b0..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_0.java +++ /dev/null @@ -1,1929 +0,0 @@ -/* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.encoding; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.Serializable; -import java.io.ByteArrayOutputStream; -import java.io.ObjectOutputStream; -import java.io.IOException; -import java.lang.reflect.Method; -import java.lang.reflect.InvocationTargetException; -import java.math.BigDecimal; -import java.nio.ByteBuffer; -import java.rmi.Remote; -import java.security.AccessController; -import java.security.PrivilegedExceptionAction; -import java.security.PrivilegedActionException; -import java.util.Hashtable; -import java.util.Stack; - -import javax.rmi.CORBA.Util; -import javax.rmi.CORBA.ValueHandler; -import javax.rmi.CORBA.ValueHandlerMultiFormat; - -import org.omg.CORBA.CustomMarshal; -import org.omg.CORBA.DataOutputStream; -import org.omg.CORBA.TypeCodePackage.BadKind; -import org.omg.CORBA.SystemException; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.Object; -import org.omg.CORBA.Principal; -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.Any; -import org.omg.CORBA.VM_CUSTOM; -import org.omg.CORBA.VM_TRUNCATABLE; -import org.omg.CORBA.VM_NONE; -import org.omg.CORBA.portable.IDLEntity; -import org.omg.CORBA.portable.CustomValue; -import org.omg.CORBA.portable.StreamableValue; -import org.omg.CORBA.portable.BoxedValueHelper; -import org.omg.CORBA.portable.OutputStream; -import org.omg.CORBA.portable.ValueBase; - -import com.sun.org.omg.CORBA.portable.ValueHelper; - -import com.sun.corba.se.pept.protocol.MessageMediator; -import com.sun.corba.se.pept.transport.ByteBufferPool; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.IORFactories; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.orb.ORBVersionFactory; -import com.sun.corba.se.spi.orb.ORBVersion; -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; -import com.sun.corba.se.spi.logging.CORBALogDomains; - -import com.sun.corba.se.impl.encoding.ByteBufferWithInfo; -import com.sun.corba.se.impl.encoding.MarshalOutputStream; -import com.sun.corba.se.impl.encoding.CodeSetConversion; -import com.sun.corba.se.impl.corba.TypeCodeImpl; -import com.sun.corba.se.impl.orbutil.CacheTable; -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.orbutil.RepositoryIdStrings; -import com.sun.corba.se.impl.orbutil.RepositoryIdUtility; -import com.sun.corba.se.impl.orbutil.RepositoryIdFactory; -import com.sun.corba.se.impl.util.Utility; -import com.sun.corba.se.impl.logging.ORBUtilSystemException; - -public class CDROutputStream_1_0 extends CDROutputStreamBase -{ - private static final int INDIRECTION_TAG = 0xffffffff; - - protected boolean littleEndian; - protected BufferManagerWrite bufferManagerWrite; - ByteBufferWithInfo bbwi; - - protected ORB orb; - protected ORBUtilSystemException wrapper ; - - protected boolean debug = false; - - protected int blockSizeIndex = -1; - protected int blockSizePosition = 0; - - protected byte streamFormatVersion; - - private static final int DEFAULT_BUFFER_SIZE = 1024; - private static final String kWriteMethod = "write"; - - // Codebase cache - private CacheTable codebaseCache = null; - - // Value cache - private CacheTable valueCache = null; - - // Repository ID cache - private CacheTable repositoryIdCache = null; - - // Write end flag - private int end_flag = 0; - - // Beginning with the resolution to interop issue 3526, - // only enclosing chunked valuetypes are taken into account - // when computing the nesting level. However, we still need - // the old computation around for interoperability with our - // older ORBs. - private int chunkedValueNestingLevel = 0; - - private boolean mustChunk = false; - - // In block marker - protected boolean inBlock = false; - - // Last end tag position - private int end_flag_position = 0; - private int end_flag_index = 0; - - // ValueHandler - private ValueHandler valueHandler = null; - - // Repository ID handlers - private RepositoryIdUtility repIdUtil; - private RepositoryIdStrings repIdStrs; - - // Code set converters (created when first needed) - private CodeSetConversion.CTBConverter charConverter; - private CodeSetConversion.CTBConverter wcharConverter; - - // REVISIT - This should be re-factored so that including whether - // to use pool byte buffers or not doesn't need to be known. - public void init(org.omg.CORBA.ORB orb, - boolean littleEndian, - BufferManagerWrite bufferManager, - byte streamFormatVersion, - boolean usePooledByteBuffers) - { - // ORB must not be null. See CDROutputStream constructor. - this.orb = (ORB)orb; - this.wrapper = ORBUtilSystemException.get( this.orb, - CORBALogDomains.RPC_ENCODING ) ; - debug = this.orb.transportDebugFlag; - - this.littleEndian = littleEndian; - this.bufferManagerWrite = bufferManager; - this.bbwi = new ByteBufferWithInfo(orb, bufferManager, usePooledByteBuffers); - this.streamFormatVersion = streamFormatVersion; - - createRepositoryIdHandlers(); - } - - public void init(org.omg.CORBA.ORB orb, - boolean littleEndian, - BufferManagerWrite bufferManager, - byte streamFormatVersion) - { - init(orb, littleEndian, bufferManager, streamFormatVersion, true); - } - - private final void createRepositoryIdHandlers() - { - repIdUtil = RepositoryIdFactory.getRepIdUtility(); - repIdStrs = RepositoryIdFactory.getRepIdStringsFactory(); - } - - public BufferManagerWrite getBufferManager() - { - return bufferManagerWrite; - } - - public byte[] toByteArray() { - byte[] it; - - it = new byte[bbwi.position()]; - - // Micro-benchmarks show ByteBuffer.get(int) out perform the bulk - // ByteBuffer.get(byte[], offset, length). - for (int i = 0; i < bbwi.position(); i++) - it[i] = bbwi.byteBuffer.get(i); - - return it; - } - - public GIOPVersion getGIOPVersion() { - return GIOPVersion.V1_0; - } - - // Called by Request and Reply message. Valid for GIOP versions >= 1.2 only. - // Illegal for GIOP versions < 1.2. - void setHeaderPadding(boolean headerPadding) { - throw wrapper.giopVersionError(); - } - - protected void handleSpecialChunkBegin(int requiredSize) - { - // No-op for GIOP 1.0 - } - - protected void handleSpecialChunkEnd() - { - // No-op for GIOP 1.0 - } - - protected final int computeAlignment(int align) { - if (align > 1) { - int incr = bbwi.position() & (align - 1); - if (incr != 0) - return align - incr; - } - - return 0; - } - - protected void alignAndReserve(int align, int n) { - - bbwi.position(bbwi.position() + computeAlignment(align)); - - if (bbwi.position() + n > bbwi.buflen) - grow(align, n); - } - - // - // Default implementation of grow. Subclassers may override this. - // Always grow the single buffer. This needs to delegate - // fragmentation policy for IIOP 1.1. - // - protected void grow(int align, int n) - { - bbwi.needed = n; - - bufferManagerWrite.overflow(bbwi); - } - - public final void putEndian() throws SystemException { - write_boolean(littleEndian); - } - - public final boolean littleEndian() { - return littleEndian; - } - - void freeInternalCaches() { - if (codebaseCache != null) - codebaseCache.done(); - - if (valueCache != null) - valueCache.done(); - - if (repositoryIdCache != null) - repositoryIdCache.done(); - } - - // No such type in java - public final void write_longdouble(double x) - { - throw wrapper.longDoubleNotImplemented( - CompletionStatus.COMPLETED_MAYBE ) ; - } - - public void write_octet(byte x) - { - // The 'if' stmt is commented out since we need the alignAndReserve to - // be called, particularly when the first body byte is written, - // to induce header padding to align the body on a 8-octet boundary, - // for GIOP versions 1.2 and above. Refer to internalWriteOctetArray() - // method that also has a similar change. - //if (bbwi.position() + 1 > bbwi.buflen) - alignAndReserve(1, 1); - -// REVISIT - Should just use ByteBuffer.put(byte) and let it -// increment the ByteBuffer position. This is true -// for all write operations in this file. - - bbwi.byteBuffer.put(bbwi.position(), x); - bbwi.position(bbwi.position() + 1); - - } - - public final void write_boolean(boolean x) - { - write_octet(x? (byte)1:(byte)0); - } - - public void write_char(char x) - { - CodeSetConversion.CTBConverter converter = getCharConverter(); - - converter.convert(x); - - // CORBA formal 99-10-07 15.3.1.6: "In the case of multi-byte encodings - // of characters, a single instance of the char type may only - // hold one octet of any multi-byte character encoding." - if (converter.getNumBytes() > 1) - throw wrapper.invalidSingleCharCtb(CompletionStatus.COMPLETED_MAYBE); - - write_octet(converter.getBytes()[0]); - } - - // These wchar methods are only used when talking to - // legacy ORBs, now. - private final void writeLittleEndianWchar(char x) { - bbwi.byteBuffer.put(bbwi.position(), (byte)(x & 0xFF)); - bbwi.byteBuffer.put(bbwi.position() + 1, (byte)((x >>> 8) & 0xFF)); - bbwi.position(bbwi.position() + 2); - } - - private final void writeBigEndianWchar(char x) { - bbwi.byteBuffer.put(bbwi.position(), (byte)((x >>> 8) & 0xFF)); - bbwi.byteBuffer.put(bbwi.position() + 1, (byte)(x & 0xFF)); - bbwi.position(bbwi.position() + 2); - } - - private final void writeLittleEndianShort(short x) { - bbwi.byteBuffer.put(bbwi.position(), (byte)(x & 0xFF)); - bbwi.byteBuffer.put(bbwi.position() + 1, (byte)((x >>> 8) & 0xFF)); - bbwi.position(bbwi.position() + 2); - } - - private final void writeBigEndianShort(short x) { - bbwi.byteBuffer.put(bbwi.position(), (byte)((x >>> 8) & 0xFF)); - bbwi.byteBuffer.put(bbwi.position() + 1, (byte)(x & 0xFF)); - bbwi.position(bbwi.position() + 2); - } - - private final void writeLittleEndianLong(int x) { - bbwi.byteBuffer.put(bbwi.position(), (byte)(x & 0xFF)); - bbwi.byteBuffer.put(bbwi.position() + 1, (byte)((x >>> 8) & 0xFF)); - bbwi.byteBuffer.put(bbwi.position() + 2, (byte)((x >>> 16) & 0xFF)); - bbwi.byteBuffer.put(bbwi.position() + 3, (byte)((x >>> 24) & 0xFF)); - bbwi.position(bbwi.position() + 4); - } - - private final void writeBigEndianLong(int x) { - bbwi.byteBuffer.put(bbwi.position(), (byte)((x >>> 24) & 0xFF)); - bbwi.byteBuffer.put(bbwi.position() + 1, (byte)((x >>> 16) & 0xFF)); - bbwi.byteBuffer.put(bbwi.position() + 2, (byte)((x >>> 8) & 0xFF)); - bbwi.byteBuffer.put(bbwi.position() + 3, (byte)(x & 0xFF)); - bbwi.position(bbwi.position() + 4); - } - - private final void writeLittleEndianLongLong(long x) { - bbwi.byteBuffer.put(bbwi.position(), (byte)(x & 0xFF)); - bbwi.byteBuffer.put(bbwi.position() + 1, (byte)((x >>> 8) & 0xFF)); - bbwi.byteBuffer.put(bbwi.position() + 2, (byte)((x >>> 16) & 0xFF)); - bbwi.byteBuffer.put(bbwi.position() + 3, (byte)((x >>> 24) & 0xFF)); - bbwi.byteBuffer.put(bbwi.position() + 4, (byte)((x >>> 32) & 0xFF)); - bbwi.byteBuffer.put(bbwi.position() + 5, (byte)((x >>> 40) & 0xFF)); - bbwi.byteBuffer.put(bbwi.position() + 6, (byte)((x >>> 48) & 0xFF)); - bbwi.byteBuffer.put(bbwi.position() + 7, (byte)((x >>> 56) & 0xFF)); - bbwi.position(bbwi.position() + 8); - } - - private final void writeBigEndianLongLong(long x) { - bbwi.byteBuffer.put(bbwi.position(), (byte)((x >>> 56) & 0xFF)); - bbwi.byteBuffer.put(bbwi.position() + 1, (byte)((x >>> 48) & 0xFF)); - bbwi.byteBuffer.put(bbwi.position() + 2, (byte)((x >>> 40) & 0xFF)); - bbwi.byteBuffer.put(bbwi.position() + 3, (byte)((x >>> 32) & 0xFF)); - bbwi.byteBuffer.put(bbwi.position() + 4, (byte)((x >>> 24) & 0xFF)); - bbwi.byteBuffer.put(bbwi.position() + 5, (byte)((x >>> 16) & 0xFF)); - bbwi.byteBuffer.put(bbwi.position() + 6, (byte)((x >>> 8) & 0xFF)); - bbwi.byteBuffer.put(bbwi.position() + 7, (byte)(x & 0xFF)); - bbwi.position(bbwi.position() + 8); - } - - public void write_wchar(char x) - { - // Don't allow transmission of wchar/wstring data with - // foreign ORBs since it's against the spec. - if (ORBUtility.isForeignORB(orb)) { - throw wrapper.wcharDataInGiop10(CompletionStatus.COMPLETED_MAYBE); - } - - // If it's one of our legacy ORBs, do what they did: - alignAndReserve(2, 2); - - if (littleEndian) { - writeLittleEndianWchar(x); - } else { - writeBigEndianWchar(x); - } - } - - public void write_short(short x) - { - alignAndReserve(2, 2); - - if (littleEndian) { - writeLittleEndianShort(x); - } else { - writeBigEndianShort(x); - } - } - - public final void write_ushort(short x) - { - write_short(x); - } - - public void write_long(int x) - { - alignAndReserve(4, 4); - - if (littleEndian) { - writeLittleEndianLong(x); - } else { - writeBigEndianLong(x); - } - } - - public final void write_ulong(int x) - { - write_long(x); - } - - public void write_longlong(long x) - { - alignAndReserve(8, 8); - - if (littleEndian) { - writeLittleEndianLongLong(x); - } else { - writeBigEndianLongLong(x); - } - } - - public final void write_ulonglong(long x) - { - write_longlong(x); - } - - public final void write_float(float x) - { - write_long(Float.floatToIntBits(x)); - } - - public final void write_double(double x) - { - write_longlong(Double.doubleToLongBits(x)); - } - - public void write_string(String value) - { - writeString(value); - } - - protected int writeString(String value) - { - if (value == null) { - throw wrapper.nullParam(CompletionStatus.COMPLETED_MAYBE); - } - - CodeSetConversion.CTBConverter converter = getCharConverter(); - - converter.convert(value); - - // A string is encoded as an unsigned CORBA long for the - // number of bytes to follow (including a terminating null). - // There is only one octet per character in the string. - int len = converter.getNumBytes() + 1; - - handleSpecialChunkBegin(computeAlignment(4) + 4 + len); - - write_long(len); - int indirection = get_offset() - 4; - - internalWriteOctetArray(converter.getBytes(), 0, converter.getNumBytes()); - - // Write the null ending - write_octet((byte)0); - - handleSpecialChunkEnd(); - return indirection; - } - - public void write_wstring(String value) - { - if (value == null) - throw wrapper.nullParam(CompletionStatus.COMPLETED_MAYBE); - - // Don't allow transmission of wchar/wstring data with - // foreign ORBs since it's against the spec. - if (ORBUtility.isForeignORB(orb)) { - throw wrapper.wcharDataInGiop10(CompletionStatus.COMPLETED_MAYBE); - } - - // When talking to our legacy ORBs, do what they did: - int len = value.length() + 1; - - // This will only have an effect if we're already chunking - handleSpecialChunkBegin(4 + (len * 2) + computeAlignment(4)); - - write_long(len); - - for (int i = 0; i < len - 1; i++) - write_wchar(value.charAt(i)); - - // Write the null ending - write_short((short)0); - - // This will only have an effect if we're already chunking - handleSpecialChunkEnd(); - } - - // Performs no checks and doesn't tamper with chunking - void internalWriteOctetArray(byte[] value, int offset, int length) - { - int n = offset; - - // This flag forces the alignAndReserve method to be called the - // first time an octet is written. This is necessary to ensure - // that the body is aligned on an 8-octet boundary. Note the 'if' - // condition inside the 'while' loop below. Also, refer to the - // write_octet() method that has a similar change. - boolean align = true; - - while (n < length+offset) { - int avail; - int bytes; - int wanted; - - if ((bbwi.position() + 1 > bbwi.buflen) || align) { - align = false; - alignAndReserve(1, 1); - } - avail = bbwi.buflen - bbwi.position(); - wanted = (length + offset) - n; - bytes = (wanted < avail) ? wanted : avail; - for (int i = 0; i < bytes; i++) - bbwi.byteBuffer.put(bbwi.position() + i, value[n+i]); - bbwi.position(bbwi.position() + bytes); - n += bytes; - } - } - - public final void write_octet_array(byte b[], int offset, int length) - { - if ( b == null ) - throw wrapper.nullParam(CompletionStatus.COMPLETED_MAYBE); - - // This will only have an effect if we're already chunking - handleSpecialChunkBegin(length); - - internalWriteOctetArray(b, offset, length); - - // This will only have an effect if we're already chunking - handleSpecialChunkEnd(); - } - - public void write_Principal(Principal p) - { - write_long(p.name().length); - write_octet_array(p.name(), 0, p.name().length); - } - - public void write_any(Any any) - { - if ( any == null ) - throw wrapper.nullParam(CompletionStatus.COMPLETED_MAYBE); - - write_TypeCode(any.type()); - any.write_value(parent); - } - - public void write_TypeCode(TypeCode tc) - { - if ( tc == null ) { - throw wrapper.nullParam(CompletionStatus.COMPLETED_MAYBE); - } - TypeCodeImpl tci; - if (tc instanceof TypeCodeImpl) { - tci = (TypeCodeImpl)tc; - } - else { - tci = new TypeCodeImpl(orb, tc); - } - - tci.write_value((org.omg.CORBA_2_3.portable.OutputStream)parent); - } - - public void write_Object(org.omg.CORBA.Object ref) - { - if (ref == null) { - IOR nullIOR = IORFactories.makeIOR( orb ) ; - nullIOR.write(parent); - return; - } - - // IDL to Java formal 01-06-06 1.21.4.2 - if (ref instanceof org.omg.CORBA.LocalObject) - throw wrapper.writeLocalObject(CompletionStatus.COMPLETED_MAYBE); - - IOR ior = ORBUtility.connectAndGetIOR( orb, ref ) ; - ior.write(parent); - return; - } - - // ------------ RMI related methods -------------------------- - - public void write_abstract_interface(java.lang.Object obj) { - boolean corbaObject = false; // Assume value type. - org.omg.CORBA.Object theObject = null; - - // Is it a CORBA.Object? - - if (obj != null && obj instanceof org.omg.CORBA.Object) { - - // Yes. - - theObject = (org.omg.CORBA.Object)obj; - corbaObject = true; - } - - // Write our flag... - - write_boolean(corbaObject); - - // Now write out the object... - - if (corbaObject) { - write_Object(theObject); - } else { - try { - write_value((java.io.Serializable)obj); - } catch(ClassCastException cce) { - if (obj instanceof java.io.Serializable) - throw cce; - else - ORBUtility.throwNotSerializableForCorba(obj.getClass().getName()); - } - } - } - - public void write_value(Serializable object, Class clz) { - - write_value(object); - } - - private void writeWStringValue(String string) { - - int indirection = writeValueTag(mustChunk, true, null); - - // Write WStringValue's repository ID - write_repositoryId(repIdStrs.getWStringValueRepId()); - - // Add indirection for object to indirection table - updateIndirectionTable(indirection, string, string); - - // Write Value chunk - if (mustChunk) { - start_block(); - end_flag--; - chunkedValueNestingLevel--; - } else - end_flag--; - - write_wstring(string); - - if (mustChunk) - end_block(); - - // Write end tag - writeEndTag(mustChunk); - } - - private void writeArray(Serializable array, Class clazz) { - - if (valueHandler == null) - valueHandler = ORBUtility.createValueHandler(); //d11638 - - // Write value_tag - int indirection = writeValueTag(mustChunk, true, - Util.getCodebase(clazz)); - - // Write repository ID - write_repositoryId(repIdStrs.createSequenceRepID(clazz)); - - // Add indirection for object to indirection table - updateIndirectionTable(indirection, array, array); - - // Write Value chunk - if (mustChunk) { - start_block(); - end_flag--; - chunkedValueNestingLevel--; - } else - end_flag--; - - if (valueHandler instanceof ValueHandlerMultiFormat) { - ValueHandlerMultiFormat vh = (ValueHandlerMultiFormat)valueHandler; - vh.writeValue(parent, array, streamFormatVersion); - } else - valueHandler.writeValue(parent, array); - - if (mustChunk) - end_block(); - - // Write end tag - writeEndTag(mustChunk); - } - - private void writeValueBase(org.omg.CORBA.portable.ValueBase object, - Class clazz) { - // _REVISIT_ could check to see whether chunking really needed - mustChunk = true; - - // Write value_tag - int indirection = writeValueTag(true, true, Util.getCodebase(clazz)); - - // Get rep id - String repId = ((ValueBase)object)._truncatable_ids()[0]; - - // Write rep id - write_repositoryId(repId); - - // Add indirection for object to indirection table - updateIndirectionTable(indirection, object, object); - - // Write Value chunk - start_block(); - end_flag--; - chunkedValueNestingLevel--; - writeIDLValue(object, repId); - end_block(); - - // Write end tag - writeEndTag(true); - } - - private void writeRMIIIOPValueType(Serializable object, Class clazz) { - if (valueHandler == null) - valueHandler = ORBUtility.createValueHandler(); //d11638 - - Serializable key = object; - - // Allow the ValueHandler to call writeReplace on - // the Serializable (if the method is present) - object = valueHandler.writeReplace(key); - - if (object == null) { - // Write null tag and return - write_long(0); - return; - } - - if (object != key) { - if (valueCache != null && valueCache.containsKey(object)) { - writeIndirection(INDIRECTION_TAG, valueCache.getVal(object)); - return; - } - - clazz = object.getClass(); - } - - if (mustChunk || valueHandler.isCustomMarshaled(clazz)) { - mustChunk = true; - } - - // Write value_tag - int indirection = writeValueTag(mustChunk, true, Util.getCodebase(clazz)); - - // Write rep. id - write_repositoryId(repIdStrs.createForJavaType(clazz)); - - // Add indirection for object to indirection table - updateIndirectionTable(indirection, object, key); - - if (mustChunk) { - // Write Value chunk - end_flag--; - chunkedValueNestingLevel--; - start_block(); - } else - end_flag--; - - if (valueHandler instanceof ValueHandlerMultiFormat) { - ValueHandlerMultiFormat vh = (ValueHandlerMultiFormat)valueHandler; - vh.writeValue(parent, object, streamFormatVersion); - } else - valueHandler.writeValue(parent, object); - - if (mustChunk) - end_block(); - - // Write end tag - writeEndTag(mustChunk); - } - - public void write_value(Serializable object, String repository_id) { - - // Handle null references - if (object == null) { - // Write null tag and return - write_long(0); - return; - } - - // Handle shared references - if (valueCache != null && valueCache.containsKey(object)) { - writeIndirection(INDIRECTION_TAG, valueCache.getVal(object)); - return; - } - - Class clazz = object.getClass(); - boolean oldMustChunk = mustChunk; - - if (mustChunk) - mustChunk = true; - - if (inBlock) - end_block(); - - if (clazz.isArray()) { - // Handle arrays - writeArray(object, clazz); - } else if (object instanceof org.omg.CORBA.portable.ValueBase) { - // Handle IDL Value types - writeValueBase((org.omg.CORBA.portable.ValueBase)object, clazz); - } else if (shouldWriteAsIDLEntity(object)) { - writeIDLEntity((IDLEntity)object); - } else if (object instanceof java.lang.String) { - writeWStringValue((String)object); - } else if (object instanceof java.lang.Class) { - writeClass(repository_id, (Class)object); - } else { - // RMI-IIOP value type - writeRMIIIOPValueType(object, clazz); - } - - mustChunk = oldMustChunk; - - // Check to see if we need to start another block for a - // possible outer value - if (mustChunk) - start_block(); - - } - - public void write_value(Serializable object) - { - write_value(object, (String)null); - } - - public void write_value(Serializable object, org.omg.CORBA.portable.BoxedValueHelper factory) - { - // Handle null references - if (object == null) { - // Write null tag and return - write_long(0); - return; - } - - // Handle shared references - if ((valueCache != null) && valueCache.containsKey(object)) { - writeIndirection(INDIRECTION_TAG, valueCache.getVal(object)); - return; - } - - boolean oldMustChunk = mustChunk; - - boolean isCustom = false; - if (factory instanceof ValueHelper) { - short modifier; - try { - modifier = ((ValueHelper)factory).get_type().type_modifier(); - } catch(BadKind ex) { // tk_value_box - modifier = VM_NONE.value; - } - if (object instanceof CustomMarshal && - modifier == VM_CUSTOM.value) { - isCustom = true; - mustChunk = true; - } - if (modifier == VM_TRUNCATABLE.value) - mustChunk = true; - } - - if (mustChunk) { - - if (inBlock) - end_block(); - - // Write value_tag - int indirection = writeValueTag(true, - orb.getORBData().useRepId(), - Util.getCodebase(object.getClass()) - ); - - if (orb.getORBData().useRepId()) { - write_repositoryId(factory.get_id()); - } - - // Add indirection for object to indirection table - updateIndirectionTable(indirection, object, object); - - // Write Value chunk - start_block(); - end_flag--; - chunkedValueNestingLevel--; - if (isCustom) - ((CustomMarshal)object).marshal(parent); - else - factory.write_value(parent, object); - end_block(); - - // Write end tag - writeEndTag(true); - } - else { - // Write value_tag - int indirection = writeValueTag(false, - orb.getORBData().useRepId(), - Util.getCodebase(object.getClass()) - ); - - if (orb.getORBData().useRepId()) { - write_repositoryId(factory.get_id()); - } - - // Add indirection for object to indirection table - updateIndirectionTable(indirection, object, object); - - // Write Value chunk - end_flag--; - // no need to test for custom on the non-chunked path - factory.write_value(parent, object); - - // Write end tag - writeEndTag(false); - } - - mustChunk = oldMustChunk; - - // Check to see if we need to start another block for a - // possible outer value - if (mustChunk) - start_block(); - - } - - public int get_offset() { - return bbwi.position(); - } - - public void start_block() { - if (debug) { - dprint("CDROutputStream_1_0 start_block, position" + bbwi.position()); - } - - //Move inBlock=true to after write_long since write_long might - //trigger grow which will lead to erroneous behavior with a - //missing blockSizeIndex. - //inBlock = true; - - // Save space in the buffer for block size - write_long(0); - - //Has to happen after write_long since write_long could - //trigger grow which is overridden by supper classes to - //depend on inBlock. - inBlock = true; - - blockSizePosition = get_offset(); - - // Remember where to put the size of the endblock less 4 - blockSizeIndex = bbwi.position(); - - if (debug) { - dprint("CDROutputStream_1_0 start_block, blockSizeIndex " - + blockSizeIndex); - } - - } - - // Utility method which will hopefully decrease chunking complexity - // by allowing us to end_block and update chunk lengths without - // calling alignAndReserve. Otherwise, it's possible to get into - // recursive scenarios which lose the chunking state. - protected void writeLongWithoutAlign(int x) { - if (littleEndian) { - writeLittleEndianLong(x); - } else { - writeBigEndianLong(x); - } - } - - public void end_block() { - if (debug) { - dprint("CDROutputStream_1_0.java end_block"); - } - - if (!inBlock) - return; - - if (debug) { - dprint("CDROutputStream_1_0.java end_block, in a block"); - } - - inBlock = false; - - // Test to see if the block was of zero length - // If so, remove the block instead of ending it - // (This can happen if the last field written - // in a value was another value) - if (get_offset() == blockSizePosition) { - // Need to assert that blockSizeIndex == bbwi.position()? REVISIT - - bbwi.position(bbwi.position() - 4); - blockSizeIndex = -1; - blockSizePosition = -1; - return; - } - - int oldSize = bbwi.position(); - bbwi.position(blockSizeIndex - 4); - - writeLongWithoutAlign(oldSize - blockSizeIndex); - - bbwi.position(oldSize); - blockSizeIndex = -1; - blockSizePosition = -1; - - // System.out.println(" post end_block: " + get_offset() + " " + bbwi.position()); - } - - public org.omg.CORBA.ORB orb() - { - return orb; - } - - // ------------ End RMI related methods -------------------------- - - public final void write_boolean_array(boolean[]value, int offset, int length) { - if ( value == null ) - throw wrapper.nullParam(CompletionStatus.COMPLETED_MAYBE); - - // This will only have an effect if we're already chunking - handleSpecialChunkBegin(length); - - for (int i = 0; i < length; i++) - write_boolean(value[offset + i]); - - // This will only have an effect if we're already chunking - handleSpecialChunkEnd(); - } - - public final void write_char_array(char[]value, int offset, int length) { - if ( value == null ) - throw wrapper.nullParam(CompletionStatus.COMPLETED_MAYBE); - - // This will only have an effect if we're already chunking - handleSpecialChunkBegin(length); - - for (int i = 0; i < length; i++) - write_char(value[offset + i]); - - // This will only have an effect if we're already chunking - handleSpecialChunkEnd(); - } - - public void write_wchar_array(char[]value, int offset, int length) { - if ( value == null ) - throw wrapper.nullParam(CompletionStatus.COMPLETED_MAYBE); - - // This will only have an effect if we're already chunking - handleSpecialChunkBegin(computeAlignment(2) + (length * 2)); - - for (int i = 0; i < length; i++) - write_wchar(value[offset + i]); - - // This will only have an effect if we're already chunking - handleSpecialChunkEnd(); - } - - public final void write_short_array(short[]value, int offset, int length) { - if ( value == null ) - throw wrapper.nullParam(CompletionStatus.COMPLETED_MAYBE); - - // This will only have an effect if we're already chunking - handleSpecialChunkBegin(computeAlignment(2) + (length * 2)); - - for (int i = 0; i < length; i++) - write_short(value[offset + i]); - - // This will only have an effect if we're already chunking - handleSpecialChunkEnd(); - } - - public final void write_ushort_array(short[]value, int offset, int length) { - write_short_array(value, offset, length); - } - - public final void write_long_array(int[]value, int offset, int length) { - if ( value == null ) - throw wrapper.nullParam(CompletionStatus.COMPLETED_MAYBE); - - // This will only have an effect if we're already chunking - handleSpecialChunkBegin(computeAlignment(4) + (length * 4)); - - for (int i = 0; i < length; i++) - write_long(value[offset + i]); - - // This will only have an effect if we're already chunking - handleSpecialChunkEnd(); - } - - public final void write_ulong_array(int[]value, int offset, int length) { - write_long_array(value, offset, length); - } - - public final void write_longlong_array(long[]value, int offset, int length) { - if ( value == null ) - throw wrapper.nullParam(CompletionStatus.COMPLETED_MAYBE); - - // This will only have an effect if we're already chunking - handleSpecialChunkBegin(computeAlignment(8) + (length * 8)); - - for (int i = 0; i < length; i++) - write_longlong(value[offset + i]); - - // This will only have an effect if we're already chunking - handleSpecialChunkEnd(); - } - - public final void write_ulonglong_array(long[]value, int offset, int length) { - write_longlong_array(value, offset, length); - } - - public final void write_float_array(float[]value, int offset, int length) { - if ( value == null ) - throw wrapper.nullParam(CompletionStatus.COMPLETED_MAYBE); - - // This will only have an effect if we're already chunking - handleSpecialChunkBegin(computeAlignment(4) + (length * 4)); - - for (int i = 0; i < length; i++) - write_float(value[offset + i]); - - // This will only have an effect if we're already chunking - handleSpecialChunkEnd(); - } - - public final void write_double_array(double[]value, int offset, int length) { - if ( value == null ) - throw wrapper.nullParam(CompletionStatus.COMPLETED_MAYBE); - - // This will only have an effect if we're already chunking - handleSpecialChunkBegin(computeAlignment(8) + (length * 8)); - - for (int i = 0; i < length; i++) - write_double(value[offset + i]); - - // This will only have an effect if we're already chunking - handleSpecialChunkEnd(); - } - - public void write_string_array(String[] value, int offset, int length) { - if ( value == null ) - throw wrapper.nullParam(CompletionStatus.COMPLETED_MAYBE); - - for(int i = 0; i < length; i++) - write_string(value[offset + i]); - } - - public void write_wstring_array(String[] value, int offset, int length) { - if ( value == null ) - throw wrapper.nullParam(CompletionStatus.COMPLETED_MAYBE); - - for(int i = 0; i < length; i++) - write_wstring(value[offset + i]); - } - - public final void write_any_array(org.omg.CORBA.Any value[], int offset, int length) - { - for(int i = 0; i < length; i++) - write_any(value[offset + i]); - } - - //--------------------------------------------------------------------// - // CDROutputStream state management. - // - - public void writeTo(java.io.OutputStream s) - throws java.io.IOException - { - byte[] tmpBuf = null; - - if (bbwi.byteBuffer.hasArray()) - { - tmpBuf = bbwi.byteBuffer.array(); - } - else - { - int size = bbwi.position(); - tmpBuf = new byte[size]; - // Micro-benchmarks are showing a loop of ByteBuffer.get(int) is - // faster than ByteBuffer.get(byte[], offset, length) - for (int i = 0; i < size; i++) - tmpBuf[i] = bbwi.byteBuffer.get(i); - } - - s.write(tmpBuf, 0, bbwi.position()); - } - - public void writeOctetSequenceTo(org.omg.CORBA.portable.OutputStream s) { - - byte[] buf = null; - - if (bbwi.byteBuffer.hasArray()) - { - buf = bbwi.byteBuffer.array(); - } - else - { - int size = bbwi.position(); - buf = new byte[size]; - // Micro-benchmarks are showing a loop of ByteBuffer.get(int) is - // faster than ByteBuffer.get(byte[], offset, length) - for (int i = 0; i < size; i++) - buf[i] = bbwi.byteBuffer.get(i); - } - - s.write_long(bbwi.position()); - s.write_octet_array(buf, 0, bbwi.position()); - - } - - public final int getSize() { - return bbwi.position(); - } - - public int getIndex() { - return bbwi.position(); - } - - public boolean isLittleEndian() { - return littleEndian; - } - - public void setIndex(int value) { - bbwi.position(value); - } - - public ByteBufferWithInfo getByteBufferWithInfo() { - return bbwi; - } - - public void setByteBufferWithInfo(ByteBufferWithInfo bbwi) { - this.bbwi = bbwi; - } - - public ByteBuffer getByteBuffer() { - ByteBuffer result = null;; - if (bbwi != null) { - result = bbwi.byteBuffer; - } - return result; - } - - public void setByteBuffer(ByteBuffer byteBuffer) { - bbwi.byteBuffer = byteBuffer; - } - - private final void updateIndirectionTable(int indirection, java.lang.Object object, - java.lang.Object key) { - // int indirection = get_offset(); - if (valueCache == null) - valueCache = new CacheTable(orb,true); - valueCache.put(object, indirection); - if (key != object) - valueCache.put(key, indirection); - } - - private final void write_repositoryId(String id) { - // Use an indirection if available - if (repositoryIdCache != null && repositoryIdCache.containsKey(id)) { - writeIndirection(INDIRECTION_TAG, repositoryIdCache.getVal(id)); - return; - } - - // Write it as a string. Note that we have already done the - // special case conversion of non-Latin-1 characters to escaped - // Latin-1 sequences in RepositoryId. - - // It's not a good idea to cache them now that we can have - // multiple code sets. - int indirection = writeString(id); - - // Add indirection for id to indirection table - if (repositoryIdCache == null) - repositoryIdCache = new CacheTable(orb,true); - repositoryIdCache.put(id, indirection); - } - - private void write_codebase(String str, int pos) { - if (codebaseCache != null && codebaseCache.containsKey(str)) { - writeIndirection(INDIRECTION_TAG, codebaseCache.getVal(str)); - } - else { - write_string(str); - if (codebaseCache == null) - codebaseCache = new CacheTable(orb,true); - codebaseCache.put(str, pos); - } - } - - private final int writeValueTag(boolean chunkIt, boolean useRepId, - String codebase) { - int indirection = 0; - if (chunkIt && !useRepId){ - if (codebase == null) { - write_long(repIdUtil.getStandardRMIChunkedNoRepStrId()); - indirection = get_offset() - 4; - } else { - write_long(repIdUtil.getCodeBaseRMIChunkedNoRepStrId()); - indirection = get_offset() - 4; - write_codebase(codebase, get_offset()); - } - } else if (chunkIt && useRepId){ - if (codebase == null) { - write_long(repIdUtil.getStandardRMIChunkedId()); - indirection = get_offset() - 4; - } else { - write_long(repIdUtil.getCodeBaseRMIChunkedId()); - indirection = get_offset() - 4; - write_codebase(codebase, get_offset()); - } - } else if (!chunkIt && !useRepId) { - if (codebase == null) { - write_long(repIdUtil.getStandardRMIUnchunkedNoRepStrId()); - indirection = get_offset() - 4; - } else { - write_long(repIdUtil.getCodeBaseRMIUnchunkedNoRepStrId()); - indirection = get_offset() - 4; - write_codebase(codebase, get_offset()); - } - } else if (!chunkIt && useRepId) { - if (codebase == null) { - write_long(repIdUtil.getStandardRMIUnchunkedId()); - indirection = get_offset() - 4; - } else { - write_long(repIdUtil.getCodeBaseRMIUnchunkedId()); - indirection = get_offset() - 4; - write_codebase(codebase, get_offset()); - } - } - return indirection; - } - - private void writeIDLValue(Serializable object, String repID) - { - if (object instanceof StreamableValue) { - ((StreamableValue)object)._write(parent); - - } else if (object instanceof CustomValue) { - ((CustomValue)object).marshal(parent); - - } else { - BoxedValueHelper helper = Utility.getHelper(object.getClass(), null, repID); - boolean isCustom = false; - if (helper instanceof ValueHelper && object instanceof CustomMarshal) { - try { - if (((ValueHelper)helper).get_type().type_modifier() == VM_CUSTOM.value) - isCustom = true; - } catch(BadKind ex) { - throw wrapper.badTypecodeForCustomValue( CompletionStatus.COMPLETED_MAYBE, - ex ) ; - } - } - if (isCustom) - ((CustomMarshal)object).marshal(parent); - else - helper.write_value(parent, object); - } - } - - // Handles end tag compaction... - private void writeEndTag(boolean chunked){ - - if (chunked) { - if (get_offset() == end_flag_position) { - - if (bbwi.position() == end_flag_index) { - - // We are exactly at the same position and index as the - // end of the last end tag. Thus, we can back up over it - // and compact the tags. - bbwi.position(bbwi.position() - 4); - - } else { - - // Special case in which we're at the beginning of a new - // fragment, but the position is the same. We can't back up, - // so we just write the new end tag without compaction. This - // occurs when a value ends and calls start_block to open a - // continuation chunk, but it's called at the very end of - // a fragment. - } - } - - writeNestingLevel(); - - // Remember the last index and position. These are only used when chunking. - end_flag_index = bbwi.position(); - end_flag_position = get_offset(); - - chunkedValueNestingLevel++; - } - - // Increment the nesting level - end_flag++; - } - - /** - * Handles ORB versioning of the end tag. Should only - * be called if chunking. - * - * If talking to our older ORBs (Standard Extension, - * Kestrel, and Ladybird), write the end flag that takes - * into account all enclosing valuetypes. - * - * If talking a newer or foreign ORB, or if the orb - * instance is null, write the end flag that only takes - * into account the enclosing chunked valuetypes. - */ - private void writeNestingLevel() { - if (orb == null || - ORBVersionFactory.getFOREIGN().equals(orb.getORBVersion()) || - ORBVersionFactory.getNEWER().compareTo(orb.getORBVersion()) <= 0) { - - write_long(chunkedValueNestingLevel); - - } else { - write_long(end_flag); - } - } - - private void writeClass(String repository_id, Class clz) { - - if (repository_id == null) - repository_id = repIdStrs.getClassDescValueRepId(); - - // Write value_tag - int indirection = writeValueTag(mustChunk, true, null); - updateIndirectionTable(indirection, clz, clz); - - write_repositoryId(repository_id); - - if (mustChunk) { - // Write Value chunk - start_block(); - end_flag--; - chunkedValueNestingLevel--; - } else - end_flag--; - - writeClassBody(clz); - - if (mustChunk) - end_block(); - - // Write end tag - writeEndTag(mustChunk); - } - - // Pre-Merlin/J2EE 1.3 ORBs wrote the repository ID - // and codebase strings in the wrong order. This handles - // backwards compatibility. - private void writeClassBody(Class clz) { - if (orb == null || - ORBVersionFactory.getFOREIGN().equals(orb.getORBVersion()) || - ORBVersionFactory.getNEWER().compareTo(orb.getORBVersion()) <= 0) { - - write_value(Util.getCodebase(clz)); - write_value(repIdStrs.createForAnyType(clz)); - } else { - - write_value(repIdStrs.createForAnyType(clz)); - write_value(Util.getCodebase(clz)); - } - } - - // Casts and returns an Object as a Serializable - // This is required for JDK 1.1 only to avoid VerifyErrors when - // passing arrays as Serializable - // private java.io.Serializable make_serializable(java.lang.Object object) - // { - // return (java.io.Serializable)object; - // } - - private boolean shouldWriteAsIDLEntity(Serializable object) - { - return ((object instanceof IDLEntity) && (!(object instanceof ValueBase)) && - (!(object instanceof org.omg.CORBA.Object))); - - } - - private void writeIDLEntity(IDLEntity object) { - - // _REVISIT_ could check to see whether chunking really needed - mustChunk = true; - - String repository_id = repIdStrs.createForJavaType(object); - Class clazz = object.getClass(); - String codebase = Util.getCodebase(clazz); - - // Write value_tag - int indirection = writeValueTag(true, true, codebase); - updateIndirectionTable(indirection, object, object); - - // Write rep. id - write_repositoryId(repository_id); - - // Write Value chunk - end_flag--; - chunkedValueNestingLevel--; - start_block(); - - // Write the IDLEntity using reflection - try { - ClassLoader clazzLoader = (clazz == null ? null : clazz.getClassLoader()); - final Class helperClass = Utility.loadClassForClass(clazz.getName()+"Helper", codebase, - clazzLoader, clazz, clazzLoader); - final Class argTypes[] = {org.omg.CORBA.portable.OutputStream.class, clazz}; - // getDeclaredMethod requires RuntimePermission accessDeclaredMembers - // if a different class loader is used (even though the javadoc says otherwise) - Method writeMethod = null; - try { - writeMethod = (Method)AccessController.doPrivileged( - new PrivilegedExceptionAction() { - public java.lang.Object run() throws NoSuchMethodException { - return helperClass.getDeclaredMethod(kWriteMethod, argTypes); - } - } - ); - } catch (PrivilegedActionException pae) { - // this gets caught below - throw (NoSuchMethodException)pae.getException(); - } - java.lang.Object args[] = {parent, object}; - writeMethod.invoke(null, args); - } catch (ClassNotFoundException cnfe) { - throw wrapper.errorInvokingHelperWrite( CompletionStatus.COMPLETED_MAYBE, cnfe ) ; - } catch(NoSuchMethodException nsme) { - throw wrapper.errorInvokingHelperWrite( CompletionStatus.COMPLETED_MAYBE, nsme ) ; - } catch(IllegalAccessException iae) { - throw wrapper.errorInvokingHelperWrite( CompletionStatus.COMPLETED_MAYBE, iae ) ; - } catch(InvocationTargetException ite) { - throw wrapper.errorInvokingHelperWrite( CompletionStatus.COMPLETED_MAYBE, ite ) ; - } - end_block(); - - // Write end tag - writeEndTag(true); - } - - /* DataOutputStream methods */ - - public void write_Abstract (java.lang.Object value) { - write_abstract_interface(value); - } - - public void write_Value (java.io.Serializable value) { - write_value(value); - } - - // This will stay a custom add-on until the java-rtf issue is resolved. - // Then it should be declared in org.omg.CORBA.portable.OutputStream. - // - // Pads the string representation of bigDecimal with zeros to fit the given - // digits and scale before it gets written to the stream. - public void write_fixed(java.math.BigDecimal bigDecimal, short digits, short scale) { - String string = bigDecimal.toString(); - String integerPart; - String fractionPart; - StringBuffer stringBuffer; - - // Get rid of the sign - if (string.charAt(0) == '-' || string.charAt(0) == '+') { - string = string.substring(1); - } - - // Determine integer and fraction parts - int dotIndex = string.indexOf('.'); - if (dotIndex == -1) { - integerPart = string; - fractionPart = null; - } else if (dotIndex == 0 ) { - integerPart = null; - fractionPart = string; - } else { - integerPart = string.substring(0, dotIndex); - fractionPart = string.substring(dotIndex + 1); - } - - // Pad both parts with zeros as necessary - stringBuffer = new StringBuffer(digits); - if (fractionPart != null) { - stringBuffer.append(fractionPart); - } - while (stringBuffer.length() < scale) { - stringBuffer.append('0'); - } - if (integerPart != null) { - stringBuffer.insert(0, integerPart); - } - while (stringBuffer.length() < digits) { - stringBuffer.insert(0, '0'); - } - - // This string contains no sign or dot - this.write_fixed(stringBuffer.toString(), bigDecimal.signum()); - } - - // This method should be remove by the java-rtf issue. - // Right now the scale and digits information of the type code is lost. - public void write_fixed(java.math.BigDecimal bigDecimal) { - // This string might contain sign and/or dot - this.write_fixed(bigDecimal.toString(), bigDecimal.signum()); - } - - // The string may contain a sign and dot - public void write_fixed(String string, int signum) { - int stringLength = string.length(); - // Each octet contains (up to) two decimal digits - byte doubleDigit = 0; - char ch; - byte digit; - - // First calculate the length of the string without optional sign and dot - int numDigits = 0; - for (int i=0; i 0, fragmentOffset - // = sum i=[1,n] { bbwi_i-1_.size - buffer i header length } - // - protected int fragmentOffset = 0; - - protected void alignAndReserve(int align, int n) { - - // Notice that in 1.1, we won't end a fragment with - // alignment padding. We also won't guarantee that - // our fragments end on evenly divisible 8 byte - // boundaries. There may be alignment - // necessary with the header of the next fragment - // since the header isn't aligned on an 8 byte - // boundary, so we have to calculate it twice. - - int alignment = computeAlignment(align); - - if (bbwi.position() + n + alignment > bbwi.buflen) { - grow(align, n); - - // Must recompute the alignment after a grow. - // In the case of fragmentation, the alignment - // calculation may no longer be correct. - - // People shouldn't be able to set their fragment - // sizes so small that the fragment header plus - // this alignment fills the entire buffer. - alignment = computeAlignment(align); - } - - bbwi.position(bbwi.position() + alignment); - } - - protected void grow(int align, int n) { - // Save the current size for possible post-fragmentation calculation - int oldSize = bbwi.position(); - - super.grow(align, n); - - // At this point, if we fragmented, we should have a ByteBufferWithInfo - // with the fragment header already marshalled. The size and length fields - // should be updated accordingly, and the fragmented flag should be set. - if (bbwi.fragmented) { - - // Clear the flag - bbwi.fragmented = false; - - // Update fragmentOffset so indirections work properly. - // At this point, oldSize is the entire length of the - // previous buffer. bbwi.position() is the length of the - // fragment header of this buffer. - fragmentOffset += (oldSize - bbwi.position()); - } - } - - public int get_offset() { - return bbwi.position() + fragmentOffset; - } - - public GIOPVersion getGIOPVersion() { - return GIOPVersion.V1_1; - } - - public void write_wchar(char x) - { - // In GIOP 1.1, interoperability with wchar is limited - // to 2 byte fixed width encodings. CORBA formal 99-10-07 15.3.1.6. - // Note that the following code prohibits UTF-16 with a byte - // order marker (which would result in 4 bytes). - CodeSetConversion.CTBConverter converter = getWCharConverter(); - - converter.convert(x); - - if (converter.getNumBytes() != 2) - throw wrapper.badGiop11Ctb(CompletionStatus.COMPLETED_MAYBE); - - alignAndReserve(converter.getAlignment(), - converter.getNumBytes()); - - parent.write_octet_array(converter.getBytes(), - 0, - converter.getNumBytes()); - } - - public void write_wstring(String value) - { - if (value == null) { - throw wrapper.nullParam(CompletionStatus.COMPLETED_MAYBE); - } - - // The length is the number of code points (which are 2 bytes each) - // including the 2 byte null. See CORBA formal 99-10-07 15.3.2.7. - - int len = value.length() + 1; - - write_long(len); - - CodeSetConversion.CTBConverter converter = getWCharConverter(); - - converter.convert(value); - - internalWriteOctetArray(converter.getBytes(), 0, converter.getNumBytes()); - - // Write the 2 byte null ending - write_short((short)0); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_2.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_2.java deleted file mode 100644 index 165fd98247e..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_2.java +++ /dev/null @@ -1,359 +0,0 @@ -/* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.encoding; - -import org.omg.CORBA.BAD_PARAM; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.CompletionStatus; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.impl.encoding.CodeSetConversion; -import com.sun.corba.se.impl.orbutil.ORBConstants; - -public class CDROutputStream_1_2 extends CDROutputStream_1_1 -{ - // There's a situation with chunking with fragmentation - // in which the alignment for a primitive value is needed - // to fill fragment N, but the primitive won't fit so - // must go into fragment N + 1. The behavior is the same - // as that for specialChunks. - // - // Unfortunately, given the current code, we can't reuse - // specialChunk. If you wrap each of the following - // write calls with handleSpecialChunkBegin/End, you - // will lose your state because the primitive calls will - // change the variables, etc. - // - // All of the CDR code should be rewritten moving chunking - // to a different level, perhaps in the buffer managers. - // We want to move to a compositional model rather than - // using inheritance. - // - // Note that in the grow case, chunks are _NOT_ closed - // at grow points, now. - // - // **** NOTE **** - // Since we will not support valuetypes with GIOP 1.1, that - // also means we do not support chunking there. - // - protected boolean primitiveAcrossFragmentedChunk = false; - - // Used in chunking. Here's how this works: - // - // When chunking and writing an array of primitives, a string, or a - // wstring, _AND_ it won't fit in the buffer do the following. (As - // you can see, this is a very "special" chunk.) - // - // 1. Write the length of the chunk including the array length - // 2. Set specialChunk to true - // 3 applies to ALL chunking: - // 3. In grow, if we need to fragment and specialChunk is false - // a) call end_block - // b) fragment - // Now back to the array only case: - // [write the data] - // 4. if specialChunk is true - // a) Close the chunk - // b) Set specialChunk to false - - protected boolean specialChunk = false; - - // Indicates whether the header should be padded. In GIOP 1.2 and above, the - // body must be aligned on a 8-octet boundary, and so the header needs to be - // padded appropriately. However, if there is no body to a request or reply - // message, there is no need to pad the header, in the unfragmented case. - private boolean headerPadding; - - protected void handleSpecialChunkBegin(int requiredSize) - { - // If we're chunking and the item won't fit in the buffer - if (inBlock && requiredSize + bbwi.position() > bbwi.buflen) { - - // Duplicating some code from end_block. Compute - // and write the total chunk length. - - int oldSize = bbwi.position(); - bbwi.position(blockSizeIndex - 4); - - //write_long(oldSize - blockSizeIndex); - writeLongWithoutAlign((oldSize - blockSizeIndex) + requiredSize); - bbwi.position(oldSize); - - // Set the special flag so we don't end the chunk when - // we fragment - specialChunk = true; - } - } - - protected void handleSpecialChunkEnd() - { - // If we're in a chunk and the item spanned fragments - if (inBlock && specialChunk) { - - // This is unnecessary, but I just want to show that - // we're done with the current chunk. (the end_block - // call is inappropriate here) - inBlock = false; - blockSizeIndex = -1; - blockSizePosition = -1; - - // Start a new chunk since we fragmented during the item. - // Thus, no one can go back to add more to the chunk length - start_block(); - - // Now turn off the flag so we go back to the normal - // behavior of closing a chunk when we fragment and - // reopening afterwards. - specialChunk = false; - } - } - - // Called after writing primitives - private void checkPrimitiveAcrossFragmentedChunk() - { - if (primitiveAcrossFragmentedChunk) { - primitiveAcrossFragmentedChunk = false; - - inBlock = false; - - // It would be nice to have a StreamPosition - // abstraction if we could avoid allocation - // overhead. - blockSizeIndex = -1; - blockSizePosition = -1; - - // Start a new chunk - start_block(); - } - } - - - public void write_octet(byte x) { - super.write_octet(x); - checkPrimitiveAcrossFragmentedChunk(); - } - - public void write_short(short x) { - super.write_short(x); - checkPrimitiveAcrossFragmentedChunk(); - } - - public void write_long(int x) { - super.write_long(x); - checkPrimitiveAcrossFragmentedChunk(); - } - - public void write_longlong(long x) { - super.write_longlong(x); - checkPrimitiveAcrossFragmentedChunk(); - } - - // Called by RequestMessage_1_2 or ReplyMessage_1_2 classes only. - void setHeaderPadding(boolean headerPadding) { - this.headerPadding = headerPadding; - } - - protected void alignAndReserve(int align, int n) { - - // headerPadding bit is set by the write operation of RequestMessage_1_2 - // or ReplyMessage_1_2 classes. When set, the very first body write - // operation (from the stub code) would trigger an alignAndReserve - // method call, that would in turn add the appropriate header padding, - // such that the body is aligned on a 8-octet boundary. The padding - // is required for GIOP versions 1.2 and above, only if body is present. - if (headerPadding == true) { - headerPadding = false; - alignOnBoundary(ORBConstants.GIOP_12_MSG_BODY_ALIGNMENT); - } - - // In GIOP 1.2, we always end fragments at our - // fragment size, which is an "evenly divisible - // 8 byte boundary" (aka divisible by 16). A fragment can - // end with appropriate alignment padding, but no padding - // is needed with respect to the next GIOP fragment - // header since it ends on an 8 byte boundary. - - bbwi.position(bbwi.position() + computeAlignment(align)); - - if (bbwi.position() + n > bbwi.buflen) - grow(align, n); - } - - protected void grow(int align, int n) { - - // Save the current size for possible post-fragmentation calculation - int oldSize = bbwi.position(); - - // See notes where specialChunk is defined, as well as the - // above notes for primitiveAcrossFragmentedChunk. - // - // If we're writing a primitive and chunking, we need to update - // the chunk length to include the length of the primitive (unless - // this complexity is handled by specialChunk). - // - // Note that this is wasted processing in the grow case, but that - // we don't actually close the chunk in that case. - boolean handleChunk = (inBlock && !specialChunk); - if (handleChunk) { - int oldIndex = bbwi.position(); - - bbwi.position(blockSizeIndex - 4); - - writeLongWithoutAlign((oldIndex - blockSizeIndex) + n); - - bbwi.position(oldIndex); - } - - bbwi.needed = n; - bufferManagerWrite.overflow(bbwi); - - // At this point, if we fragmented, we should have a ByteBufferWithInfo - // with the fragment header already marshalled. The buflen and position - // should be updated accordingly, and the fragmented flag should be set. - - // Note that fragmented is only true in the streaming and collect cases. - if (bbwi.fragmented) { - - // Clear the flag - bbwi.fragmented = false; - - // Update fragmentOffset so indirections work properly. - // At this point, oldSize is the entire length of the - // previous buffer. bbwi.position() is the length of the - // fragment header of this buffer. - fragmentOffset += (oldSize - bbwi.position()); - - // We just fragmented, and need to signal that we should - // start a new chunk after writing the primitive. - if (handleChunk) - primitiveAcrossFragmentedChunk = true; - - } - } - - public GIOPVersion getGIOPVersion() { - return GIOPVersion.V1_2; - } - - public void write_wchar(char x) - { - // In GIOP 1.2, a wchar is encoded as an unsigned octet length - // followed by the octets of the converted wchar. This is good, - // but it causes problems with our chunking code. We don't - // want that octet to get put in a different chunk at the end - // of the previous fragment. - // - // Ensure that this won't happen by overriding write_wchar_array - // and doing our own handleSpecialChunkBegin/End here. - CodeSetConversion.CTBConverter converter = getWCharConverter(); - - converter.convert(x); - - handleSpecialChunkBegin(1 + converter.getNumBytes()); - - write_octet((byte)converter.getNumBytes()); - - byte[] result = converter.getBytes(); - - // Write the bytes without messing with chunking - // See CDROutputStream_1_0 - internalWriteOctetArray(result, 0, converter.getNumBytes()); - - handleSpecialChunkEnd(); - } - - public void write_wchar_array(char[] value, int offset, int length) - { - if (value == null) { - throw wrapper.nullParam(CompletionStatus.COMPLETED_MAYBE); - } - - CodeSetConversion.CTBConverter converter = getWCharConverter(); - - // Unfortunately, because of chunking, we have to convert the - // entire char[] to a byte[] array first so we can know how - // many bytes we're writing ahead of time. You can't split - // an array of primitives into multiple chunks. - int totalNumBytes = 0; - - // Remember that every wchar starts with an octet telling - // its length. The buffer size is an upper bound estimate. - int maxLength = (int)Math.ceil(converter.getMaxBytesPerChar() * length); - byte[] buffer = new byte[maxLength + length]; - - for (int i = 0; i < length; i++) { - // Convert one wchar - converter.convert(value[offset + i]); - - // Make sure to add the octet length - buffer[totalNumBytes++] = (byte)converter.getNumBytes(); - - // Copy it into our buffer - System.arraycopy(converter.getBytes(), 0, - buffer, totalNumBytes, - converter.getNumBytes()); - - totalNumBytes += converter.getNumBytes(); - } - - // Now that we know the total length, we can deal with chunking. - // Note that we don't have to worry about alignment since they're - // just octets. - handleSpecialChunkBegin(totalNumBytes); - - // Must use totalNumBytes rather than buffer.length since the - // buffer.length is only the upper bound estimate. - internalWriteOctetArray(buffer, 0, totalNumBytes); - - handleSpecialChunkEnd(); - } - - public void write_wstring(String value) { - if (value == null) { - throw wrapper.nullParam(CompletionStatus.COMPLETED_MAYBE); - } - - // In GIOP 1.2, wstrings are not terminated by a null. The - // length is the number of octets in the converted format. - // A zero length string is represented with the 4 byte length - // value of 0. - if (value.length() == 0) { - write_long(0); - return; - } - - CodeSetConversion.CTBConverter converter = getWCharConverter(); - - converter.convert(value); - - handleSpecialChunkBegin(computeAlignment(4) + 4 + converter.getNumBytes()); - - write_long(converter.getNumBytes()); - - // Write the octet array without tampering with chunking - internalWriteOctetArray(converter.getBytes(), 0, converter.getNumBytes()); - - handleSpecialChunkEnd(); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CachedCodeBase.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CachedCodeBase.java deleted file mode 100644 index 3e698764e8d..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CachedCodeBase.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.encoding; - -import java.util.Hashtable; -import com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription; -import com.sun.org.omg.SendingContext.CodeBase; -import com.sun.org.omg.SendingContext.CodeBaseHelper; -import com.sun.org.omg.SendingContext._CodeBaseImplBase; -import com.sun.org.omg.SendingContext._CodeBaseStub; -import com.sun.corba.se.spi.transport.CorbaConnection; -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.orb.ORB; -/** - * Provides the reading side with a per connection cache of - * info obtained via calls to the remote CodeBase. - * - * Previously, most of this was in IIOPConnection. - * - * Features: - * Delays cache creation unless used - * Postpones remote calls until necessary - * Handles creating obj ref from IOR - * Maintains caches for the following maps: - * CodeBase IOR to obj ref (global) - * RepId to implementation URL(s) - * RepId to remote FVD - * RepId to superclass type list - * - * Needs cache management. - */ -public class CachedCodeBase extends _CodeBaseImplBase -{ - private Hashtable implementations, fvds, bases; - private volatile CodeBase delegate; - private CorbaConnection conn; - - private static Object iorMapLock = new Object(); - private static Hashtable iorMap = new Hashtable<>(); - - public static synchronized void cleanCache( ORB orb ) { - synchronized (iorMapLock) { - for (IOR ior : iorMap.keySet()) { - if (ior.getORB() == orb) { - iorMap.remove(ior); - } - } - } - } - - public CachedCodeBase(CorbaConnection connection) { - conn = connection; - } - - public com.sun.org.omg.CORBA.Repository get_ir () { - return null; - } - - public synchronized String implementation (String repId) { - String urlResult = null; - - if (implementations == null) - implementations = new Hashtable(); - else - urlResult = (String)implementations.get(repId); - - if (urlResult == null && connectedCodeBase()) { - urlResult = delegate.implementation(repId); - - if (urlResult != null) - implementations.put(repId, urlResult); - } - - return urlResult; - } - - public synchronized String[] implementations (String[] repIds) { - String[] urlResults = new String[repIds.length]; - - for (int i = 0; i < urlResults.length; i++) - urlResults[i] = implementation(repIds[i]); - - return urlResults; - } - - public synchronized FullValueDescription meta (String repId) { - FullValueDescription result = null; - - if (fvds == null) - fvds = new Hashtable(); - else - result = (FullValueDescription)fvds.get(repId); - - if (result == null && connectedCodeBase()) { - result = delegate.meta(repId); - - if (result != null) - fvds.put(repId, result); - } - - return result; - } - - public synchronized FullValueDescription[] metas (String[] repIds) { - FullValueDescription[] results - = new FullValueDescription[repIds.length]; - - for (int i = 0; i < results.length; i++) - results[i] = meta(repIds[i]); - - return results; - } - - public synchronized String[] bases (String repId) { - - String[] results = null; - - if (bases == null) - bases = new Hashtable(); - else - results = (String[])bases.get(repId); - - if (results == null && connectedCodeBase()) { - results = delegate.bases(repId); - - if (results != null) - bases.put(repId, results); - } - - return results; - } - - // Ensures that we've used the connection's IOR to create - // a valid CodeBase delegate. If this returns false, then - // it is not valid to access the delegate. - private synchronized boolean connectedCodeBase() { - if (delegate != null) - return true; - - // The delegate was null, so see if the connection's - // IOR was set. If so, then we just need to connect - // it. Otherwise, there is no hope of checking the - // remote code base. That could be bug if the - // service context processing didn't occur, or it - // could be that we're talking to a foreign ORB which - // doesn't include this optional service context. - if (conn.getCodeBaseIOR() == null) { - // REVISIT. Use Merlin logging service to report that - // codebase functionality was requested but unavailable. - if (conn.getBroker().transportDebugFlag) - conn.dprint("CodeBase unavailable on connection: " + conn); - - return false; - } - - synchronized(iorMapLock) { - - // Recheck the condition to make sure another - // thread didn't already do this while we waited - if (delegate != null) - return true; - - // Do we have a reference initialized by another connection? - delegate = CachedCodeBase.iorMap.get(conn.getCodeBaseIOR()); - - if (delegate != null) - return true; - - // Connect the delegate and update the cache - delegate = CodeBaseHelper.narrow(getObjectFromIOR()); - - // Save it for the benefit of other connections - CachedCodeBase.iorMap.put(conn.getCodeBaseIOR(), delegate); - } - - // It's now safe to use the delegate - return true; - } - - private final org.omg.CORBA.Object getObjectFromIOR() { - return CDRInputStream_1_0.internalIORToObject( - conn.getCodeBaseIOR(), null /*stubFactory*/, conn.getBroker()); - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CodeSetCache.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CodeSetCache.java deleted file mode 100644 index bcd417bc2b7..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CodeSetCache.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.encoding; - -import java.nio.charset.CharsetDecoder; -import java.nio.charset.CharsetEncoder; -import java.util.Map; -import java.util.WeakHashMap; - -/** - * Thread local cache of sun.io code set converters for performance. - * - * The thread local class contains a single reference to a Map[] - * containing two WeakHashMaps. One for CharsetEncoders and - * one for CharsetDecoders. Constants are defined for indexing. - * - * This is used internally by CodeSetConversion. - */ -class CodeSetCache -{ - /** - * The ThreadLocal data is a 2 element Map array indexed - * by BTC_CACHE_MAP and CTB_CACHE_MAP. - */ - private ThreadLocal converterCaches = new ThreadLocal() { - public java.lang.Object initialValue() { - return new Map[] { new WeakHashMap(), new WeakHashMap() }; - } - }; - - /** - * Index in the thread local converterCaches array for - * the byte to char converter Map. A key is the Java - * name corresponding to the desired code set. - */ - private static final int BTC_CACHE_MAP = 0; - - /** - * Index in the thread local converterCaches array for - * the char to byte converter Map. A key is the Java - * name corresponding to the desired code set. - */ - private static final int CTB_CACHE_MAP = 1; - - /** - * Retrieve a CharsetDecoder from the Map using the given key. - */ - CharsetDecoder getByteToCharConverter(Object key) { - Map btcMap = ((Map[])converterCaches.get())[BTC_CACHE_MAP]; - - return (CharsetDecoder)btcMap.get(key); - } - - /** - * Retrieve a CharsetEncoder from the Map using the given key. - */ - CharsetEncoder getCharToByteConverter(Object key) { - Map ctbMap = ((Map[])converterCaches.get())[CTB_CACHE_MAP]; - - return (CharsetEncoder)ctbMap.get(key); - } - - /** - * Stores the given CharsetDecoder in the thread local cache, - * and returns the same converter. - */ - CharsetDecoder setConverter(Object key, CharsetDecoder converter) { - Map btcMap = ((Map[])converterCaches.get())[BTC_CACHE_MAP]; - - btcMap.put(key, converter); - - return converter; - } - - /** - * Stores the given CharsetEncoder in the thread local cache, - * and returns the same converter. - */ - CharsetEncoder setConverter(Object key, CharsetEncoder converter) { - - Map ctbMap = ((Map[])converterCaches.get())[CTB_CACHE_MAP]; - - ctbMap.put(key, converter); - - return converter; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CodeSetComponentInfo.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CodeSetComponentInfo.java deleted file mode 100644 index 8f0e7c0c372..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CodeSetComponentInfo.java +++ /dev/null @@ -1,340 +0,0 @@ -/* - * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.encoding; - -import java.util.StringTokenizer; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.NoSuchElementException; -import org.omg.CORBA.INITIALIZE; -import org.omg.CORBA.CompletionStatus; - -import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.impl.logging.ORBUtilSystemException; - -public final class CodeSetComponentInfo { - - /** - * CodeSetComponent is part of an IOR multi-component profile. Two - * instances constitute a CodeSetComponentInfo (one for char and one - * for wchar data) - */ - public static final class CodeSetComponent { - int nativeCodeSet; - int[] conversionCodeSets; - - public boolean equals( Object obj ) - { - if (this == obj) - return true ; - - if (!(obj instanceof CodeSetComponent)) - return false ; - - CodeSetComponent other = (CodeSetComponent)obj ; - - return (nativeCodeSet == other.nativeCodeSet) && - Arrays.equals( conversionCodeSets, other.conversionCodeSets ) ; - } - - public int hashCode() - { - int result = nativeCodeSet ; - for (int ctr=0; ctr= 4) { - - int b1 = array[offset] & 0x00FF; - int b2 = array[offset + 1] & 0x00FF; - - char marker = (char)((b1 << 8) | (b2 << 0)); - - return (marker == UTF16_BE_MARKER || marker == UTF16_LE_MARKER); - } else - return false; - } - - /** - * The current solution for dealing with UTF-16 in CORBA - * is that if our sun.io converter requires byte order markers, - * and then we see a CORBA wstring/wchar without them, we - * switch to the sun.io converter that doesn't require them. - */ - private void switchToConverter(OSFCodeSetRegistry.Entry newCodeSet) { - - // Use the getConverter method from our superclass. - btc = super.getConverter(newCodeSet.getName()); - } - } - - /** - * CTB converter factory for single byte or variable length encodings. - */ - public CTBConverter getCTBConverter(OSFCodeSetRegistry.Entry codeset) { - int alignment = (!codeset.isFixedWidth() ? - 1 : - codeset.getMaxBytesPerChar()); - - return new JavaCTBConverter(codeset, alignment); - } - - /** - * CTB converter factory for multibyte (mainly fixed) encodings. - * - * Because of the awkwardness with byte order markers and the possibility of - * using UCS-2, you must specify both the endianness of the stream as well as - * whether or not to use byte order markers if applicable. UCS-2 has no byte - * order markers. UTF-16 has optional markers. - * - * If you select useByteOrderMarkers, there is no guarantee that the encoding - * will use the endianness specified. - * - */ - public CTBConverter getCTBConverter(OSFCodeSetRegistry.Entry codeset, - boolean littleEndian, - boolean useByteOrderMarkers) { - - // UCS2 doesn't have byte order markers, and we're encoding it - // as UTF-16 since UCS2 isn't available in all Java platforms. - // They should be identical with only minor differences in - // negative cases. - if (codeset == OSFCodeSetRegistry.UCS_2) - return new UTF16CTBConverter(littleEndian); - - // We can write UTF-16 with or without a byte order marker. - if (codeset == OSFCodeSetRegistry.UTF_16) { - if (useByteOrderMarkers) - return new UTF16CTBConverter(); - else - return new UTF16CTBConverter(littleEndian); - } - - // Everything else uses the generic JavaCTBConverter. - // - // Variable width encodings are aligned on 1 byte boundaries. - // A fixed width encoding with a max. of 4 bytes/char should - // align on a 4 byte boundary. Note that UTF-16 is a special - // case because of the optional byte order marker, so it's - // handled above. - // - // This doesn't matter for GIOP 1.2 wchars and wstrings - // since the encoded bytes are treated as an encapsulation. - int alignment = (!codeset.isFixedWidth() ? - 1 : - codeset.getMaxBytesPerChar()); - - return new JavaCTBConverter(codeset, alignment); - } - - /** - * BTCConverter factory for single byte or variable width encodings. - */ - public BTCConverter getBTCConverter(OSFCodeSetRegistry.Entry codeset) { - return new JavaBTCConverter(codeset); - } - - /** - * BTCConverter factory for fixed width multibyte encodings. - */ - public BTCConverter getBTCConverter(OSFCodeSetRegistry.Entry codeset, - boolean defaultToLittleEndian) { - - if (codeset == OSFCodeSetRegistry.UTF_16 || - codeset == OSFCodeSetRegistry.UCS_2) { - - return new UTF16BTCConverter(defaultToLittleEndian); - } else { - return new JavaBTCConverter(codeset); - } - } - - /** - * Follows the code set negotiation algorithm in CORBA formal 99-10-07 13.7.2. - * - * Returns the proper negotiated OSF character encoding number or - * CodeSetConversion.FALLBACK_CODESET. - */ - private int selectEncoding(CodeSetComponentInfo.CodeSetComponent client, - CodeSetComponentInfo.CodeSetComponent server) { - - // A "null" value for the server's nativeCodeSet means that - // the server desired not to indicate one. We'll take that - // to mean that it wants the first thing in its conversion list. - // If it's conversion list is empty, too, then use the fallback - // codeset. - int serverNative = server.nativeCodeSet; - - if (serverNative == 0) { - if (server.conversionCodeSets.length > 0) - serverNative = server.conversionCodeSets[0]; - else - return CodeSetConversion.FALLBACK_CODESET; - } - - if (client.nativeCodeSet == serverNative) { - // Best case -- client and server don't have to convert - return serverNative; - } - - // Is this client capable of converting to the server's - // native code set? - for (int i = 0; i < client.conversionCodeSets.length; i++) { - if (serverNative == client.conversionCodeSets[i]) { - // The client will convert to the server's - // native code set. - return serverNative; - } - } - - // Is the server capable of converting to the client's - // native code set? - for (int i = 0; i < server.conversionCodeSets.length; i++) { - if (client.nativeCodeSet == server.conversionCodeSets[i]) { - // The server will convert to the client's - // native code set. - return client.nativeCodeSet; - } - } - - // See if there are any code sets that both the server and client - // support (giving preference to the server). The order - // of conversion sets is from most to least desired. - for (int i = 0; i < server.conversionCodeSets.length; i++) { - for (int y = 0; y < client.conversionCodeSets.length; y++) { - if (server.conversionCodeSets[i] == client.conversionCodeSets[y]) { - return server.conversionCodeSets[i]; - } - } - } - - // Before using the fallback codesets, the spec calls for a - // compatibility check on the native code sets. It doesn't make - // sense because loss free communication is always possible with - // UTF8 and UTF16, the fall back code sets. It's also a lot - // of work to implement. In the case of incompatibility, the - // spec says to throw a CODESET_INCOMPATIBLE exception. - - // Use the fallback - return CodeSetConversion.FALLBACK_CODESET; - } - - /** - * Perform the code set negotiation algorithm and come up with - * the two encodings to use. - */ - public CodeSetComponentInfo.CodeSetContext negotiate(CodeSetComponentInfo client, - CodeSetComponentInfo server) { - int charData - = selectEncoding(client.getCharComponent(), - server.getCharComponent()); - - if (charData == CodeSetConversion.FALLBACK_CODESET) { - charData = OSFCodeSetRegistry.UTF_8.getNumber(); - } - - int wcharData - = selectEncoding(client.getWCharComponent(), - server.getWCharComponent()); - - if (wcharData == CodeSetConversion.FALLBACK_CODESET) { - wcharData = OSFCodeSetRegistry.UTF_16.getNumber(); - } - - return new CodeSetComponentInfo.CodeSetContext(charData, - wcharData); - } - - // No one should instantiate a CodeSetConversion but the singleton - // instance method - private CodeSetConversion() {} - - // initialize-on-demand holder - private static class CodeSetConversionHolder { - static final CodeSetConversion csc = new CodeSetConversion() ; - } - - /** - * CodeSetConversion is a singleton, and this is the access point. - */ - public final static CodeSetConversion impl() { - return CodeSetConversionHolder.csc ; - } - - // Singleton instance - private static CodeSetConversion implementation; - - // Number used internally to indicate the fallback code - // set. - private static final int FALLBACK_CODESET = 0; - - // Provides a thread local cache for the sun.io - // converters. - private CodeSetCache cache = new CodeSetCache(); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/EncapsInputStream.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/EncapsInputStream.java deleted file mode 100644 index 7853812f89d..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/EncapsInputStream.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.encoding; - -import java.nio.ByteBuffer; -import org.omg.CORBA.CompletionStatus; -import com.sun.org.omg.SendingContext.CodeBase; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.impl.encoding.CDRInputStream; -import com.sun.corba.se.impl.encoding.BufferManagerFactory; -import com.sun.corba.se.impl.encoding.CodeSetConversion; -import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry; -import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; - -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.impl.logging.ORBUtilSystemException; - -import sun.corba.EncapsInputStreamFactory; -/** - * Encapsulations are supposed to explicitly define their - * code sets and GIOP version. The original resolution to issue 2784 - * said that the defaults were UTF-8 and UTF-16, but that was not - * agreed upon. - * - * These streams currently use CDR 1.2 with ISO8859-1 for char/string and - * UTF16 for wchar/wstring. If no byte order marker is available, - * the endianness of the encapsulation is used. - * - * When more encapsulations arise that have their own special code - * sets defined, we can make all constructors take such parameters. - */ -public class EncapsInputStream extends CDRInputStream -{ - private ORBUtilSystemException wrapper ; - - // corba/EncapsOutputStream - // corba/ORBSingleton - // iiop/ORB - public EncapsInputStream(org.omg.CORBA.ORB orb, byte[] buf, - int size, boolean littleEndian, - GIOPVersion version) { - super(orb, ByteBuffer.wrap(buf), size, littleEndian, - version, Message.CDR_ENC_VERSION, - BufferManagerFactory.newBufferManagerRead( - BufferManagerFactory.GROW, - Message.CDR_ENC_VERSION, - (ORB)orb)); - - wrapper = ORBUtilSystemException.get( (ORB)orb, - CORBALogDomains.RPC_ENCODING ) ; - - performORBVersionSpecificInit(); - } - - public EncapsInputStream(org.omg.CORBA.ORB orb, ByteBuffer byteBuffer, - int size, boolean littleEndian, - GIOPVersion version) { - super(orb, byteBuffer, size, littleEndian, - version, Message.CDR_ENC_VERSION, - BufferManagerFactory.newBufferManagerRead( - BufferManagerFactory.GROW, - Message.CDR_ENC_VERSION, - (com.sun.corba.se.spi.orb.ORB)orb)); - - performORBVersionSpecificInit(); - } - - // ior/IdentifiableBase - // ior/IIOPProfile - // corba/ORBSingleton - // iiop/ORB - public EncapsInputStream(org.omg.CORBA.ORB orb, byte[] data, int size) - { - this(orb, data, size, GIOPVersion.V1_2); - } - - // corba/AnyImpl - public EncapsInputStream(EncapsInputStream eis) - { - super(eis); - - wrapper = ORBUtilSystemException.get( (ORB)(eis.orb()), - CORBALogDomains.RPC_ENCODING ) ; - - performORBVersionSpecificInit(); - } - - // CDREncapsCodec - // ServiceContext - // - // Assumes big endian (can use consumeEndian to read and set - // the endianness if it is an encapsulation with a byte order - // mark at the beginning) - public EncapsInputStream(org.omg.CORBA.ORB orb, byte[] data, int size, GIOPVersion version) - { - this(orb, data, size, false, version); - } - - /** - * Full constructor with a CodeBase parameter useful for - * unmarshaling RMI-IIOP valuetypes (technically against the - * intention of an encapsulation, but necessary due to OMG - * issue 4795. Used by ServiceContexts. - */ - public EncapsInputStream(org.omg.CORBA.ORB orb, - byte[] data, - int size, - GIOPVersion version, - CodeBase codeBase) { - super(orb, - ByteBuffer.wrap(data), - size, - false, - version, Message.CDR_ENC_VERSION, - BufferManagerFactory.newBufferManagerRead( - BufferManagerFactory.GROW, - Message.CDR_ENC_VERSION, - (ORB)orb)); - - this.codeBase = codeBase; - - performORBVersionSpecificInit(); - } - - public CDRInputStream dup() { - return EncapsInputStreamFactory.newEncapsInputStream(this); - } - - protected CodeSetConversion.BTCConverter createCharBTCConverter() { - return CodeSetConversion.impl().getBTCConverter(OSFCodeSetRegistry.ISO_8859_1); - } - - protected CodeSetConversion.BTCConverter createWCharBTCConverter() { - // Wide characters don't exist in GIOP 1.0 - if (getGIOPVersion().equals(GIOPVersion.V1_0)) - throw wrapper.wcharDataInGiop10( CompletionStatus.COMPLETED_MAYBE); - - // In GIOP 1.1, we shouldn't have byte order markers. Take the order - // of the stream if we don't see them. - if (getGIOPVersion().equals(GIOPVersion.V1_1)) - return CodeSetConversion.impl().getBTCConverter(OSFCodeSetRegistry.UTF_16, - isLittleEndian()); - - // Assume anything else adheres to GIOP 1.2 requirements. - // - // Our UTF_16 converter will work with byte order markers, and if - // they aren't present, it will use the provided endianness. - // - // With no byte order marker, it's big endian in GIOP 1.2. - // formal 00-11-03 15.3.16. - return CodeSetConversion.impl().getBTCConverter(OSFCodeSetRegistry.UTF_16, - false); - } - - public CodeBase getCodeBase() { - return codeBase; - } - - private CodeBase codeBase; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/EncapsOutputStream.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/EncapsOutputStream.java deleted file mode 100644 index 4f908dc8569..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/EncapsOutputStream.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.encoding; - -import org.omg.CORBA.CompletionStatus; - -import com.sun.corba.se.spi.orb.ORB; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; - -import com.sun.corba.se.impl.encoding.CodeSetConversion; -import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry; -import com.sun.corba.se.impl.encoding.CDROutputStream; -import com.sun.corba.se.impl.encoding.BufferManagerWrite; -import com.sun.corba.se.impl.encoding.BufferManagerFactory; -import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; -import com.sun.corba.se.impl.orbutil.ORBConstants; - -import sun.corba.EncapsInputStreamFactory; - -/** - * Encapsulations are supposed to explicitly define their - * code sets and GIOP version. The original resolution to issue 2784 - * said that the defaults were UTF-8 and UTF-16, but that was not - * agreed upon. - * - * These streams currently use CDR 1.2 with ISO8859-1 for char/string and - * UTF16 for wchar/wstring. If no byte order marker is available, - * the endianness of the encapsulation is used. - * - * When more encapsulations arise that have their own special code - * sets defined, we can make all constructors take such parameters. - */ -public class EncapsOutputStream extends CDROutputStream -{ - - // REVISIT - Right now, EncapsOutputStream's do not use - // pooled byte buffers. This is controlled by the following - // static constant. This should be re-factored such that - // the EncapsOutputStream doesn't know it's using pooled - // byte buffers. - final static boolean usePooledByteBuffers = false; - - // REVISIT - Right now, valuetypes in encapsulations will - // only use stream format version 1, which may create problems - // for service contexts or codecs (?). - - // corba/ORB - // corba/ORBSingleton - // iiop/ORB - // iiop/GIOPImpl - // corba/AnyImpl - public EncapsOutputStream(ORB orb) { - // GIOP version 1.2 with no fragmentation, big endian, - // UTF8 for char data and UTF-16 for wide char data; - this(orb, GIOPVersion.V1_2); - } - - // CDREncapsCodec - // - // REVISIT. A UTF-16 encoding with GIOP 1.1 will not work - // with byte order markers. - public EncapsOutputStream(ORB orb, GIOPVersion version) { - this(orb, version, false); - } - - // Used by IIOPProfileTemplate - // - public EncapsOutputStream(ORB orb, boolean isLittleEndian) { - this(orb, GIOPVersion.V1_2, isLittleEndian); - } - - public EncapsOutputStream(ORB orb, - GIOPVersion version, - boolean isLittleEndian) - { - super(orb, version, Message.CDR_ENC_VERSION, isLittleEndian, - BufferManagerFactory.newBufferManagerWrite( - BufferManagerFactory.GROW, - Message.CDR_ENC_VERSION, - orb), - ORBConstants.STREAM_FORMAT_VERSION_1, - usePooledByteBuffers); - } - - public org.omg.CORBA.portable.InputStream create_input_stream() { - freeInternalCaches(); - - return EncapsInputStreamFactory.newEncapsInputStream(orb(), - getByteBuffer(), - getSize(), - isLittleEndian(), - getGIOPVersion()); - } - - protected CodeSetConversion.CTBConverter createCharCTBConverter() { - return CodeSetConversion.impl().getCTBConverter(OSFCodeSetRegistry.ISO_8859_1); - } - - protected CodeSetConversion.CTBConverter createWCharCTBConverter() { - if (getGIOPVersion().equals(GIOPVersion.V1_0)) - throw wrapper.wcharDataInGiop10(CompletionStatus.COMPLETED_MAYBE); - - // In the case of GIOP 1.1, we take the byte order of the stream and don't - // use byte order markers since we're limited to a 2 byte fixed width encoding. - if (getGIOPVersion().equals(GIOPVersion.V1_1)) - return CodeSetConversion.impl().getCTBConverter(OSFCodeSetRegistry.UTF_16, - isLittleEndian(), - false); - - // Assume anything else meets GIOP 1.2 requirements - // - // Use byte order markers? If not, use big endian in GIOP 1.2. - // (formal 00-11-03 15.3.16) - - boolean useBOM = ((ORB)orb()).getORBData().useByteOrderMarkersInEncapsulations(); - - return CodeSetConversion.impl().getCTBConverter(OSFCodeSetRegistry.UTF_16, - false, - useBOM); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/IDLJavaSerializationInputStream.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/IDLJavaSerializationInputStream.java deleted file mode 100644 index 12ca370d4bf..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/IDLJavaSerializationInputStream.java +++ /dev/null @@ -1,1083 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.encoding; - -import java.io.Serializable; -import java.io.ObjectInputStream; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.math.BigDecimal; -import java.util.LinkedList; - -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.IORFactories; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.spi.presentation.rmi.StubAdapter; -import com.sun.corba.se.spi.presentation.rmi.PresentationManager; -import com.sun.corba.se.spi.presentation.rmi.PresentationDefaults; - -import com.sun.corba.se.impl.util.Utility; -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.corba.TypeCodeImpl; -import com.sun.corba.se.impl.util.RepositoryId; -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.impl.logging.ORBUtilSystemException; -import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; - -import org.omg.CORBA.Any; -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.Principal; -import org.omg.CORBA.portable.IDLEntity; - -/** - * Implementation class that uses Java serialization for input streams. - * This assumes a GIOP version 1.2 message format. - * - * This class uses a ByteArrayInputStream as the underlying buffer. The - * first 16 bytes are directly read out of the underlying buffer. This allows - * [GIOPHeader (12 bytes) + requestID (4 bytes)] to be read as bytes. - * Subsequent write operations on this output stream object uses - * ObjectInputStream class to read into the buffer. This allows unmarshaling - * complex types and graphs using the ObjectInputStream implementation. - * - * Note, this class assumes a GIOP 1.2 style header. Further, the first - * 12 bytes, that is, the GIOPHeader is read directly from the received - * message, before this stream object is called. So, this class effectively - * reads only the requestID (4 bytes) directly, and uses the - * ObjectInputStream for further unmarshaling. - * - * @author Ram Jeyaraman - */ -public class IDLJavaSerializationInputStream extends CDRInputStreamBase { - - private ORB orb; - private int bufSize; - private ByteBuffer buffer; - private byte encodingVersion; - private ObjectInputStream is; - private _ByteArrayInputStream bis; - private BufferManagerRead bufferManager; - - // [GIOPHeader(12) + requestID(4)] bytes - private final int directReadLength = Message.GIOPMessageHeaderLength + 4; - - // Used for mark / reset operations. - private boolean markOn; - private int peekIndex, peekCount; - private LinkedList markedItemQ = new LinkedList(); - - protected ORBUtilSystemException wrapper; - - class _ByteArrayInputStream extends ByteArrayInputStream { - - _ByteArrayInputStream(byte[] buf) { - super(buf); - } - - int getPosition() { - return this.pos; - } - - void setPosition(int value) { - if (value < 0 || value > count) { - throw new IndexOutOfBoundsException(); - } - this.pos = value; - } - } - - class MarshalObjectInputStream extends ObjectInputStream { - - ORB orb; - - MarshalObjectInputStream(java.io.InputStream out, ORB orb) - throws IOException { - - super(out); - this.orb = orb; - - java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public Object run() { - // needs SerializablePermission("enableSubstitution") - enableResolveObject(true); - return null; - } - } - ); - } - - /** - * Connect the Stub to the ORB. - */ - protected final Object resolveObject(Object obj) throws IOException { - try { - if (StubAdapter.isStub(obj)) { - StubAdapter.connect(obj, orb); - } - } catch (java.rmi.RemoteException re) { - IOException ie = new IOException("resolveObject failed"); - ie.initCause(re); - throw ie; - } - return obj; - } - } - - public IDLJavaSerializationInputStream(byte encodingVersion) { - super(); - this.encodingVersion = encodingVersion; - } - - public void init(org.omg.CORBA.ORB orb, - ByteBuffer byteBuffer, - int bufSize, - boolean littleEndian, - BufferManagerRead bufferManager) { - this.orb = (ORB) orb; - this.bufSize = bufSize; - this.bufferManager = bufferManager; - buffer = byteBuffer; - wrapper = - ORBUtilSystemException.get((ORB)orb, CORBALogDomains.RPC_ENCODING); - - byte[] buf; - if (buffer.hasArray()) { - buf = buffer.array(); - } else { - buf = new byte[bufSize]; - buffer.get(buf); - } - // Note: at this point, the buffer position is zero. The setIndex() - // method call can be used to set a desired read index. - bis = new _ByteArrayInputStream(buf); - } - - // Called from read_octet or read_long or read_ulong method. - private void initObjectInputStream() { - //System.out.print(" is "); - if (is != null) { - throw wrapper.javaStreamInitFailed(); - } - try { - is = new MarshalObjectInputStream(bis, orb); - } catch (Exception e) { - throw wrapper.javaStreamInitFailed(e); - } - } - - // org.omg.CORBA.portable.InputStream - - // Primitive types. - - public boolean read_boolean() { - if (!markOn && !(markedItemQ.isEmpty())) { // dequeue - return ((Boolean)markedItemQ.removeFirst()).booleanValue(); - } - if (markOn && !(markedItemQ.isEmpty()) && - (peekIndex < peekCount)) { // peek - return ((Boolean)markedItemQ.get(peekIndex++)).booleanValue(); - } - try { - boolean value = is.readBoolean(); - if (markOn) { // enqueue - markedItemQ.addLast(Boolean.valueOf(value)); - } - return value; - } catch (Exception e) { - throw wrapper.javaSerializationException(e, "read_boolean"); - } - } - - public char read_char() { - if (!markOn && !(markedItemQ.isEmpty())) { // dequeue - return ((Character)markedItemQ.removeFirst()).charValue(); - } - if (markOn && !(markedItemQ.isEmpty()) && - (peekIndex < peekCount)) { // peek - return ((Character)markedItemQ.get(peekIndex++)).charValue(); - } - try { - char value = is.readChar(); - if (markOn) { // enqueue - markedItemQ.addLast(new Character(value)); - } - return value; - } catch (Exception e) { - throw wrapper.javaSerializationException(e, "read_char"); - } - } - - public char read_wchar() { - return this.read_char(); - } - - public byte read_octet() { - - // check if size < [ GIOPHeader(12) + requestID(4)] bytes - if (bis.getPosition() < directReadLength) { - byte b = (byte) bis.read(); - if (bis.getPosition() == directReadLength) { - initObjectInputStream(); - } - return b; - } - - if (!markOn && !(markedItemQ.isEmpty())) { // dequeue - return ((Byte)markedItemQ.removeFirst()).byteValue(); - } - - if (markOn && !(markedItemQ.isEmpty()) && - (peekIndex < peekCount)) { // peek - return ((Byte)markedItemQ.get(peekIndex++)).byteValue(); - } - - try { - byte value = is.readByte(); - if (markOn) { // enqueue - //markedItemQ.addLast(Byte.valueOf(value)); // only in JDK 1.5 - markedItemQ.addLast(new Byte(value)); - } - return value; - } catch (Exception e) { - throw wrapper.javaSerializationException(e, "read_octet"); - } - } - - public short read_short() { - if (!markOn && !(markedItemQ.isEmpty())) { // dequeue - return ((Short)markedItemQ.removeFirst()).shortValue(); - } - if (markOn && !(markedItemQ.isEmpty()) && - (peekIndex < peekCount)) { // peek - return ((Short)markedItemQ.get(peekIndex++)).shortValue(); - } - - try { - short value = is.readShort(); - if (markOn) { // enqueue - markedItemQ.addLast(new Short(value)); - } - return value; - } catch (Exception e) { - throw wrapper.javaSerializationException(e, "read_short"); - } - } - - public short read_ushort() { - return this.read_short(); - } - - public int read_long() { - - // check if size < [ GIOPHeader(12) + requestID(4)] bytes - if (bis.getPosition() < directReadLength) { - - // Use big endian (network byte order). This is fixed. - // Both the writer and reader use the same byte order. - int b1 = (bis.read() << 24) & 0xFF000000; - int b2 = (bis.read() << 16) & 0x00FF0000; - int b3 = (bis.read() << 8) & 0x0000FF00; - int b4 = (bis.read() << 0) & 0x000000FF; - - if (bis.getPosition() == directReadLength) { - initObjectInputStream(); - } else if (bis.getPosition() > directReadLength) { - // Cannot happen. All direct reads are contained - // within the first 16 bytes. - wrapper.javaSerializationException("read_long"); - } - - return (b1 | b2 | b3 | b4); - } - - if (!markOn && !(markedItemQ.isEmpty())) { // dequeue - return ((Integer)markedItemQ.removeFirst()).intValue(); - } - - if (markOn && !(markedItemQ.isEmpty()) && - (peekIndex < peekCount)) { // peek - return ((Integer)markedItemQ.get(peekIndex++)).intValue(); - } - - try { - int value = is.readInt(); - if (markOn) { // enqueue - markedItemQ.addLast(new Integer(value)); - } - return value; - } catch (Exception e) { - throw wrapper.javaSerializationException(e, "read_long"); - } - } - - public int read_ulong() { - return this.read_long(); - } - - public long read_longlong() { - if (!markOn && !(markedItemQ.isEmpty())) { // dequeue - return ((Long)markedItemQ.removeFirst()).longValue(); - } - if (markOn && !(markedItemQ.isEmpty()) && - (peekIndex < peekCount)) { // peek - return ((Long)markedItemQ.get(peekIndex++)).longValue(); - } - - try { - long value = is.readLong(); - if (markOn) { // enqueue - markedItemQ.addLast(new Long(value)); - } - return value; - } catch (Exception e) { - throw wrapper.javaSerializationException(e, "read_longlong"); - } - } - - public long read_ulonglong() { - return read_longlong(); - } - - public float read_float() { - if (!markOn && !(markedItemQ.isEmpty())) { // dequeue - return ((Float)markedItemQ.removeFirst()).floatValue(); - } - if (markOn && !(markedItemQ.isEmpty()) && - (peekIndex < peekCount)) { // peek - return ((Float)markedItemQ.get(peekIndex++)).floatValue(); - } - - try { - float value = is.readFloat(); - if (markOn) { // enqueue - markedItemQ.addLast(new Float(value)); - } - return value; - } catch (Exception e) { - throw wrapper.javaSerializationException(e, "read_float"); - } - } - - public double read_double() { - if (!markOn && !(markedItemQ.isEmpty())) { // dequeue - return ((Double)markedItemQ.removeFirst()).doubleValue(); - } - if (markOn && !(markedItemQ.isEmpty()) && - (peekIndex < peekCount)) { // peek - return ((Double)markedItemQ.get(peekIndex++)).doubleValue(); - } - - try { - double value = is.readDouble(); - if (markOn) { // enqueue - markedItemQ.addLast(new Double(value)); - } - return value; - } catch (Exception e) { - throw wrapper.javaSerializationException(e, "read_double"); - } - } - - // String types. - - public String read_string() { - if (!markOn && !(markedItemQ.isEmpty())) { // dequeue - return (String) markedItemQ.removeFirst(); - } - if (markOn && !(markedItemQ.isEmpty()) && - (peekIndex < peekCount)) { // peek - return (String) markedItemQ.get(peekIndex++); - } - try { - String value = is.readUTF(); - if (markOn) { // enqueue - markedItemQ.addLast(value); - } - return value; - } catch (Exception e) { - throw wrapper.javaSerializationException(e, "read_string"); - } - } - - public String read_wstring() { - if (!markOn && !(markedItemQ.isEmpty())) { // dequeue - return (String) markedItemQ.removeFirst(); - } - if (markOn && !(markedItemQ.isEmpty()) && - (peekIndex < peekCount)) { // peek - return (String) markedItemQ.get(peekIndex++); - } - try { - String value = (String) is.readObject(); - if (markOn) { // enqueue - markedItemQ.addLast(value); - } - return value; - } catch (Exception e) { - throw wrapper.javaSerializationException(e, "read_wstring"); - } - } - - // Array types. - - public void read_boolean_array(boolean[] value, int offset, int length){ - for(int i = 0; i < length; i++) { - value[i+offset] = read_boolean(); - } - } - - public void read_char_array(char[] value, int offset, int length) { - for(int i=0; i < length; i++) { - value[i+offset] = read_char(); - } - } - - public void read_wchar_array(char[] value, int offset, int length) { - read_char_array(value, offset, length); - } - - public void read_octet_array(byte[] value, int offset, int length) { - for(int i=0; i < length; i++) { - value[i+offset] = read_octet(); - } - /* // Cannot use this efficient read due to mark/reset support. - try { - while (length > 0) { - int n = is.read(value, offset, length); - offset += n; - length -= n; - } - } catch (Exception e) { - throw wrapper.javaSerializationException(e, "read_octet_array"); - } - */ - } - - public void read_short_array(short[] value, int offset, int length) { - for(int i=0; i < length; i++) { - value[i+offset] = read_short(); - } - } - - public void read_ushort_array(short[] value, int offset, int length) { - read_short_array(value, offset, length); - } - - public void read_long_array(int[] value, int offset, int length) { - for(int i=0; i < length; i++) { - value[i+offset] = read_long(); - } - } - - public void read_ulong_array(int[] value, int offset, int length) { - read_long_array(value, offset, length); - } - - public void read_longlong_array(long[] value, int offset, int length) { - for(int i=0; i < length; i++) { - value[i+offset] = read_longlong(); - } - } - - public void read_ulonglong_array(long[] value, int offset, int length) { - read_longlong_array(value, offset, length); - } - - public void read_float_array(float[] value, int offset, int length) { - for(int i=0; i < length; i++) { - value[i+offset] = read_float(); - } - } - - public void read_double_array(double[] value, int offset, int length) { - for(int i=0; i < length; i++) { - value[i+offset] = read_double(); - } - } - - // Complex types. - - public org.omg.CORBA.Object read_Object() { - return read_Object(null); - } - - public TypeCode read_TypeCode() { - TypeCodeImpl tc = new TypeCodeImpl(orb); - tc.read_value(parent); - return tc; - } - - public Any read_any() { - - Any any = orb.create_any(); - TypeCodeImpl tc = new TypeCodeImpl(orb); - - // read off the typecode - - // REVISIT We could avoid this try-catch if we could peek the typecode - // kind off this stream and see if it is a tk_value. - // Looking at the code we know that for tk_value the Any.read_value() - // below ignores the tc argument anyway (except for the kind field). - // But still we would need to make sure that the whole typecode, - // including encapsulations, is read off. - try { - tc.read_value(parent); - } catch (org.omg.CORBA.MARSHAL ex) { - if (tc.kind().value() != org.omg.CORBA.TCKind._tk_value) { - throw ex; - } - // We can be sure that the whole typecode encapsulation has been - // read off. - ex.printStackTrace(); - } - - // read off the value of the any. - any.read_value(parent, tc); - - return any; - } - - public Principal read_Principal() { - // We don't need an implementation for this method, since principal - // is absent in GIOP version 1.2 or above. - int len = read_long(); - byte[] pvalue = new byte[len]; - read_octet_array(pvalue,0,len); - Principal p = new com.sun.corba.se.impl.corba.PrincipalImpl(); - p.name(pvalue); - return p; - } - - public BigDecimal read_fixed() { - return new BigDecimal(read_fixed_buffer().toString()); - } - - // Each octet contains (up to) two decimal digits. If the fixed type has - // an odd number of decimal digits, then the representation - // begins with the first (most significant) digit. - // Otherwise, this first half-octet is all zero, and the first digit - // is in the second half-octet. - // The sign configuration, in the last half-octet of the representation, - // is 0xD for negative numbers and 0xC for positive and zero values. - private StringBuffer read_fixed_buffer() { - StringBuffer buffer = new StringBuffer(64); - byte doubleDigit; - int firstDigit; - int secondDigit; - boolean wroteFirstDigit = false; - boolean more = true; - while (more) { - doubleDigit = read_octet(); - firstDigit = (int)((doubleDigit & 0xf0) >> 4); - secondDigit = (int)(doubleDigit & 0x0f); - if (wroteFirstDigit || firstDigit != 0) { - buffer.append(Character.forDigit(firstDigit, 10)); - wroteFirstDigit = true; - } - if (secondDigit == 12) { - // positive number or zero - if ( ! wroteFirstDigit) { - // zero - return new StringBuffer("0.0"); - } else { - // positive number - // done - } - more = false; - } else if (secondDigit == 13) { - // negative number - buffer.insert(0, '-'); - more = false; - } else { - buffer.append(Character.forDigit(secondDigit, 10)); - wroteFirstDigit = true; - } - } - return buffer; - } - - public org.omg.CORBA.Object read_Object(java.lang.Class clz) { - - // In any case, we must first read the IOR. - IOR ior = IORFactories.makeIOR(parent) ; - if (ior.isNil()) { - return null; - } - - PresentationManager.StubFactoryFactory sff = - ORB.getStubFactoryFactory(); - String codeBase = ior.getProfile().getCodebase(); - PresentationManager.StubFactory stubFactory = null; - - if (clz == null) { - RepositoryId rid = RepositoryId.cache.getId(ior.getTypeId() ); - String className = rid.getClassName(); - boolean isIDLInterface = rid.isIDLType(); - - if (className == null || className.equals( "" )) { - stubFactory = null; - } else { - try { - stubFactory = sff.createStubFactory(className, - isIDLInterface, codeBase, (Class) null, - (ClassLoader) null); - } catch (Exception exc) { - // Could not create stubFactory, so use null. - // XXX stubFactory handling is still too complex: - // Can we resolve the stubFactory question once in - // a single place? - stubFactory = null ; - } - } - } else if (StubAdapter.isStubClass(clz)) { - stubFactory = PresentationDefaults.makeStaticStubFactory(clz); - } else { - // clz is an interface class - boolean isIDL = IDLEntity.class.isAssignableFrom(clz); - - stubFactory = sff.createStubFactory( - clz.getName(), isIDL, codeBase, clz, clz.getClassLoader()); - } - - return CDRInputStream_1_0.internalIORToObject(ior, stubFactory, orb); - } - - public org.omg.CORBA.ORB orb() { - return this.orb; - } - - // org.omg.CORBA_2_3.portable.InputStream - - public java.io.Serializable read_value() { - if (!markOn && !(markedItemQ.isEmpty())) { // dequeue - return (Serializable) markedItemQ.removeFirst(); - } - if (markOn && !(markedItemQ.isEmpty()) && - (peekIndex < peekCount)) { // peek - return (Serializable) markedItemQ.get(peekIndex++); - } - try { - Serializable value = (java.io.Serializable) is.readObject(); - if (markOn) { // enqueue - markedItemQ.addLast(value); - } - return value; - } catch (Exception e) { - throw wrapper.javaSerializationException(e, "read_value"); - } - } - - public java.io.Serializable read_value(java.lang.Class clz) { - return read_value(); - } - - public java.io.Serializable read_value( - org.omg.CORBA.portable.BoxedValueHelper factory) { - return read_value(); - } - - public java.io.Serializable read_value(java.lang.String rep_id) { - return read_value(); - } - - public java.io.Serializable read_value(java.io.Serializable value) { - return read_value(); - } - - public java.lang.Object read_abstract_interface() { - return read_abstract_interface(null); - } - - public java.lang.Object read_abstract_interface(java.lang.Class clz) { - boolean isObject = read_boolean(); - if (isObject) { - return read_Object(clz); - } else { - return read_value(); - } - } - - // com.sun.corba.se.impl.encoding.MarshalInputStream - public void consumeEndian() { - throw wrapper.giopVersionError(); - } - - public int getPosition() { - try { - return bis.getPosition(); - } catch (Exception e) { - throw wrapper.javaSerializationException(e, "getPosition"); - } - } - - // org.omg.CORBA.DataInputStream - public java.lang.Object read_Abstract() { - return read_abstract_interface(); - } - - public java.io.Serializable read_Value() { - return read_value(); - } - - public void read_any_array (org.omg.CORBA.AnySeqHolder seq, - int offset, int length) { - read_any_array(seq.value, offset, length); - } - - private final void read_any_array(org.omg.CORBA.Any[] value, - int offset, int length) { - for(int i=0; i < length; i++) { - value[i+offset] = read_any(); - } - } - - public void read_boolean_array (org.omg.CORBA.BooleanSeqHolder seq, - int offset, int length){ - read_boolean_array(seq.value, offset, length); - } - - public void read_char_array (org.omg.CORBA.CharSeqHolder seq, - int offset, int length){ - read_char_array(seq.value, offset, length); - } - - public void read_wchar_array (org.omg.CORBA.WCharSeqHolder seq, - int offset, int length){ - read_wchar_array(seq.value, offset, length); - } - - public void read_octet_array (org.omg.CORBA.OctetSeqHolder seq, - int offset, int length){ - read_octet_array(seq.value, offset, length); - } - - public void read_short_array (org.omg.CORBA.ShortSeqHolder seq, - int offset, int length){ - read_short_array(seq.value, offset, length); - } - - public void read_ushort_array (org.omg.CORBA.UShortSeqHolder seq, - int offset, int length){ - read_ushort_array(seq.value, offset, length); - } - - public void read_long_array (org.omg.CORBA.LongSeqHolder seq, - int offset, int length){ - read_long_array(seq.value, offset, length); - } - - public void read_ulong_array (org.omg.CORBA.ULongSeqHolder seq, - int offset, int length){ - read_ulong_array(seq.value, offset, length); - } - - public void read_ulonglong_array (org.omg.CORBA.ULongLongSeqHolder seq, - int offset, int length){ - read_ulonglong_array(seq.value, offset, length); - } - - public void read_longlong_array (org.omg.CORBA.LongLongSeqHolder seq, - int offset, int length){ - read_longlong_array(seq.value, offset, length); - } - - public void read_float_array (org.omg.CORBA.FloatSeqHolder seq, - int offset, int length){ - read_float_array(seq.value, offset, length); - } - - public void read_double_array (org.omg.CORBA.DoubleSeqHolder seq, - int offset, int length){ - read_double_array(seq.value, offset, length); - } - - // org.omg.CORBA.portable.ValueBase - - public String[] _truncatable_ids() { - throw wrapper.giopVersionError(); - } - - // java.io.InputStream - // REVISIT - should we make these throw UnsupportedOperationExceptions? - // Right now, they'll go up to the java.io versions! - - // public int read(byte b[]) throws IOException; - // public int read(byte b[], int off, int len) throws IOException - // public long skip(long n) throws IOException; - // public int available() throws IOException; - // public void close() throws IOException; - - public void mark(int readLimit) { - // Nested mark disallowed. - // Further, mark is not supported until first 16 bytes are read. - if (markOn || is == null) { - throw wrapper.javaSerializationException("mark"); - } - markOn = true; - if (!(markedItemQ.isEmpty())) { - peekIndex = 0; - peekCount = markedItemQ.size(); - } - /* - // Note: only ByteArrayInputStream supports mark/reset. - if (is == null || is.markSupported() == false) { - throw wrapper.javaSerializationException("mark"); - } - is.mark(readLimit); - */ - } - - public void reset() { - markOn = false; - peekIndex = 0; - peekCount = 0; - /* - // Note: only ByteArrayInputStream supports mark/reset. - if (is == null || is.markSupported() == false) { - throw wrapper.javaSerializationException("mark"); - } - try { - is.reset(); - } catch (Exception e) { - throw wrapper.javaSerializationException(e, "reset"); - } - */ - } - - // This should return false so that outside users (people using the JDK) - // don't have any guarantees that mark/reset will work in their - // custom marshaling code. This is necessary since they could do things - // like expect obj1a == obj1b in the following code: - // - // is.mark(10000); - // Object obj1a = is.readObject(); - // is.reset(); - // Object obj1b = is.readObject(); - // - public boolean markSupported() { - return true; - } - - // Needed by AnyImpl and ServiceContexts - public CDRInputStreamBase dup() { - - CDRInputStreamBase result = null ; - - try { - result = (CDRInputStreamBase) this.getClass().newInstance(); - } catch (Exception e) { - throw wrapper.couldNotDuplicateCdrInputStream(e); - } - - result.init(this.orb, this.buffer, this.bufSize, false, null); - - // Set the buffer position. - ((IDLJavaSerializationInputStream)result).skipBytes(getPosition()); - - // Set mark related data. - ((IDLJavaSerializationInputStream)result). - setMarkData(markOn, peekIndex, peekCount, - (LinkedList) markedItemQ.clone()); - - return result; - } - - // Used exclusively by the dup() method. - void skipBytes(int len) { - try { - is.skipBytes(len); - } catch (Exception e) { - throw wrapper.javaSerializationException(e, "skipBytes"); - } - } - - // Used exclusively by the dup() method. - void setMarkData(boolean markOn, int peekIndex, int peekCount, - LinkedList markedItemQ) { - this.markOn = markOn; - this.peekIndex = peekIndex; - this.peekCount = peekCount; - this.markedItemQ = markedItemQ; - } - - // Needed by TCUtility - public java.math.BigDecimal read_fixed(short digits, short scale) { - // digits isn't really needed here - StringBuffer buffer = read_fixed_buffer(); - if (digits != buffer.length()) - throw wrapper.badFixed( new Integer(digits), - new Integer(buffer.length()) ) ; - buffer.insert(digits - scale, '.'); - return new BigDecimal(buffer.toString()); - } - - // Needed by TypeCodeImpl - public boolean isLittleEndian() { - throw wrapper.giopVersionError(); - } - - // Needed by request and reply messages for GIOP versions >= 1.2 only. - void setHeaderPadding(boolean headerPadding) { - // no-op. We don't care about body alignment while using - // Java serialization. What the GIOP spec states does not apply here. - } - - // Needed by IIOPInputStream and other subclasses - - public ByteBuffer getByteBuffer() { - throw wrapper.giopVersionError(); - } - - public void setByteBuffer(ByteBuffer byteBuffer) { - throw wrapper.giopVersionError(); - } - - public void setByteBufferWithInfo(ByteBufferWithInfo bbwi) { - throw wrapper.giopVersionError(); - } - - public int getBufferLength() { - return bufSize; - } - - public void setBufferLength(int value) { - // this is redundant, since buffer size was already specified - // as part of the init call. So, ignore. - } - - public int getIndex() { - return bis.getPosition(); - } - - public void setIndex(int value) { - try { - bis.setPosition(value); - } catch (IndexOutOfBoundsException e) { - throw wrapper.javaSerializationException(e, "setIndex"); - } - } - - public void orb(org.omg.CORBA.ORB orb) { - this.orb = (ORB) orb; - } - - public BufferManagerRead getBufferManager() { - return bufferManager; - } - - public GIOPVersion getGIOPVersion() { - return GIOPVersion.V1_2; - } - - com.sun.org.omg.SendingContext.CodeBase getCodeBase() { - return parent.getCodeBase(); - } - - void printBuffer() { - byte[] buf = this.buffer.array(); - - System.out.println("+++++++ Input Buffer ++++++++"); - System.out.println(); - System.out.println("Current position: " + getPosition()); - System.out.println("Total length : " + this.bufSize); - System.out.println(); - - char[] charBuf = new char[16]; - - try { - - for (int i = 0; i < buf.length; i += 16) { - - int j = 0; - - // For every 16 bytes, there is one line - // of output. First, the hex output of - // the 16 bytes with each byte separated - // by a space. - while (j < 16 && j + i < buf.length) { - int k = buf[i + j]; - if (k < 0) - k = 256 + k; - String hex = Integer.toHexString(k); - if (hex.length() == 1) - hex = "0" + hex; - System.out.print(hex + " "); - j++; - } - - // Add any extra spaces to align the - // text column in case we didn't end - // at 16 - while (j < 16) { - System.out.print(" "); - j++; - } - - // Now output the ASCII equivalents. Non-ASCII - // characters are shown as periods. - int x = 0; - - while (x < 16 && x + i < buf.length) { - if (ORBUtility.isPrintable((char)buf[i + x])) { - charBuf[x] = (char) buf[i + x]; - } else { - charBuf[x] = '.'; - } - x++; - } - System.out.println(new String(charBuf, 0, x)); - } - } catch (Throwable t) { - t.printStackTrace(); - } - System.out.println("++++++++++++++++++++++++++++++"); - } - - void alignOnBoundary(int octetBoundary) { - throw wrapper.giopVersionError(); - } - - void performORBVersionSpecificInit() { - // No-op. - } - - public void resetCodeSetConverters() { - // No-op. - } - - // ValueInputStream ------------------------- - - public void start_value() { - throw wrapper.giopVersionError(); - } - - public void end_value() { - throw wrapper.giopVersionError(); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/IDLJavaSerializationOutputStream.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/IDLJavaSerializationOutputStream.java deleted file mode 100644 index 6914e0ec87a..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/IDLJavaSerializationOutputStream.java +++ /dev/null @@ -1,798 +0,0 @@ -/* - * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.encoding; - -import java.io.IOException; -import java.io.ObjectOutputStream; -import java.io.ByteArrayOutputStream; - -import java.nio.ByteBuffer; - -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.IORFactories; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.spi.presentation.rmi.StubAdapter; - -import com.sun.corba.se.impl.util.Utility; -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.corba.TypeCodeImpl; -import com.sun.corba.se.impl.logging.ORBUtilSystemException; -import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; - -import org.omg.CORBA.Any; -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.Principal; -import org.omg.CORBA.CompletionStatus; - -/** - * Implementation class that uses Java serialization for output streams. - * This assumes a GIOP version 1.2 message format. - * - * This class uses a ByteArrayOutputStream as the underlying buffer. The - * first 16 bytes are direct writes into the underlying buffer. This allows - * [GIOPHeader (12 bytes) + requestID (4 bytes)] to be written as bytes. - * Subsequent write operations on this output stream object uses - * ObjectOutputStream class to write into the buffer. This allows marshaling - * complex types and graphs using the ObjectOutputStream implementation. - * - * Note, this class assumes a GIOP 1.2 style header. Note, we expect that the - * first 16 bytes are written only using the write_octet, write_long or - * write_ulong method calls. - * - * @author Ram Jeyaraman - */ -final class IDLJavaSerializationOutputStream extends CDROutputStreamBase { - - private ORB orb; - private byte encodingVersion; - private ObjectOutputStream os; - private _ByteArrayOutputStream bos; - private BufferManagerWrite bufferManager; - - // [GIOPHeader(12) + requestID(4)] bytes - private final int directWriteLength = Message.GIOPMessageHeaderLength + 4; - - protected ORBUtilSystemException wrapper; - - class _ByteArrayOutputStream extends ByteArrayOutputStream { - - _ByteArrayOutputStream(int initialSize) { - super(initialSize); - } - - byte[] getByteArray() { - return this.buf; - } - } - - class MarshalObjectOutputStream extends ObjectOutputStream { - - ORB orb; - - MarshalObjectOutputStream(java.io.OutputStream out, ORB orb) - throws IOException { - - super(out); - this.orb = orb; - java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public Object run() { - // needs SerializablePermission("enableSubstitution") - enableReplaceObject(true); - return null; - } - } - ); - } - - /** - * Checks for objects that are instances of java.rmi.Remote - * that need to be serialized as proxy (Stub) objects. - */ - protected final Object replaceObject(Object obj) throws IOException { - try { - if ((obj instanceof java.rmi.Remote) && - !(StubAdapter.isStub(obj))) { - return Utility.autoConnect(obj, orb, true); - } - } catch (Exception e) { - IOException ie = new IOException("replaceObject failed"); - ie.initCause(e); - throw ie; - } - return obj; - } - } - - public IDLJavaSerializationOutputStream(byte encodingVersion) { - super(); - this.encodingVersion = encodingVersion; - } - - public void init(org.omg.CORBA.ORB orb, boolean littleEndian, - BufferManagerWrite bufferManager, - byte streamFormatVersion, - boolean usePooledByteBuffers) { - this.orb = (ORB) orb; - this.bufferManager = bufferManager; - wrapper = ORBUtilSystemException.get((ORB) orb, - CORBALogDomains.RPC_ENCODING); - bos = - new _ByteArrayOutputStream(ORBConstants.GIOP_DEFAULT_BUFFER_SIZE); - } - - // Called from read_octet or read_long or read_ulong method. - private void initObjectOutputStream() { - //System.out.print(" os "); - if (os != null) { - throw wrapper.javaStreamInitFailed(); - } - try { - os = new MarshalObjectOutputStream(bos, orb); - } catch (Exception e) { - throw wrapper.javaStreamInitFailed(e); - } - } - - // org.omg.CORBA.portable.OutputStream - - // Primitive types. - - public final void write_boolean(boolean value) { - try { - os.writeBoolean(value); - } catch (Exception e) { - throw wrapper.javaSerializationException(e, "write_boolean"); - } - } - - public final void write_char(char value) { - try { - os.writeChar(value); - } catch (Exception e) { - throw wrapper.javaSerializationException(e, "write_char"); - } - } - - public final void write_wchar(char value) { - this.write_char(value); - } - - public final void write_octet(byte value) { - - // check if size < [ GIOPHeader(12) + requestID(4)] bytes - if (bos.size() < directWriteLength) { - bos.write(value); // direct write. - if (bos.size() == directWriteLength) { - initObjectOutputStream(); - } - return; - } - - try { - os.writeByte(value); - } catch (Exception e) { - throw wrapper.javaSerializationException(e, "write_octet"); - } - } - - public final void write_short(short value) { - try { - os.writeShort(value); - } catch (Exception e) { - throw wrapper.javaSerializationException(e, "write_short"); - } - } - - public final void write_ushort(short value) { - this.write_short(value); - } - - public final void write_long(int value) { - - // check if size < [ GIOPHeader(12) + requestID(4)] bytes - if (bos.size() < directWriteLength) { - - // Use big endian (network byte order). This is fixed. - // Both the writer and reader use the same byte order. - bos.write((byte)((value >>> 24) & 0xFF)); - bos.write((byte)((value >>> 16) & 0xFF)); - bos.write((byte)((value >>> 8) & 0xFF)); - bos.write((byte)((value >>> 0) & 0xFF)); - - if (bos.size() == directWriteLength) { - initObjectOutputStream(); - } else if (bos.size() > directWriteLength) { - // Cannot happen. All direct writes are contained - // within the first 16 bytes. - wrapper.javaSerializationException("write_long"); - } - return; - } - - try { - os.writeInt(value); - } catch (Exception e) { - throw wrapper.javaSerializationException(e, "write_long"); - } - } - - public final void write_ulong(int value) { - this.write_long(value); - } - - public final void write_longlong(long value) { - try { - os.writeLong(value); - } catch (Exception e) { - throw wrapper.javaSerializationException(e, "write_longlong"); - } - } - - public final void write_ulonglong(long value) { - this.write_longlong(value); - } - - public final void write_float(float value) { - try { - os.writeFloat(value); - } catch (Exception e) { - throw wrapper.javaSerializationException(e, "write_float"); - } - } - - public final void write_double(double value) { - try { - os.writeDouble(value); - } catch (Exception e) { - throw wrapper.javaSerializationException(e, "write_double"); - } - } - - // String types. - - public final void write_string(String value) { - try { - os.writeUTF(value); - } catch (Exception e) { - throw wrapper.javaSerializationException(e, "write_string"); - } - } - - public final void write_wstring(String value) { - try { - os.writeObject(value); - } catch (Exception e) { - throw wrapper.javaSerializationException(e, "write_wstring"); - } - } - - // Array types. - - public final void write_boolean_array(boolean[] value, - int offset, int length) { - for (int i = 0; i < length; i++) { - write_boolean(value[offset + i]); - } - } - - public final void write_char_array(char[] value, int offset, int length) { - for (int i = 0; i < length; i++) { - write_char(value[offset + i]); - } - } - - public final void write_wchar_array(char[] value, int offset, int length) { - write_char_array(value, offset, length); - } - - public final void write_octet_array(byte[] value, int offset, int length) { - try { - os.write(value, offset, length); - } catch (Exception e) { - throw wrapper.javaSerializationException(e, "write_octet_array"); - } - } - - public final void write_short_array(short[] value, - int offset, int length) { - for (int i = 0; i < length; i++) { - write_short(value[offset + i]); - } - } - - public final void write_ushort_array(short[] value, - int offset, int length){ - write_short_array(value, offset, length); - } - - public final void write_long_array(int[] value, int offset, int length) { - for (int i = 0; i < length; i++) { - write_long(value[offset + i]); - } - } - - public final void write_ulong_array(int[] value, int offset, int length) { - write_long_array(value, offset, length); - } - - public final void write_longlong_array(long[] value, - int offset, int length) { - for (int i = 0; i < length; i++) { - write_longlong(value[offset + i]); - } - } - - public final void write_ulonglong_array(long[] value, - int offset,int length) { - write_longlong_array(value, offset, length); - } - - public final void write_float_array(float[] value, - int offset, int length) { - for (int i = 0; i < length; i++) { - write_float(value[offset + i]); - } - } - - public final void write_double_array(double[] value, - int offset, int length) { - for (int i = 0; i < length; i++) { - write_double(value[offset + i]); - } - } - - // Complex types (objects and graphs). - - public final void write_Object(org.omg.CORBA.Object value) { - if (value == null) { - IOR nullIOR = IORFactories.makeIOR(orb); - nullIOR.write(parent); - return; - } - // IDL to Java formal 01-06-06 1.21.4.2 - if (value instanceof org.omg.CORBA.LocalObject) { - throw wrapper.writeLocalObject(CompletionStatus.COMPLETED_MAYBE); - } - IOR ior = ORBUtility.connectAndGetIOR(orb, value); - ior.write(parent); - return; - } - - public final void write_TypeCode(TypeCode tc) { - if (tc == null) { - throw wrapper.nullParam(CompletionStatus.COMPLETED_MAYBE); - } - TypeCodeImpl tci; - if (tc instanceof TypeCodeImpl) { - tci = (TypeCodeImpl) tc; - } else { - tci = new TypeCodeImpl(orb, tc); - } - tci.write_value((org.omg.CORBA_2_3.portable.OutputStream) parent); - } - - public final void write_any(Any any) { - if (any == null) { - throw wrapper.nullParam(CompletionStatus.COMPLETED_MAYBE); - } - write_TypeCode(any.type()); - any.write_value(parent); - } - - public final void write_Principal(Principal p) { - // We don't need an implementation for this method, since principal - // is absent in GIOP version 1.2 or above. - write_long(p.name().length); - write_octet_array(p.name(), 0, p.name().length); - } - - public final void write_fixed(java.math.BigDecimal bigDecimal) { - // This string might contain sign and/or dot - this.write_fixed(bigDecimal.toString(), bigDecimal.signum()); - } - - // The string may contain a sign and dot - private void write_fixed(String string, int signum) { - - int stringLength = string.length(); - - // Each octet contains (up to) two decimal digits. - byte doubleDigit = 0; - char ch; - byte digit; - - // First calculate the string length without optional sign and dot. - int numDigits = 0; - for (int i=0; i= 1.2 only. - public void setHeaderPadding(boolean headerPadding) { - // no-op. We don't care about body alignment while using - // Java serialization. What the GIOP spec states does not apply here. - } - - // ValueOutputStream ----------------------------- - - public void start_value(String rep_id) { - throw wrapper.giopVersionError(); - } - - public void end_value() { - throw wrapper.giopVersionError(); - } - - // java.io.OutputStream - - // Note: These methods are defined in the super class and accessible. - - //public abstract void write(byte b[]) throws IOException; - //public abstract void write(byte b[], int off, int len) - // throws IOException; - //public abstract void flush() throws IOException; - //public abstract void close() throws IOException; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/MarkAndResetHandler.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/MarkAndResetHandler.java deleted file mode 100644 index 7774ab68baa..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/MarkAndResetHandler.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.encoding; - - -/** - * Defines an abstraction for a RestorableInputStream to - * implement mark/reset. - */ -interface MarkAndResetHandler -{ - void mark(RestorableInputStream inputStream); - - void fragmentationOccured(ByteBufferWithInfo newFragment); - - void reset(); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/MarshalInputStream.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/MarshalInputStream.java deleted file mode 100644 index 73e47af93a1..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/MarshalInputStream.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.encoding; - -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.Principal; -import org.omg.CORBA.Any; - -public interface MarshalInputStream { - public boolean read_boolean(); - public char read_char(); - public char read_wchar(); - public byte read_octet(); - public short read_short(); - public short read_ushort(); - public int read_long(); - public int read_ulong(); - public long read_longlong(); - public long read_ulonglong(); - public float read_float(); - public double read_double(); - public String read_string(); - public String read_wstring(); - - public void read_boolean_array(boolean[] value, int offset, int length); - public void read_char_array(char[] value, int offset, int length); - public void read_wchar_array(char[] value, int offset, int length); - public void read_octet_array(byte[] value, int offset, int length); - public void read_short_array(short[] value, int offset, int length); - public void read_ushort_array(short[] value, int offset, int length); - public void read_long_array(int[] value, int offset, int length); - public void read_ulong_array(int[] value, int offset, int length); - public void read_longlong_array(long[] value, int offset, int length); - public void read_ulonglong_array(long[] value, int offset, int length); - public void read_float_array(float[] value, int offset, int length); - public void read_double_array(double[] value, int offset, int length); - - public org.omg.CORBA.Object read_Object(); - public TypeCode read_TypeCode(); - public Any read_any(); - public Principal read_Principal(); - - /* - * The methods necessary to support RMI - */ - public org.omg.CORBA.Object read_Object(Class stubClass); - public java.io.Serializable read_value() throws Exception; - - /* - * Additional Methods - */ - public void consumeEndian(); - - // Determines the current byte stream position - // (also handles fragmented streams) - public int getPosition(); - - // mark/reset from java.io.InputStream - public void mark(int readAheadLimit); - public void reset(); - - /** - * This must be called once before unmarshaling valuetypes or anything - * that uses repository IDs. The ORB's version should be set - * to the desired value prior to calling. - */ - public void performORBVersionSpecificInit(); - - /** - * Tells the input stream to null any code set converter - * references, forcing it to reacquire them if it needs - * converters again. This is used when the server - * input stream needs to switch the connection's char code set - * converter to something different after reading the - * code set service context for the first time. Initially, - * we use ISO8859-1 to read the operation name (it can't - * be more than ASCII). - */ - public void resetCodeSetConverters(); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/MarshalOutputStream.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/MarshalOutputStream.java deleted file mode 100644 index 531f89d866c..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/MarshalOutputStream.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.encoding; - -import java.io.IOException; - -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.Principal; -import org.omg.CORBA.Any; - -import org.omg.CORBA.portable.InputStream; - -public interface MarshalOutputStream { - - public InputStream create_input_stream(); - - public void write_boolean(boolean value); - public void write_char(char value); - public void write_wchar(char value); - public void write_octet(byte value); - public void write_short(short value); - public void write_ushort(short value); - public void write_long(int value); - public void write_ulong(int value); - public void write_longlong(long value); - public void write_ulonglong(long value); - public void write_float(float value); - public void write_double(double value); - public void write_string(String value); - public void write_wstring(String value); - - public void write_boolean_array(boolean[] value, int offset, int length); - public void write_char_array(char[] value, int offset, int length); - public void write_wchar_array(char[] value, int offset, int length); - public void write_octet_array(byte[] value, int offset, int length); - public void write_short_array(short[] value, int offset, int length); - public void write_ushort_array(short[] value, int offset, int length); - public void write_long_array(int[] value, int offset, int length); - public void write_ulong_array(int[] value, int offset, int length); - public void write_longlong_array(long[] value, int offset, int length); - public void write_ulonglong_array(long[] value, int offset, int length); - public void write_float_array(float[] value, int offset, int length); - public void write_double_array(double[] value, int offset, int length); - - public void write_Object(org.omg.CORBA.Object value); - public void write_TypeCode(TypeCode value); - public void write_any(Any value); - public void write_Principal(Principal value); - - - /* - * The methods necessary to support RMI - */ - public void write_value(java.io.Serializable value); - public void start_block(); - public void end_block(); - - /* - * Additional Methods - */ - - public void putEndian(); - public void writeTo(java.io.OutputStream s) - throws IOException; - - public byte[] toByteArray(); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/OSFCodeSetRegistry.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/OSFCodeSetRegistry.java deleted file mode 100644 index 69500829ab0..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/OSFCodeSetRegistry.java +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.encoding; - -/** - * - * Information from the OSF code set registry version 1.2g. - * - * Use the Entry corresponding to the desired code set. - * - * Consider rename to CodeSetRegistry since OSF is dead. - */ -public final class OSFCodeSetRegistry -{ - // Numbers from the OSF code set registry version 1.2g. - // - // Please see the individual Entry definitions for - // more details. - public static final int ISO_8859_1_VALUE = 0x00010001; - public static final int UTF_16_VALUE = 0x00010109; - public static final int UTF_8_VALUE = 0x05010001; - public static final int UCS_2_VALUE = 0x00010100; - public static final int ISO_646_VALUE = 0x00010020; - - private OSFCodeSetRegistry() {} - - /** - * An entry in the OSF registry which allows users - * to find out the equivalent Java character encoding - * name as well as some other facts from the registry. - */ - public final static class Entry - { - private String javaName; - private int encodingNum; - private boolean isFixedWidth; - private int maxBytesPerChar; - - private Entry(String javaName, - int encodingNum, - boolean isFixedWidth, - int maxBytesPerChar) { - this.javaName = javaName; - this.encodingNum = encodingNum; - this.isFixedWidth = isFixedWidth; - this.maxBytesPerChar = maxBytesPerChar; - } - - /** - * Returns the Java equivalent name. If the encoding has - * an optional byte order marker, this name will map to the - * Java encoding that includes the marker. - */ - public String getName() { - return javaName; - } - - /** - * Get the OSF registry number for this code set. - */ - public int getNumber() { - return encodingNum; - } - - /** - * Is this a fixed or variable width code set? (In CORBA - * terms, "non-byte-oriented" or a "byte-oriented" - * code set, respectively) - */ - public boolean isFixedWidth() { - return isFixedWidth; - } - - public int getMaxBytesPerChar() { - return maxBytesPerChar; - } - - /** - * First checks reference equality since it's expected - * people will use the pre-defined constant Entries. - */ - public boolean equals(Object obj) { - if (this == obj) - return true; - - if (!(obj instanceof OSFCodeSetRegistry.Entry)) - return false; - - OSFCodeSetRegistry.Entry other - = (OSFCodeSetRegistry.Entry)obj; - - return (javaName.equals(other.javaName) && - encodingNum == other.encodingNum && - isFixedWidth == other.isFixedWidth && - maxBytesPerChar == other.maxBytesPerChar); - } - - /** - * Uses the registry number as the hash code. - */ - public int hashCode() { - return encodingNum; - } - } - - /** - * 8-bit encoding required for GIOP 1.0, and used as the char set - * when nothing else is specified. - */ - public static final Entry ISO_8859_1 - = new Entry("ISO-8859-1", - ISO_8859_1_VALUE, - true, - 1); - - /** - * UTF-16 as specified in the OSF registry has an optional - * byte order marker. UTF-16BE and UTF-16LE are not in the OSF - * registry since it is no longer being developed. When the OMG - * switches to the IANA registry, these can be public. Right - * now, they're used internally by CodeSetConversion. - */ - static final Entry UTF_16BE - = new Entry("UTF-16BE", - -1, - true, - 2); - - static final Entry UTF_16LE - = new Entry("UTF-16LE", - -2, - true, - 2); - - /** - * Fallback wchar code set. - * - * In the resolution of issue 3405b, UTF-16 defaults to big endian, so - * doesn't have to have a byte order marker. Unfortunately, this has to be - * a special case for compatibility. - */ - public static final Entry UTF_16 - = new Entry("UTF-16", - UTF_16_VALUE, - true, - 4); - - /** - * Fallback char code set. Also the code set for char data - * in encapsulations. However, since CORBA says chars are - * only one octet, it is really the same as Latin-1. - */ - public static final Entry UTF_8 - = new Entry("UTF-8", - UTF_8_VALUE, - false, - 6); - - /* - * At least in JDK 1.3, UCS-2 isn't one of the mandatory Java character - * encodings. However, our old ORBs require what they call UCS2, even - * though they didn't necessarily do the correct encoding of it. - * - * This is a special case for our legacy ORBs, and put as the last thing - * in our conversion list for wchar data. - * - * If a foreign ORB actually tries to speak UCS2 with us, it probably - * won't work! Beware! - */ - public static final Entry UCS_2 - = new Entry("UCS-2", - UCS_2_VALUE, - true, - 2); - - /** - * This is the encoding older JavaSoft ORBs advertised as their - * CORBA char code set. Actually, they took the lower byte of - * the Java char. This is a 7-bit encoding, so they - * were really sending ISO8859-1. - */ - public static final Entry ISO_646 - = new Entry("US-ASCII", - ISO_646_VALUE, - true, - 1); - - /** - * Given an OSF registry value, return the corresponding Entry. - * Returns null if an Entry for that value is unavailable. - */ - public static Entry lookupEntry(int encodingValue) { - switch(encodingValue) { - case ISO_8859_1_VALUE: - return OSFCodeSetRegistry.ISO_8859_1; - case UTF_16_VALUE: - return OSFCodeSetRegistry.UTF_16; - case UTF_8_VALUE: - return OSFCodeSetRegistry.UTF_8; - case ISO_646_VALUE: - return OSFCodeSetRegistry.ISO_646; - case UCS_2_VALUE: - return OSFCodeSetRegistry.UCS_2; - default: - return null; - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/RestorableInputStream.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/RestorableInputStream.java deleted file mode 100644 index 8d1c9b6c4a7..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/RestorableInputStream.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.encoding; - -/** - * Defines the methods on an input stream which provide - * a way to get and restore its internal state without - * violating encapsulation. - */ -interface RestorableInputStream -{ - Object createStreamMemento(); - - void restoreInternalState(Object streamMemento); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/TypeCodeInputStream.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/TypeCodeInputStream.java deleted file mode 100644 index ae91457f161..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/TypeCodeInputStream.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.encoding; - -import java.util.HashMap; -import java.util.Map; -import java.util.Iterator; -import java.util.List; -import java.util.Collections; -import java.util.ArrayList; -import java.io.IOException; -import java.io.PrintStream; -import java.io.ByteArrayOutputStream; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.nio.ByteBuffer; - -import org.omg.CORBA.TypeCode ; -import org.omg.CORBA.StructMember ; -import org.omg.CORBA.UnionMember ; -import org.omg.CORBA.ValueMember ; -import org.omg.CORBA.TCKind ; -import org.omg.CORBA.Any ; -import org.omg.CORBA.Principal ; -import org.omg.CORBA.BAD_TYPECODE ; -import org.omg.CORBA.BAD_PARAM ; -import org.omg.CORBA.BAD_OPERATION ; -import org.omg.CORBA.INTERNAL ; -import org.omg.CORBA.MARSHAL ; - -import org.omg.CORBA.TypeCodePackage.BadKind ; - -import org.omg.CORBA_2_3.portable.InputStream; -import org.omg.CORBA_2_3.portable.OutputStream; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.impl.corba.TypeCodeImpl; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.impl.encoding.CodeSetConversion; -import com.sun.corba.se.impl.encoding.CDRInputStream; -import com.sun.corba.se.impl.encoding.CDROutputStream; -import com.sun.corba.se.impl.encoding.MarshalInputStream; - -import sun.corba.EncapsInputStreamFactory; - -public class TypeCodeInputStream extends EncapsInputStream implements TypeCodeReader -{ - private Map typeMap = null; - private InputStream enclosure = null; - private boolean isEncapsulation = false; - - public TypeCodeInputStream(org.omg.CORBA.ORB orb, byte[] data, int size) { - super(orb, data, size); - } - - public TypeCodeInputStream(org.omg.CORBA.ORB orb, - byte[] data, - int size, - boolean littleEndian, - GIOPVersion version) { - super(orb, data, size, littleEndian, version); - } - - public TypeCodeInputStream(org.omg.CORBA.ORB orb, - ByteBuffer byteBuffer, - int size, - boolean littleEndian, - GIOPVersion version) { - super(orb, byteBuffer, size, littleEndian, version); - } - - public void addTypeCodeAtPosition(TypeCodeImpl tc, int position) { - if (typeMap == null) { - //if (TypeCodeImpl.debug) System.out.println("Creating typeMap"); - typeMap = new HashMap(16); - } - //if (TypeCodeImpl.debug) System.out.println(this + " adding tc " + tc + " at position " + position); - typeMap.put(new Integer(position), tc); - } - - public TypeCodeImpl getTypeCodeAtPosition(int position) { - if (typeMap == null) - return null; - //if (TypeCodeImpl.debug) { - //System.out.println("Getting tc " + (TypeCode)typeMap.get(new Integer(position)) + - //" at position " + position); - //} - return (TypeCodeImpl)typeMap.get(new Integer(position)); - } - - public void setEnclosingInputStream(InputStream enclosure) { - this.enclosure = enclosure; - } - - public TypeCodeReader getTopLevelStream() { - if (enclosure == null) - return this; - if (enclosure instanceof TypeCodeReader) - return ((TypeCodeReader)enclosure).getTopLevelStream(); - return this; - } - - public int getTopLevelPosition() { - if (enclosure != null && enclosure instanceof TypeCodeReader) { - // The enclosed stream has to consider if the enclosing stream - // had to read the enclosed stream completely when creating it. - // This is why the size of the enclosed stream needs to be substracted. - int topPos = ((TypeCodeReader)enclosure).getTopLevelPosition(); - // Substract getBufferLength from the parents pos because it read this stream - // from its own when creating it - int pos = topPos - getBufferLength() + getPosition(); - //if (TypeCodeImpl.debug) { - //System.out.println("TypeCodeInputStream.getTopLevelPosition using getTopLevelPosition " + topPos + - //(isEncapsulation ? " - encaps length 4" : "") + - //" - getBufferLength() " + getBufferLength() + - //" + getPosition() " + getPosition() + " = " + pos); - //} - return pos; - } - //if (TypeCodeImpl.debug) { - //System.out.println("TypeCodeInputStream.getTopLevelPosition returning getPosition() = " + - //getPosition() + " because enclosure is " + enclosure); - //} - return getPosition(); - } - - public static TypeCodeInputStream readEncapsulation(InputStream is, org.omg.CORBA.ORB _orb) { - // _REVISIT_ Would be nice if we didn't have to copy the buffer! - TypeCodeInputStream encap; - - int encapLength = is.read_long(); - - // read off part of the buffer corresponding to the encapsulation - byte[] encapBuffer = new byte[encapLength]; - is.read_octet_array(encapBuffer, 0, encapBuffer.length); - - // create an encapsulation using the marshal buffer - if (is instanceof CDRInputStream) { - encap = EncapsInputStreamFactory.newTypeCodeInputStream((ORB) _orb, - encapBuffer, encapBuffer.length, - ((CDRInputStream) is).isLittleEndian(), - ((CDRInputStream) is).getGIOPVersion()); - } else { - encap = EncapsInputStreamFactory.newTypeCodeInputStream((ORB) _orb, - encapBuffer, encapBuffer.length); - } - encap.setEnclosingInputStream(is); - encap.makeEncapsulation(); - //if (TypeCodeImpl.debug) { - //System.out.println("Created TypeCodeInputStream " + encap + " with parent " + is); - //encap.printBuffer(); - //} - return encap; - } - - protected void makeEncapsulation() { - // first entry in an encapsulation is the endianess - consumeEndian(); - isEncapsulation = true; - } - - public void printTypeMap() { - System.out.println("typeMap = {"); - Iterator i = typeMap.keySet().iterator(); - while (i.hasNext()) { - Integer pos = (Integer)i.next(); - TypeCodeImpl tci = (TypeCodeImpl)typeMap.get(pos); - System.out.println(" key = " + pos.intValue() + ", value = " + tci.description()); - } - System.out.println("}"); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/TypeCodeOutputStream.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/TypeCodeOutputStream.java deleted file mode 100644 index 93f7c97c50d..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/TypeCodeOutputStream.java +++ /dev/null @@ -1,264 +0,0 @@ -/* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.encoding; - -import org.omg.CORBA.TypeCode ; -import org.omg.CORBA.StructMember ; -import org.omg.CORBA.UnionMember ; -import org.omg.CORBA.ValueMember ; -import org.omg.CORBA.TCKind ; -import org.omg.CORBA.Any ; -import org.omg.CORBA.Principal ; -import org.omg.CORBA.CompletionStatus ; - -import org.omg.CORBA.TypeCodePackage.BadKind ; - -import org.omg.CORBA_2_3.portable.InputStream; -import org.omg.CORBA_2_3.portable.OutputStream; - -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry; -import com.sun.corba.se.impl.encoding.MarshalInputStream; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.impl.encoding.CodeSetConversion; - -import com.sun.corba.se.impl.encoding.CDRInputStream; -import com.sun.corba.se.impl.encoding.CDROutputStream; - -import java.util.HashMap; -import java.util.Map; -import java.util.Iterator; -import java.util.List; -import java.util.Collections; -import java.util.ArrayList; -import java.io.IOException; -import java.io.PrintStream; -import java.io.ByteArrayOutputStream; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.nio.ByteBuffer; - -import sun.corba.EncapsInputStreamFactory; - -public final class TypeCodeOutputStream extends EncapsOutputStream -{ - private OutputStream enclosure = null; - private Map typeMap = null; - private boolean isEncapsulation = false; - - public TypeCodeOutputStream(ORB orb) { - super(orb, false); - } - - public TypeCodeOutputStream(ORB orb, boolean littleEndian) { - super(orb, littleEndian); - } - - public org.omg.CORBA.portable.InputStream create_input_stream() - { - TypeCodeInputStream tcis = EncapsInputStreamFactory - .newTypeCodeInputStream((ORB) orb(), getByteBuffer(), - getIndex(), isLittleEndian(), getGIOPVersion()); - //if (TypeCodeImpl.debug) { - //System.out.println("Created TypeCodeInputStream " + tcis + " with no parent"); - //tcis.printBuffer(); - //} - return tcis; - } - - public void setEnclosingOutputStream(OutputStream enclosure) { - this.enclosure = enclosure; - } - - /* - public boolean isEncapsulatedIn(TypeCodeOutputStream outerEnclosure) { - if (outerEnclosure == this) - return true; - if (enclosure == null) - return false; - if (enclosure instanceof TypeCodeOutputStream) - return ((TypeCodeOutputStream)enclosure).isEncapsulatedIn(outerEnclosure); - // Last chance! Recursion ends with first non TypeCodeOutputStream. - return (enclosure == outerEnclosure); - } - */ - - public TypeCodeOutputStream getTopLevelStream() { - if (enclosure == null) - return this; - if (enclosure instanceof TypeCodeOutputStream) - return ((TypeCodeOutputStream)enclosure).getTopLevelStream(); - return this; - } - - public int getTopLevelPosition() { - if (enclosure != null && enclosure instanceof TypeCodeOutputStream) { - int pos = ((TypeCodeOutputStream)enclosure).getTopLevelPosition() + getPosition(); - // Add four bytes for the encaps length, not another 4 for the byte order - // which is included in getPosition(). - if (isEncapsulation) pos += 4; - //if (TypeCodeImpl.debug) { - //System.out.println("TypeCodeOutputStream.getTopLevelPosition using getTopLevelPosition " + - //((TypeCodeOutputStream)enclosure).getTopLevelPosition() + - //" + getPosition() " + getPosition() + - //(isEncapsulation ? " + encaps length 4" : "") + - //" = " + pos); - //} - return pos; - } - //if (TypeCodeImpl.debug) { - //System.out.println("TypeCodeOutputStream.getTopLevelPosition returning getPosition() = " + - //getPosition() + ", enclosure is " + enclosure); - //} - return getPosition(); - } - - public void addIDAtPosition(String id, int position) { - if (typeMap == null) - typeMap = new HashMap(16); - //if (TypeCodeImpl.debug) System.out.println(this + " adding id " + id + " at position " + position); - typeMap.put(id, new Integer(position)); - } - - public int getPositionForID(String id) { - if (typeMap == null) - throw wrapper.refTypeIndirType( CompletionStatus.COMPLETED_NO ) ; - //if (TypeCodeImpl.debug) System.out.println("Getting position " + ((Integer)typeMap.get(id)).intValue() + - //" for id " + id); - return ((Integer)typeMap.get(id)).intValue(); - } - - public void writeRawBuffer(org.omg.CORBA.portable.OutputStream s, int firstLong) { - // Writes this streams buffer to the given OutputStream - // without byte order flag and length as is the case for encapsulations. - - // Make sure to align s to 4 byte boundaries. - // Unfortunately we can't do just this: - // s.alignAndReserve(4, 4); - // So we have to take the first four bytes given in firstLong and write them - // with a call to write_long which will trigger the alignment. - // Then write the rest of the byte array. - - //if (TypeCodeImpl.debug) { - //System.out.println(this + ".writeRawBuffer(" + s + ", " + firstLong + ")"); - //if (s instanceof CDROutputStream) { - //System.out.println("Parent position before writing kind = " + ((CDROutputStream)s).getIndex()); - //} - //} - s.write_long(firstLong); - //if (TypeCodeImpl.debug) { - //if (s instanceof CDROutputStream) { - //System.out.println("Parent position after writing kind = " + ((CDROutputStream)s).getIndex()); - //} - //} - ByteBuffer byteBuffer = getByteBuffer(); - if (byteBuffer.hasArray()) - { - s.write_octet_array(byteBuffer.array(), 4, getIndex() - 4); - } - else - { - // get bytes from DirectByteBuffer - // NOTE: Microbenchmarks are showing it is faster to do - // a loop of ByteBuffer.get(int) than it is to do - // a bulk ByteBuffer.get(byte[], offset, length) - byte[] buf = new byte[byteBuffer.limit()]; - for (int i = 0; i < buf.length; i++) - buf[i] = byteBuffer.get(i); - s.write_octet_array(buf, 4, getIndex() - 4); - } - //if (TypeCodeImpl.debug) { - //if (s instanceof CDROutputStream) { - //System.out.println("Parent position after writing all " + getIndex() + " bytes = " + ((CDROutputStream)s).getIndex()); - //} - //} - } - - public TypeCodeOutputStream createEncapsulation(org.omg.CORBA.ORB _orb) { - TypeCodeOutputStream encap = - sun.corba.OutputStreamFactory.newTypeCodeOutputStream((ORB)_orb, isLittleEndian()); - encap.setEnclosingOutputStream(this); - encap.makeEncapsulation(); - //if (TypeCodeImpl.debug) System.out.println("Created TypeCodeOutputStream " + encap + " with parent " + this); - return encap; - } - - protected void makeEncapsulation() { - // first entry in an encapsulation is the endianess - putEndian(); - isEncapsulation = true; - } - - public static TypeCodeOutputStream wrapOutputStream(OutputStream os) { - boolean littleEndian = ((os instanceof CDROutputStream) ? ((CDROutputStream)os).isLittleEndian() : false); - TypeCodeOutputStream tos = - sun.corba.OutputStreamFactory.newTypeCodeOutputStream((ORB)os.orb(), littleEndian); - tos.setEnclosingOutputStream(os); - //if (TypeCodeImpl.debug) System.out.println("Created TypeCodeOutputStream " + tos + " with parent " + os); - return tos; - } - - public int getPosition() { - return getIndex(); - } - - public int getRealIndex(int index) { - int topPos = getTopLevelPosition(); - //if (TypeCodeImpl.debug) System.out.println("TypeCodeOutputStream.getRealIndex using getTopLevelPosition " + - //topPos + " instead of getPosition " + getPosition()); - return topPos; - } -/* - protected void printBuffer() { - super.printBuffer(); - } -*/ - public byte[] getTypeCodeBuffer() { - // Returns the buffer trimmed of the trailing zeros and without the - // known _kind value at the beginning. - ByteBuffer theBuffer = getByteBuffer(); - //System.out.println("outBuffer length = " + (getIndex() - 4)); - byte[] tcBuffer = new byte[getIndex() - 4]; - // Micro-benchmarks show that DirectByteBuffer.get(int) is faster - // than DirectByteBuffer.get(byte[], offset, length). - // REVISIT - May want to check if buffer is direct or non-direct - // and use array copy if ByteBuffer is non-direct. - for (int i = 0; i < tcBuffer.length; i++) - tcBuffer[i] = theBuffer.get(i+4); - return tcBuffer; - } - - public void printTypeMap() { - System.out.println("typeMap = {"); - Iterator i = typeMap.keySet().iterator(); - while (i.hasNext()) { - String id = (String)i.next(); - Integer pos = (Integer)typeMap.get(id); - System.out.println(" key = " + id + ", value = " + pos); - } - System.out.println("}"); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/TypeCodeReader.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/TypeCodeReader.java deleted file mode 100644 index 8f55fc2ed71..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/TypeCodeReader.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.encoding; - -import java.util.HashMap; -import java.util.Map; -import java.util.Iterator; -import java.util.List; -import java.util.Collections; -import java.util.ArrayList; -import java.io.IOException; -import java.io.PrintStream; -import java.io.ByteArrayOutputStream; -import java.math.BigDecimal; -import java.math.BigInteger; - -import org.omg.CORBA.TypeCode ; -import org.omg.CORBA.StructMember ; -import org.omg.CORBA.UnionMember ; -import org.omg.CORBA.ValueMember ; -import org.omg.CORBA.TCKind ; -import org.omg.CORBA.Any ; -import org.omg.CORBA.Principal ; -import org.omg.CORBA.BAD_TYPECODE ; -import org.omg.CORBA.BAD_PARAM ; -import org.omg.CORBA.BAD_OPERATION ; -import org.omg.CORBA.INTERNAL ; -import org.omg.CORBA.MARSHAL ; - -import org.omg.CORBA.TypeCodePackage.BadKind ; - -import org.omg.CORBA_2_3.portable.InputStream; -import org.omg.CORBA_2_3.portable.OutputStream; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.impl.corba.TypeCodeImpl; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry; -import com.sun.corba.se.impl.encoding.MarshalInputStream; -import com.sun.corba.se.impl.encoding.CodeSetConversion; -import com.sun.corba.se.impl.encoding.CDRInputStream; -import com.sun.corba.se.impl.encoding.CDROutputStream; - -public interface TypeCodeReader extends MarshalInputStream { - public void addTypeCodeAtPosition(TypeCodeImpl tc, int position); - public TypeCodeImpl getTypeCodeAtPosition(int position); - public void setEnclosingInputStream(InputStream enclosure); - public TypeCodeReader getTopLevelStream(); - public int getTopLevelPosition(); - // for debugging - //public void printBuffer(); - public int getPosition(); - public void printTypeMap(); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/WrapperInputStream.java b/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/WrapperInputStream.java deleted file mode 100644 index aad4380e402..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/WrapperInputStream.java +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.encoding; - -import java.util.HashMap; -import java.util.Map; -import java.util.Iterator; -import java.util.List; -import java.util.Collections; -import java.util.ArrayList; -import java.io.IOException; -import java.io.PrintStream; -import java.io.ByteArrayOutputStream; -import java.math.BigDecimal; -import java.math.BigInteger; - -import org.omg.CORBA.TypeCode ; -import org.omg.CORBA.StructMember ; -import org.omg.CORBA.UnionMember ; -import org.omg.CORBA.ValueMember ; -import org.omg.CORBA.TCKind ; -import org.omg.CORBA.Any ; -import org.omg.CORBA.Principal ; -import org.omg.CORBA.BAD_TYPECODE ; -import org.omg.CORBA.BAD_PARAM ; -import org.omg.CORBA.BAD_OPERATION ; -import org.omg.CORBA.INTERNAL ; -import org.omg.CORBA.MARSHAL ; - -import org.omg.CORBA.TypeCodePackage.BadKind ; - -import org.omg.CORBA_2_3.portable.InputStream; -import org.omg.CORBA_2_3.portable.OutputStream; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.impl.corba.TypeCodeImpl; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry; -import com.sun.corba.se.impl.encoding.MarshalInputStream; -import com.sun.corba.se.impl.encoding.CodeSetConversion; -import com.sun.corba.se.impl.encoding.CDRInputStream; -import com.sun.corba.se.impl.encoding.CDROutputStream; - -public class WrapperInputStream extends org.omg.CORBA_2_3.portable.InputStream implements TypeCodeReader -{ - private CDRInputStream stream; - private Map typeMap = null; - private int startPos = 0; - - public WrapperInputStream(CDRInputStream s) { - super(); - stream = s; - startPos = stream.getPosition(); - } - - public int read() throws IOException { return stream.read(); } - public int read(byte b[]) throws IOException { return stream.read(b); } - public int read(byte b[], int off, int len) throws IOException { - return stream.read(b, off, len); - } - public long skip(long n) throws IOException { return stream.skip(n); } - public int available() throws IOException { return stream.available(); } - public void close() throws IOException { stream.close(); } - public void mark(int readlimit) { stream.mark(readlimit); } - public void reset() { stream.reset(); } - public boolean markSupported() { return stream.markSupported(); } - public int getPosition() { return stream.getPosition(); } - public void consumeEndian() { stream.consumeEndian(); } - public boolean read_boolean() { return stream.read_boolean(); } - public char read_char() { return stream.read_char(); } - public char read_wchar() { return stream.read_wchar(); } - public byte read_octet() { return stream.read_octet(); } - public short read_short() { return stream.read_short(); } - public short read_ushort() { return stream.read_ushort(); } - public int read_long() { return stream.read_long(); } - public int read_ulong() { return stream.read_ulong(); } - public long read_longlong() { return stream.read_longlong(); } - public long read_ulonglong() { return stream.read_ulonglong(); } - public float read_float() { return stream.read_float(); } - public double read_double() { return stream.read_double(); } - public String read_string() { return stream.read_string(); } - public String read_wstring() { return stream.read_wstring(); } - - public void read_boolean_array(boolean[] value, int offset, int length) { - stream.read_boolean_array(value, offset, length); - } - public void read_char_array(char[] value, int offset, int length) { - stream.read_char_array(value, offset, length); - } - public void read_wchar_array(char[] value, int offset, int length) { - stream.read_wchar_array(value, offset, length); - } - public void read_octet_array(byte[] value, int offset, int length) { - stream.read_octet_array(value, offset, length); - } - public void read_short_array(short[] value, int offset, int length) { - stream.read_short_array(value, offset, length); - } - public void read_ushort_array(short[] value, int offset, int length) { - stream.read_ushort_array(value, offset, length); - } - public void read_long_array(int[] value, int offset, int length) { - stream.read_long_array(value, offset, length); - } - public void read_ulong_array(int[] value, int offset, int length) { - stream.read_ulong_array(value, offset, length); - } - public void read_longlong_array(long[] value, int offset, int length) { - stream.read_longlong_array(value, offset, length); - } - public void read_ulonglong_array(long[] value, int offset, int length) { - stream.read_ulonglong_array(value, offset, length); - } - public void read_float_array(float[] value, int offset, int length) { - stream.read_float_array(value, offset, length); - } - public void read_double_array(double[] value, int offset, int length) { - stream.read_double_array(value, offset, length); - } - - public org.omg.CORBA.Object read_Object() { return stream.read_Object(); } - public java.io.Serializable read_value() {return stream.read_value();} - public TypeCode read_TypeCode() { return stream.read_TypeCode(); } - public Any read_any() { return stream.read_any(); } - public Principal read_Principal() { return stream.read_Principal(); } - public java.math.BigDecimal read_fixed() { return stream.read_fixed(); } - public org.omg.CORBA.Context read_Context() { return stream.read_Context(); } - - public org.omg.CORBA.ORB orb() { return stream.orb(); } - - public void addTypeCodeAtPosition(TypeCodeImpl tc, int position) { - if (typeMap == null) { - //if (TypeCodeImpl.debug) System.out.println("Creating typeMap"); - typeMap = new HashMap(16); - } - //if (TypeCodeImpl.debug) System.out.println(this + " adding tc " + tc + " at position " + position); - typeMap.put(new Integer(position), tc); - } - - public TypeCodeImpl getTypeCodeAtPosition(int position) { - if (typeMap == null) - return null; - //if (TypeCodeImpl.debug) System.out.println("Getting tc " + (TypeCodeImpl)typeMap.get(new Integer(position)) + - //" at position " + position); - return (TypeCodeImpl)typeMap.get(new Integer(position)); - } - - public void setEnclosingInputStream(InputStream enclosure) { - // WrapperInputStream has no enclosure - } - - public TypeCodeReader getTopLevelStream() { - // WrapperInputStream has no enclosure - return this; - } - - public int getTopLevelPosition() { - //if (TypeCodeImpl.debug) System.out.println("WrapperInputStream.getTopLevelPosition " + - //"returning getPosition " + getPosition() + " - startPos " + startPos + - //" = " + (getPosition() - startPos)); - return getPosition() - startPos; - } - - public void performORBVersionSpecificInit() { - // This is never actually called on a WrapperInputStream, but - // exists to satisfy the interface requirement. - stream.performORBVersionSpecificInit(); - } - - public void resetCodeSetConverters() { - stream.resetCodeSetConverters(); - } - - //public void printBuffer() { stream.printBuffer(); } - - public void printTypeMap() { - System.out.println("typeMap = {"); - List sortedKeys = new ArrayList(typeMap.keySet()); - Collections.sort(sortedKeys); - Iterator i = sortedKeys.iterator(); - while (i.hasNext()) { - Integer pos = (Integer)i.next(); - TypeCodeImpl tci = (TypeCodeImpl)typeMap.get(pos); - System.out.println(" key = " + pos.intValue() + ", value = " + tci.description()); - } - System.out.println("}"); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/CDREncapsCodec.java b/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/CDREncapsCodec.java deleted file mode 100644 index 235b8956de1..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/CDREncapsCodec.java +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.interceptors; - -import org.omg.CORBA.Any; -import org.omg.CORBA.ORB; -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.LocalObject; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.logging.CORBALogDomains; - -import sun.corba.EncapsInputStreamFactory; - -import com.sun.corba.se.impl.corba.AnyImpl; -import com.sun.corba.se.impl.encoding.EncapsInputStream; -import com.sun.corba.se.impl.encoding.EncapsOutputStream; -import com.sun.corba.se.impl.logging.ORBUtilSystemException; - -import org.omg.IOP.Codec; -import org.omg.IOP.CodecPackage.FormatMismatch; -import org.omg.IOP.CodecPackage.InvalidTypeForEncoding; -import org.omg.IOP.CodecPackage.TypeMismatch; - -/** - * CDREncapsCodec is an implementation of Codec, as described - * in orbos/99-12-02, that supports CDR encapsulation version 1.0, 1.1, and - * 1.2. - */ -public final class CDREncapsCodec - extends org.omg.CORBA.LocalObject - implements Codec -{ - // The ORB that created the factory this codec was created from - private ORB orb; - ORBUtilSystemException wrapper; - - // The GIOP version we are encoding for - private GIOPVersion giopVersion; - - /* - ******************************************************************* - * NOTE: CDREncapsCodec must remain immutable! This is so that we - * can pre-create CDREncapsCodecs for each version of GIOP in - * CodecFactoryImpl. - *******************************************************************/ - - /** - * Creates a new codec implementation. Uses the given ORB to create - * CDRInputStreams when necessary. - * - * @param orb The ORB to use to create a CDRInputStream or CDROutputStream - * @param major The major version of GIOP we are encoding for - * @param minor The minor version of GIOP we are encoding for - */ - public CDREncapsCodec( ORB orb, int major, int minor ) { - this.orb = orb; - wrapper = ORBUtilSystemException.get( - (com.sun.corba.se.spi.orb.ORB)orb, CORBALogDomains.RPC_PROTOCOL ) ; - - giopVersion = GIOPVersion.getInstance( (byte)major, (byte)minor ); - } - - /** - * Convert the given any into a CDR encapsulated octet sequence - */ - public byte[] encode( Any data ) - throws InvalidTypeForEncoding - { - if ( data == null ) - throw wrapper.nullParam() ; - return encodeImpl( data, true ); - } - - /** - * Decode the given octet sequence into an any based on a CDR - * encapsulated octet sequence. - */ - public Any decode ( byte[] data ) - throws FormatMismatch - { - if( data == null ) - throw wrapper.nullParam() ; - return decodeImpl( data, null ); - } - - /** - * Convert the given any into a CDR encapsulated octet sequence. Only - * the data is stored. The type code is not. - */ - public byte[] encode_value( Any data ) - throws InvalidTypeForEncoding - { - if( data == null ) - throw wrapper.nullParam() ; - return encodeImpl( data, false ); - } - - /** - * Decode the given octet sequence into an any based on a CDR - * encapsulated octet sequence. The type code is expected not to appear - * in the octet sequence, and the given type code is used instead. - */ - public Any decode_value( byte[] data, TypeCode tc ) - throws FormatMismatch, TypeMismatch - { - if( data == null ) - throw wrapper.nullParam() ; - if( tc == null ) - throw wrapper.nullParam() ; - return decodeImpl( data, tc ); - } - - /** - * Convert the given any into a CDR encapsulated octet sequence. - * If sendTypeCode is true, the type code is sent with the message, as in - * a standard encapsulation. If it is false, only the data is sent. - * Either way, the endian type is sent as the first part of the message. - */ - private byte[] encodeImpl( Any data, boolean sendTypeCode ) - throws InvalidTypeForEncoding - { - if( data == null ) - throw wrapper.nullParam() ; - - // _REVISIT_ Note that InvalidTypeForEncoding is never thrown in - // the body of this method. This is due to the fact that CDR*Stream - // will never throw an exception if the encoding is invalid. To - // fix this, the CDROutputStream must know the version of GIOP it - // is encoding for and it must check to ensure that, for example, - // wstring cannot be encoded in GIOP 1.0. - // - // As part of the GIOP 1.2 work, the CDRInput and OutputStream will - // be versioned. This can be handled once this work is complete. - - // Create output stream with default endianness. - EncapsOutputStream cdrOut = - sun.corba.OutputStreamFactory.newEncapsOutputStream( - (com.sun.corba.se.spi.orb.ORB)orb, giopVersion ); - - // This is an encapsulation, so put out the endian: - cdrOut.putEndian(); - - // Sometimes encode type code: - if( sendTypeCode ) { - cdrOut.write_TypeCode( data.type() ); - } - - // Encode value and return. - data.write_value( cdrOut ); - - return cdrOut.toByteArray(); - } - - /** - * Decode the given octet sequence into an any based on a CDR - * encapsulated octet sequence. If the type code is null, it is - * expected to appear in the octet sequence. Otherwise, the given - * type code is used. - */ - private Any decodeImpl( byte[] data, TypeCode tc ) - throws FormatMismatch - { - if( data == null ) - throw wrapper.nullParam() ; - - AnyImpl any = null; // return value - - // _REVISIT_ Currently there is no way for us to distinguish between - // a FormatMismatch and a TypeMismatch because we cannot get this - // information from the CDRInputStream. If a RuntimeException occurs, - // it is turned into a FormatMismatch exception. - - try { - EncapsInputStream cdrIn = EncapsInputStreamFactory.newEncapsInputStream( orb, data, - data.length, giopVersion ); - - - cdrIn.consumeEndian(); - - // If type code not specified, read it from octet stream: - if( tc == null ) { - tc = cdrIn.read_TypeCode(); - } - - // Create a new Any object: - any = new AnyImpl( (com.sun.corba.se.spi.orb.ORB)orb ); - any.read_value( cdrIn, tc ); - } - catch( RuntimeException e ) { - // See above note. - throw new FormatMismatch(); - } - - return any; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/ClientRequestInfoImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/ClientRequestInfoImpl.java deleted file mode 100644 index 94e3f957c31..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/ClientRequestInfoImpl.java +++ /dev/null @@ -1,978 +0,0 @@ -/* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.interceptors; - -import java.util.HashMap ; - -import org.omg.CORBA.Any; -import org.omg.CORBA.BAD_INV_ORDER; -import org.omg.CORBA.BAD_PARAM; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.Context; -import org.omg.CORBA.ContextList; -import org.omg.CORBA.CTX_RESTRICT_SCOPE; -import org.omg.CORBA.ExceptionList; -import org.omg.CORBA.LocalObject; -import org.omg.CORBA.NamedValue; -import org.omg.CORBA.NO_IMPLEMENT; -import org.omg.CORBA.NO_RESOURCES; -import org.omg.CORBA.NVList; -import org.omg.CORBA.Object; -import org.omg.CORBA.ParameterMode; -import org.omg.CORBA.Policy; -import org.omg.CORBA.SystemException; -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.UserException; -import org.omg.CORBA.portable.ApplicationException; -import org.omg.CORBA.portable.InputStream; -import com.sun.corba.se.spi.servicecontext.ServiceContexts; -import com.sun.corba.se.spi.servicecontext.UnknownServiceContext; - -import org.omg.IOP.ServiceContext; -import org.omg.IOP.ServiceContextHelper; -import org.omg.IOP.TaggedProfile; -import org.omg.IOP.TaggedProfileHelper; -import org.omg.IOP.TaggedComponent; -import org.omg.IOP.TaggedComponentHelper; -import org.omg.IOP.TAG_INTERNET_IOP; -import org.omg.Dynamic.Parameter; -import org.omg.PortableInterceptor.ClientRequestInfo; -import org.omg.PortableInterceptor.LOCATION_FORWARD; -import org.omg.PortableInterceptor.SUCCESSFUL; -import org.omg.PortableInterceptor.SYSTEM_EXCEPTION; -import org.omg.PortableInterceptor.TRANSPORT_RETRY; -import org.omg.PortableInterceptor.USER_EXCEPTION; - -import com.sun.corba.se.pept.protocol.MessageMediator; - -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; -import com.sun.corba.se.spi.protocol.RetryType; -import com.sun.corba.se.spi.transport.CorbaContactInfo; -import com.sun.corba.se.spi.transport.CorbaContactInfoList; -import com.sun.corba.se.spi.transport.CorbaContactInfoListIterator; - -import com.sun.corba.se.impl.encoding.CDROutputStream; -import com.sun.corba.se.impl.encoding.CDRInputStream_1_0; -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.protocol.CorbaInvocationInfo; -import com.sun.corba.se.impl.util.RepositoryId; - -/** - * Implementation of the ClientRequestInfo interface as specified in - * orbos/99-12-02 section 5.4.2. - */ -public final class ClientRequestInfoImpl - extends RequestInfoImpl - implements ClientRequestInfo -{ - - // The available constants for startingPointCall - static final int CALL_SEND_REQUEST = 0; - static final int CALL_SEND_POLL = 1; - - // The available constants for endingPointCall - static final int CALL_RECEIVE_REPLY = 0; - static final int CALL_RECEIVE_EXCEPTION = 1; - static final int CALL_RECEIVE_OTHER = 2; - - ////////////////////////////////////////////////////////////////////// - // - // NOTE: IF AN ATTRIBUTE IS ADDED, PLEASE UPDATE RESET(); - // - ////////////////////////////////////////////////////////////////////// - - // The current retry request status. True if this request is being - // retried and this info object is to be reused, or false otherwise. - private RetryType retryRequest; - - // The number of times this info object has been (re)used. This is - // incremented every time a request is retried, and decremented every - // time a request is complete. When this reaches zero, the info object - // is popped from the ClientRequestInfoImpl ThreadLocal stack in the ORB. - private int entryCount = 0; - - // The RequestImpl is set when the call is DII based. - // The DII query calls like ParameterList, ExceptionList, - // ContextList will be delegated to RequestImpl. - private org.omg.CORBA.Request request; - - // Sources of client request information - private boolean diiInitiate; - private CorbaMessageMediator messageMediator; - - // Cached information: - private org.omg.CORBA.Object cachedTargetObject; - private org.omg.CORBA.Object cachedEffectiveTargetObject; - private Parameter[] cachedArguments; - private TypeCode[] cachedExceptions; - private String[] cachedContexts; - private String[] cachedOperationContext; - private String cachedReceivedExceptionId; - private Any cachedResult; - private Any cachedReceivedException; - private TaggedProfile cachedEffectiveProfile; - // key = Integer, value = IOP.ServiceContext. - private HashMap cachedRequestServiceContexts; - // key = Integer, value = IOP.ServiceContext. - private HashMap cachedReplyServiceContexts; - // key = Integer, value = TaggedComponent - private HashMap cachedEffectiveComponents; - - - protected boolean piCurrentPushed; - - ////////////////////////////////////////////////////////////////////// - // - // NOTE: IF AN ATTRIBUTE IS ADDED, PLEASE UPDATE RESET(); - // - ////////////////////////////////////////////////////////////////////// - - /** - * Reset the info object so that it can be reused for a retry, - * for example. - */ - void reset() { - super.reset(); - - // Please keep these in the same order that they're declared above. - - // 6763340 - retryRequest = RetryType.NONE; - - // Do not reset entryCount because we need to know when to pop this - // from the stack. - - request = null; - diiInitiate = false; - messageMediator = null; - - // Clear cached attributes: - cachedTargetObject = null; - cachedEffectiveTargetObject = null; - cachedArguments = null; - cachedExceptions = null; - cachedContexts = null; - cachedOperationContext = null; - cachedReceivedExceptionId = null; - cachedResult = null; - cachedReceivedException = null; - cachedEffectiveProfile = null; - cachedRequestServiceContexts = null; - cachedReplyServiceContexts = null; - cachedEffectiveComponents = null; - - piCurrentPushed = false; - - startingPointCall = CALL_SEND_REQUEST; - endingPointCall = CALL_RECEIVE_REPLY; - - } - - /* - ********************************************************************** - * Access protection - **********************************************************************/ - - // Method IDs for all methods in ClientRequestInfo. This allows for a - // convenient O(1) lookup for checkAccess(). - protected static final int MID_TARGET = MID_RI_LAST + 1; - protected static final int MID_EFFECTIVE_TARGET = MID_RI_LAST + 2; - protected static final int MID_EFFECTIVE_PROFILE = MID_RI_LAST + 3; - protected static final int MID_RECEIVED_EXCEPTION = MID_RI_LAST + 4; - protected static final int MID_RECEIVED_EXCEPTION_ID = MID_RI_LAST + 5; - protected static final int MID_GET_EFFECTIVE_COMPONENT = MID_RI_LAST + 6; - protected static final int MID_GET_EFFECTIVE_COMPONENTS - = MID_RI_LAST + 7; - protected static final int MID_GET_REQUEST_POLICY = MID_RI_LAST + 8; - protected static final int MID_ADD_REQUEST_SERVICE_CONTEXT - = MID_RI_LAST + 9; - - // ClientRequestInfo validity table (see ptc/00-08-06 table 21-1). - // Note: These must be in the same order as specified in contants. - private static final boolean validCall[][] = { - // LEGEND: - // s_req = send_request r_rep = receive_reply - // s_pol = send_poll r_exc = receive_exception - // r_oth = receive_other - // - // A true value indicates call is valid at specified point. - // A false value indicates the call is invalid. - // - // - // NOTE: If the order or number of columns change, update - // checkAccess() accordingly. - // - // { s_req, s_pol, r_rep, r_exc, r_oth } - // RequestInfo methods: - /*request_id*/ { true , true , true , true , true }, - /*operation*/ { true , true , true , true , true }, - /*arguments*/ { true , false, true , false, false }, - /*exceptions*/ { true , false, true , true , true }, - /*contexts*/ { true , false, true , true , true }, - /*operation_context*/ { true , false, true , true , true }, - /*result*/ { false, false, true , false, false }, - /*response_expected*/ { true , true , true , true , true }, - /*sync_scope*/ { true , false, true , true , true }, - /*reply_status*/ { false, false, true , true , true }, - /*forward_reference*/ { false, false, false, false, true }, - /*get_slot*/ { true , true , true , true , true }, - /*get_request_service_context*/ { true , false, true , true , true }, - /*get_reply_service_context*/ { false, false, true , true , true }, - // - // ClientRequestInfo methods:: - /*target*/ { true , true , true , true , true }, - /*effective_target*/ { true , true , true , true , true }, - /*effective_profile*/ { true , true , true , true , true }, - /*received_exception*/ { false, false, false, true , false }, - /*received_exception_id*/ { false, false, false, true , false }, - /*get_effective_component*/ { true , false, true , true , true }, - /*get_effective_components*/ { true , false, true , true , true }, - /*get_request_policy*/ { true , false, true , true , true }, - /*add_request_service_context*/ { true , false, false, false, false } - }; - - - /* - ********************************************************************** - * Public ClientRequestInfo interfaces - **********************************************************************/ - - /** - * Creates a new ClientRequestInfo implementation. - * The constructor is package scope since no other package need create - * an instance of this class. - */ - protected ClientRequestInfoImpl( ORB myORB ) { - super( myORB ); - startingPointCall = CALL_SEND_REQUEST; - endingPointCall = CALL_RECEIVE_REPLY; - } - - /** - * The object which the client called to perform the operation. - */ - public org.omg.CORBA.Object target (){ - // access is currently valid for all states: - //checkAccess( MID_TARGET ); - if (cachedTargetObject == null) { - CorbaContactInfo corbaContactInfo = (CorbaContactInfo) - messageMediator.getContactInfo(); - cachedTargetObject = - iorToObject(corbaContactInfo.getTargetIOR()); - } - return cachedTargetObject; - } - - /** - * The actual object on which the operation will be invoked. If the - * reply_status is LOCATION_FORWARD, then on subsequent requests, - * effective_target will contain the forwarded IOR while target will - * remain unchanged. - */ - public org.omg.CORBA.Object effective_target() { - // access is currently valid for all states: - //checkAccess( MID_EFFECTIVE_TARGET ); - - // Note: This is not necessarily the same as locatedIOR. - // Reason: See the way we handle COMM_FAILURES in - // ClientRequestDispatcher.createRequest, v1.32 - - if (cachedEffectiveTargetObject == null) { - CorbaContactInfo corbaContactInfo = (CorbaContactInfo) - messageMediator.getContactInfo(); - // REVISIT - get through chain like getLocatedIOR helper below. - cachedEffectiveTargetObject = - iorToObject(corbaContactInfo.getEffectiveTargetIOR()); - } - return cachedEffectiveTargetObject; - } - - /** - * The profile that will be used to send the request. If a location - * forward has occurred for this operation's object and that object's - * profile change accordingly, then this profile will be that located - * profile. - */ - public TaggedProfile effective_profile (){ - // access is currently valid for all states: - //checkAccess( MID_EFFECTIVE_PROFILE ); - - if( cachedEffectiveProfile == null ) { - CorbaContactInfo corbaContactInfo = (CorbaContactInfo) - messageMediator.getContactInfo(); - cachedEffectiveProfile = - corbaContactInfo.getEffectiveProfile().getIOPProfile(); - } - - // Good citizen: In the interest of efficiency, we assume interceptors - // will not modify the returned TaggedProfile in any way so we need - // not make a deep copy of it. - - return cachedEffectiveProfile; - } - - /** - * Contains the exception to be returned to the client. - */ - public Any received_exception (){ - checkAccess( MID_RECEIVED_EXCEPTION ); - - if( cachedReceivedException == null ) { - cachedReceivedException = exceptionToAny( exception ); - } - - // Good citizen: In the interest of efficiency, we assume interceptors - // will not modify the returned Any in any way so we need - // not make a deep copy of it. - - return cachedReceivedException; - } - - /** - * The CORBA::RepositoryId of the exception to be returned to the client. - */ - public String received_exception_id (){ - checkAccess( MID_RECEIVED_EXCEPTION_ID ); - - if( cachedReceivedExceptionId == null ) { - String result = null; - - if( exception == null ) { - // Note: exception should never be null here since we will - // throw a BAD_INV_ORDER if this is not called from - // receive_exception. - throw wrapper.exceptionWasNull() ; - } else if( exception instanceof SystemException ) { - String name = exception.getClass().getName(); - result = ORBUtility.repositoryIdOf(name); - } else if( exception instanceof ApplicationException ) { - result = ((ApplicationException)exception).getId(); - } - - // _REVISIT_ We need to be able to handle a UserException in the - // DII case. How do we extract the ID from a UserException? - - cachedReceivedExceptionId = result; - } - - return cachedReceivedExceptionId; - } - - /** - * Returns the IOP::TaggedComponent with the given ID from the profile - * selected for this request. IF there is more than one component for a - * given component ID, it is undefined which component this operation - * returns (get_effective_component should be called instead). - */ - public TaggedComponent get_effective_component (int id){ - checkAccess( MID_GET_EFFECTIVE_COMPONENT ); - - return get_effective_components( id )[0]; - } - - /** - * Returns all the tagged components with the given ID from the profile - * selected for this request. - */ - public TaggedComponent[] get_effective_components (int id){ - checkAccess( MID_GET_EFFECTIVE_COMPONENTS ); - Integer integerId = new Integer( id ); - TaggedComponent[] result = null; - boolean justCreatedCache = false; - - if( cachedEffectiveComponents == null ) { - cachedEffectiveComponents = new HashMap(); - justCreatedCache = true; - } - else { - // Look in cache: - result = (TaggedComponent[])cachedEffectiveComponents.get( - integerId ); - } - - // null could mean we cached null or not in cache. - if( (result == null) && - (justCreatedCache || - !cachedEffectiveComponents.containsKey( integerId ) ) ) - { - // Not in cache. Get it from the profile: - CorbaContactInfo corbaContactInfo = (CorbaContactInfo) - messageMediator.getContactInfo(); - IIOPProfileTemplate ptemp = - (IIOPProfileTemplate)corbaContactInfo.getEffectiveProfile(). - getTaggedProfileTemplate(); - result = ptemp.getIOPComponents(myORB, id); - cachedEffectiveComponents.put( integerId, result ); - } - - // As per ptc/00-08-06, section 21.3.13.6., If not found, raise - // BAD_PARAM with minor code INVALID_COMPONENT_ID. - if( (result == null) || (result.length == 0) ) { - throw stdWrapper.invalidComponentId( integerId ) ; - } - - // Good citizen: In the interest of efficiency, we will assume - // interceptors will not modify the returned TaggedCompoent[], or - // the TaggedComponents inside of it. Otherwise, we would need to - // clone the array and make a deep copy of its contents. - - return result; - } - - /** - * Returns the given policy in effect for this operation. - */ - public Policy get_request_policy (int type){ - checkAccess( MID_GET_REQUEST_POLICY ); - // _REVISIT_ Our ORB is not policy-based at this time. - throw wrapper.piOrbNotPolicyBased() ; - } - - /** - * Allows interceptors to add service contexts to the request. - *

            - * There is no declaration of the order of the service contexts. They - * may or may not appear in the order they are added. - */ - public void add_request_service_context (ServiceContext service_context, - boolean replace) - { - checkAccess( MID_ADD_REQUEST_SERVICE_CONTEXT ); - - if( cachedRequestServiceContexts == null ) { - cachedRequestServiceContexts = new HashMap(); - } - - addServiceContext( cachedRequestServiceContexts, - messageMediator.getRequestServiceContexts(), - service_context, replace ); - } - - // NOTE: When adding a method, be sure to: - // 1. Add a MID_* constant for that method - // 2. Call checkAccess at the start of the method - // 3. Define entries in the validCall[][] table for interception points. - - /* - ********************************************************************** - * Public RequestInfo interfaces - * - * These are implemented here because they have differing - * implementations depending on whether this is a client or a server - * request info object. - **********************************************************************/ - - /** - * See RequestInfoImpl for javadoc. - */ - public int request_id (){ - // access is currently valid for all states: - //checkAccess( MID_REQUEST_ID ); - /* - * NOTE: The requestId in client interceptors is the same as the - * GIOP request id. This works because both interceptors and - * request ids are scoped by the ORB on the client side. - */ - return messageMediator.getRequestId(); - } - - /** - * See RequestInfoImpl for javadoc. - */ - public String operation (){ - // access is currently valid for all states: - //checkAccess( MID_OPERATION ); - return messageMediator.getOperationName(); - } - - /** - * See RequestInfoImpl for javadoc. - */ - public Parameter[] arguments (){ - checkAccess( MID_ARGUMENTS ); - - if( cachedArguments == null ) { - if( request == null ) { - throw stdWrapper.piOperationNotSupported1() ; - } - - // If it is DII request then get the arguments from the DII req - // and convert that into parameters. - cachedArguments = nvListToParameterArray( request.arguments() ); - } - - // Good citizen: In the interest of efficiency, we assume - // interceptors will be "good citizens" in that they will not - // modify the contents of the Parameter[] array. We also assume - // they will not change the values of the containing Anys. - - return cachedArguments; - } - - /** - * See RequestInfoImpl for javadoc. - */ - public TypeCode[] exceptions (){ - checkAccess( MID_EXCEPTIONS ); - - if( cachedExceptions == null ) { - if( request == null ) { - throw stdWrapper.piOperationNotSupported2() ; - } - - // Get the list of exceptions from DII request data, If there are - // no exceptions raised then this method will return null. - ExceptionList excList = request.exceptions( ); - int count = excList.count(); - TypeCode[] excTCList = new TypeCode[count]; - try { - for( int i = 0; i < count; i++ ) { - excTCList[i] = excList.item( i ); - } - } catch( Exception e ) { - throw wrapper.exceptionInExceptions( e ) ; - } - - cachedExceptions = excTCList; - } - - // Good citizen: In the interest of efficiency, we assume - // interceptors will be "good citizens" in that they will not - // modify the contents of the TypeCode[] array. We also assume - // they will not change the values of the containing TypeCodes. - - return cachedExceptions; - } - - /** - * See RequestInfoImpl for javadoc. - */ - public String[] contexts (){ - checkAccess( MID_CONTEXTS ); - - if( cachedContexts == null ) { - if( request == null ) { - throw stdWrapper.piOperationNotSupported3() ; - } - - // Get the list of contexts from DII request data, If there are - // no contexts then this method will return null. - ContextList ctxList = request.contexts( ); - int count = ctxList.count(); - String[] ctxListToReturn = new String[count]; - try { - for( int i = 0; i < count; i++ ) { - ctxListToReturn[i] = ctxList.item( i ); - } - } catch( Exception e ) { - throw wrapper.exceptionInContexts( e ) ; - } - - cachedContexts = ctxListToReturn; - } - - // Good citizen: In the interest of efficiency, we assume - // interceptors will be "good citizens" in that they will not - // modify the contents of the String[] array. - - return cachedContexts; - } - - /** - * See RequestInfoImpl for javadoc. - */ - public String[] operation_context (){ - checkAccess( MID_OPERATION_CONTEXT ); - - if( cachedOperationContext == null ) { - if( request == null ) { - throw stdWrapper.piOperationNotSupported4() ; - } - - // Get the list of contexts from DII request data, If there are - // no contexts then this method will return null. - Context ctx = request.ctx( ); - // _REVISIT_ The API for get_values is not compliant with the spec, - // Revisit this code once it's fixed. - // _REVISIT_ Our ORB doesn't support Operation Context, This code - // will not be excerscised until it's supported. - // The first parameter in get_values is the start_scope which - // if blank makes it as a global scope. - // The second parameter is op_flags which is set to RESTRICT_SCOPE - // As there is only one defined in the spec. - // The Third param is the pattern which is '*' requiring it to - // get all the contexts. - NVList nvList = ctx.get_values( "", CTX_RESTRICT_SCOPE.value,"*" ); - String[] context = new String[(nvList.count() * 2) ]; - if( ( nvList != null ) &&( nvList.count() != 0 ) ) { - // The String[] array will contain Name and Value for each - // context and hence double the size in the array. - int index = 0; - for( int i = 0; i < nvList.count(); i++ ) { - NamedValue nv; - try { - nv = nvList.item( i ); - } - catch (Exception e ) { - return (String[]) null; - } - context[index] = nv.name(); - index++; - context[index] = nv.value().extract_string(); - index++; - } - } - - cachedOperationContext = context; - } - - // Good citizen: In the interest of efficiency, we assume - // interceptors will be "good citizens" in that they will not - // modify the contents of the String[] array. - - return cachedOperationContext; - } - - /** - * See RequestInfoImpl for javadoc. - */ - public Any result (){ - checkAccess( MID_RESULT ); - - if( cachedResult == null ) { - if( request == null ) { - throw stdWrapper.piOperationNotSupported5() ; - } - // Get the result from the DII request data. - NamedValue nvResult = request.result( ); - - if( nvResult == null ) { - throw wrapper.piDiiResultIsNull() ; - } - - cachedResult = nvResult.value(); - } - - // Good citizen: In the interest of efficiency, we assume that - // interceptors will not modify the contents of the result Any. - // Otherwise, we would need to create a deep copy of the Any. - - return cachedResult; - } - - /** - * See RequestInfoImpl for javadoc. - */ - public boolean response_expected (){ - // access is currently valid for all states: - //checkAccess( MID_RESPONSE_EXPECTED ); - return ! messageMediator.isOneWay(); - } - - /** - * See RequestInfoImpl for javadoc. - */ - public Object forward_reference (){ - checkAccess( MID_FORWARD_REFERENCE ); - // Check to make sure we are in LOCATION_FORWARD - // state as per ptc/00-08-06, table 21-1 - // footnote 2. - if( replyStatus != LOCATION_FORWARD.value ) { - throw stdWrapper.invalidPiCall1() ; - } - - // Do not cache this value since if an interceptor raises - // forward request then the next interceptor in the - // list should see the new value. - IOR ior = getLocatedIOR(); - return iorToObject(ior); - } - - private IOR getLocatedIOR() - { - IOR ior; - CorbaContactInfoList contactInfoList = (CorbaContactInfoList) - messageMediator.getContactInfo().getContactInfoList(); - ior = contactInfoList.getEffectiveTargetIOR(); - return ior; - } - - protected void setLocatedIOR(IOR ior) - { - ORB orb = (ORB) messageMediator.getBroker(); - - CorbaContactInfoListIterator iterator = (CorbaContactInfoListIterator) - ((CorbaInvocationInfo)orb.getInvocationInfo()) - .getContactInfoListIterator(); - - // REVISIT - this most likely causes reportRedirect to happen twice. - // Once here and once inside the request dispatcher. - iterator.reportRedirect( - (CorbaContactInfo)messageMediator.getContactInfo(), - ior); - } - - /** - * See RequestInfoImpl for javadoc. - */ - public org.omg.IOP.ServiceContext get_request_service_context( int id ) { - checkAccess( MID_GET_REQUEST_SERVICE_CONTEXT ); - - if( cachedRequestServiceContexts == null ) { - cachedRequestServiceContexts = new HashMap(); - } - - return getServiceContext(cachedRequestServiceContexts, - messageMediator.getRequestServiceContexts(), - id); - } - - /** - * does not contain an etry for that ID, BAD_PARAM with a minor code of - * TBD_BP is raised. - */ - public org.omg.IOP.ServiceContext get_reply_service_context( int id ) { - checkAccess( MID_GET_REPLY_SERVICE_CONTEXT ); - - if( cachedReplyServiceContexts == null ) { - cachedReplyServiceContexts = new HashMap(); - } - - // In the event this is called from a oneway, we will have no - // response object. - // - // In the event this is called after a IIOPConnection.purgeCalls, - // we will have a response object, but that object will - // not contain a header (which would hold the service context - // container). See bug 4624102. - // - // REVISIT: this is the only thing used - // from response at this time. However, a more general solution - // would avoid accessing other parts of response's header. - // - // Instead of throwing a NullPointer, we will - // "gracefully" handle these with a BAD_PARAM with minor code 25. - - try { - ServiceContexts serviceContexts = - messageMediator.getReplyServiceContexts(); - if (serviceContexts == null) { - throw new NullPointerException(); - } - return getServiceContext(cachedReplyServiceContexts, - serviceContexts, id); - } catch (NullPointerException e) { - // REVISIT how this is programmed - not what it does. - // See purge calls test. The waiter is woken up by the - // call to purge calls - but there is no reply containing - // service contexts. - throw stdWrapper.invalidServiceContextId( e ) ; - } - } - - // - // REVISIT - // Override RequestInfoImpl connection to work in framework. - // - - public com.sun.corba.se.spi.legacy.connection.Connection connection() - { - return (com.sun.corba.se.spi.legacy.connection.Connection) - messageMediator.getConnection(); - } - - - - /* - ********************************************************************** - * Package-scope interfaces - **********************************************************************/ - - protected void setInfo(MessageMediator messageMediator) - { - this.messageMediator = (CorbaMessageMediator)messageMediator; - // REVISIT - so mediator can handle DII in subcontract. - this.messageMediator.setDIIInfo(request); - } - - /** - * Set or reset the retry request flag. - */ - void setRetryRequest( RetryType retryRequest ) { - this.retryRequest = retryRequest; - } - - /** - * Retrieve the current retry request status. - */ - RetryType getRetryRequest() { - // 6763340 - return this.retryRequest; - } - - /** - * Increases the entry count by 1. - */ - void incrementEntryCount() { - this.entryCount++; - } - - /** - * Decreases the entry count by 1. - */ - void decrementEntryCount() { - this.entryCount--; - } - - /** - * Retrieve the current entry count - */ - int getEntryCount() { - return this.entryCount; - } - - /** - * Overridden from RequestInfoImpl. Calls the super class, then - * sets the ending point call depending on the reply status. - */ - protected void setReplyStatus( short replyStatus ) { - super.setReplyStatus( replyStatus ); - switch( replyStatus ) { - case SUCCESSFUL.value: - endingPointCall = CALL_RECEIVE_REPLY; - break; - case SYSTEM_EXCEPTION.value: - case USER_EXCEPTION.value: - endingPointCall = CALL_RECEIVE_EXCEPTION; - break; - case LOCATION_FORWARD.value: - case TRANSPORT_RETRY.value: - endingPointCall = CALL_RECEIVE_OTHER; - break; - } - } - - /** - * Sets DII request object in the RequestInfoObject. - */ - protected void setDIIRequest(org.omg.CORBA.Request req) { - request = req; - } - - /** - * Keeps track of whether initiate was called for a DII request. The ORB - * needs to know this so it knows whether to ignore a second call to - * initiateClientPIRequest or not. - */ - protected void setDIIInitiate( boolean diiInitiate ) { - this.diiInitiate = diiInitiate; - } - - /** - * See comment for setDIIInitiate - */ - protected boolean isDIIInitiate() { - return this.diiInitiate; - } - - /** - * The PICurrent stack should only be popped if it was pushed. - * This is generally the case. But exceptions which occur - * after the stub's entry to _request but before the push - * end up in _releaseReply which will try to pop unless told not to. - */ - protected void setPICurrentPushed( boolean piCurrentPushed ) { - this.piCurrentPushed = piCurrentPushed; - } - - protected boolean isPICurrentPushed() { - return this.piCurrentPushed; - } - - /** - * Overridden from RequestInfoImpl. - */ - protected void setException( Exception exception ) { - super.setException( exception ); - - // Clear cached values: - cachedReceivedException = null; - cachedReceivedExceptionId = null; - } - - protected boolean getIsOneWay() { - return ! response_expected(); - } - - /** - * See description for RequestInfoImpl.checkAccess - */ - protected void checkAccess( int methodID ) - throws BAD_INV_ORDER - { - // Make sure currentPoint matches the appropriate index in the - // validCall table: - int validCallIndex = 0; - switch( currentExecutionPoint ) { - case EXECUTION_POINT_STARTING: - switch( startingPointCall ) { - case CALL_SEND_REQUEST: - validCallIndex = 0; - break; - case CALL_SEND_POLL: - validCallIndex = 1; - break; - } - break; - case EXECUTION_POINT_ENDING: - switch( endingPointCall ) { - case CALL_RECEIVE_REPLY: - validCallIndex = 2; - break; - case CALL_RECEIVE_EXCEPTION: - validCallIndex = 3; - break; - case CALL_RECEIVE_OTHER: - validCallIndex = 4; - break; - } - break; - } - - // Check the validCall table: - if( !validCall[methodID][validCallIndex] ) { - throw stdWrapper.invalidPiCall2() ; - } - } - -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/CodecFactoryImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/CodecFactoryImpl.java deleted file mode 100644 index 5274b5558a8..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/CodecFactoryImpl.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.interceptors; - -import org.omg.IOP.Codec; -import org.omg.IOP.CodecFactory; -import org.omg.IOP.CodecFactoryPackage.UnknownEncoding; -import org.omg.IOP.Encoding; -import org.omg.IOP.ENCODING_CDR_ENCAPS; - -import com.sun.corba.se.spi.logging.CORBALogDomains; - -import com.sun.corba.se.impl.logging.ORBUtilSystemException; - -import org.omg.CORBA.ORB; -import org.omg.CORBA.LocalObject; - -/** - * CodecFactoryImpl is the implementation of the Codec Factory, as described - * in orbos/99-12-02. - */ -public final class CodecFactoryImpl - extends org.omg.CORBA.LocalObject - implements CodecFactory -{ - // The ORB that created this Codec Factory - private ORB orb; - private ORBUtilSystemException wrapper ; - - // The maximum minor version of GIOP supported by this codec factory. - // Currently, this is 1.2. - private static final int MAX_MINOR_VERSION_SUPPORTED = 2; - - // The pre-created minor versions of Codec version 1.0, 1.1, ..., - // 1.(MAX_MINOR_VERSION_SUPPORTED) - private Codec codecs[] = new Codec[MAX_MINOR_VERSION_SUPPORTED + 1]; - - /** - * Creates a new CodecFactory implementation. Stores the ORB that - * created this factory, for later use by the Codec. - */ - public CodecFactoryImpl( ORB orb ) { - this.orb = orb; - wrapper = ORBUtilSystemException.get( - (com.sun.corba.se.spi.orb.ORB)orb, - CORBALogDomains.RPC_PROTOCOL ) ; - - // Precreate a codec for version 1.0 through - // 1.(MAX_MINOR_VERSION_SUPPORTED). This can be - // done since Codecs are immutable in their current implementation. - // This is an optimization that eliminates the overhead of creating - // a new Codec each time create_codec is called. - for( int minor = 0; minor <= MAX_MINOR_VERSION_SUPPORTED; minor++ ) { - codecs[minor] = new CDREncapsCodec( orb, 1, minor ); - } - } - - /** - * Creates a codec of the given encoding. The only format recognized - * by this factory is ENCODING_CDR_ENCAPS, versions 1.0 through - * 1.(MAX_MINOR_VERSION_SUPPORTED). - * - * @exception UnknownEncoding Thrown if this factory cannot create a - * Codec of the given encoding. - */ - public Codec create_codec ( Encoding enc ) - throws UnknownEncoding - { - if( enc == null ) nullParam(); - - Codec result = null; - - // This is the only format we can currently create codecs for: - if( (enc.format == ENCODING_CDR_ENCAPS.value) && - (enc.major_version == 1) ) - { - if( (enc.minor_version >= 0) && - (enc.minor_version <= MAX_MINOR_VERSION_SUPPORTED) ) - { - result = codecs[enc.minor_version]; - } - } - - if( result == null ) { - throw new UnknownEncoding(); - } - - return result; - } - - /** - * Called when an invalid null parameter was passed. Throws a - * BAD_PARAM with a minor code of 1 - */ - private void nullParam() - { - throw wrapper.nullParam() ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/IORInfoImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/IORInfoImpl.java deleted file mode 100644 index 6f0a1068cc4..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/IORInfoImpl.java +++ /dev/null @@ -1,318 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.interceptors; - -import java.util.Iterator ; - -import org.omg.IOP.TaggedComponent; - -import org.omg.CORBA.BAD_INV_ORDER; -import org.omg.CORBA.BAD_PARAM; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.INV_POLICY; -import org.omg.CORBA.NO_IMPLEMENT; -import org.omg.CORBA.Policy; -import org.omg.CORBA.LocalObject; - -import org.omg.PortableInterceptor.IORInfo; -import org.omg.PortableInterceptor.ObjectReferenceTemplate; -import org.omg.PortableInterceptor.ObjectReferenceFactory; - -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.spi.oa.ObjectAdapter; - -import com.sun.corba.se.spi.legacy.interceptor.IORInfoExt; -import com.sun.corba.se.spi.legacy.interceptor.UnknownType; - -import com.sun.corba.se.spi.ior.IORTemplate; -import com.sun.corba.se.spi.ior.TaggedProfileTemplate; -import com.sun.corba.se.spi.ior.TaggedComponentFactoryFinder ; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; - -import com.sun.corba.se.impl.logging.InterceptorsSystemException ; -import com.sun.corba.se.impl.logging.OMGSystemException ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -/** - * IORInfoImpl is the implementation of the IORInfo class, as described - * in orbos/99-12-02, section 7. - */ -public final class IORInfoImpl - extends LocalObject - implements IORInfo, IORInfoExt -{ - // State values that determine which methods are allowed. - // get_effective_policy, manager_id, and adapter_state are valid unless STATE_DONE - - // add_component, and add_component_to_profile are valid. - private static final int STATE_INITIAL = 0 ; - - // adapter_template, and R/W to current_factory are valid - private static final int STATE_ESTABLISHED = 1 ; - - // No methods are valid in this state - private static final int STATE_DONE = 2 ; - - // The current state of this object - private int state = STATE_INITIAL ; - - // The ObjectAdapter associated with this IORInfo object. - private ObjectAdapter adapter; - - private ORB orb ; - - private ORBUtilSystemException orbutilWrapper ; - private InterceptorsSystemException wrapper ; - private OMGSystemException omgWrapper ; - - /** - * Creates a new IORInfo implementation. This info object will establish - * tagged components with the template for the provided IOR Template. - */ - IORInfoImpl( ObjectAdapter adapter ) { - this.orb = adapter.getORB() ; - - orbutilWrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - wrapper = InterceptorsSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - omgWrapper = OMGSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - - this.adapter = adapter; - } - - /** - * An ORB service implementation may determine what server side policy - * of a particular type is in effect for an IOR being constructed by - * calling the get_effective_policy operation. When the IOR being - * constructed is for an object implemented using a POA, all Policy - * objects passed to the PortableServer::POA::create_POA call that - * created that POA are accessible via get_effective_policy. - *

            - * If a policy for the given type is not known to the ORB, then this - * operation will raise INV_POLICY with a standard minor code of 2. - * - * @param type The CORBA::PolicyType specifying the type of policy to - * return. - * @return The effective CORBA::Policy object of the requested type. - * If the given policy type is known, but no policy of that tpye is - * in effect, then this operation will return a nil object reference. - */ - public Policy get_effective_policy (int type) { - checkState( STATE_INITIAL, STATE_ESTABLISHED ) ; - - return adapter.getEffectivePolicy( type ); - } - - /** - * A portable ORB service implementation calls this method from its - * implementation of establish_components to add a tagged component to - * the set which will be included when constructing IORs. The - * components in this set will be included in all profiles. - *

            - * Any number of components may exist with the same component ID. - * - * @param tagged_component The IOP::TaggedComponent to add - */ - public void add_ior_component (TaggedComponent tagged_component) { - checkState( STATE_INITIAL ) ; - - if( tagged_component == null ) nullParam(); - addIORComponentToProfileInternal( tagged_component, - adapter.getIORTemplate().iterator()); - } - - /** - * A portable ORB service implementation calls this method from its - * implementation of establish_components to add a tagged component to - * the set which will be included when constructing IORs. The - * components in this set will be included in the specified profile. - *

            - * Any number of components may exist with the same component ID. - *

            - * If the given profile ID does not define a known profile or it is - * impossible to add components to thgat profile, BAD_PARAM is raised - * with a minor code of TBD_BP + 3. - * - * @param tagged_component The IOP::TaggedComponent to add. - * @param profile_id The IOP::ProfileId tof the profile to which this - * component will be added. - */ - public void add_ior_component_to_profile ( - TaggedComponent tagged_component, int profile_id ) - { - checkState( STATE_INITIAL ) ; - - if( tagged_component == null ) nullParam(); - addIORComponentToProfileInternal( - tagged_component, adapter.getIORTemplate().iteratorById( - profile_id ) ); - } - - /** - * @param type The type of the server port - * (see connection.ORBSocketFactory for discussion). - * @return The listen port number for that type. - * @throws UnknownType if no port of the given type is found. - */ - public int getServerPort(String type) - throws UnknownType - { - checkState( STATE_INITIAL, STATE_ESTABLISHED ) ; - - int port = - orb.getLegacyServerSocketManager() - .legacyGetTransientOrPersistentServerPort(type); - if (port == -1) { - throw new UnknownType(); - } - return port; - } - - public ObjectAdapter getObjectAdapter() - { - return adapter; - } - - public int manager_id() - { - checkState( STATE_INITIAL, STATE_ESTABLISHED) ; - - return adapter.getManagerId() ; - } - - public short state() - { - checkState( STATE_INITIAL, STATE_ESTABLISHED) ; - - return adapter.getState() ; - } - - public ObjectReferenceTemplate adapter_template() - { - checkState( STATE_ESTABLISHED) ; - - // At this point, the iortemp must contain only a single - // IIOPProfileTemplate. This is a restriction of our - // implementation. Also, note the the ObjectReferenceTemplate - // is called when a certain POA is created in a certain ORB - // in a certain server, so the server_id, orb_id, and - // poa_id operations must be well-defined no matter what - // kind of implementation is used: e.g., if a POA creates - // IORs with multiple profiles, they must still all agree - // about this information. Thus, we are justified in - // extracting the single IIOPProfileTemplate to create - // an ObjectReferenceTemplate here. - - return adapter.getAdapterTemplate() ; - } - - public ObjectReferenceFactory current_factory() - { - checkState( STATE_ESTABLISHED) ; - - return adapter.getCurrentFactory() ; - } - - public void current_factory( ObjectReferenceFactory factory ) - { - checkState( STATE_ESTABLISHED) ; - - adapter.setCurrentFactory( factory ) ; - } - - /** - * Internal utility method to add an IOR component to the set of profiles - * present in the iterator. - */ - private void addIORComponentToProfileInternal( - TaggedComponent tagged_component, Iterator iterator ) - { - // Convert the given IOP::TaggedComponent into the appropriate - // type for the TaggedProfileTemplate - TaggedComponentFactoryFinder finder = - orb.getTaggedComponentFactoryFinder(); - Object newTaggedComponent = finder.create( orb, tagged_component ); - - // Iterate through TaggedProfileTemplates and add the given tagged - // component to the appropriate one(s). - boolean found = false; - while( iterator.hasNext() ) { - found = true; - TaggedProfileTemplate taggedProfileTemplate = - (TaggedProfileTemplate)iterator.next(); - taggedProfileTemplate.add( newTaggedComponent ); - } - - // If no profile was found with the given id, throw a BAD_PARAM: - // (See orbos/00-08-06, section 21.5.3.3.) - if( !found ) { - throw omgWrapper.invalidProfileId() ; - } - } - - /** - * Called when an invalid null parameter was passed. Throws a - * BAD_PARAM with a minor code of 1 - */ - private void nullParam() - { - throw orbutilWrapper.nullParam() ; - } - - // REVISIT: add minor codes! - - private void checkState( int expectedState ) - { - if (expectedState != state) - throw wrapper.badState1( new Integer(expectedState), new Integer(state) ) ; - } - - private void checkState( int expectedState1, int expectedState2 ) - { - if ((expectedState1 != state) && (expectedState2 != state)) - throw wrapper.badState2( new Integer(expectedState1), - new Integer(expectedState2), new Integer(state) ) ; - } - - void makeStateEstablished() - { - checkState( STATE_INITIAL ) ; - - state = STATE_ESTABLISHED ; - } - - void makeStateDone() - { - checkState( STATE_ESTABLISHED ) ; - - state = STATE_DONE ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/InterceptorInvoker.java b/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/InterceptorInvoker.java deleted file mode 100644 index 367ed231900..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/InterceptorInvoker.java +++ /dev/null @@ -1,662 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.interceptors; - -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.SystemException; -import org.omg.CORBA.portable.Delegate; -import org.omg.PortableInterceptor.LOCATION_FORWARD; -import org.omg.PortableInterceptor.SUCCESSFUL; -import org.omg.PortableInterceptor.SYSTEM_EXCEPTION; -import org.omg.PortableInterceptor.TRANSPORT_RETRY; -import org.omg.PortableInterceptor.USER_EXCEPTION; -import org.omg.PortableInterceptor.ClientRequestInfo; -import org.omg.PortableInterceptor.ClientRequestInterceptor; -import org.omg.PortableInterceptor.ForwardRequest; -import org.omg.PortableInterceptor.IORInterceptor; -import org.omg.PortableInterceptor.IORInterceptor_3_0; -import org.omg.PortableInterceptor.ServerRequestInfo; -import org.omg.PortableInterceptor.ServerRequestInterceptor; -import org.omg.PortableInterceptor.ObjectReferenceTemplate; - -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.oa.ObjectAdapter; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.impl.orbutil.ORBUtility; - -/** - * Handles invocation of interceptors. Has specific knowledge of how to - * invoke IOR, ClientRequest, and ServerRequest interceptors. - * Makes use of the InterceptorList to retrieve the list of interceptors to - * be invoked. Most methods in this class are package scope so that they - * may only be called from the PIHandlerImpl. - */ -public class InterceptorInvoker { - - // The ORB - private ORB orb; - - // The list of interceptors to be invoked - private InterceptorList interceptorList; - - // True if interceptors are to be invoked, or false if not - // Note: This is a global enable/disable flag, whereas the enable flag - // in the RequestInfoStack in PIHandlerImpl is only for a particular Thread. - private boolean enabled = false; - - // PICurrent variable. - private PICurrent current; - - // NOTE: Be careful about adding additional attributes to this class. - // Multiple threads may be calling methods on this invoker at the same - // time. - - /** - * Creates a new Interceptor Invoker. Constructor is package scope so - * only the ORB can create it. The invoker is initially disabled, and - * must be explicitly enabled using setEnabled(). - */ - InterceptorInvoker( ORB orb, InterceptorList interceptorList, - PICurrent piCurrent ) - { - this.orb = orb; - this.interceptorList = interceptorList; - this.enabled = false; - this.current = piCurrent; - } - - /** - * Enables or disables the interceptor invoker - */ - void setEnabled( boolean enabled ) { - this.enabled = enabled; - } - - /* - ********************************************************************** - * IOR Interceptor invocation - **********************************************************************/ - - /** - * Called when a new POA is created. - * - * @param oa The Object Adapter associated with the IOR interceptor. - */ - void objectAdapterCreated( ObjectAdapter oa ) { - // If invocation is not yet enabled, don't do anything. - if( enabled ) { - // Create IORInfo object to pass to IORInterceptors: - IORInfoImpl info = new IORInfoImpl( oa ); - - // Call each IORInterceptor: - IORInterceptor[] iorInterceptors = - (IORInterceptor[])interceptorList.getInterceptors( - InterceptorList.INTERCEPTOR_TYPE_IOR ); - int size = iorInterceptors.length; - - // Implementation note: - // This loop counts backwards for greater efficiency. - // Benchmarks have shown that counting down is more efficient - // than counting up in Java for loops, as a compare to zero is - // faster than a subtract and compare to zero. In this case, - // it doesn't really matter much, but it's simply a force of habit. - - for( int i = (size - 1); i >= 0; i-- ) { - IORInterceptor interceptor = iorInterceptors[i]; - try { - interceptor.establish_components( info ); - } - catch( Exception e ) { - // as per PI spec (orbos/99-12-02 sec 7.2.1), if - // establish_components throws an exception, ignore it. - } - } - - // Change the state so that only template operations are valid - info.makeStateEstablished() ; - - for( int i = (size - 1); i >= 0; i-- ) { - IORInterceptor interceptor = iorInterceptors[i]; - if (interceptor instanceof IORInterceptor_3_0) { - IORInterceptor_3_0 interceptor30 = (IORInterceptor_3_0)interceptor ; - // Note that exceptions here are NOT ignored, as per the - // ORT spec (orbos/01-01-04) - interceptor30.components_established( info ); - } - } - - // Change the state so that no operations are valid, - // in case a reference to info escapes this scope. - // This also completes the actions associated with the - // template interceptors on this POA. - info.makeStateDone() ; - } - } - - void adapterManagerStateChanged( int managerId, short newState ) - { - if (enabled) { - IORInterceptor[] interceptors = - (IORInterceptor[])interceptorList.getInterceptors( - InterceptorList.INTERCEPTOR_TYPE_IOR ); - int size = interceptors.length; - - for( int i = (size - 1); i >= 0; i-- ) { - try { - IORInterceptor interceptor = interceptors[i]; - if (interceptor instanceof IORInterceptor_3_0) { - IORInterceptor_3_0 interceptor30 = (IORInterceptor_3_0)interceptor ; - interceptor30.adapter_manager_state_changed( managerId, - newState ); - } - } catch (Exception exc) { - // No-op: ignore exception in this case - } - } - } - } - - void adapterStateChanged( ObjectReferenceTemplate[] templates, - short newState ) - { - if (enabled) { - IORInterceptor[] interceptors = - (IORInterceptor[])interceptorList.getInterceptors( - InterceptorList.INTERCEPTOR_TYPE_IOR ); - int size = interceptors.length; - - for( int i = (size - 1); i >= 0; i-- ) { - try { - IORInterceptor interceptor = interceptors[i]; - if (interceptor instanceof IORInterceptor_3_0) { - IORInterceptor_3_0 interceptor30 = (IORInterceptor_3_0)interceptor ; - interceptor30.adapter_state_changed( templates, newState ); - } - } catch (Exception exc) { - // No-op: ignore exception in this case - } - } - } - } - - /* - ********************************************************************** - * Client Interceptor invocation - **********************************************************************/ - - /** - * Invokes either send_request, or send_poll, depending on the value - * of info.getStartingPointCall() - */ - void invokeClientInterceptorStartingPoint( ClientRequestInfoImpl info ) { - // If invocation is not yet enabled, don't do anything. - if( enabled ) { - try { - // Make a a fresh slot table available to TSC in case - // interceptors need to make out calls. - // Client's TSC is now RSC via RequestInfo. - current.pushSlotTable( ); - info.setPICurrentPushed( true ); - info.setCurrentExecutionPoint( info.EXECUTION_POINT_STARTING ); - - // Get all ClientRequestInterceptors: - ClientRequestInterceptor[] clientInterceptors = - (ClientRequestInterceptor[])interceptorList. - getInterceptors( InterceptorList.INTERCEPTOR_TYPE_CLIENT ); - int size = clientInterceptors.length; - - // We will assume that all interceptors returned successfully, - // and adjust the flowStackIndex to the appropriate value if - // we later discover otherwise. - int flowStackIndex = size; - boolean continueProcessing = true; - - // Determine whether we are calling send_request or send_poll: - // (This is currently commented out because our ORB does not - // yet support the Messaging specification, so send_poll will - // never occur. Once we have implemented messaging, this may - // be uncommented.) - // int startingPointCall = info.getStartingPointCall(); - for( int i = 0; continueProcessing && (i < size); i++ ) { - try { - clientInterceptors[i].send_request( info ); - - // Again, it is not necessary for a switch here, since - // there is only one starting point call type (see - // above comment). - - //switch( startingPointCall ) { - //case ClientRequestInfoImpl.CALL_SEND_REQUEST: - //clientInterceptors[i].send_request( info ); - //break; - //case ClientRequestInfoImpl.CALL_SEND_POLL: - //clientInterceptors[i].send_poll( info ); - //break; - //} - - } - catch( ForwardRequest e ) { - // as per PI spec (orbos/99-12-02 sec 5.2.1.), if - // interception point throws a ForwardRequest, - // no other Interceptors' send_request operations are - // called. - flowStackIndex = i; - info.setForwardRequest( e ); - info.setEndingPointCall( - ClientRequestInfoImpl.CALL_RECEIVE_OTHER ); - info.setReplyStatus( LOCATION_FORWARD.value ); - - updateClientRequestDispatcherForward( info ); - - // For some reason, using break here causes the VM on - // NT to lose track of the value of flowStackIndex - // after exiting the for loop. I changed this to - // check a boolean value instead and it seems to work - // fine. - continueProcessing = false; - } - catch( SystemException e ) { - // as per PI spec (orbos/99-12-02 sec 5.2.1.), if - // interception point throws a SystemException, - // no other Interceptors' send_request operations are - // called. - flowStackIndex = i; - info.setEndingPointCall( - ClientRequestInfoImpl.CALL_RECEIVE_EXCEPTION ); - info.setReplyStatus( SYSTEM_EXCEPTION.value ); - info.setException( e ); - - // For some reason, using break here causes the VM on - // NT to lose track of the value of flowStackIndex - // after exiting the for loop. I changed this to - // check a boolean value instead and it seems to - // work fine. - continueProcessing = false; - } - } - - // Remember where we left off in the flow stack: - info.setFlowStackIndex( flowStackIndex ); - } - finally { - // Make the SlotTable fresh for the next interception point. - current.resetSlotTable( ); - } - } // end enabled check - } - - /** - * Invokes either receive_reply, receive_exception, or receive_other, - * depending on the value of info.getEndingPointCall() - */ - void invokeClientInterceptorEndingPoint( ClientRequestInfoImpl info ) { - // If invocation is not yet enabled, don't do anything. - if( enabled ) { - try { - // NOTE: It is assumed someplace else prepared a - // fresh TSC slot table. - - info.setCurrentExecutionPoint( info.EXECUTION_POINT_ENDING ); - - // Get all ClientRequestInterceptors: - ClientRequestInterceptor[] clientInterceptors = - (ClientRequestInterceptor[])interceptorList. - getInterceptors( InterceptorList.INTERCEPTOR_TYPE_CLIENT ); - int flowStackIndex = info.getFlowStackIndex(); - - // Determine whether we are calling receive_reply, - // receive_exception, or receive_other: - int endingPointCall = info.getEndingPointCall(); - - // If we would be calling RECEIVE_REPLY, but this is a - // one-way call, override this and call receive_other: - if( ( endingPointCall == - ClientRequestInfoImpl.CALL_RECEIVE_REPLY ) && - info.getIsOneWay() ) - { - endingPointCall = ClientRequestInfoImpl.CALL_RECEIVE_OTHER; - info.setEndingPointCall( endingPointCall ); - } - - // Only step through the interceptors whose starting points - // have successfully returned. - // Unlike the previous loop, this one counts backwards for a - // reason - we must execute these in the reverse order of the - // starting points. - for( int i = (flowStackIndex - 1); i >= 0; i-- ) { - - try { - switch( endingPointCall ) { - case ClientRequestInfoImpl.CALL_RECEIVE_REPLY: - clientInterceptors[i].receive_reply( info ); - break; - case ClientRequestInfoImpl.CALL_RECEIVE_EXCEPTION: - clientInterceptors[i].receive_exception( info ); - break; - case ClientRequestInfoImpl.CALL_RECEIVE_OTHER: - clientInterceptors[i].receive_other( info ); - break; - } - } - catch( ForwardRequest e ) { - - // as per PI spec (orbos/99-12-02 sec 5.2.1.), if - // interception point throws a ForwardException, - // ending point call changes to receive_other. - endingPointCall = - ClientRequestInfoImpl.CALL_RECEIVE_OTHER; - info.setEndingPointCall( endingPointCall ); - info.setReplyStatus( LOCATION_FORWARD.value ); - info.setForwardRequest( e ); - updateClientRequestDispatcherForward( info ); - } - catch( SystemException e ) { - - // as per PI spec (orbos/99-12-02 sec 5.2.1.), if - // interception point throws a SystemException, - // ending point call changes to receive_exception. - endingPointCall = - ClientRequestInfoImpl.CALL_RECEIVE_EXCEPTION; - info.setEndingPointCall( endingPointCall ); - info.setReplyStatus( SYSTEM_EXCEPTION.value ); - info.setException( e ); - } - } - } - finally { - // See doc for setPICurrentPushed as to why this is necessary. - // Check info for null in case errors happen before initiate. - if (info != null && info.isPICurrentPushed()) { - current.popSlotTable( ); - // After the pop, original client's TSC slot table - // remains avaiable via PICurrent. - } - } - } // end enabled check - } - - /* - ********************************************************************** - * Server Interceptor invocation - **********************************************************************/ - - /** - * Invokes receive_request_service_context interception points. - */ - void invokeServerInterceptorStartingPoint( ServerRequestInfoImpl info ) { - // If invocation is not yet enabled, don't do anything. - if( enabled ) { - try { - // Make a fresh slot table for RSC. - current.pushSlotTable(); - info.setSlotTable(current.getSlotTable()); - - // Make a fresh slot table for TSC in case - // interceptors need to make out calls. - current.pushSlotTable( ); - - info.setCurrentExecutionPoint( info.EXECUTION_POINT_STARTING ); - - // Get all ServerRequestInterceptors: - ServerRequestInterceptor[] serverInterceptors = - (ServerRequestInterceptor[])interceptorList. - getInterceptors( InterceptorList.INTERCEPTOR_TYPE_SERVER ); - int size = serverInterceptors.length; - - // We will assume that all interceptors returned successfully, - // and adjust the flowStackIndex to the appropriate value if - // we later discover otherwise. - int flowStackIndex = size; - boolean continueProcessing = true; - - // Currently, there is only one server-side starting point - // interceptor called receive_request_service_contexts. - for( int i = 0; continueProcessing && (i < size); i++ ) { - - try { - serverInterceptors[i]. - receive_request_service_contexts( info ); - } - catch( ForwardRequest e ) { - // as per PI spec (orbos/99-12-02 sec 5.3.1.), if - // interception point throws a ForwardRequest, - // no other Interceptors' starting points are - // called and send_other is called. - flowStackIndex = i; - info.setForwardRequest( e ); - info.setIntermediatePointCall( - ServerRequestInfoImpl.CALL_INTERMEDIATE_NONE ); - info.setEndingPointCall( - ServerRequestInfoImpl.CALL_SEND_OTHER ); - info.setReplyStatus( LOCATION_FORWARD.value ); - - // For some reason, using break here causes the VM on - // NT to lose track of the value of flowStackIndex - // after exiting the for loop. I changed this to - // check a boolean value instead and it seems to work - // fine. - continueProcessing = false; - } - catch( SystemException e ) { - - // as per PI spec (orbos/99-12-02 sec 5.3.1.), if - // interception point throws a SystemException, - // no other Interceptors' starting points are - // called. - flowStackIndex = i; - info.setException( e ); - info.setIntermediatePointCall( - ServerRequestInfoImpl.CALL_INTERMEDIATE_NONE ); - info.setEndingPointCall( - ServerRequestInfoImpl.CALL_SEND_EXCEPTION ); - info.setReplyStatus( SYSTEM_EXCEPTION.value ); - - // For some reason, using break here causes the VM on - // NT to lose track of the value of flowStackIndex - // after exiting the for loop. I changed this to - // check a boolean value instead and it seems to - // work fine. - continueProcessing = false; - } - - } - - // Remember where we left off in the flow stack: - info.setFlowStackIndex( flowStackIndex ); - } - finally { - // The remaining points, ServantManager and Servant - // all run in the same logical thread. - current.popSlotTable( ); - // Now TSC and RSC are equivalent. - } - } // end enabled check - } - - /** - * Invokes receive_request interception points - */ - void invokeServerInterceptorIntermediatePoint( - ServerRequestInfoImpl info ) - { - int intermediatePointCall = info.getIntermediatePointCall(); - // If invocation is not yet enabled, don't do anything. - if( enabled && ( intermediatePointCall != - ServerRequestInfoImpl.CALL_INTERMEDIATE_NONE ) ) - { - // NOTE: do not touch the slotStack. The RSC and TSC are - // equivalent at this point. - - info.setCurrentExecutionPoint( info.EXECUTION_POINT_INTERMEDIATE ); - - // Get all ServerRequestInterceptors: - ServerRequestInterceptor[] serverInterceptors = - (ServerRequestInterceptor[]) - interceptorList.getInterceptors( - InterceptorList.INTERCEPTOR_TYPE_SERVER ); - int size = serverInterceptors.length; - - // Currently, there is only one server-side intermediate point - // interceptor called receive_request. - for( int i = 0; i < size; i++ ) { - - try { - serverInterceptors[i].receive_request( info ); - } - catch( ForwardRequest e ) { - - // as per PI spec (orbos/99-12-02 sec 5.3.1.), if - // interception point throws a ForwardRequest, - // no other Interceptors' intermediate points are - // called and send_other is called. - info.setForwardRequest( e ); - info.setEndingPointCall( - ServerRequestInfoImpl.CALL_SEND_OTHER ); - info.setReplyStatus( LOCATION_FORWARD.value ); - break; - } - catch( SystemException e ) { - - // as per PI spec (orbos/99-12-02 sec 5.3.1.), if - // interception point throws a SystemException, - // no other Interceptors' starting points are - // called. - info.setException( e ); - info.setEndingPointCall( - ServerRequestInfoImpl.CALL_SEND_EXCEPTION ); - info.setReplyStatus( SYSTEM_EXCEPTION.value ); - break; - } - } - } // end enabled check - } - - /** - * Invokes either send_reply, send_exception, or send_other, - * depending on the value of info.getEndingPointCall() - */ - void invokeServerInterceptorEndingPoint( ServerRequestInfoImpl info ) { - // If invocation is not yet enabled, don't do anything. - if( enabled ) { - try { - // NOTE: do not touch the slotStack. The RSC and TSC are - // equivalent at this point. - - // REVISIT: This is moved out to PIHandlerImpl until dispatch - // path is rearchitected. It must be there so that - // it always gets executed so if an interceptor raises - // an exception any service contexts added in earlier points - // this point get put in the exception reply (via the SC Q). - //info.setCurrentExecutionPoint( info.EXECUTION_POINT_ENDING ); - - // Get all ServerRequestInterceptors: - ServerRequestInterceptor[] serverInterceptors = - (ServerRequestInterceptor[])interceptorList. - getInterceptors( InterceptorList.INTERCEPTOR_TYPE_SERVER ); - int flowStackIndex = info.getFlowStackIndex(); - - // Determine whether we are calling - // send_exception, or send_other: - int endingPointCall = info.getEndingPointCall(); - - // Only step through the interceptors whose starting points - // have successfully returned. - for( int i = (flowStackIndex - 1); i >= 0; i-- ) { - try { - switch( endingPointCall ) { - case ServerRequestInfoImpl.CALL_SEND_REPLY: - serverInterceptors[i].send_reply( info ); - break; - case ServerRequestInfoImpl.CALL_SEND_EXCEPTION: - serverInterceptors[i].send_exception( info ); - break; - case ServerRequestInfoImpl.CALL_SEND_OTHER: - serverInterceptors[i].send_other( info ); - break; - } - } - catch( ForwardRequest e ) { - // as per PI spec (orbos/99-12-02 sec 5.3.1.), if - // interception point throws a ForwardException, - // ending point call changes to receive_other. - endingPointCall = - ServerRequestInfoImpl.CALL_SEND_OTHER; - info.setEndingPointCall( endingPointCall ); - info.setForwardRequest( e ); - info.setReplyStatus( LOCATION_FORWARD.value ); - info.setForwardRequestRaisedInEnding(); - } - catch( SystemException e ) { - // as per PI spec (orbos/99-12-02 sec 5.3.1.), if - // interception point throws a SystemException, - // ending point call changes to send_exception. - endingPointCall = - ServerRequestInfoImpl.CALL_SEND_EXCEPTION; - info.setEndingPointCall( endingPointCall ); - info.setException( e ); - info.setReplyStatus( SYSTEM_EXCEPTION.value ); - } - } - - // Remember that all interceptors' starting and ending points - // have already been executed so we need not do anything. - info.setAlreadyExecuted( true ); - } - finally { - // Get rid of the Server side RSC. - current.popSlotTable(); - } - } // end enabled check - } - - /* - ********************************************************************** - * Private utility methods - **********************************************************************/ - - /** - * Update the client delegate in the event of a ForwardRequest, given the - * information in the passed-in info object. - */ - private void updateClientRequestDispatcherForward( - ClientRequestInfoImpl info ) - { - ForwardRequest forwardRequest = info.getForwardRequestException(); - - // ForwardRequest may be null if the forwarded IOR is set internal - // to the ClientRequestDispatcher rather than explicitly through Portable - // Interceptors. In this case, we need not update the client - // delegate ForwardRequest object. - if( forwardRequest != null ) { - org.omg.CORBA.Object object = forwardRequest.forward; - - // Convert the forward object into an IOR: - IOR ior = ORBUtility.getIOR( object ) ; - info.setLocatedIOR( ior ); - } - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/InterceptorList.java b/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/InterceptorList.java deleted file mode 100644 index b8e6466f866..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/InterceptorList.java +++ /dev/null @@ -1,260 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.interceptors; - -import org.omg.PortableInterceptor.Interceptor; -import org.omg.PortableInterceptor.ORBInitInfo; -import org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName; - -import org.omg.CORBA.INTERNAL; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.lang.reflect.Array; - -import com.sun.corba.se.impl.logging.InterceptorsSystemException ; - -/** - * Provides a repository of registered Portable Interceptors, organized - * by type. This list is designed to be accessed as efficiently as - * possible during runtime, with the expense of added complexity during - * initialization and interceptor registration. The class is designed - * to easily allow for the addition of new interceptor types. - */ -public class InterceptorList { - - // Interceptor type list. If additional interceptors are needed, - // add additional types in numerical order (do not skip numbers), - // and update NUM_INTERCEPTOR_TYPES and classTypes accordingly. - // NUM_INTERCEPTOR_TYPES represents the number of interceptor - // types, so we know how many lists to maintain. - static final int INTERCEPTOR_TYPE_CLIENT = 0; - static final int INTERCEPTOR_TYPE_SERVER = 1; - static final int INTERCEPTOR_TYPE_IOR = 2; - - static final int NUM_INTERCEPTOR_TYPES = 3; - - // Array of class types for interceptors. This is used to create the - // appropriate array type for each interceptor type. These must - // match the indices of the constants declared above. - static final Class[] classTypes = { - org.omg.PortableInterceptor.ClientRequestInterceptor.class, - org.omg.PortableInterceptor.ServerRequestInterceptor.class, - org.omg.PortableInterceptor.IORInterceptor.class - }; - - // True if no further interceptors may be registered with this list. - private boolean locked = false; - private InterceptorsSystemException wrapper ; - - // List of interceptors currently registered. There are - // NUM_INTERCEPTOR_TYPES lists of registered interceptors. - // For example, interceptors[INTERCEPTOR_TYPE_CLIENT] contains an array - // of objects of type ClientRequestInterceptor. - private Interceptor[][] interceptors = - new Interceptor[NUM_INTERCEPTOR_TYPES][]; - - /** - * Creates a new Interceptor List. Constructor is package scope so - * only the ORB can create it. - */ - InterceptorList( InterceptorsSystemException wrapper ) { - this.wrapper = wrapper ; - // Create empty interceptors arrays for each type: - initInterceptorArrays(); - } - - /** - * Registers an interceptor of the given type into the interceptor list. - * The type is one of: - *

              - *
            • INTERCEPTOR_TYPE_CLIENT - ClientRequestInterceptor - *
            • INTERCEPTOR_TYPE_SERVER - ServerRequestInterceptor - *
            • INTERCEPTOR_TYPE_IOR - IORInterceptor - *
            - * - * @exception DuplicateName Thrown if an interceptor of the given - * name already exists for the given type. - */ - void register_interceptor( Interceptor interceptor, int type ) - throws DuplicateName - { - // If locked, deny any further addition of interceptors. - if( locked ) { - throw wrapper.interceptorListLocked() ; - } - - // Cache interceptor name: - String interceptorName = interceptor.name(); - boolean anonymous = interceptorName.equals( "" ); - boolean foundDuplicate = false; - Interceptor[] interceptorList = interceptors[type]; - - // If this is not an anonymous interceptor, - // search for an interceptor of the same name in this category: - if( !anonymous ) { - int size = interceptorList.length; - - // An O(n) search will suffice because register_interceptor is not - // likely to be called often. - for( int i = 0; i < size; i++ ) { - Interceptor in = (Interceptor)interceptorList[i]; - if( in.name().equals( interceptorName ) ) { - foundDuplicate = true; - break; - } - } - } - - if( !foundDuplicate ) { - growInterceptorArray( type ); - interceptors[type][interceptors[type].length-1] = interceptor; - } - else { - throw new DuplicateName( interceptorName ); - } - } - - /** - * Locks this interceptor list so that no more interceptors may be - * registered. This method is called after all interceptors are - * registered for security reasons. - */ - void lock() { - locked = true; - } - - /** - * Retrieves an array of interceptors of the given type. For efficiency, - * the type parameter is assumed to be valid. - */ - Interceptor[] getInterceptors( int type ) { - return interceptors[type]; - } - - /** - * Returns true if there is at least one interceptor of the given type, - * or false if not. - */ - boolean hasInterceptorsOfType( int type ) { - return interceptors[type].length > 0; - } - - /** - * Initializes all interceptors arrays to zero-length arrays of the - * correct type, based on the classTypes list. - */ - private void initInterceptorArrays() { - for( int type = 0; type < NUM_INTERCEPTOR_TYPES; type++ ) { - Class classType = classTypes[type]; - - // Create a zero-length array for each type: - interceptors[type] = - (Interceptor[])Array.newInstance( classType, 0 ); - } - } - - /** - * Grows the given interceptor array by one: - */ - private void growInterceptorArray( int type ) { - Class classType = classTypes[type]; - int currentLength = interceptors[type].length; - Interceptor[] replacementArray; - - // Create new array to replace the old one. The new array will be - // one element larger but have the same type as the old one. - replacementArray = (Interceptor[]) - Array.newInstance( classType, currentLength + 1 ); - System.arraycopy( interceptors[type], 0, - replacementArray, 0, currentLength ); - interceptors[type] = replacementArray; - } - - /** - * Destroys all interceptors in this list by invoking their destroy() - * method. - */ - void destroyAll() { - int numTypes = interceptors.length; - - for( int i = 0; i < numTypes; i++ ) { - int numInterceptors = interceptors[i].length; - for( int j = 0; j < numInterceptors; j++ ) { - interceptors[i][j].destroy(); - } - } - } - - /** - * Sort interceptors. - */ - void sortInterceptors() { - List sorted = null; - List unsorted = null; - - int numTypes = interceptors.length; - - for( int i = 0; i < numTypes; i++ ) { - int numInterceptors = interceptors[i].length; - if (numInterceptors > 0) { - // Get fresh sorting bins for each non empty type. - sorted = new ArrayList(); // not synchronized like we want. - unsorted = new ArrayList(); - } - for( int j = 0; j < numInterceptors; j++ ) { - Interceptor interceptor = interceptors[i][j]; - if (interceptor instanceof Comparable) { - sorted.add(interceptor); - } else { - unsorted.add(interceptor); - } - } - if (numInterceptors > 0 && sorted.size() > 0) { - // Let the RuntimeExceptions thrown by sort - // (i.e., ClassCastException and UnsupportedOperationException) - // flow back to the user. - Collections.sort(sorted); - Iterator sortedIterator = sorted.iterator(); - Iterator unsortedIterator = unsorted.iterator(); - for( int j = 0; j < numInterceptors; j++ ) { - if (sortedIterator.hasNext()) { - interceptors[i][j] = - (Interceptor) sortedIterator.next(); - } else if (unsortedIterator.hasNext()) { - interceptors[i][j] = - (Interceptor) unsortedIterator.next(); - } else { - throw wrapper.sortSizeMismatch() ; - } - } - } - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/ORBInitInfoImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/ORBInitInfoImpl.java deleted file mode 100644 index f8ac3974e6f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/ORBInitInfoImpl.java +++ /dev/null @@ -1,381 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.interceptors; - -import org.omg.CORBA.BAD_PARAM; -import org.omg.CORBA.BAD_INV_ORDER; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.NO_IMPLEMENT; -import org.omg.CORBA.OBJECT_NOT_EXIST; -import org.omg.CORBA.LocalObject; -import org.omg.CORBA.Policy; -import org.omg.CORBA.PolicyError; -import org.omg.IOP.CodecFactory; -import org.omg.PortableInterceptor.ORBInitInfo; -import org.omg.PortableInterceptor.ClientRequestInterceptor; -import org.omg.PortableInterceptor.IORInterceptor; -import org.omg.PortableInterceptor.PolicyFactory; -import org.omg.PortableInterceptor.ServerRequestInterceptor; -import org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName; -import org.omg.PortableInterceptor.ORBInitInfoPackage.InvalidName; - -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.legacy.interceptor.ORBInitInfoExt ; -import com.sun.corba.se.spi.logging.CORBALogDomains; - -import com.sun.corba.se.impl.orbutil.ORBUtility; - -import com.sun.corba.se.impl.logging.InterceptorsSystemException; -import com.sun.corba.se.impl.logging.ORBUtilSystemException; -import com.sun.corba.se.impl.logging.OMGSystemException; - -/** - * ORBInitInfoImpl is the implementation of the ORBInitInfo class to be - * passed to ORBInitializers, as described in orbos/99-12-02. - */ -public final class ORBInitInfoImpl - extends org.omg.CORBA.LocalObject - implements ORBInitInfo, ORBInitInfoExt -{ - // The ORB we are initializing - private ORB orb; - - private InterceptorsSystemException wrapper ; - private ORBUtilSystemException orbutilWrapper ; - private OMGSystemException omgWrapper ; - - // The arguments passed to ORB_init - private String[] args; - - // The ID of the ORB being initialized - private String orbId; - - // The CodecFactory - private CodecFactory codecFactory; - - // The current stage of initialization - private int stage = STAGE_PRE_INIT; - - // The pre-initialization stage (pre_init() being called) - public static final int STAGE_PRE_INIT = 0; - - // The post-initialization stage (post_init() being called) - public static final int STAGE_POST_INIT = 1; - - // Reject all calls - this object should no longer be around. - public static final int STAGE_CLOSED = 2; - - // The description for the OBJECT_NOT_EXIST exception in STAGE_CLOSED - private static final String MESSAGE_ORBINITINFO_INVALID = - "ORBInitInfo object is only valid during ORB_init"; - - /** - * Creates a new ORBInitInfoImpl object (scoped to package) - * - * @param args The arguments passed to ORB_init. - */ - ORBInitInfoImpl( ORB orb, String[] args, - String orbId, CodecFactory codecFactory ) - { - this.orb = orb; - - wrapper = InterceptorsSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - orbutilWrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - omgWrapper = OMGSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - - this.args = args; - this.orbId = orbId; - this.codecFactory = codecFactory; - } - - /** Return the ORB behind this ORBInitInfo. This is defined in the - * ORBInitInfoExt interface. - */ - public ORB getORB() - { - return orb ; - } - - /** - * Sets the current stage we are in. This limits access to certain - * functionality. - */ - void setStage( int stage ) { - this.stage = stage; - } - - /** - * Throws an exception if the current stage is STAGE_CLOSED. - * This is called before any method is invoked to ensure that - * no method invocations are attempted after all calls to post_init() - * are completed. - */ - private void checkStage() { - if( stage == STAGE_CLOSED ) { - throw wrapper.orbinitinfoInvalid() ; - } - } - - /* - ******************************************************************* - * The following are implementations of the ORBInitInfo operations. - *******************************************************************/ - - /** - * This attribute contains the arguments passed to ORB_init. They may - * or may not contain the ORB's arguments - */ - public String[] arguments () { - checkStage(); - return args; - } - - /** - * This attribute is the ID of the ORB being initialized - */ - public String orb_id () { - checkStage(); - return orbId; - } - - /** - * This attribute is the IOP::CodecFactory. The CodecFactory is normally - * obtained via a call to ORB::resolve_initial_references( "CodecFactory" ) - * but since the ORB is not yet available and Interceptors, particularly - * when processing service contexts, will require a Codec, a means of - * obtaining a Codec is necessary during ORB intialization. - */ - public CodecFactory codec_factory () { - checkStage(); - return codecFactory; - } - - /** - * See orbos/99-12-02, Chapter 11, Dynamic Initial References on page - * 11-81. This operation is identical to ORB::register_initial_reference - * described there. This same functionality exists here because the ORB, - * not yet fully initialized, is not yet available but initial references - * may need to be registered as part of Interceptor registration. - *

            - * This method may not be called during post_init. - */ - public void register_initial_reference( String id, - org.omg.CORBA.Object obj ) - throws InvalidName - { - checkStage(); - if( id == null ) nullParam(); - - // As per CORBA 3.0 section 21.8.1, - // if null is passed as the obj parameter, - // throw BAD_PARAM with minor code OMGSystemException.RIR_WITH_NULL_OBJECT. - // Though the spec is talking about IDL null, we will address both - // Java null and IDL null: - // Note: Local Objects can never be nil! - if( obj == null ) { - throw omgWrapper.rirWithNullObject() ; - } - - // This check was made to determine that the objref is a - // non-local objref that is fully - // initialized: this was called only for its side-effects of - // possibly throwing exceptions. However, registering - // local objects should be permitted! - // XXX/Revisit? - // IOR ior = ORBUtility.getIOR( obj ) ; - - // Delegate to ORB. If ORB version throws InvalidName, convert to - // equivalent Portable Interceptors InvalidName. - try { - orb.register_initial_reference( id, obj ); - } catch( org.omg.CORBA.ORBPackage.InvalidName e ) { - InvalidName exc = new InvalidName( e.getMessage() ); - exc.initCause( e ) ; - throw exc ; - } - } - - /** - * This operation is only valid during post_init. It is identical to - * ORB::resolve_initial_references. This same functionality exists here - * because the ORB, not yet fully initialized, is not yet available, - * but initial references may be required from the ORB as part - * of Interceptor registration. - *

            - * (incorporates changes from errata in orbos/00-01-01) - *

            - * This method may not be called during pre_init. - */ - public org.omg.CORBA.Object resolve_initial_references (String id) - throws InvalidName - { - checkStage(); - if( id == null ) nullParam(); - - if( stage == STAGE_PRE_INIT ) { - // Initializer is not allowed to invoke this method during - // this stage. - - // _REVISIT_ Spec issue: What exception should really be - // thrown here? - throw wrapper.rirInvalidPreInit() ; - } - - org.omg.CORBA.Object objRef = null; - - try { - objRef = orb.resolve_initial_references( id ); - } - catch( org.omg.CORBA.ORBPackage.InvalidName e ) { - // Convert PIDL to IDL exception: - throw new InvalidName(); - } - - return objRef; - } - - // New method from CORBA 3.1 - public void add_client_request_interceptor_with_policy ( - ClientRequestInterceptor interceptor, Policy[] policies ) - throws DuplicateName - { - // XXX ignore policies for now - add_client_request_interceptor( interceptor ) ; - } - - /** - * This operation is used to add a client-side request Interceptor to - * the list of client-side request Interceptors. - *

            - * If a client-side request Interceptor has already been registered - * with this Interceptor's name, DuplicateName is raised. - */ - public void add_client_request_interceptor ( - ClientRequestInterceptor interceptor) - throws DuplicateName - { - checkStage(); - if( interceptor == null ) nullParam(); - - orb.getPIHandler().register_interceptor( interceptor, - InterceptorList.INTERCEPTOR_TYPE_CLIENT ); - } - - // New method from CORBA 3.1 - public void add_server_request_interceptor_with_policy ( - ServerRequestInterceptor interceptor, Policy[] policies ) - throws DuplicateName, PolicyError - { - // XXX ignore policies for now - add_server_request_interceptor( interceptor ) ; - } - - /** - * This operation is used to add a server-side request Interceptor to - * the list of server-side request Interceptors. - *

            - * If a server-side request Interceptor has already been registered - * with this Interceptor's name, DuplicateName is raised. - */ - public void add_server_request_interceptor ( - ServerRequestInterceptor interceptor) - throws DuplicateName - { - checkStage(); - if( interceptor == null ) nullParam(); - - orb.getPIHandler().register_interceptor( interceptor, - InterceptorList.INTERCEPTOR_TYPE_SERVER ); - } - - // New method from CORBA 3.1 - public void add_ior_interceptor_with_policy ( - IORInterceptor interceptor, Policy[] policies ) - throws DuplicateName, PolicyError - { - // XXX ignore policies for now - add_ior_interceptor( interceptor ) ; - } - - /** - * This operation is used to add an IOR Interceptor to - * the list of IOR Interceptors. - *

            - * If an IOR Interceptor has already been registered - * with this Interceptor's name, DuplicateName is raised. - */ - public void add_ior_interceptor ( - IORInterceptor interceptor ) - throws DuplicateName - { - checkStage(); - if( interceptor == null ) nullParam(); - - orb.getPIHandler().register_interceptor( interceptor, - InterceptorList.INTERCEPTOR_TYPE_IOR ); - } - - /** - * A service calls allocate_slot_id to allocate a slot on - * PortableInterceptor::Current. - * - * @return The index to the slot which has been allocated. - */ - public int allocate_slot_id () { - checkStage(); - - return ((PICurrent)orb.getPIHandler().getPICurrent()).allocateSlotId( ); - - } - - /** - * Register a PolicyFactory for the given PolicyType. - *

            - * If a PolicyFactory already exists for the given PolicyType, - * BAD_INV_ORDER is raised with a minor code of TBD_BIO+2. - */ - public void register_policy_factory( int type, - PolicyFactory policy_factory ) - { - checkStage(); - if( policy_factory == null ) nullParam(); - orb.getPIHandler().registerPolicyFactory( type, policy_factory ); - } - - - /** - * Called when an invalid null parameter was passed. Throws a - * BAD_PARAM with a minor code of 1 - */ - private void nullParam() - throws BAD_PARAM - { - throw orbutilWrapper.nullParam() ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/PICurrent.java b/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/PICurrent.java deleted file mode 100644 index 5502be3ae92..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/PICurrent.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.interceptors; - -import com.sun.corba.se.spi.orb.ORB; -import org.omg.PortableInterceptor.Current; -import org.omg.PortableInterceptor.InvalidSlot; -import org.omg.CORBA.Any; -import org.omg.CORBA.BAD_INV_ORDER; -import org.omg.CORBA.CompletionStatus; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.impl.logging.OMGSystemException ; - -/** - * PICurrent is the implementation of Current as specified in the Portable - * Interceptors Spec orbos/99-12-02. - * IMPORTANT: PICurrent is implemented with the assumption that get_slot() - * or set_slot() will not be called in ORBInitializer.pre_init() and - * post_init(). - */ -public class PICurrent extends org.omg.CORBA.LocalObject - implements Current -{ - // slotCounter is used to keep track of ORBInitInfo.allocate_slot_id() - private int slotCounter; - - // The ORB associated with this PICurrent object. - private ORB myORB; - - private OMGSystemException wrapper ; - - // True if the orb is still initialzing and get_slot and set_slot are not - // to be called. - private boolean orbInitializing; - - // ThreadLocal contains a stack of SlotTable which are used - // for resolve_initial_references( "PICurrent" ); - private ThreadLocal threadLocalSlotTable - = new ThreadLocal( ) { - protected Object initialValue( ) { - SlotTable table = new SlotTable( myORB, slotCounter ); - return new SlotTableStack( myORB, table ); - } - }; - - /** - * PICurrent constructor which will be called for every ORB - * initialization. - */ - PICurrent( ORB myORB ) { - this.myORB = myORB; - wrapper = OMGSystemException.get( myORB, - CORBALogDomains.RPC_PROTOCOL ) ; - this.orbInitializing = true; - slotCounter = 0; - } - - - /** - * This method will be called from ORBInitInfo.allocate_slot_id( ). - * simply returns a slot id by incrementing slotCounter. - */ - int allocateSlotId( ) { - int slotId = slotCounter; - slotCounter = slotCounter + 1; - return slotId; - } - - - /** - * This method gets the SlotTable which is on the top of the - * ThreadLocalStack. - */ - SlotTable getSlotTable( ) { - SlotTable table = (SlotTable) - ((SlotTableStack)threadLocalSlotTable.get()).peekSlotTable(); - return table; - } - - /** - * This method pushes a SlotTable on the SlotTableStack. When there is - * a resolve_initial_references("PICurrent") after this call. The new - * PICurrent will be returned. - */ - void pushSlotTable( ) { - SlotTableStack st = (SlotTableStack)threadLocalSlotTable.get(); - st.pushSlotTable( ); - } - - - /** - * This method pops a SlotTable on the SlotTableStack. - */ - void popSlotTable( ) { - SlotTableStack st = (SlotTableStack)threadLocalSlotTable.get(); - st.popSlotTable( ); - } - - /** - * This method sets the slot data at the given slot id (index) in the - * Slot Table which is on the top of the SlotTableStack. - */ - public void set_slot( int id, Any data ) throws InvalidSlot - { - if( orbInitializing ) { - // As per ptc/00-08-06 if the ORB is still initializing, disallow - // calls to get_slot and set_slot. If an attempt is made to call, - // throw a BAD_INV_ORDER. - throw wrapper.invalidPiCall3() ; - } - - getSlotTable().set_slot( id, data ); - } - - /** - * This method gets the slot data at the given slot id (index) from the - * Slot Table which is on the top of the SlotTableStack. - */ - public Any get_slot( int id ) throws InvalidSlot - { - if( orbInitializing ) { - // As per ptc/00-08-06 if the ORB is still initializing, disallow - // calls to get_slot and set_slot. If an attempt is made to call, - // throw a BAD_INV_ORDER. - throw wrapper.invalidPiCall4() ; - } - - return getSlotTable().get_slot( id ); - } - - /** - * This method resets all the slot data to null in the - * Slot Table which is on the top of SlotTableStack. - */ - void resetSlotTable( ) { - getSlotTable().resetSlots(); - } - - /** - * Called from ORB when the ORBInitializers are about to start - * initializing. - */ - void setORBInitializing( boolean init ) { - this.orbInitializing = init; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/PIHandlerImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/PIHandlerImpl.java deleted file mode 100644 index 9ad417e464e..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/PIHandlerImpl.java +++ /dev/null @@ -1,992 +0,0 @@ -/* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.interceptors; - -import java.util.*; -import java.io.IOException; - -import org.omg.CORBA.Any; -import org.omg.CORBA.BAD_PARAM; -import org.omg.CORBA.BAD_POLICY; -import org.omg.CORBA.BAD_INV_ORDER; -import org.omg.CORBA.COMM_FAILURE; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.NVList; -import org.omg.CORBA.OBJECT_NOT_EXIST; -import org.omg.CORBA.ORBPackage.InvalidName; -import org.omg.CORBA.SystemException; -import org.omg.CORBA.UserException; -import org.omg.CORBA.UNKNOWN; - -import org.omg.CORBA.portable.ApplicationException; -import org.omg.CORBA.portable.RemarshalException; - -import org.omg.IOP.CodecFactory; - -import org.omg.PortableInterceptor.ForwardRequest; -import org.omg.PortableInterceptor.Current; -import org.omg.PortableInterceptor.Interceptor; -import org.omg.PortableInterceptor.LOCATION_FORWARD; -import org.omg.PortableInterceptor.ORBInitializer; -import org.omg.PortableInterceptor.ORBInitInfo; -import org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName; -import org.omg.PortableInterceptor.SUCCESSFUL; -import org.omg.PortableInterceptor.SYSTEM_EXCEPTION; -import org.omg.PortableInterceptor.TRANSPORT_RETRY; -import org.omg.PortableInterceptor.USER_EXCEPTION; -import org.omg.PortableInterceptor.PolicyFactory; -import org.omg.PortableInterceptor.ObjectReferenceTemplate; - -import com.sun.corba.se.pept.encoding.OutputObject; - -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.ObjectKeyTemplate; -import com.sun.corba.se.spi.oa.ObjectAdapter; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.orbutil.closure.ClosureFactory; -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; -import com.sun.corba.se.spi.protocol.ForwardException; -import com.sun.corba.se.spi.protocol.PIHandler; -import com.sun.corba.se.spi.protocol.RetryType; -import com.sun.corba.se.spi.logging.CORBALogDomains; - -import com.sun.corba.se.impl.logging.InterceptorsSystemException; -import com.sun.corba.se.impl.logging.ORBUtilSystemException; -import com.sun.corba.se.impl.logging.OMGSystemException; -import com.sun.corba.se.impl.corba.RequestImpl; -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.orbutil.StackImpl; -import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage; - -/** - * Provides portable interceptor functionality. - */ -public class PIHandlerImpl implements PIHandler -{ - // REVISIT - delete these after framework merging. - boolean printPushPopEnabled = false; - int pushLevel = 0; - private void printPush() - { - if (! printPushPopEnabled) return; - printSpaces(pushLevel); - pushLevel++; - System.out.println("PUSH"); - } - private void printPop() - { - if (! printPushPopEnabled) return; - pushLevel--; - printSpaces(pushLevel); - System.out.println("POP"); - } - private void printSpaces(int n) - { - for (int i = 0; i < n; i++) { - System.out.print(" "); - } - } - - private ORB orb; - InterceptorsSystemException wrapper; - ORBUtilSystemException orbutilWrapper; - OMGSystemException omgWrapper; - - // A unique id used in ServerRequestInfo. - // This does not correspond to the GIOP request id. - private int serverRequestIdCounter = 0; - - // Stores the codec factory for producing codecs - CodecFactory codecFactory = null; - - // The arguments passed to the application's main method. May be null. - // This is used for ORBInitializers and set from set_parameters. - String[] arguments = null; - - // The list of portable interceptors, organized by type: - private InterceptorList interceptorList; - - // Cached information for optimization - do we have any interceptors - // registered of the given types? Set during ORB initialization. - private boolean hasIORInterceptors; - private boolean hasClientInterceptors; // temp always true - private boolean hasServerInterceptors; - - // The class responsible for invoking interceptors - private InterceptorInvoker interceptorInvoker; - - // There will be one PICurrent instantiated for every ORB. - private PICurrent current; - - // This table contains a list of PolicyFactories registered using - // ORBInitInfo.registerPolicyFactory() method. - // Key for the table is PolicyType which is an Integer - // Value is PolicyFactory. - private HashMap policyFactoryTable; - - // Table to convert from a ReplyMessage.? to a PI replyStatus short. - // Note that this table relies on the order and constants of - // ReplyMessage not to change. - private final static short REPLY_MESSAGE_TO_PI_REPLY_STATUS[] = { - SUCCESSFUL.value, // = ReplyMessage.NO_EXCEPTION - USER_EXCEPTION.value, // = ReplyMessage.USER_EXCEPTION - SYSTEM_EXCEPTION.value, // = ReplyMessage.SYSTEM_EXCEPTION - LOCATION_FORWARD.value, // = ReplyMessage.LOCATION_FORWARD - LOCATION_FORWARD.value, // = ReplyMessage.LOCATION_FORWARD_PERM - TRANSPORT_RETRY.value // = ReplyMessage.NEEDS_ADDRESSING_MODE - }; - - // ThreadLocal containing a stack to store client request info objects - // and a disable count. - private ThreadLocal threadLocalClientRequestInfoStack = - new ThreadLocal() { - protected Object initialValue() { - return new RequestInfoStack(); - } - }; - - // ThreadLocal containing the current server request info object. - private ThreadLocal threadLocalServerRequestInfoStack = - new ThreadLocal() { - protected Object initialValue() { - return new RequestInfoStack(); - } - }; - - public void close() { - orb = null; - wrapper = null; - orbutilWrapper = null; - omgWrapper = null; - codecFactory = null; - arguments = null; - interceptorList = null; - interceptorInvoker = null; - current = null; - policyFactoryTable = null; - threadLocalClientRequestInfoStack = null; - threadLocalServerRequestInfoStack = null; - } - - // Class to contain all ThreadLocal data for ClientRequestInfo - // maintenance. - // - // We use an ArrayList instead since it is not thread-safe. - // RequestInfoStack is used quite frequently. - private final class RequestInfoStack extends Stack { - // Number of times a request has been made to disable interceptors. - // When this reaches 0, interception hooks are disabled. Any higher - // value indicates they are enabled. - // NOTE: The is only currently used on the client side. - public int disableCount = 0; - } - - public PIHandlerImpl( ORB orb, String[] args ) { - this.orb = orb ; - wrapper = InterceptorsSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - orbutilWrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - omgWrapper = OMGSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - arguments = args ; - - // Create codec factory: - codecFactory = new CodecFactoryImpl( orb ); - - // Create new interceptor list: - interceptorList = new InterceptorList( wrapper ); - - // Create a new PICurrent. - current = new PICurrent( orb ); - - // Create new interceptor invoker, initially disabled: - interceptorInvoker = new InterceptorInvoker( orb, interceptorList, - current ); - - // Register the PI current and Codec factory objects - orb.getLocalResolver().register( ORBConstants.PI_CURRENT_NAME, - ClosureFactory.makeConstant( current ) ) ; - orb.getLocalResolver().register( ORBConstants.CODEC_FACTORY_NAME, - ClosureFactory.makeConstant( codecFactory ) ) ; - } - - public void initialize() { - // If we have any orb initializers, make use of them: - if( orb.getORBData().getORBInitializers() != null ) { - // Create the ORBInitInfo object to pass to ORB intializers: - ORBInitInfoImpl orbInitInfo = createORBInitInfo(); - - // Make sure get_slot and set_slot are not called from within - // ORB initializers: - current.setORBInitializing( true ); - - // Call pre_init on all ORB initializers: - preInitORBInitializers( orbInitInfo ); - - // Call post_init on all ORB initializers: - postInitORBInitializers( orbInitInfo ); - - // Proprietary: sort interceptors: - interceptorList.sortInterceptors(); - - // Re-enable get_slot and set_slot to be called from within - // ORB initializers: - current.setORBInitializing( false ); - - // Ensure nobody makes any more calls on this object. - orbInitInfo.setStage( ORBInitInfoImpl.STAGE_CLOSED ); - - // Set cached flags indicating whether we have interceptors - // registered of a given type. - hasIORInterceptors = interceptorList.hasInterceptorsOfType( - InterceptorList.INTERCEPTOR_TYPE_IOR ); - // XXX This must always be true, so that using the new generic - // RPC framework can pass info between the PI stack and the - // framework invocation stack. Temporary until Harold fixes - // this. Note that this must never be true until after the - // ORBInitializer instances complete executing. - //hasClientInterceptors = interceptorList.hasInterceptorsOfType( - //InterceptorList.INTERCEPTOR_TYPE_CLIENT ); - hasClientInterceptors = true; - hasServerInterceptors = interceptorList.hasInterceptorsOfType( - InterceptorList.INTERCEPTOR_TYPE_SERVER ); - - // Enable interceptor invoker (not necessary if no interceptors - // are registered). This should be the last stage of ORB - // initialization. - interceptorInvoker.setEnabled( true ); - } - } - - /** - * ptc/00-08-06 p 205: "When an application calls ORB::destroy, the ORB - * 1) waits for all requests in progress to complete - * 2) calls the Interceptor::destroy operation for each interceptor - * 3) completes destruction of the ORB" - * - * This must be called at the end of ORB.destroy. Note that this is not - * part of the PIHandler interface, since ORBImpl implements the ORB interface. - */ - public void destroyInterceptors() { - interceptorList.destroyAll(); - } - - public void objectAdapterCreated( ObjectAdapter oa ) - { - if (!hasIORInterceptors) - return ; - - interceptorInvoker.objectAdapterCreated( oa ) ; - } - - public void adapterManagerStateChanged( int managerId, - short newState ) - { - if (!hasIORInterceptors) - return ; - - interceptorInvoker.adapterManagerStateChanged( managerId, newState ) ; - } - - public void adapterStateChanged( ObjectReferenceTemplate[] - templates, short newState ) - { - if (!hasIORInterceptors) - return ; - - interceptorInvoker.adapterStateChanged( templates, newState ) ; - } - - /* - ***************** - * Client PI hooks - *****************/ - - public void disableInterceptorsThisThread() { - if( !hasClientInterceptors ) return; - - RequestInfoStack infoStack = - (RequestInfoStack)threadLocalClientRequestInfoStack.get(); - infoStack.disableCount++; - } - - public void enableInterceptorsThisThread() { - if( !hasClientInterceptors ) return; - - RequestInfoStack infoStack = - (RequestInfoStack)threadLocalClientRequestInfoStack.get(); - infoStack.disableCount--; - } - - public void invokeClientPIStartingPoint() - throws RemarshalException - { - if( !hasClientInterceptors ) return; - if( !isClientPIEnabledForThisThread() ) return; - - // Invoke the starting interception points and record exception - // and reply status info in the info object: - ClientRequestInfoImpl info = peekClientRequestInfoImplStack(); - interceptorInvoker.invokeClientInterceptorStartingPoint( info ); - - // Check reply status. If we will not have another chance later - // to invoke the client ending points, do it now. - short replyStatus = info.getReplyStatus(); - if( (replyStatus == SYSTEM_EXCEPTION.value) || - (replyStatus == LOCATION_FORWARD.value) ) - { - // Note: Transport retry cannot happen here since this happens - // before the request hits the wire. - - Exception exception = invokeClientPIEndingPoint( - convertPIReplyStatusToReplyMessage( replyStatus ), - info.getException() ); - if( exception == null ) { - // Do not throw anything. Otherwise, it must be a - // SystemException, UserException or RemarshalException. - } if( exception instanceof SystemException ) { - throw (SystemException)exception; - } else if( exception instanceof RemarshalException ) { - throw (RemarshalException)exception; - } else if( (exception instanceof UserException) || - (exception instanceof ApplicationException) ) { - // It should not be possible for an interceptor to throw - // a UserException. By asserting instead of throwing the - // UserException, we need not declare anything but - // RemarshalException in the throws clause. - throw wrapper.exceptionInvalid() ; - } - } - else if( replyStatus != ClientRequestInfoImpl.UNINITIALIZED ) { - throw wrapper.replyStatusNotInit() ; - } - } - - // Needed when an error forces a retry AFTER initiateClientPIRequest - // but BEFORE invokeClientPIStartingPoint. - public Exception makeCompletedClientRequest( int replyStatus, - Exception exception ) { - - // 6763340 - return handleClientPIEndingPoint( replyStatus, exception, false ) ; - } - - public Exception invokeClientPIEndingPoint( int replyStatus, - Exception exception ) { - - // 6763340 - return handleClientPIEndingPoint( replyStatus, exception, true ) ; - } - - public Exception handleClientPIEndingPoint( - int replyStatus, Exception exception, boolean invokeEndingPoint ) { - if( !hasClientInterceptors ) return exception; - if( !isClientPIEnabledForThisThread() ) return exception; - - // Translate ReplyMessage.replyStatus into PI replyStatus: - // Note: this is also an assertion to make sure a valid replyStatus - // is passed in (IndexOutOfBoundsException will be thrown otherwise) - short piReplyStatus = REPLY_MESSAGE_TO_PI_REPLY_STATUS[replyStatus]; - - // Invoke the ending interception points and record exception - // and reply status info in the info object: - ClientRequestInfoImpl info = peekClientRequestInfoImplStack(); - info.setReplyStatus( piReplyStatus ); - info.setException( exception ); - - if (invokeEndingPoint) { - // 6763340 - interceptorInvoker.invokeClientInterceptorEndingPoint( info ); - piReplyStatus = info.getReplyStatus(); - } - - // Check reply status: - if( (piReplyStatus == LOCATION_FORWARD.value) || - (piReplyStatus == TRANSPORT_RETRY.value) ) { - // If this is a forward or a retry, reset and reuse - // info object: - info.reset(); - - // fix for 6763340: - if (invokeEndingPoint) { - info.setRetryRequest( RetryType.AFTER_RESPONSE ) ; - } else { - info.setRetryRequest( RetryType.BEFORE_RESPONSE ) ; - } - - // ... and return a RemarshalException so the orb internals know - exception = new RemarshalException(); - } else if( (piReplyStatus == SYSTEM_EXCEPTION.value) || - (piReplyStatus == USER_EXCEPTION.value) ) { - exception = info.getException(); - } - - return exception; - } - - public void initiateClientPIRequest( boolean diiRequest ) { - if( !hasClientInterceptors ) return; - if( !isClientPIEnabledForThisThread() ) return; - - // Get the most recent info object from the thread local - // ClientRequestInfoImpl stack: - RequestInfoStack infoStack = - (RequestInfoStack)threadLocalClientRequestInfoStack.get(); - ClientRequestInfoImpl info = null; - - if (!infoStack.empty() ) { - info = (ClientRequestInfoImpl)infoStack.peek(); - } - - if (!diiRequest && (info != null) && info.isDIIInitiate() ) { - // In RequestImpl.doInvocation we already called - // initiateClientPIRequest( true ), so ignore this initiate. - info.setDIIInitiate( false ); - } else { - // If there is no info object or if we are not retrying a request, - // push a new ClientRequestInfoImpl on the stack: - - // 6763340: don't push unless this is not a retry - if( (info == null) || !info.getRetryRequest().isRetry() ) { - info = new ClientRequestInfoImpl( orb ); - infoStack.push( info ); - printPush(); - // Note: the entry count is automatically initialized to 0. - } - - // Reset the retry request flag so that recursive calls will - // push a new info object, and bump up entry count so we know - // when to pop this info object: - info.setRetryRequest( RetryType.NONE ); - info.incrementEntryCount(); - - // KMC 6763340: I don't know why this wasn't set earlier, - // but we do not want a retry to pick up the previous - // reply status, so clear it here. Most likely a new - // info was pushed before, so that this was not a problem. - info.setReplyStatus( RequestInfoImpl.UNINITIALIZED ) ; - - // If this is a DII request, make sure we ignore the next initiate. - if( diiRequest ) { - info.setDIIInitiate( true ); - } - } - } - - public void cleanupClientPIRequest() { - if( !hasClientInterceptors ) return; - if( !isClientPIEnabledForThisThread() ) return; - - ClientRequestInfoImpl info = peekClientRequestInfoImplStack(); - RetryType rt = info.getRetryRequest() ; - - // fix for 6763340 - if (!rt.equals( RetryType.BEFORE_RESPONSE )) { - - // If the replyStatus has not yet been set, this is an indication - // that the ORB threw an exception before we had a chance to - // invoke the client interceptor ending points. - // - // _REVISIT_ We cannot handle any exceptions or ForwardRequests - // flagged by the ending points here because there is no way - // to gracefully handle this in any of the calling code. - // This is a rare corner case, so we will ignore this for now. - short replyStatus = info.getReplyStatus(); - if (replyStatus == info.UNINITIALIZED ) { - invokeClientPIEndingPoint( ReplyMessage.SYSTEM_EXCEPTION, - wrapper.unknownRequestInvoke( - CompletionStatus.COMPLETED_MAYBE ) ) ; - } - } - - // Decrement entry count, and if it is zero, pop it from the stack. - info.decrementEntryCount(); - - // fix for 6763340, and probably other cases (non-recursive retry) - if (info.getEntryCount() == 0 && !info.getRetryRequest().isRetry()) { - // RequestInfoStack infoStack = - // threadLocalClientRequestInfoStack.get(); - RequestInfoStack infoStack = - (RequestInfoStack)threadLocalClientRequestInfoStack.get(); - infoStack.pop(); - printPop(); - } - } - - public void setClientPIInfo(CorbaMessageMediator messageMediator) - { - if( !hasClientInterceptors ) return; - if( !isClientPIEnabledForThisThread() ) return; - - peekClientRequestInfoImplStack().setInfo(messageMediator); - } - - public void setClientPIInfo( RequestImpl requestImpl ) { - if( !hasClientInterceptors ) return; - if( !isClientPIEnabledForThisThread() ) return; - - peekClientRequestInfoImplStack().setDIIRequest( requestImpl ); - } - - /* - ***************** - * Server PI hooks - *****************/ - - public void invokeServerPIStartingPoint() - { - if( !hasServerInterceptors ) return; - - ServerRequestInfoImpl info = peekServerRequestInfoImplStack(); - interceptorInvoker.invokeServerInterceptorStartingPoint( info ); - - // Handle SystemException or ForwardRequest: - serverPIHandleExceptions( info ); - } - - public void invokeServerPIIntermediatePoint() - { - if( !hasServerInterceptors ) return; - - ServerRequestInfoImpl info = peekServerRequestInfoImplStack(); - interceptorInvoker.invokeServerInterceptorIntermediatePoint( info ); - - // Clear servant from info object so that the user has control over - // its lifetime: - info.releaseServant(); - - // Handle SystemException or ForwardRequest: - serverPIHandleExceptions( info ); - } - - public void invokeServerPIEndingPoint( ReplyMessage replyMessage ) - { - if( !hasServerInterceptors ) return; - ServerRequestInfoImpl info = peekServerRequestInfoImplStack(); - - // REVISIT: This needs to be done "early" for the following workaround. - info.setReplyMessage( replyMessage ); - - // REVISIT: This was done inside of invokeServerInterceptorEndingPoint - // but needs to be here for now. See comment in that method for why. - info.setCurrentExecutionPoint( info.EXECUTION_POINT_ENDING ); - - // It is possible we might have entered this method more than - // once (e.g. if an ending point threw a SystemException, then - // a new ServerResponseImpl is created). - if( !info.getAlreadyExecuted() ) { - int replyStatus = replyMessage.getReplyStatus(); - - // Translate ReplyMessage.replyStatus into PI replyStatus: - // Note: this is also an assertion to make sure a valid - // replyStatus is passed in (IndexOutOfBoundsException will be - // thrown otherwise) - short piReplyStatus = - REPLY_MESSAGE_TO_PI_REPLY_STATUS[replyStatus]; - - // Make forwarded IOR available to interceptors, if applicable: - if( ( piReplyStatus == LOCATION_FORWARD.value ) || - ( piReplyStatus == TRANSPORT_RETRY.value ) ) - { - info.setForwardRequest( replyMessage.getIOR() ); - } - - // REVISIT: Do early above for now. - // Make reply message available to interceptors: - //info.setReplyMessage( replyMessage ); - - // Remember exception so we can tell if an interceptor changed it. - Exception prevException = info.getException(); - - // _REVISIT_ We do not have access to the User Exception at - // this point, so treat it as an UNKNOWN for now. - // Note that if this is a DSI call, we do have the user exception. - if( !info.isDynamic() && - (piReplyStatus == USER_EXCEPTION.value) ) - { - info.setException( omgWrapper.unknownUserException( - CompletionStatus.COMPLETED_MAYBE ) ) ; - } - - // Invoke the ending interception points: - info.setReplyStatus( piReplyStatus ); - interceptorInvoker.invokeServerInterceptorEndingPoint( info ); - short newPIReplyStatus = info.getReplyStatus(); - Exception newException = info.getException(); - - // Check reply status. If an interceptor threw a SystemException - // and it is different than the one that we came in with, - // rethrow it so the proper response can be constructed: - if( ( newPIReplyStatus == SYSTEM_EXCEPTION.value ) && - ( newException != prevException ) ) - { - throw (SystemException)newException; - } - - // If we are to forward the location: - if( newPIReplyStatus == LOCATION_FORWARD.value ) { - if( piReplyStatus != LOCATION_FORWARD.value ) { - // Treat a ForwardRequest as a ForwardException. - IOR ior = info.getForwardRequestIOR(); - throw new ForwardException( orb, ior ) ; - } - else if( info.isForwardRequestRaisedInEnding() ) { - // Treat a ForwardRequest by changing the IOR. - replyMessage.setIOR( info.getForwardRequestIOR() ); - } - } - } - } - - public void setServerPIInfo( Exception exception ) { - if( !hasServerInterceptors ) return; - - ServerRequestInfoImpl info = peekServerRequestInfoImplStack(); - info.setException( exception ); - } - - public void setServerPIInfo( NVList arguments ) - { - if( !hasServerInterceptors ) return; - - ServerRequestInfoImpl info = peekServerRequestInfoImplStack(); - info.setDSIArguments( arguments ); - } - - public void setServerPIExceptionInfo( Any exception ) - { - if( !hasServerInterceptors ) return; - - ServerRequestInfoImpl info = peekServerRequestInfoImplStack(); - info.setDSIException( exception ); - } - - public void setServerPIInfo( Any result ) - { - if( !hasServerInterceptors ) return; - - ServerRequestInfoImpl info = peekServerRequestInfoImplStack(); - info.setDSIResult( result ); - } - - public void initializeServerPIInfo( CorbaMessageMediator request, - ObjectAdapter oa, byte[] objectId, ObjectKeyTemplate oktemp ) - { - if( !hasServerInterceptors ) return; - - RequestInfoStack infoStack = - (RequestInfoStack)threadLocalServerRequestInfoStack.get(); - ServerRequestInfoImpl info = new ServerRequestInfoImpl( orb ); - infoStack.push( info ); - printPush(); - - // Notify request object that once response is constructed, make - // sure we execute ending points. - request.setExecutePIInResponseConstructor( true ); - - info.setInfo( request, oa, objectId, oktemp ); - } - - public void setServerPIInfo( java.lang.Object servant, - String targetMostDerivedInterface ) - { - if( !hasServerInterceptors ) return; - - ServerRequestInfoImpl info = peekServerRequestInfoImplStack(); - info.setInfo( servant, targetMostDerivedInterface ); - } - - public void cleanupServerPIRequest() { - if( !hasServerInterceptors ) return; - - RequestInfoStack infoStack = - (RequestInfoStack)threadLocalServerRequestInfoStack.get(); - infoStack.pop(); - printPop(); - } - - /* - ********************************************************************** - * The following methods are private utility methods. - ************************************************************************/ - - /** - * Handles exceptions for the starting and intermediate points for - * server request interceptors. This is common code that has been - * factored out into this utility method. - *

            - * This method will NOT work for ending points. - */ - private void serverPIHandleExceptions( ServerRequestInfoImpl info ) - { - int endingPointCall = info.getEndingPointCall(); - if(endingPointCall == ServerRequestInfoImpl.CALL_SEND_EXCEPTION) { - // If a system exception was thrown, throw it to caller: - throw (SystemException)info.getException(); - } - else if( (endingPointCall == ServerRequestInfoImpl.CALL_SEND_OTHER) && - (info.getForwardRequestException() != null) ) - { - // If an interceptor throws a forward request, convert it - // into a ForwardException for easier handling: - IOR ior = info.getForwardRequestIOR(); - throw new ForwardException( orb, ior ); - } - } - - /** - * Utility method to convert a PI reply status short to a ReplyMessage - * constant. This is a reverse lookup on the table defined in - * REPLY_MESSAGE_TO_PI_REPLY_STATUS. The reverse lookup need not be - * performed as quickly since it is only executed in exception - * conditions. - */ - private int convertPIReplyStatusToReplyMessage( short replyStatus ) { - int result = 0; - for( int i = 0; i < REPLY_MESSAGE_TO_PI_REPLY_STATUS.length; i++ ) { - if( REPLY_MESSAGE_TO_PI_REPLY_STATUS[i] == replyStatus ) { - result = i; - break; - } - } - return result; - } - - /** - * Convenience method to get the ClientRequestInfoImpl object off the - * top of the ThreadLocal stack. Throws an INTERNAL exception if - * the Info stack is empty. - */ - private ClientRequestInfoImpl peekClientRequestInfoImplStack() { - RequestInfoStack infoStack = - (RequestInfoStack)threadLocalClientRequestInfoStack.get(); - ClientRequestInfoImpl info = null; - if( !infoStack.empty() ) { - info = (ClientRequestInfoImpl)infoStack.peek(); - } else { - throw wrapper.clientInfoStackNull() ; - } - - return info; - } - - /** - * Convenience method to get the ServerRequestInfoImpl object off the - * top of the ThreadLocal stack. Returns null if there are none. - */ - private ServerRequestInfoImpl peekServerRequestInfoImplStack() { - RequestInfoStack infoStack = - (RequestInfoStack)threadLocalServerRequestInfoStack.get(); - ServerRequestInfoImpl info = null; - - if( !infoStack.empty() ) { - info = (ServerRequestInfoImpl)infoStack.peek(); - } else { - throw wrapper.serverInfoStackNull() ; - } - - return info; - } - - /** - * Convenience method to determine whether Client PI is enabled - * for requests on this thread. - */ - private boolean isClientPIEnabledForThisThread() { - RequestInfoStack infoStack = - (RequestInfoStack)threadLocalClientRequestInfoStack.get(); - return (infoStack.disableCount == 0); - } - - /** - * Call pre_init on all ORB initializers - */ - private void preInitORBInitializers( ORBInitInfoImpl info ) { - - // Inform ORBInitInfo we are in pre_init stage - info.setStage( ORBInitInfoImpl.STAGE_PRE_INIT ); - - // Step through each initializer instantiation and call its - // pre_init. Ignore any exceptions. - for( int i = 0; i < orb.getORBData().getORBInitializers().length; - i++ ) { - ORBInitializer init = orb.getORBData().getORBInitializers()[i]; - if( init != null ) { - try { - init.pre_init( info ); - } - catch( Exception e ) { - // As per orbos/99-12-02, section 9.3.1.2, "If there are - // any exceptions, the ORB shall ignore them and proceed." - } - } - } - } - - /** - * Call post_init on all ORB initializers - */ - private void postInitORBInitializers( ORBInitInfoImpl info ) { - - // Inform ORBInitInfo we are in post_init stage - info.setStage( ORBInitInfoImpl.STAGE_POST_INIT ); - - // Step through each initializer instantiation and call its post_init. - // Ignore any exceptions. - for( int i = 0; i < orb.getORBData().getORBInitializers().length; - i++ ) { - ORBInitializer init = orb.getORBData().getORBInitializers()[i]; - if( init != null ) { - try { - init.post_init( info ); - } - catch( Exception e ) { - // As per orbos/99-12-02, section 9.3.1.2, "If there are - // any exceptions, the ORB shall ignore them and proceed." - } - } - } - } - - /** - * Creates the ORBInitInfo object to be passed to ORB intializers' - * pre_init and post_init methods - */ - private ORBInitInfoImpl createORBInitInfo() { - ORBInitInfoImpl result = null; - - // arguments comes from set_parameters. May be null. - - // _REVISIT_ The spec does not specify which ID this is to be. - // We currently get this from the corba.ORB, which reads it from - // the ORB_ID_PROPERTY property. - String orbId = orb.getORBData().getORBId() ; - - result = new ORBInitInfoImpl( orb, arguments, orbId, codecFactory ); - - return result; - } - - /** - * Called by ORBInitInfo when an interceptor needs to be registered. - * The type is one of: - *

              - *
            • INTERCEPTOR_TYPE_CLIENT - ClientRequestInterceptor - *
            • INTERCEPTOR_TYPE_SERVER - ServerRequestInterceptor - *
            • INTERCEPTOR_TYPE_IOR - IORInterceptor - *
            - * - * @exception DuplicateName Thrown if an interceptor of the given - * name already exists for the given type. - */ - public void register_interceptor( Interceptor interceptor, int type ) - throws DuplicateName - { - // We will assume interceptor is not null, since it is called - // internally. - if( (type >= InterceptorList.NUM_INTERCEPTOR_TYPES) || (type < 0) ) { - throw wrapper.typeOutOfRange( new Integer( type ) ) ; - } - - String interceptorName = interceptor.name(); - - if( interceptorName == null ) { - throw wrapper.nameNull() ; - } - - // Register with interceptor list: - interceptorList.register_interceptor( interceptor, type ); - } - - public Current getPICurrent( ) { - return current; - } - - /** - * Called when an invalid null parameter was passed. Throws a - * BAD_PARAM with a minor code of 1 - */ - private void nullParam() - throws BAD_PARAM - { - throw orbutilWrapper.nullParam() ; - } - - /** This is the implementation of standard API defined in org.omg.CORBA.ORB - * class. This method finds the Policy Factory for the given Policy Type - * and instantiates the Policy object from the Factory. It will throw - * PolicyError exception, If the PolicyFactory for the given type is - * not registered. - * _REVISIT_, Once Policy Framework work is completed, Reorganize - * this method to com.sun.corba.se.spi.orb.ORB. - */ - public org.omg.CORBA.Policy create_policy(int type, org.omg.CORBA.Any val) - throws org.omg.CORBA.PolicyError - { - if( val == null ) { - nullParam( ); - } - if( policyFactoryTable == null ) { - throw new org.omg.CORBA.PolicyError( - "There is no PolicyFactory Registered for type " + type, - BAD_POLICY.value ); - } - PolicyFactory factory = (PolicyFactory)policyFactoryTable.get( - new Integer(type) ); - if( factory == null ) { - throw new org.omg.CORBA.PolicyError( - " Could Not Find PolicyFactory for the Type " + type, - BAD_POLICY.value); - } - org.omg.CORBA.Policy policy = factory.create_policy( type, val ); - return policy; - } - - /** This method registers the Policy Factory in the policyFactoryTable, - * which is a HashMap. This method is made package private, because - * it is used internally by the Interceptors. - */ - public void registerPolicyFactory( int type, PolicyFactory factory ) { - if( policyFactoryTable == null ) { - policyFactoryTable = new HashMap(); - } - Integer key = new Integer( type ); - java.lang.Object val = policyFactoryTable.get( key ); - if( val == null ) { - policyFactoryTable.put( key, factory ); - } - else { - throw omgWrapper.policyFactoryRegFailed( new Integer( type ) ) ; - } - } - - public synchronized int allocateServerRequestId () - { - return serverRequestIdCounter++; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/PINoOpHandlerImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/PINoOpHandlerImpl.java deleted file mode 100644 index 93c047b76cd..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/PINoOpHandlerImpl.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.interceptors; - -import java.io.IOException; - -import org.omg.CORBA.Any; -import org.omg.CORBA.NVList; - -import org.omg.IOP.CodecFactory; - -import org.omg.CORBA.portable.RemarshalException; - -import org.omg.PortableInterceptor.ObjectReferenceTemplate ; -import org.omg.PortableInterceptor.ForwardRequest; -import org.omg.PortableInterceptor.Interceptor; -import org.omg.PortableInterceptor.PolicyFactory; -import org.omg.PortableInterceptor.Current; - -import org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName ; - -import com.sun.corba.se.pept.encoding.OutputObject; - -import com.sun.corba.se.spi.ior.ObjectKeyTemplate; - -import com.sun.corba.se.spi.oa.ObjectAdapter; - -import com.sun.corba.se.spi.orb.ORB; - -import com.sun.corba.se.spi.protocol.PIHandler; -import com.sun.corba.se.spi.protocol.ForwardException; -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; - -import com.sun.corba.se.impl.corba.RequestImpl; - -import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage; - -/** - * This is No-Op implementation of PIHandler. It is used in ORBConfigurator - * to initialize a piHandler before the Persistent Server Activation. This - * PIHandler implementation will be replaced by the real PIHandler in - * ORB.postInit( ) call. - */ -public class PINoOpHandlerImpl implements PIHandler -{ - public PINoOpHandlerImpl( ) { - } - - public void close() { - } - - public void initialize() { - } - - public void destroyInterceptors() { - } - - public void objectAdapterCreated( ObjectAdapter oa ) - { - } - - public void adapterManagerStateChanged( int managerId, - short newState ) - { - } - - public void adapterStateChanged( ObjectReferenceTemplate[] - templates, short newState ) - { - } - - - public void disableInterceptorsThisThread() { - } - - public void enableInterceptorsThisThread() { - } - - public void invokeClientPIStartingPoint() - throws RemarshalException - { - } - - public Exception invokeClientPIEndingPoint( - int replyStatus, Exception exception ) - { - return null; - } - - public Exception makeCompletedClientRequest( - int replyStatus, Exception exception ) { - return null; - } - - public void initiateClientPIRequest( boolean diiRequest ) { - } - - public void cleanupClientPIRequest() { - } - - public void setClientPIInfo(CorbaMessageMediator messageMediator) - { - } - - public void setClientPIInfo( RequestImpl requestImpl ) - { - } - - final public void sendCancelRequestIfFinalFragmentNotSent() - { - } - - - public void invokeServerPIStartingPoint() - { - } - - public void invokeServerPIIntermediatePoint() - { - } - - public void invokeServerPIEndingPoint( ReplyMessage replyMessage ) - { - } - - public void setServerPIInfo( Exception exception ) { - } - - public void setServerPIInfo( NVList arguments ) - { - } - - public void setServerPIExceptionInfo( Any exception ) - { - } - - public void setServerPIInfo( Any result ) - { - } - - public void initializeServerPIInfo( CorbaMessageMediator request, - ObjectAdapter oa, byte[] objectId, ObjectKeyTemplate oktemp ) - { - } - - public void setServerPIInfo( java.lang.Object servant, - String targetMostDerivedInterface ) - { - } - - public void cleanupServerPIRequest() { - } - - public void register_interceptor( Interceptor interceptor, int type ) - throws DuplicateName - { - } - - public Current getPICurrent( ) { - return null; - } - - public org.omg.CORBA.Policy create_policy(int type, org.omg.CORBA.Any val) - throws org.omg.CORBA.PolicyError - { - return null; - } - - public void registerPolicyFactory( int type, PolicyFactory factory ) { - } - - public int allocateServerRequestId () - { - return 0; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/RequestInfoImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/RequestInfoImpl.java deleted file mode 100644 index 52e457f2220..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/RequestInfoImpl.java +++ /dev/null @@ -1,929 +0,0 @@ -/* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.interceptors; - -import java.io.IOException ; - -import java.lang.reflect.Method ; -import java.lang.reflect.InvocationTargetException ; - -import java.util.HashMap ; - -import org.omg.PortableInterceptor.ForwardRequest; -import org.omg.PortableInterceptor.InvalidSlot; -import org.omg.PortableInterceptor.RequestInfo; -import org.omg.PortableInterceptor.LOCATION_FORWARD; -import org.omg.IOP.TaggedProfile; -import org.omg.IOP.TaggedComponent; -import org.omg.IOP.ServiceContextHelper; -import org.omg.Messaging.SYNC_WITH_TRANSPORT; -import org.omg.CORBA.ParameterMode; - -import org.omg.CORBA.Any; -import org.omg.CORBA.BAD_INV_ORDER; -import org.omg.CORBA.BAD_PARAM; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.Context; -import org.omg.CORBA.ContextList; -import org.omg.CORBA.CTX_RESTRICT_SCOPE; -import org.omg.CORBA.ExceptionList; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.LocalObject; -import org.omg.CORBA.NamedValue; -import org.omg.CORBA.NO_IMPLEMENT; -import org.omg.CORBA.NO_RESOURCES; -import org.omg.CORBA.NVList; -import org.omg.CORBA.Object; -import org.omg.CORBA.Policy; -import org.omg.CORBA.SystemException; -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.UNKNOWN; -import org.omg.CORBA.UserException; -import org.omg.CORBA.portable.ApplicationException; -import org.omg.CORBA.portable.Delegate; -import org.omg.CORBA.portable.InputStream; - -import org.omg.Dynamic.Parameter; - -import com.sun.corba.se.spi.legacy.connection.Connection; - -import com.sun.corba.se.spi.legacy.interceptor.RequestInfoExt; - -import com.sun.corba.se.spi.ior.IOR; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; - -import com.sun.corba.se.spi.orb.ORB; - -import com.sun.corba.se.spi.logging.CORBALogDomains; - -import com.sun.corba.se.spi.servicecontext.ServiceContexts; -import com.sun.corba.se.spi.servicecontext.UnknownServiceContext; - -import com.sun.corba.se.impl.encoding.CDRInputStream_1_0; -import com.sun.corba.se.impl.encoding.EncapsOutputStream; - -import com.sun.corba.se.impl.orbutil.ORBUtility; - -import com.sun.corba.se.impl.util.RepositoryId; - -import com.sun.corba.se.impl.logging.InterceptorsSystemException; -import com.sun.corba.se.impl.logging.OMGSystemException; - -import sun.corba.SharedSecrets; - -/** - * Implementation of the RequestInfo interface as specified in - * orbos/99-12-02 section 5.4.1. - */ -public abstract class RequestInfoImpl - extends LocalObject - implements RequestInfo, RequestInfoExt -{ - ////////////////////////////////////////////////////////////////////// - // - // NOTE: IF AN ATTRIBUTE IS ADDED, PLEASE UPDATE RESET(); - // - ////////////////////////////////////////////////////////////////////// - - // The ORB from which to get PICurrent and other info - protected ORB myORB; - protected InterceptorsSystemException wrapper ; - protected OMGSystemException stdWrapper ; - - // The number of interceptors actually invoked for this client request. - // See setFlowStackIndex for a detailed description. - protected int flowStackIndex = 0; - - // The type of starting point call to make to the interceptors - // See ClientRequestInfoImpl and ServerRequestInfoImpl for a list of - // appropriate constants. - protected int startingPointCall; - - // The type of intermediate point call to make to the interceptors - // See ServerRequestInfoImpl for a list of appropriate constants. - // This does not currently apply to client request interceptors but is - // here in case intermediate points are introduced in the future. - protected int intermediatePointCall; - - // The type of ending point call to make to the interceptors - // See ClientRequestInfoImpl and ServerRequestInfoImpl for a list of - // appropriate constants. - protected int endingPointCall; - - // The reply status to return in reply_status. This is initialized - // to UNINITIALIZED so that we can tell if this has been set or not. - protected short replyStatus = UNINITIALIZED; - - // Constant for an uninitizlied reply status. - protected static final short UNINITIALIZED = -1; - - // Which points we are currently executing (so we can implement the - // validity table). - protected int currentExecutionPoint; - protected static final int EXECUTION_POINT_STARTING = 0; - protected static final int EXECUTION_POINT_INTERMEDIATE = 1; - protected static final int EXECUTION_POINT_ENDING = 2; - - // Set to true if all interceptors have had all their points - // executed. - protected boolean alreadyExecuted; - - // Sources of request information - protected Connection connection; - protected ServiceContexts serviceContexts; - - // The ForwardRequest object if this request is being forwarded. - // Either the forwardRequest or the forwardRequestIOR field is set. - // When set, the other field is set to null initially. If the other - // field is queried, it is lazily calculated and cached. These - // two attributes are always kept in sync. - protected ForwardRequest forwardRequest; - protected IOR forwardRequestIOR; - - // PICurrent's SlotTable - protected SlotTable slotTable; - - // The exception to be returned by received_exception and - // received_exception_id - protected Exception exception; - - ////////////////////////////////////////////////////////////////////// - // - // NOTE: IF AN ATTRIBUTE IS ADDED, PLEASE UPDATE RESET(); - // - ////////////////////////////////////////////////////////////////////// - - /** - * Reset the info object so that it can be reused for a retry, - * for example. - */ - void reset() { - - // Please keep these in the same order as declared above. - - flowStackIndex = 0; - startingPointCall = 0; - intermediatePointCall = 0; - endingPointCall = 0; - // 6763340 - setReplyStatus( UNINITIALIZED ) ; - currentExecutionPoint = EXECUTION_POINT_STARTING; - alreadyExecuted = false; - connection = null; - serviceContexts = null; - forwardRequest = null; - forwardRequestIOR = null; - exception = null; - - // We don't need to reset the Slots because they are - // already in the clean state after recieve_ interceptor - // are called. - } - - /* - ********************************************************************** - * Access protection - **********************************************************************/ - - // Method IDs for all methods in RequestInfo. This allows for a - // convenient O(1) lookup for checkAccess(). - protected static final int MID_REQUEST_ID = 0; - protected static final int MID_OPERATION = 1; - protected static final int MID_ARGUMENTS = 2; - protected static final int MID_EXCEPTIONS = 3; - protected static final int MID_CONTEXTS = 4; - protected static final int MID_OPERATION_CONTEXT = 5; - protected static final int MID_RESULT = 6; - protected static final int MID_RESPONSE_EXPECTED = 7; - protected static final int MID_SYNC_SCOPE = 8; - protected static final int MID_REPLY_STATUS = 9; - protected static final int MID_FORWARD_REFERENCE = 10; - protected static final int MID_GET_SLOT = 11; - protected static final int MID_GET_REQUEST_SERVICE_CONTEXT = 12; - protected static final int MID_GET_REPLY_SERVICE_CONTEXT = 13; - // The last value from RequestInfo (be sure to update this): - protected static final int MID_RI_LAST = 13; - - /* - ********************************************************************** - * Public interfaces - **********************************************************************/ - - /** - * Creates a new RequestInfoImpl object. - */ - public RequestInfoImpl( ORB myORB ) { - super(); - - this.myORB = myORB; - wrapper = InterceptorsSystemException.get( myORB, - CORBALogDomains.RPC_PROTOCOL ) ; - stdWrapper = OMGSystemException.get( myORB, - CORBALogDomains.RPC_PROTOCOL ) ; - - // Capture the current TSC and make it the RSC of this request. - PICurrent current = (PICurrent)(myORB.getPIHandler().getPICurrent()); - slotTable = current.getSlotTable( ); - } - - /** - * Implementation for request_id() differs for client and server - * implementations. - * - * Uniquely identifies an active request/reply sequence. Once a - * request/reply sequence is concluded this ID may be reused. (this - * is NOT necessarily the same as the GIOP request_id). - */ - abstract public int request_id (); - - /** - * Implementation for operation() differs for client and server - * implementations. - * - * The name of the operation being invoked. - */ - abstract public String operation (); - - - /** - * This method returns the list of arguments for the operation that was - * invoked. It raises NO_RESOURCES exception if the operation is not invoked - * by using DII mechanism. - */ - abstract public Parameter[] arguments (); - - /** - * This method returns the list of exceptios that was raised when the - * operation was invoked. It raises NO_RESOURCES exception if the operation - * is not invoked by using DII mechanism. - */ - abstract public TypeCode[] exceptions (); - - /** - * This method returns the list of contexts for the DII operation. - * It raises NO_RESOURCES exception if the operation is not invoked by - * using DII mechanism. - */ - abstract public String[] contexts (); - - /** - * This method returns the list of operation_context for the DII operation. - * It raises NO_RESOURCES exception if the operation is not invoked by - * using DII mechanism. - */ - abstract public String[] operation_context (); - - /** - * This method returns the result from the invoked DII operation. - * It raises NO_RESOURCES exception if the operation is not invoked by - * using DII mechanism. - */ - abstract public Any result (); - - /** - * Implementation for response_expected() differs for client and server - * implementations. - * - * Indicates whether a response is expected. On the client, a reply is - * not returned when response_expected is false, so receive_reply cannot - * be called. receive_other is called unless an exception occurs, in - * which case receive_exception is called. On the client, within - * send_poll, this attribute is true. - */ - abstract public boolean response_expected (); - - /** - * Defined in the Messaging specification. Pertinent only when - * response_expected is false. If response_expected is true, the value - * of sync_scope is undefined. It defines how far the request shall - * progress before control is returned to the client. This attribute may - * have one of the follwing values: - *
              - *
            • Messaging::SYNC_NONE
            • - *
            • Messaging::SYNC_WITH_TRANSPORT
            • - *
            • Messaging::SYNC_WITH_SERVER
            • - *
            • Messaging::SYNC_WITH_TARGET
            • - *
            - */ - public short sync_scope (){ - checkAccess( MID_SYNC_SCOPE ); - return SYNC_WITH_TRANSPORT.value; // REVISIT - get from MessageMediator - } - - /** - * Describes the state of the result of the operation invocation. Its - * value can be one of the following: - *
              - *
            • PortableInterceptor::SUCCESSFUL
            • - *
            • PortableInterceptor::SYSTEM_EXCEPTION
            • - *
            • PortableInterceptor::USER_EXCEPTION
            • - *
            • PortableInterceptor::LOCATION_FORWARD
            • - *
            • PortableInterceptor::TRANSPORT_RETRY
            • - *
            - */ - public short reply_status (){ - checkAccess( MID_REPLY_STATUS ); - return replyStatus; - } - - /** - * Implementation for forward_reference() differs for client and server - * implementations. - * - * If the reply_status attribute is LOCATION_FORWARD - * then this attribute will contain the object - * to which the request will be forwarded. It is indeterminate whether a - * forwarded request will actually occur. - */ - abstract public Object forward_reference (); - - - /** - * Returns the data from the given slot of the PortableInterceptor::Current - * that is in the scope of the request. - *

            - * If the given slot has not been set, then an any containing a type code - * with a TCKind value of tk_null is returned. - *

            - * If the ID does not define an allocated slot, InvalidSlot is raised. - */ - public Any get_slot (int id) - throws InvalidSlot - { - // access is currently valid for all states: - //checkAccess( MID_GET_SLOT ); - // Delegate the call to the slotTable which was set when RequestInfo was - // created. - return slotTable.get_slot( id ); - } - - /** - * Implementation for get_request_service_context() differs for client - * and server implementations. - * - * This operation returns a copy of the service context with the given ID - * that is associated with the request. If the request's service context - * does not contain an etry for that ID, BAD_PARAM with a minor code of - * TBD_BP is raised. - */ - abstract public org.omg.IOP.ServiceContext - get_request_service_context(int id); - - /** - * Implementation for get_reply_service_context() differs for client - * and server implementations. - * - * This operation returns a copy of the service context with the given ID - * that is associated with the reply. IF the request's service context - * does not contain an entry for that ID, BAD_PARAM with a minor code of - * TBD_BP is raised. - */ - abstract public org.omg.IOP.ServiceContext - get_reply_service_context (int id); - - - // NOTE: When adding a method, be sure to: - // 1. Add a MID_* constant for that method - // 2. Call checkAccess at the start of the method - // 3. Define entries in the validCall[][] table for interception points - // in both ClientRequestInfoImpl and ServerRequestInfoImpl. - - - - /* - ********************************************************************** - * Proprietary methods - **********************************************************************/ - - /** - * @return The connection on which the request is made. - * - * Note: we store the connection as an internal type but - * expose it here as an external type. - */ - public com.sun.corba.se.spi.legacy.connection.Connection connection() - { - return connection; - } - - /* - ********************************************************************** - * Private utility methods - **********************************************************************/ - - /** - * Inserts the UserException inside the given ApplicationException - * into the given Any. Throws an UNKNOWN with minor code - * OMGSYstemException.UNKNOWN_USER_EXCEPTION if the Helper class could not be - * found to insert it with. - */ - private void insertApplicationException( ApplicationException appException, - Any result ) - throws UNKNOWN - { - try { - // Extract the UserException from the ApplicationException. - // Look up class name from repository id: - RepositoryId repId = RepositoryId.cache.getId( - appException.getId() ); - String className = repId.getClassName(); - - // Find the read method on the helper class: - String helperClassName = className + "Helper"; - Class helperClass = - SharedSecrets.getJavaCorbaAccess().loadClass( helperClassName ); - Class[] readParams = new Class[1]; - readParams[0] = org.omg.CORBA.portable.InputStream.class; - Method readMethod = helperClass.getMethod( "read", readParams ); - - // Invoke the read method, passing in the input stream to - // retrieve the user exception. Mark and reset the stream - // as to not disturb it. - InputStream ueInputStream = appException.getInputStream(); - ueInputStream.mark( 0 ); - UserException userException = null; - try { - java.lang.Object[] readArguments = new java.lang.Object[1]; - readArguments[0] = ueInputStream; - userException = (UserException)readMethod.invoke( - null, readArguments ); - } - finally { - try { - ueInputStream.reset(); - } - catch( IOException e ) { - throw wrapper.markAndResetFailed( e ) ; - } - } - - // Insert this UserException into the provided Any using the - // helper class. - insertUserException( userException, result ); - } catch( ClassNotFoundException e ) { - throw stdWrapper.unknownUserException( CompletionStatus.COMPLETED_MAYBE, e ) ; - } catch( NoSuchMethodException e ) { - throw stdWrapper.unknownUserException( CompletionStatus.COMPLETED_MAYBE, e ) ; - } catch( SecurityException e ) { - throw stdWrapper.unknownUserException( CompletionStatus.COMPLETED_MAYBE, e ) ; - } catch( IllegalAccessException e ) { - throw stdWrapper.unknownUserException( CompletionStatus.COMPLETED_MAYBE, e ) ; - } catch( IllegalArgumentException e ) { - throw stdWrapper.unknownUserException( CompletionStatus.COMPLETED_MAYBE, e ) ; - } catch( InvocationTargetException e ) { - throw stdWrapper.unknownUserException( CompletionStatus.COMPLETED_MAYBE, e ) ; - } - } - - /** - * Inserts the UserException into the given Any. - * Throws an UNKNOWN with minor code - * OMGSYstemException.UNKNOWN_USER_EXCEPTION if the Helper class could not be - * found to insert it with. - */ - private void insertUserException( UserException userException, Any result ) - throws UNKNOWN - { - try { - // Insert this UserException into the provided Any using the - // helper class. - if( userException != null ) { - Class exceptionClass = userException.getClass(); - String className = exceptionClass.getName(); - String helperClassName = className + "Helper"; - Class helperClass = - SharedSecrets.getJavaCorbaAccess().loadClass( helperClassName ); - - // Find insert( Any, class ) method - Class[] insertMethodParams = new Class[2]; - insertMethodParams[0] = org.omg.CORBA.Any.class; - insertMethodParams[1] = exceptionClass; - Method insertMethod = helperClass.getMethod( - "insert", insertMethodParams ); - - // Call helper.insert( result, userException ): - java.lang.Object[] insertMethodArguments = - new java.lang.Object[2]; - insertMethodArguments[0] = result; - insertMethodArguments[1] = userException; - insertMethod.invoke( null, insertMethodArguments ); - } - } catch( ClassNotFoundException e ) { - throw stdWrapper.unknownUserException( CompletionStatus.COMPLETED_MAYBE, e ); - } catch( NoSuchMethodException e ) { - throw stdWrapper.unknownUserException( CompletionStatus.COMPLETED_MAYBE, e ); - } catch( SecurityException e ) { - throw stdWrapper.unknownUserException( CompletionStatus.COMPLETED_MAYBE, e ); - } catch( IllegalAccessException e ) { - throw stdWrapper.unknownUserException( CompletionStatus.COMPLETED_MAYBE, e ); - } catch( IllegalArgumentException e ) { - throw stdWrapper.unknownUserException( CompletionStatus.COMPLETED_MAYBE, e ); - } catch( InvocationTargetException e ) { - throw stdWrapper.unknownUserException( CompletionStatus.COMPLETED_MAYBE, e ); - } - } - - /* - ********************************************************************** - * Protected utility methods - **********************************************************************/ - - /** - * Internal utility method to convert an NVList into a PI Parameter[] - */ - protected Parameter[] nvListToParameterArray( NVList parNVList ) { - - // _REVISIT_ This utility method should probably be doing a deep - // copy so interceptor can't accidentally change the arguments. - - int count = parNVList.count(); - Parameter[] plist = new Parameter[count]; - try { - for( int i = 0; i < count; i++ ) { - Parameter p = new Parameter(); - plist[i] = p; - NamedValue nv = parNVList.item( i ); - plist[i].argument = nv.value(); - // ParameterMode spec can be found in 99-10-07.pdf - // Section:10.5.22 - // nv.flags spec can be found in 99-10-07.pdf - // Section 7.1.1 - // nv.flags has ARG_IN as 1, ARG_OUT as 2 and ARG_INOUT as 3 - // To convert this into enum PARAM_IN, PARAM_OUT and - // PARAM_INOUT the value is subtracted by 1. - plist[i].mode = ParameterMode.from_int( nv.flags() - 1 ); - } - } catch ( Exception e ) { - throw wrapper.exceptionInArguments( e ) ; - } - - return plist; - } - - /** - * Utility to wrap the given Exception in an Any object and return it. - * If the exception is a UserException which cannot be inserted into - * an any, then this returns an Any containing the system exception - * UNKNOWN. - */ - protected Any exceptionToAny( Exception exception ){ - Any result = myORB.create_any(); - - if( exception == null ) { - // Note: exception should never be null here since we will throw - // a BAD_INV_ORDER if this is not called from receive_exception. - throw wrapper.exceptionWasNull2() ; - } else if( exception instanceof SystemException ) { - ORBUtility.insertSystemException( - (SystemException)exception, result ); - } else if( exception instanceof ApplicationException ) { - // Use the Helper class for this exception to insert it into an - // Any. - try { - // Insert the user exception inside the application exception - // into the Any result: - ApplicationException appException = - (ApplicationException)exception; - insertApplicationException( appException, result ); - } catch( UNKNOWN e ) { - // As per ptc/00-08-06, 21.3.13.4. if we cannot find the - // appropriate class, then return an any containing UNKNOWN, - // with a minor code of 1. This is conveniently the same - // exception that is returned from the - // insertApplicationException utility method. - ORBUtility.insertSystemException( e, result ); - } - } else if( exception instanceof UserException ) { - try { - UserException userException = (UserException)exception; - insertUserException( userException, result ); - } catch( UNKNOWN e ) { - ORBUtility.insertSystemException( e, result ); - } - } - - - return result; - } - - /** - * Utility method to look up a service context with the given id and - * convert it to an IOP.ServiceContext. Uses the given HashMap as - * a cache. If not found in cache, the result is inserted in the cache. - */ - protected org.omg.IOP.ServiceContext - getServiceContext ( HashMap cachedServiceContexts, - ServiceContexts serviceContexts, int id ) - { - org.omg.IOP.ServiceContext result = null; - Integer integerId = new Integer( id ); - - // Search cache first: - result = (org.omg.IOP.ServiceContext) - cachedServiceContexts.get( integerId ); - - // null could normally mean that either we cached the value null - // or it's not in the cache. However, there is no way for us to - // cache the value null in the following code. - if( result == null ) { - // Not in cache. Find it and put in cache. - // Get the desired "core" service context. - com.sun.corba.se.spi.servicecontext.ServiceContext context = - serviceContexts.get( id ); - if (context == null) - throw stdWrapper.invalidServiceContextId() ; - - // Convert the "core" service context to an - // "IOP" ServiceContext by writing it to a - // CDROutputStream and reading it back. - EncapsOutputStream out = - sun.corba.OutputStreamFactory.newEncapsOutputStream(myORB); - - context.write( out, GIOPVersion.V1_2 ); - InputStream inputStream = out.create_input_stream(); - result = ServiceContextHelper.read( inputStream ); - - cachedServiceContexts.put( integerId, result ); - } - - // Good citizen: For increased efficiency, we assume that interceptors - // will not modify the returned ServiceContext. Otherwise, we would - // have to make a deep copy. - - return result; - } - - - /** - * Utility method to add an IOP.ServiceContext to a core.ServiceContexts - * object. If replace is true, any service context with the given id - * is replaced. - *

            - * Raises BAD_INV_ORDER if replace is false and a service context with - * the given id already exists. - *

            - * Uses the given HashMap as a cache. If a service context is placed - * in the container, it goes in the HashMap as well. - */ - protected void addServiceContext( - HashMap cachedServiceContexts, - ServiceContexts serviceContexts, - org.omg.IOP.ServiceContext service_context, - boolean replace ) - { - int id = 0 ; - // Convert IOP.service_context to core.ServiceContext: - EncapsOutputStream outputStream = - sun.corba.OutputStreamFactory.newEncapsOutputStream(myORB); - InputStream inputStream = null; - UnknownServiceContext coreServiceContext = null; - ServiceContextHelper.write( outputStream, service_context ); - inputStream = outputStream.create_input_stream(); - - // Constructor expects id to already have been read from stream. - coreServiceContext = new UnknownServiceContext( - inputStream.read_long(), - (org.omg.CORBA_2_3.portable.InputStream)inputStream ); - - id = coreServiceContext.getId(); - - if (serviceContexts.get(id) != null) - if (replace) - serviceContexts.delete( id ); - else - throw stdWrapper.serviceContextAddFailed( new Integer(id) ) ; - - serviceContexts.put( coreServiceContext ); - - // Place IOP.ServiceContext in cache as well: - cachedServiceContexts.put( new Integer( id ), service_context ); - } - - /** - * Sets the number of interceptors whose starting interception - * points were successfully invoked on this client call. As specified - * in orbos/99-12-02, section 5.2.1., not all interceptors will - * be invoked if a ForwardRequest exception or a system exception - * is raised. This keeps track of how many were successfully executed - * so we know not to execute the corresponding ending interception - * points for the interceptors whose starting interception points - * were not completed. This simulates the "Flow Stack Visual Model" - * presented in section 5.1.3.*/ - protected void setFlowStackIndex(int num ) { - this.flowStackIndex = num; - } - - /** - * Returns the number of interceptors whose starting interception - * points were actually invoked on this client request. See - * setFlowStackIndex for more details. - */ - protected int getFlowStackIndex() { - return this.flowStackIndex; - } - - /** - * Sets which ending interception point should be called - * for each interceptor in the virtual flow stack. - */ - protected void setEndingPointCall( int call ) { - this.endingPointCall = call; - } - - /** - * Retrieves the current ending point call type (see - * setEndingPointCall for more details). - */ - protected int getEndingPointCall() { - return this.endingPointCall; - } - - /** - * Sets which intermediate interception point should be called - * for each interceptor in the virtual flow stack. - */ - protected void setIntermediatePointCall( int call ) { - this.intermediatePointCall = call; - } - - /** - * Retrieves the current intermediate point call type (see - * setEndingPointCall for more details). - */ - protected int getIntermediatePointCall() { - return this.intermediatePointCall; - } - - /** - * Sets which starting interception point should be called - * for each interceptor in the virtual flow stack. - */ - protected void setStartingPointCall( int call ) { - this.startingPointCall = call; - } - - /** - * Retrieves the current starting point call type (see - * setStartingPointCall for more details). - */ - protected int getStartingPointCall() { - return this.startingPointCall; - } - - /** - * Returns true if all interceptors' starting and ending points - * have already executed to completion, or false if not yet. - */ - protected boolean getAlreadyExecuted() { - return this.alreadyExecuted; - } - - /** - * Sets whether all interceotrs' starting and ending points - * have already been executed to completion. - */ - protected void setAlreadyExecuted( boolean alreadyExecuted ) { - this.alreadyExecuted = alreadyExecuted; - } - - /** - * Sets the value to be returned by reply_status - */ - protected void setReplyStatus( short replyStatus ) { - this.replyStatus = replyStatus; - } - - /** - * Gets the current reply_status without doing an access check - * (available only to package and subclasses) - */ - protected short getReplyStatus() { - return this.replyStatus; - } - - /** - * Stores the given ForwardRequest object for later analysis. - * This version supplements setForwardRequest( IOR ); - */ - protected void setForwardRequest( ForwardRequest forwardRequest ) { - this.forwardRequest = forwardRequest; - this.forwardRequestIOR = null; - } - - /** - * Stores the given IOR for later forward request analysis. - * This version supplements setForwardRequest( ForwardRequest ); - */ - protected void setForwardRequest( IOR ior ) { - this.forwardRequestIOR = ior; - this.forwardRequest = null; - } - - /** - * Retrieves the ForwardRequest object as a ForwardRequest exception. - */ - protected ForwardRequest getForwardRequestException() { - if( this.forwardRequest == null ) { - if( this.forwardRequestIOR != null ) { - // Convert the internal IOR to a forward request exception - // by creating an object reference. - org.omg.CORBA.Object obj = iorToObject(this.forwardRequestIOR); - this.forwardRequest = new ForwardRequest( obj ); - } - } - - return this.forwardRequest; - } - - /** - * Retrieves the IOR of the ForwardRequest exception. - */ - protected IOR getForwardRequestIOR() { - if( this.forwardRequestIOR == null ) { - if( this.forwardRequest != null ) { - this.forwardRequestIOR = ORBUtility.getIOR( - this.forwardRequest.forward ) ; - } - } - - return this.forwardRequestIOR; - } - - /** - * Sets the exception to be returned by received_exception and - * received_exception_id. - */ - protected void setException( Exception exception ) { - this.exception = exception; - } - - /** - * Returns the exception to be returned by received_exception and - * received_exception_id. - */ - Exception getException() { - return this.exception; - } - - /** - * Sets the execution point that we are currently executing - * (starting points, intermediate points, or ending points). - * This allows us to enforce the validity table. - */ - protected void setCurrentExecutionPoint( int executionPoint ) { - this.currentExecutionPoint = executionPoint; - } - - /** - * Check whether the caller is allowed to access this method at - * this particular time. This is overridden in subclasses to implement - * the validity table specified in ptc/00-04-05, table 21-1 and 21-2. - * The currentExecutionPoint attribute is checked, and if access is - * forbidden at this time, BAD_INV_ORDER is raised with a minor code of - * TBD_BIO. - * - * @param methodID The ID of this method, one of the MID_* constants. - * This allows us to easily look up the method access in a table. - * Note that method ids may overlap between subclasses. - */ - protected abstract void checkAccess( int methodID ) - throws BAD_INV_ORDER; - - /** - * The server side does an explicit set rather than taking the - * current PICurrent table as is done in the general RequestInfoImpl - * constructor. - */ - void setSlotTable(SlotTable slotTable) - { - this.slotTable = slotTable; - } - - protected org.omg.CORBA.Object iorToObject( IOR ior ) - { - return ORBUtility.makeObjectReference( ior ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/ServerRequestInfoImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/ServerRequestInfoImpl.java deleted file mode 100644 index ecea44c521b..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/ServerRequestInfoImpl.java +++ /dev/null @@ -1,907 +0,0 @@ -/* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.interceptors; - -import org.omg.CORBA.Any; -import org.omg.CORBA.BAD_INV_ORDER; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.LocalObject; -import org.omg.CORBA.NO_IMPLEMENT; -import org.omg.CORBA.NO_RESOURCES; -import org.omg.CORBA.NVList; -import org.omg.CORBA.Object; -import org.omg.CORBA.Policy; -import org.omg.CORBA.TypeCode; - -import org.omg.PortableServer.Servant; - -import org.omg.IOP.TaggedProfile; -import org.omg.IOP.ServiceContext; - -import org.omg.Dynamic.Parameter; - -import org.omg.PortableInterceptor.InvalidSlot; -import org.omg.PortableInterceptor.ServerRequestInfo; -import org.omg.PortableInterceptor.LOCATION_FORWARD; -import org.omg.PortableInterceptor.SUCCESSFUL; -import org.omg.PortableInterceptor.SYSTEM_EXCEPTION; -import org.omg.PortableInterceptor.TRANSPORT_RETRY; -import org.omg.PortableInterceptor.USER_EXCEPTION; - -import com.sun.corba.se.spi.oa.ObjectAdapter; -import com.sun.corba.se.spi.presentation.rmi.StubAdapter; - -import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage; - -import com.sun.corba.se.spi.servicecontext.ServiceContexts; -import com.sun.corba.se.spi.orb.ORB; - -import com.sun.corba.se.spi.ior.ObjectKeyTemplate; -import com.sun.corba.se.spi.ior.ObjectAdapterId ; - -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; - -import java.util.*; - -/** - * Implementation of the ServerRequestInfo interface as specified in - * orbos/99-12-02 section 5.4.3. - */ -public final class ServerRequestInfoImpl - extends RequestInfoImpl - implements ServerRequestInfo -{ - // The available constants for startingPointCall - static final int CALL_RECEIVE_REQUEST_SERVICE_CONTEXT = 0; - - // The available constants for intermediatePointCall. The default (0) - // is receive_request, but can be set to none on demand. - static final int CALL_RECEIVE_REQUEST = 0; - static final int CALL_INTERMEDIATE_NONE = 1; - - // The available constants for endingPointCall - static final int CALL_SEND_REPLY = 0; - static final int CALL_SEND_EXCEPTION = 1; - static final int CALL_SEND_OTHER = 2; - - ////////////////////////////////////////////////////////////////////// - // - // NOTE: IF AN ATTRIBUTE IS ADDED, PLEASE UPDATE RESET(); - // - ////////////////////////////////////////////////////////////////////// - - // Set to true if the server ending point raised ForwardRequest at some - // point in the ending point. - private boolean forwardRequestRaisedInEnding; - - // Sources of server request information: - private CorbaMessageMediator request; - private java.lang.Object servant; - private byte[] objectId; - private ObjectKeyTemplate oktemp ; - - // Information cached from calls to oktemp - private byte[] adapterId; - private String[] adapterName; - - private ArrayList addReplyServiceContextQueue; - private ReplyMessage replyMessage; - private String targetMostDerivedInterface; - private NVList dsiArguments; - private Any dsiResult; - private Any dsiException; - private boolean isDynamic; - private ObjectAdapter objectAdapter; - private int serverRequestId; - - // Cached information: - private Parameter[] cachedArguments; - private Any cachedSendingException; - // key = Integer, value = IOP.ServiceContext. - private HashMap cachedRequestServiceContexts; - // key = Integer, value = IOP.ServiceContext. - private HashMap cachedReplyServiceContexts; - - ////////////////////////////////////////////////////////////////////// - // - // NOTE: IF AN ATTRIBUTE IS ADDED, PLEASE UPDATE RESET(); - // - ////////////////////////////////////////////////////////////////////// - - - /** - * Reset the info object so that it can be reused for a retry, - * for example. - */ - void reset() { - super.reset(); - - // Please keep these in the same order as declared above. - - forwardRequestRaisedInEnding = false; - - request = null; - servant = null; - objectId = null; - oktemp = null; - - adapterId = null; - adapterName = null; - - addReplyServiceContextQueue = null; - replyMessage = null; - targetMostDerivedInterface = null; - dsiArguments = null; - dsiResult = null; - dsiException = null; - isDynamic = false; - objectAdapter = null; - serverRequestId = myORB.getPIHandler().allocateServerRequestId(); - - // reset cached attributes: - cachedArguments = null; - cachedSendingException = null; - cachedRequestServiceContexts = null; - cachedReplyServiceContexts = null; - - startingPointCall = CALL_RECEIVE_REQUEST_SERVICE_CONTEXT; - intermediatePointCall = CALL_RECEIVE_REQUEST; - endingPointCall = CALL_SEND_REPLY; - } - - /* - ********************************************************************** - * Access protection - **********************************************************************/ - - // Method IDs for all methods in ServerRequestInfo. This allows for a - // convenient O(1) lookup for checkAccess(). - protected static final int MID_SENDING_EXCEPTION = MID_RI_LAST + 1; - protected static final int MID_OBJECT_ID = MID_RI_LAST + 2; - protected static final int MID_ADAPTER_ID = MID_RI_LAST + 3; - protected static final int MID_TARGET_MOST_DERIVED_INTERFACE - = MID_RI_LAST + 4; - protected static final int MID_GET_SERVER_POLICY = MID_RI_LAST + 5; - protected static final int MID_SET_SLOT = MID_RI_LAST + 6; - protected static final int MID_TARGET_IS_A = MID_RI_LAST + 7; - protected static final int MID_ADD_REPLY_SERVICE_CONTEXT - = MID_RI_LAST + 8; - protected static final int MID_SERVER_ID = MID_RI_LAST + 9; - protected static final int MID_ORB_ID = MID_RI_LAST + 10; - protected static final int MID_ADAPTER_NAME = MID_RI_LAST + 11; - - // ServerRequestInfo validity table (see ptc/00-08-06 table 21-2). - // Note: These must be in the same order as specified in contants. - private static final boolean validCall[][] = { - // LEGEND: - // r_rsc = receive_request_service_contexts - // r_req = receive_request - // s_rep = send_reply - // s_exc = send_exception - // s_oth = send_other - // - // A true value indicates call is valid at specified point. - // A false value indicates the call is invalid. - // - // NOTE: If the order or number of columns change, update - // checkAccess() accordingly. - // - // { r_rsc, r_req, s_rep, s_exc, s_oth } - // RequestInfo methods: - /*request_id*/ { true , true , true , true , true }, - /*operation*/ { true , true , true , true , true }, - /*arguments*/ { false, true , true , false, false }, - /*exceptions*/ { false, true , true , true , true }, - /*contexts*/ { false, true , true , true , true }, - /*operation_context*/ { false, true , true , false, false }, - /*result*/ { false, false, true , false, false }, - /*response_expected*/ { true , true , true , true , true }, - /*sync_scope*/ { true , true , true , true , true }, - /*reply_status*/ { false, false, true , true , true }, - /*forward_reference*/ { false, false, false, false, true }, - /*get_slot*/ { true , true , true , true , true }, - /*get_request_service_context*/ { true , true , true , true , true }, - /*get_reply_service_context*/ { false, false, true , true , true }, - // - // ServerRequestInfo methods:: - /*sending_exception*/ { false, false, false, true , false }, - /*object_id*/ { false, true , true , true , true }, - /*adapter_id*/ { false, true , true , true , true }, - /*target_most_derived_inte...*/ { false, true , false, false, false }, - /*get_server_policy*/ { true , true , true , true , true }, - /*set_slot*/ { true , true , true , true , true }, - /*target_is_a*/ { false, true , false, false, false }, - /*add_reply_service_context*/ { true , true , true , true , true }, - /*orb_id*/ { false, true , true , true , true }, - /*server_id*/ { false, true , true , true , true }, - /*adapter_name*/ { false, true , true , true , true } - }; - - /* - ********************************************************************** - * Public interfaces - **********************************************************************/ - - /** - * Creates a new ServerRequestInfo implementation. - * The constructor is package scope since no other package need create - * an instance of this class. - */ - ServerRequestInfoImpl( ORB myORB ) { - super( myORB ); - startingPointCall = CALL_RECEIVE_REQUEST_SERVICE_CONTEXT; - intermediatePointCall = CALL_RECEIVE_REQUEST; - endingPointCall = CALL_SEND_REPLY; - serverRequestId = myORB.getPIHandler().allocateServerRequestId(); - } - - /** - * Any containing the exception to be returned to the client. - */ - public Any sending_exception () { - checkAccess( MID_SENDING_EXCEPTION ); - - if( cachedSendingException == null ) { - Any result = null ; - - if( dsiException != null ) { - result = dsiException; - } else if( exception != null ) { - result = exceptionToAny( exception ); - } else { - // sending_exception should not be callable if both dsiException - // and exception are null. - throw wrapper.exceptionUnavailable() ; - } - - cachedSendingException = result; - } - - return cachedSendingException; - } - - /** - * The opaque object_id describing the target of the operation invocation. - */ - public byte[] object_id () { - checkAccess( MID_OBJECT_ID ); - - if( objectId == null ) { - // For some reason, we never set object id. This could be - // because a servant locator caused a location forward or - // raised an exception. As per ptc/00-08-06, section 21.3.14, - // we throw NO_RESOURCES - throw stdWrapper.piOperationNotSupported6() ; - } - - // Good citizen: In the interest of efficiency, we will assume - // interceptors will not change the resulting byte[] array. - // Otherwise, we would need to make a clone of this array. - - return objectId; - } - - private void checkForNullTemplate() - { - if (oktemp == null) { - // For some reason, we never set the ObjectKeyTemplate - // because a servant locator caused a location forward or - // raised an exception. As per ptc/00-08-06, section 21.3.14, - // we throw NO_RESOURCES - throw stdWrapper.piOperationNotSupported7() ; - } - } - - public String server_id() - { - checkAccess( MID_SERVER_ID ) ; - checkForNullTemplate() ; - - // Good citizen: In the interest of efficiency, we will assume - // interceptors will not change the resulting byte[] array. - // Otherwise, we would need to make a clone of this array. - - return Integer.toString( oktemp.getServerId() ) ; - } - - public String orb_id() - { - checkAccess( MID_ORB_ID ) ; - - return myORB.getORBData().getORBId() ; - } - - synchronized public String[] adapter_name() - { - checkAccess( MID_ADAPTER_NAME ) ; - - if (adapterName == null) { - checkForNullTemplate() ; - - ObjectAdapterId oaid = oktemp.getObjectAdapterId() ; - adapterName = oaid.getAdapterName() ; - } - - return adapterName ; - } - - /** - * The opaque identifier for the object adapter. - */ - synchronized public byte[] adapter_id () - { - checkAccess( MID_ADAPTER_ID ); - - if( adapterId == null ) { - checkForNullTemplate() ; - adapterId = oktemp.getAdapterId() ; - } - - return adapterId; - } - - /** - * The RepositoryID for the most derived interface of the servant. - */ - public String target_most_derived_interface () { - checkAccess( MID_TARGET_MOST_DERIVED_INTERFACE ); - return targetMostDerivedInterface; - } - - /** - * Returns the policy in effect for this operation for the given policy - * type. - */ - public Policy get_server_policy (int type) { - // access is currently valid for all states: - //checkAccess( MID_GET_SERVER_POLICY ); - - Policy result = null; - - if( objectAdapter != null ) { - result = objectAdapter.getEffectivePolicy( type ); - } - - // _REVISIT_ RTF Issue: get_server_policy spec not in sync with - // get_effective_policy spec. - - return result; - } - - /** - * Allows an Interceptor to set a slot in the Current that is in the scope - * of the request. If data already exists in that slot, it will be - * overwritten. If the ID does not define an allocated slot, InvalidSlot - * is raised. - */ - public void set_slot (int id, Any data) throws InvalidSlot { - // access is currently valid for all states: - //checkAccess( MID_SET_SLOT ); - - slotTable.set_slot( id, data ); - } - - /** - * Returns true if the servant is the given RepositoryId, false if it is - * not. - */ - public boolean target_is_a (String id) { - checkAccess( MID_TARGET_IS_A ); - - boolean result = false ; - if( servant instanceof Servant ) { - result = ((Servant)servant)._is_a( id ); - } else if (StubAdapter.isStub( servant )) { - result = ((org.omg.CORBA.Object)servant)._is_a( id ); - } else { - throw wrapper.servantInvalid() ; - } - - return result; - } - - /** - * Allows Interceptors to add service contexts to the request. - */ - public void add_reply_service_context ( ServiceContext service_context, - boolean replace ) - { - // access is currently valid for all states: - //checkAccess( MID_ADD_REPLY_SERVICE_CONTEXT ); - - if( currentExecutionPoint == EXECUTION_POINT_ENDING ) { - ServiceContexts scs = replyMessage.getServiceContexts(); - - // May be null. If this is null, create a new one in its place. - if( scs == null ) { - scs = new ServiceContexts( myORB ); - replyMessage.setServiceContexts( scs ); - } - - if( cachedReplyServiceContexts == null ) { - cachedReplyServiceContexts = new HashMap(); - } - - // This is during and ending point, so we now have enough - // information to add the reply service context. - addServiceContext( cachedReplyServiceContexts, scs, - service_context, replace ); - } - - // We enqueue all adds for the following reasons: - // - // If we are not in the ending point then we do not yet have a - // pointer to the ServiceContexts object so we cannot access the - // service contexts until we get to the ending point. - // So we enqueue this add reply service context request. - // It is added when we do have a handle on the service contexts object. - // - // If we are in the ending point and we just add directly to the - // SC container but then an interceptor raises a SystemException - // then that add will be lost since a new container is created - // for the SystemException response. - // - // Therefore we always enqueue and never dequeue (per request) so - // that all adds will be completed. - - AddReplyServiceContextCommand addReply = - new AddReplyServiceContextCommand(); - addReply.service_context = service_context; - addReply.replace = replace; - - if( addReplyServiceContextQueue == null ) { - addReplyServiceContextQueue = new ArrayList(); - } - - // REVISIT: this does not add to the cache. - enqueue( addReply ); - } - - // NOTE: When adding a method, be sure to: - // 1. Add a MID_* constant for that method - // 2. Call checkAccess at the start of the method - // 3. Define entries in the validCall[][] table for interception points. - - /* - ********************************************************************** - * Public RequestInfo interfaces - * - * These are implemented here because they have differing - * implementations depending on whether this is a client or a server - * request info object. - **********************************************************************/ - - /** - * See ServerRequestInfo for javadocs. - */ - public int request_id (){ - // access is currently valid for all states: - //checkAccess( MID_REQUEST_ID ); - /* - * NOTE: The request id in server interceptors is NOT the - * same as the GIOP request id. The ORB may be servicing several - * connections, each with possibly overlapping sets of request ids. - * Therefore we create a request id specific to interceptors. - */ - return serverRequestId; - } - - /** - * See ServerRequestInfo for javadocs. - */ - public String operation (){ - // access is currently valid for all states: - //checkAccess( MID_OPERATION ); - return request.getOperationName(); - } - - /** - * See ServerRequestInfo for javadocs. - */ - public Parameter[] arguments (){ - checkAccess( MID_ARGUMENTS ); - - if( cachedArguments == null ) { - if( !isDynamic ) { - throw stdWrapper.piOperationNotSupported1() ; - } - - if( dsiArguments == null ) { - throw stdWrapper.piOperationNotSupported8() ; - } - - // If it is a DSI request then get the arguments from the DSI req - // and convert that into parameters. - cachedArguments = nvListToParameterArray( dsiArguments ); - } - - // Good citizen: In the interest of efficiency, we assume - // interceptors will be "good citizens" in that they will not - // modify the contents of the Parameter[] array. We also assume - // they will not change the values of the containing Anys. - - return cachedArguments; - } - - /** - * See ServerRequestInfo for javadocs. - */ - public TypeCode[] exceptions (){ - checkAccess( MID_EXCEPTIONS ); - - // _REVISIT_ PI RTF Issue: No exception list on server side. - - throw stdWrapper.piOperationNotSupported2() ; - } - - /** - * See ServerRequestInfo for javadocs. - */ - public String[] contexts (){ - checkAccess( MID_CONTEXTS ); - - // We do not support this because our ORB does not send contexts. - - throw stdWrapper.piOperationNotSupported3() ; - } - - /** - * See ServerRequestInfo for javadocs. - */ - public String[] operation_context (){ - checkAccess( MID_OPERATION_CONTEXT ); - - // We do not support this because our ORB does not send - // operation_context. - - throw stdWrapper.piOperationNotSupported4() ; - } - - /** - * See ServerRequestInfo for javadocs. - */ - public Any result (){ - checkAccess( MID_RESULT ); - - if( !isDynamic ) { - throw stdWrapper.piOperationNotSupported5() ; - } - - if( dsiResult == null ) { - throw wrapper.piDsiResultIsNull() ; - } - - // Good citizen: In the interest of efficiency, we assume that - // interceptors will not modify the contents of the result Any. - // Otherwise, we would need to create a deep copy of the Any. - - return dsiResult; - } - - /** - * See ServerRequestInfo for javadocs. - */ - public boolean response_expected (){ - // access is currently valid for all states: - //checkAccess( MID_RESPONSE_EXPECTED ); - return !request.isOneWay(); - } - - /** - * See ServerRequestInfo for javadocs. - */ - public Object forward_reference (){ - checkAccess( MID_FORWARD_REFERENCE ); - // Check to make sure we are in LOCATION_FORWARD - // state as per ptc/00-08-06, table 21-2 - // footnote 2. - if( replyStatus != LOCATION_FORWARD.value ) { - throw stdWrapper.invalidPiCall1() ; - } - - return getForwardRequestException().forward; - } - - /** - * See ServerRequestInfo for javadocs. - */ - public org.omg.IOP.ServiceContext get_request_service_context( int id ) { - checkAccess( MID_GET_REQUEST_SERVICE_CONTEXT ); - - if( cachedRequestServiceContexts == null ) { - cachedRequestServiceContexts = new HashMap(); - } - - return getServiceContext( cachedRequestServiceContexts, - request.getRequestServiceContexts(), id ); - } - - /** - * See ServerRequestInfo for javadocs. - */ - public org.omg.IOP.ServiceContext get_reply_service_context( int id ) { - checkAccess( MID_GET_REPLY_SERVICE_CONTEXT ); - - if( cachedReplyServiceContexts == null ) { - cachedReplyServiceContexts = new HashMap(); - } - - return getServiceContext( cachedReplyServiceContexts, - replyMessage.getServiceContexts(), id ); - } - - /* - ********************************************************************** - * Private-scope classes and methods - **********************************************************************/ - - // A command encapsulating a request to add a reply service context. - // These commands are enqueued until we have a handle on the actual - // reply service context, at which point they are executed. - private class AddReplyServiceContextCommand { - ServiceContext service_context; - boolean replace; - } - - // Adds the given add reply service context command to the queue of - // such commands. If a command is detected to have the same id as - // the service context in this command, and replace is false, - // BAD_INV_ORDER is thrown. If replace is true, the original command - // in the queue is replaced by this command. - private void enqueue( AddReplyServiceContextCommand addReply ) { - int size = addReplyServiceContextQueue.size(); - boolean found = false; - - for( int i = 0; i < size; i++ ) { - AddReplyServiceContextCommand cmd = - (AddReplyServiceContextCommand) - addReplyServiceContextQueue.get( i ); - - if( cmd.service_context.context_id == - addReply.service_context.context_id ) - { - found = true; - if( addReply.replace ) { - addReplyServiceContextQueue.set( i, addReply ); - } else { - throw stdWrapper.serviceContextAddFailed( - new Integer( cmd.service_context.context_id ) ) ; - } - break; - } - } - - if( !found ) { - addReplyServiceContextQueue.add( addReply ); - } - } - - /* - ********************************************************************** - * Package and protected-scope methods - **********************************************************************/ - - /** - * Overridden from RequestInfoImpl. This version calls the super - * and then, if we are changing to ending points, executes all - * enqueued AddReplyServiceContextCommands. - */ - protected void setCurrentExecutionPoint( int executionPoint ) { - super.setCurrentExecutionPoint( executionPoint ); - - // If we are transitioning to ending point, we will now have a pointer - // to the reply service contexts, so we can execute all queued - // add reply service context requests. - if( (executionPoint == EXECUTION_POINT_ENDING) && - (addReplyServiceContextQueue != null) ) - { - int size = addReplyServiceContextQueue.size(); - for( int i = 0; i < size; i++ ) { - AddReplyServiceContextCommand addReply = - (AddReplyServiceContextCommand) - addReplyServiceContextQueue.get( i ); - try { - add_reply_service_context( addReply.service_context, - addReply.replace ); - } - catch( BAD_INV_ORDER e ) { - // _REVISIT_ The only way this can happen is if during - // rrsc or rr, the interceptor tried to add with - // replace=false to a service context that is present in - // the reply message. At that time there was no way for - // us to check for this, so the best we can do is ignore - // the original request. - } - } - - // We specifically do not empty the SC queue so that if - // the interceptor raises an exception the queued service contexts - // will be put in the exception response. - } - } - - /** - * Stores the various sources of information used for this info object. - */ - protected void setInfo( CorbaMessageMediator request, ObjectAdapter oa, - byte[] objectId, ObjectKeyTemplate oktemp ) - { - this.request = request; - this.objectId = objectId; - this.oktemp = oktemp; - this.objectAdapter = oa ; - this.connection = (com.sun.corba.se.spi.legacy.connection.Connection) - request.getConnection(); - } - - /** - * Stores the various sources of information used for this info object. - */ - protected void setDSIArguments( NVList arguments ) { - this.dsiArguments = arguments; - } - - /** - * Stores the various sources of information used for this info object. - */ - protected void setDSIException( Any exception ) { - this.dsiException = exception; - - // Clear cached exception value: - cachedSendingException = null; - } - - /** - * Stores the various sources of information used for this info object. - */ - protected void setDSIResult( Any result ) { - this.dsiResult = result; - } - - /** - * Sets the exception to be returned by received_exception and - * received_exception_id. - */ - protected void setException( Exception exception ) { - super.setException( exception ); - - // Make sure DSIException is null because this is the more recent one. - this.dsiException = null; - - // Clear cached exception value: - cachedSendingException = null; - } - - /** - * Stores the various sources of information used for this info object. - */ - protected void setInfo( java.lang.Object servant, - String targetMostDerivedInterface ) - { - this.servant = servant; - this.targetMostDerivedInterface = targetMostDerivedInterface; - this.isDynamic = - (servant instanceof - org.omg.PortableServer.DynamicImplementation) || - (servant instanceof org.omg.CORBA.DynamicImplementation); - } - - /** - * Set reply message - */ - void setReplyMessage( ReplyMessage replyMessage ) { - this.replyMessage = replyMessage; - } - - /** - * Overridden from RequestInfoImpl. Calls the super class, then - * sets the ending point call depending on the reply status. - */ - protected void setReplyStatus( short replyStatus ) { - super.setReplyStatus( replyStatus ); - switch( replyStatus ) { - case SUCCESSFUL.value: - endingPointCall = CALL_SEND_REPLY; - break; - case SYSTEM_EXCEPTION.value: - case USER_EXCEPTION.value: - endingPointCall = CALL_SEND_EXCEPTION; - break; - case LOCATION_FORWARD.value: - case TRANSPORT_RETRY.value: - endingPointCall = CALL_SEND_OTHER; - break; - } - } - - /** - * Release the servant object so the user has control over its lifetime. - * Called after receive_request is finished executing. - */ - void releaseServant() { - this.servant = null; - } - - /** - * Sets the forwardRequestRaisedInEnding flag to true, indicating that - * a server ending point has raised location forward at some point. - */ - void setForwardRequestRaisedInEnding() { - this.forwardRequestRaisedInEnding = true; - } - - /** - * Returns true if ForwardRequest was raised by a server ending point - * or false otherwise. - */ - boolean isForwardRequestRaisedInEnding() { - return this.forwardRequestRaisedInEnding; - } - - /** - * Returns true if this is a dynamic invocation, or false if not - */ - boolean isDynamic() { - return this.isDynamic; - } - - /** - * See description for RequestInfoImpl.checkAccess - */ - protected void checkAccess( int methodID ) - { - // Make sure currentPoint matches the appropriate index in the - // validCall table: - int validCallIndex = 0; - switch( currentExecutionPoint ) { - case EXECUTION_POINT_STARTING: - validCallIndex = 0; - break; - case EXECUTION_POINT_INTERMEDIATE: - validCallIndex = 1; - break; - case EXECUTION_POINT_ENDING: - switch( endingPointCall ) { - case CALL_SEND_REPLY: - validCallIndex = 2; - break; - case CALL_SEND_EXCEPTION: - validCallIndex = 3; - break; - case CALL_SEND_OTHER: - validCallIndex = 4; - break; - } - break; - } - - // Check the validCall table: - if( !validCall[methodID][validCallIndex] ) { - throw stdWrapper.invalidPiCall2() ; - } - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/SlotTable.java b/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/SlotTable.java deleted file mode 100644 index 93908fd189f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/SlotTable.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.interceptors; - -import com.sun.corba.se.impl.corba.AnyImpl; -import com.sun.corba.se.spi.orb.ORB; -import org.omg.PortableInterceptor.Current; -import org.omg.PortableInterceptor.InvalidSlot; -import org.omg.CORBA.Any; - -/** - * SlotTable is used internally by PICurrent to store the slot information. - */ -public class SlotTable { - // The vector where all the slot data for the current thread is stored - private Any[] theSlotData; - - // Required for instantiating Any object. - private ORB orb; - - // The flag to check whether there are any updates in the current SlotTable. - // The slots will be reset to null, only if this flag is set. - private boolean dirtyFlag; - - /** - * The constructor instantiates an Array of Any[] of size given by slotSize - * parameter. - */ - SlotTable( ORB orb, int slotSize ) { - dirtyFlag = false; - this.orb = orb; - theSlotData = new Any[slotSize]; - } - - /** - * This method sets the slot data at the given slot id (index). - */ - public void set_slot( int id, Any data ) throws InvalidSlot - { - // First check whether the slot is allocated - // If not, raise the invalid slot exception - if( id >= theSlotData.length ) { - throw new InvalidSlot(); - } - dirtyFlag = true; - theSlotData[id] = data; - } - - /** - * This method get the slot data for the given slot id (index). - */ - public Any get_slot( int id ) throws InvalidSlot - { - // First check whether the slot is allocated - // If not, raise the invalid slot exception - if( id >= theSlotData.length ) { - throw new InvalidSlot(); - } - if( theSlotData[id] == null ) { - theSlotData [id] = new AnyImpl(orb); - } - return theSlotData[ id ]; - } - - - /** - * This method resets all the slot data to null if dirtyFlag is set. - */ - void resetSlots( ) { - if( dirtyFlag == true ) { - for( int i = 0; i < theSlotData.length; i++ ) { - theSlotData[i] = null; - } - } - } - - /** - * This method returns the size of the allocated slots. - */ - int getSize( ) { - return theSlotData.length; - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/SlotTableStack.java b/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/SlotTableStack.java deleted file mode 100644 index c19a3843cdd..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/interceptors/SlotTableStack.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.interceptors; - -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.INTERNAL; -import org.omg.PortableInterceptor.Current; -import org.omg.PortableInterceptor.InvalidSlot; - -import com.sun.corba.se.impl.corba.AnyImpl; - -import com.sun.corba.se.impl.logging.InterceptorsSystemException; -import com.sun.corba.se.spi.logging.CORBALogDomains; - -import com.sun.corba.se.spi.orb.ORB; - -/** - * SlotTableStack is the container of SlotTable instances for each thread - */ -public class SlotTableStack -{ - // SlotTablePool is the container for reusable SlotTables' - private class SlotTablePool { - - // Contains a list of reusable SlotTable - private SlotTable[] pool; - - // High water mark for the pool - // If the pool size reaches this limit then putSlotTable will - // not put SlotTable to the pool. - private final int HIGH_WATER_MARK = 5; - - // currentIndex points to the last SlotTable in the list - private int currentIndex; - - SlotTablePool( ) { - pool = new SlotTable[HIGH_WATER_MARK]; - currentIndex = 0; - } - - /** - * Puts SlotTable to the re-usable pool. - */ - void putSlotTable( SlotTable table ) { - // If there are enough SlotTables in the pool, then don't add - // this table to the pool. - if( currentIndex >= HIGH_WATER_MARK ) { - // Let the garbage collector collect it. - return; - } - pool[currentIndex] = table; - currentIndex++; - } - - /** - * Gets SlotTable from the re-usable pool. - */ - SlotTable getSlotTable( ) { - // If there are no entries in the pool then return null - if( currentIndex == 0 ) { - return null; - } - // Works like a stack, Gets the last one added first - currentIndex--; - return pool[currentIndex]; - } - } - - // Contains all the active SlotTables for each thread. - // The List is made to behave like a stack. - private java.util.List tableContainer; - - // Keeps track of number of PICurrents in the stack. - private int currentIndex; - - // For Every Thread there will be a pool of re-usable SlotTables' - // stored in SlotTablePool - private SlotTablePool tablePool; - - // The ORB associated with this slot table stack - private ORB orb; - - private InterceptorsSystemException wrapper ; - - /** - * Constructs the stack and and SlotTablePool - */ - SlotTableStack( ORB orb, SlotTable table ) { - this.orb = orb; - wrapper = InterceptorsSystemException.get( orb, CORBALogDomains.RPC_PROTOCOL ) ; - - currentIndex = 0; - tableContainer = new java.util.ArrayList( ); - tablePool = new SlotTablePool( ); - // SlotTableStack will be created with one SlotTable on the stack. - // This table is used as the reference to query for number of - // allocated slots to create other slottables. - tableContainer.add( currentIndex, table ); - currentIndex++; - } - - - /** - * pushSlotTable pushes a fresh Slot Table on to the stack by doing the - * following, - * 1: Checks to see if there is any SlotTable in SlotTablePool - * If present then use that instance to push into the SlotTableStack - * - * 2: If there is no SlotTable in the pool, then creates a new one and - * pushes that into the SlotTableStack - */ - void pushSlotTable( ) { - SlotTable table = tablePool.getSlotTable( ); - if( table == null ) { - // get an existing PICurrent to get the slotSize - SlotTable tableTemp = peekSlotTable(); - table = new SlotTable( orb, tableTemp.getSize( )); - } - // NOTE: Very important not to always "add" - otherwise a memory leak. - if (currentIndex == tableContainer.size()) { - // Add will cause the table to grow. - tableContainer.add( currentIndex, table ); - } else if (currentIndex > tableContainer.size()) { - throw wrapper.slotTableInvariant( new Integer( currentIndex ), - new Integer( tableContainer.size() ) ) ; - } else { - // Set will override unused slots. - tableContainer.set( currentIndex, table ); - } - currentIndex++; - } - - /** - * popSlotTable does the following - * 1: pops the top SlotTable in the SlotTableStack - * - * 2: resets the slots in the SlotTable which resets the slotvalues to - * null if there are any previous sets. - * - * 3: puts the reset SlotTable into the SlotTablePool to reuse - */ - void popSlotTable( ) { - if( currentIndex <= 1 ) { - // Do not pop the SlotTable, If there is only one. - // This should not happen, But an extra check for safety. - throw wrapper.cantPopOnlyPicurrent() ; - } - currentIndex--; - SlotTable table = (SlotTable)tableContainer.get( currentIndex ); - tableContainer.set( currentIndex, null ); // Do not leak memory. - table.resetSlots( ); - tablePool.putSlotTable( table ); - } - - /** - * peekSlotTable gets the top SlotTable from the SlotTableStack without - * popping. - */ - SlotTable peekSlotTable( ) { - return (SlotTable) tableContainer.get( currentIndex - 1); - } - -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/io/FVDCodeBaseImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/io/FVDCodeBaseImpl.java deleted file mode 100644 index c69fb42421b..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/io/FVDCodeBaseImpl.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.io; - -import org.omg.CORBA.ORB; -import java.util.Properties; -import javax.rmi.CORBA.Util; -import javax.rmi.CORBA.ValueHandler; -import java.util.Hashtable; -import java.util.Stack; - -import com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription; -import com.sun.org.omg.SendingContext._CodeBaseImplBase; -import com.sun.org.omg.SendingContext.CodeBase; -import com.sun.org.omg.SendingContext.CodeBaseHelper; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.ORB; - -import com.sun.corba.se.impl.logging.OMGSystemException; -import com.sun.corba.se.spi.logging.CORBALogDomains; - -/** - * This class acts as the remote interface to receivers wishing to retrieve - * the information of a remote Class. - */ -public class FVDCodeBaseImpl extends _CodeBaseImplBase -{ - // Contains rep. ids as keys to FullValueDescriptions - private static Hashtable fvds = new Hashtable(); - - // Private ORBSingleton used when we need an ORB while not - // having a delegate set. - private transient ORB orb = null; - - private transient OMGSystemException wrapper = OMGSystemException.get( - CORBALogDomains.RPC_ENCODING ) ; - - // backward compatability so that appropriate rep-id calculations - // can take place - // this needs to be transient to prevent serialization during - // marshalling/unmarshalling - private transient ValueHandlerImpl vhandler = null; - - void setValueHandler(ValueHandler vh) - { - vhandler = (com.sun.corba.se.impl.io.ValueHandlerImpl) vh; - } - - // Operation to obtain the IR from the sending context - public com.sun.org.omg.CORBA.Repository get_ir (){ - return null; - } - - // Operations to obtain a URL to the implementation code - public String implementation (String x){ - try{ - // default to using the current ORB version in case the - // vhandler is not set - if (vhandler == null) { - vhandler = ValueHandlerImpl.getInstance(false); - } - - // Util.getCodebase may return null which would - // cause a BAD_PARAM exception. - String result = Util.getCodebase(vhandler.getClassFromType(x)); - if (result == null) - return ""; - else - return result; - } catch(ClassNotFoundException cnfe){ - throw wrapper.missingLocalValueImpl( CompletionStatus.COMPLETED_MAYBE, - cnfe ) ; - } - } - - public String[] implementations (String[] x){ - String result[] = new String[x.length]; - - for (int i = 0; i < x.length; i++) - result[i] = implementation(x[i]); - - return result; - } - - // the same information - public FullValueDescription meta (String x){ - try{ - FullValueDescription result = (FullValueDescription)fvds.get(x); - - if (result == null) { - // default to using the current ORB version in case the - // vhandler is not set - if (vhandler == null) { - vhandler = ValueHandlerImpl.getInstance(false); - } - - try{ - result = ValueUtility.translate(_orb(), - ObjectStreamClass.lookup(vhandler.getAnyClassFromType(x)), vhandler); - } catch(Throwable t){ - if (orb == null) - orb = ORB.init(); //d11638 - result = ValueUtility.translate(orb, - ObjectStreamClass.lookup(vhandler.getAnyClassFromType(x)), vhandler); - } - - if (result != null){ - fvds.put(x, result); - } else { - throw wrapper.missingLocalValueImpl( CompletionStatus.COMPLETED_MAYBE); - } - } - - return result; - } catch(Throwable t){ - throw wrapper.incompatibleValueImpl(CompletionStatus.COMPLETED_MAYBE,t); - } - } - - public FullValueDescription[] metas (String[] x){ - FullValueDescription descriptions[] = new FullValueDescription[x.length]; - - for (int i = 0; i < x.length; i++) - descriptions[i] = meta(x[i]); - - return descriptions; - } - - // information - public String[] bases (String x){ - try { - // default to using the current ORB version in case the - // vhandler is not set - if (vhandler == null) { - vhandler = ValueHandlerImpl.getInstance(false); - } - - Stack repIds = new Stack(); - Class parent = ObjectStreamClass.lookup(vhandler.getClassFromType(x)).forClass().getSuperclass(); - - while (!parent.equals(java.lang.Object.class)) { - repIds.push(vhandler.createForAnyType(parent)); - parent = parent.getSuperclass(); - } - - String result[] = new String[repIds.size()]; - for (int i = result.length - 1; i >= 0; i++) - result[i] = (String)repIds.pop(); - - return result; - } catch (Throwable t) { - throw wrapper.missingLocalValueImpl( CompletionStatus.COMPLETED_MAYBE, t ); - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java b/src/java.corba/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java deleted file mode 100644 index 8993aa51e91..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java +++ /dev/null @@ -1,2810 +0,0 @@ -/* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.io; - -import java.io.IOException; -import java.io.StreamCorruptedException; -import java.io.ObjectInputValidation; -import java.io.NotActiveException; -import java.io.InvalidObjectException; -import java.io.InvalidClassException; -import java.io.OptionalDataException; -import java.io.Externalizable; -import java.io.EOFException; -import java.lang.reflect.*; -import java.util.Vector; -import java.util.Enumeration; - -import sun.corba.Bridge ; - -import java.security.AccessController ; -import java.security.PrivilegedAction ; - -import com.sun.corba.se.impl.util.Utility; - -import org.omg.CORBA.portable.ValueInputStream; - -import org.omg.CORBA.ValueMember; -import org.omg.CORBA.SystemException; -import org.omg.CORBA.TCKind; -import org.omg.CORBA.ORB; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.portable.IndirectionException; -import org.omg.CORBA.MARSHAL; -import org.omg.CORBA.TypeCode; - -import com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription; -import com.sun.org.omg.SendingContext.CodeBase; - -import javax.rmi.CORBA.Util; -import javax.rmi.CORBA.ValueHandler; - -import java.security.*; -import java.util.*; - -import com.sun.corba.se.impl.logging.OMGSystemException ; -import com.sun.corba.se.impl.logging.UtilSystemException ; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; - -/** - * IIOPInputStream is used by the ValueHandlerImpl to handle Java serialization - * input semantics. - * - * @author Stephen Lewallen - * @since JDK1.1.6 - */ - -public class IIOPInputStream - extends com.sun.corba.se.impl.io.InputStreamHook -{ - private static Bridge bridge = - (Bridge)AccessController.doPrivileged( - new PrivilegedAction() { - public Object run() { - return Bridge.get() ; - } - } - ) ; - - private static OMGSystemException omgWrapper = OMGSystemException.get( - CORBALogDomains.RPC_ENCODING ) ; - private static UtilSystemException utilWrapper = UtilSystemException.get( - CORBALogDomains.RPC_ENCODING ) ; - - // Necessary to pass the appropriate fields into the - // defaultReadObjectDelegate method (which takes no - // parameters since it's called from - // java.io.ObjectInpuStream defaultReadObject() - // which we can't change). - // - // This is only used in the case where the fields had - // to be obtained remotely because of a serializable - // version difference. Set in inputObjectUsingFVD. - // Part of serialization evolution fixes for Ladybird, - // bug 4365188. - private ValueMember defaultReadObjectFVDMembers[] = null; - - private org.omg.CORBA_2_3.portable.InputStream orbStream; - - private CodeBase cbSender; - - private ValueHandlerImpl vhandler; //d4365188 - - private Object currentObject = null; - - private ObjectStreamClass currentClassDesc = null; - - private Class currentClass = null; - - private int recursionDepth = 0; - - private int simpleReadDepth = 0; - - // The ActiveRecursionManager replaces the old RecursionManager which - // used to record how many recursions were made, and resolve them after - // an object was completely deserialized. - // - // That created problems (as in bug 4414154) because when custom - // unmarshaling in readObject, there can be recursive references - // to one of the objects currently being unmarshaled, and the - // passive recursion system failed. - ActiveRecursionManager activeRecursionMgr = new ActiveRecursionManager(); - - private IOException abortIOException = null; - - /* Remember the first exception that stopped this stream. */ - private ClassNotFoundException abortClassNotFoundException = null; - - /* Vector of validation callback objects - * The vector is created as needed. The vector is maintained in - * order of highest (first) priority to lowest - */ - private Vector callbacks; - - // Serialization machinery fields - /* Arrays used to keep track of classes and ObjectStreamClasses - * as they are being merged; used in inputObject. - * spClass is the stack pointer for both. */ - ObjectStreamClass[] classdesc; - Class[] classes; - int spClass; - - private static final String kEmptyStr = ""; - - // TCKind TypeCodes used in FVD inputClassFields - //public static final TypeCode kRemoteTypeCode = new TypeCodeImpl(TCKind._tk_objref); - //public static final TypeCode kValueTypeCode = new TypeCodeImpl(TCKind._tk_value); - // removed TypeCodeImpl dependency - public static final TypeCode kRemoteTypeCode = ORB.init().get_primitive_tc(TCKind.tk_objref); - public static final TypeCode kValueTypeCode = ORB.init().get_primitive_tc(TCKind.tk_value); - - // TESTING CODE - useFVDOnly should be made final before FCS in order to - // optimize out the check. - private static final boolean useFVDOnly = false; - - private byte streamFormatVersion; - - // Return the stream format version currently being used - // to deserialize an object - protected byte getStreamFormatVersion() { - return streamFormatVersion; - } - - // At the beginning of data sent by a writeObject or - // writeExternal method there is a byte telling the - // reader the stream format version. - private void readFormatVersion() throws IOException { - - streamFormatVersion = orbStream.read_octet(); - - if (streamFormatVersion < 1 || - streamFormatVersion > vhandler.getMaximumStreamFormatVersion()) { - SystemException sysex = omgWrapper.unsupportedFormatVersion( - CompletionStatus.COMPLETED_MAYBE); - // XXX I18N? Logging for IOException? - IOException result = new IOException("Unsupported format version: " - + streamFormatVersion); - result.initCause( sysex ) ; - throw result ; - } - - if (streamFormatVersion == 2) { - if (!(orbStream instanceof ValueInputStream)) { - SystemException sysex = omgWrapper.notAValueinputstream( - CompletionStatus.COMPLETED_MAYBE); - // XXX I18N? Logging for IOException? - IOException result = new IOException("Not a ValueInputStream"); - result.initCause( sysex ) ; - throw result; - } - } - } - - public static void setTestFVDFlag(boolean val){ - // useFVDOnly = val; - } - - /** - * Dummy constructor; passes upper stream a dummy stream; - **/ - public IIOPInputStream() - throws java.io.IOException { - super(); - resetStream(); - } - - final void setOrbStream(org.omg.CORBA_2_3.portable.InputStream os) { - orbStream = os; - } - - final org.omg.CORBA_2_3.portable.InputStream getOrbStream() { - return orbStream; - } - - //added setSender and getSender - public final void setSender(CodeBase cb) { - cbSender = cb; - } - - public final CodeBase getSender() { - return cbSender; - } - - // 4365188 this is added to enable backward compatability w/ wrong - // rep-ids - public final void setValueHandler(ValueHandler vh) { - vhandler = (com.sun.corba.se.impl.io.ValueHandlerImpl) vh; - } - - public final ValueHandler getValueHandler() { - return (javax.rmi.CORBA.ValueHandler) vhandler; - } - - final void increaseRecursionDepth(){ - recursionDepth++; - } - - final int decreaseRecursionDepth(){ - return --recursionDepth; - } - - /** - * Override the actions of the final method "readObject()" - * in ObjectInputStream. - * @since JDK1.1.6 - * - * Read an object from the ObjectInputStream. - * The class of the object, the signature of the class, and the values - * of the non-transient and non-static fields of the class and all - * of its supertypes are read. Default deserializing for a class can be - * overriden using the writeObject and readObject methods. - * Objects referenced by this object are read transitively so - * that a complete equivalent graph of objects is reconstructed by readObject.

            - * - * The root object is completly restored when all of its fields - * and the objects it references are completely restored. At this - * point the object validation callbacks are executed in order - * based on their registered priorities. The callbacks are - * registered by objects (in the readObject special methods) - * as they are individually restored. - * - * Exceptions are thrown for problems with the InputStream and for classes - * that should not be deserialized. All exceptions are fatal to the - * InputStream and leave it in an indeterminate state; it is up to the caller - * to ignore or recover the stream state. - * @exception java.lang.ClassNotFoundException Class of a serialized object - * cannot be found. - * @exception InvalidClassException Something is wrong with a class used by - * serialization. - * @exception StreamCorruptedException Control information in the - * stream is inconsistent. - * @exception OptionalDataException Primitive data was found in the - * stream instead of objects. - * @exception IOException Any of the usual Input/Output related exceptions. - * @since JDK1.1 - */ - public final synchronized Object readObjectDelegate() throws IOException - { - try { - - readObjectState.readData(this); - - return orbStream.read_abstract_interface(); - } catch (MARSHAL marshalException) { - handleOptionalDataMarshalException(marshalException, true); - throw marshalException; - } catch(IndirectionException cdrie) - { - // The CDR stream had never seen the given offset before, - // so check the recursion manager (it will throw an - // IOException if it doesn't have a reference, either). - return activeRecursionMgr.getObject(cdrie.offset); - } - } - - final synchronized Object simpleReadObject(Class clz, - String repositoryID, - com.sun.org.omg.SendingContext.CodeBase sender, - int offset) - /* throws OptionalDataException, ClassNotFoundException, IOException */ - { - /* Save the current state and get ready to read an object. */ - Object prevObject = currentObject; - ObjectStreamClass prevClassDesc = currentClassDesc; - Class prevClass = currentClass; - byte oldStreamFormatVersion = streamFormatVersion; - - simpleReadDepth++; // Entering - Object obj = null; - - /* - * Check for reset, handle it before reading an object. - */ - try { - // d4365188: backward compatability - if (vhandler.useFullValueDescription(clz, repositoryID)) { - obj = inputObjectUsingFVD(clz, repositoryID, sender, offset); - } else { - obj = inputObject(clz, repositoryID, sender, offset); - } - - obj = currentClassDesc.readResolve(obj); - } - catch(ClassNotFoundException cnfe) - { - bridge.throwException( cnfe ) ; - return null; - } - catch(IOException ioe) - { - // System.out.println("CLZ = " + clz + "; " + ioe.toString()); - bridge.throwException(ioe) ; - return null; - } - finally { - simpleReadDepth --; - currentObject = prevObject; - currentClassDesc = prevClassDesc; - currentClass = prevClass; - streamFormatVersion = oldStreamFormatVersion; - } - - - /* Check for thrown exceptions and re-throw them, clearing them if - * this is the last recursive call . - */ - IOException exIOE = abortIOException; - if (simpleReadDepth == 0) - abortIOException = null; - if (exIOE != null){ - bridge.throwException( exIOE ) ; - return null; - } - - - ClassNotFoundException exCNF = abortClassNotFoundException; - if (simpleReadDepth == 0) - abortClassNotFoundException = null; - if (exCNF != null) { - bridge.throwException( exCNF ) ; - return null; - } - - return obj; - } - - public final synchronized void simpleSkipObject(String repositoryID, - com.sun.org.omg.SendingContext.CodeBase sender) - /* throws OptionalDataException, ClassNotFoundException, IOException */ - { - - /* Save the current state and get ready to read an object. */ - Object prevObject = currentObject; - ObjectStreamClass prevClassDesc = currentClassDesc; - Class prevClass = currentClass; - byte oldStreamFormatVersion = streamFormatVersion; - - simpleReadDepth++; // Entering - Object obj = null; - - /* - * Check for reset, handle it before reading an object. - */ - try { - skipObjectUsingFVD(repositoryID, sender); - } - catch(ClassNotFoundException cnfe) - { - bridge.throwException( cnfe ) ; - return; - } - catch(IOException ioe) - { - bridge.throwException( ioe ) ; - return; - } - finally { - simpleReadDepth --; - streamFormatVersion = oldStreamFormatVersion; - currentObject = prevObject; - currentClassDesc = prevClassDesc; - currentClass = prevClass; - } - - - /* Check for thrown exceptions and re-throw them, clearing them if - * this is the last recursive call . - */ - IOException exIOE = abortIOException; - if (simpleReadDepth == 0) - abortIOException = null; - if (exIOE != null){ - bridge.throwException( exIOE ) ; - return; - } - - - ClassNotFoundException exCNF = abortClassNotFoundException; - if (simpleReadDepth == 0) - abortClassNotFoundException = null; - if (exCNF != null) { - bridge.throwException( exCNF ) ; - return; - } - - return; - } - ///////////////// - - /** - * This method is called by trusted subclasses of ObjectOutputStream - * that constructed ObjectOutputStream using the - * protected no-arg constructor. The subclass is expected to provide - * an override method with the modifier "final". - * - * @return the Object read from the stream. - * - * @see #ObjectInputStream() - * @see #readObject - * @since JDK 1.2 - */ - protected final Object readObjectOverride() - throws OptionalDataException, ClassNotFoundException, IOException - { - return readObjectDelegate(); - } - - /** - * Override the actions of the final method "defaultReadObject()" - * in ObjectInputStream. - * @since JDK1.1.6 - * - * Read the non-static and non-transient fields of the current class - * from this stream. This may only be called from the readObject method - * of the class being deserialized. It will throw the NotActiveException - * if it is called otherwise. - * - * @exception java.lang.ClassNotFoundException if the class of a serialized - * object could not be found. - * @exception IOException if an I/O error occurs. - * @exception NotActiveException if the stream is not currently reading - * objects. - * @since JDK1.1 - */ - final synchronized void defaultReadObjectDelegate() - /* throws IOException, ClassNotFoundException, NotActiveException */ - { - try { - if (currentObject == null || currentClassDesc == null) - // XXX I18N, logging needed. - throw new NotActiveException("defaultReadObjectDelegate"); - - if (!currentClassDesc.forClass().isAssignableFrom( - currentObject.getClass())) { - throw new IOException("Object Type mismatch"); - } - - // The array will be null unless fields were retrieved - // remotely because of a serializable version difference. - // Bug fix for 4365188. See the definition of - // defaultReadObjectFVDMembers for more information. - if (defaultReadObjectFVDMembers != null && - defaultReadObjectFVDMembers.length > 0) { - - // WARNING: Be very careful! What if some of - // these fields actually have to do this, too? - // This works because the defaultReadObjectFVDMembers - // reference is passed to inputClassFields, but - // there is no guarantee that - // defaultReadObjectFVDMembers will point to the - // same array after calling inputClassFields. - - // Use the remote fields to unmarshal. - inputClassFields(currentObject, - currentClass, - currentClassDesc, - defaultReadObjectFVDMembers, - cbSender); - - } else { - - // Use the local fields to unmarshal. - ObjectStreamField[] fields = - currentClassDesc.getFieldsNoCopy(); - if (fields.length > 0) { - inputClassFields(currentObject, currentClass, fields, cbSender); - } - } - } - catch(NotActiveException nae) - { - bridge.throwException( nae ) ; - } - catch(IOException ioe) - { - bridge.throwException( ioe ) ; - } - catch(ClassNotFoundException cnfe) - { - bridge.throwException( cnfe ) ; - } - - } - - /** - * Override the actions of the final method "enableResolveObject()" - * in ObjectInputStream. - * @since JDK1.1.6 - * - * Enable the stream to allow objects read from the stream to be replaced. - * If the stream is a trusted class it is allowed to enable replacment. - * Trusted classes are those classes with a classLoader equals null.

            - * - * When enabled the resolveObject method is called for every object - * being deserialized. - * - * @exception SecurityException The classloader of this stream object is non-null. - * @since JDK1.1 - */ - public final boolean enableResolveObjectDelegate(boolean enable) - /* throws SecurityException */ - { - return false; - } - - // The following three methods allow the implementing orbStream - // to provide mark/reset behavior as defined in java.io.InputStream. - - public final void mark(int readAheadLimit) { - orbStream.mark(readAheadLimit); - } - - public final boolean markSupported() { - return orbStream.markSupported(); - } - - public final void reset() throws IOException { - try { - orbStream.reset(); - } catch (Error e) { - IOException err = new IOException(e.getMessage()); - err.initCause(e) ; - throw err ; - } - } - - public final int available() throws IOException{ - return 0; // unreliable - } - - public final void close() throws IOException{ - // no op - } - - public final int read() throws IOException{ - try{ - readObjectState.readData(this); - - return (orbStream.read_octet() << 0) & 0x000000FF; - } catch (MARSHAL marshalException) { - if (marshalException.minor - == OMGSystemException.RMIIIOP_OPTIONAL_DATA_INCOMPATIBLE1) { - setState(IN_READ_OBJECT_NO_MORE_OPT_DATA); - return -1; - } - - throw marshalException; - } catch(Error e) { - IOException exc = new IOException(e.getMessage()); - exc.initCause(e) ; - throw exc ; - } - } - - public final int read(byte data[], int offset, int length) throws IOException{ - try{ - readObjectState.readData(this); - - orbStream.read_octet_array(data, offset, length); - return length; - } catch (MARSHAL marshalException) { - if (marshalException.minor - == OMGSystemException.RMIIIOP_OPTIONAL_DATA_INCOMPATIBLE1) { - setState(IN_READ_OBJECT_NO_MORE_OPT_DATA); - return -1; - } - - throw marshalException; - } catch(Error e) { - IOException exc = new IOException(e.getMessage()); - exc.initCause(e) ; - throw exc ; - } - - } - - public final boolean readBoolean() throws IOException{ - try{ - readObjectState.readData(this); - - return orbStream.read_boolean(); - } catch (MARSHAL marshalException) { - handleOptionalDataMarshalException(marshalException, false); - throw marshalException; - - } catch(Error e) { - IOException exc = new IOException(e.getMessage()); - exc.initCause(e); - throw exc ; - } - } - - public final byte readByte() throws IOException{ - try{ - readObjectState.readData(this); - - return orbStream.read_octet(); - } catch (MARSHAL marshalException) { - handleOptionalDataMarshalException(marshalException, false); - throw marshalException; - - } catch(Error e) { - IOException exc = new IOException(e.getMessage()); - exc.initCause(e); - throw exc ; - } - } - - public final char readChar() throws IOException{ - try{ - readObjectState.readData(this); - - return orbStream.read_wchar(); - } catch (MARSHAL marshalException) { - handleOptionalDataMarshalException(marshalException, false); - throw marshalException; - - } catch(Error e) { - IOException exc = new IOException(e.getMessage()); - exc.initCause(e); - throw exc ; - } - } - - public final double readDouble() throws IOException{ - try{ - readObjectState.readData(this); - - return orbStream.read_double(); - } catch (MARSHAL marshalException) { - handleOptionalDataMarshalException(marshalException, false); - throw marshalException; - } catch(Error e) { - IOException exc = new IOException(e.getMessage()); - exc.initCause(e); - throw exc ; - } - } - - public final float readFloat() throws IOException{ - try{ - readObjectState.readData(this); - - return orbStream.read_float(); - } catch (MARSHAL marshalException) { - handleOptionalDataMarshalException(marshalException, false); - throw marshalException; - } catch(Error e) { - IOException exc = new IOException(e.getMessage()); - exc.initCause(e); - throw exc ; - } - } - - public final void readFully(byte data[]) throws IOException{ -// d11623 : implement readFully, required for serializing some core classes - - readFully(data, 0, data.length); - } - - public final void readFully(byte data[], int offset, int size) throws IOException{ -// d11623 : implement readFully, required for serializing some core classes - try{ - readObjectState.readData(this); - - orbStream.read_octet_array(data, offset, size); - } catch (MARSHAL marshalException) { - handleOptionalDataMarshalException(marshalException, false); - - throw marshalException; - } catch(Error e) { - IOException exc = new IOException(e.getMessage()); - exc.initCause(e); - throw exc ; - } - } - - public final int readInt() throws IOException{ - try{ - readObjectState.readData(this); - - return orbStream.read_long(); - } catch (MARSHAL marshalException) { - handleOptionalDataMarshalException(marshalException, false); - throw marshalException; - } catch(Error e) { - IOException exc = new IOException(e.getMessage()); - exc.initCause(e); - throw exc ; - } - } - - public final String readLine() throws IOException{ - // XXX I18N, logging needed. - throw new IOException("Method readLine not supported"); - } - - public final long readLong() throws IOException{ - try{ - readObjectState.readData(this); - - return orbStream.read_longlong(); - } catch (MARSHAL marshalException) { - handleOptionalDataMarshalException(marshalException, false); - throw marshalException; - } catch(Error e) { - IOException exc = new IOException(e.getMessage()); - exc.initCause(e); - throw exc ; - } - } - - public final short readShort() throws IOException{ - try{ - readObjectState.readData(this); - - return orbStream.read_short(); - } catch (MARSHAL marshalException) { - handleOptionalDataMarshalException(marshalException, false); - throw marshalException; - } catch(Error e) { - IOException exc = new IOException(e.getMessage()); - exc.initCause(e); - throw exc ; - } - } - - protected final void readStreamHeader() throws IOException, StreamCorruptedException{ - // no op - } - - public final int readUnsignedByte() throws IOException{ - try{ - readObjectState.readData(this); - - return (orbStream.read_octet() << 0) & 0x000000FF; - } catch (MARSHAL marshalException) { - handleOptionalDataMarshalException(marshalException, false); - throw marshalException; - } catch(Error e) { - IOException exc = new IOException(e.getMessage()); - exc.initCause(e); - throw exc ; - } - } - - public final int readUnsignedShort() throws IOException{ - try{ - readObjectState.readData(this); - - return (orbStream.read_ushort() << 0) & 0x0000FFFF; - } catch (MARSHAL marshalException) { - handleOptionalDataMarshalException(marshalException, false); - throw marshalException; - } catch(Error e) { - IOException exc = new IOException(e.getMessage()); - exc.initCause(e); - throw exc ; - } - } - - /** - * Helper method for correcting the Kestrel bug 4367783 (dealing - * with larger than 8-bit chars). The old behavior is preserved - * in orbutil.IIOPInputStream_1_3 in order to interoperate with - * our legacy ORBs. - */ - protected String internalReadUTF(org.omg.CORBA.portable.InputStream stream) - { - return stream.read_wstring(); - } - - public final String readUTF() throws IOException{ - try{ - readObjectState.readData(this); - - return internalReadUTF(orbStream); - } catch (MARSHAL marshalException) { - handleOptionalDataMarshalException(marshalException, false); - throw marshalException; - } catch(Error e) { - IOException exc = new IOException(e.getMessage()); - exc.initCause(e); - throw exc ; - } - } - - // If the ORB stream detects an incompatibility between what's - // on the wire and what our Serializable's readObject wants, - // it throws a MARSHAL exception with a specific minor code. - // This is rethrown to the readObject as an OptionalDataException. - // So far in RMI-IIOP, this process isn't specific enough to - // tell the readObject how much data is available, so we always - // set the OptionalDataException's EOF marker to true. - private void handleOptionalDataMarshalException(MARSHAL marshalException, - boolean objectRead) - throws IOException { - - // Java Object Serialization spec 3.4: "If the readObject method - // of the class attempts to read more data than is present in the - // optional part of the stream for this class, the stream will - // return -1 for bytewise reads, throw an EOFException for - // primitive data reads, or throw an OptionalDataException - // with the eof field set to true for object reads." - if (marshalException.minor - == OMGSystemException.RMIIIOP_OPTIONAL_DATA_INCOMPATIBLE1) { - - IOException result; - - if (!objectRead) - result = new EOFException("No more optional data"); - else - result = bridge.newOptionalDataExceptionForSerialization(true); - - result.initCause(marshalException); - - setState(IN_READ_OBJECT_NO_MORE_OPT_DATA); - - throw result; - } - } - - public final synchronized void registerValidation(ObjectInputValidation obj, - int prio) - throws NotActiveException, InvalidObjectException{ - // XXX I18N, logging needed. - throw new Error("Method registerValidation not supported"); - } - - protected final Class resolveClass(ObjectStreamClass v) - throws IOException, ClassNotFoundException{ - // XXX I18N, logging needed. - throw new IOException("Method resolveClass not supported"); - } - - protected final Object resolveObject(Object obj) throws IOException{ - // XXX I18N, logging needed. - throw new IOException("Method resolveObject not supported"); - } - - public final int skipBytes(int len) throws IOException{ - try{ - readObjectState.readData(this); - - byte buf[] = new byte[len]; - orbStream.read_octet_array(buf, 0, len); - return len; - } catch (MARSHAL marshalException) { - handleOptionalDataMarshalException(marshalException, false); - - throw marshalException; - } catch(Error e) { - IOException exc = new IOException(e.getMessage()); - exc.initCause(e) ; - throw exc ; - } - } - - private synchronized Object inputObject(Class clz, - String repositoryID, - com.sun.org.omg.SendingContext.CodeBase sender, - int offset) - throws IOException, ClassNotFoundException - { - - /* - * Get the descriptor and then class of the incoming object. - */ - - currentClassDesc = ObjectStreamClass.lookup(clz); - currentClass = currentClassDesc.forClass(); - //currentClassDesc.setClass(currentClass); - if (currentClass == null) - // XXX I18N, logging needed. - throw new ClassNotFoundException(currentClassDesc.getName()); - - try { - /* If Externalizable, - * Create an instance and tell it to read its data. - * else, - * Handle it as a serializable class. - */ - if (Enum.class.isAssignableFrom( clz )) { - int ordinal = orbStream.read_long() ; - String value = (String)orbStream.read_value( String.class ) ; - return Enum.valueOf( clz, value ) ; - } else if (currentClassDesc.isExternalizable()) { - try { - currentObject = (currentClass == null) ? - null : currentClassDesc.newInstance(); - if (currentObject != null) { - - // Store this object and its beginning position - // since there might be indirections to it while - // it's been unmarshalled. - activeRecursionMgr.addObject(offset, currentObject); - - // Read format version - readFormatVersion(); - - Externalizable ext = (Externalizable)currentObject; - ext.readExternal(this); - } - } catch (InvocationTargetException e) { - InvalidClassException exc = new InvalidClassException( - currentClass.getName(), - "InvocationTargetException accessing no-arg constructor"); - exc.initCause( e ) ; - throw exc ; - } catch (UnsupportedOperationException e) { - InvalidClassException exc = new InvalidClassException( - currentClass.getName(), - "UnsupportedOperationException accessing no-arg constructor"); - exc.initCause( e ) ; - throw exc ; - } catch (InstantiationException e) { - InvalidClassException exc = new InvalidClassException( - currentClass.getName(), - "InstantiationException accessing no-arg constructor"); - exc.initCause( e ) ; - throw exc ; - } - } // end : if (currentClassDesc.isExternalizable()) - else { - /* Count number of classes and descriptors we might have - * to work on. - */ - - ObjectStreamClass currdesc = currentClassDesc; - Class currclass = currentClass; - - int spBase = spClass; // current top of stack - - if (currentClass.getName().equals("java.lang.String")) { - return this.readUTF(); - } - /* The object's classes should be processed from supertype to subtype - * Push all the clases of the current object onto a stack. - * Note that only the serializable classes are represented - * in the descriptor list. - * - * Handle versioning where one or more supertypes of - * have been inserted or removed. The stack will - * contain pairs of descriptors and the corresponding - * class. If the object has a class that did not occur in - * the original the descriptor will be null. If the - * original object had a descriptor for a class not - * present in the local hierarchy of the object the class will be - * null. - * - */ - - /* - * This is your basic diff pattern, made simpler - * because reordering is not allowed. - */ - // sun.4296963 ibm.11861 - // d11861 we should stop when we find the highest serializable class - // We need this so that when we allocate the new object below, we - // can call the constructor of the non-serializable superclass. - // Note that in the JRMP variant of this code the - // ObjectStreamClass.lookup() method handles this, but we've put - // this fix here rather than change lookup because the new behaviour - // is needed in other cases. - - for (currdesc = currentClassDesc, currclass = currentClass; - currdesc != null && currdesc.isSerializable(); /*sun.4296963 ibm.11861*/ - currdesc = currdesc.getSuperclass()) { - - /* - * Search the classes to see if the class of this - * descriptor appears further up the hierarchy. Until - * it's found assume its an inserted class. If it's - * not found, its the descriptor's class that has been - * removed. - */ - Class cc = currdesc.forClass(); - Class cl; - for (cl = currclass; cl != null; cl = cl.getSuperclass()) { - if (cc == cl) { - // found a superclass that matches this descriptor - break; - } else { - /* Ignore a class that doesn't match. No - * action is needed since it is already - * initialized. - */ - } - } // end : for (cl = currclass; cl != null; cl = cl.getSuperclass()) - /* Test if there is room for this new entry. - * If not, double the size of the arrays and copy the contents. - */ - spClass++; - if (spClass >= classes.length) { - int newlen = classes.length * 2; - Class[] newclasses = new Class[newlen]; - ObjectStreamClass[] newclassdesc = new ObjectStreamClass[newlen]; - - System.arraycopy(classes, 0, - newclasses, 0, - classes.length); - System.arraycopy(classdesc, 0, - newclassdesc, 0, - classes.length); - - classes = newclasses; - classdesc = newclassdesc; - } - - if (cl == null) { - /* Class not found corresponding to this descriptor. - * Pop off all the extra classes pushed. - * Push the descriptor and a null class. - */ - classdesc[spClass] = currdesc; - classes[spClass] = null; - } else { - /* Current class descriptor matches current class. - * Some classes may have been inserted. - * Record the match and advance the class, continue - * with the next descriptor. - */ - classdesc[spClass] = currdesc; - classes[spClass] = cl; - currclass = cl.getSuperclass(); - } - } // end : for (currdesc = currentClassDesc, currclass = currentClass; - - /* Allocate a new object. The object is only constructed - * above the highest serializable class and is set to - * default values for all more specialized classes. - */ - try { - currentObject = (currentClass == null) ? - null : currentClassDesc.newInstance() ; - - // Store this object and its beginning position - // since there might be indirections to it while - // it's been unmarshalled. - activeRecursionMgr.addObject(offset, currentObject); - } catch (InvocationTargetException e) { - InvalidClassException exc = new InvalidClassException( - currentClass.getName(), - "InvocationTargetException accessing no-arg constructor"); - exc.initCause( e ) ; - throw exc ; - } catch (UnsupportedOperationException e) { - InvalidClassException exc = new InvalidClassException( - currentClass.getName(), - "UnsupportedOperationException accessing no-arg constructor"); - exc.initCause( e ) ; - throw exc ; - } catch (InstantiationException e) { - InvalidClassException exc = new InvalidClassException( - currentClass.getName(), - "InstantiationException accessing no-arg constructor"); - exc.initCause( e ) ; - throw exc ; - } - - /* - * For all the pushed descriptors and classes. - * if the class has its own writeObject and readObject methods - * call the readObject method - * else - * invoke the defaultReadObject method - */ - try { - for (spClass = spClass; spClass > spBase; spClass--) { - /* - * Set current descriptor and corresponding class - */ - currentClassDesc = classdesc[spClass]; - currentClass = classes[spClass]; - if (classes[spClass] != null) { - /* Read the data from the stream described by the - * descriptor and store into the matching class. - */ - - ReadObjectState oldState = readObjectState; - setState(DEFAULT_STATE); - - try { - - // Changed since invokeObjectReader no longer does this. - if (currentClassDesc.hasWriteObject()) { - - // Read format version - readFormatVersion(); - - // Read defaultWriteObject indicator - boolean calledDefaultWriteObject = readBoolean(); - - readObjectState.beginUnmarshalCustomValue(this, - calledDefaultWriteObject, - currentClassDesc.hasReadObject()); - } else { - if (currentClassDesc.hasReadObject()) - setState(IN_READ_OBJECT_REMOTE_NOT_CUSTOM_MARSHALED); - } - - if (!invokeObjectReader(currentClassDesc, currentObject, currentClass) || - readObjectState == IN_READ_OBJECT_DEFAULTS_SENT) { - - // Error case of no readObject and didn't call - // defaultWriteObject handled in default state - - ObjectStreamField[] fields = - currentClassDesc.getFieldsNoCopy(); - if (fields.length > 0) { - inputClassFields(currentObject, currentClass, fields, sender); - } - } - - if (currentClassDesc.hasWriteObject()) - readObjectState.endUnmarshalCustomValue(this); - - } finally { - setState(oldState); - } - - } else { - - // _REVISIT_ : Can we ever get here? - /* No local class for this descriptor, - * Skip over the data for this class. - * like defaultReadObject with a null currentObject. - * The code will read the values but discard them. - */ - ObjectStreamField[] fields = - currentClassDesc.getFieldsNoCopy(); - if (fields.length > 0) { - inputClassFields(null, currentClass, fields, sender); - } - - } - - } - } finally { - // Make sure we exit at the same stack level as when we started. - spClass = spBase; - } - } - } finally { - // We've completed deserializing this object. Any - // future indirections will be handled correctly at the - // CDR level. The ActiveRecursionManager only deals with - // objects currently being deserialized. - activeRecursionMgr.removeObject(offset); - } - - return currentObject; - } - - // This retrieves a vector of FVD's for the hierarchy of serializable classes stemming from - // repositoryID. It is assumed that the sender will not provide base_value id's for non-serializable - // classes! - private Vector getOrderedDescriptions(String repositoryID, - com.sun.org.omg.SendingContext.CodeBase sender) { - Vector descs = new Vector(); - - if (sender == null) { - return descs; - } - - FullValueDescription aFVD = sender.meta(repositoryID); - while (aFVD != null) { - descs.insertElementAt(aFVD, 0); - if ((aFVD.base_value != null) && !kEmptyStr.equals(aFVD.base_value)) { - aFVD = sender.meta(aFVD.base_value); - } - else return descs; - } - - return descs; - } - - /** - * This input method uses FullValueDescriptions retrieved from the sender's runtime to - * read in the data. This method is capable of throwing out data not applicable to client's fields. - * This method handles instances where the reader has a class not sent by the sender, the sender sent - * a class not present on the reader, and/or the reader's class does not match the sender's class. - * - * NOTE : If the local description indicates custom marshaling and the remote type's FVD also - * indicates custom marsahling than the local type is used to read the data off the wire. However, - * if either says custom while the other does not, a MARSHAL error is thrown. Externalizable is - * a form of custom marshaling. - * - */ - private synchronized Object inputObjectUsingFVD(Class clz, - String repositoryID, - com.sun.org.omg.SendingContext.CodeBase sender, - int offset) - throws IOException, ClassNotFoundException - { - int spBase = spClass; // current top of stack - try{ - - /* - * Get the descriptor and then class of the incoming object. - */ - - ObjectStreamClass currdesc = currentClassDesc = ObjectStreamClass.lookup(clz); - Class currclass = currentClass = clz; - - /* If Externalizable, - * Create an instance and tell it to read its data. - * else, - * Handle it as a serializable class. - */ - if (currentClassDesc.isExternalizable()) { - try { - currentObject = (currentClass == null) ? - null : currentClassDesc.newInstance(); - if (currentObject != null) { - // Store this object and its beginning position - // since there might be indirections to it while - // it's been unmarshalled. - activeRecursionMgr.addObject(offset, currentObject); - - // Read format version - readFormatVersion(); - - Externalizable ext = (Externalizable)currentObject; - ext.readExternal(this); - } - } catch (InvocationTargetException e) { - InvalidClassException exc = new InvalidClassException( - currentClass.getName(), - "InvocationTargetException accessing no-arg constructor"); - exc.initCause( e ) ; - throw exc ; - } catch (UnsupportedOperationException e) { - InvalidClassException exc = new InvalidClassException( - currentClass.getName(), - "UnsupportedOperationException accessing no-arg constructor"); - exc.initCause( e ) ; - throw exc ; - } catch (InstantiationException e) { - InvalidClassException exc = new InvalidClassException( - currentClass.getName(), - "InstantiationException accessing no-arg constructor"); - exc.initCause( e ) ; - throw exc ; - } - } else { - /* - * This is your basic diff pattern, made simpler - * because reordering is not allowed. - */ - for (currdesc = currentClassDesc, currclass = currentClass; - currdesc != null && currdesc.isSerializable(); /*sun.4296963 ibm.11861*/ - - currdesc = currdesc.getSuperclass()) { - - /* - * Search the classes to see if the class of this - * descriptor appears further up the hierarchy. Until - * it's found assume its an inserted class. If it's - * not found, its the descriptor's class that has been - * removed. - */ - Class cc = currdesc.forClass(); - Class cl; - for (cl = currclass; cl != null; cl = cl.getSuperclass()) { - if (cc == cl) { - // found a superclass that matches this descriptor - break; - } else { - /* Ignore a class that doesn't match. No - * action is needed since it is already - * initialized. - */ - } - } // end : for (cl = currclass; cl != null; cl = cl.getSuperclass()) - /* Test if there is room for this new entry. - * If not, double the size of the arrays and copy the contents. - */ - spClass++; - if (spClass >= classes.length) { - int newlen = classes.length * 2; - Class[] newclasses = new Class[newlen]; - ObjectStreamClass[] newclassdesc = new ObjectStreamClass[newlen]; - - System.arraycopy(classes, 0, - newclasses, 0, - classes.length); - System.arraycopy(classdesc, 0, - newclassdesc, 0, - classes.length); - - classes = newclasses; - classdesc = newclassdesc; - } - - if (cl == null) { - /* Class not found corresponding to this descriptor. - * Pop off all the extra classes pushed. - * Push the descriptor and a null class. - */ - classdesc[spClass] = currdesc; - classes[spClass] = null; - } else { - /* Current class descriptor matches current class. - * Some classes may have been inserted. - * Record the match and advance the class, continue - * with the next descriptor. - */ - classdesc[spClass] = currdesc; - classes[spClass] = cl; - currclass = cl.getSuperclass(); - } - } // end : for (currdesc = currentClassDesc, currclass = currentClass; - - /* Allocate a new object. - */ - try { - currentObject = (currentClass == null) ? - null : currentClassDesc.newInstance(); - - // Store this object and its beginning position - // since there might be indirections to it while - // it's been unmarshalled. - activeRecursionMgr.addObject(offset, currentObject); - } catch (InvocationTargetException e) { - InvalidClassException exc = new InvalidClassException( - currentClass.getName(), - "InvocationTargetException accessing no-arg constructor"); - exc.initCause( e ) ; - throw exc ; - } catch (UnsupportedOperationException e) { - InvalidClassException exc = new InvalidClassException( - currentClass.getName(), - "UnsupportedOperationException accessing no-arg constructor"); - exc.initCause( e ) ; - throw exc ; - } catch (InstantiationException e) { - InvalidClassException exc = new InvalidClassException( - currentClass.getName(), - "InstantiationException accessing no-arg constructor"); - exc.initCause( e ) ; - throw exc ; - } - - Enumeration fvdsList = getOrderedDescriptions(repositoryID, sender).elements(); - - while((fvdsList.hasMoreElements()) && (spClass > spBase)) { - FullValueDescription fvd = (FullValueDescription)fvdsList.nextElement(); - // d4365188: backward compatability - String repIDForFVD = vhandler.getClassName(fvd.id); - String repIDForClass = vhandler.getClassName(vhandler.getRMIRepositoryID(currentClass)); - - while ((spClass > spBase) && - (!repIDForFVD.equals(repIDForClass))) { - int pos = findNextClass(repIDForFVD, classes, spClass, spBase); - if (pos != -1) { - spClass = pos; - currclass = currentClass = classes[spClass]; - repIDForClass = vhandler.getClassName(vhandler.getRMIRepositoryID(currentClass)); - } - else { // Read and throw away one level of the fvdslist - - // This seems to mean that the sender had a superclass that - // we don't have - - if (fvd.is_custom) { - - readFormatVersion(); - boolean calledDefaultWriteObject = readBoolean(); - - if (calledDefaultWriteObject) - inputClassFields(null, null, null, fvd.members, sender); - - if (getStreamFormatVersion() == 2) { - - ((ValueInputStream)getOrbStream()).start_value(); - ((ValueInputStream)getOrbStream()).end_value(); - } - - // WARNING: If stream format version is 1 and there's - // optional data, we'll get some form of exception down - // the line or data corruption. - - } else { - - inputClassFields(null, currentClass, null, fvd.members, sender); - } - - if (fvdsList.hasMoreElements()){ - fvd = (FullValueDescription)fvdsList.nextElement(); - repIDForFVD = vhandler.getClassName(fvd.id); - } - else return currentObject; - } - } - - currdesc = currentClassDesc = ObjectStreamClass.lookup(currentClass); - - if (!repIDForClass.equals("java.lang.Object")) { - - // If the sender used custom marshaling, then it should have put - // the two bytes on the wire indicating stream format version - // and whether or not the writeObject method called - // defaultWriteObject/writeFields. - - ReadObjectState oldState = readObjectState; - setState(DEFAULT_STATE); - - try { - - if (fvd.is_custom) { - - // Read format version - readFormatVersion(); - - // Read defaultWriteObject indicator - boolean calledDefaultWriteObject = readBoolean(); - - readObjectState.beginUnmarshalCustomValue(this, - calledDefaultWriteObject, - currentClassDesc.hasReadObject()); - } - - boolean usedReadObject = false; - - // Always use readObject if it exists, and fall back to default - // unmarshaling if it doesn't. - try { - - if (!fvd.is_custom && currentClassDesc.hasReadObject()) - setState(IN_READ_OBJECT_REMOTE_NOT_CUSTOM_MARSHALED); - - // See the definition of defaultReadObjectFVDMembers - // for more information. This concerns making sure - // we use the remote FVD's members in defaultReadObject. - defaultReadObjectFVDMembers = fvd.members; - usedReadObject = invokeObjectReader(currentClassDesc, - currentObject, - currentClass); - - } finally { - defaultReadObjectFVDMembers = null; - } - - // Note that the !usedReadObject !calledDefaultWriteObject - // case is handled by the beginUnmarshalCustomValue method - // of the default state - if (!usedReadObject || readObjectState == IN_READ_OBJECT_DEFAULTS_SENT) - inputClassFields(currentObject, currentClass, currdesc, fvd.members, sender); - - if (fvd.is_custom) - readObjectState.endUnmarshalCustomValue(this); - - } finally { - setState(oldState); - } - - currclass = currentClass = classes[--spClass]; - - } else { - - // The remaining hierarchy of the local class does not match the sender's FVD. - // So, use remaining FVDs to read data off wire. If any remaining FVDs indicate - // custom marshaling, throw MARSHAL error. - inputClassFields(null, currentClass, null, fvd.members, sender); - - while (fvdsList.hasMoreElements()){ - fvd = (FullValueDescription)fvdsList.nextElement(); - - if (fvd.is_custom) - skipCustomUsingFVD(fvd.members, sender); - else - inputClassFields(null, currentClass, null, fvd.members, sender); - } - - } - - } // end : while(fvdsList.hasMoreElements()) - while (fvdsList.hasMoreElements()){ - - FullValueDescription fvd = (FullValueDescription)fvdsList.nextElement(); - if (fvd.is_custom) - skipCustomUsingFVD(fvd.members, sender); - else - throwAwayData(fvd.members, sender); - } - } - - return currentObject; - } - finally { - // Make sure we exit at the same stack level as when we started. - spClass = spBase; - - // We've completed deserializing this object. Any - // future indirections will be handled correctly at the - // CDR level. The ActiveRecursionManager only deals with - // objects currently being deserialized. - activeRecursionMgr.removeObject(offset); - } - - } - - /** - * This input method uses FullValueDescriptions retrieved from the sender's runtime to - * read in the data. This method is capable of throwing out data not applicable to client's fields. - * - * NOTE : If the local description indicates custom marshaling and the remote type's FVD also - * indicates custom marsahling than the local type is used to read the data off the wire. However, - * if either says custom while the other does not, a MARSHAL error is thrown. Externalizable is - * a form of custom marshaling. - * - */ - private Object skipObjectUsingFVD(String repositoryID, - com.sun.org.omg.SendingContext.CodeBase sender) - throws IOException, ClassNotFoundException - { - - Enumeration fvdsList = getOrderedDescriptions(repositoryID, sender).elements(); - - while(fvdsList.hasMoreElements()) { - FullValueDescription fvd = (FullValueDescription)fvdsList.nextElement(); - String repIDForFVD = vhandler.getClassName(fvd.id); - - if (!repIDForFVD.equals("java.lang.Object")) { - if (fvd.is_custom) { - - readFormatVersion(); - - boolean calledDefaultWriteObject = readBoolean(); - - if (calledDefaultWriteObject) - inputClassFields(null, null, null, fvd.members, sender); - - if (getStreamFormatVersion() == 2) { - - ((ValueInputStream)getOrbStream()).start_value(); - ((ValueInputStream)getOrbStream()).end_value(); - } - - // WARNING: If stream format version is 1 and there's - // optional data, we'll get some form of exception down - // the line. - - } else { - // Use default marshaling - inputClassFields(null, null, null, fvd.members, sender); - } - } - - } // end : while(fvdsList.hasMoreElements()) - return null; - - } - - /////////////////// - - private int findNextClass(String classname, Class classes[], int _spClass, int _spBase){ - - for (int i = _spClass; i > _spBase; i--){ - if (classname.equals(classes[i].getName())) { - return i; - } - } - - return -1; - } - - /* - * Invoke the readObject method if present. Assumes that in the case of custom - * marshaling, the format version and defaultWriteObject indicator were already - * removed. - */ - private boolean invokeObjectReader(ObjectStreamClass osc, Object obj, Class aclass) - throws InvalidClassException, StreamCorruptedException, - ClassNotFoundException, IOException - { - try { - return osc.invokeReadObject( obj, this ) ; - } catch (InvocationTargetException e) { - Throwable t = e.getTargetException(); - if (t instanceof ClassNotFoundException) - throw (ClassNotFoundException)t; - else if (t instanceof IOException) - throw (IOException)t; - else if (t instanceof RuntimeException) - throw (RuntimeException) t; - else if (t instanceof Error) - throw (Error) t; - else - // XXX I18N, logging needed. - throw new Error("internal error"); - } - } - - /* - * Reset the stream to be just like it was after the constructor. - */ - private void resetStream() throws IOException { - - if (classes == null) - classes = new Class[20]; - else { - for (int i = 0; i < classes.length; i++) - classes[i] = null; - } - if (classdesc == null) - classdesc = new ObjectStreamClass[20]; - else { - for (int i = 0; i < classdesc.length; i++) - classdesc[i] = null; - } - spClass = 0; - - if (callbacks != null) - callbacks.setSize(0); // discard any pending callbacks - } - - /** - * Factored out of inputClassFields This reads a primitive value and sets it - * in the field of o described by the ObjectStreamField field. - * - * Note that reflection cannot be used here, because reflection cannot be used - * to set final fields. - */ - private void inputPrimitiveField(Object o, Class cl, ObjectStreamField field) - throws InvalidClassException, IOException { - - try { - switch (field.getTypeCode()) { - case 'B': - byte byteValue = orbStream.read_octet(); - if (field.getField() != null) { - bridge.putByte( o, field.getFieldID(), byteValue ) ; - //reflective code: field.getField().setByte( o, byteValue ) ; - } - break; - case 'Z': - boolean booleanValue = orbStream.read_boolean(); - if (field.getField() != null) { - bridge.putBoolean( o, field.getFieldID(), booleanValue ) ; - //reflective code: field.getField().setBoolean( o, booleanValue ) ; - } - break; - case 'C': - char charValue = orbStream.read_wchar(); - if (field.getField() != null) { - bridge.putChar( o, field.getFieldID(), charValue ) ; - //reflective code: field.getField().setChar( o, charValue ) ; - } - break; - case 'S': - short shortValue = orbStream.read_short(); - if (field.getField() != null) { - bridge.putShort( o, field.getFieldID(), shortValue ) ; - //reflective code: field.getField().setShort( o, shortValue ) ; - } - break; - case 'I': - int intValue = orbStream.read_long(); - if (field.getField() != null) { - bridge.putInt( o, field.getFieldID(), intValue ) ; - //reflective code: field.getField().setInt( o, intValue ) ; - } - break; - case 'J': - long longValue = orbStream.read_longlong(); - if (field.getField() != null) { - bridge.putLong( o, field.getFieldID(), longValue ) ; - //reflective code: field.getField().setLong( o, longValue ) ; - } - break; - case 'F' : - float floatValue = orbStream.read_float(); - if (field.getField() != null) { - bridge.putFloat( o, field.getFieldID(), floatValue ) ; - //reflective code: field.getField().setFloat( o, floatValue ) ; - } - break; - case 'D' : - double doubleValue = orbStream.read_double(); - if (field.getField() != null) { - bridge.putDouble( o, field.getFieldID(), doubleValue ) ; - //reflective code: field.getField().setDouble( o, doubleValue ) ; - } - break; - default: - // XXX I18N, logging needed. - throw new InvalidClassException(cl.getName()); - } - } catch (IllegalArgumentException e) { - /* This case should never happen. If the field types - are not the same, InvalidClassException is raised when - matching the local class to the serialized ObjectStreamClass. */ - ClassCastException cce = new ClassCastException("Assigning instance of class " + - field.getType().getName() + - " to field " + - currentClassDesc.getName() + '#' + - field.getField().getName()); - cce.initCause( e ) ; - throw cce ; - } - } - - private Object inputObjectField(org.omg.CORBA.ValueMember field, - com.sun.org.omg.SendingContext.CodeBase sender) - throws IndirectionException, ClassNotFoundException, IOException, - StreamCorruptedException { - - Object objectValue = null; - Class type = null; - String id = field.id; - - try { - type = vhandler.getClassFromType(id); - } catch(ClassNotFoundException cnfe) { - // Make sure type = null - type = null; - } - - String signature = null; - if (type != null) - signature = ValueUtility.getSignature(field); - - if (signature != null && (signature.equals("Ljava/lang/Object;") || - signature.equals("Ljava/io/Serializable;") || - signature.equals("Ljava/io/Externalizable;"))) { - objectValue = javax.rmi.CORBA.Util.readAny(orbStream); - } else { - // Decide what method call to make based on the type. If - // it is a type for which we need to load a stub, convert - // the type to the correct stub type. - // - // NOTE : Since FullValueDescription does not allow us - // to ask whether something is an interface we do not - // have the ability to optimize this check. - - int callType = ValueHandlerImpl.kValueType; - - if (!vhandler.isSequence(id)) { - - if (field.type.kind().value() == kRemoteTypeCode.kind().value()) { - - // RMI Object reference... - callType = ValueHandlerImpl.kRemoteType; - - } else { - - // REVISIT. If we don't have the local class, - // we should probably verify that it's an RMI type, - // query the remote FVD, and use is_abstract. - // Our FVD seems to get NullPointerExceptions for any - // non-RMI types. - - // This uses the local class in the same way as - // inputObjectField(ObjectStreamField) does. REVISIT - // inputObjectField(ObjectStreamField)'s loadStubClass - // logic. Assumption is that the given type cannot - // evolve to become a CORBA abstract interface or - // a RMI abstract interface. - - if (type != null && type.isInterface() && - (vhandler.isAbstractBase(type) || - ObjectStreamClassCorbaExt.isAbstractInterface(type))) { - - callType = ValueHandlerImpl.kAbstractType; - } - } - } - - // Now that we have used the FVD of the field to determine the proper course - // of action, it is ok to use the type (Class) from this point forward since - // the rep. id for this read will also follow on the wire. - - switch (callType) { - case ValueHandlerImpl.kRemoteType: - if (type != null) - objectValue = Utility.readObjectAndNarrow(orbStream, type); - else - objectValue = orbStream.read_Object(); - break; - case ValueHandlerImpl.kAbstractType: - if (type != null) - objectValue = Utility.readAbstractAndNarrow(orbStream, type); - else - objectValue = orbStream.read_abstract_interface(); - break; - case ValueHandlerImpl.kValueType: - if (type != null) - objectValue = orbStream.read_value(type); - else - objectValue = orbStream.read_value(); - break; - default: - // XXX I18N, logging needed. - throw new StreamCorruptedException("Unknown callType: " + callType); - } - } - - return objectValue; - } - - /** - * Factored out of inputClassFields and reused in - * inputCurrentClassFieldsForReadFields. - * - * Reads the field (which of an Object type as opposed to a primitive) - * described by ObjectStreamField field and returns it. - */ - private Object inputObjectField(ObjectStreamField field) - throws InvalidClassException, StreamCorruptedException, - ClassNotFoundException, IndirectionException, IOException { - - if (ObjectStreamClassCorbaExt.isAny(field.getTypeString())) { - return javax.rmi.CORBA.Util.readAny(orbStream); - } - - Object objectValue = null; - - // fields have an API to provide the actual class - // corresponding to the data type - // Class type = osc.forClass(); - Class fieldType = field.getType(); - Class actualType = fieldType; // This may change if stub loaded. - - // Decide what method call to make based on the fieldType. If - // it is a type for which we need to load a stub, convert - // the type to the correct stub type. - - int callType = ValueHandlerImpl.kValueType; - boolean narrow = false; - - if (fieldType.isInterface()) { - boolean loadStubClass = false; - - if (java.rmi.Remote.class.isAssignableFrom(fieldType)) { - - // RMI Object reference... - callType = ValueHandlerImpl.kRemoteType; - - } else if (org.omg.CORBA.Object.class.isAssignableFrom(fieldType)){ - - // IDL Object reference... - callType = ValueHandlerImpl.kRemoteType; - loadStubClass = true; - - } else if (vhandler.isAbstractBase(fieldType)) { - // IDL Abstract Object reference... - - callType = ValueHandlerImpl.kAbstractType; - loadStubClass = true; - } else if (ObjectStreamClassCorbaExt.isAbstractInterface(fieldType)) { - // RMI Abstract Object reference... - - callType = ValueHandlerImpl.kAbstractType; - } - - if (loadStubClass) { - try { - String codebase = Util.getCodebase(fieldType); - String repID = vhandler.createForAnyType(fieldType); - Class stubType = - Utility.loadStubClass(repID, codebase, fieldType); - actualType = stubType; - } catch (ClassNotFoundException e) { - narrow = true; - } - } else { - narrow = true; - } - } - - switch (callType) { - case ValueHandlerImpl.kRemoteType: - if (!narrow) - objectValue = (Object)orbStream.read_Object(actualType); - else - objectValue = Utility.readObjectAndNarrow(orbStream, actualType); - break; - case ValueHandlerImpl.kAbstractType: - if (!narrow) - objectValue = (Object)orbStream.read_abstract_interface(actualType); - else - objectValue = Utility.readAbstractAndNarrow(orbStream, actualType); - break; - case ValueHandlerImpl.kValueType: - objectValue = (Object)orbStream.read_value(actualType); - break; - default: - // XXX I18N, logging needed. - throw new StreamCorruptedException("Unknown callType: " + callType); - } - - return objectValue; - } - - private final boolean mustUseRemoteValueMembers() { - return defaultReadObjectFVDMembers != null; - } - - void readFields(java.util.Map fieldToValueMap) - throws InvalidClassException, StreamCorruptedException, - ClassNotFoundException, IOException { - - if (mustUseRemoteValueMembers()) { - inputRemoteMembersForReadFields(fieldToValueMap); - } else - inputCurrentClassFieldsForReadFields(fieldToValueMap); - } - - private final void inputRemoteMembersForReadFields(java.util.Map fieldToValueMap) - throws InvalidClassException, StreamCorruptedException, - ClassNotFoundException, IOException { - - // Must have this local variable since defaultReadObjectFVDMembers - // may get mangled by recursion. - ValueMember fields[] = defaultReadObjectFVDMembers; - - try { - - for (int i = 0; i < fields.length; i++) { - - switch (fields[i].type.kind().value()) { - - case TCKind._tk_octet: - byte byteValue = orbStream.read_octet(); - fieldToValueMap.put(fields[i].name, new Byte(byteValue)); - break; - case TCKind._tk_boolean: - boolean booleanValue = orbStream.read_boolean(); - fieldToValueMap.put(fields[i].name, new Boolean(booleanValue)); - break; - case TCKind._tk_char: - // Backwards compatibility. Older Sun ORBs sent - // _tk_char even though they read and wrote wchars - // correctly. - // - // Fall through to the _tk_wchar case. - case TCKind._tk_wchar: - char charValue = orbStream.read_wchar(); - fieldToValueMap.put(fields[i].name, new Character(charValue)); - break; - case TCKind._tk_short: - short shortValue = orbStream.read_short(); - fieldToValueMap.put(fields[i].name, new Short(shortValue)); - break; - case TCKind._tk_long: - int intValue = orbStream.read_long(); - fieldToValueMap.put(fields[i].name, new Integer(intValue)); - break; - case TCKind._tk_longlong: - long longValue = orbStream.read_longlong(); - fieldToValueMap.put(fields[i].name, new Long(longValue)); - break; - case TCKind._tk_float: - float floatValue = orbStream.read_float(); - fieldToValueMap.put(fields[i].name, new Float(floatValue)); - break; - case TCKind._tk_double: - double doubleValue = orbStream.read_double(); - fieldToValueMap.put(fields[i].name, new Double(doubleValue)); - break; - case TCKind._tk_value: - case TCKind._tk_objref: - case TCKind._tk_value_box: - Object objectValue = null; - try { - objectValue = inputObjectField(fields[i], - cbSender); - - } catch (IndirectionException cdrie) { - // The CDR stream had never seen the given offset before, - // so check the recursion manager (it will throw an - // IOException if it doesn't have a reference, either). - objectValue = activeRecursionMgr.getObject(cdrie.offset); - } - - fieldToValueMap.put(fields[i].name, objectValue); - break; - default: - // XXX I18N, logging needed. - throw new StreamCorruptedException("Unknown kind: " - + fields[i].type.kind().value()); - } - } - } catch (Throwable t) { - StreamCorruptedException result = new StreamCorruptedException(t.getMessage()); - result.initCause(t); - throw result; - } - } - - /** - * Called from InputStreamHook. - * - * Reads the fields of the current class (could be the ones - * queried from the remote FVD) and puts them in - * the given Map, name to value. Wraps primitives in the - * corresponding java.lang Objects. - */ - private final void inputCurrentClassFieldsForReadFields(java.util.Map fieldToValueMap) - throws InvalidClassException, StreamCorruptedException, - ClassNotFoundException, IOException { - - ObjectStreamField[] fields = currentClassDesc.getFieldsNoCopy(); - - int primFields = fields.length - currentClassDesc.objFields; - - // Handle the primitives first - for (int i = 0; i < primFields; ++i) { - - switch (fields[i].getTypeCode()) { - case 'B': - byte byteValue = orbStream.read_octet(); - fieldToValueMap.put(fields[i].getName(), - new Byte(byteValue)); - break; - case 'Z': - boolean booleanValue = orbStream.read_boolean(); - fieldToValueMap.put(fields[i].getName(), - new Boolean(booleanValue)); - break; - case 'C': - char charValue = orbStream.read_wchar(); - fieldToValueMap.put(fields[i].getName(), - new Character(charValue)); - break; - case 'S': - short shortValue = orbStream.read_short(); - fieldToValueMap.put(fields[i].getName(), - new Short(shortValue)); - break; - case 'I': - int intValue = orbStream.read_long(); - fieldToValueMap.put(fields[i].getName(), - new Integer(intValue)); - break; - case 'J': - long longValue = orbStream.read_longlong(); - fieldToValueMap.put(fields[i].getName(), - new Long(longValue)); - break; - case 'F' : - float floatValue = orbStream.read_float(); - fieldToValueMap.put(fields[i].getName(), - new Float(floatValue)); - break; - case 'D' : - double doubleValue = orbStream.read_double(); - fieldToValueMap.put(fields[i].getName(), - new Double(doubleValue)); - break; - default: - // XXX I18N, logging needed. - throw new InvalidClassException(currentClassDesc.getName()); - } - } - - /* Read and set object fields from the input stream. */ - if (currentClassDesc.objFields > 0) { - for (int i = primFields; i < fields.length; i++) { - Object objectValue = null; - try { - objectValue = inputObjectField(fields[i]); - } catch(IndirectionException cdrie) { - // The CDR stream had never seen the given offset before, - // so check the recursion manager (it will throw an - // IOException if it doesn't have a reference, either). - objectValue = activeRecursionMgr.getObject(cdrie.offset); - } - - fieldToValueMap.put(fields[i].getName(), objectValue); - } - } - } - - /* - * Read the fields of the specified class from the input stream and set - * the values of the fields in the specified object. If the specified - * object is null, just consume the fields without setting any values. If - * any ObjectStreamField does not have a reflected Field, don't try to set - * that field in the object. - * - * REVISIT -- This code doesn't do what the comment says to when - * getField() is null! - */ - private void inputClassFields(Object o, Class cl, - ObjectStreamField[] fields, - com.sun.org.omg.SendingContext.CodeBase sender) - throws InvalidClassException, StreamCorruptedException, - ClassNotFoundException, IOException - { - - int primFields = fields.length - currentClassDesc.objFields; - - // this will leave primitives in the inputstream - // should really consume and discard where necessary - if (o != null) { - for (int i = 0; i < primFields; ++i) { - inputPrimitiveField(o, cl, fields[i]); - } - } - - /* Read and set object fields from the input stream. */ - if (currentClassDesc.objFields > 0) { - for (int i = primFields; i < fields.length; i++) { - Object objectValue = null; - - try { - objectValue = inputObjectField(fields[i]); - } catch(IndirectionException cdrie) { - // The CDR stream had never seen the given offset before, - // so check the recursion manager (it will throw an - // IOException if it doesn't have a reference, either). - objectValue = activeRecursionMgr.getObject(cdrie.offset); - } - - if ((o == null) || (fields[i].getField() == null)) { - continue; - } - - try { - Class fieldCl = fields[i].getClazz(); - if ((objectValue != null) - && (!fieldCl.isAssignableFrom( - objectValue.getClass()))) { - throw new IllegalArgumentException("Field mismatch"); - } - Field declaredClassField = null; - final String inputStreamFieldName = fields[i].getName(); - try { - declaredClassField = getDeclaredField( cl, inputStreamFieldName); - } catch (PrivilegedActionException paEx) { - throw new IllegalArgumentException( - (NoSuchFieldException) paEx.getException()); - } catch (SecurityException secEx) { - throw new IllegalArgumentException(secEx); - } catch (NullPointerException npEx) { - continue; - } catch (NoSuchFieldException e) { - continue; - } - - if (declaredClassField == null) { - continue; - } - - Class declaredFieldClass = declaredClassField.getType(); - - // check input field type is a declared field type - // input field is a subclass of the declared field - if (!declaredFieldClass.isAssignableFrom(fieldCl)) { - throw new IllegalArgumentException( - "Field Type mismatch"); - } - if (objectValue != null && !fieldCl.isInstance(objectValue)) { - throw new IllegalArgumentException(); - } - bridge.putObject( o, fields[i].getFieldID(), objectValue ) ; - // reflective code: fields[i].getField().set( o, objectValue ) ; - } catch (IllegalArgumentException iaEx) { - String objectValueClassName = "null"; - String currentClassDescClassName = "null"; - String fieldName = "null"; - if (objectValue != null) { - objectValueClassName = objectValue.getClass().getName(); - } - if (currentClassDesc != null) { - currentClassDescClassName = currentClassDesc.getName(); - } - if (fields[i] != null && fields[i].getField() != null) { - fieldName = fields[i].getField().getName(); - } - ClassCastException ccEx = new ClassCastException( - "Assigning instance of class " + objectValueClassName - + " to field " + currentClassDescClassName + '#' + fieldName); - ccEx.initCause( iaEx ) ; - throw ccEx ; - } - } // end : for loop - } - } - - /* - * Read the fields of the specified class from the input stream and set - * the values of the fields in the specified object. If the specified - * object is null, just consume the fields without setting any values. If - * any ObjectStreamField does not have a reflected Field, don't try to set - * that field in the object. - */ - private void inputClassFields(Object o, Class cl, - ObjectStreamClass osc, - ValueMember[] fields, - com.sun.org.omg.SendingContext.CodeBase sender) - throws InvalidClassException, StreamCorruptedException, - ClassNotFoundException, IOException - { - try{ - for (int i = 0; i < fields.length; ++i) { - try { - switch (fields[i].type.kind().value()) { - case TCKind._tk_octet: - byte byteValue = orbStream.read_octet(); - if ((o != null) && osc.hasField(fields[i])) - setByteField(o, cl, fields[i].name, byteValue); - break; - case TCKind._tk_boolean: - boolean booleanValue = orbStream.read_boolean(); - if ((o != null) && osc.hasField(fields[i])) - setBooleanField(o, cl, fields[i].name, booleanValue); - break; - case TCKind._tk_char: - // Backwards compatibility. Older Sun ORBs sent - // _tk_char even though they read and wrote wchars - // correctly. - // - // Fall through to the _tk_wchar case. - case TCKind._tk_wchar: - char charValue = orbStream.read_wchar(); - if ((o != null) && osc.hasField(fields[i])) - setCharField(o, cl, fields[i].name, charValue); - break; - case TCKind._tk_short: - short shortValue = orbStream.read_short(); - if ((o != null) && osc.hasField(fields[i])) - setShortField(o, cl, fields[i].name, shortValue); - break; - case TCKind._tk_long: - int intValue = orbStream.read_long(); - if ((o != null) && osc.hasField(fields[i])) - setIntField(o, cl, fields[i].name, intValue); - break; - case TCKind._tk_longlong: - long longValue = orbStream.read_longlong(); - if ((o != null) && osc.hasField(fields[i])) - setLongField(o, cl, fields[i].name, longValue); - break; - case TCKind._tk_float: - float floatValue = orbStream.read_float(); - if ((o != null) && osc.hasField(fields[i])) - setFloatField(o, cl, fields[i].name, floatValue); - break; - case TCKind._tk_double: - double doubleValue = orbStream.read_double(); - if ((o != null) && osc.hasField(fields[i])) - setDoubleField(o, cl, fields[i].name, doubleValue); - break; - case TCKind._tk_value: - case TCKind._tk_objref: - case TCKind._tk_value_box: - Object objectValue = null; - try { - objectValue = inputObjectField(fields[i], sender); - } catch (IndirectionException cdrie) { - // The CDR stream had never seen the given offset before, - // so check the recursion manager (it will throw an - // IOException if it doesn't have a reference, either). - objectValue = activeRecursionMgr.getObject(cdrie.offset); - } - - if (o == null) - continue; - try { - if (osc.hasField(fields[i])){ - setObjectField(o, - cl, - fields[i].name, - objectValue); - } else { - // REVISIT. Convert to a log message. - // This is a normal case when fields have - // been added as part of evolution, but - // silently skipping can make it hard to - // debug if there's an error -// System.out.println("**** warning, not setting field: " -// + fields[i].name -// + " since not on class " -// + osc.getName()); - - } - } catch (IllegalArgumentException e) { - // XXX I18N, logging needed. - ClassCastException cce = new ClassCastException("Assigning instance of class " + - objectValue.getClass().getName() + " to field " + fields[i].name); - cce.initCause(e) ; - throw cce ; - } - break; - default: - // XXX I18N, logging needed. - throw new StreamCorruptedException("Unknown kind: " - + fields[i].type.kind().value()); - } - } catch (IllegalArgumentException e) { - /* This case should never happen. If the field types - are not the same, InvalidClassException is raised when - matching the local class to the serialized ObjectStreamClass. */ - // XXX I18N, logging needed. - ClassCastException cce = new ClassCastException("Assigning instance of class " + fields[i].id + - " to field " + currentClassDesc.getName() + '#' + fields[i].name); - cce.initCause( e ) ; - throw cce ; - } - } - } catch(Throwable t){ - // XXX I18N, logging needed. - StreamCorruptedException sce = new StreamCorruptedException(t.getMessage()); - sce.initCause(t) ; - throw sce ; - } - } - - private void skipCustomUsingFVD(ValueMember[] fields, - com.sun.org.omg.SendingContext.CodeBase sender) - throws InvalidClassException, StreamCorruptedException, - ClassNotFoundException, IOException - { - readFormatVersion(); - boolean calledDefaultWriteObject = readBoolean(); - - if (calledDefaultWriteObject) - throwAwayData(fields, sender); - - if (getStreamFormatVersion() == 2) { - - ((ValueInputStream)getOrbStream()).start_value(); - ((ValueInputStream)getOrbStream()).end_value(); - } - } - - /* - * Read the fields of the specified class from the input stream throw data away. - * This must handle same switch logic as above. - */ - private void throwAwayData(ValueMember[] fields, - com.sun.org.omg.SendingContext.CodeBase sender) - throws InvalidClassException, StreamCorruptedException, - ClassNotFoundException, IOException { - - for (int i = 0; i < fields.length; ++i) { - - try { - - switch (fields[i].type.kind().value()) { - case TCKind._tk_octet: - orbStream.read_octet(); - break; - case TCKind._tk_boolean: - orbStream.read_boolean(); - break; - case TCKind._tk_char: - // Backwards compatibility. Older Sun ORBs sent - // _tk_char even though they read and wrote wchars - // correctly. - // - // Fall through to the _tk_wchar case. - case TCKind._tk_wchar: - orbStream.read_wchar(); - break; - case TCKind._tk_short: - orbStream.read_short(); - break; - case TCKind._tk_long: - orbStream.read_long(); - break; - case TCKind._tk_longlong: - orbStream.read_longlong(); - break; - case TCKind._tk_float: - orbStream.read_float(); - break; - case TCKind._tk_double: - orbStream.read_double(); - break; - case TCKind._tk_value: - case TCKind._tk_objref: - case TCKind._tk_value_box: - Class type = null; - String id = fields[i].id; - - try { - type = vhandler.getClassFromType(id); - } - catch(ClassNotFoundException cnfe){ - // Make sure type = null - type = null; - } - String signature = null; - if (type != null) - signature = ValueUtility.getSignature(fields[i]); - - // Read value - try { - if ((signature != null) && ( signature.equals("Ljava/lang/Object;") || - signature.equals("Ljava/io/Serializable;") || - signature.equals("Ljava/io/Externalizable;")) ) { - javax.rmi.CORBA.Util.readAny(orbStream); - } - else { - // Decide what method call to make based on the type. - // - // NOTE : Since FullValueDescription does not allow us - // to ask whether something is an interface we do not - // have the ability to optimize this check. - - int callType = ValueHandlerImpl.kValueType; - - if (!vhandler.isSequence(id)) { - FullValueDescription fieldFVD = sender.meta(fields[i].id); - if (kRemoteTypeCode == fields[i].type) { - - // RMI Object reference... - callType = ValueHandlerImpl.kRemoteType; - } else if (fieldFVD.is_abstract) { - // RMI Abstract Object reference... - - callType = ValueHandlerImpl.kAbstractType; - } - } - - // Now that we have used the FVD of the field to determine the proper course - // of action, it is ok to use the type (Class) from this point forward since - // the rep. id for this read will also follow on the wire. - - switch (callType) { - case ValueHandlerImpl.kRemoteType: - orbStream.read_Object(); - break; - case ValueHandlerImpl.kAbstractType: - orbStream.read_abstract_interface(); - break; - case ValueHandlerImpl.kValueType: - if (type != null) { - orbStream.read_value(type); - } else { - orbStream.read_value(); - } - break; - default: - // XXX I18N, logging needed. - throw new StreamCorruptedException("Unknown callType: " - + callType); - } - } - - } - catch(IndirectionException cdrie) { - // Since we are throwing this away, don't bother handling recursion. - continue; - } - - break; - default: - // XXX I18N, logging needed. - throw new StreamCorruptedException("Unknown kind: " - + fields[i].type.kind().value()); - - } - } catch (IllegalArgumentException e) { - /* This case should never happen. If the field types - are not the same, InvalidClassException is raised when - matching the local class to the serialized ObjectStreamClass. */ - // XXX I18N, logging needed. - ClassCastException cce = new ClassCastException("Assigning instance of class " + - fields[i].id + " to field " + currentClassDesc.getName() + - '#' + fields[i].name); - cce.initCause(e) ; - throw cce ; - } - } - } - - private static void setObjectField(Object o, Class c, String fieldName, Object v) { - try { - Field fld = getDeclaredField( c, fieldName ) ; - Class fieldCl = fld.getType(); - if(v != null && !fieldCl.isInstance(v)) { - throw new Exception(); - } - long key = bridge.objectFieldOffset( fld ) ; - bridge.putObject( o, key, v ) ; - } catch (Exception e) { - if (o != null) { - throw utilWrapper.errorSetObjectField( e, fieldName, - o.toString(), - v.toString() ) ; - } else { - throw utilWrapper.errorSetObjectField( e, fieldName, - "null " + c.getName() + " object", - v.toString() ) ; - } - } - } - - private static void setBooleanField(Object o, Class c, String fieldName, boolean v) - { - try { - Field fld = getDeclaredField( c, fieldName ) ; - if ((fld != null) && (fld.getType() == Boolean.TYPE)) { - long key = bridge.objectFieldOffset( fld ) ; - bridge.putBoolean( o, key, v ) ; - } else { - throw new InvalidObjectException("Field Type mismatch"); - } - } catch (Exception e) { - if (o != null) { - throw utilWrapper.errorSetBooleanField( e, fieldName, - o.toString(), - new Boolean(v) ) ; - } else { - throw utilWrapper.errorSetBooleanField( e, fieldName, - "null " + c.getName() + " object", - new Boolean(v) ) ; - } - } - } - - private static void setByteField(Object o, Class c, String fieldName, byte v) - { - try { - Field fld = getDeclaredField( c, fieldName ) ; - if ((fld != null) && (fld.getType() == Byte.TYPE)) { - long key = bridge.objectFieldOffset( fld ) ; - bridge.putByte( o, key, v ) ; - } else { - throw new InvalidObjectException("Field Type mismatch"); - } - } catch (Exception e) { - if (o != null) { - throw utilWrapper.errorSetByteField( e, fieldName, - o.toString(), - new Byte(v) ) ; - } else { - throw utilWrapper.errorSetByteField( e, fieldName, - "null " + c.getName() + " object", - new Byte(v) ) ; - } - } - } - - private static void setCharField(Object o, Class c, String fieldName, char v) - { - try { - Field fld = getDeclaredField( c, fieldName ) ; - if ((fld != null) && (fld.getType() == Character.TYPE)) { - long key = bridge.objectFieldOffset( fld ) ; - bridge.putChar( o, key, v ) ; - } else { - throw new InvalidObjectException("Field Type mismatch"); - } - } catch (Exception e) { - if (o != null) { - throw utilWrapper.errorSetCharField( e, fieldName, - o.toString(), - new Character(v) ) ; - } else { - throw utilWrapper.errorSetCharField( e, fieldName, - "null " + c.getName() + " object", - new Character(v) ) ; - } - } - } - - private static void setShortField(Object o, Class c, String fieldName, short v) - { - try { - Field fld = getDeclaredField( c, fieldName ) ; - if ((fld != null) && (fld.getType() == Short.TYPE)) { - long key = bridge.objectFieldOffset( fld ) ; - bridge.putShort( o, key, v ) ; - } else { - throw new InvalidObjectException("Field Type mismatch"); - } - } catch (Exception e) { - if (o != null) { - throw utilWrapper.errorSetShortField( e, fieldName, - o.toString(), - new Short(v) ) ; - } else { - throw utilWrapper.errorSetShortField( e, fieldName, - "null " + c.getName() + " object", - new Short(v) ) ; - } - } - } - - private static void setIntField(Object o, Class c, String fieldName, int v) - { - try { - Field fld = getDeclaredField( c, fieldName ) ; - if ((fld != null) && (fld.getType() == Integer.TYPE)) { - long key = bridge.objectFieldOffset( fld ) ; - bridge.putInt( o, key, v ) ; - } else { - throw new InvalidObjectException("Field Type mismatch"); - } - } catch (Exception e) { - if (o != null) { - throw utilWrapper.errorSetIntField( e, fieldName, - o.toString(), - new Integer(v) ) ; - } else { - throw utilWrapper.errorSetIntField( e, fieldName, - "null " + c.getName() + " object", - new Integer(v) ) ; - } - } - } - - private static void setLongField(Object o, Class c, String fieldName, long v) - { - try { - Field fld = getDeclaredField( c, fieldName ) ; - if ((fld != null) && (fld.getType() == Long.TYPE)) { - long key = bridge.objectFieldOffset( fld ) ; - bridge.putLong( o, key, v ) ; - } else { - throw new InvalidObjectException("Field Type mismatch"); - } - } catch (Exception e) { - if (o != null) { - throw utilWrapper.errorSetLongField( e, fieldName, - o.toString(), - new Long(v) ) ; - } else { - throw utilWrapper.errorSetLongField( e, fieldName, - "null " + c.getName() + " object", - new Long(v) ) ; - } - } - } - - private static void setFloatField(Object o, Class c, String fieldName, float v) - { - try { - Field fld = getDeclaredField( c, fieldName ) ; - if ((fld != null) && (fld.getType() == Float.TYPE)) { - long key = bridge.objectFieldOffset( fld ) ; - bridge.putFloat( o, key, v ) ; - } else { - throw new InvalidObjectException("Field Type mismatch"); - } - } catch (Exception e) { - if (o != null) { - throw utilWrapper.errorSetFloatField( e, fieldName, - o.toString(), - new Float(v) ) ; - } else { - throw utilWrapper.errorSetFloatField( e, fieldName, - "null " + c.getName() + " object", - new Float(v) ) ; - } - } - } - - private static void setDoubleField(Object o, Class c, String fieldName, double v) - { - try { - Field fld = getDeclaredField( c, fieldName ) ; - if ((fld != null) && (fld.getType() == Double.TYPE)) { - long key = bridge.objectFieldOffset( fld ) ; - bridge.putDouble( o, key, v ) ; - } else { - throw new InvalidObjectException("Field Type mismatch"); - } - } catch (Exception e) { - if (o != null) { - throw utilWrapper.errorSetDoubleField( e, fieldName, - o.toString(), - new Double(v) ) ; - } else { - throw utilWrapper.errorSetDoubleField( e, fieldName, - "null " + c.getName() + " object", - new Double(v) ) ; - } - } - } - - - private static Field getDeclaredField(final Class c, - final String fieldName) - throws PrivilegedActionException, NoSuchFieldException, SecurityException { - if (System.getSecurityManager() == null) { - return c.getDeclaredField(fieldName); - } else { - return AccessController - .doPrivileged(new PrivilegedExceptionAction() { - public Field run() throws NoSuchFieldException { - return c.getDeclaredField(fieldName); - } - }); - } - } - - /** - * This class maintains a map of stream position to - * an Object currently being deserialized. It is used - * to handle the cases where the are indirections to - * an object on the recursion stack. The CDR level - * handles indirections to objects previously seen - * (and completely deserialized) in the stream. - */ - static class ActiveRecursionManager - { - private Map offsetToObjectMap; - - public ActiveRecursionManager() { - // A hash map is unsynchronized and allows - // null values - offsetToObjectMap = new HashMap<>(); - } - - // Called right after allocating a new object. - // Offset is the starting position in the stream - // of the object. - public void addObject(int offset, Object value) { - offsetToObjectMap.put(new Integer(offset), value); - } - - // If the given starting position doesn't refer - // to the beginning of an object currently being - // deserialized, this throws an IOException. - // Otherwise, it returns a reference to the - // object. - public Object getObject(int offset) throws IOException { - Integer position = new Integer(offset); - - if (!offsetToObjectMap.containsKey(position)) - // XXX I18N, logging needed. - throw new IOException("Invalid indirection to offset " - + offset); - - return offsetToObjectMap.get(position); - } - - // Called when an object has been completely - // deserialized, so it should no longer be in - // this mapping. The CDR level can handle - // further indirections. - public void removeObject(int offset) { - offsetToObjectMap.remove(new Integer(offset)); - } - - // If the given offset doesn't map to an Object, - // then it isn't an indirection to an object - // currently being deserialized. - public boolean containsObject(int offset) { - return offsetToObjectMap.containsKey(new Integer(offset)); - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/io/IIOPOutputStream.java b/src/java.corba/share/classes/com/sun/corba/se/impl/io/IIOPOutputStream.java deleted file mode 100644 index e5f77093aae..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/io/IIOPOutputStream.java +++ /dev/null @@ -1,801 +0,0 @@ -/* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.io; - -import org.omg.CORBA.portable.OutputStream; - -import java.security.AccessController ; -import java.security.PrivilegedAction ; - -import java.io.IOException; -import java.io.InvalidClassException; -import java.io.Externalizable; -import java.io.NotSerializableException; -import java.io.NotActiveException; - -import java.lang.reflect.InvocationTargetException; - -import javax.rmi.CORBA.Util; - -import sun.corba.Bridge ; - -import com.sun.corba.se.impl.util.Utility; -import com.sun.corba.se.impl.util.RepositoryId; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.impl.logging.UtilSystemException ; - -/** - * IIOPOutputStream is ... - * - * @author Stephen Lewallen - * @since JDK1.1.6 - */ - -public class IIOPOutputStream - extends com.sun.corba.se.impl.io.OutputStreamHook -{ - private UtilSystemException wrapper = UtilSystemException.get( - CORBALogDomains.RPC_ENCODING ) ; - - private static Bridge bridge = - (Bridge)AccessController.doPrivileged( - new PrivilegedAction() { - public Object run() { - return Bridge.get() ; - } - } - ) ; - - private org.omg.CORBA_2_3.portable.OutputStream orbStream; - - private Object currentObject = null; - - private ObjectStreamClass currentClassDesc = null; - - private int recursionDepth = 0; - - private int simpleWriteDepth = 0; - - private IOException abortIOException = null; - - private java.util.Stack classDescStack = new java.util.Stack(); - - // Used when calling an object's writeObject method - private Object[] writeObjectArgList = {this}; - - public IIOPOutputStream() - throws java.io.IOException - { - super(); - } - - // If using RMI-IIOP stream format version 2, this tells - // the ORB stream (which must be a ValueOutputStream) to - // begin a new valuetype to contain the optional data - // of the writeObject method. - protected void beginOptionalCustomData() { - - if (streamFormatVersion == 2) { - - org.omg.CORBA.portable.ValueOutputStream vout - = (org.omg.CORBA.portable.ValueOutputStream)orbStream; - - vout.start_value(currentClassDesc.getRMIIIOPOptionalDataRepId()); - } - } - - final void setOrbStream(org.omg.CORBA_2_3.portable.OutputStream os) { - orbStream = os; - } - - final org.omg.CORBA_2_3.portable.OutputStream getOrbStream() { - return orbStream; - } - - final void increaseRecursionDepth(){ - recursionDepth++; - } - - final int decreaseRecursionDepth(){ - return --recursionDepth; - } - - /** - * Override the actions of the final method "writeObject()" - * in ObjectOutputStream. - * @since JDK1.1.6 - */ - public final void writeObjectOverride(Object obj) - throws IOException - { - writeObjectState.writeData(this); - - Util.writeAbstractObject((OutputStream)orbStream, obj); - } - - /** - * Override the actions of the final method "writeObject()" - * in ObjectOutputStream. - * @since JDK1.1.6 - */ - public final void simpleWriteObject(Object obj, byte formatVersion) - /* throws IOException */ - { - byte oldStreamFormatVersion = streamFormatVersion; - - streamFormatVersion = formatVersion; - - Object prevObject = currentObject; - ObjectStreamClass prevClassDesc = currentClassDesc; - simpleWriteDepth++; - - try { - // if (!checkSpecialClasses(obj) && !checkSubstitutableSpecialClasses(obj)) - outputObject(obj); - - } catch (IOException ee) { - if (abortIOException == null) - abortIOException = ee; - } finally { - /* Restore state of previous call incase this is a nested call */ - streamFormatVersion = oldStreamFormatVersion; - simpleWriteDepth--; - currentObject = prevObject; - currentClassDesc = prevClassDesc; - } - - /* If the recursion depth is 0, test for and clear the pending exception. - * If there is a pending exception throw it. - */ - IOException pending = abortIOException; - if (simpleWriteDepth == 0) - abortIOException = null; - if (pending != null) { - bridge.throwException( pending ) ; - } - } - - // Required by the superclass. - ObjectStreamField[] getFieldsNoCopy() { - return currentClassDesc.getFieldsNoCopy(); - } - - /** - * Override the actions of the final method "defaultWriteObject()" - * in ObjectOutputStream. - * @since JDK1.1.6 - */ - public final void defaultWriteObjectDelegate() - /* throws IOException */ - { - try { - if (currentObject == null || currentClassDesc == null) - // XXX I18N, Logging needed. - throw new NotActiveException("defaultWriteObjectDelegate"); - - ObjectStreamField[] fields = - currentClassDesc.getFieldsNoCopy(); - if (fields.length > 0) { - outputClassFields(currentObject, currentClassDesc.forClass(), - fields); - } - } catch(IOException ioe) { - bridge.throwException(ioe); - } - } - - /** - * Override the actions of the final method "enableReplaceObject()" - * in ObjectOutputStream. - * @since JDK1.1.6 - */ - public final boolean enableReplaceObjectDelegate(boolean enable) - /* throws SecurityException */ - { - return false; - - } - - - protected final void annotateClass(Class cl) throws IOException{ - // XXX I18N, Logging needed. - throw new IOException("Method annotateClass not supported"); - } - - public final void close() throws IOException{ - // no op - } - - protected final void drain() throws IOException{ - // no op - } - - public final void flush() throws IOException{ - try{ - orbStream.flush(); - } catch(Error e) { - IOException ioexc = new IOException(e.getMessage()); - ioexc.initCause(e) ; - throw ioexc ; - } - } - - protected final Object replaceObject(Object obj) throws IOException{ - // XXX I18N, Logging needed. - throw new IOException("Method replaceObject not supported"); - } - - /** - * Reset will disregard the state of any objects already written - * to the stream. The state is reset to be the same as a new - * ObjectOutputStream. The current point in the stream is marked - * as reset so the corresponding ObjectInputStream will be reset - * at the same point. Objects previously written to the stream - * will not be refered to as already being in the stream. They - * will be written to the stream again. - * @since JDK1.1 - */ - public final void reset() throws IOException{ - try{ - //orbStream.reset(); - - if (currentObject != null || currentClassDesc != null) - // XXX I18N, Logging needed. - throw new IOException("Illegal call to reset"); - - abortIOException = null; - - if (classDescStack == null) - classDescStack = new java.util.Stack(); - else - classDescStack.setSize(0); - - } catch(Error e) { - IOException ioexc = new IOException(e.getMessage()); - ioexc.initCause(e) ; - throw ioexc ; - } - } - - public final void write(byte b[]) throws IOException{ - try{ - writeObjectState.writeData(this); - - orbStream.write_octet_array(b, 0, b.length); - } catch(Error e) { - IOException ioexc = new IOException(e.getMessage()); - ioexc.initCause(e) ; - throw ioexc ; - } - } - - public final void write(byte b[], int off, int len) throws IOException{ - try{ - writeObjectState.writeData(this); - - orbStream.write_octet_array(b, off, len); - } catch(Error e) { - IOException ioexc = new IOException(e.getMessage()); - ioexc.initCause(e) ; - throw ioexc ; - } - } - - public final void write(int data) throws IOException{ - try{ - writeObjectState.writeData(this); - - orbStream.write_octet((byte)(data & 0xFF)); - } catch(Error e) { - IOException ioexc = new IOException(e.getMessage()); - ioexc.initCause(e) ; - throw ioexc ; - } - } - - public final void writeBoolean(boolean data) throws IOException{ - try{ - writeObjectState.writeData(this); - - orbStream.write_boolean(data); - } catch(Error e) { - IOException ioexc = new IOException(e.getMessage()); - ioexc.initCause(e) ; - throw ioexc ; - } - } - - public final void writeByte(int data) throws IOException{ - try{ - writeObjectState.writeData(this); - - orbStream.write_octet((byte)data); - } catch(Error e) { - IOException ioexc = new IOException(e.getMessage()); - ioexc.initCause(e) ; - throw ioexc ; - } - } - - public final void writeBytes(String data) throws IOException{ - try{ - writeObjectState.writeData(this); - - byte buf[] = data.getBytes(); - orbStream.write_octet_array(buf, 0, buf.length); - } catch(Error e) { - IOException ioexc = new IOException(e.getMessage()); - ioexc.initCause(e) ; - throw ioexc ; - } - } - - public final void writeChar(int data) throws IOException{ - try{ - writeObjectState.writeData(this); - - orbStream.write_wchar((char)data); - } catch(Error e) { - IOException ioexc = new IOException(e.getMessage()); - ioexc.initCause(e) ; - throw ioexc ; - } - } - - public final void writeChars(String data) throws IOException{ - try{ - writeObjectState.writeData(this); - - char buf[] = data.toCharArray(); - orbStream.write_wchar_array(buf, 0, buf.length); - } catch(Error e) { - IOException ioexc = new IOException(e.getMessage()); - ioexc.initCause(e) ; - throw ioexc ; - } - } - - public final void writeDouble(double data) throws IOException{ - try{ - writeObjectState.writeData(this); - - orbStream.write_double(data); - } catch(Error e) { - IOException ioexc = new IOException(e.getMessage()); - ioexc.initCause(e) ; - throw ioexc ; - } - } - - public final void writeFloat(float data) throws IOException{ - try{ - writeObjectState.writeData(this); - - orbStream.write_float(data); - } catch(Error e) { - IOException ioexc = new IOException(e.getMessage()); - ioexc.initCause(e) ; - throw ioexc ; - } - } - - public final void writeInt(int data) throws IOException{ - try{ - writeObjectState.writeData(this); - - orbStream.write_long(data); - } catch(Error e) { - IOException ioexc = new IOException(e.getMessage()); - ioexc.initCause(e) ; - throw ioexc ; - } - } - - public final void writeLong(long data) throws IOException{ - try{ - writeObjectState.writeData(this); - - orbStream.write_longlong(data); - } catch(Error e) { - IOException ioexc = new IOException(e.getMessage()); - ioexc.initCause(e) ; - throw ioexc ; - } - } - - public final void writeShort(int data) throws IOException{ - try{ - writeObjectState.writeData(this); - - orbStream.write_short((short)data); - } catch(Error e) { - IOException ioexc = new IOException(e.getMessage()); - ioexc.initCause(e) ; - throw ioexc ; - } - } - - protected final void writeStreamHeader() throws IOException{ - // no op - } - - /** - * Helper method for correcting the Kestrel bug 4367783 (dealing - * with larger than 8-bit chars). The old behavior is preserved - * in orbutil.IIOPInputStream_1_3 in order to interoperate with - * our legacy ORBs. - */ - protected void internalWriteUTF(org.omg.CORBA.portable.OutputStream stream, - String data) - { - stream.write_wstring(data); - } - - public final void writeUTF(String data) throws IOException{ - try{ - writeObjectState.writeData(this); - - internalWriteUTF(orbStream, data); - } catch(Error e) { - IOException ioexc = new IOException(e.getMessage()); - ioexc.initCause(e) ; - throw ioexc ; - } - } - - // INTERNAL UTILITY METHODS - /* - * Check for special cases of serializing objects. - * These objects are not subject to replacement. - */ - private boolean checkSpecialClasses(Object obj) throws IOException { - - /* - * If this is a class, don't allow substitution - */ - //if (obj instanceof Class) { - // throw new IOException("Serialization of Class not supported"); - //} - - if (obj instanceof ObjectStreamClass) { - // XXX I18N, Logging needed. - throw new IOException("Serialization of ObjectStreamClass not supported"); - } - - return false; - } - - /* - * Check for special cases of substitutable serializing objects. - * These classes are replaceable. - */ - private boolean checkSubstitutableSpecialClasses(Object obj) - throws IOException - { - if (obj instanceof String) { - orbStream.write_value((java.io.Serializable)obj); - return true; - } - - //if (obj.getClass().isArray()) { - // outputArray(obj); - // return true; - //} - - return false; - } - - /* - * Write out the object - */ - private void outputObject(final Object obj) throws IOException{ - - currentObject = obj; - Class currclass = obj.getClass(); - - /* Get the Class descriptor for this class, - * Throw a NotSerializableException if there is none. - */ - currentClassDesc = ObjectStreamClass.lookup(currclass); - if (currentClassDesc == null) { - // XXX I18N, Logging needed. - throw new NotSerializableException(currclass.getName()); - } - - /* If the object is externalizable, - * call writeExternal. - * else do Serializable processing. - */ - if (currentClassDesc.isExternalizable()) { - // Write format version - orbStream.write_octet(streamFormatVersion); - - Externalizable ext = (Externalizable)obj; - ext.writeExternal(this); - - } else { - - /* The object's classes should be processed from supertype to subtype - * Push all the clases of the current object onto a stack. - * Remember the stack pointer where this set of classes is being pushed. - */ - if (currentClassDesc.forClass().getName().equals("java.lang.String")) { - this.writeUTF((String)obj); - return; - } - int stackMark = classDescStack.size(); - try { - ObjectStreamClass next; - while ((next = currentClassDesc.getSuperclass()) != null) { - classDescStack.push(currentClassDesc); - currentClassDesc = next; - } - - /* - * For currentClassDesc and all the pushed class descriptors - * If the class is writing its own data - * set blockData = true; call the class writeObject method - * If not - * invoke either the defaultWriteObject method. - */ - do { - - WriteObjectState oldState = writeObjectState; - - try { - - setState(NOT_IN_WRITE_OBJECT); - - if (currentClassDesc.hasWriteObject()) { - invokeObjectWriter(currentClassDesc, obj ); - } else { - defaultWriteObjectDelegate(); - } - } finally { - setState(oldState); - } - - } while (classDescStack.size() > stackMark && - (currentClassDesc = (ObjectStreamClass)classDescStack.pop()) != null); - } finally { - classDescStack.setSize(stackMark); - } - } - } - - /* - * Invoke writer. - * _REVISIT_ invokeObjectWriter and invokeObjectReader behave inconsistently with each other since - * the reader returns a boolean...fix later - */ - private void invokeObjectWriter(ObjectStreamClass osc, Object obj) - throws IOException - { - Class c = osc.forClass() ; - - try { - - // Write format version - orbStream.write_octet(streamFormatVersion); - - writeObjectState.enterWriteObject(this); - - // writeObject(obj, c, this); - osc.invokeWriteObject( obj, this ) ; - - writeObjectState.exitWriteObject(this); - - } catch (InvocationTargetException e) { - Throwable t = e.getTargetException(); - if (t instanceof IOException) - throw (IOException)t; - else if (t instanceof RuntimeException) - throw (RuntimeException) t; - else if (t instanceof Error) - throw (Error) t; - else - // XXX I18N, Logging needed. - throw new Error("invokeObjectWriter internal error",e); - } - } - - void writeField(ObjectStreamField field, Object value) throws IOException { - switch (field.getTypeCode()) { - case 'B': - if (value == null) - orbStream.write_octet((byte)0); - else - orbStream.write_octet(((Byte)value).byteValue()); - break; - case 'C': - if (value == null) - orbStream.write_wchar((char)0); - else - orbStream.write_wchar(((Character)value).charValue()); - break; - case 'F': - if (value == null) - orbStream.write_float((float)0); - else - orbStream.write_float(((Float)value).floatValue()); - break; - case 'D': - if (value == null) - orbStream.write_double((double)0); - else - orbStream.write_double(((Double)value).doubleValue()); - break; - case 'I': - if (value == null) - orbStream.write_long((int)0); - else - orbStream.write_long(((Integer)value).intValue()); - break; - case 'J': - if (value == null) - orbStream.write_longlong((long)0); - else - orbStream.write_longlong(((Long)value).longValue()); - break; - case 'S': - if (value == null) - orbStream.write_short((short)0); - else - orbStream.write_short(((Short)value).shortValue()); - break; - case 'Z': - if (value == null) - orbStream.write_boolean(false); - else - orbStream.write_boolean(((Boolean)value).booleanValue()); - break; - case '[': - case 'L': - // What to do if it's null? - writeObjectField(field, value); - break; - default: - // XXX I18N, Logging needed. - throw new InvalidClassException(currentClassDesc.getName()); - } - } - - private void writeObjectField(ObjectStreamField field, - Object objectValue) throws IOException { - - if (ObjectStreamClassCorbaExt.isAny(field.getTypeString())) { - javax.rmi.CORBA.Util.writeAny(orbStream, objectValue); - } - else { - Class type = field.getType(); - int callType = ValueHandlerImpl.kValueType; - - if (type.isInterface()) { - String className = type.getName(); - - if (java.rmi.Remote.class.isAssignableFrom(type)) { - - // RMI Object reference... - - callType = ValueHandlerImpl.kRemoteType; - - - } else if (org.omg.CORBA.Object.class.isAssignableFrom(type)){ - - // IDL Object reference... - callType = ValueHandlerImpl.kRemoteType; - - } else if (RepositoryId.isAbstractBase(type)) { - // IDL Abstract Object reference... - callType = ValueHandlerImpl.kAbstractType; - } else if (ObjectStreamClassCorbaExt.isAbstractInterface(type)) { - callType = ValueHandlerImpl.kAbstractType; - } - } - - switch (callType) { - case ValueHandlerImpl.kRemoteType: - Util.writeRemoteObject(orbStream, objectValue); - break; - case ValueHandlerImpl.kAbstractType: - Util.writeAbstractObject(orbStream, objectValue); - break; - case ValueHandlerImpl.kValueType: - try{ - orbStream.write_value((java.io.Serializable)objectValue, type); - } - catch(ClassCastException cce){ - if (objectValue instanceof java.io.Serializable) - throw cce; - else - Utility.throwNotSerializableForCorba(objectValue.getClass().getName()); - } - } - } - } - - /* Write the fields of the specified class by invoking the appropriate - * write* method on this class. - */ - private void outputClassFields(Object o, Class cl, - ObjectStreamField[] fields) - throws IOException { - - for (int i = 0; i < fields.length; i++) { - if (fields[i].getField() == null) - throw new InvalidClassException(cl.getName(), - "Nonexistent field " + fields[i].getName()); - switch (fields[i].getTypeCode()) { - case 'B': - byte byteValue = bridge.getByte(o, fields[i].getFieldID()) ; - orbStream.write_octet(byteValue); - break; - case 'C': - char charValue = bridge.getChar(o, fields[i].getFieldID()) ; - orbStream.write_wchar(charValue); - break; - case 'F': - float floatValue = bridge.getFloat(o, fields[i].getFieldID()) ; - orbStream.write_float(floatValue); - break; - case 'D' : - double doubleValue = bridge.getDouble(o, fields[i].getFieldID()) ; - orbStream.write_double(doubleValue); - break; - case 'I': - int intValue = bridge.getInt(o, fields[i].getFieldID()) ; - orbStream.write_long(intValue); - break; - case 'J': - long longValue = bridge.getLong(o, fields[i].getFieldID()) ; - orbStream.write_longlong(longValue); - break; - case 'S': - short shortValue = bridge.getShort(o, fields[i].getFieldID()) ; - orbStream.write_short(shortValue); - break; - case 'Z': - boolean booleanValue = bridge.getBoolean(o, fields[i].getFieldID()) ; - orbStream.write_boolean(booleanValue); - break; - case '[': - case 'L': - Object objectValue = bridge.getObject(o, fields[i].getFieldID()) ; - writeObjectField(fields[i], objectValue); - break; - default: - throw new InvalidClassException(cl.getName()); - } - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/io/InputStreamHook.java b/src/java.corba/share/classes/com/sun/corba/se/impl/io/InputStreamHook.java deleted file mode 100644 index f4198e386de..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/io/InputStreamHook.java +++ /dev/null @@ -1,469 +0,0 @@ -/* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.io; - -import java.io.IOException; -import java.io.StreamCorruptedException; -import java.io.NotActiveException; -import java.io.InputStream; -import java.io.ObjectInputStream; -import java.util.*; -import java.lang.reflect.Array; -import java.lang.reflect.Constructor; - -import org.omg.CORBA.portable.ValueInputStream; - -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.orb.ORBVersion; -import com.sun.corba.se.spi.orb.ORBVersionFactory; -import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.impl.logging.UtilSystemException; -import com.sun.corba.se.impl.logging.OMGSystemException; - -public abstract class InputStreamHook extends ObjectInputStream -{ - // These should be visible in all the nested classes - static final OMGSystemException omgWrapper = - OMGSystemException.get( CORBALogDomains.RPC_ENCODING ) ; - - static final UtilSystemException utilWrapper = - UtilSystemException.get( CORBALogDomains.RPC_ENCODING ) ; - - private class HookGetFields extends ObjectInputStream.GetField { - private Map fields = null; - - HookGetFields(Map fields){ - this.fields = fields; - } - - /** - * Get the ObjectStreamClass that describes the fields in the stream. - * - * REVISIT! This doesn't work since we have our own ObjectStreamClass. - */ - public java.io.ObjectStreamClass getObjectStreamClass() { - return null; - } - - /** - * Return true if the named field is defaulted and has no value - * in this stream. - */ - public boolean defaulted(String name) - throws IOException, IllegalArgumentException { - return (!fields.containsKey(name)); - } - - /** - * Get the value of the named boolean field from the persistent field. - */ - public boolean get(String name, boolean defvalue) - throws IOException, IllegalArgumentException { - if (defaulted(name)) - return defvalue; - else return ((Boolean)fields.get(name)).booleanValue(); - } - - /** - * Get the value of the named char field from the persistent fields. - */ - public char get(String name, char defvalue) - throws IOException, IllegalArgumentException { - if (defaulted(name)) - return defvalue; - else return ((Character)fields.get(name)).charValue(); - - } - - /** - * Get the value of the named byte field from the persistent fields. - */ - public byte get(String name, byte defvalue) - throws IOException, IllegalArgumentException { - if (defaulted(name)) - return defvalue; - else return ((Byte)fields.get(name)).byteValue(); - - } - - /** - * Get the value of the named short field from the persistent fields. - */ - public short get(String name, short defvalue) - throws IOException, IllegalArgumentException { - if (defaulted(name)) - return defvalue; - else return ((Short)fields.get(name)).shortValue(); - - } - - /** - * Get the value of the named int field from the persistent fields. - */ - public int get(String name, int defvalue) - throws IOException, IllegalArgumentException { - if (defaulted(name)) - return defvalue; - else return ((Integer)fields.get(name)).intValue(); - - } - - /** - * Get the value of the named long field from the persistent fields. - */ - public long get(String name, long defvalue) - throws IOException, IllegalArgumentException { - if (defaulted(name)) - return defvalue; - else return ((Long)fields.get(name)).longValue(); - - } - - /** - * Get the value of the named float field from the persistent fields. - */ - public float get(String name, float defvalue) - throws IOException, IllegalArgumentException { - if (defaulted(name)) - return defvalue; - else return ((Float)fields.get(name)).floatValue(); - - } - - /** - * Get the value of the named double field from the persistent field. - */ - public double get(String name, double defvalue) - throws IOException, IllegalArgumentException { - if (defaulted(name)) - return defvalue; - else return ((Double)fields.get(name)).doubleValue(); - - } - - /** - * Get the value of the named Object field from the persistent field. - */ - public Object get(String name, Object defvalue) - throws IOException, IllegalArgumentException { - if (defaulted(name)) - return defvalue; - else return fields.get(name); - - } - - public String toString(){ - return fields.toString(); - } - } - - public InputStreamHook() - throws IOException { - super(); - } - - public void defaultReadObject() - throws IOException, ClassNotFoundException, NotActiveException - { - readObjectState.beginDefaultReadObject(this); - - defaultReadObjectDelegate(); - - readObjectState.endDefaultReadObject(this); - } - - abstract void defaultReadObjectDelegate(); - - abstract void readFields(java.util.Map fieldToValueMap) - throws java.io.InvalidClassException, java.io.StreamCorruptedException, - ClassNotFoundException, java.io.IOException; - - - // See java.io.ObjectInputStream.GetField - // Remember that this is equivalent to defaultReadObject - // in RMI-IIOP - public ObjectInputStream.GetField readFields() - throws IOException, ClassNotFoundException, NotActiveException { - - HashMap fieldValueMap = new HashMap(); - - // We were treating readFields same as defaultReadObject. It is - // incorrect if the state is readOptionalData. If this line - // is uncommented, it will throw a stream corrupted exception. - // _REVISIT_: The ideal fix would be to add a new state. In - // writeObject user may do one of the following - // 1. Call defaultWriteObject() - // 2. Put out optional fields - // 3. Call writeFields - // We have the state defined for (1) and (2) but not for (3), so - // we should ideally introduce a new state for 3 and have the - // beginDefaultReadObject do nothing. - //readObjectState.beginDefaultReadObject(this); - - readFields(fieldValueMap); - - readObjectState.endDefaultReadObject(this); - - return new HookGetFields(fieldValueMap); - } - - // The following is a State pattern implementation of what - // should be done when the sender's Serializable has a - // writeObject method. This was especially necessary for - // RMI-IIOP stream format version 2. Please see the - // state diagrams in the docs directory of the workspace. - // - // On the reader's side, the main factors are whether or not - // we have a readObject method and whether or not the - // sender wrote default data - - protected void setState(ReadObjectState newState) { - readObjectState = newState; - } - - protected abstract byte getStreamFormatVersion(); - abstract org.omg.CORBA_2_3.portable.InputStream getOrbStream(); - - // Description of possible actions - protected static class ReadObjectState { - public void beginUnmarshalCustomValue(InputStreamHook stream, - boolean calledDefaultWriteObject, - boolean hasReadObject) throws IOException {} - - public void endUnmarshalCustomValue(InputStreamHook stream) throws IOException {} - public void beginDefaultReadObject(InputStreamHook stream) throws IOException {} - public void endDefaultReadObject(InputStreamHook stream) throws IOException {} - public void readData(InputStreamHook stream) throws IOException {} - } - - protected ReadObjectState readObjectState = DEFAULT_STATE; - - protected static final ReadObjectState DEFAULT_STATE = new DefaultState(); - protected static final ReadObjectState IN_READ_OBJECT_OPT_DATA - = new InReadObjectOptionalDataState(); - protected static final ReadObjectState IN_READ_OBJECT_NO_MORE_OPT_DATA - = new InReadObjectNoMoreOptionalDataState(); - protected static final ReadObjectState IN_READ_OBJECT_DEFAULTS_SENT - = new InReadObjectDefaultsSentState(); - protected static final ReadObjectState NO_READ_OBJECT_DEFAULTS_SENT - = new NoReadObjectDefaultsSentState(); - - protected static final ReadObjectState IN_READ_OBJECT_REMOTE_NOT_CUSTOM_MARSHALED - = new InReadObjectRemoteDidNotUseWriteObjectState(); - protected static final ReadObjectState IN_READ_OBJECT_PAST_DEFAULTS_REMOTE_NOT_CUSTOM - = new InReadObjectPastDefaultsRemoteDidNotUseWOState(); - - protected static class DefaultState extends ReadObjectState { - - public void beginUnmarshalCustomValue(InputStreamHook stream, - boolean calledDefaultWriteObject, - boolean hasReadObject) - throws IOException { - - if (hasReadObject) { - if (calledDefaultWriteObject) - stream.setState(IN_READ_OBJECT_DEFAULTS_SENT); - else { - try { - if (stream.getStreamFormatVersion() == 2) - ((ValueInputStream)stream.getOrbStream()).start_value(); - } catch( Exception e ) { - // This will happen for Big Integer which uses - // writeFields in it's writeObject. We should be past - // start_value by now. - // NOTE: If we don't log any exception here we should - // be fine. If there is an error, it will be caught - // while reading the optional data. - - } - stream.setState(IN_READ_OBJECT_OPT_DATA); - } - } else { - if (calledDefaultWriteObject) - stream.setState(NO_READ_OBJECT_DEFAULTS_SENT); - else - // XXX I18N and logging needed. - throw new StreamCorruptedException("No default data sent"); - } - } - } - - // REVISIT. If a readObject exits here without reading - // default data, we won't skip it. This could be done automatically - // as in line 1492 in IIOPInputStream. - protected static class InReadObjectRemoteDidNotUseWriteObjectState extends ReadObjectState { - - public void beginUnmarshalCustomValue(InputStreamHook stream, - boolean calledDefaultWriteObject, - boolean hasReadObject) - { - throw utilWrapper.badBeginUnmarshalCustomValue() ; - } - - public void endDefaultReadObject(InputStreamHook stream) { - stream.setState(IN_READ_OBJECT_PAST_DEFAULTS_REMOTE_NOT_CUSTOM); - } - - public void readData(InputStreamHook stream) { - stream.throwOptionalDataIncompatibleException(); - } - } - - protected static class InReadObjectPastDefaultsRemoteDidNotUseWOState extends ReadObjectState { - - public void beginUnmarshalCustomValue(InputStreamHook stream, - boolean calledDefaultWriteObject, - boolean hasReadObject) - { - throw utilWrapper.badBeginUnmarshalCustomValue() ; - } - - public void beginDefaultReadObject(InputStreamHook stream) throws IOException - { - // XXX I18N and logging needed. - throw new StreamCorruptedException("Default data already read"); - } - - - public void readData(InputStreamHook stream) { - stream.throwOptionalDataIncompatibleException(); - } - } - - protected void throwOptionalDataIncompatibleException() - { - throw omgWrapper.rmiiiopOptionalDataIncompatible2() ; - } - - - protected static class InReadObjectDefaultsSentState extends ReadObjectState { - - public void beginUnmarshalCustomValue(InputStreamHook stream, - boolean calledDefaultWriteObject, - boolean hasReadObject) { - // This should never happen. - throw utilWrapper.badBeginUnmarshalCustomValue() ; - } - - public void endUnmarshalCustomValue(InputStreamHook stream) { - - // In stream format version 2, we can skip over - // the optional data this way. In stream format version 1, - // we will probably wind up with an error if we're - // unmarshaling a superclass. - if (stream.getStreamFormatVersion() == 2) { - ((ValueInputStream)stream.getOrbStream()).start_value(); - ((ValueInputStream)stream.getOrbStream()).end_value(); - } - - stream.setState(DEFAULT_STATE); - } - - public void endDefaultReadObject(InputStreamHook stream) throws IOException { - - // Read the fake valuetype header in stream format version 2 - if (stream.getStreamFormatVersion() == 2) - ((ValueInputStream)stream.getOrbStream()).start_value(); - - stream.setState(IN_READ_OBJECT_OPT_DATA); - } - - public void readData(InputStreamHook stream) throws IOException { - org.omg.CORBA.ORB orb = stream.getOrbStream().orb(); - if ((orb == null) || - !(orb instanceof com.sun.corba.se.spi.orb.ORB)) { - throw new StreamCorruptedException( - "Default data must be read first"); - } - ORBVersion clientOrbVersion = - ((com.sun.corba.se.spi.orb.ORB)orb).getORBVersion(); - - // Fix Date interop bug. For older versions of the ORB don't do - // anything for readData(). Before this used to throw - // StreamCorruptedException for older versions of the ORB where - // calledDefaultWriteObject always returns true. - if ((ORBVersionFactory.getPEORB().compareTo(clientOrbVersion) <= 0) || - (clientOrbVersion.equals(ORBVersionFactory.getFOREIGN()))) { - // XXX I18N and logging needed. - throw new StreamCorruptedException("Default data must be read first"); - } - } - } - - protected static class InReadObjectOptionalDataState extends ReadObjectState { - - public void beginUnmarshalCustomValue(InputStreamHook stream, - boolean calledDefaultWriteObject, - boolean hasReadObject) - { - // This should never happen. - throw utilWrapper.badBeginUnmarshalCustomValue() ; - } - - public void endUnmarshalCustomValue(InputStreamHook stream) throws IOException - { - if (stream.getStreamFormatVersion() == 2) { - ((ValueInputStream)stream.getOrbStream()).end_value(); - } - stream.setState(DEFAULT_STATE); - } - - public void beginDefaultReadObject(InputStreamHook stream) throws IOException - { - // XXX I18N and logging needed. - throw new StreamCorruptedException("Default data not sent or already read/passed"); - } - - - } - - protected static class InReadObjectNoMoreOptionalDataState - extends InReadObjectOptionalDataState { - - public void readData(InputStreamHook stream) throws IOException { - stream.throwOptionalDataIncompatibleException(); - } - } - - protected static class NoReadObjectDefaultsSentState extends ReadObjectState { - public void endUnmarshalCustomValue(InputStreamHook stream) throws IOException { - // Code should read default fields before calling this - - if (stream.getStreamFormatVersion() == 2) { - ((ValueInputStream)stream.getOrbStream()).start_value(); - ((ValueInputStream)stream.getOrbStream()).end_value(); - } - - stream.setState(DEFAULT_STATE); - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java b/src/java.corba/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java deleted file mode 100644 index 62c0a62a227..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java +++ /dev/null @@ -1,1795 +0,0 @@ -/* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 2012 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.io; - -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.lang.invoke.MethodHandle; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.security.DigestOutputStream; -import java.security.AccessController; -import java.security.PermissionCollection; -import java.security.Permissions; -import java.security.PrivilegedAction; -import java.security.ProtectionDomain; - -import java.lang.reflect.Modifier; -import java.lang.reflect.Field; -import java.lang.reflect.Member; -import java.lang.reflect.Method; -import java.lang.reflect.Constructor; -import java.lang.reflect.Proxy; -import java.lang.reflect.InvocationTargetException; - -import java.io.IOException; -import java.io.DataOutputStream; -import java.io.ByteArrayOutputStream; -import java.io.InvalidClassException; -import java.io.Externalizable; -import java.io.Serializable; - -import java.util.Arrays; -import java.util.Comparator; -import java.util.HashSet; -import java.util.Set; - -import com.sun.corba.se.impl.util.RepositoryId; - -import org.omg.CORBA.ValueMember; - -import sun.corba.Bridge; - -/** - * An ObjectStreamClass describes a class that can be serialized to a stream - * or a class that was serialized to a stream. It contains the name - * and the serialVersionUID of the class. - *
            - * The ObjectStreamClass for a specific class loaded in this Java VM can - * be found using the lookup method. - * - * @author Roger Riggs - * @since JDK1.1 - */ -public class ObjectStreamClass implements java.io.Serializable { - private static final boolean DEBUG_SVUID = false ; - - public static final long kDefaultUID = -1; - - /** true if represents enum type */ - private boolean isEnum; - - private static final Bridge bridge = - AccessController.doPrivileged( - new PrivilegedAction() { - public Bridge run() { - return Bridge.get() ; - } - } - ) ; - - /** Find the descriptor for a class that can be serialized. Null - * is returned if the specified class does not implement - * java.io.Serializable or java.io.Externalizable. - */ - static final ObjectStreamClass lookup(Class cl) - { - ObjectStreamClass desc = lookupInternal(cl); - if (desc.isSerializable() || desc.isExternalizable()) - return desc; - return null; - } - - /* - * Find the class descriptor for the specified class. - * Package access only so it can be called from ObjectIn/OutStream. - */ - static ObjectStreamClass lookupInternal(Class cl) - { - /* Synchronize on the hashtable so no two threads will do - * this at the same time. - */ - ObjectStreamClass desc = null; - synchronized (descriptorFor) { - /* Find the matching descriptor if it already known */ - desc = findDescriptorFor(cl); - if (desc == null) { - /* Check if it's serializable */ - boolean serializable = Serializable.class.isAssignableFrom(cl); - - /* If the class is only Serializable, - * lookup the descriptor for the superclass. - */ - ObjectStreamClass superdesc = null; - if (serializable) { - Class superclass = cl.getSuperclass(); - if (superclass != null) - superdesc = lookup(superclass); - } - - /* Check if its' externalizable. - * If it's Externalizable, clear the serializable flag. - * Only one or the other may be set in the protocol. - */ - boolean externalizable = false; - if (serializable) { - externalizable = - ((superdesc != null) && superdesc.isExternalizable()) || - Externalizable.class.isAssignableFrom(cl); - if (externalizable) { - serializable = false; - } - } - - /* Create a new version descriptor, - * it put itself in the known table. - */ - desc = new ObjectStreamClass(cl, superdesc, - serializable, externalizable); - } - // Must always call init. See bug 4488137. This code was - // incorrectly changed to return immediately on a non-null - // cache result. That allowed threads to gain access to - // unintialized instances. - // - // History: Note, the following init() call was originally within - // the synchronization block, as it currently is now. Later, the - // init() call was moved outside the synchronization block, and - // the init() method used a private member variable lock, to - // avoid performance problems. See bug 4165204. But that lead to - // a deadlock situation, see bug 5104239. Hence, the init() method - // has now been moved back into the synchronization block. The - // right approach to solving these problems would be to rewrite - // this class, based on the latest java.io.ObjectStreamClass. - desc.init(); - } - return desc; - } - - /** - * The name of the class described by this descriptor. - */ - public final String getName() { - return name; - } - - /** - * Return the serialVersionUID for this class. - * The serialVersionUID defines a set of classes all with the same name - * that have evolved from a common root class and agree to be serialized - * and deserialized using a common format. - */ - public static final long getSerialVersionUID( java.lang.Class clazz) { - ObjectStreamClass theosc = ObjectStreamClass.lookup( clazz ); - if( theosc != null ) - { - return theosc.getSerialVersionUID( ); - } - return 0; - } - - /** - * Return the serialVersionUID for this class. - * The serialVersionUID defines a set of classes all with the same name - * that have evolved from a common root class and agree to be serialized - * and deserialized using a common format. - */ - public final long getSerialVersionUID() { - return suid; - } - - /** - * Return the serialVersionUID string for this class. - * The serialVersionUID defines a set of classes all with the same name - * that have evolved from a common root class and agree to be serialized - * and deserialized using a common format. - */ - public final String getSerialVersionUIDStr() { - if (suidStr == null) - suidStr = Long.toHexString(suid).toUpperCase(); - return suidStr; - } - - /** - * Return the actual (computed) serialVersionUID for this class. - */ - public static final long getActualSerialVersionUID( java.lang.Class clazz ) - { - ObjectStreamClass theosc = ObjectStreamClass.lookup( clazz ); - if( theosc != null ) - { - return theosc.getActualSerialVersionUID( ); - } - return 0; - } - - /** - * Return the actual (computed) serialVersionUID for this class. - */ - public final long getActualSerialVersionUID() { - return actualSuid; - } - - /** - * Return the actual (computed) serialVersionUID for this class. - */ - public final String getActualSerialVersionUIDStr() { - if (actualSuidStr == null) - actualSuidStr = Long.toHexString(actualSuid).toUpperCase(); - return actualSuidStr; - } - - /** - * Return the class in the local VM that this version is mapped to. - * Null is returned if there is no corresponding local class. - */ - public final Class forClass() { - return ofClass; - } - - /** - * Return an array of the fields of this serializable class. - * @return an array containing an element for each persistent - * field of this class. Returns an array of length zero if - * there are no fields. - * @since JDK1.2 - */ - public ObjectStreamField[] getFields() { - // Return a copy so the caller can't change the fields. - if (fields.length > 0) { - ObjectStreamField[] dup = new ObjectStreamField[fields.length]; - System.arraycopy(fields, 0, dup, 0, fields.length); - return dup; - } else { - return fields; - } - } - - public boolean hasField(ValueMember field) - { - try { - for (int i = 0; i < fields.length; i++) { - if (fields[i].getName().equals(field.name)) { - if (fields[i].getSignature().equals( - ValueUtility.getSignature(field))) - return true; - } - } - } catch (Exception exc) { - // Ignore this; all we want to do is return false - // Note that ValueUtility.getSignature can throw checked exceptions. - } - - return false; - } - - /* Avoid unnecessary allocations. */ - final ObjectStreamField[] getFieldsNoCopy() { - return fields; - } - - /** - * Get the field of this class by name. - * @return The ObjectStreamField object of the named field or null if there - * is no such named field. - */ - public final ObjectStreamField getField(String name) { - /* Binary search of fields by name. - */ - for (int i = fields.length-1; i >= 0; i--) { - if (name.equals(fields[i].getName())) { - return fields[i]; - } - } - return null; - } - - public final boolean invokeWriteObject(Object obj, ObjectOutputStream ois) throws InvocationTargetException { - if (!hasWriteObject()) { - return false; - } - try { - writeObjectMethod.invoke(obj, ois); - } catch (Throwable t) { - throw new InvocationTargetException(t, "writeObject"); - } - return true; - } - - public final boolean invokeReadObject(Object obj, ObjectInputStream ois) throws InvocationTargetException { - if (hasReadObject()) { - try { - readObjectMethod.invoke(obj, ois); - return true; - } catch (Throwable t) { - throw new InvocationTargetException(t, "readObject"); - } - } else { - return false; - } - } - - public Serializable writeReplace(Serializable value) { - if (writeReplaceObjectMethod != null) { - try { - return (Serializable) writeReplaceObjectMethod.invoke(value); - } catch (Throwable t) { - throw new InternalError("unexpected error", t); - } - } - else return value; - } - - public Object readResolve(Object value) { - if (readResolveObjectMethod != null) { - try { - return readResolveObjectMethod.invoke(value); - } catch (Throwable t) { - throw new InternalError("unexpected error", t); - } - } - else return value; - } - - /** - * Return a string describing this ObjectStreamClass. - */ - public final String toString() { - StringBuffer sb = new StringBuffer(); - - sb.append(name); - sb.append(": static final long serialVersionUID = "); - sb.append(Long.toString(suid)); - sb.append("L;"); - return sb.toString(); - } - - /* - * Create a new ObjectStreamClass from a loaded class. - * Don't call this directly, call lookup instead. - */ - private ObjectStreamClass(java.lang.Class cl, ObjectStreamClass superdesc, - boolean serial, boolean extern) - { - ofClass = cl; /* created from this class */ - - if (Proxy.isProxyClass(cl)) { - forProxyClass = true; - } - - name = cl.getName(); - isEnum = Enum.class.isAssignableFrom(cl); - superclass = superdesc; - serializable = serial; - if (!forProxyClass) { - // proxy classes are never externalizable - externalizable = extern; - } - - /* - * Enter this class in the table of known descriptors. - * Otherwise, when the fields are read it may recurse - * trying to find the descriptor for itself. - */ - insertDescriptorFor(this); - - /* - * The remainder of initialization occurs in init(), which is called - * after the lock on the global class descriptor table has been - * released. - */ - } - - static final class PersistentFieldsValue - extends ClassValue { - PersistentFieldsValue() { } - - protected ObjectStreamField[] computeValue(Class type) { - try { - bridge.ensureClassInitialized(type); - Field pf = type.getDeclaredField("serialPersistentFields"); - int mods = pf.getModifiers(); - if (Modifier.isPrivate(mods) && Modifier.isStatic(mods) && - Modifier.isFinal(mods)) { - long offset = bridge.staticFieldOffset(pf); - java.io.ObjectStreamField[] fields = - (java.io.ObjectStreamField[])bridge.getObject(type, offset); - return translateFields(fields); - } - } catch (NoSuchFieldException | - IllegalArgumentException | ClassCastException e) { - } - return null; - } - - private static ObjectStreamField[] translateFields(java.io.ObjectStreamField[] fields) { - if (fields == null) { - return null; - } - ObjectStreamField[] translation = - new ObjectStreamField[fields.length]; - for (int i = 0; i < fields.length; i++) { - translation[i] = new ObjectStreamField(fields[i].getName(), - fields[i].getType()); - } - return translation; - } - } - - private static final PersistentFieldsValue persistentFieldsValue = - new PersistentFieldsValue(); - - /** - * Creates a PermissionDomain that grants no permission. - */ - private ProtectionDomain noPermissionsDomain() { - PermissionCollection perms = new Permissions(); - perms.setReadOnly(); - return new ProtectionDomain(null, perms); - } - - /** - * Aggregate the ProtectionDomains of all the classes that separate - * a concrete class {@code cl} from its ancestor's class declaring - * a constructor {@code cons}. - * - * If {@code cl} is defined by the boot loader, or the constructor - * {@code cons} is declared by {@code cl}, or if there is no security - * manager, then this method does nothing and {@code null} is returned. - * - * @param cons A constructor declared by {@code cl} or one of its - * ancestors. - * @param cl A concrete class, which is either the class declaring - * the constructor {@code cons}, or a serializable subclass - * of that class. - * @return An array of ProtectionDomain representing the set of - * ProtectionDomain that separate the concrete class {@code cl} - * from its ancestor's declaring {@code cons}, or {@code null}. - */ - private ProtectionDomain[] getProtectionDomains(Constructor cons, - Class cl) { - ProtectionDomain[] domains = null; - if (cons != null && cl.getClassLoader() != null - && System.getSecurityManager() != null) { - Class cls = cl; - Class fnscl = cons.getDeclaringClass(); - Set pds = null; - while (cls != fnscl) { - ProtectionDomain pd = cls.getProtectionDomain(); - if (pd != null) { - if (pds == null) pds = new HashSet<>(); - pds.add(pd); - } - cls = cls.getSuperclass(); - if (cls == null) { - // that's not supposed to happen - // make a ProtectionDomain with no permission. - // should we throw instead? - if (pds == null) pds = new HashSet<>(); - else pds.clear(); - pds.add(noPermissionsDomain()); - break; - } - } - if (pds != null) { - domains = pds.toArray(new ProtectionDomain[0]); - } - } - return domains; - } - - /* - * Initialize class descriptor. This method is only invoked on class - * descriptors created via calls to lookupInternal(). This method is kept - * separate from the ObjectStreamClass constructor so that lookupInternal - * does not have to hold onto a global class descriptor table lock while the - * class descriptor is being initialized (see bug 4165204). - */ - - - private void init() { - synchronized (lock) { - - // See description at definition of initialized. - if (initialized) - return; - - final Class cl = ofClass; - - if (!serializable || - externalizable || - forProxyClass || - name.equals("java.lang.String")){ - fields = NO_FIELDS; - } else if (serializable) { - /* Ask for permission to override field access checks. - */ - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - /* Fill in the list of persistent fields. - * If it is declared, use the declared serialPersistentFields. - * Otherwise, extract the fields from the class itself. - */ - fields = persistentFieldsValue.get(cl); - - if (fields == null) { - /* Get all of the declared fields for this Class. - * Create a temporary ObjectStreamField array to hold each - * non-static, non-transient field. Then copy the - * temporary array into an array of the correct - * size once the number of fields is known. - */ - Field[] actualfields = cl.getDeclaredFields(); - - int numFields = 0; - ObjectStreamField[] tempFields = - new ObjectStreamField[actualfields.length]; - for (int i = 0; i < actualfields.length; i++) { - Field fld = actualfields[i] ; - int modifiers = fld.getModifiers(); - if (!Modifier.isStatic(modifiers) && - !Modifier.isTransient(modifiers)) { - tempFields[numFields++] = new ObjectStreamField(fld); - } - } - - fields = new ObjectStreamField[numFields]; - System.arraycopy(tempFields, 0, fields, 0, numFields); - - } else { - // For each declared persistent field, look for an actual - // reflected Field. If there is one, make sure it's the correct - // type and cache it in the ObjectStreamClass for that field. - for (int j = fields.length-1; j >= 0; j--) { - try { - Field reflField = cl.getDeclaredField(fields[j].getName()); - if (fields[j].getType() == reflField.getType()) { - fields[j].setField(reflField); - } - } catch (NoSuchFieldException e) { - // Nothing to do - } - } - } - return null; - } - }); - - if (fields.length > 1) - Arrays.sort(fields); - - /* Set up field data for use while writing using the API api. */ - computeFieldInfo(); - } - - /* Get the serialVersionUID from the class. - * It uses the access override mechanism so make sure - * the field objects is only used here. - * - * NonSerializable classes have a serialVerisonUID of 0L. - */ - if (isNonSerializable() || isEnum) { - suid = 0L; - } else { - // Lookup special Serializable members using reflection. - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - if (forProxyClass) { - // proxy classes always have serialVersionUID of 0L - suid = 0L; - } else { - try { - final Field f = cl.getDeclaredField("serialVersionUID"); - int mods = f.getModifiers(); - // SerialBug 5: static final SUID should be read - if (Modifier.isStatic(mods) && Modifier.isFinal(mods) ) { - long offset = bridge.staticFieldOffset(f); - suid = bridge.getLong(cl, offset); - // SerialBug 2: should be computed after writeObject - // actualSuid = computeStructuralUID(cl); - } else { - suid = _computeSerialVersionUID(cl); - // SerialBug 2: should be computed after writeObject - // actualSuid = computeStructuralUID(cl); - } - } catch (NoSuchFieldException ex) { - suid = _computeSerialVersionUID(cl); - // SerialBug 2: should be computed after writeObject - // actualSuid = computeStructuralUID(cl); - } - } - - writeReplaceObjectMethod = bridge.writeReplaceForSerialization(cl); - - readResolveObjectMethod = bridge.readResolveForSerialization(cl); - - domains = new ProtectionDomain[] {noPermissionsDomain()}; - - if (externalizable) - cons = getExternalizableConstructor(cl) ; - else - cons = getSerializableConstructor(cl) ; - - domains = getProtectionDomains(cons, cl); - - if (serializable && !forProxyClass) { - writeObjectMethod = bridge.writeObjectForSerialization(cl) ; - readObjectMethod = bridge.readObjectForSerialization(cl); - } - return null; - } - }); - } - - // This call depends on a lot of information computed above! - actualSuid = ObjectStreamClass.computeStructuralUID(this, cl); - - // If we have a write object method, precompute the - // RMI-IIOP stream format version 2 optional data - // repository ID. - if (hasWriteObject()) - rmiiiopOptionalDataRepId = computeRMIIIOPOptionalDataRepId(); - - // This must be done last. - initialized = true; - } - } - - // Specific to RMI-IIOP - /** - * Java to IDL ptc-02-01-12 1.5.1 - * - * "The rep_id string passed to the start_value method must be - * 'RMI:org.omg.custom.class:hashcode:suid' where class is the - * fully-qualified name of the class whose writeObject method - * is being invoked and hashcode and suid are the class's hashcode - * and SUID." - */ - private String computeRMIIIOPOptionalDataRepId() { - - StringBuffer sbuf = new StringBuffer("RMI:org.omg.custom."); - sbuf.append(RepositoryId.convertToISOLatin1(this.getName())); - sbuf.append(':'); - sbuf.append(this.getActualSerialVersionUIDStr()); - sbuf.append(':'); - sbuf.append(this.getSerialVersionUIDStr()); - - return sbuf.toString(); - } - - /** - * This will return null if there is no writeObject method. - */ - public final String getRMIIIOPOptionalDataRepId() { - return rmiiiopOptionalDataRepId; - } - - /* - * Create an empty ObjectStreamClass for a class about to be read. - * This is separate from read so ObjectInputStream can assign the - * wire handle early, before any nested ObjectStreamClass might - * be read. - */ - ObjectStreamClass(String n, long s) { - name = n; - suid = s; - superclass = null; - } - - - /* - * Set the class this version descriptor matches. - * The base class name and serializable hash must match. - * Fill in the reflected Fields that will be used - * for reading. - */ - final void setClass(Class cl) throws InvalidClassException { - - if (cl == null) { - localClassDesc = null; - ofClass = null; - computeFieldInfo(); - return; - } - - localClassDesc = lookupInternal(cl); - if (localClassDesc == null) - // XXX I18N, logging needed - throw new InvalidClassException(cl.getName(), - "Local class not compatible"); - if (suid != localClassDesc.suid) { - - /* Check for exceptional cases that allow mismatched suid. */ - - /* Allow adding Serializable or Externalizable - * to a later release of the class. - */ - boolean addedSerialOrExtern = - isNonSerializable() || localClassDesc.isNonSerializable(); - - /* Disregard the serialVersionUID of an array - * when name and cl.Name differ. If resolveClass() returns - * an array with a different package name, - * the serialVersionUIDs will not match since the fully - * qualified array class is used in the - * computation of the array's serialVersionUID. There is - * no way to set a permanent serialVersionUID for an array type. - */ - - boolean arraySUID = (cl.isArray() && ! cl.getName().equals(name)); - - if (! arraySUID && ! addedSerialOrExtern ) { - // XXX I18N, logging needed - throw new InvalidClassException(cl.getName(), - "Local class not compatible:" + - " stream classdesc serialVersionUID=" + suid + - " local class serialVersionUID=" + localClassDesc.suid); - } - } - - /* compare the class names, stripping off package names. */ - if (! compareClassNames(name, cl.getName(), '.')) - // XXX I18N, logging needed - throw new InvalidClassException(cl.getName(), - "Incompatible local class name. " + - "Expected class name compatible with " + - name); - - /* - * Test that both implement either serializable or externalizable. - */ - - // The next check is more generic, since it covers the - // Proxy case, the JDK 1.3 serialization code has - // both checks - //if ((serializable && localClassDesc.externalizable) || - // (externalizable && localClassDesc.serializable)) - // throw new InvalidClassException(localCl.getName(), - // "Serializable is incompatible with Externalizable"); - - if ((serializable != localClassDesc.serializable) || - (externalizable != localClassDesc.externalizable) || - (!serializable && !externalizable)) - - // XXX I18N, logging needed - throw new InvalidClassException(cl.getName(), - "Serialization incompatible with Externalization"); - - /* Set up the reflected Fields in the class where the value of each - * field in this descriptor should be stored. - * Each field in this ObjectStreamClass (the source) is located (by - * name) in the ObjectStreamClass of the class(the destination). - * In the usual (non-versioned case) the field is in both - * descriptors and the types match, so the reflected Field is copied. - * If the type does not match, a InvalidClass exception is thrown. - * If the field is not present in the class, the reflected Field - * remains null so the field will be read but discarded. - * If extra fields are present in the class they are ignored. Their - * values will be set to the default value by the object allocator. - * Both the src and dest field list are sorted by type and name. - */ - - ObjectStreamField[] destfield = - (ObjectStreamField[])localClassDesc.fields; - ObjectStreamField[] srcfield = - (ObjectStreamField[])fields; - - int j = 0; - nextsrc: - for (int i = 0; i < srcfield.length; i++ ) { - /* Find this field in the dest*/ - for (int k = j; k < destfield.length; k++) { - if (srcfield[i].getName().equals(destfield[k].getName())) { - /* found match */ - if (srcfield[i].isPrimitive() && - !srcfield[i].typeEquals(destfield[k])) { - // XXX I18N, logging needed - throw new InvalidClassException(cl.getName(), - "The type of field " + - srcfield[i].getName() + - " of class " + name + - " is incompatible."); - } - - /* Skip over any fields in the dest that are not in the src */ - j = k; - - srcfield[i].setField(destfield[j].getField()); - // go on to the next source field - continue nextsrc; - } - } - } - - /* Set up field data for use while reading from the input stream. */ - computeFieldInfo(); - - /* Remember the class this represents */ - ofClass = cl; - - /* get the cache of these methods from the local class - * implementation. - */ - readObjectMethod = localClassDesc.readObjectMethod; - readResolveObjectMethod = localClassDesc.readResolveObjectMethod; - } - - /* Compare the base class names of streamName and localName. - * - * @return Return true iff the base class name compare. - * @param streamName Fully qualified class name. - * @param localName Fully qualified class name. - * @param pkgSeparator class names use either '.' or '/'. - * - * Only compare base class name to allow package renaming. - */ - static boolean compareClassNames(String streamName, - String localName, - char pkgSeparator) { - /* compare the class names, stripping off package names. */ - int streamNameIndex = streamName.lastIndexOf(pkgSeparator); - if (streamNameIndex < 0) - streamNameIndex = 0; - - int localNameIndex = localName.lastIndexOf(pkgSeparator); - if (localNameIndex < 0) - localNameIndex = 0; - - return streamName.regionMatches(false, streamNameIndex, - localName, localNameIndex, - streamName.length() - streamNameIndex); - } - - /* - * Compare the types of two class descriptors. - * They match if they have the same class name and suid - */ - final boolean typeEquals(ObjectStreamClass other) { - return (suid == other.suid) && - compareClassNames(name, other.name, '.'); - } - - /* - * Return the superclass descriptor of this descriptor. - */ - final void setSuperclass(ObjectStreamClass s) { - superclass = s; - } - - /* - * Return the superclass descriptor of this descriptor. - */ - final ObjectStreamClass getSuperclass() { - return superclass; - } - - /** - * Return whether the class has a readObject method - */ - final boolean hasReadObject() { - return readObjectMethod != null; - } - - /* - * Return whether the class has a writeObject method - */ - final boolean hasWriteObject() { - return writeObjectMethod != null ; - } - - /** - * Returns true if represented class is serializable or externalizable and - * defines a conformant writeReplace method. Otherwise, returns false. - */ - boolean hasWriteReplaceMethod() { - return (writeReplaceObjectMethod != null); - } - - /** - * Returns true if represented class is serializable or externalizable and - * defines a conformant readResolve method. Otherwise, returns false. - */ - boolean hasReadResolveMethod() { - return (readResolveObjectMethod != null); - } - - /** - * Returns when or not this class should be custom - * marshaled (use chunking). This should happen if - * it is Externalizable OR if it or - * any of its superclasses has a writeObject method, - */ - final boolean isCustomMarshaled() { - return (hasWriteObject() || isExternalizable()) - || (superclass != null && superclass.isCustomMarshaled()); - } - - /* - * Return true if all instances of 'this' Externalizable class - * are written in block-data mode from the stream that 'this' was read - * from.

            - * - * In JDK 1.1, all Externalizable instances are not written - * in block-data mode. - * In JDK 1.2, all Externalizable instances, by default, are written - * in block-data mode and the Externalizable instance is terminated with - * tag TC_ENDBLOCKDATA. Change enabled the ability to skip Externalizable - * instances. - * - * IMPLEMENTATION NOTE: - * This should have been a mode maintained per stream; however, - * for compatibility reasons, it was only possible to record - * this change per class. All Externalizable classes within - * a given stream should either have this mode enabled or - * disabled. This is enforced by not allowing the PROTOCOL_VERSION - * of a stream to he changed after any objects have been written. - * - * @see ObjectOutputStream#useProtocolVersion - * @see ObjectStreamConstants#PROTOCOL_VERSION_1 - * @see ObjectStreamConstants#PROTOCOL_VERSION_2 - * - * @since JDK 1.2 - */ - boolean hasExternalizableBlockDataMode() { - return hasExternalizableBlockData; - } - - /** - * Creates a new instance of the represented class. If the class is - * externalizable, invokes its public no-arg constructor; otherwise, if the - * class is serializable, invokes the no-arg constructor of the first - * non-serializable superclass. Throws UnsupportedOperationException if - * this class descriptor is not associated with a class, if the associated - * class is non-serializable or if the appropriate no-arg constructor is - * inaccessible/unavailable. - */ - Object newInstance() - throws InstantiationException, InvocationTargetException, - UnsupportedOperationException - { - if (cons != null) { - try { - return bridge.newInstanceForSerialization(cons, domains); - } catch (IllegalAccessException ex) { - // should not occur, as access checks have been suppressed - InternalError ie = new InternalError(); - ie.initCause( ex ) ; - throw ie ; - } - } else { - throw new UnsupportedOperationException("no constructor for " + ofClass); - } - } - - /** - * Returns public no-arg constructor of given class, or null if none found. - * Access checks are disabled on the returned constructor (if any), since - * the defining class may still be non-public. - */ - private static Constructor getExternalizableConstructor(Class cl) { - return bridge.newConstructorForExternalization(cl); - } - - /** - * Returns subclass-accessible no-arg constructor of first non-serializable - * superclass, or null if none found. Access checks are disabled on the - * returned constructor (if any). - */ - private static Constructor getSerializableConstructor(Class cl) { - return bridge.newConstructorForSerialization(cl); - } - - /* - * Return the ObjectStreamClass of the local class this one is based on. - */ - final ObjectStreamClass localClassDescriptor() { - return localClassDesc; - } - - /* - * Get the Serializability of the class. - */ - boolean isSerializable() { - return serializable; - } - - /* - * Get the externalizability of the class. - */ - boolean isExternalizable() { - return externalizable; - } - - boolean isNonSerializable() { - return ! (externalizable || serializable); - } - - /* - * Calculate the size of the array needed to store primitive data and the - * number of object references to read when reading from the input - * stream. - */ - private void computeFieldInfo() { - primBytes = 0; - objFields = 0; - - for (int i = 0; i < fields.length; i++ ) { - switch (fields[i].getTypeCode()) { - case 'B': - case 'Z': - primBytes += 1; - break; - case 'C': - case 'S': - primBytes += 2; - break; - - case 'I': - case 'F': - primBytes += 4; - break; - case 'J': - case 'D' : - primBytes += 8; - break; - - case 'L': - case '[': - objFields += 1; - break; - } - } - } - - private static void msg( String str ) - { - System.out.println( str ) ; - } - - /* JDK 1.5 has introduced some new modifier bits (such as SYNTHETIC) - * that can affect the SVUID computation (see bug 4897937). These bits - * must be ignored, as otherwise interoperability with ORBs in earlier - * JDK versions can be compromised. I am adding these masks for this - * purpose as discussed in the CCC for this bug (see http://ccc.sfbay/4897937). - */ - - public static final int CLASS_MASK = Modifier.PUBLIC | Modifier.FINAL | - Modifier.INTERFACE | Modifier.ABSTRACT ; - public static final int FIELD_MASK = Modifier.PUBLIC | Modifier.PRIVATE | - Modifier.PROTECTED | Modifier.STATIC | Modifier.FINAL | - Modifier.TRANSIENT | Modifier.VOLATILE ; - public static final int METHOD_MASK = Modifier.PUBLIC | Modifier.PRIVATE | - Modifier.PROTECTED | Modifier.STATIC | Modifier.FINAL | - Modifier.SYNCHRONIZED | Modifier.NATIVE | Modifier.ABSTRACT | - Modifier.STRICT ; - - /* - * Compute a hash for the specified class. Incrementally add - * items to the hash accumulating in the digest stream. - * Fold the hash into a long. Use the SHA secure hash function. - */ - private static long _computeSerialVersionUID(Class cl) { - if (DEBUG_SVUID) - msg( "Computing SerialVersionUID for " + cl ) ; - ByteArrayOutputStream devnull = new ByteArrayOutputStream(512); - - long h = 0; - try { - MessageDigest md = MessageDigest.getInstance("SHA"); - DigestOutputStream mdo = new DigestOutputStream(devnull, md); - DataOutputStream data = new DataOutputStream(mdo); - - if (DEBUG_SVUID) - msg( "\twriteUTF( \"" + cl.getName() + "\" )" ) ; - data.writeUTF(cl.getName()); - - int classaccess = cl.getModifiers(); - classaccess &= (Modifier.PUBLIC | Modifier.FINAL | - Modifier.INTERFACE | Modifier.ABSTRACT); - - /* Workaround for javac bug that only set ABSTRACT for - * interfaces if the interface had some methods. - * The ABSTRACT bit reflects that the number of methods > 0. - * This is required so correct hashes can be computed - * for existing class files. - * Previously this hack was previously present in the VM. - */ - Method[] method = cl.getDeclaredMethods(); - if ((classaccess & Modifier.INTERFACE) != 0) { - classaccess &= (~Modifier.ABSTRACT); - if (method.length > 0) { - classaccess |= Modifier.ABSTRACT; - } - } - - // Mask out any post-1.4 attributes - classaccess &= CLASS_MASK ; - - if (DEBUG_SVUID) - msg( "\twriteInt( " + classaccess + " ) " ) ; - data.writeInt(classaccess); - - /* - * Get the list of interfaces supported, - * Accumulate their names their names in Lexical order - * and add them to the hash - */ - if (!cl.isArray()) { - /* In 1.2fcs, getInterfaces() was modified to return - * {java.lang.Cloneable, java.io.Serializable} when - * called on array classes. These values would upset - * the computation of the hash, so we explicitly omit - * them from its computation. - */ - - Class interfaces[] = cl.getInterfaces(); - Arrays.sort(interfaces, compareClassByName); - - for (int i = 0; i < interfaces.length; i++) { - if (DEBUG_SVUID) - msg( "\twriteUTF( \"" + interfaces[i].getName() + "\" ) " ) ; - data.writeUTF(interfaces[i].getName()); - } - } - - /* Sort the field names to get a deterministic order */ - Field[] field = cl.getDeclaredFields(); - Arrays.sort(field, compareMemberByName); - - for (int i = 0; i < field.length; i++) { - Field f = field[i]; - - /* Include in the hash all fields except those that are - * private transient and private static. - */ - int m = f.getModifiers(); - if (Modifier.isPrivate(m) && - (Modifier.isTransient(m) || Modifier.isStatic(m))) - continue; - - if (DEBUG_SVUID) - msg( "\twriteUTF( \"" + f.getName() + "\" ) " ) ; - data.writeUTF(f.getName()); - - // Mask out any post-1.4 bits - m &= FIELD_MASK ; - - if (DEBUG_SVUID) - msg( "\twriteInt( " + m + " ) " ) ; - data.writeInt(m); - - if (DEBUG_SVUID) - msg( "\twriteUTF( \"" + getSignature(f.getType()) + "\" ) " ) ; - data.writeUTF(getSignature(f.getType())); - } - - if (hasStaticInitializer(cl)) { - if (DEBUG_SVUID) - msg( "\twriteUTF( \"\" ) " ) ; - data.writeUTF(""); - - if (DEBUG_SVUID) - msg( "\twriteInt( " + Modifier.STATIC + " )" ) ; - data.writeInt(Modifier.STATIC); // TBD: what modifiers does it have - - if (DEBUG_SVUID) - msg( "\twriteUTF( \"()V\" )" ) ; - data.writeUTF("()V"); - } - - /* - * Get the list of constructors including name and signature - * Sort lexically, add all except the private constructors - * to the hash with their access flags - */ - - MethodSignature[] constructors = - MethodSignature.removePrivateAndSort(cl.getDeclaredConstructors()); - for (int i = 0; i < constructors.length; i++) { - MethodSignature c = constructors[i]; - String mname = ""; - String desc = c.signature; - desc = desc.replace('/', '.'); - if (DEBUG_SVUID) - msg( "\twriteUTF( \"" + mname + "\" )" ) ; - data.writeUTF(mname); - - // mask out post-1.4 modifiers - int modifier = c.member.getModifiers() & METHOD_MASK ; - - if (DEBUG_SVUID) - msg( "\twriteInt( " + modifier + " ) " ) ; - data.writeInt( modifier ) ; - - if (DEBUG_SVUID) - msg( "\twriteUTF( \"" + desc+ "\" )" ) ; - data.writeUTF(desc); - } - - /* Include in the hash all methods except those that are - * private transient and private static. - */ - MethodSignature[] methods = - MethodSignature.removePrivateAndSort(method); - for (int i = 0; i < methods.length; i++ ) { - MethodSignature m = methods[i]; - String desc = m.signature; - desc = desc.replace('/', '.'); - - if (DEBUG_SVUID) - msg( "\twriteUTF( \"" + m.member.getName()+ "\" )" ) ; - data.writeUTF(m.member.getName()); - - // mask out post-1.4 modifiers - int modifier = m.member.getModifiers() & METHOD_MASK ; - - if (DEBUG_SVUID) - msg( "\twriteInt( " + modifier + " ) " ) ; - data.writeInt( modifier ) ; - - if (DEBUG_SVUID) - msg( "\twriteUTF( \"" + desc + "\" )" ) ; - data.writeUTF(desc); - } - - /* Compute the hash value for this class. - * Use only the first 64 bits of the hash. - */ - data.flush(); - byte hasharray[] = md.digest(); - for (int i = 0; i < Math.min(8, hasharray.length); i++) { - h += (long)(hasharray[i] & 255) << (i * 8); - } - } catch (IOException ignore) { - /* can't happen, but be deterministic anyway. */ - h = -1; - } catch (NoSuchAlgorithmException complain) { - SecurityException se = new SecurityException() ; - se.initCause( complain ) ; - throw se ; - } - - return h; - } - - private static long computeStructuralUID(com.sun.corba.se.impl.io.ObjectStreamClass osc, Class cl) { - ByteArrayOutputStream devnull = new ByteArrayOutputStream(512); - - long h = 0; - try { - - if ((!java.io.Serializable.class.isAssignableFrom(cl)) || - (cl.isInterface())){ - return 0; - } - - if (java.io.Externalizable.class.isAssignableFrom(cl)) { - return 1; - } - - MessageDigest md = MessageDigest.getInstance("SHA"); - DigestOutputStream mdo = new DigestOutputStream(devnull, md); - DataOutputStream data = new DataOutputStream(mdo); - - // Get SUID of parent - Class parent = cl.getSuperclass(); - if ((parent != null)) - // SerialBug 1; acc. to spec the one for - // java.lang.object - // should be computed and put - // && (parent != java.lang.Object.class)) - { - //data.writeLong(computeSerialVersionUID(null,parent)); - data.writeLong(computeStructuralUID(lookup(parent), parent)); - } - - if (osc.hasWriteObject()) - data.writeInt(2); - else - data.writeInt(1); - - // CORBA formal 00-11-03 10.6.2: For each field of the - // class that is mapped to IDL, sorted lexicographically - // by Java field name, in increasing order... - ObjectStreamField[] field = osc.getFields(); - if (field.length > 1) { - Arrays.sort(field, compareObjStrFieldsByName); - } - - // ...Java field name in UTF encoding, field - // descriptor, as defined by the JVM spec... - for (int i = 0; i < field.length; i++) { - data.writeUTF(field[i].getName()); - data.writeUTF(field[i].getSignature()); - } - - /* Compute the hash value for this class. - * Use only the first 64 bits of the hash. - */ - data.flush(); - byte hasharray[] = md.digest(); - // int minimum = Math.min(8, hasharray.length); - // SerialBug 3: SHA computation is wrong; for loop reversed - //for (int i = minimum; i > 0; i--) - for (int i = 0; i < Math.min(8, hasharray.length); i++) { - h += (long)(hasharray[i] & 255) << (i * 8); - } - } catch (IOException ignore) { - /* can't happen, but be deterministic anyway. */ - h = -1; - } catch (NoSuchAlgorithmException complain) { - SecurityException se = new SecurityException(); - se.initCause( complain ) ; - throw se ; - } - return h; - } - - /** - * Compute the JVM signature for the class. - */ - static String getSignature(Class clazz) { - String type = null; - if (clazz.isArray()) { - Class cl = clazz; - int dimensions = 0; - while (cl.isArray()) { - dimensions++; - cl = cl.getComponentType(); - } - StringBuffer sb = new StringBuffer(); - for (int i = 0; i < dimensions; i++) { - sb.append("["); - } - sb.append(getSignature(cl)); - type = sb.toString(); - } else if (clazz.isPrimitive()) { - if (clazz == Integer.TYPE) { - type = "I"; - } else if (clazz == Byte.TYPE) { - type = "B"; - } else if (clazz == Long.TYPE) { - type = "J"; - } else if (clazz == Float.TYPE) { - type = "F"; - } else if (clazz == Double.TYPE) { - type = "D"; - } else if (clazz == Short.TYPE) { - type = "S"; - } else if (clazz == Character.TYPE) { - type = "C"; - } else if (clazz == Boolean.TYPE) { - type = "Z"; - } else if (clazz == Void.TYPE) { - type = "V"; - } - } else { - type = "L" + clazz.getName().replace('.', '/') + ";"; - } - return type; - } - - /* - * Compute the JVM method descriptor for the method. - */ - static String getSignature(Method meth) { - StringBuffer sb = new StringBuffer(); - - sb.append("("); - - Class[] params = meth.getParameterTypes(); // avoid clone - for (int j = 0; j < params.length; j++) { - sb.append(getSignature(params[j])); - } - sb.append(")"); - sb.append(getSignature(meth.getReturnType())); - return sb.toString(); - } - - /* - * Compute the JVM constructor descriptor for the constructor. - */ - static String getSignature(Constructor cons) { - StringBuffer sb = new StringBuffer(); - - sb.append("("); - - Class[] params = cons.getParameterTypes(); // avoid clone - for (int j = 0; j < params.length; j++) { - sb.append(getSignature(params[j])); - } - sb.append(")V"); - return sb.toString(); - } - - /* - * Cache of Class -> ClassDescriptor Mappings. - */ - static private ObjectStreamClassEntry[] descriptorFor = new ObjectStreamClassEntry[61]; - - /* - * findDescriptorFor a Class. This looks in the cache for a - * mapping from Class -> ObjectStreamClass mappings. The hashCode - * of the Class is used for the lookup since the Class is the key. - * The entries are extended from java.lang.ref.SoftReference so the - * gc will be able to free them if needed. - */ - private static ObjectStreamClass findDescriptorFor(Class cl) { - - int hash = cl.hashCode(); - int index = (hash & 0x7FFFFFFF) % descriptorFor.length; - ObjectStreamClassEntry e; - ObjectStreamClassEntry prev; - - /* Free any initial entries whose refs have been cleared */ - while ((e = descriptorFor[index]) != null && e.get() == null) { - descriptorFor[index] = e.next; - } - - /* Traverse the chain looking for a descriptor with ofClass == cl. - * unlink entries that are unresolved. - */ - prev = e; - while (e != null ) { - ObjectStreamClass desc = (ObjectStreamClass)(e.get()); - if (desc == null) { - // This entry has been cleared, unlink it - prev.next = e.next; - } else { - if (desc.ofClass == cl) - return desc; - prev = e; - } - e = e.next; - } - return null; - } - - /* - * insertDescriptorFor a Class -> ObjectStreamClass mapping. - */ - private static void insertDescriptorFor(ObjectStreamClass desc) { - // Make sure not already present - if (findDescriptorFor(desc.ofClass) != null) { - return; - } - - int hash = desc.ofClass.hashCode(); - int index = (hash & 0x7FFFFFFF) % descriptorFor.length; - ObjectStreamClassEntry e = new ObjectStreamClassEntry(desc); - e.next = descriptorFor[index]; - descriptorFor[index] = e; - } - - private static Field[] getDeclaredFields(final Class clz) { - return (Field[]) AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - return clz.getDeclaredFields(); - } - }); - } - - - /* - * The name of this descriptor - */ - private String name; - - /* - * The descriptor of the supertype. - */ - private ObjectStreamClass superclass; - - /* - * Flags for Serializable and Externalizable. - */ - private boolean serializable; - private boolean externalizable; - - /* - * Array of persistent fields of this class, sorted by - * type and name. - */ - private ObjectStreamField[] fields; - - /* - * Class that is a descriptor for in this virtual machine. - */ - private Class ofClass; - - /* - * True if descriptor for a proxy class. - */ - boolean forProxyClass; - - - /* - * SerialVersionUID for this class. - */ - private long suid = kDefaultUID; - private String suidStr = null; - - /* - * Actual (computed) SerialVersionUID for this class. - */ - private long actualSuid = kDefaultUID; - private String actualSuidStr = null; - - /* - * The total number of bytes of primitive fields. - * The total number of object fields. - */ - int primBytes; - int objFields; - - /** - * Flag indicating whether or not this instance has - * successfully completed initialization. This is to - * try to fix bug 4373844. Working to move to - * reusing java.io.ObjectStreamClass for JDK 1.5. - */ - private boolean initialized = false; - - /* Internal lock object. */ - private Object lock = new Object(); - - /* In JDK 1.1, external data was not written in block mode. - * As of JDK 1.2, external data is written in block data mode. This - * flag enables JDK 1.2 to be able to read JDK 1.1 written external data. - * - * @since JDK 1.2 - */ - private boolean hasExternalizableBlockData; - private transient MethodHandle writeObjectMethod; - private transient MethodHandle readObjectMethod; - private transient MethodHandle writeReplaceObjectMethod; - private transient MethodHandle readResolveObjectMethod; - private transient Constructor cons; - private transient ProtectionDomain[] domains; - - /** - * Beginning in Java to IDL ptc/02-01-12, RMI-IIOP has a - * stream format version 2 which puts a fake valuetype around - * a Serializable's optional custom data. This valuetype has - * a special repository ID made from the Serializable's - * information which we are pre-computing and - * storing here. - */ - private String rmiiiopOptionalDataRepId = null; - - /* - * ObjectStreamClass that this one was built from. - */ - private ObjectStreamClass localClassDesc; - - /** - * Returns true if the given class defines a static initializer method, - * false otherwise. - */ - private static boolean hasStaticInitializer(Class cl) { - return bridge.hasStaticInitializerForSerialization(cl); - } - - - /** use serialVersionUID from JDK 1.1. for interoperability */ - private static final long serialVersionUID = -6120832682080437368L; - - /** - * Set serialPersistentFields of a Serializable class to this value to - * denote that the class has no Serializable fields. - */ - public static final ObjectStreamField[] NO_FIELDS = - new ObjectStreamField[0]; - - /* - * Entries held in the Cache of known ObjectStreamClass objects. - * Entries are chained together with the same hash value (modulo array size). - */ - private static class ObjectStreamClassEntry // extends java.lang.ref.SoftReference - { - ObjectStreamClassEntry(ObjectStreamClass c) { - //super(c); - this.c = c; - } - ObjectStreamClassEntry next; - - public Object get() - { - return c; - } - private ObjectStreamClass c; - } - - /* - * Comparator object for Classes and Interfaces - */ - private static Comparator compareClassByName = - new CompareClassByName(); - - private static class CompareClassByName implements Comparator { - public int compare(Object o1, Object o2) { - Class c1 = (Class)o1; - Class c2 = (Class)o2; - return (c1.getName()).compareTo(c2.getName()); - } - } - - /** - * Comparator for ObjectStreamFields by name - */ - private final static Comparator compareObjStrFieldsByName - = new CompareObjStrFieldsByName(); - - private static class CompareObjStrFieldsByName implements Comparator { - public int compare(Object o1, Object o2) { - ObjectStreamField osf1 = (ObjectStreamField)o1; - ObjectStreamField osf2 = (ObjectStreamField)o2; - - return osf1.getName().compareTo(osf2.getName()); - } - } - - /* - * Comparator object for Members, Fields, and Methods - */ - private static Comparator compareMemberByName = - new CompareMemberByName(); - - private static class CompareMemberByName implements Comparator { - public int compare(Object o1, Object o2) { - String s1 = ((Member)o1).getName(); - String s2 = ((Member)o2).getName(); - - if (o1 instanceof Method) { - s1 += getSignature((Method)o1); - s2 += getSignature((Method)o2); - } else if (o1 instanceof Constructor) { - s1 += getSignature((Constructor)o1); - s2 += getSignature((Constructor)o2); - } - return s1.compareTo(s2); - } - } - - /* It is expensive to recompute a method or constructor signature - many times, so compute it only once using this data structure. */ - private static class MethodSignature implements Comparator { - Member member; - String signature; // cached parameter signature - - /* Given an array of Method or Constructor members, - return a sorted array of the non-private members.*/ - /* A better implementation would be to implement the returned data - structure as an insertion sorted link list.*/ - static MethodSignature[] removePrivateAndSort(Member[] m) { - int numNonPrivate = 0; - for (int i = 0; i < m.length; i++) { - if (! Modifier.isPrivate(m[i].getModifiers())) { - numNonPrivate++; - } - } - MethodSignature[] cm = new MethodSignature[numNonPrivate]; - int cmi = 0; - for (int i = 0; i < m.length; i++) { - if (! Modifier.isPrivate(m[i].getModifiers())) { - cm[cmi] = new MethodSignature(m[i]); - cmi++; - } - } - if (cmi > 0) - Arrays.sort(cm, cm[0]); - return cm; - } - - /* Assumes that o1 and o2 are either both methods - or both constructors.*/ - public int compare(Object o1, Object o2) { - /* Arrays.sort calls compare when o1 and o2 are equal.*/ - if (o1 == o2) - return 0; - - MethodSignature c1 = (MethodSignature)o1; - MethodSignature c2 = (MethodSignature)o2; - - int result; - if (isConstructor()) { - result = c1.signature.compareTo(c2.signature); - } else { // is a Method. - result = c1.member.getName().compareTo(c2.member.getName()); - if (result == 0) - result = c1.signature.compareTo(c2.signature); - } - return result; - } - - final private boolean isConstructor() { - return member instanceof Constructor; - } - private MethodSignature(Member m) { - member = m; - if (isConstructor()) { - signature = ObjectStreamClass.getSignature((Constructor)m); - } else { - signature = ObjectStreamClass.getSignature((Method)m); - } - } - } - - /** - * Returns non-static, non-abstract method with given signature provided it - * is defined by or accessible (via inheritance) by the given class, or - * null if no match found. Access checks are disabled on the returned - * method (if any). - * - * Copied from the Merlin java.io.ObjectStreamClass. - */ - private static Method getInheritableMethod(Class cl, String name, - Class[] argTypes, - Class returnType) - { - Method meth = null; - Class defCl = cl; - while (defCl != null) { - try { - meth = defCl.getDeclaredMethod(name, argTypes); - break; - } catch (NoSuchMethodException ex) { - defCl = defCl.getSuperclass(); - } - } - - if ((meth == null) || (meth.getReturnType() != returnType)) { - return null; - } - int mods = meth.getModifiers(); - if ((mods & (Modifier.STATIC | Modifier.ABSTRACT)) != 0) { - return null; - } else if ((mods & (Modifier.PUBLIC | Modifier.PROTECTED)) != 0) { - return meth; - } else if ((mods & Modifier.PRIVATE) != 0) { - return (cl == defCl) ? meth : null; - } else { - return packageEquals(cl, defCl) ? meth : null; - } - } - - /** - * Returns true if classes are defined in the same package, false - * otherwise. - * - * Copied from the Merlin java.io.ObjectStreamClass. - */ - private static boolean packageEquals(Class cl1, Class cl2) { - Package pkg1 = cl1.getPackage(), pkg2 = cl2.getPackage(); - return ((pkg1 == pkg2) || ((pkg1 != null) && (pkg1.equals(pkg2)))); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/io/ObjectStreamClassCorbaExt.java b/src/java.corba/share/classes/com/sun/corba/se/impl/io/ObjectStreamClassCorbaExt.java deleted file mode 100644 index 8f54e25ca6b..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/io/ObjectStreamClassCorbaExt.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.io; - -import java.security.AccessController; -import java.security.PrivilegedExceptionAction; -import java.security.PrivilegedActionException; -import java.security.PrivilegedAction; - -import java.lang.reflect.Modifier; -import java.lang.reflect.Array; -import java.lang.reflect.Field; -import java.lang.reflect.Member; -import java.lang.reflect.Method; - - -// This file contains some utility methods that -// originally were in the OSC in the RMI-IIOP -// code delivered by IBM. They don't make -// sense there, and hence have been put -// here so that they can be factored out in -// an attempt to eliminate redundant code from -// ObjectStreamClass. Eventually the goal is -// to move to java.io.ObjectStreamClass, and -// java.io.ObjectStreamField. - -// class is package private for security reasons - -class ObjectStreamClassCorbaExt { - - /** - * Return true, iff, - * - * 1. 'cl' is an interface, and - * 2. 'cl' and all its ancestors do not implement java.rmi.Remote, and - * 3. if 'cl' has no methods (including those of its ancestors), or, - * if all the methods (including those of its ancestors) throw an - * exception that is atleast java.rmi.RemoteException or one of - * java.rmi.RemoteException's super classes. - */ - static final boolean isAbstractInterface(Class cl) { - if (!cl.isInterface() || // #1 - java.rmi.Remote.class.isAssignableFrom(cl)) { // #2 - return false; - } - Method[] methods = cl.getMethods(); - for (int i = 0; i < methods.length; i++) { - Class exceptions[] = methods[i].getExceptionTypes(); - boolean exceptionMatch = false; - for (int j = 0; (j < exceptions.length) && !exceptionMatch; j++) { - if ((java.rmi.RemoteException.class == exceptions[j]) || - (java.lang.Throwable.class == exceptions[j]) || - (java.lang.Exception.class == exceptions[j]) || - (java.io.IOException.class == exceptions[j])) { - exceptionMatch = true; - } - } - if (!exceptionMatch) { - return false; - } - } - return true; - } - - /* - * Returns TRUE if type is 'any'. - */ - static final boolean isAny(String typeString) { - - int isAny = 0; - - if ( (typeString != null) && - (typeString.equals("Ljava/lang/Object;") || - typeString.equals("Ljava/io/Serializable;") || - typeString.equals("Ljava/io/Externalizable;")) ) - isAny = 1; - - return (isAny==1); - } - - private static final Method[] getDeclaredMethods(final Class clz) { - return (Method[]) AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - return clz.getDeclaredMethods(); - } - }); - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/io/ObjectStreamField.java b/src/java.corba/share/classes/com/sun/corba/se/impl/io/ObjectStreamField.java deleted file mode 100644 index 0fa0f991c38..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/io/ObjectStreamField.java +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.io; - -import java.lang.reflect.Field; -import java.lang.Comparable; -import java.util.Hashtable; - -import sun.corba.Bridge ; -import java.security.AccessController ; -import java.security.PrivilegedAction ; - -/** - * A description of a field in a serializable class. - * A array of these is used to declare the persistent fields of - * a class. - * - */ -public class ObjectStreamField implements Comparable -{ - private static final Bridge bridge = - (Bridge)AccessController.doPrivileged( - new PrivilegedAction() { - public Object run() { - return Bridge.get() ; - } - } - ) ; - - /** - * Create a named field with the specified type. - */ - ObjectStreamField(String n, Class clazz) { - name = n; - this.clazz = clazz; - - // Compute the typecode for easy switching - if (clazz.isPrimitive()) { - if (clazz == Integer.TYPE) { - type = 'I'; - } else if (clazz == Byte.TYPE) { - type = 'B'; - } else if (clazz == Long.TYPE) { - type = 'J'; - } else if (clazz == Float.TYPE) { - type = 'F'; - } else if (clazz == Double.TYPE) { - type = 'D'; - } else if (clazz == Short.TYPE) { - type = 'S'; - } else if (clazz == Character.TYPE) { - type = 'C'; - } else if (clazz == Boolean.TYPE) { - type = 'Z'; - } - } else if (clazz.isArray()) { - type = '['; - typeString = ObjectStreamClass.getSignature(clazz); - } else { - type = 'L'; - typeString = ObjectStreamClass.getSignature(clazz); - } - - if (typeString != null) - signature = typeString; - else - signature = String.valueOf(type); - - } - - ObjectStreamField(Field field) { - this(field.getName(), field.getType()); - setField( field ) ; - } - - /** - * Create an ObjectStreamField containing a reflected Field. - */ - ObjectStreamField(String n, char t, Field f, String ts) - { - name = n; - type = t; - setField( f ) ; - typeString = ts; - - if (typeString != null) - signature = typeString; - else - signature = String.valueOf(type); - - } - - /** - * Get the name of this field. - */ - public String getName() { - return name; - } - - /** - * Get the type of the field. - */ - public Class getType() { - if (clazz != null) - return clazz; - switch (type) { - case 'B': clazz = Byte.TYPE; - break; - case 'C': clazz = Character.TYPE; - break; - case 'S': clazz = Short.TYPE; - break; - case 'I': clazz = Integer.TYPE; - break; - case 'J': clazz = Long.TYPE; - break; - case 'F': clazz = Float.TYPE; - break; - case 'D': clazz = Double.TYPE; - break; - case 'Z': clazz = Boolean.TYPE; - break; - case '[': - case 'L': - clazz = Object.class; - break; - } - - return clazz; - } - - public char getTypeCode() { - return type; - } - - public String getTypeString() { - return typeString; - } - - Field getField() { - return field; - } - - void setField(Field field) { - this.field = field; - this.fieldID = bridge.objectFieldOffset( field ) ; - } - - /* - * Default constructor creates an empty field. - * Usually used just to get to the sort functions. - */ - ObjectStreamField() { - } - - /** - * test if this field is a primitive or not. - */ - public boolean isPrimitive() { - return (type != '[' && type != 'L'); - } - - /** - * Compare this with another ObjectStreamField. - * return -1 if this is smaller, 0 if equal, 1 if greater - * types that are primitives are "smaller" than objects. - * if equal, the names are compared. - */ - public int compareTo(Object o) { - ObjectStreamField f2 = (ObjectStreamField)o; - boolean thisprim = (this.typeString == null); - boolean otherprim = (f2.typeString == null); - - if (thisprim != otherprim) { - return (thisprim ? -1 : 1); - } - return this.name.compareTo(f2.name); - } - - /** - * Compare the types of two class descriptors. - * The match if they have the same primitive types. - * or if they are both objects and the object types match. - */ - public boolean typeEquals(ObjectStreamField other) { - if (other == null || type != other.type) - return false; - - /* Return true if the primitive types matched */ - if (typeString == null && other.typeString == null) - return true; - - return ObjectStreamClass.compareClassNames(typeString, - other.typeString, - '/'); - } - - /* Returns the signature of the Field. - * - */ - public String getSignature() { - - return signature; - - } - - /** - * Return a string describing this field. - */ - public String toString() { - if (typeString != null) - return typeString + " " + name; - else - return type + " " + name; - } - - public Class getClazz() { - return clazz; - } - - /* Returns the Field ID - * - */ - public long getFieldID() { - return fieldID ; - } - - private String name; // the name of the field - private char type; // type first byte of the type signature - private Field field; // Reflected field - private String typeString; // iff object, typename - private Class clazz; // the type of this field, if has been resolved - - // the next 2 things are RMI-IIOP specific, it can be easily - // removed, if we can figure out all place where there are dependencies - // to this. Signature is esentially equal to typestring. Then - // essentially we can use the java.io.ObjectStreamField as such. - - private String signature; // the signature of the field - private long fieldID = Bridge.INVALID_FIELD_OFFSET ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/io/OptionalDataException.java b/src/java.corba/share/classes/com/sun/corba/se/impl/io/OptionalDataException.java deleted file mode 100644 index 89228fdb1a2..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/io/OptionalDataException.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.io; - -/** - * Unexpected data appeared in an ObjectInputStream trying to read - * an Object. - * This exception occurs when the stream contains primitive data - * instead of the object expected by readObject. - * The eof flag in the exception is true to indicate that no more - * primitive data is available. - * The count field contains the number of bytes available to read. - * - * @author unascribed - * @since JDK1.1 - */ -public class OptionalDataException extends java.io.IOException { - /* - * Create an OptionalDataException with a length. - */ - OptionalDataException(int len) { - eof = false; - length = len; - } - - /* - * Create an OptionalDataException signifing no - * more primitive data is available. - */ - OptionalDataException(boolean end) { - length = 0; - eof = end; - } - - /** - * The number of bytes of primitive data available to be read - * in the current buffer. - */ - public int length; - - /** - * True if there is no more data in the buffered part of the stream. - */ - public boolean eof; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/io/OutputStreamHook.java b/src/java.corba/share/classes/com/sun/corba/se/impl/io/OutputStreamHook.java deleted file mode 100644 index 79ef01e8765..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/io/OutputStreamHook.java +++ /dev/null @@ -1,318 +0,0 @@ -/* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.io; - -import java.io.IOException; -import java.io.NotActiveException; -import java.io.OutputStream; -import java.io.ObjectOutputStream; -import java.io.ObjectOutput; -import java.util.Map; -import java.util.HashMap; - -import org.omg.CORBA.INTERNAL; - -public abstract class OutputStreamHook extends ObjectOutputStream -{ - private HookPutFields putFields = null; - - /** - * Since ObjectOutputStream.PutField methods specify no exceptions, - * we are not checking for null parameters on put methods. - */ - private class HookPutFields extends ObjectOutputStream.PutField - { - private Map fields = new HashMap<>(); - - /** - * Put the value of the named boolean field into the persistent field. - */ - public void put(String name, boolean value){ - fields.put(name, new Boolean(value)); - } - - /** - * Put the value of the named char field into the persistent fields. - */ - public void put(String name, char value){ - fields.put(name, new Character(value)); - } - - /** - * Put the value of the named byte field into the persistent fields. - */ - public void put(String name, byte value){ - fields.put(name, new Byte(value)); - } - - /** - * Put the value of the named short field into the persistent fields. - */ - public void put(String name, short value){ - fields.put(name, new Short(value)); - } - - /** - * Put the value of the named int field into the persistent fields. - */ - public void put(String name, int value){ - fields.put(name, new Integer(value)); - } - - /** - * Put the value of the named long field into the persistent fields. - */ - public void put(String name, long value){ - fields.put(name, new Long(value)); - } - - /** - * Put the value of the named float field into the persistent fields. - * - */ - public void put(String name, float value){ - fields.put(name, new Float(value)); - } - - /** - * Put the value of the named double field into the persistent field. - */ - public void put(String name, double value){ - fields.put(name, new Double(value)); - } - - /** - * Put the value of the named Object field into the persistent field. - */ - public void put(String name, Object value){ - fields.put(name, value); - } - - /** - * Write the data and fields to the specified ObjectOutput stream. - */ - public void write(ObjectOutput out) throws IOException { - OutputStreamHook hook = (OutputStreamHook)out; - - ObjectStreamField[] osfields = hook.getFieldsNoCopy(); - - // Write the fields to the stream in the order - // provided by the ObjectStreamClass. (They should - // be sorted appropriately already.) - for (int i = 0; i < osfields.length; i++) { - - Object value = fields.get(osfields[i].getName()); - - hook.writeField(osfields[i], value); - } - } - } - - abstract void writeField(ObjectStreamField field, Object value) throws IOException; - - public OutputStreamHook() - throws java.io.IOException { - super(); - } - - public void defaultWriteObject() throws IOException { - - writeObjectState.defaultWriteObject(this); - - defaultWriteObjectDelegate(); - } - - public abstract void defaultWriteObjectDelegate(); - - public ObjectOutputStream.PutField putFields() - throws IOException { - if (putFields == null) { - putFields = new HookPutFields(); - } - return putFields; - } - - // Stream format version, saved/restored during recursive calls - protected byte streamFormatVersion = 1; - - // Return the stream format version currently being used - // to serialize an object - public byte getStreamFormatVersion() { - return streamFormatVersion; - } - - abstract ObjectStreamField[] getFieldsNoCopy(); - - // User uses PutFields to simulate default data. - // See java.io.ObjectOutputStream.PutFields - public void writeFields() - throws IOException { - - writeObjectState.defaultWriteObject(this); - if (putFields != null) { - putFields.write(this); - } else { - throw new NotActiveException("no current PutField object"); - } - } - - abstract org.omg.CORBA_2_3.portable.OutputStream getOrbStream(); - - protected abstract void beginOptionalCustomData(); - - - // The following is a State pattern implementation of what - // should be done when a Serializable has a - // writeObject method. This was especially necessary for - // RMI-IIOP stream format version 2. Please see the - // state diagrams in the docs directory of the workspace. - - protected WriteObjectState writeObjectState = NOT_IN_WRITE_OBJECT; - - protected void setState(WriteObjectState newState) { - writeObjectState = newState; - } - - // Description of possible actions - protected static class WriteObjectState { - public void enterWriteObject(OutputStreamHook stream) throws IOException {} - public void exitWriteObject(OutputStreamHook stream) throws IOException {} - public void defaultWriteObject(OutputStreamHook stream) throws IOException {} - public void writeData(OutputStreamHook stream) throws IOException {} - } - - protected static class DefaultState extends WriteObjectState { - public void enterWriteObject(OutputStreamHook stream) throws IOException { - stream.setState(IN_WRITE_OBJECT); - } - } - - protected static final WriteObjectState NOT_IN_WRITE_OBJECT = new DefaultState(); - protected static final WriteObjectState IN_WRITE_OBJECT = new InWriteObjectState(); - protected static final WriteObjectState WROTE_DEFAULT_DATA = new WroteDefaultDataState(); - protected static final WriteObjectState WROTE_CUSTOM_DATA = new WroteCustomDataState(); - - protected static class InWriteObjectState extends WriteObjectState { - - public void enterWriteObject(OutputStreamHook stream) throws IOException { - // XXX I18N, logging needed. - throw new IOException("Internal state failure: Entered writeObject twice"); - } - - public void exitWriteObject(OutputStreamHook stream) throws IOException { - - // We didn't write any data, so write the - // called defaultWriteObject indicator as false - stream.getOrbStream().write_boolean(false); - - // If we're in stream format verison 2, we must - // put the "null" marker to say that there isn't - // any optional data - if (stream.getStreamFormatVersion() == 2) - stream.getOrbStream().write_long(0); - - stream.setState(NOT_IN_WRITE_OBJECT); - } - - public void defaultWriteObject(OutputStreamHook stream) throws IOException { - - // The writeObject method called defaultWriteObject - // or writeFields, so put the called defaultWriteObject - // indicator as true - stream.getOrbStream().write_boolean(true); - - stream.setState(WROTE_DEFAULT_DATA); - } - - public void writeData(OutputStreamHook stream) throws IOException { - - // The writeObject method first called a direct - // write operation. Write the called defaultWriteObject - // indicator as false, put the special stream format - // version 2 header (if stream format version 2, of course), - // and write the data - stream.getOrbStream().write_boolean(false); - stream.beginOptionalCustomData(); - stream.setState(WROTE_CUSTOM_DATA); - } - } - - protected static class WroteDefaultDataState extends InWriteObjectState { - - public void exitWriteObject(OutputStreamHook stream) throws IOException { - - // We only wrote default data, so if in stream format - // version 2, put the null indicator to say that there - // is no optional data - if (stream.getStreamFormatVersion() == 2) - stream.getOrbStream().write_long(0); - - stream.setState(NOT_IN_WRITE_OBJECT); - } - - public void defaultWriteObject(OutputStreamHook stream) throws IOException { - // XXX I18N, logging needed. - throw new IOException("Called defaultWriteObject/writeFields twice"); - } - - public void writeData(OutputStreamHook stream) throws IOException { - - // The writeObject method called a direct write operation. - // If in stream format version 2, put the fake valuetype - // header. - stream.beginOptionalCustomData(); - - stream.setState(WROTE_CUSTOM_DATA); - } - } - - protected static class WroteCustomDataState extends InWriteObjectState { - - public void exitWriteObject(OutputStreamHook stream) throws IOException { - // In stream format version 2, we must tell the ORB - // stream to close the fake custom valuetype. - if (stream.getStreamFormatVersion() == 2) - ((org.omg.CORBA.portable.ValueOutputStream)stream.getOrbStream()).end_value(); - - stream.setState(NOT_IN_WRITE_OBJECT); - } - - public void defaultWriteObject(OutputStreamHook stream) throws IOException { - // XXX I18N, logging needed. - throw new IOException("Cannot call defaultWriteObject/writeFields after writing custom data in RMI-IIOP"); - } - - // We don't have to do anything special here, just let - // the stream write the data. - public void writeData(OutputStreamHook stream) throws IOException {} - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/io/TypeMismatchException.java b/src/java.corba/share/classes/com/sun/corba/se/impl/io/TypeMismatchException.java deleted file mode 100644 index 7561f886068..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/io/TypeMismatchException.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.io; - -public class TypeMismatchException extends Error -{ - public TypeMismatchException() - { - super(); - } - - public TypeMismatchException(String mssg) - { - super(mssg); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/io/ValueHandlerImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/io/ValueHandlerImpl.java deleted file mode 100644 index 9a46afd1b88..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/io/ValueHandlerImpl.java +++ /dev/null @@ -1,926 +0,0 @@ -/* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.io; - -import javax.rmi.CORBA.Util; - -import java.util.Hashtable; -import java.io.IOException; - -import com.sun.corba.se.impl.util.RepositoryId; -import com.sun.corba.se.impl.util.Utility; - -import org.omg.CORBA.TCKind; - -import org.omg.CORBA.portable.IndirectionException; -import com.sun.org.omg.SendingContext.CodeBase; -import com.sun.org.omg.SendingContext.CodeBaseHelper; - -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.security.PrivilegedExceptionAction; - -import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.impl.logging.OMGSystemException; -import com.sun.corba.se.impl.logging.UtilSystemException; - -public final class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat { - - // Property to override our maximum stream format version - public static final String FORMAT_VERSION_PROPERTY - = "com.sun.CORBA.MaxStreamFormatVersion"; - - private static final byte MAX_SUPPORTED_FORMAT_VERSION = (byte)2; - private static final byte STREAM_FORMAT_VERSION_1 = (byte)1; - - // The ValueHandler's maximum stream format version to advertise, - // set in a static initializer. - private static final byte MAX_STREAM_FORMAT_VERSION; - - static { - MAX_STREAM_FORMAT_VERSION = getMaxStreamFormatVersion(); - } - - // Looks for the FORMAT_VERSION_PROPERTY system property - // to allow the user to override our default stream format - // version. Note that this still only allows them to pick - // a supported version (1 through MAX_STREAM_FORMAT_VERSION). - private static byte getMaxStreamFormatVersion() { - - try { - - String propValue = (String) AccessController.doPrivileged( - new PrivilegedAction() { - public java.lang.Object run() { - return System.getProperty(ValueHandlerImpl.FORMAT_VERSION_PROPERTY); - } - }); - - // The property wasn't set - if (propValue == null) - return MAX_SUPPORTED_FORMAT_VERSION; - - byte result = Byte.parseByte(propValue); - - // REVISIT. Just set to MAX_SUPPORTED_FORMAT_VERSION - // or really let the system shutdown with this Error? - if (result < 1 || result > MAX_SUPPORTED_FORMAT_VERSION) - // XXX I18N, logging needed. - throw new ExceptionInInitializerError("Invalid stream format version: " - + result - + ". Valid range is 1 through " - + MAX_SUPPORTED_FORMAT_VERSION); - - return result; - - } catch (Exception ex) { - // REVISIT. Swallow this or really let - // the system shutdown with this Error? - - Error err = new ExceptionInInitializerError(ex); - err.initCause( ex ) ; - throw err ; - } - } - - public static final short kRemoteType = 0; - public static final short kAbstractType = 1; - public static final short kValueType = 2; - - private Hashtable inputStreamPairs = null; - private Hashtable outputStreamPairs = null; - private CodeBase codeBase = null; - private boolean useHashtables = true; - private boolean isInputStream = true; - private IIOPOutputStream outputStreamBridge = null; - private IIOPInputStream inputStreamBridge = null; - private OMGSystemException omgWrapper = OMGSystemException.get( - CORBALogDomains.RPC_ENCODING ) ; - private UtilSystemException utilWrapper = UtilSystemException.get( - CORBALogDomains.RPC_ENCODING ) ; - - // See javax.rmi.CORBA.ValueHandlerMultiFormat - public byte getMaximumStreamFormatVersion() { - return MAX_STREAM_FORMAT_VERSION; - } - - // See javax.rmi.CORBA.ValueHandlerMultiFormat - public void writeValue(org.omg.CORBA.portable.OutputStream out, - java.io.Serializable value, - byte streamFormatVersion) { - - if (streamFormatVersion == 2) { - if (!(out instanceof org.omg.CORBA.portable.ValueOutputStream)) { - throw omgWrapper.notAValueoutputstream() ; - } - } else if (streamFormatVersion != 1) { - throw omgWrapper.invalidStreamFormatVersion( - new Integer(streamFormatVersion) ) ; - } - - writeValueWithVersion(out, value, streamFormatVersion); - } - - private ValueHandlerImpl(){} - - private ValueHandlerImpl(boolean isInputStream) { - this(); - useHashtables = false; - this.isInputStream = isInputStream; - } - - static ValueHandlerImpl getInstance() { - return new ValueHandlerImpl(); - } - - static ValueHandlerImpl getInstance(boolean isInputStream) { - return new ValueHandlerImpl(isInputStream); - } - - /** - * Writes the value to the stream using java semantics. - * @param out The stream to write the value to - * @param value The value to be written to the stream - **/ - public void writeValue(org.omg.CORBA.portable.OutputStream out, - java.io.Serializable value) { - writeValueWithVersion(out, value, STREAM_FORMAT_VERSION_1); - } - - private void writeValueWithVersion(org.omg.CORBA.portable.OutputStream _out, - java.io.Serializable value, - byte streamFormatVersion) { - - org.omg.CORBA_2_3.portable.OutputStream out = - (org.omg.CORBA_2_3.portable.OutputStream) _out; - - if (!useHashtables) { - if (outputStreamBridge == null) { - outputStreamBridge = createOutputStream(); - outputStreamBridge.setOrbStream(out); - } - - try { - outputStreamBridge.increaseRecursionDepth(); - writeValueInternal(outputStreamBridge, out, value, streamFormatVersion); - } finally { - outputStreamBridge.decreaseRecursionDepth(); - } - - return; - } - - IIOPOutputStream jdkToOrbOutputStreamBridge = null; - - if (outputStreamPairs == null) - outputStreamPairs = new Hashtable(); - - jdkToOrbOutputStreamBridge = (IIOPOutputStream)outputStreamPairs.get(_out); - - if (jdkToOrbOutputStreamBridge == null) { - jdkToOrbOutputStreamBridge = createOutputStream(); - jdkToOrbOutputStreamBridge.setOrbStream(out); - outputStreamPairs.put(_out, jdkToOrbOutputStreamBridge); - } - - try { - - jdkToOrbOutputStreamBridge.increaseRecursionDepth(); - writeValueInternal(jdkToOrbOutputStreamBridge, out, value, streamFormatVersion); - } finally { - if (jdkToOrbOutputStreamBridge.decreaseRecursionDepth() == 0) { - outputStreamPairs.remove(_out); - } - } - } - - private void writeValueInternal(IIOPOutputStream bridge, - org.omg.CORBA_2_3.portable.OutputStream out, - java.io.Serializable value, - byte streamFormatVersion) - { - Class clazz = value.getClass(); - - if (clazz.isArray()) - write_Array(out, value, clazz.getComponentType()); - else - bridge.simpleWriteObject(value, streamFormatVersion); - } - - /** - * Reads a value from the stream using java semantics. - * @param in The stream to read the value from - * @param clazz The type of the value to be read in - * @param rt The sending context runtime - **/ - public java.io.Serializable readValue(org.omg.CORBA.portable.InputStream in, - int offset, - java.lang.Class clazz, - String repositoryID, - org.omg.SendingContext.RunTime rt) - { - // Must use narrow rather than a direct cast to a com.sun - // class. Fix for bug 4379539. - CodeBase sender = CodeBaseHelper.narrow(rt); - - org.omg.CORBA_2_3.portable.InputStream inStream = - (org.omg.CORBA_2_3.portable.InputStream) in; - - if (!useHashtables) { - if (inputStreamBridge == null) { - inputStreamBridge = createInputStream(); - inputStreamBridge.setOrbStream(inStream); - inputStreamBridge.setSender(sender); //d11638 - // backward compatability 4365188 - inputStreamBridge.setValueHandler(this); - } - - java.io.Serializable result = null; - - try { - - inputStreamBridge.increaseRecursionDepth(); - result = (java.io.Serializable) readValueInternal(inputStreamBridge, inStream, offset, clazz, repositoryID, sender); - - } finally { - - if (inputStreamBridge.decreaseRecursionDepth() == 0) { - // Indirections are resolved immediately since - // the change to the active recursion manager, - // so this will never happen. - } - } - - return result; - } - - IIOPInputStream jdkToOrbInputStreamBridge = null; - if (inputStreamPairs == null) - inputStreamPairs = new Hashtable(); - - jdkToOrbInputStreamBridge = (IIOPInputStream)inputStreamPairs.get(in); - - if (jdkToOrbInputStreamBridge == null) { - - jdkToOrbInputStreamBridge = createInputStream(); - jdkToOrbInputStreamBridge.setOrbStream(inStream); - jdkToOrbInputStreamBridge.setSender(sender); //d11638 - // backward compatability 4365188 - jdkToOrbInputStreamBridge.setValueHandler(this); - inputStreamPairs.put(in, jdkToOrbInputStreamBridge); - } - - java.io.Serializable result = null; - - try { - - jdkToOrbInputStreamBridge.increaseRecursionDepth(); - result = (java.io.Serializable) readValueInternal(jdkToOrbInputStreamBridge, inStream, offset, clazz, repositoryID, sender); - - } finally { - - if (jdkToOrbInputStreamBridge.decreaseRecursionDepth() == 0) { - inputStreamPairs.remove(in); - } - } - - return result; - } - - private java.io.Serializable readValueInternal(IIOPInputStream bridge, - org.omg.CORBA_2_3.portable.InputStream in, - int offset, - java.lang.Class clazz, - String repositoryID, - com.sun.org.omg.SendingContext.CodeBase sender) - { - java.io.Serializable result = null; - - if (clazz == null) { - // clazz == null indicates an FVD situation for a nonexistant class - if (isArray(repositoryID)){ - read_Array(bridge, in, null, sender, offset); - } else { - bridge.simpleSkipObject(repositoryID, sender); - } - return result; - } - - if (clazz.isArray()) { - result = (java.io.Serializable)read_Array(bridge, in, clazz, sender, offset); - } else { - result = (java.io.Serializable)bridge.simpleReadObject(clazz, repositoryID, sender, offset); - } - - return result; - } - - /** - * Returns the repository ID for the given RMI value Class. - * @param clz The class to return a repository ID for. - * @return the repository ID of the Class. - **/ - public java.lang.String getRMIRepositoryID(java.lang.Class clz) { - return RepositoryId.createForJavaType(clz); - } - - /** - * Indicates whether the given Class performs custom or - * default marshaling. - * @param clz The class to test for custom marshaling. - * @return True if the class performs custom marshaling, false - * if it does not. - **/ - public boolean isCustomMarshaled(java.lang.Class clz) { - return ObjectStreamClass.lookup(clz).isCustomMarshaled(); - } - - /** - * Returns the CodeBase for this ValueHandler. This is used by - * the ORB runtime. The server sends the service context containing - * the IOR for this CodeBase on the first GIOP reply. The clients - * do the same on the first GIOP request. - * @return the SendingContext.CodeBase of this ValueHandler. - **/ - public org.omg.SendingContext.RunTime getRunTimeCodeBase() { - if (codeBase != null) - return codeBase; - else { - codeBase = new FVDCodeBaseImpl(); - - // backward compatability 4365188 - // set the valueHandler so that correct/incorrect RepositoryID - // calculations can be done based on the ORB version - FVDCodeBaseImpl fvdImpl = (FVDCodeBaseImpl) codeBase; - fvdImpl.setValueHandler(this); - return codeBase; - } - } - - - // methods supported for backward compatability so that the appropriate - // Rep-id calculations take place based on the ORB version - - /** - * Returns a boolean of whether or not RepositoryId indicates - * FullValueDescriptor. - * used for backward compatability - */ - - public boolean useFullValueDescription(Class clazz, String repositoryID) - throws IOException - { - return RepositoryId.useFullValueDescription(clazz, repositoryID); - } - - public String getClassName(String id) - { - RepositoryId repID = RepositoryId.cache.getId(id); - return repID.getClassName(); - } - - public Class getClassFromType(String id) - throws ClassNotFoundException - { - RepositoryId repId = RepositoryId.cache.getId(id); - return repId.getClassFromType(); - } - - public Class getAnyClassFromType(String id) - throws ClassNotFoundException - { - RepositoryId repId = RepositoryId.cache.getId(id); - return repId.getAnyClassFromType(); - } - - public String createForAnyType(Class cl) - { - return RepositoryId.createForAnyType(cl); - } - - public String getDefinedInId(String id) - { - RepositoryId repId = RepositoryId.cache.getId(id); - return repId.getDefinedInId(); - } - - public String getUnqualifiedName(String id) - { - RepositoryId repId = RepositoryId.cache.getId(id); - return repId.getUnqualifiedName(); - } - - public String getSerialVersionUID(String id) - { - RepositoryId repId = RepositoryId.cache.getId(id); - return repId.getSerialVersionUID(); - } - - - public boolean isAbstractBase(Class clazz) - { - return RepositoryId.isAbstractBase(clazz); - } - - public boolean isSequence(String id) - { - RepositoryId repId = RepositoryId.cache.getId(id); - return repId.isSequence(); - } - - /** - * If the value contains a writeReplace method then the result - * is returned. Otherwise, the value itself is returned. - * @return the true value to marshal on the wire. - **/ - public java.io.Serializable writeReplace(java.io.Serializable value) { - return ObjectStreamClass.lookup(value.getClass()).writeReplace(value); - } - - private void writeCharArray(org.omg.CORBA_2_3.portable.OutputStream out, - char[] array, - int offset, - int length) - { - out.write_wchar_array(array, offset, length); - } - - private void write_Array(org.omg.CORBA_2_3.portable.OutputStream out, java.io.Serializable obj, Class type) { - - int i, length; - - if (type.isPrimitive()) { - if (type == Integer.TYPE) { - int[] array = (int[])((Object)obj); - length = array.length; - out.write_ulong(length); - out.write_long_array(array, 0, length); - } else if (type == Byte.TYPE) { - byte[] array = (byte[])((Object)obj); - length = array.length; - out.write_ulong(length); - out.write_octet_array(array, 0, length); - } else if (type == Long.TYPE) { - long[] array = (long[])((Object)obj); - length = array.length; - out.write_ulong(length); - out.write_longlong_array(array, 0, length); - } else if (type == Float.TYPE) { - float[] array = (float[])((Object)obj); - length = array.length; - out.write_ulong(length); - out.write_float_array(array, 0, length); - } else if (type == Double.TYPE) { - double[] array = (double[])((Object)obj); - length = array.length; - out.write_ulong(length); - out.write_double_array(array, 0, length); - } else if (type == Short.TYPE) { - short[] array = (short[])((Object)obj); - length = array.length; - out.write_ulong(length); - out.write_short_array(array, 0, length); - } else if (type == Character.TYPE) { - char[] array = (char[])((Object)obj); - length = array.length; - out.write_ulong(length); - writeCharArray(out, array, 0, length); - } else if (type == Boolean.TYPE) { - boolean[] array = (boolean[])((Object)obj); - length = array.length; - out.write_ulong(length); - out.write_boolean_array(array, 0, length); - } else { - // XXX I18N, logging needed. - throw new Error("Invalid primitive type : " + - obj.getClass().getName()); - } - } else if (type == java.lang.Object.class) { - Object[] array = (Object[])((Object)obj); - length = array.length; - out.write_ulong(length); - for (i = 0; i < length; i++) { - Util.writeAny(out, array[i]); - } - } else { - Object[] array = (Object[])((Object)obj); - length = array.length; - out.write_ulong(length); - int callType = kValueType; - - if (type.isInterface()) { - String className = type.getName(); - - if (java.rmi.Remote.class.isAssignableFrom(type)) { - // RMI Object reference... - callType = kRemoteType; - } else if (org.omg.CORBA.Object.class.isAssignableFrom(type)){ - // IDL Object reference... - callType = kRemoteType; - } else if (RepositoryId.isAbstractBase(type)) { - // IDL Abstract Object reference... - callType = kAbstractType; - } else if (ObjectStreamClassCorbaExt.isAbstractInterface(type)) { - callType = kAbstractType; - } - } - - for (i = 0; i < length; i++) { - switch (callType) { - case kRemoteType: - Util.writeRemoteObject(out, array[i]); - break; - case kAbstractType: - Util.writeAbstractObject(out,array[i]); - break; - case kValueType: - try{ - out.write_value((java.io.Serializable)array[i]); - } catch(ClassCastException cce){ - if (array[i] instanceof java.io.Serializable) - throw cce; - else { - Utility.throwNotSerializableForCorba( - array[i].getClass().getName()); - } - } - break; - } - } - } - } - - private void readCharArray(org.omg.CORBA_2_3.portable.InputStream in, - char[] array, - int offset, - int length) - { - in.read_wchar_array(array, offset, length); - } - - private java.lang.Object read_Array(IIOPInputStream bridge, - org.omg.CORBA_2_3.portable.InputStream in, - Class sequence, - com.sun.org.omg.SendingContext.CodeBase sender, - int offset) - { - try { - // Read length of coming array - int length = in.read_ulong(); - int i; - - if (sequence == null) { - for (i = 0; i < length; i++) - in.read_value(); - - return null; - } - - Class componentType = sequence.getComponentType(); - Class actualType = componentType; - - - if (componentType.isPrimitive()) { - if (componentType == Integer.TYPE) { - int[] array = new int[length]; - in.read_long_array(array, 0, length); - return ((java.io.Serializable)((Object)array)); - } else if (componentType == Byte.TYPE) { - byte[] array = new byte[length]; - in.read_octet_array(array, 0, length); - return ((java.io.Serializable)((Object)array)); - } else if (componentType == Long.TYPE) { - long[] array = new long[length]; - in.read_longlong_array(array, 0, length); - return ((java.io.Serializable)((Object)array)); - } else if (componentType == Float.TYPE) { - float[] array = new float[length]; - in.read_float_array(array, 0, length); - return ((java.io.Serializable)((Object)array)); - } else if (componentType == Double.TYPE) { - double[] array = new double[length]; - in.read_double_array(array, 0, length); - return ((java.io.Serializable)((Object)array)); - } else if (componentType == Short.TYPE) { - short[] array = new short[length]; - in.read_short_array(array, 0, length); - return ((java.io.Serializable)((Object)array)); - } else if (componentType == Character.TYPE) { - char[] array = new char[length]; - readCharArray(in, array, 0, length); - return ((java.io.Serializable)((Object)array)); - } else if (componentType == Boolean.TYPE) { - boolean[] array = new boolean[length]; - in.read_boolean_array(array, 0, length); - return ((java.io.Serializable)((Object)array)); - } else { - // XXX I18N, logging needed. - throw new Error("Invalid primitive componentType : " + sequence.getName()); - } - } else if (componentType == java.lang.Object.class) { - Object[] array = (Object[])java.lang.reflect.Array.newInstance( - componentType, length); - - // Store this object and its beginning position - // since there might be indirections to it while - // it's been unmarshalled. - bridge.activeRecursionMgr.addObject(offset, array); - - for (i = 0; i < length; i++) { - Object objectValue = null; - try { - objectValue = Util.readAny(in); - } catch(IndirectionException cdrie) { - try { - // The CDR stream had never seen the given offset - // before, so check the recursion manager (it will - // throw an IOException if it doesn't have a - // reference, either). - objectValue = bridge.activeRecursionMgr.getObject( - cdrie.offset); - } catch (IOException ie) { - // Translate to a MARSHAL exception since - // ValueHandlers aren't allowed to throw - // IOExceptions - throw utilWrapper.invalidIndirection( ie, - new Integer( cdrie.offset ) ) ; - } - } - - array[i] = objectValue; - } - return ((java.io.Serializable)((Object)array)); - } else { - Object[] array = (Object[])java.lang.reflect.Array.newInstance( - componentType, length); - // Store this object and its beginning position - // since there might be indirections to it while - // it's been unmarshalled. - bridge.activeRecursionMgr.addObject(offset, array); - - // Decide what method call to make based on the componentType. - // If it is a componentType for which we need to load a stub, - // convert the componentType to the correct stub type. - - int callType = kValueType; - boolean narrow = false; - - if (componentType.isInterface()) { - boolean loadStubClass = false; - // String className = componentType.getName(); - - if (java.rmi.Remote.class.isAssignableFrom(componentType)) { - - // RMI Object reference... - callType = kRemoteType; - - // for better performance, load the stub class once - // instead of for each element of the array - loadStubClass = true; - } else if (org.omg.CORBA.Object.class.isAssignableFrom(componentType)){ - // IDL Object reference... - callType = kRemoteType; - loadStubClass = true; - } else if (RepositoryId.isAbstractBase(componentType)) { - // IDL Abstract Object reference... - callType = kAbstractType; - loadStubClass = true; - } else if (ObjectStreamClassCorbaExt.isAbstractInterface(componentType)) { - - // RMI Abstract Object reference... - - // componentType = null; - callType = kAbstractType; - } - - if (loadStubClass) { - try { - String codebase = Util.getCodebase(componentType); - String repID = RepositoryId.createForAnyType(componentType); - Class stubType = - Utility.loadStubClass(repID, codebase, componentType); - actualType = stubType; - } catch (ClassNotFoundException e) { - narrow = true; - } - } else { - narrow = true; - } - } - - for (i = 0; i < length; i++) { - - try { - switch (callType) { - case kRemoteType: - if (!narrow) - array[i] = (Object)in.read_Object(actualType); - else { - array[i] = Utility.readObjectAndNarrow(in, actualType); - - } - break; - case kAbstractType: - if (!narrow) - array[i] = (Object)in.read_abstract_interface(actualType); - else { - array[i] = Utility.readAbstractAndNarrow(in, actualType); - } - break; - case kValueType: - array[i] = (Object)in.read_value(actualType); - break; - } - } catch(IndirectionException cdrie) { - // The CDR stream had never seen the given offset before, - // so check the recursion manager (it will throw an - // IOException if it doesn't have a reference, either). - try { - array[i] = bridge.activeRecursionMgr.getObject( - cdrie.offset); - } catch (IOException ioe) { - // Translate to a MARSHAL exception since - // ValueHandlers aren't allowed to throw - // IOExceptions - throw utilWrapper.invalidIndirection( ioe, - new Integer( cdrie.offset ) ) ; - } - } - - } - - return ((java.io.Serializable)((Object)array)); - } - } finally { - // We've completed deserializing this object. Any - // future indirections will be handled correctly at the - // CDR level. The ActiveRecursionManager only deals with - // objects currently being deserialized. - bridge.activeRecursionMgr.removeObject(offset); - } - } - - private boolean isArray(String repId){ - return RepositoryId.cache.getId(repId).isSequence(); - } - - private String getOutputStreamClassName() { - return "com.sun.corba.se.impl.io.IIOPOutputStream"; - } - - private IIOPOutputStream createOutputStream() { - final String name = getOutputStreamClassName(); - try { - IIOPOutputStream stream = createOutputStreamBuiltIn(name); - if (stream != null) { - return stream; - } - return createCustom(IIOPOutputStream.class, name); - } catch (Throwable t) { - // Throw exception under the carpet. - InternalError ie = new InternalError( - "Error loading " + name - ); - ie.initCause(t); - throw ie; - } - } - - /** - * Construct a built in implementation with priveleges. - * Returning null indicates a non-built is specified. - */ - private IIOPOutputStream createOutputStreamBuiltIn( - final String name - ) throws Throwable { - try { - return AccessController.doPrivileged( - new PrivilegedExceptionAction() { - public IIOPOutputStream run() throws IOException { - return createOutputStreamBuiltInNoPriv(name); - } - } - ); - } catch (java.security.PrivilegedActionException exc) { - throw exc.getCause(); - } - } - - /** - * Returning null indicates a non-built is specified. - */ - private IIOPOutputStream createOutputStreamBuiltInNoPriv( - final String name - ) throws IOException { - return name.equals(IIOPOutputStream.class.getName()) ? - new IIOPOutputStream() : null; - } - - private String getInputStreamClassName() { - return "com.sun.corba.se.impl.io.IIOPInputStream"; - } - - private IIOPInputStream createInputStream() { - final String name = getInputStreamClassName(); - try { - IIOPInputStream stream = createInputStreamBuiltIn(name); - if (stream != null) { - return stream; - } - return createCustom(IIOPInputStream.class, name); - } catch (Throwable t) { - // Throw exception under the carpet. - InternalError ie = new InternalError( - "Error loading " + name - ); - ie.initCause(t); - throw ie; - } - } - - /** - * Construct a built in implementation with priveleges. - * Returning null indicates a non-built is specified. - */ - private IIOPInputStream createInputStreamBuiltIn( - final String name - ) throws Throwable { - try { - return AccessController.doPrivileged( - new PrivilegedExceptionAction() { - public IIOPInputStream run() throws IOException { - return createInputStreamBuiltInNoPriv(name); - } - } - ); - } catch (java.security.PrivilegedActionException exc) { - throw exc.getCause(); - } - } - - /** - * Returning null indicates a non-built is specified. - */ - private IIOPInputStream createInputStreamBuiltInNoPriv( - final String name - ) throws IOException { - return name.equals(IIOPInputStream.class.getName()) ? - new IIOPInputStream() : null; - } - - /** - * Create a custom implementation without privileges. - */ - private T createCustom( - final Class type, final String className - ) throws Throwable { - // Note: We use the thread context or system ClassLoader here - // since we want to load classes outside of the - // core JDK when running J2EE Pure ORB and - // talking to Kestrel. - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - if (cl == null) - cl = ClassLoader.getSystemClassLoader(); - - Class clazz = cl.loadClass(className); - Class streamClass = clazz.asSubclass(type); - - // Since the ClassLoader should cache the class, this isn't - // as expensive as it looks. - return streamClass.newInstance(); - - } - - TCKind getJavaCharTCKind() { - return TCKind.tk_wchar; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/io/ValueUtility.java b/src/java.corba/share/classes/com/sun/corba/se/impl/io/ValueUtility.java deleted file mode 100644 index 20cec8d7b30..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/io/ValueUtility.java +++ /dev/null @@ -1,483 +0,0 @@ -/* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.io; - -import com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription; -import com.sun.org.omg.CORBA.OperationDescription; -import com.sun.org.omg.CORBA.AttributeDescription; -import org.omg.CORBA.ValueMember; -import com.sun.org.omg.CORBA.Initializer; -import org.omg.CORBA.IDLType; -import com.sun.org.omg.CORBA._IDLTypeStub; -import org.omg.CORBA.ORB; -import org.omg.CORBA.TypeCodePackage.*; -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.TCKind; -import java.lang.reflect.*; -import com.sun.corba.se.impl.util.RepositoryId; -import java.util.*; -import javax.rmi.CORBA.Util; -import javax.rmi.CORBA.ValueHandler; - -/** - * Holds utility methods for converting from ObjectStreamClass to - * FullValueDescription and generating typecodes from ObjectStreamClass. - **/ -public class ValueUtility { - - public static final short PRIVATE_MEMBER = 0; - public static final short PUBLIC_MEMBER = 1; - - private static final String primitiveConstants[] = { - null, // tk_null 0 - null, // tk_void 1 - "S", // tk_short 2 - "I", // tk_long 3 - "S", // tk_ushort 4 - "I", // tk_ulong 5 - "F", // tk_float 6 - "D", // tk_double 7 - "Z", // tk_boolean 8 - "C", // tk_char 9 - "B", // tk_octet 10 - null, // tk_any 11 - null, // tk_typecode 12 - null, // tk_principal 13 - null, // tk_objref 14 - null, // tk_struct 15 - null, // tk_union 16 - null, // tk_enum 17 - null, // tk_string 18 - null, // tk_sequence 19 - null, // tk_array 20 - null, // tk_alias 21 - null, // tk_except 22 - "J", // tk_longlong 23 - "J", // tk_ulonglong 24 - "D", // tk_longdouble 25 - "C", // tk_wchar 26 - null, // tk_wstring 27 - null, // tk_fixed 28 - null, // tk_value 29 - null, // tk_value_box 30 - null, // tk_native 31 - null, // tk_abstract_interface 32 - }; - - static { - sun.corba.SharedSecrets.setJavaCorbaAccess(new sun.corba.JavaCorbaAccess() { - public ValueHandlerImpl newValueHandlerImpl() { - return ValueHandlerImpl.getInstance(); - } - public Class loadClass(String className) throws ClassNotFoundException { - if (Thread.currentThread().getContextClassLoader() != null) { - return Thread.currentThread().getContextClassLoader(). - loadClass(className); - } else { - return ClassLoader.getSystemClassLoader().loadClass(className); - } - } - }); - } - - public static String getSignature(ValueMember member) - throws ClassNotFoundException { - - // REVISIT. Can the type be something that is - // non-primitive yet not a value_box, value, or objref? - // If so, should use ObjectStreamClass or throw - // exception. - - if (member.type.kind().value() == TCKind._tk_value_box || - member.type.kind().value() == TCKind._tk_value || - member.type.kind().value() == TCKind._tk_objref) { - Class c = RepositoryId.cache.getId(member.id).getClassFromType(); - return ObjectStreamClass.getSignature(c); - - } else { - - return primitiveConstants[member.type.kind().value()]; - } - - } - - public static FullValueDescription translate(ORB orb, ObjectStreamClass osc, ValueHandler vh){ - - // Create FullValueDescription - FullValueDescription result = new FullValueDescription(); - Class className = osc.forClass(); - - ValueHandlerImpl vhandler = (com.sun.corba.se.impl.io.ValueHandlerImpl) vh; - String repId = vhandler.createForAnyType(className); - - // Set FVD name - result.name = vhandler.getUnqualifiedName(repId); - if (result.name == null) - result.name = ""; - - // Set FVD id _REVISIT_ : Manglings - result.id = vhandler.getRMIRepositoryID(className); - if (result.id == null) - result.id = ""; - - // Set FVD is_abstract - result.is_abstract = ObjectStreamClassCorbaExt.isAbstractInterface(className); - - // Set FVD is_custom - result.is_custom = osc.hasWriteObject() || osc.isExternalizable(); - - // Set FVD defined_in _REVISIT_ : Manglings - result.defined_in = vhandler.getDefinedInId(repId); - if (result.defined_in == null) - result.defined_in = ""; - - // Set FVD version - result.version = vhandler.getSerialVersionUID(repId); - if (result.version == null) - result.version = ""; - - // Skip FVD operations - N/A - result.operations = new OperationDescription[0]; - - // Skip FVD attributed - N/A - result.attributes = new AttributeDescription[0]; - - // Set FVD members - // Maps classes to repositoryIDs strings. This is used to detect recursive types. - IdentityKeyValueStack createdIDs = new IdentityKeyValueStack(); - // Stores all types created for resolving indirect types at the end. - result.members = translateMembers(orb, osc, vh, createdIDs); - - // Skip FVD initializers - N/A - result.initializers = new Initializer[0]; - - Class interfaces[] = osc.forClass().getInterfaces(); - int abstractCount = 0; - - // Skip FVD supported_interfaces - result.supported_interfaces = new String[interfaces.length]; - for (int interfaceIndex = 0; interfaceIndex < interfaces.length; - interfaceIndex++) { - result.supported_interfaces[interfaceIndex] = - vhandler.createForAnyType(interfaces[interfaceIndex]); - - if ((!(java.rmi.Remote.class.isAssignableFrom(interfaces[interfaceIndex]))) || - (!Modifier.isPublic(interfaces[interfaceIndex].getModifiers()))) - abstractCount++; - } - - // Skip FVD abstract_base_values - N/A - result.abstract_base_values = new String[abstractCount]; - for (int interfaceIndex = 0; interfaceIndex < interfaces.length; - interfaceIndex++) { - if ((!(java.rmi.Remote.class.isAssignableFrom(interfaces[interfaceIndex]))) || - (!Modifier.isPublic(interfaces[interfaceIndex].getModifiers()))) - result.abstract_base_values[interfaceIndex] = - vhandler.createForAnyType(interfaces[interfaceIndex]); - - } - - result.is_truncatable = false; - - // Set FVD base_value - Class superClass = osc.forClass().getSuperclass(); - if (java.io.Serializable.class.isAssignableFrom(superClass)) - result.base_value = vhandler.getRMIRepositoryID(superClass); - else - result.base_value = ""; - - // Set FVD type - //result.type = createTypeCodeForClass(orb, osc.forClass()); - result.type = orb.get_primitive_tc(TCKind.tk_value); //11638 - - return result; - - } - - private static ValueMember[] translateMembers (ORB orb, - ObjectStreamClass osc, - ValueHandler vh, - IdentityKeyValueStack createdIDs) - { - ValueHandlerImpl vhandler = (com.sun.corba.se.impl.io.ValueHandlerImpl) vh; - ObjectStreamField fields[] = osc.getFields(); - int fieldsLength = fields.length; - ValueMember[] members = new ValueMember[fieldsLength]; - // Note : fields come out of ObjectStreamClass in correct order for - // writing. So, we will create the same order in the members array. - for (int i = 0; i < fieldsLength; i++) { - String valRepId = vhandler.getRMIRepositoryID(fields[i].getClazz()); - members[i] = new ValueMember(); - members[i].name = fields[i].getName(); - members[i].id = valRepId; // _REVISIT_ : Manglings - members[i].defined_in = vhandler.getDefinedInId(valRepId);// _REVISIT_ : Manglings - members[i].version = "1.0"; - members[i].type_def = new _IDLTypeStub(); // _REVISIT_ : IDLType implementation missing - - if (fields[i].getField() == null) { - // When using serialPersistentFields, the class may - // no longer have an actual Field that corresponds - // to one of the items. The Java to IDL spec - // ptc-00-01-06 1.3.5.6 says that the IDL field - // should be private in this case. - members[i].access = PRIVATE_MEMBER; - } else { - int m = fields[i].getField().getModifiers(); - if (Modifier.isPublic(m)) - members[i].access = PUBLIC_MEMBER; - else - members[i].access = PRIVATE_MEMBER; - } - - switch (fields[i].getTypeCode()) { - case 'B': - members[i].type = orb.get_primitive_tc(TCKind.tk_octet); //11638 - break; - case 'C': - members[i].type - = orb.get_primitive_tc(vhandler.getJavaCharTCKind()); // 11638 - break; - case 'F': - members[i].type = orb.get_primitive_tc(TCKind.tk_float); //11638 - break; - case 'D' : - members[i].type = orb.get_primitive_tc(TCKind.tk_double); //11638 - break; - case 'I': - members[i].type = orb.get_primitive_tc(TCKind.tk_long); //11638 - break; - case 'J': - members[i].type = orb.get_primitive_tc(TCKind.tk_longlong); //11638 - break; - case 'S': - members[i].type = orb.get_primitive_tc(TCKind.tk_short); //11638 - break; - case 'Z': - members[i].type = orb.get_primitive_tc(TCKind.tk_boolean); //11638 - break; - // case '[': - // members[i].type = orb.get_primitive_tc(TCKind.tk_value_box); //11638 - // members[i].id = RepositoryId.createForAnyType(fields[i].getType()); - // break; - default: - members[i].type = createTypeCodeForClassInternal(orb, fields[i].getClazz(), vhandler, - createdIDs); - members[i].id = vhandler.createForAnyType(fields[i].getType()); - break; - } // end switch - - } // end for loop - - return members; - } - - private static boolean exists(String str, String strs[]){ - for (int i = 0; i < strs.length; i++) - if (str.equals(strs[i])) - return true; - - return false; - } - - public static boolean isAssignableFrom(String clzRepositoryId, FullValueDescription type, - com.sun.org.omg.SendingContext.CodeBase sender){ - - if (exists(clzRepositoryId, type.supported_interfaces)) - return true; - - if (clzRepositoryId.equals(type.id)) - return true; - - if ((type.base_value != null) && - (!type.base_value.equals(""))) { - FullValueDescription parent = sender.meta(type.base_value); - - return isAssignableFrom(clzRepositoryId, parent, sender); - } - - return false; - - } - - public static TypeCode createTypeCodeForClass (ORB orb, java.lang.Class c, ValueHandler vh) { - // Maps classes to repositoryIDs strings. This is used to detect recursive types. - IdentityKeyValueStack createdIDs = new IdentityKeyValueStack(); - // Stores all types created for resolving indirect types at the end. - TypeCode tc = createTypeCodeForClassInternal(orb, c, vh, createdIDs); - return tc; - } - - private static TypeCode createTypeCodeForClassInternal (ORB orb, - java.lang.Class c, - ValueHandler vh, - IdentityKeyValueStack createdIDs) - { - // This wrapper method is the protection against infinite recursion. - TypeCode tc = null; - String id = (String)createdIDs.get(c); - if (id != null) { - return orb.create_recursive_tc(id); - } else { - id = vh.getRMIRepositoryID(c); - if (id == null) id = ""; - // cache the rep id BEFORE creating a new typecode. - // so that recursive tc can look up the rep id. - createdIDs.push(c, id); - tc = createTypeCodeInternal(orb, c, vh, id, createdIDs); - createdIDs.pop(); - return tc; - } - } - - // Maintains a stack of key-value pairs. Compares elements using == operator. - private static class IdentityKeyValueStack { - private static class KeyValuePair { - Object key; - Object value; - KeyValuePair(Object key, Object value) { - this.key = key; - this.value = value; - } - boolean equals(KeyValuePair pair) { - return pair.key == this.key; - } - } - - Stack pairs = null; - - Object get(Object key) { - if (pairs == null) { - return null; - } - for (Iterator i = pairs.iterator(); i.hasNext();) { - KeyValuePair pair = (KeyValuePair)i.next(); - if (pair.key == key) { - return pair.value; - } - } - return null; - } - - void push(Object key, Object value) { - if (pairs == null) { - pairs = new Stack(); - } - pairs.push(new KeyValuePair(key, value)); - } - - void pop() { - pairs.pop(); - } - } - - private static TypeCode createTypeCodeInternal (ORB orb, - java.lang.Class c, - ValueHandler vh, - String id, - IdentityKeyValueStack createdIDs) - { - if ( c.isArray() ) { - // Arrays - may recurse for multi-dimensional arrays - Class componentClass = c.getComponentType(); - TypeCode embeddedType; - if ( componentClass.isPrimitive() ){ - embeddedType - = ValueUtility.getPrimitiveTypeCodeForClass(orb, - componentClass, - vh); - } else { - embeddedType = createTypeCodeForClassInternal(orb, componentClass, vh, - createdIDs); - } - TypeCode t = orb.create_sequence_tc (0, embeddedType); - return orb.create_value_box_tc (id, "Sequence", t); - } else if ( c == java.lang.String.class ) { - // Strings - TypeCode t = orb.create_string_tc (0); - return orb.create_value_box_tc (id, "StringValue", t); - } else if (java.rmi.Remote.class.isAssignableFrom(c)) { - return orb.get_primitive_tc(TCKind.tk_objref); - } else if (org.omg.CORBA.Object.class.isAssignableFrom(c)) { - return orb.get_primitive_tc(TCKind.tk_objref); - } - - // Anything else - - ObjectStreamClass osc = ObjectStreamClass.lookup(c); - - if (osc == null) { - return orb.create_value_box_tc (id, "Value", orb.get_primitive_tc (TCKind.tk_value)); - } - - // type modifier - // REVISIT truncatable and abstract? - short modifier = (osc.isCustomMarshaled() ? org.omg.CORBA.VM_CUSTOM.value : org.omg.CORBA.VM_NONE.value); - - // concrete base - TypeCode base = null; - Class superClass = c.getSuperclass(); - if (superClass != null && java.io.Serializable.class.isAssignableFrom(superClass)) { - base = createTypeCodeForClassInternal(orb, superClass, vh, createdIDs); - } - - // members - ValueMember[] members = translateMembers (orb, osc, vh, createdIDs); - - return orb.create_value_tc(id, c.getName(), modifier, base, members); - } - - public static TypeCode getPrimitiveTypeCodeForClass (ORB orb, - Class c, - ValueHandler vh) { - - if (c == Integer.TYPE) { - return orb.get_primitive_tc (TCKind.tk_long); - } else if (c == Byte.TYPE) { - return orb.get_primitive_tc (TCKind.tk_octet); - } else if (c == Long.TYPE) { - return orb.get_primitive_tc (TCKind.tk_longlong); - } else if (c == Float.TYPE) { - return orb.get_primitive_tc (TCKind.tk_float); - } else if (c == Double.TYPE) { - return orb.get_primitive_tc (TCKind.tk_double); - } else if (c == Short.TYPE) { - return orb.get_primitive_tc (TCKind.tk_short); - } else if (c == Character.TYPE) { - return orb.get_primitive_tc (((ValueHandlerImpl)vh).getJavaCharTCKind()); - } else if (c == Boolean.TYPE) { - return orb.get_primitive_tc (TCKind.tk_boolean); - } else { - // _REVISIT_ Not sure if this is right. - return orb.get_primitive_tc (TCKind.tk_any); - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ByteBuffer.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ByteBuffer.java deleted file mode 100644 index 39affb193ad..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ByteBuffer.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior ; - - -public class ByteBuffer { - /** - * The array buffer into which the components of the ByteBuffer are - * stored. The capacity of the ByteBuffer is the length of this array buffer, - * and is at least large enough to contain all the ByteBuffer's elements.

            - * - * Any array elements following the last element in the ByteBuffer are 0. - */ - protected byte elementData[]; - - /** - * The number of valid components in this {@code ByteBuffer} object. - * Components {@code elementData[0]} through - * {@code elementData[elementCount-1]} are the actual items. - * - * @serial - */ - protected int elementCount; - - /** - * The amount by which the capacity of the ByteBuffer is automatically - * incremented when its size becomes greater than its capacity. If - * the capacity increment is less than or equal to zero, the capacity - * of the ByteBuffer is doubled each time it needs to grow. - * - * @serial - */ - protected int capacityIncrement; - - /** - * Constructs an empty ByteBuffer with the specified initial capacity and - * capacity increment. - * - * @param initialCapacity the initial capacity of the ByteBuffer. - * @param capacityIncrement the amount by which the capacity is - * increased when the ByteBuffer overflows. - * @exception IllegalArgumentException if the specified initial capacity - * is negative - */ - public ByteBuffer(int initialCapacity, int capacityIncrement) { - super(); - if (initialCapacity < 0) - throw new IllegalArgumentException("Illegal Capacity: "+ - initialCapacity); - this.elementData = new byte[initialCapacity]; - this.capacityIncrement = capacityIncrement; - } - - /** - * Constructs an empty ByteBuffer with the specified initial capacity and - * with its capacity increment equal to zero. - * - * @param initialCapacity the initial capacity of the ByteBuffer. - * @exception IllegalArgumentException if the specified initial capacity - * is negative - */ - public ByteBuffer(int initialCapacity) { - this(initialCapacity, 0); - } - - /** - * Constructs an empty ByteBuffer so that its internal data array - * has size {@code 10} and its standard capacity increment is - * zero. - */ - public ByteBuffer() { - this(200); - } - - /** - * Trims the capacity of this ByteBuffer to be the ByteBuffer's current - * size. If the capacity of this cector is larger than its current - * size, then the capacity is changed to equal the size by replacing - * its internal data array, kept in the field {@code elementData}, - * with a smaller one. An application can use this operation to - * minimize the storage of a ByteBuffer. - */ - public void trimToSize() { - int oldCapacity = elementData.length; - if (elementCount < oldCapacity) { - byte oldData[] = elementData; - elementData = new byte[elementCount]; - System.arraycopy(oldData, 0, elementData, 0, elementCount); - } - } - - /** - * This implements the unsynchronized semantics of ensureCapacity. - * Synchronized methods in this class can internally call this - * method for ensuring capacity without incurring the cost of an - * extra synchronization. - * - * @see java.util.ByteBuffer#ensureCapacity(int) - */ - private void ensureCapacityHelper(int minCapacity) { - int oldCapacity = elementData.length; - if (minCapacity > oldCapacity) { - byte oldData[] = elementData; - int newCapacity = (capacityIncrement > 0) ? - (oldCapacity + capacityIncrement) : (oldCapacity * 2); - if (newCapacity < minCapacity) { - newCapacity = minCapacity; - } - elementData = new byte[newCapacity]; - System.arraycopy(oldData, 0, elementData, 0, elementCount); - } - } - - /** - * Returns the current capacity of this ByteBuffer. - * - * @return the current capacity (the length of its internal - * data arary, kept in the field {@code elementData} - * of this ByteBuffer. - */ - public int capacity() { - return elementData.length; - } - - /** - * Returns the number of components in this ByteBuffer. - * - * @return the number of components in this ByteBuffer. - */ - public int size() { - return elementCount; - } - - /** - * Tests if this ByteBuffer has no components. - * - * @return {@code true} if and only if this ByteBuffer has - * no components, that is, its size is zero; - * {@code false} otherwise. - */ - public boolean isEmpty() { - return elementCount == 0; - } - - public void append(byte value) - { - ensureCapacityHelper(elementCount + 1); - elementData[elementCount++] = value; - } - - public void append( int value ) - { - ensureCapacityHelper(elementCount + 4); - doAppend( value ) ; - } - - private void doAppend( int value ) - { - int current = value ; - for (int ctr=0; ctr<4; ctr++) { - elementData[elementCount+ctr] = (byte)(current & 255) ; - current = current >> 8 ; - } - elementCount += 4 ; - } - - public void append( String value ) - { - byte[] data = value.getBytes() ; - ensureCapacityHelper( elementCount + data.length + 4 ) ; - doAppend( data.length ) ; - System.arraycopy( data, 0, elementData, elementCount, data.length ) ; - elementCount += data.length ; - } - - /** - * Returns an array containing all of the elements in this ByteBuffer - * in the correct order. - * - * @since 1.2 - */ - public byte[] toArray() { - return elementData ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/EncapsulationUtility.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/EncapsulationUtility.java deleted file mode 100644 index 63cdcae2bee..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/EncapsulationUtility.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior; - -import java.util.List; -import java.util.LinkedList; -import java.util.Iterator; - -import org.omg.IOP.TAG_INTERNET_IOP ; - -import org.omg.CORBA_2_3.portable.OutputStream ; -import org.omg.CORBA_2_3.portable.InputStream ; - -import com.sun.corba.se.spi.ior.TaggedComponent ; -import com.sun.corba.se.spi.ior.Identifiable ; -import com.sun.corba.se.spi.ior.IdentifiableFactoryFinder ; -import com.sun.corba.se.spi.ior.WriteContents ; - -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.impl.ior.FreezableList ; - -import com.sun.corba.se.impl.encoding.CDROutputStream ; -import com.sun.corba.se.impl.encoding.EncapsOutputStream ; -import com.sun.corba.se.impl.encoding.EncapsInputStream ; - -import sun.corba.EncapsInputStreamFactory; - -/** - * This static utility class contains various utility methods for reading and - * writing CDR encapsulations. - * - * @author Ken Cavanaugh - */ -public class EncapsulationUtility -{ - private EncapsulationUtility() - { - } - - /** Read the count from is, then read count Identifiables from - * is using the factory. Add each constructed Identifiable to container. - */ - public static void readIdentifiableSequence( List container, - IdentifiableFactoryFinder finder, InputStream istr) - { - int count = istr.read_long() ; - for (int ctr = 0; ctr iorTypeNames; - private static final Set builtinIorTypeNames; - private ORB theOrb; - - static { - builtinIorTypeNames = initBuiltinIorTypeNames(); - } - - public IORTypeCheckRegistryImpl( String filterProperties, ORB orb) { - theOrb = orb; - iorTypeNames = parseIorClassNameList(filterProperties); - } - - /* - * - * A note on the validation flow: - * 1. against the filter class name list - * 2. against the builtin class name list - */ - - @Override - public boolean isValidIORType(String iorClassName) { - dprintTransport(".isValidIORType : iorClassName == " + iorClassName); - return validateIorTypeByName(iorClassName); - } - - - private boolean validateIorTypeByName(String iorClassName) { - dprintTransport(".validateIorTypeByName : iorClassName == " + iorClassName); - boolean isValidType; - - isValidType = checkIorTypeNames(iorClassName); - - if (!isValidType) { - isValidType = checkBuiltinClassNames(iorClassName); - } - - dprintTransport(".validateIorTypeByName : isValidType == " + isValidType); - return isValidType; - } - - - /* - * check if the class name corresponding to an IOR Type name - * is in the ior class name list as generated from the filter property. - * So if the IOR type is recorded in the registry then allow the creation of the - * stub factory and let it resolve and load the class. That is if current - * type check deliberation permits. - * IOR Type names are configured by the filter property - */ - - private boolean checkIorTypeNames( - String theIorClassName) { - return (iorTypeNames != null) && (iorTypeNames.contains(theIorClassName)); - } - - /* - * Check the IOR interface class name against the set of - * class names that correspond to the builtin JDK IDL stub classes. - */ - - private boolean checkBuiltinClassNames( - String theIorClassName) { - return builtinIorTypeNames.contains(theIorClassName); - } - - - private Set parseIorClassNameList(String filterProperty) { - Set _iorTypeNames = null; - if (filterProperty != null) { - String[] tempIorClassNames = filterProperty.split(";"); - _iorTypeNames = Set.of(tempIorClassNames); - if (theOrb.orbInitDebugFlag) { - dprintConfiguredIorTypeNames(); - } - } - return _iorTypeNames; - } - - - private static Set initBuiltinIorTypeNames() { - Set> builtInCorbaStubTypes = initBuiltInCorbaStubTypes(); - String [] tempBuiltinIorTypeNames = new String[builtInCorbaStubTypes.size()]; - int i = 0; - for (Class _stubClass: builtInCorbaStubTypes) { - tempBuiltinIorTypeNames[i++] = _stubClass.getName(); - } - return Set.of(tempBuiltinIorTypeNames); - } - - private static Set> initBuiltInCorbaStubTypes() { - Class tempBuiltinCorbaStubTypes[] = { - com.sun.corba.se.spi.activation.Activator.class, - com.sun.corba.se.spi.activation._ActivatorStub.class, - com.sun.corba.se.spi.activation._InitialNameServiceStub.class, - com.sun.corba.se.spi.activation._LocatorStub.class, - com.sun.corba.se.spi.activation._RepositoryStub.class, - com.sun.corba.se.spi.activation._ServerManagerStub.class, - com.sun.corba.se.spi.activation._ServerStub.class, - org.omg.CosNaming.BindingIterator.class, - org.omg.CosNaming._BindingIteratorStub.class, - org.omg.CosNaming.NamingContextExt.class, - org.omg.CosNaming._NamingContextExtStub.class, - org.omg.CosNaming.NamingContext.class, - org.omg.CosNaming._NamingContextStub.class, - org.omg.DynamicAny.DynAnyFactory.class, - org.omg.DynamicAny._DynAnyFactoryStub.class, - org.omg.DynamicAny.DynAny.class, - org.omg.DynamicAny._DynAnyStub.class, - org.omg.DynamicAny.DynArray.class, - org.omg.DynamicAny._DynArrayStub.class, - org.omg.DynamicAny.DynEnum.class, - org.omg.DynamicAny._DynEnumStub.class, - org.omg.DynamicAny.DynFixed.class, - org.omg.DynamicAny._DynFixedStub.class, - org.omg.DynamicAny.DynSequence.class, - org.omg.DynamicAny._DynSequenceStub.class, - org.omg.DynamicAny.DynStruct.class, - org.omg.DynamicAny._DynStructStub.class, - org.omg.DynamicAny.DynUnion.class, - org.omg.DynamicAny._DynUnionStub.class, - org.omg.DynamicAny._DynValueStub.class, - org.omg.DynamicAny.DynValue.class, - org.omg.PortableServer.ServantActivator.class, - org.omg.PortableServer._ServantActivatorStub.class, - org.omg.PortableServer.ServantLocator.class, - org.omg.PortableServer._ServantLocatorStub.class }; - return Set.>of(tempBuiltinCorbaStubTypes); - } - - private void dprintConfiguredIorTypeNames() { - if (iorTypeNames != null) { - for (String iorTypeName : iorTypeNames) { - ORBUtility.dprint(this, ".dprintConfiguredIorTypeNames: " + iorTypeName); - } - } - } - - private void dprintTransport(String msg) { - if (theOrb.transportDebugFlag) { - ORBUtility.dprint(this, msg); - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/IdentifiableFactoryFinderBase.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/IdentifiableFactoryFinderBase.java deleted file mode 100644 index 89cc94c05a1..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/IdentifiableFactoryFinderBase.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior ; - -import org.omg.CORBA_2_3.portable.InputStream ; - -import java.util.Map ; -import java.util.HashMap ; - -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.spi.ior.Identifiable ; -import com.sun.corba.se.spi.ior.IdentifiableFactory ; -import com.sun.corba.se.spi.ior.IdentifiableFactoryFinder ; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; - -import com.sun.corba.se.impl.logging.IORSystemException ; - -public abstract class IdentifiableFactoryFinderBase implements - IdentifiableFactoryFinder -{ - private ORB orb ; - private Map map ; - protected IORSystemException wrapper ; - - protected IdentifiableFactoryFinderBase( ORB orb ) - { - map = new HashMap() ; - this.orb = orb ; - wrapper = IORSystemException.get( orb, - CORBALogDomains.OA_IOR ) ; - } - - protected IdentifiableFactory getFactory(int id) - { - Integer ident = new Integer( id ) ; - IdentifiableFactory factory = (IdentifiableFactory)(map.get( - ident ) ) ; - return factory ; - } - - public abstract Identifiable handleMissingFactory( int id, InputStream is ) ; - - public Identifiable create(int id, InputStream is) - { - IdentifiableFactory factory = getFactory( id ) ; - - if (factory != null) - return factory.create( is ) ; - else - return handleMissingFactory( id, is ) ; - } - - public void registerFactory(IdentifiableFactory factory) - { - Integer ident = new Integer( factory.getId() ) ; - map.put( ident, factory ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/JIDLObjectKeyTemplate.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/JIDLObjectKeyTemplate.java deleted file mode 100644 index 3e7b9c2c3dd..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/JIDLObjectKeyTemplate.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior; - -import org.omg.CORBA_2_3.portable.InputStream ; -import org.omg.CORBA_2_3.portable.OutputStream ; - -import org.omg.CORBA.OctetSeqHolder ; - -import com.sun.corba.se.spi.ior.ObjectId ; -import com.sun.corba.se.spi.ior.ObjectKeyFactory ; - -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.orb.ORBVersion ; -import com.sun.corba.se.spi.orb.ORBVersionFactory ; - -import com.sun.corba.se.impl.ior.ObjectKeyFactoryImpl ; - -/** - * @author Ken Cavanaugh - */ -public final class JIDLObjectKeyTemplate extends NewObjectKeyTemplateBase -{ - /** This constructor reads the template ONLY from the stream. - */ - public JIDLObjectKeyTemplate( ORB orb, int magic, int scid, InputStream is ) - { - super( orb, magic, scid, is.read_long(), JIDL_ORB_ID, JIDL_OAID ); - - setORBVersion( is ) ; - } - - /** This constructor reads a complete ObjectKey (template and Id) - * from the stream. - */ - public JIDLObjectKeyTemplate( ORB orb, int magic, int scid, InputStream is, - OctetSeqHolder osh ) - { - super( orb, magic, scid, is.read_long(), JIDL_ORB_ID, JIDL_OAID ); - - osh.value = readObjectKey( is ) ; - - setORBVersion( is ) ; - } - - public JIDLObjectKeyTemplate( ORB orb, int scid, int serverid ) - { - super( orb, ObjectKeyFactoryImpl.JAVAMAGIC_NEWER, scid, serverid, - JIDL_ORB_ID, JIDL_OAID ) ; - - setORBVersion( ORBVersionFactory.getORBVersion() ) ; - } - - protected void writeTemplate( OutputStream os ) - { - os.write_long( getMagic() ) ; - os.write_long( getSubcontractId() ) ; - os.write_long( getServerId() ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/NewObjectKeyTemplateBase.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/NewObjectKeyTemplateBase.java deleted file mode 100644 index 691927a714d..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/NewObjectKeyTemplateBase.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior; - -import java.io.IOException ; - -import org.omg.CORBA_2_3.portable.InputStream ; -import org.omg.CORBA_2_3.portable.OutputStream ; - -import com.sun.corba.se.spi.ior.ObjectId ; -import com.sun.corba.se.spi.ior.ObjectAdapterId ; -import com.sun.corba.se.spi.ior.ObjectKeyFactory ; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion ; - -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.orb.ORBVersion ; -import com.sun.corba.se.spi.orb.ORBVersionFactory ; - -import com.sun.corba.se.impl.ior.ObjectKeyFactoryImpl ; - -public abstract class NewObjectKeyTemplateBase extends ObjectKeyTemplateBase -{ - public NewObjectKeyTemplateBase( ORB orb, int magic, int scid, int serverid, - String orbid, ObjectAdapterId oaid ) - { - super( orb, magic, scid, serverid, orbid, oaid ) ; - // subclass must set the version, since we don't have the object key here. - - if (magic != ObjectKeyFactoryImpl.JAVAMAGIC_NEWER) - throw wrapper.badMagic( new Integer( magic ) ) ; - } - - public void write(ObjectId objectId, OutputStream os) - { - super.write( objectId, os ) ; - getORBVersion().write( os ) ; - } - - public void write(OutputStream os) - { - super.write( os ) ; - getORBVersion().write( os ) ; - } - - protected void setORBVersion( InputStream is ) - { - ORBVersion version = ORBVersionFactory.create( is ) ; - setORBVersion( version ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectAdapterIdArray.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectAdapterIdArray.java deleted file mode 100644 index bb98e46e4e1..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectAdapterIdArray.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior ; - -import java.util.Iterator ; -import java.util.Arrays ; - -public class ObjectAdapterIdArray extends ObjectAdapterIdBase { - private final String[] objectAdapterId ; - - public ObjectAdapterIdArray( String[] objectAdapterId ) - { - this.objectAdapterId = objectAdapterId ; - } - - /** Special constructor used for OA IDs of length 2. - */ - public ObjectAdapterIdArray( String name1, String name2 ) - { - objectAdapterId = new String[2] ; - objectAdapterId[0] = name1 ; - objectAdapterId[1] = name2 ; - } - - public int getNumLevels() - { - return objectAdapterId.length ; - } - - public Iterator iterator() - { - return Arrays.asList( objectAdapterId ).iterator() ; - } - - public String[] getAdapterName() - { - return (String[])(objectAdapterId.clone()) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectAdapterIdBase.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectAdapterIdBase.java deleted file mode 100644 index febce612941..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectAdapterIdBase.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior ; - -import java.util.Iterator ; - -import org.omg.CORBA_2_3.portable.OutputStream ; - -import com.sun.corba.se.spi.ior.ObjectAdapterId ; - -abstract class ObjectAdapterIdBase implements ObjectAdapterId { - public boolean equals( Object other ) - { - if (!(other instanceof ObjectAdapterId)) - return false ; - - ObjectAdapterId theOther = (ObjectAdapterId)other ; - - Iterator iter1 = iterator() ; - Iterator iter2 = theOther.iterator() ; - - while (iter1.hasNext() && iter2.hasNext()) { - String str1 = (String)(iter1.next()) ; - String str2 = (String)(iter2.next()) ; - - if (!str1.equals( str2 )) - return false ; - } - - return iter1.hasNext() == iter2.hasNext() ; - } - - public int hashCode() - { - int result = 17 ; - Iterator iter = iterator() ; - while (iter.hasNext()) { - String str = (String)(iter.next()) ; - result = 37*result + str.hashCode() ; - } - return result ; - } - - public String toString() - { - StringBuffer buff = new StringBuffer() ; - buff.append( "ObjectAdapterID[" ) ; - Iterator iter = iterator() ; - boolean first = true ; - while (iter.hasNext()) { - String str = (String)(iter.next()) ; - - if (first) - first = false ; - else - buff.append( "/" ) ; - - buff.append( str ) ; - } - - buff.append( "]" ) ; - - return buff.toString() ; - } - - public void write( OutputStream os ) - { - os.write_long( getNumLevels() ) ; - Iterator iter = iterator() ; - while (iter.hasNext()) { - String str = (String)(iter.next()) ; - os.write_string( str ) ; - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectAdapterIdNumber.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectAdapterIdNumber.java deleted file mode 100644 index 4fc98527107..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectAdapterIdNumber.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior ; - -import java.util.Iterator ; -import org.omg.CORBA_2_3.portable.OutputStream ; - -/** ObjectAdapterIdNumber is used to represent pre-JDK 1.4 POA adapter - * IDs. The POA ID was simply represented as a single integer, which was - * mapped to the actual POA instance. Here, we just represent these - * internally as arrays of the form {@code { "OldRootPOA", "" }}, - * and provide an extra method to get the number back. - */ -public class ObjectAdapterIdNumber extends ObjectAdapterIdArray { - private int poaid ; - - public ObjectAdapterIdNumber( int poaid ) - { - super( "OldRootPOA", Integer.toString( poaid ) ) ; - this.poaid = poaid ; - } - - public int getOldPOAId() - { - return poaid ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectIdImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectIdImpl.java deleted file mode 100644 index 200f045063d..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectIdImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior; - -import java.util.Arrays ; -import com.sun.corba.se.spi.ior.ObjectId ; -import org.omg.CORBA_2_3.portable.OutputStream ; - -public final class ObjectIdImpl implements ObjectId -{ - private byte[] id; - - public boolean equals( Object obj ) - { - if (!(obj instanceof ObjectIdImpl)) - return false ; - - ObjectIdImpl other = (ObjectIdImpl)obj ; - - return Arrays.equals( this.id, other.id ) ; - } - - public int hashCode() - { - int result = 17 ; - for (int ctr=0; ctr= ORBConstants.FIRST_POA_SCID) && - (scid <= ORBConstants.MAX_POA_SCID)) { - if (magic >= JAVAMAGIC_NEWER) - oktemp = new POAObjectKeyTemplate( orb, magic, scid, is, osh ) ; - else - oktemp = new OldPOAObjectKeyTemplate( orb, magic, scid, is, osh ) ; - } else if ((scid >= 0) && (scid < ORBConstants.FIRST_POA_SCID)) { - if (magic >= JAVAMAGIC_NEWER) - oktemp = new JIDLObjectKeyTemplate( orb, magic, scid, is, osh ) ; - else - oktemp = new OldJIDLObjectKeyTemplate( orb, magic, scid, is, osh ); - } - - return oktemp ; - } - } ; - - /** This handler reads only the oktemp. - */ - private Handler oktempOnly = new Handler() { - public ObjectKeyTemplate handle( int magic, int scid, - InputStream is, OctetSeqHolder osh ) { - ObjectKeyTemplate oktemp = null ; - - if ((scid >= ORBConstants.FIRST_POA_SCID) && - (scid <= ORBConstants.MAX_POA_SCID)) { - if (magic >= JAVAMAGIC_NEWER) - oktemp = new POAObjectKeyTemplate( orb, magic, scid, is ) ; - else - oktemp = new OldPOAObjectKeyTemplate( orb, magic, scid, is ) ; - } else if ((scid >= 0) && (scid < ORBConstants.FIRST_POA_SCID)) { - if (magic >= JAVAMAGIC_NEWER) - oktemp = new JIDLObjectKeyTemplate( orb, magic, scid, is ) ; - else - oktemp = new OldJIDLObjectKeyTemplate( orb, magic, scid, is ) ; - } - - return oktemp ; - } - } ; - - /** Returns true iff magic is in the range of valid magic numbers - * for our ORB. - */ - private boolean validMagic( int magic ) - { - return (magic >= MAGIC_BASE) && (magic <= MAX_MAGIC) ; - } - - /** Creates an ObjectKeyTemplate from the InputStream. Most of the - * decoding is done inside the handler. - */ - private ObjectKeyTemplate create( InputStream is, Handler handler, - OctetSeqHolder osh ) - { - ObjectKeyTemplate oktemp = null ; - - try { - is.mark(0) ; - int magic = is.read_long() ; - - if (validMagic( magic )) { - int scid = is.read_long() ; - oktemp = handler.handle( magic, scid, is, osh ) ; - } - } catch (MARSHAL mexc) { - // XXX log this error - // ignore this: error handled below because oktemp == null - } - - if (oktemp == null) - // If we did not successfully construct a oktemp, reset the - // stream so that WireObjectKeyTemplate can correctly construct the - // object key. - try { - is.reset() ; - } catch (IOException exc) { - // XXX log this error - // ignore this - } - - return oktemp ; - } - - public ObjectKey create( byte[] key ) - { - OctetSeqHolder osh = new OctetSeqHolder() ; - EncapsInputStream is = EncapsInputStreamFactory.newEncapsInputStream( orb, key, key.length ); - - ObjectKeyTemplate oktemp = create( is, fullKey, osh ) ; - if (oktemp == null) - oktemp = new WireObjectKeyTemplate( is, osh ) ; - - ObjectId oid = new ObjectIdImpl( osh.value ) ; - return new ObjectKeyImpl( oktemp, oid ) ; - } - - public ObjectKeyTemplate createTemplate( InputStream is ) - { - ObjectKeyTemplate oktemp = create( is, oktempOnly, null ) ; - if (oktemp == null) - oktemp = new WireObjectKeyTemplate( orb ) ; - - return oktemp ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectKeyImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectKeyImpl.java deleted file mode 100644 index ddf84a311e4..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectKeyImpl.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior; - -import org.omg.CORBA_2_3.portable.OutputStream ; - -import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher ; - -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.spi.ior.ObjectId ; -import com.sun.corba.se.spi.ior.ObjectKey ; -import com.sun.corba.se.spi.ior.ObjectKeyTemplate ; - -import com.sun.corba.se.impl.encoding.EncapsOutputStream ; - -public class ObjectKeyImpl implements ObjectKey -{ - private ObjectKeyTemplate oktemp; - private ObjectId id; - - public boolean equals( Object obj ) - { - if (obj == null) - return false ; - - if (!(obj instanceof ObjectKeyImpl)) - return false ; - - ObjectKeyImpl other = (ObjectKeyImpl)obj ; - - return oktemp.equals( other.oktemp ) && - id.equals( other.id ) ; - } - - public int hashCode() - { - return oktemp.hashCode() ^ id.hashCode() ; - } - - public ObjectKeyTemplate getTemplate() - { - return oktemp ; - } - - public ObjectId getId() - { - return id ; - } - - public ObjectKeyImpl( ObjectKeyTemplate oktemp, ObjectId id ) - { - this.oktemp = oktemp ; - this.id = id ; - } - - public void write( OutputStream os ) - { - oktemp.write( id, os ) ; - } - - public byte[] getBytes( org.omg.CORBA.ORB orb ) - { - EncapsOutputStream os = - sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)orb); - write( os ) ; - return os.toByteArray() ; - } - - public CorbaServerRequestDispatcher getServerRequestDispatcher( ORB orb ) - { - return oktemp.getServerRequestDispatcher( orb, id ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectKeyTemplateBase.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectKeyTemplateBase.java deleted file mode 100644 index 6f0cfbe5914..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectKeyTemplateBase.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior; - -import java.util.Iterator ; - -import org.omg.CORBA_2_3.portable.InputStream ; -import org.omg.CORBA_2_3.portable.OutputStream ; - -import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher ; - -import com.sun.corba.se.spi.ior.ObjectId ; -import com.sun.corba.se.spi.ior.ObjectAdapterId ; -import com.sun.corba.se.spi.ior.ObjectKeyTemplate ; - -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.orb.ORBVersion ; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; - - -import com.sun.corba.se.impl.encoding.EncapsOutputStream ; - -import com.sun.corba.se.impl.logging.IORSystemException ; - - -public abstract class ObjectKeyTemplateBase implements ObjectKeyTemplate -{ - // Fixed constants for Java IDL object key template forms - public static final String JIDL_ORB_ID = "" ; - private static final String[] JIDL_OAID_STRINGS = { "TransientObjectAdapter" } ; - public static final ObjectAdapterId JIDL_OAID = new ObjectAdapterIdArray( JIDL_OAID_STRINGS ) ; - - private ORB orb ; - protected IORSystemException wrapper ; - private ORBVersion version ; - private int magic ; - private int scid ; - private int serverid ; - private String orbid ; - private ObjectAdapterId oaid ; - - private byte[] adapterId ; - - public byte[] getAdapterId() - { - return (byte[])(adapterId.clone()) ; - } - - private byte[] computeAdapterId() - { - // write out serverid, orbid, oaid - ByteBuffer buff = new ByteBuffer() ; - - buff.append( getServerId() ) ; - buff.append( orbid ) ; - - buff.append( oaid.getNumLevels() ) ; - Iterator iter = oaid.iterator() ; - while (iter.hasNext()) { - String comp = (String)(iter.next()) ; - buff.append( comp ) ; - } - - buff.trimToSize() ; - - return buff.toArray() ; - } - - public ObjectKeyTemplateBase( ORB orb, int magic, int scid, int serverid, - String orbid, ObjectAdapterId oaid ) - { - this.orb = orb ; - this.wrapper = IORSystemException.get( orb, - CORBALogDomains.OA_IOR ) ; - this.magic = magic ; - this.scid = scid ; - this.serverid = serverid ; - this.orbid = orbid ; - this.oaid = oaid ; - - adapterId = computeAdapterId() ; - } - - public boolean equals( Object obj ) - { - if (!(obj instanceof ObjectKeyTemplateBase)) - return false ; - - ObjectKeyTemplateBase other = (ObjectKeyTemplateBase)obj ; - - return (magic == other.magic) && (scid == other.scid) && - (serverid == other.serverid) && (version.equals( other.version ) && - orbid.equals( other.orbid ) && oaid.equals( other.oaid )) ; - } - - public int hashCode() - { - int result = 17 ; - result = 37*result + magic ; - result = 37*result + scid ; - result = 37*result + serverid ; - result = 37*result + version.hashCode() ; - result = 37*result + orbid.hashCode() ; - result = 37*result + oaid.hashCode() ; - return result ; - } - - public int getSubcontractId() - { - return scid ; - } - - public int getServerId() - { - return serverid ; - } - - public String getORBId() - { - return orbid ; - } - - public ObjectAdapterId getObjectAdapterId() - { - return oaid ; - } - - public void write(ObjectId objectId, OutputStream os) - { - writeTemplate( os ) ; - objectId.write( os ) ; - } - - public void write( OutputStream os ) - { - writeTemplate( os ) ; - } - - abstract protected void writeTemplate( OutputStream os ) ; - - protected int getMagic() - { - return magic ; - } - - // All subclasses should set the version in their constructors. - // Public so it can be used in a white-box test. - public void setORBVersion( ORBVersion version ) - { - this.version = version ; - } - - public ORBVersion getORBVersion() - { - return version ; - } - - protected byte[] readObjectKey( InputStream is ) - { - int len = is.read_long() ; - byte[] result = new byte[len] ; - is.read_octet_array( result, 0, len ) ; - return result ; - } - - public CorbaServerRequestDispatcher getServerRequestDispatcher( ORB orb, ObjectId id ) - { - return orb.getRequestDispatcherRegistry().getServerRequestDispatcher( scid ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectReferenceFactoryImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectReferenceFactoryImpl.java deleted file mode 100644 index cb5424ce2b3..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectReferenceFactoryImpl.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior ; - -import java.util.Iterator ; - -import org.omg.CORBA.portable.InputStream ; -import org.omg.CORBA.portable.OutputStream ; -import org.omg.CORBA.portable.StreamableValue ; - -import org.omg.CORBA.TypeCode ; - -import org.omg.PortableInterceptor.ObjectReferenceFactory ; -import org.omg.PortableInterceptor.ObjectReferenceFactoryHelper ; - -import com.sun.corba.se.spi.oa.ObjectAdapter ; - -import com.sun.corba.se.spi.ior.ObjectId ; -import com.sun.corba.se.spi.ior.ObjectKeyTemplate ; -import com.sun.corba.se.spi.ior.ObjectAdapterId ; -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.IORFactory; -import com.sun.corba.se.spi.ior.IORTemplateList; -import com.sun.corba.se.spi.ior.IORFactories; - -import com.sun.corba.se.impl.orbutil.ORBUtility ; - -import com.sun.corba.se.spi.orb.ORB ; - -/** This is an implementation of the ObjectReferenceFactory abstract value -* type defined by the portable interceptors IDL. -* Note that this is a direct Java implementation -* of the abstract value type: there is no stateful value type defined in IDL, -* since defining the state in IDL is awkward and inefficient. The best way -* to define the state is to use internal data structures that can be written -* to and read from CORBA streams. -*/ -public class ObjectReferenceFactoryImpl extends ObjectReferenceProducerBase - implements ObjectReferenceFactory, StreamableValue -{ - transient private IORTemplateList iorTemplates ; - - public ObjectReferenceFactoryImpl( InputStream is ) - { - super( (ORB)(is.orb()) ) ; - _read( is ) ; - } - - public ObjectReferenceFactoryImpl( ORB orb, IORTemplateList iortemps ) - { - super( orb ) ; - iorTemplates = iortemps ; - } - - public boolean equals( Object obj ) - { - if (!(obj instanceof ObjectReferenceFactoryImpl)) - return false ; - - ObjectReferenceFactoryImpl other = (ObjectReferenceFactoryImpl)obj ; - - return (iorTemplates != null) && - iorTemplates.equals( other.iorTemplates ) ; - } - - public int hashCode() - { - return iorTemplates.hashCode() ; - } - - // Note that this repository ID must reflect the implementation - // of the abstract valuetype (that is, this class), not the - // repository ID of the org.omg.PortableInterceptor.ObjectReferenceFactory - // class. This allows for multiple independent implementations - // of the abstract valuetype, should that become necessary. - public static final String repositoryId = - "IDL:com/sun/corba/se/impl/ior/ObjectReferenceFactoryImpl:1.0" ; - - public String[] _truncatable_ids() - { - return new String[] { repositoryId } ; - } - - public TypeCode _type() - { - return ObjectReferenceFactoryHelper.type() ; - } - - /** Read the data into a (presumably) empty ObjectReferenceFactoryImpl. - * This sets the orb to the ORB of the InputStream. - */ - public void _read( InputStream is ) - { - org.omg.CORBA_2_3.portable.InputStream istr = - (org.omg.CORBA_2_3.portable.InputStream)is ; - - iorTemplates = IORFactories.makeIORTemplateList( istr ) ; - } - - /** Write the state to the OutputStream. - */ - public void _write( OutputStream os ) - { - org.omg.CORBA_2_3.portable.OutputStream ostr = - (org.omg.CORBA_2_3.portable.OutputStream)os ; - - iorTemplates.write( ostr ) ; - } - - public IORFactory getIORFactory() - { - return iorTemplates ; - } - - public IORTemplateList getIORTemplateList() - { - return iorTemplates ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectReferenceProducerBase.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectReferenceProducerBase.java deleted file mode 100644 index f4a3a60dc77..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectReferenceProducerBase.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior ; - -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.spi.ior.IORFactory ; -import com.sun.corba.se.spi.ior.IOR ; -import com.sun.corba.se.spi.ior.IORFactories ; -import com.sun.corba.se.spi.ior.IORTemplateList ; -import com.sun.corba.se.spi.ior.ObjectId ; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; - -import com.sun.corba.se.impl.orbutil.ORBUtility ; - -import com.sun.corba.se.impl.logging.IORSystemException ; - -public abstract class ObjectReferenceProducerBase { - transient protected ORB orb ; - - public abstract IORFactory getIORFactory() ; - - public abstract IORTemplateList getIORTemplateList() ; - - public ObjectReferenceProducerBase( ORB orb ) - { - this.orb = orb ; - } - - public org.omg.CORBA.Object make_object (String repositoryId, - byte[] objectId) - { - ObjectId oid = IORFactories.makeObjectId( objectId ) ; - IOR ior = getIORFactory().makeIOR( orb, repositoryId, oid ) ; - - return ORBUtility.makeObjectReference( ior ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectReferenceTemplateImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectReferenceTemplateImpl.java deleted file mode 100644 index 267f2dbf128..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectReferenceTemplateImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior ; - -import java.util.Iterator ; - -import org.omg.CORBA.portable.InputStream ; -import org.omg.CORBA.portable.OutputStream ; -import org.omg.CORBA.portable.StreamableValue ; - -import org.omg.CORBA.TypeCode ; - -import org.omg.PortableInterceptor.ObjectReferenceTemplate ; -import org.omg.PortableInterceptor.ObjectReferenceTemplateHelper ; - -import com.sun.corba.se.spi.oa.ObjectAdapter ; - -import com.sun.corba.se.spi.ior.ObjectId ; -import com.sun.corba.se.spi.ior.ObjectKeyTemplate ; -import com.sun.corba.se.spi.ior.ObjectAdapterId ; -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.IORFactory; -import com.sun.corba.se.spi.ior.IORTemplate; -import com.sun.corba.se.spi.ior.IORTemplateList; -import com.sun.corba.se.spi.ior.IORFactories; - -import com.sun.corba.se.impl.orbutil.ORBUtility ; - -import com.sun.corba.se.spi.orb.ORB ; - -/** This is an implementation of the ObjectReferenceTemplate abstract value -* type defined by the portable interceptors IDL. -* Note that this is a direct Java implementation -* of the abstract value type: there is no stateful value type defined in IDL, -* since defining the state in IDL is awkward and inefficient. The best way -* to define the state is to use internal data structures that can be written -* to and read from CORBA streams. -*/ -public class ObjectReferenceTemplateImpl extends ObjectReferenceProducerBase - implements ObjectReferenceTemplate, StreamableValue -{ - transient private IORTemplate iorTemplate ; - - public ObjectReferenceTemplateImpl( InputStream is ) - { - super( (ORB)(is.orb()) ) ; - _read( is ) ; - } - - public ObjectReferenceTemplateImpl( ORB orb, IORTemplate iortemp ) - { - super( orb ) ; - iorTemplate = iortemp ; - } - - public boolean equals( Object obj ) - { - if (!(obj instanceof ObjectReferenceTemplateImpl)) - return false ; - - ObjectReferenceTemplateImpl other = (ObjectReferenceTemplateImpl)obj ; - - return (iorTemplate != null) && - iorTemplate.equals( other.iorTemplate ) ; - } - - public int hashCode() - { - return iorTemplate.hashCode() ; - } - - // Note that this repository ID must reflect the implementation - // of the abstract valuetype (that is, this class), not the - // repository ID of the org.omg.PortableInterceptor.ObjectReferenceTemplate - // class. This allows for multiple independent implementations - // of the abstract valuetype, should that become necessary. - public static final String repositoryId = - "IDL:com/sun/corba/se/impl/ior/ObjectReferenceTemplateImpl:1.0" ; - - public String[] _truncatable_ids() - { - return new String[] { repositoryId } ; - } - - public TypeCode _type() - { - return ObjectReferenceTemplateHelper.type() ; - } - - /** Read the data into a (presumably) empty ORTImpl. This sets the - * orb to the ORB of the InputStream. - */ - public void _read( InputStream is ) - { - org.omg.CORBA_2_3.portable.InputStream istr = - (org.omg.CORBA_2_3.portable.InputStream)is ; - iorTemplate = IORFactories.makeIORTemplate( istr ) ; - orb = (ORB)(istr.orb()) ; - } - - /** Write the state to the OutputStream. - */ - public void _write( OutputStream os ) - { - org.omg.CORBA_2_3.portable.OutputStream ostr = - (org.omg.CORBA_2_3.portable.OutputStream)os ; - - iorTemplate.write( ostr ) ; - } - - public String server_id () - { - int val = iorTemplate.getObjectKeyTemplate().getServerId() ; - return Integer.toString( val ) ; - } - - public String orb_id () - { - return iorTemplate.getObjectKeyTemplate().getORBId() ; - } - - public String[] adapter_name() - { - ObjectAdapterId poaid = - iorTemplate.getObjectKeyTemplate().getObjectAdapterId() ; - - return poaid.getAdapterName() ; - } - - public IORFactory getIORFactory() - { - return iorTemplate ; - } - - public IORTemplateList getIORTemplateList() - { - IORTemplateList tl = IORFactories.makeIORTemplateList() ; - tl.add( iorTemplate ) ; - tl.makeImmutable() ; - return tl ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/OldJIDLObjectKeyTemplate.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/OldJIDLObjectKeyTemplate.java deleted file mode 100644 index e5b854c5010..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/OldJIDLObjectKeyTemplate.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior; - -import org.omg.CORBA.OctetSeqHolder ; - -import org.omg.CORBA_2_3.portable.InputStream ; -import org.omg.CORBA_2_3.portable.OutputStream ; - -import com.sun.corba.se.spi.ior.ObjectId ; -import com.sun.corba.se.spi.ior.ObjectKeyFactory ; - -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.orb.ORBVersion ; -import com.sun.corba.se.spi.orb.ORBVersionFactory ; - -import com.sun.corba.se.impl.ior.ObjectKeyFactoryImpl ; - -import com.sun.corba.se.impl.encoding.CDRInputStream ; - -/** - * Handles object keys created by JDK ORBs from before JDK 1.4.0. - */ -public final class OldJIDLObjectKeyTemplate extends OldObjectKeyTemplateBase -{ - /** - * JDK 1.3.1 FCS did not include a version byte at the end of - * its object keys. JDK 1.3.1_01 included the byte with the - * value 1. Anything below 1 is considered an invalid value. - */ - public static final byte NULL_PATCH_VERSION = 0; - - byte patchVersion = OldJIDLObjectKeyTemplate.NULL_PATCH_VERSION; - - public OldJIDLObjectKeyTemplate( ORB orb, int magic, int scid, - InputStream is, OctetSeqHolder osh ) - { - this( orb, magic, scid, is ); - - osh.value = readObjectKey( is ) ; - - /** - * Beginning with JDK 1.3.1_01, a byte was placed at the end of - * the object key with a value indicating the patch version. - * JDK 1.3.1_01 had the value 1. If other patches are necessary - * which involve ORB versioning changes, they should increment - * the patch version. - * - * Note that if we see a value greater than 1 in this code, we - * will treat it as if we're talking to the most recent ORB version. - * - * WARNING: This code is sensitive to changes in CDRInputStream - * getPosition. It assumes that the CDRInputStream is an - * encapsulation whose position can be compared to the object - * key array length. - */ - if (magic == ObjectKeyFactoryImpl.JAVAMAGIC_NEW && - osh.value.length > ((CDRInputStream)is).getPosition()) { - - patchVersion = is.read_octet(); - - if (patchVersion == ObjectKeyFactoryImpl.JDK1_3_1_01_PATCH_LEVEL) - setORBVersion(ORBVersionFactory.getJDK1_3_1_01()); - else if (patchVersion > ObjectKeyFactoryImpl.JDK1_3_1_01_PATCH_LEVEL) - setORBVersion(ORBVersionFactory.getORBVersion()); - else - throw wrapper.invalidJdk131PatchLevel( new Integer( patchVersion ) ) ; - } - } - - - public OldJIDLObjectKeyTemplate( ORB orb, int magic, int scid, int serverid) - { - super( orb, magic, scid, serverid, JIDL_ORB_ID, JIDL_OAID ) ; - } - - public OldJIDLObjectKeyTemplate(ORB orb, int magic, int scid, InputStream is) - { - this( orb, magic, scid, is.read_long() ) ; - } - - protected void writeTemplate( OutputStream os ) - { - os.write_long( getMagic() ) ; - os.write_long( getSubcontractId() ) ; - os.write_long( getServerId() ) ; - } - - public void write(ObjectId objectId, OutputStream os) - { - super.write(objectId, os); - - if (patchVersion != OldJIDLObjectKeyTemplate.NULL_PATCH_VERSION) - os.write_octet( patchVersion ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/OldObjectKeyTemplateBase.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/OldObjectKeyTemplateBase.java deleted file mode 100644 index e68d6f60583..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/OldObjectKeyTemplateBase.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior; - -import com.sun.corba.se.spi.ior.ObjectAdapterId ; - -import org.omg.CORBA_2_3.portable.OutputStream ; - -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.orb.ORBVersion ; -import com.sun.corba.se.spi.orb.ORBVersionFactory ; - -import com.sun.corba.se.impl.ior.ObjectKeyFactoryImpl ; - -/** - * @author Ken Cavanaugh - */ -public abstract class OldObjectKeyTemplateBase extends ObjectKeyTemplateBase -{ - public OldObjectKeyTemplateBase( ORB orb, int magic, int scid, int serverid, - String orbid, ObjectAdapterId oaid ) - { - super( orb, magic, scid, serverid, orbid, oaid ) ; - - // set version based on magic - if (magic == ObjectKeyFactoryImpl.JAVAMAGIC_OLD) - setORBVersion( ORBVersionFactory.getOLD() ) ; - else if (magic == ObjectKeyFactoryImpl.JAVAMAGIC_NEW) - setORBVersion( ORBVersionFactory.getNEW() ) ; - else // any other magic should not be here - throw wrapper.badMagic( new Integer( magic ) ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/OldPOAObjectKeyTemplate.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/OldPOAObjectKeyTemplate.java deleted file mode 100644 index 626310cebfa..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/OldPOAObjectKeyTemplate.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior; - -import org.omg.CORBA.INTERNAL ; -import org.omg.CORBA.OctetSeqHolder ; - -import org.omg.CORBA_2_3.portable.InputStream ; -import org.omg.CORBA_2_3.portable.OutputStream ; - -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.orb.ORBVersion ; -import com.sun.corba.se.spi.orb.ORBVersionFactory ; - -import com.sun.corba.se.impl.ior.ObjectKeyFactoryImpl ; - -/** - * @author Ken Cavanaugh - */ -public final class OldPOAObjectKeyTemplate extends OldObjectKeyTemplateBase -{ - /** This constructor reads the template ONLY from the stream - */ - public OldPOAObjectKeyTemplate( ORB orb, int magic, int scid, InputStream is ) - { - this( orb, magic, scid, is.read_long(), is.read_long(), is.read_long() ) ; - } - - /** This constructor reads a complete ObjectKey (template and Id) - * from the stream. - */ - public OldPOAObjectKeyTemplate( ORB orb, int magic, int scid, InputStream is, - OctetSeqHolder osh ) - { - this( orb, magic, scid, is ) ; - osh.value = readObjectKey( is ) ; - } - - public OldPOAObjectKeyTemplate( ORB orb, int magic, int scid, int serverid, - int orbid, int poaid) - { - super( orb, magic, scid, serverid, - Integer.toString( orbid ), - new ObjectAdapterIdNumber( poaid ) ) ; - } - - public void writeTemplate(OutputStream os) - { - os.write_long( getMagic() ) ; - os.write_long( getSubcontractId() ) ; - os.write_long( getServerId() ) ; - - int orbid = Integer.parseInt( getORBId() ) ; - os.write_long( orbid ) ; - - ObjectAdapterIdNumber oaid = (ObjectAdapterIdNumber)(getObjectAdapterId()) ; - int poaid = oaid.getOldPOAId() ; - os.write_long( poaid ) ; - } - - public ORBVersion getORBVersion() - { - if (getMagic() == ObjectKeyFactoryImpl.JAVAMAGIC_OLD) - return ORBVersionFactory.getOLD() ; - else if (getMagic() == ObjectKeyFactoryImpl.JAVAMAGIC_NEW) - return ORBVersionFactory.getNEW() ; - else - throw new INTERNAL() ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/POAObjectKeyTemplate.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/POAObjectKeyTemplate.java deleted file mode 100644 index 3a8eac05e2b..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/POAObjectKeyTemplate.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior; - -import java.util.Iterator ; - -import org.omg.CORBA_2_3.portable.InputStream ; -import org.omg.CORBA_2_3.portable.OutputStream ; - -import org.omg.CORBA.OctetSeqHolder ; - -import com.sun.corba.se.spi.activation.POANameHelper ; - -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.orb.ORBVersion ; -import com.sun.corba.se.spi.orb.ORBVersionFactory ; - -import com.sun.corba.se.spi.ior.ObjectAdapterId ; - -import com.sun.corba.se.impl.ior.ObjectKeyFactoryImpl ; - -public final class POAObjectKeyTemplate extends NewObjectKeyTemplateBase -{ - /** This constructor reads the template ONLY from the stream. - */ - public POAObjectKeyTemplate( ORB orb, int magic, int scid, InputStream is ) - { - super( orb, magic, scid, is.read_long(), is.read_string(), - new ObjectAdapterIdArray( POANameHelper.read( is ) ) ) ; - - setORBVersion( is ) ; - } - - /** This constructor reads a complete ObjectKey (template and Id) - * from the stream. - */ - public POAObjectKeyTemplate( ORB orb, int magic, int scid, InputStream is, - OctetSeqHolder osh ) - { - super( orb, magic, scid, is.read_long(), is.read_string(), - new ObjectAdapterIdArray( POANameHelper.read( is ) ) ) ; - - osh.value = readObjectKey( is ) ; - - setORBVersion( is ) ; - } - - public POAObjectKeyTemplate( ORB orb, int scid, int serverid, String orbid, - ObjectAdapterId objectAdapterId) - { - super( orb, ObjectKeyFactoryImpl.JAVAMAGIC_NEWER, scid, serverid, orbid, - objectAdapterId ) ; - - setORBVersion( ORBVersionFactory.getORBVersion() ) ; - } - - public void writeTemplate(OutputStream os) - { - os.write_long( getMagic() ) ; - os.write_long( getSubcontractId() ) ; - os.write_long( getServerId() ) ; - os.write_string( getORBId() ) ; - getObjectAdapterId().write( os ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/StubIORImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/StubIORImpl.java deleted file mode 100644 index 3c455e3aca8..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/StubIORImpl.java +++ /dev/null @@ -1,267 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.ior; - -import java.io.ObjectInputStream ; -import java.io.ObjectOutputStream ; -import java.io.IOException ; -import java.io.StringWriter ; - -import org.omg.CORBA.ORB ; - -import org.omg.CORBA.portable.Delegate ; -import org.omg.CORBA.portable.InputStream ; -import org.omg.CORBA.portable.OutputStream ; - -// Be very careful: com.sun.corba imports must not depend on -// PEORB internal classes in ways that prevent portability to -// other vendor's ORBs. -import com.sun.corba.se.spi.presentation.rmi.StubAdapter ; -import com.sun.corba.se.impl.orbutil.HexOutputStream ; - -/** - * This class implements a very simply IOR representation - * which must be completely ORBImpl free so that this class - * can be used in the implementation of a portable StubDelegateImpl. - */ -public class StubIORImpl -{ - // cached hash code - private int hashCode; - - // IOR components - private byte[] typeData; - private int[] profileTags; - private byte[][] profileData; - - public StubIORImpl() - { - hashCode = 0 ; - typeData = null ; - profileTags = null ; - profileData = null ; - } - - public String getRepositoryId() - { - if (typeData == null) - return null ; - - return new String( typeData ) ; - } - - public StubIORImpl( org.omg.CORBA.Object obj ) - { - // write the IOR to an OutputStream and get an InputStream - OutputStream ostr = StubAdapter.getORB( obj ).create_output_stream(); - ostr.write_Object(obj); - InputStream istr = ostr.create_input_stream(); - - // read the IOR components back from the stream - int typeLength = istr.read_long(); - typeData = new byte[typeLength]; - istr.read_octet_array(typeData, 0, typeLength); - int numProfiles = istr.read_long(); - profileTags = new int[numProfiles]; - profileData = new byte[numProfiles][]; - for (int i = 0; i < numProfiles; i++) { - profileTags[i] = istr.read_long(); - profileData[i] = new byte[istr.read_long()]; - istr.read_octet_array(profileData[i], 0, profileData[i].length); - } - } - - public Delegate getDelegate( ORB orb ) - { - // write the IOR components to an org.omg.CORBA.portable.OutputStream - OutputStream ostr = orb.create_output_stream(); - ostr.write_long(typeData.length); - ostr.write_octet_array(typeData, 0, typeData.length); - ostr.write_long(profileTags.length); - for (int i = 0; i < profileTags.length; i++) { - ostr.write_long(profileTags[i]); - ostr.write_long(profileData[i].length); - ostr.write_octet_array(profileData[i], 0, profileData[i].length); - } - - InputStream istr = ostr.create_input_stream() ; - - // read the IOR back from the stream - org.omg.CORBA.Object obj = (org.omg.CORBA.Object)istr.read_Object(); - return StubAdapter.getDelegate( obj ) ; - } - - public void doRead( java.io.ObjectInputStream stream ) - throws IOException, ClassNotFoundException - { - // read the IOR from the ObjectInputStream - int typeLength = stream.readInt(); - typeData = new byte[typeLength]; - stream.readFully(typeData); - int numProfiles = stream.readInt(); - profileTags = new int[numProfiles]; - profileData = new byte[numProfiles][]; - for (int i = 0; i < numProfiles; i++) { - profileTags[i] = stream.readInt(); - profileData[i] = new byte[stream.readInt()]; - stream.readFully(profileData[i]); - } - } - - public void doWrite( ObjectOutputStream stream ) - throws IOException - { - // write the IOR to the ObjectOutputStream - stream.writeInt(typeData.length); - stream.write(typeData); - stream.writeInt(profileTags.length); - for (int i = 0; i < profileTags.length; i++) { - stream.writeInt(profileTags[i]); - stream.writeInt(profileData[i].length); - stream.write(profileData[i]); - } - } - - /** - * Returns a hash code value for the object which is the same for all stubs - * that represent the same remote object. - * @return the hash code value. - */ - public synchronized int hashCode() - { - if (hashCode == 0) { - - // compute the hash code - for (int i = 0; i < typeData.length; i++) { - hashCode = hashCode * 37 + typeData[i]; - } - - for (int i = 0; i < profileTags.length; i++) { - hashCode = hashCode * 37 + profileTags[i]; - for (int j = 0; j < profileData[i].length; j++) { - hashCode = hashCode * 37 + profileData[i][j]; - } - } - } - - return hashCode; - } - - private boolean equalArrays( int[] data1, int[] data2 ) - { - if (data1.length != data2.length) - return false ; - - for (int ctr=0; ctr,[]data, ...]"} - * @return a string representation of this stub. - */ - public String toString() - { - StringBuffer result = new StringBuffer() ; - result.append( "SimpleIORImpl[" ) ; - String repositoryId = new String( typeData ) ; - result.append( repositoryId ) ; - for (int ctr=0; ctr32K - CodeSetsComponent - - none additional - JavaCodebaseComponent - - none additional - ORBTypeComponent - - none additional - PoliciesComponent - - none additional - -IdentifiableContainerBase (DONE) - - Test iteratorById on Identifiables (DONE) - - Iterator on id not present is empty (hasNext() == false) - - Iterator on id present returns all ids in sequence -IdEncapsulationContainerBase (DONE) - - Test read sequence of TaggedComponents - - Test writing sequence of TaggedComponents -GenericIdEncapsulation (DONE) - - Test by using for tagged profile and tagged component - - write out and read back test -IIOPAddress (DONE) - - Constructed object returns correct values - - equals: - - false for non-IIOPAddress value - - true iff ports and hosts match -IIOPProfile (DONE) - - construct from id, template; check that correct values are returned - - write out and read back - - no components for 1.0 - - components for >1.0 - - getObjectKey returns value constructed correctly - - isEquivalent iff ids equal and templates equivalent -IIOPProfileTemplate (DONE) - - Constructed object contains correct values - - isEquivalent iff address and template are equal - - cannot have new components added after makeImmutable call -IOR (DONE) - - Constructed object contains correct values - - IOR() has null typeid and no profiles (DONE) - - IOR( String ) has given typeid and no profiles (DONE) - - IOR( String, IIOPProfileTemplate, ObjectId ) has given typeid and - one IIOPProfile corresponding to template and objectid - - IOR( String, IORTemplate, ObjectId ) has profiles corresponding to - IORTemplate and ObjectIds. (DONE) - - IORTemplate( String, IORTemplate, ObjectIds ) has profiles - corresponding to IORTemplate and ObjectIds (DONE) - - IOR( IORTemplate, ObjectIds ) usual test (DONE) - - write out/read back test (DONE) - - Construct IOR with 2 IIOPProfiles, each with several components, - and 2 GenericIdEncapsulation profiles, write out, read back, - check for equals directly and by calling equals - - cannot have new profiles added after makeImmutable call (DONE) - - contained IIOPProfiles cannot have added components after - makeImmutable call. (DONE) -IORTemplate (DONE) - - Constructed object contains correct value -JIDLObjectKeyTemplate (DONE) - - test that IDs match expected values when created from - byte[] in ObjectKeyFactory.create - - Constructed object contains correct values - - write out and read back test - - getId correctly extract id from key -FreezableList (DONE) - - ASSUME that it acts like a linked list: don't test entire interface - - all modification operations throw UnsupportedOperationException - after makeImmutable call - - all iterators (whether created before or after makeImmutable call) - throw U.O.E. after makeImmutable -ObjectId (DONE) - - constructed object returns same id - - test cases in equals -ObjectKey (DONE) - - constructed object returns same id, template - - write/read test - - getBytes returns correct value (test by using factory and - comparing) -ObjectKeyFactory (DONE) - - test create with hand created keys - - key length < 4 - - key length >= 4 - - magic is JAVAMAGIC - - scid is POA scid - - scid is JIDL scid - - other scid - - magic is not JAVAMAGIC - - test with error cases on length -POAObjectKeyTemplate (DONE) - - test that IDs match expected values when created from - byte[] in ObjectKeyFactory.create - - test that IDs match when created with explicit values - - write out and read back test - - getId correctly extracts id from key -TaggedComponentFactories (DONE) - - only tested inditectly by reading and writing IIOPProfileTemplate - that contains all components -TaggedComponentFactoryFinder (DONE) - - registered factory can be looked up - - lookup of unregistered factory returns null - - reads tagged component from stream as correct type if registered - - reads tagged component from stream as generic if not registered -TaggedProfileFactoryFinder (DONE) - - reads IIOP profile as IIOPProfile - - reads others as Generic -WireObjectTemplate (DONE) - - getId returns entire key as id - - serverId is -1 - - write out and read back test - -Interfaces (no tests): - IdEncapsulation - IdEncapsulationFactory - IdEncapsulationFactoryFinder - Identifiable - ObjectKeyTemplateo - ObjectKeyTemplate - TaggedComponent - TaggedProfile - TaggedProfileTemplate - Writeable - -Trivial classes: - ObjectIds diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/WireObjectKeyTemplate.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/WireObjectKeyTemplate.java deleted file mode 100644 index b80e00e278f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/WireObjectKeyTemplate.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior; - -import org.omg.CORBA.OctetSeqHolder ; - -import org.omg.CORBA_2_3.portable.OutputStream ; -import org.omg.CORBA_2_3.portable.InputStream ; - -import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher ; - -import com.sun.corba.se.spi.ior.ObjectKeyTemplate ; -import com.sun.corba.se.spi.ior.ObjectId ; -import com.sun.corba.se.spi.ior.ObjectAdapterId ; - -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.orb.ORBVersion ; -import com.sun.corba.se.spi.orb.ORBVersionFactory ; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; - -import com.sun.corba.se.impl.orbutil.ORBConstants ; - -import com.sun.corba.se.impl.encoding.CDRInputStream ; - -import com.sun.corba.se.impl.logging.IORSystemException ; - -/** - * @author Ken Cavanaugh - */ -public class WireObjectKeyTemplate implements ObjectKeyTemplate -{ - private ORB orb ; - private IORSystemException wrapper ; - - public boolean equals( Object obj ) - { - if (obj == null) - return false ; - - return obj instanceof WireObjectKeyTemplate ; - } - - public int hashCode() - { - return 53 ; // All WireObjectKeyTemplates are the same, so they should - // have the same hashCode. - } - - private byte[] getId( InputStream is ) - { - CDRInputStream cis = (CDRInputStream)is ; - int len = cis.getBufferLength() ; - byte[] result = new byte[ len ] ; - cis.read_octet_array( result, 0, len ) ; - return result ; - } - - public WireObjectKeyTemplate( ORB orb ) - { - initORB( orb ) ; - } - - public WireObjectKeyTemplate( InputStream is, OctetSeqHolder osh ) - { - osh.value = getId( is ) ; - initORB( (ORB)(is.orb())) ; - } - - private void initORB( ORB orb ) - { - this.orb = orb ; - wrapper = IORSystemException.get( orb, - CORBALogDomains.OA_IOR ) ; - } - - public void write( ObjectId id, OutputStream os ) - { - byte[] key = id.getId() ; - os.write_octet_array( key, 0, key.length ) ; - } - - public void write( OutputStream os ) - { - // Does nothing - } - - public int getSubcontractId() - { - return ORBConstants.DEFAULT_SCID ; - } - - /** While it might make sense to throw an exception here, this causes - * problems since we need to check whether unusual object references - * are local or not. It seems that the easiest way to handle this is - * to return an invalid server id. - */ - public int getServerId() - { - return -1 ; - } - - public String getORBId() - { - throw wrapper.orbIdNotAvailable() ; - } - - public ObjectAdapterId getObjectAdapterId() - { - throw wrapper.objectAdapterIdNotAvailable() ; - } - - /** Adapter ID is not available, since our - * ORB did not implement the object carrying this key. - */ - public byte[] getAdapterId() - { - throw wrapper.adapterIdNotAvailable() ; - } - - public ORBVersion getORBVersion() - { - return ORBVersionFactory.getFOREIGN() ; - } - - public CorbaServerRequestDispatcher getServerRequestDispatcher( ORB orb, ObjectId id ) - { - byte[] bid = id.getId() ; - String str = new String( bid ) ; - return orb.getRequestDispatcherRegistry().getServerRequestDispatcher( str ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/AlternateIIOPAddressComponentImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/AlternateIIOPAddressComponentImpl.java deleted file mode 100644 index 231dac60620..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/AlternateIIOPAddressComponentImpl.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior.iiop; - -import org.omg.CORBA_2_3.portable.OutputStream ; - -import com.sun.corba.se.spi.ior.TaggedComponentBase ; - -import com.sun.corba.se.spi.ior.iiop.IIOPAddress ; -import com.sun.corba.se.spi.ior.iiop.AlternateIIOPAddressComponent ; - -import org.omg.IOP.TAG_ALTERNATE_IIOP_ADDRESS ; - -/** - * @author Ken Cavanaugh - */ -public class AlternateIIOPAddressComponentImpl extends TaggedComponentBase - implements AlternateIIOPAddressComponent -{ - private IIOPAddress addr ; - - public boolean equals( Object obj ) - { - if (!(obj instanceof AlternateIIOPAddressComponentImpl)) - return false ; - - AlternateIIOPAddressComponentImpl other = - (AlternateIIOPAddressComponentImpl)obj ; - - return addr.equals( other.addr ) ; - } - - public int hashCode() - { - return addr.hashCode() ; - } - - public String toString() - { - return "AlternateIIOPAddressComponentImpl[addr=" + addr + "]" ; - } - - public AlternateIIOPAddressComponentImpl( IIOPAddress addr ) - { - this.addr = addr ; - } - - public IIOPAddress getAddress() - { - return addr ; - } - - public void writeContents(OutputStream os) - { - addr.write( os ) ; - } - - public int getId() - { - return TAG_ALTERNATE_IIOP_ADDRESS.value ; // 3 in CORBA 2.3.1 13.6.3 - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/CodeSetsComponentImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/CodeSetsComponentImpl.java deleted file mode 100644 index 1bc03c61f92..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/CodeSetsComponentImpl.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior.iiop; - -import org.omg.CORBA_2_3.portable.InputStream ; -import org.omg.CORBA_2_3.portable.OutputStream ; - -import com.sun.corba.se.spi.ior.TaggedComponentBase ; - -import com.sun.corba.se.spi.ior.iiop.CodeSetsComponent ; - -import org.omg.IOP.TAG_CODE_SETS ; - -import com.sun.corba.se.impl.encoding.CodeSetComponentInfo ; -import com.sun.corba.se.impl.encoding.MarshalOutputStream ; -import com.sun.corba.se.impl.encoding.MarshalInputStream ; - -public class CodeSetsComponentImpl extends TaggedComponentBase - implements CodeSetsComponent -{ - CodeSetComponentInfo csci ; - - public boolean equals( Object obj ) - { - if (!(obj instanceof CodeSetsComponentImpl)) - return false ; - - CodeSetsComponentImpl other = (CodeSetsComponentImpl)obj ; - - return csci.equals( other.csci ) ; - } - - public int hashCode() - { - return csci.hashCode() ; - } - - public String toString() - { - return "CodeSetsComponentImpl[csci=" + csci + "]" ; - } - - public CodeSetsComponentImpl() - { - // Uses our default code sets (see CodeSetComponentInfo) - csci = new CodeSetComponentInfo() ; - } - - public CodeSetsComponentImpl( InputStream is ) - { - csci = new CodeSetComponentInfo() ; - csci.read( (MarshalInputStream)is ) ; - } - - public CodeSetsComponentImpl(com.sun.corba.se.spi.orb.ORB orb) - { - if (orb == null) - csci = new CodeSetComponentInfo(); - else - csci = orb.getORBData().getCodeSetComponentInfo(); - } - - public CodeSetComponentInfo getCodeSetComponentInfo() - { - return csci ; - } - - public void writeContents(OutputStream os) - { - csci.write( (MarshalOutputStream)os ) ; - } - - public int getId() - { - return TAG_CODE_SETS.value ; // 1 in CORBA 2.3.1 13.6.3 - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPAddressBase.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPAddressBase.java deleted file mode 100644 index cc91839e0ec..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPAddressBase.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior.iiop ; - -import org.omg.CORBA.BAD_PARAM ; - -import org.omg.CORBA_2_3.portable.InputStream ; -import org.omg.CORBA_2_3.portable.OutputStream ; - -import com.sun.corba.se.spi.ior.iiop.IIOPAddress ; - -abstract class IIOPAddressBase implements IIOPAddress -{ - // Ports are marshalled as shorts on the wire. The IDL - // type is unsigned short, which lacks a convenient representation - // in Java in the 32768-65536 range. So, we treat ports as - // ints throught this code, except that marshalling requires a - // scaling conversion. intToShort and shortToInt are provided - // for this purpose. - protected short intToShort( int value ) - { - if (value > 32767) - return (short)(value - 65536) ; - return (short)value ; - } - - protected int shortToInt( short value ) - { - if (value < 0) - return value + 65536 ; - return value ; - } - - public void write( OutputStream os ) - { - os.write_string( getHost() ) ; - int port = getPort() ; - os.write_short( intToShort( port ) ) ; - } - - public boolean equals( Object obj ) - { - if (!(obj instanceof IIOPAddress)) - return false ; - - IIOPAddress other = (IIOPAddress)obj ; - - return getHost().equals(other.getHost()) && - (getPort() == other.getPort()) ; - } - - public int hashCode() - { - return getHost().hashCode() ^ getPort() ; - } - - public String toString() - { - return "IIOPAddress[" + getHost() + "," + getPort() + "]" ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPAddressClosureImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPAddressClosureImpl.java deleted file mode 100644 index 80ecfac09b9..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPAddressClosureImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior.iiop; - -import org.omg.CORBA.BAD_PARAM ; - -import org.omg.CORBA_2_3.portable.InputStream ; -import org.omg.CORBA_2_3.portable.OutputStream ; - -import com.sun.corba.se.spi.orbutil.closure.Closure ; - -public final class IIOPAddressClosureImpl extends IIOPAddressBase -{ - private Closure host; - private Closure port; - - public IIOPAddressClosureImpl( Closure host, Closure port ) - { - this.host = host ; - this.port = port ; - } - - public String getHost() - { - return (String)(host.evaluate()) ; - } - - public int getPort() - { - Integer value = (Integer)(port.evaluate()) ; - return value.intValue() ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPAddressImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPAddressImpl.java deleted file mode 100644 index 255f20aff82..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPAddressImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior.iiop; - -import org.omg.CORBA.BAD_PARAM ; - -import org.omg.CORBA_2_3.portable.InputStream ; -import org.omg.CORBA_2_3.portable.OutputStream ; - -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; - -import com.sun.corba.se.impl.logging.IORSystemException ; - -public final class IIOPAddressImpl extends IIOPAddressBase -{ - private ORB orb ; - private IORSystemException wrapper ; - private String host; - private int port; - - public IIOPAddressImpl( ORB orb, String host, int port ) - { - this.orb = orb ; - wrapper = IORSystemException.get( orb, - CORBALogDomains.OA_IOR ) ; - - if ((port < 0) || (port > 65535)) - throw wrapper.badIiopAddressPort( new Integer(port)) ; - - this.host = host ; - this.port = port ; - } - - public IIOPAddressImpl( InputStream is ) - { - host = is.read_string() ; - short thePort = is.read_short() ; - port = shortToInt( thePort ) ; - } - - public String getHost() - { - return host ; - } - - public int getPort() - { - return port ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileImpl.java deleted file mode 100644 index bb30cc86b9d..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileImpl.java +++ /dev/null @@ -1,348 +0,0 @@ -/* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior.iiop; - -import java.util.List ; -import java.util.Iterator ; - -import org.omg.CORBA.SystemException ; - -import org.omg.CORBA_2_3.portable.OutputStream ; -import org.omg.CORBA_2_3.portable.InputStream ; - -import org.omg.IOP.TAG_ALTERNATE_IIOP_ADDRESS ; -import org.omg.IOP.TAG_INTERNET_IOP; -import org.omg.IOP.TAG_JAVA_CODEBASE; - -import com.sun.corba.se.spi.protocol.RequestDispatcherRegistry ; - -import com.sun.corba.se.spi.oa.ObjectAdapter ; -import com.sun.corba.se.spi.oa.ObjectAdapterFactory ; - -import com.sun.corba.se.spi.ior.ObjectId ; -import com.sun.corba.se.spi.ior.ObjectAdapterId ; -import com.sun.corba.se.spi.ior.TaggedProfile ; -import com.sun.corba.se.spi.ior.TaggedProfileTemplate ; -import com.sun.corba.se.spi.ior.ObjectKey ; -import com.sun.corba.se.spi.ior.ObjectKeyTemplate ; -import com.sun.corba.se.spi.ior.TaggedComponent ; -import com.sun.corba.se.spi.ior.IdentifiableBase ; -import com.sun.corba.se.spi.ior.IORFactories ; -import com.sun.corba.se.spi.ior.ObjectKeyFactory ; - -import com.sun.corba.se.spi.ior.iiop.IIOPAddress ; -import com.sun.corba.se.spi.ior.iiop.IIOPProfile ; -import com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate ; -import com.sun.corba.se.spi.ior.iiop.IIOPFactories ; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion ; -import com.sun.corba.se.spi.ior.iiop.JavaCodebaseComponent ; - -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.orb.ORBVersion ; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; - -import com.sun.corba.se.impl.ior.EncapsulationUtility ; - -import com.sun.corba.se.impl.encoding.EncapsInputStream ; -import com.sun.corba.se.impl.encoding.EncapsOutputStream ; - -import sun.corba.EncapsInputStreamFactory; - -import com.sun.corba.se.impl.util.JDKBridge; - -import com.sun.corba.se.impl.logging.IORSystemException; - -public class IIOPProfileImpl extends IdentifiableBase implements IIOPProfile -{ - private ORB orb ; - private IORSystemException wrapper ; - private ObjectId oid; - private IIOPProfileTemplate proftemp; - private ObjectKeyTemplate oktemp ; - - // Cached lookups - protected String codebase = null ; - protected boolean cachedCodebase = false; - - private boolean checkedIsLocal = false ; - private boolean cachedIsLocal = false ; - - // initialize-on-demand holder - private static class LocalCodeBaseSingletonHolder { - public static JavaCodebaseComponent comp ; - - static { - String localCodebase = JDKBridge.getLocalCodebase() ; - if (localCodebase == null) - comp = null ; - else - comp = IIOPFactories.makeJavaCodebaseComponent( - localCodebase ) ; - } - } - - private GIOPVersion giopVersion = null; - - public boolean equals( Object obj ) - { - if (!(obj instanceof IIOPProfileImpl)) - return false ; - - IIOPProfileImpl other = (IIOPProfileImpl)obj ; - - return oid.equals( other.oid ) && proftemp.equals( other.proftemp ) && - oktemp.equals( other.oktemp ) ; - } - - public int hashCode() - { - return oid.hashCode() ^ proftemp.hashCode() ^ oktemp.hashCode() ; - } - - public ObjectId getObjectId() - { - return oid ; - } - - public TaggedProfileTemplate getTaggedProfileTemplate() - { - return proftemp ; - } - - public ObjectKeyTemplate getObjectKeyTemplate() - { - return oktemp ; - } - - private IIOPProfileImpl( ORB orb ) - { - this.orb = orb ; - wrapper = IORSystemException.get( orb, - CORBALogDomains.OA_IOR ) ; - } - - public IIOPProfileImpl( ORB orb, ObjectKeyTemplate oktemp, ObjectId oid, - IIOPProfileTemplate proftemp ) - { - this( orb ) ; - this.oktemp = oktemp ; - this.oid = oid ; - this.proftemp = proftemp ; - } - - public IIOPProfileImpl( InputStream is ) - { - this( (ORB)(is.orb()) ) ; - init( is ) ; - } - - public IIOPProfileImpl( ORB orb, org.omg.IOP.TaggedProfile profile) - { - this( orb ) ; - - if (profile == null || profile.tag != TAG_INTERNET_IOP.value || - profile.profile_data == null) { - throw wrapper.invalidTaggedProfile() ; - } - - EncapsInputStream istr = EncapsInputStreamFactory.newEncapsInputStream((ORB)orb, profile.profile_data, - profile.profile_data.length); - istr.consumeEndian(); - init( istr ) ; - } - - private void init( InputStream istr ) - { - // First, read all of the IIOP IOR data - GIOPVersion version = new GIOPVersion() ; - version.read( istr ) ; - IIOPAddress primary = new IIOPAddressImpl( istr ) ; - byte[] key = EncapsulationUtility.readOctets( istr ) ; - - ObjectKey okey = orb.getObjectKeyFactory().create( key ) ; - oktemp = okey.getTemplate() ; - oid = okey.getId() ; - - proftemp = IIOPFactories.makeIIOPProfileTemplate( orb, - version, primary ) ; - - // Handle any tagged components (if applicable) - if (version.getMinor() > 0) - EncapsulationUtility.readIdentifiableSequence( proftemp, - orb.getTaggedComponentFactoryFinder(), istr ) ; - - // If there is no codebase in this IOR and there IS a - // java.rmi.server.codebase property set, we need to - // update the IOR with the local codebase. Note that - // there is only one instance of the local codebase, but it - // can be safely shared in multiple IORs since it is immutable. - if (uncachedGetCodeBase() == null) { - JavaCodebaseComponent jcc = LocalCodeBaseSingletonHolder.comp ; - - if (jcc != null) { - if (version.getMinor() > 0) - proftemp.add( jcc ) ; - - codebase = jcc.getURLs() ; - } - - // Whether codebase is null or not, we have it, - // and so getCodebase ned never call uncachedGetCodebase. - cachedCodebase = true; - } - } - - public void writeContents(OutputStream os) - { - proftemp.write( oktemp, oid, os ) ; - } - - public int getId() - { - return proftemp.getId() ; - } - - public boolean isEquivalent( TaggedProfile prof ) - { - if (!(prof instanceof IIOPProfile)) - return false ; - - IIOPProfile other = (IIOPProfile)prof ; - - return oid.equals( other.getObjectId() ) && - proftemp.isEquivalent( other.getTaggedProfileTemplate() ) && - oktemp.equals( other.getObjectKeyTemplate() ) ; - } - - public ObjectKey getObjectKey() - { - ObjectKey result = IORFactories.makeObjectKey( oktemp, oid ) ; - return result ; - } - - public org.omg.IOP.TaggedProfile getIOPProfile() - { - EncapsOutputStream os = - sun.corba.OutputStreamFactory.newEncapsOutputStream(orb); - os.write_long( getId() ) ; - write( os ) ; - InputStream is = (InputStream)(os.create_input_stream()) ; - return org.omg.IOP.TaggedProfileHelper.read( is ) ; - } - - private String uncachedGetCodeBase() { - Iterator iter = proftemp.iteratorById( TAG_JAVA_CODEBASE.value ) ; - - if (iter.hasNext()) { - JavaCodebaseComponent jcbc = (JavaCodebaseComponent)(iter.next()) ; - return jcbc.getURLs() ; - } - - return null ; - } - - public synchronized String getCodebase() { - if (!cachedCodebase) { - cachedCodebase = true ; - codebase = uncachedGetCodeBase() ; - } - - return codebase ; - } - - /** - * @return the ORBVersion associated with the object key in the IOR. - */ - public ORBVersion getORBVersion() { - return oktemp.getORBVersion(); - } - - public synchronized boolean isLocal() - { - if (!checkedIsLocal) { - checkedIsLocal = true ; - String host = proftemp.getPrimaryAddress().getHost() ; - - cachedIsLocal = orb.isLocalHost(host) && - orb.isLocalServerId(oktemp.getSubcontractId(), - oktemp.getServerId()) && - orb.getLegacyServerSocketManager() - .legacyIsLocalServerPort( - proftemp.getPrimaryAddress().getPort()); - } - - return cachedIsLocal ; - } - - /** Return the servant for this IOR, if it is local AND if the OA that - * implements this objref supports direct access to servants outside of an - * invocation. - * XXX revisit: do we want this at all? If we do, it might move to the - * ObjectKeyTemplate instead. - */ - public java.lang.Object getServant() - { - if (!isLocal()) - return null ; - - RequestDispatcherRegistry scr = orb.getRequestDispatcherRegistry() ; - ObjectAdapterFactory oaf = scr.getObjectAdapterFactory( - oktemp.getSubcontractId() ) ; - - ObjectAdapterId oaid = oktemp.getObjectAdapterId() ; - ObjectAdapter oa = null ; - - try { - oa = oaf.find( oaid ) ; - } catch (SystemException exc) { - // Could not find the OA, so just return null. - // This usually happens when POAs are being deleted, - // and the POA always return null for getLocalServant anyway. - wrapper.getLocalServantFailure( exc, oaid.toString() ) ; - return null ; - } - - byte[] boid = oid.getId() ; - java.lang.Object servant = oa.getLocalServant( boid ) ; - return servant ; - } - - /** - * Return GIOPVersion for this IOR. - * Requests created against this IOR will be of the - * return Version. - */ - public synchronized GIOPVersion getGIOPVersion() - { - return proftemp.getGIOPVersion() ; - } - - public void makeImmutable() - { - proftemp.makeImmutable() ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileTemplateImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileTemplateImpl.java deleted file mode 100644 index 4d3dbe5ee63..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileTemplateImpl.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior.iiop; - -import java.util.Iterator ; - -import org.omg.IOP.TAG_INTERNET_IOP ; - -import org.omg.CORBA_2_3.portable.InputStream ; -import org.omg.CORBA_2_3.portable.OutputStream ; - -import com.sun.corba.se.spi.ior.TaggedComponent ; -import com.sun.corba.se.spi.ior.TaggedProfile ; -import com.sun.corba.se.spi.ior.TaggedProfileTemplate ; -import com.sun.corba.se.spi.ior.TaggedProfileTemplateBase ; -import com.sun.corba.se.spi.ior.ObjectKeyTemplate ; -import com.sun.corba.se.spi.ior.ObjectId ; -import com.sun.corba.se.spi.ior.IdentifiableContainerBase ; -import com.sun.corba.se.spi.ior.IdentifiableBase ; - -import com.sun.corba.se.impl.ior.EncapsulationUtility ; - -import com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate ; -import com.sun.corba.se.spi.ior.iiop.IIOPAddress ; -import com.sun.corba.se.spi.ior.iiop.IIOPFactories ; - -import com.sun.corba.se.impl.encoding.EncapsOutputStream ; - -import com.sun.corba.se.impl.encoding.CDROutputStream ; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion ; -import com.sun.corba.se.spi.orb.ORB ; - -/** - * If getMinorVersion==0, this does not contain any tagged components - */ -public class IIOPProfileTemplateImpl extends TaggedProfileTemplateBase - implements IIOPProfileTemplate -{ - private ORB orb ; - private GIOPVersion giopVersion ; - private IIOPAddress primary ; - - public boolean equals( Object obj ) - { - if (!(obj instanceof IIOPProfileTemplateImpl)) - return false ; - - IIOPProfileTemplateImpl other = (IIOPProfileTemplateImpl)obj ; - - return super.equals( obj ) && giopVersion.equals( other.giopVersion ) && - primary.equals( other.primary ) ; - } - - public int hashCode() - { - return super.hashCode() ^ giopVersion.hashCode() ^ primary.hashCode() ; - } - - public TaggedProfile create( ObjectKeyTemplate oktemp, ObjectId id ) - { - return IIOPFactories.makeIIOPProfile( orb, oktemp, id, this ) ; - } - - public GIOPVersion getGIOPVersion() - { - return giopVersion ; - } - - public IIOPAddress getPrimaryAddress() - { - return primary ; - } - - public IIOPProfileTemplateImpl( ORB orb, GIOPVersion version, IIOPAddress primary ) - { - this.orb = orb ; - this.giopVersion = version ; - this.primary = primary ; - if (giopVersion.getMinor() == 0) - // Adding tagged components is not allowed for IIOP 1.0, - // so this template is complete and should be made immutable. - makeImmutable() ; - } - - public IIOPProfileTemplateImpl( InputStream istr ) - { - byte major = istr.read_octet() ; - byte minor = istr.read_octet() ; - giopVersion = GIOPVersion.getInstance( major, minor ) ; - primary = new IIOPAddressImpl( istr ) ; - orb = (ORB)(istr.orb()) ; - // Handle any tagged components (if applicable) - if (minor > 0) - EncapsulationUtility.readIdentifiableSequence( - this, orb.getTaggedComponentFactoryFinder(), istr ) ; - - makeImmutable() ; - } - - public void write( ObjectKeyTemplate okeyTemplate, ObjectId id, OutputStream os) - { - giopVersion.write( os ) ; - primary.write( os ) ; - - // Note that this is NOT an encapsulation: do not marshal - // the endianness flag. However, the length is required. - // Note that this cannot be accomplished with a codec! - - // Use the byte order of the given stream - OutputStream encapsulatedOS = - sun.corba.OutputStreamFactory.newEncapsOutputStream( - (ORB)os.orb(), ((CDROutputStream)os).isLittleEndian() ) ; - - okeyTemplate.write( id, encapsulatedOS ) ; - EncapsulationUtility.writeOutputStream( encapsulatedOS, os ) ; - - if (giopVersion.getMinor() > 0) - EncapsulationUtility.writeIdentifiableSequence( this, os ) ; - } - - /** Write out this IIOPProfileTemplateImpl only. - */ - public void writeContents( OutputStream os) - { - giopVersion.write( os ) ; - primary.write( os ) ; - - if (giopVersion.getMinor() > 0) - EncapsulationUtility.writeIdentifiableSequence( this, os ) ; - } - - public int getId() - { - return TAG_INTERNET_IOP.value ; - } - - public boolean isEquivalent( TaggedProfileTemplate temp ) - { - if (!(temp instanceof IIOPProfileTemplateImpl)) - return false ; - - IIOPProfileTemplateImpl tempimp = (IIOPProfileTemplateImpl)temp ; - - return primary.equals( tempimp.primary ) ; - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/JavaCodebaseComponentImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/JavaCodebaseComponentImpl.java deleted file mode 100644 index f7b17e0107e..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/JavaCodebaseComponentImpl.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior.iiop; - -import org.omg.IOP.TAG_JAVA_CODEBASE ; - -import org.omg.CORBA_2_3.portable.OutputStream ; - -import com.sun.corba.se.spi.ior.TaggedComponentBase ; - -import com.sun.corba.se.spi.ior.iiop.JavaCodebaseComponent ; - -public class JavaCodebaseComponentImpl extends TaggedComponentBase - implements JavaCodebaseComponent -{ - private String URLs ; - - public boolean equals( Object obj ) - { - if (obj == null) - return false ; - - if (!(obj instanceof JavaCodebaseComponentImpl)) - return false ; - - JavaCodebaseComponentImpl other = (JavaCodebaseComponentImpl)obj ; - - return URLs.equals( other.getURLs() ) ; - } - - public int hashCode() - { - return URLs.hashCode() ; - } - - public String toString() - { - return "JavaCodebaseComponentImpl[URLs=" + URLs + "]" ; - } - - public String getURLs() - { - return URLs ; - } - - public JavaCodebaseComponentImpl( String URLs ) - { - this.URLs = URLs ; - } - - public void writeContents(OutputStream os) - { - os.write_string( URLs ) ; - } - - public int getId() - { - return TAG_JAVA_CODEBASE.value ; // 25 in CORBA 2.3.1 13.6.3 - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/JavaSerializationComponent.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/JavaSerializationComponent.java deleted file mode 100644 index a89ea216670..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/JavaSerializationComponent.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.ior.iiop; - -import org.omg.CORBA_2_3.portable.OutputStream; - -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; - -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.ior.TaggedComponentBase; - -/** - * Tagged component that contains a value that indicates the Java - * serialization version supported by the ORB. - * - * ORB Java serialization uses IIOP as the transport protocol, but uses - * Java serialization mechanism and its accompanying encodings, instead - * of IIOP CDR serialization mechanism. Java serialization is generally - * observed to be faster than CDR. - */ -public class JavaSerializationComponent extends TaggedComponentBase { - - private byte version; - - private static JavaSerializationComponent singleton; - - public static JavaSerializationComponent singleton() { - if (singleton == null) { - synchronized (JavaSerializationComponent.class) { - singleton = - new JavaSerializationComponent(Message.JAVA_ENC_VERSION); - } - } - return singleton; - } - - public JavaSerializationComponent(byte version) { - this.version = version; - } - - public byte javaSerializationVersion() { - return this.version; - } - - public void writeContents(OutputStream os) { - os.write_octet(version); - } - - public int getId() { - return ORBConstants.TAG_JAVA_SERIALIZATION_ID; - } - - public boolean equals(Object obj) { - if (!(obj instanceof JavaSerializationComponent)) { - return false; - } - JavaSerializationComponent other = (JavaSerializationComponent) obj; - return this.version == other.version; - } - - public int hashCode() { - return this.version; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/MaxStreamFormatVersionComponentImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/MaxStreamFormatVersionComponentImpl.java deleted file mode 100644 index dcf5b2e59ab..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/MaxStreamFormatVersionComponentImpl.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/** - */ -package com.sun.corba.se.impl.ior.iiop; - -import org.omg.IOP.TAG_RMI_CUSTOM_MAX_STREAM_FORMAT; - -import org.omg.CORBA_2_3.portable.OutputStream; - -import javax.rmi.CORBA.Util; -import javax.rmi.CORBA.ValueHandler; -import javax.rmi.CORBA.ValueHandlerMultiFormat; - -import com.sun.corba.se.impl.orbutil.ORBUtility; - -import com.sun.corba.se.spi.ior.TaggedComponentBase; - -import com.sun.corba.se.spi.ior.iiop.MaxStreamFormatVersionComponent; - -// Java to IDL ptc 02-01-12 1.4.11 -// TAG_RMI_CUSTOM_MAX_STREAM_FORMAT -public class MaxStreamFormatVersionComponentImpl extends TaggedComponentBase - implements MaxStreamFormatVersionComponent -{ - private byte version; - - public static final MaxStreamFormatVersionComponentImpl singleton - = new MaxStreamFormatVersionComponentImpl(); - - public boolean equals(Object obj) - { - if (!(obj instanceof MaxStreamFormatVersionComponentImpl)) - return false ; - - MaxStreamFormatVersionComponentImpl other = - (MaxStreamFormatVersionComponentImpl)obj ; - - return version == other.version ; - } - - public int hashCode() - { - return version ; - } - - public String toString() - { - return "MaxStreamFormatVersionComponentImpl[version=" + version + "]" ; - } - - public MaxStreamFormatVersionComponentImpl() - { - version = ORBUtility.getMaxStreamFormatVersion(); - } - - public MaxStreamFormatVersionComponentImpl(byte streamFormatVersion) { - version = streamFormatVersion; - } - - public byte getMaxStreamFormatVersion() - { - return version; - } - - public void writeContents(OutputStream os) - { - os.write_octet(version); - } - - public int getId() - { - return TAG_RMI_CUSTOM_MAX_STREAM_FORMAT.value; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/ORBTypeComponentImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/ORBTypeComponentImpl.java deleted file mode 100644 index 68a4f9bc546..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/ORBTypeComponentImpl.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.ior.iiop; - -import org.omg.IOP.TAG_ORB_TYPE ; - -import com.sun.corba.se.spi.ior.TaggedComponentBase ; - -import com.sun.corba.se.spi.ior.iiop.ORBTypeComponent ; - -import org.omg.CORBA_2_3.portable.OutputStream ; - -/** - * @author Ken Cavanaugh - */ -public class ORBTypeComponentImpl extends TaggedComponentBase - implements ORBTypeComponent -{ - private int ORBType; - - public boolean equals( Object obj ) - { - if (!(obj instanceof ORBTypeComponentImpl)) - return false ; - - ORBTypeComponentImpl other = (ORBTypeComponentImpl)obj ; - - return ORBType == other.ORBType ; - } - - public int hashCode() - { - return ORBType ; - } - - public String toString() - { - return "ORBTypeComponentImpl[ORBType=" + ORBType + "]" ; - } - - public ORBTypeComponentImpl(int ORBType) - { - this.ORBType = ORBType ; - } - - public int getId() - { - return TAG_ORB_TYPE.value ; // 0 in CORBA 2.3.1 13.6.3 - } - - public int getORBType() - { - return ORBType ; - } - - public void writeContents(OutputStream os) - { - os.write_ulong( ORBType ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/RequestPartitioningComponentImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/RequestPartitioningComponentImpl.java deleted file mode 100644 index 84b370383af..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/RequestPartitioningComponentImpl.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/** - */ -package com.sun.corba.se.impl.ior.iiop; - -import org.omg.CORBA_2_3.portable.OutputStream; - -import com.sun.corba.se.spi.ior.TaggedComponentBase; -import com.sun.corba.se.spi.ior.iiop.RequestPartitioningComponent; -import com.sun.corba.se.spi.logging.CORBALogDomains ; - -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; -import com.sun.corba.se.impl.orbutil.ORBConstants; - - -public class RequestPartitioningComponentImpl extends TaggedComponentBase - implements RequestPartitioningComponent -{ - private static ORBUtilSystemException wrapper = - ORBUtilSystemException.get( CORBALogDomains.OA_IOR ) ; - - private int partitionToUse; - - public boolean equals(Object obj) - { - if (!(obj instanceof RequestPartitioningComponentImpl)) - return false ; - - RequestPartitioningComponentImpl other = - (RequestPartitioningComponentImpl)obj ; - - return partitionToUse == other.partitionToUse ; - } - - public int hashCode() - { - return partitionToUse; - } - - public String toString() - { - return "RequestPartitioningComponentImpl[partitionToUse=" + partitionToUse + "]" ; - } - - public RequestPartitioningComponentImpl() - { - partitionToUse = 0; - } - - public RequestPartitioningComponentImpl(int thePartitionToUse) { - if (thePartitionToUse < ORBConstants.REQUEST_PARTITIONING_MIN_THREAD_POOL_ID || - thePartitionToUse > ORBConstants.REQUEST_PARTITIONING_MAX_THREAD_POOL_ID) { - throw wrapper.invalidRequestPartitioningComponentValue( - new Integer(thePartitionToUse), - new Integer(ORBConstants.REQUEST_PARTITIONING_MIN_THREAD_POOL_ID), - new Integer(ORBConstants.REQUEST_PARTITIONING_MAX_THREAD_POOL_ID)); - } - partitionToUse = thePartitionToUse; - } - - public int getRequestPartitioningId() - { - return partitionToUse; - } - - public void writeContents(OutputStream os) - { - os.write_ulong(partitionToUse); - } - - public int getId() - { - return ORBConstants.TAG_REQUEST_PARTITIONING_ID; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/notes b/src/java.corba/share/classes/com/sun/corba/se/impl/ior/notes deleted file mode 100644 index 7f66ce5db89..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/ior/notes +++ /dev/null @@ -1,317 +0,0 @@ -Notes on IOR implementation - -1. Writeable is an interface that can write itself to an OutputStream. - -2. IdEncapsulation is a particular kind of Writeable that has an Id and - an Encapsulation (a sequence of bytes) representing some other structure - in a CDR encapsulation. - -3. ContainerBase is a base class for containers of IdEncapsulations. - -4. An IOR is a ContainerBase. - -5. A TaggedComponent is not a ContainerBase. - -6. Some (not all) Profiles are ContainerBases. - -7. IIOPAddress contains (host, port) - IIOPServerLocation contains: - - A primary IIOPAddress - - 0 or more secondary IIOPAddresses (these get placed in - TAG_ALTERNATE_IIOP_ADDRESS components) - -8. IIOPProfileTemplate: - - major, minor version - - 0 or more TaggedComponents - - ObjectKeyTemplate - -9. ObjectKeyTemplate: - - contains only wire data, not internal structures - - write( object id, output stream ): write the object key out - to the output stream with the given object id - -10. Significant problem: must of the dispatch path code is written in terms of - IORs when it should be based on profiles. Only a single profile is used in - a request, and that is what should be passed around. This needs fixing soon - to accommodate the eventual implementation of CORBA FT, and also to work - properly with the new IOR. - -11. Another question: since profile contains key which contains scid, what if - we have multiple profiles with different scids? - One answer: create a cluster subcontract that invokes the individual - profiles for FT. This may not mesh well with the FT spec. - -12. Uses of IORs in the ORB: - -Activation/ServerManagerImpl.java - - Construct IOR for bad ID handler location forward -corba/ClientDelegate.java - - marshal, getIOR, unmarshal are all questionable and make - poor use of IOR. - - gets forwarded IOR from response - - IORs handled in some service contexts - - createRequest needs to parse IOR - - gets the (one) IIOP profile that we care about - - gets the object key -corba/InitialNamingClient.java - - constructs IOR from address info, object key - - current implementation should use AlternateIIOPAddress components - - constructs IOR with key "INIT" for old bootstrap -corba/ORB.java - - stringify and destringify IOR -corba/ServerDelegate.java - - access IOR from sending context service context - - destroyObjref directly access transient key from a known offset. - - creation sets up key inline with known offsets -core/IOR.java - - IOR sometimes stores a servant - - IOR contains the following - - Object servant - - Endpoint ep - - String codebase - - boolean cachedCodebase - - TaggedComponent localCodeBaseTC - - InternetIOPTag - - The two constructors that take full args also - construct tagged components - - will need alternate address components for INS -core/SendingContextServiceContext.java - - reads IOR from input stream -iiop/CDRInputStream.java - - needs type id, code base from IOR -iiop/IIOPOutputStream.java - - needs to access objkey as a sequence of bytes to realing requests. -POA/GenericPOAClientSC.java - - needs to pull POA ID out of object key - - needs to created a new IOR that has an updated scid -POA/GenericPOAServerSC.java - - creates IORs -TransactionalPOA/TransactionalServerSC.java - - inline access to known offset in object key to - determine whether transactional - -Guide to the files: - -Basic Interfaces: - Identifiable.java (Object has an Id) - Writeable.java (Object can write to OutputStream) - IdEncapsulation.java (Writeable, Identifiable interface) - IdEncapsulationFactory.java (Factory interface for IdEncapsulation) - IdEncapsulationFactoryFinder.java (Finder interface for IdEncapsulationFactoryFinder) - - IIOPAddress.java (class containing host and port for IIOP) - -Basic support for IdEncapsulations (shared for components and profiles): - GenericIdEncapsulation.java (Has id, octet sequence: used for generic - TaggedComponent and TaggedProfile objects) - FreezableList.java (Delegated implementation of List that can be made - immutable after construction) - IdentifiableContainerBase.java (extends FreezableList: container of Identifiable: - supports iteratorById.) - IdEncapsulationContainerBase.java (extends IdenitifableContainerBase: - container of IdEncapsulation: supports read/write IdEncapsulationSequence) - -Object Keys: - ObjectKeyFactory.java - ObjectKeyTemplate.java (interface for the following:) - JIDLObjectKeyTemplate.java (object key used in *Delegate) - POAObjectKeyTemplate.java (object key used in GenericPOA*SC) - WireObjectKeyTemplate.java (used for non-Sun ORB IORs) - ObjectId.java (a simple wrapper for byte[]) - ObjectKey.java (contains ObjectId and ObjectKeyTemplate) - -Components: - TaggedComponentFactories.java (contains method for registering factories) - TaggedComponentFactoryFinder.java (contains registered factories) - TaggedComponent.java (interface of all tagged components) - AlternateIIOPAddressComponent.java - CodeSetsComponent.java - JavaCodebaseComponent.java - ORBTypeComponent.java - PoliciesComponent.java - -Profiles: - IIOPProfile.java (IIOPProfileTemplate and ObjectId) - IIOPProfileTemplate.java (contains version, address, ObjectKeyTemplate, - list of TaggedComponent) - TaggedProfile.java (interface for all TaggedProfiles) - TaggedProfileFactoryFinder.java - TaggedProfileTemplate.java - -IOR: - IOR.java - IORTemplate.java (List of IIOPProfileTemplate - ObjectIds.java (List of ObjectId: needed for an IOR constructor) - -Notes from integration code review: - -General: - - Look at making IOR API public, or - move everything into com.sun.corba.se.impl.ior - (don't hold up putback for this) - Making public: - - Writeable needs getBytes() as well as write() - methods. - - codec can be used with an Any to convert between - IDL data type and sequence of bytes. - - write() needs to use getBytes, then write id, length, - octets to output stream. - - getBytes() method needs to get typecode from IDL - then create Any. - - IdEncapsulations need to have constructor that takes - byte[] (encapsulation of value). - Why not? - - Unencapsulated object keys can't be made portable - - Lots of dependencies on ORB code in ObjectKey support - Conclusion: - - move to internal (DONE) - - JAVA_MAGIC should move to ObjectKeyTemplates (DONE) - - check for intToBytes/bytesToInt related to object key - corba/ServerDelegate (DONE) - POA/GenericPOAServerSC (DONE) - POA/SubcontractResponseHandler (DONE) - TransactionalPOA/TransactionalClientSC.java (DONE) - TransactionalPOA/TransactionalServerSC.java (DONE) - -./com/sun/corba/se/impl/cosnaming/BootstrapServer.java - - remove sc_init_key_* (DONE) - -./com/sun/corba/se/impl/poa/POAImpl.java - - remove line 130: comment on other endpoints, e.g. SSL (DONE) - - add revisit comment on line 133: use multiple server port API (DONE) - -./com/sun/corba/se/impl/corba/ORB.java - - object_to_string: add comment that connect only takes place in - non-POA cases. (DONE) - -./com/sun/corba/se/impl/corba/ServerDelegate.java - - chase down the object key offsets (DONE) - (search for bytesToInt and intToBytes) - -./com/sun/corba/se/impl/core/SubcontractRegistry.java - - getServerSubcontract: add b-e l-e comment and history on INIT, TINI (DONE) - - getServerSubcontract: reference to constants (May not do this?) - - getServerSubcontract: return null at end IS reachable, in the - case where we have essentially a name in the key that isn't - one of the ones we support. Throw an exception? (DONE) - - add minor code for INTERNAL (and string) (DONE) - - remove setId calls in callers to getClientSubcontract (DONE) - - throw INTERNAL exception for temp.size() != 1 case (DONE) - Think about INST corbaloc problems (multi-profile IORs) - both return nulls should throw exceptions (DONE) - -./com/sun/corba/se/impl/core/IOR.java - - Add some comments to getIORfromString about 4/2 constants (DONE) - - fix name: should be getIORFromString (DONE) - - IOR( InputStream ) has a problem with cachedCodeBase: - is should not call getCodeBase: must refactor to - an internal implementation method. (DONE) - - isEquivalent and isLocal should assert failure - if multiple profiles (through exception in getProfile) (DONE) - (add comments about multi case) - -./com/sun/corba/se/impl/iiop/CDRInputStream_1_0.java - - read_Object: add assert in case servant is not Tie or objref (DONE) - -./com/sun/corba/se/internal/TransactionalPOA/TransactionalPOAImpl.java - - add comment about transactionalIortemplate: goes away after - we get to OTS 1.2 transactional policy. (DONE) - - change transactionalClone( ObjectKeyTemplate ) so that - we get an error (INTERNAL) if NOT POAObjectKeyTemplate (DONE) - - line 138: get string constant from - org.omg.CosTransactions.TransactionalObject (DONE) - - remove Delegate d decl. (DONE) - -We need to assign minor codes for all exceptions! - -We need to clean up the minor code base usage! (DONE) - -Add equals/toString to: - Do not try to develop a reflective universal equals: too slow! - Do we really want equals on lists? - If we do, define collectionEqual on FreezableList - -CodeSetsComponent: toString -FreezableList: basic toString, equals methods -IIOPProfile: toString -IIOPProfileTemplate: toString -IOR: toString -IORTemplate.java: toString, equals (inherit?) -IdEncapsulationContainerBase.java: make abstract, but provide base toString/equals -IdentifiableContainerBase.java: make abstract (no other changes) - (ContainerBase classes need some explanation) -ObjectIds.java needs toString, equals (use FreezableList?) -ObjectKey: toString -ObjectKeyFactory.java: singleton: don't add toString or equals -PoliciesComponent.java: should finish this sometime (after we figure out - exactly what to do with it) -TaggedComponentBase.java: should be abstract -TaggedComponentFactories.java: a singelton -TaggedComponentFactoryFinder.java: a singleton -TaggedProfileFactoryFinder.java: a singleton -JIDLObjectKeyTemplate: toString -POAObjectKeyTemplate: toString -WireObjectKeyTemplate: toString uninteresting: no data, equals not useful - -use util/Utility.objectToString to implement toString methods. - -Other changes: - - IIOPAddress.toString should include class name (DONE) - - New tests needed: - IIOPProfile.getIOPComponents - IIOPProfile.getIOPProfile - GenericTaggedProfile.getIOPComponents - GenericTaggedProfile.getIOPProfile - GenericTaggedComponent.getIOPComponent - ObjectKeyTemplate.getAdapterId - - Plus, do a read/write test for IOP stuff: - construct profile - convert to IOP.TaggedProfile - write to stream - get input stream - construct profile - check for equal - - do some tests on IOR.toString() just to see what gets printed. - - Add getAdapterId to *ObjectKeyTemplate.java (DONE) - Add some tests for this: - - WireObjectKeyTemplate throws an exception - - Identically constructed ObjectKeyTemplates produce identical Adapter Ids. - - Different OKTs produce different adapter IDs. - -New tests for versioning support: - -ORBVersionFactory: - - for create array methods (DONE) - - returns expected values for version encodings - - throws INTERNAL for negative version - - test one case for create stream method (DONE) - - getORBVersion returns correct version (DONE) -ORBVersionImpl: - - check equals on some ORBVersions (DONE) - - check that each ORBVersion returns correct orbtype (DONE) -JIDLObjectKeyTemplate: - - non-key constructor gives NEWER version (DONE) -POAObjectKeyTemplate: - - non-key constructor gives NEWER version (DONE) -OldJIDLObjectKeyTemplate: (DONE) - - non-key constructor with OLD, NEW MAGIC and check version - - other values throw exception -OldPOAObjectKeyTemplate: (DONE) - - non-key constructor with OLD, NEW MAGIC and check version (DONE) - - other values throw exception (DONE) -WireObjectKeyTemplate (DONE) - - version is FOREIGN -ObjectKeyFactory (DONE) - create the following keys and check results: - JIDL OLD OldJIDL with correct magic, version - JIDL NEW OldJIDL - JIDL NEWER JIDL - POA OLD OldPOA - POA NEW OldPOA - POA NEWER POA diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/StubDelegateImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/StubDelegateImpl.java deleted file mode 100644 index 5ac8283265f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/StubDelegateImpl.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.javax.rmi.CORBA; - -import java.io.IOException; - -import java.rmi.RemoteException; - -import javax.rmi.CORBA.Tie; - -import org.omg.CORBA.ORB; -import org.omg.CORBA.SystemException; -import org.omg.CORBA.BAD_OPERATION; -import org.omg.CORBA.BAD_INV_ORDER; - -import org.omg.CORBA.portable.Delegate; -import org.omg.CORBA.portable.OutputStream; -import org.omg.CORBA.portable.InputStream; - -import com.sun.corba.se.spi.presentation.rmi.StubAdapter; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; - -import com.sun.corba.se.impl.util.Utility; - -import com.sun.corba.se.impl.ior.StubIORImpl ; -import com.sun.corba.se.impl.presentation.rmi.StubConnectImpl ; - -import com.sun.corba.se.impl.logging.UtilSystemException ; - -/** - * Base class from which all static RMI-IIOP stubs must inherit. - */ -public class StubDelegateImpl implements javax.rmi.CORBA.StubDelegate -{ - static UtilSystemException wrapper = UtilSystemException.get( - CORBALogDomains.RMIIIOP ) ; - - private StubIORImpl ior ; - - public StubIORImpl getIOR() - { - return ior ; - } - - public StubDelegateImpl() - { - ior = null ; - } - - /** - * Sets the IOR components if not already set. - */ - private void init (javax.rmi.CORBA.Stub self) - { - // If the Stub is not connected to an ORB, BAD_OPERATION exception - // will be raised by the code below. - if (ior == null) - ior = new StubIORImpl( self ) ; - } - - /** - * Returns a hash code value for the object which is the same for all stubs - * that represent the same remote object. - * @return the hash code value. - */ - public int hashCode(javax.rmi.CORBA.Stub self) - { - init(self); - return ior.hashCode() ; - } - - /** - * Compares two stubs for equality. Returns true when used to compare stubs - * that represent the same remote object, and false otherwise. - * @param obj the reference object with which to compare. - * @return true if this object is the same as the obj - * argument; false otherwise. - */ - public boolean equals(javax.rmi.CORBA.Stub self, java.lang.Object obj) - { - if (self == obj) { - return true; - } - - if (!(obj instanceof javax.rmi.CORBA.Stub)) { - return false; - } - - // no need to call init() because of calls to hashCode() below - - javax.rmi.CORBA.Stub other = (javax.rmi.CORBA.Stub) obj; - if (other.hashCode() != self.hashCode()) { - return false; - } - - // hashCodes being the same does not mean equality. The stubs still - // could be pointing to different IORs. So, do a literal comparison. - // Apparently the ONLY way to do this (other than using private - // reflection) toString, because it is not possible to directly - // access the StubDelegateImpl from the Stub. - return self.toString().equals( other.toString() ) ; - } - - public boolean equals( Object obj ) - { - if (this == obj) - return true ; - - if (!(obj instanceof StubDelegateImpl)) - return false ; - - StubDelegateImpl other = (StubDelegateImpl)obj ; - - if (ior == null) - return ior == other.ior ; - else - return ior.equals( other.ior ) ; - } - - public int hashCode() { - if (ior == null) { - return 0; - } else { - return ior.hashCode(); - } - } - - /** - * Returns a string representation of this stub. Returns the same string - * for all stubs that represent the same remote object. - * @return a string representation of this stub. - */ - public String toString(javax.rmi.CORBA.Stub self) - { - if (ior == null) - return null ; - else - return ior.toString() ; - } - - /** - * Connects this stub to an ORB. Required after the stub is deserialized - * but not after it is demarshalled by an ORB stream. If an unconnected - * stub is passed to an ORB stream for marshalling, it is implicitly - * connected to that ORB. Application code should not call this method - * directly, but should call the portable wrapper method - * {@link javax.rmi.PortableRemoteObject#connect}. - * @param orb the ORB to connect to. - * @exception RemoteException if the stub is already connected to a different - * ORB, or if the stub does not represent an exported remote or local object. - */ - public void connect(javax.rmi.CORBA.Stub self, ORB orb) - throws RemoteException - { - ior = StubConnectImpl.connect( ior, self, self, orb ) ; - } - - /** - * Serialization method to restore the IOR state. - */ - public void readObject(javax.rmi.CORBA.Stub self, - java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException - { - if (ior == null) - ior = new StubIORImpl() ; - - ior.doRead( stream ) ; - } - - /** - * Serialization method to save the IOR state. - * @serialData The length of the IOR type ID (int), followed by the IOR type ID - * (byte array encoded using ISO8859-1), followed by the number of IOR profiles - * (int), followed by the IOR profiles. Each IOR profile is written as a - * profile tag (int), followed by the length of the profile data (int), followed - * by the profile data (byte array). - */ - public void writeObject(javax.rmi.CORBA.Stub self, - java.io.ObjectOutputStream stream) throws IOException - { - init(self); - ior.doWrite( stream ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/Util.java b/src/java.corba/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/Util.java deleted file mode 100644 index a9ae337883e..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/Util.java +++ /dev/null @@ -1,778 +0,0 @@ -/* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.javax.rmi.CORBA; // Util (sed marker, don't remove!) - -import java.rmi.RemoteException; -import java.rmi.UnexpectedException; -import java.rmi.MarshalException; - -import java.rmi.server.RMIClassLoader; - -import java.util.Hashtable; -import java.util.Enumeration; -import java.util.Properties; -import java.util.Map; -import java.util.WeakHashMap; - -import java.io.Serializable; -import java.io.NotSerializableException; - -import java.lang.reflect.Constructor; - -import javax.rmi.CORBA.ValueHandler; -import javax.rmi.CORBA.Tie; - -import java.security.AccessController; -import java.security.PrivilegedAction; - -import java.rmi.MarshalException; -import java.rmi.NoSuchObjectException; -import java.rmi.AccessException; -import java.rmi.Remote; -import java.rmi.ServerError; -import java.rmi.ServerException; -import java.rmi.ServerRuntimeException; - -import javax.transaction.TransactionRequiredException; -import javax.transaction.TransactionRolledbackException; -import javax.transaction.InvalidTransactionException; - -import org.omg.CORBA.SystemException; -import org.omg.CORBA.Any; -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.COMM_FAILURE; -import org.omg.CORBA.BAD_PARAM; -import org.omg.CORBA.INV_OBJREF; -import org.omg.CORBA.NO_PERMISSION; -import org.omg.CORBA.MARSHAL; -import org.omg.CORBA.OBJECT_NOT_EXIST; -import org.omg.CORBA.TRANSACTION_REQUIRED; -import org.omg.CORBA.TRANSACTION_ROLLEDBACK; -import org.omg.CORBA.INVALID_TRANSACTION; -import org.omg.CORBA.BAD_OPERATION; -import org.omg.CORBA.ACTIVITY_REQUIRED; -import org.omg.CORBA.ACTIVITY_COMPLETED; -import org.omg.CORBA.INVALID_ACTIVITY; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.TCKind; -import org.omg.CORBA.portable.UnknownException; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; - -// This class must be able to function with non-Sun ORBs. -// This means that any of the following com.sun.corba classes -// must only occur in contexts that also handle the non-Sun case. - -import com.sun.corba.se.pept.transport.ContactInfoList ; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.orb.ORBVersionFactory; -import com.sun.corba.se.spi.protocol.CorbaClientDelegate; -import com.sun.corba.se.spi.transport.CorbaContactInfoList ; -import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcher ; -import com.sun.corba.se.spi.copyobject.ReflectiveCopyException ; -import com.sun.corba.se.spi.copyobject.CopierManager ; -import com.sun.corba.se.spi.copyobject.ObjectCopierFactory ; -import com.sun.corba.se.spi.copyobject.ObjectCopier ; -import com.sun.corba.se.impl.io.ValueHandlerImpl; -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.logging.OMGSystemException; -import com.sun.corba.se.impl.util.Utility; -import com.sun.corba.se.impl.util.IdentityHashtable; -import com.sun.corba.se.impl.util.JDKBridge; -import com.sun.corba.se.impl.logging.UtilSystemException; -import com.sun.corba.se.spi.logging.CORBALogDomains; -import sun.corba.SharedSecrets; - - -/** - * Provides utility methods that can be used by stubs and ties to - * perform common operations. - */ -public class Util implements javax.rmi.CORBA.UtilDelegate -{ - // Runs as long as there are exportedServants - private static KeepAlive keepAlive = null; - - // Maps targets to ties. - private static IdentityHashtable exportedServants = new IdentityHashtable(); - - private static final ValueHandlerImpl valueHandlerSingleton = - SharedSecrets.getJavaCorbaAccess().newValueHandlerImpl(); - - private UtilSystemException utilWrapper = UtilSystemException.get( - CORBALogDomains.RPC_ENCODING); - - private static Util instance = null; - - public Util() { - setInstance(this); - } - - private static void setInstance( Util util ) { - assert instance == null : "Instance already defined"; - instance = util; - } - - public static Util getInstance() { - return instance; - } - - public static boolean isInstanceDefined() { - return instance != null; - } - - // Used by TOAFactory.shutdown to unexport all targets for this - // particular ORB. This happens during ORB shutdown. - public void unregisterTargetsForORB(org.omg.CORBA.ORB orb) - { - for (Enumeration e = exportedServants.keys(); e.hasMoreElements(); ) - { - java.lang.Object key = e.nextElement(); - Remote target = (Remote)(key instanceof Tie ? ((Tie)key).getTarget() : key); - - // Bug 4476347: BAD_OPERATION is thrown if the ties delegate isn't set. - // We can ignore this because it means the tie is not connected to an ORB. - try { - if (orb == getTie(target).orb()) { - try { - unexportObject(target); - } catch( java.rmi.NoSuchObjectException ex ) { - // We neglect this exception if at all if it is - // raised. It is not harmful. - } - } - } catch (BAD_OPERATION bad) { - /* Ignore */ - } - } - } - - /** - * Maps a SystemException to a RemoteException. - * @param ex the SystemException to map. - * @return the mapped exception. - */ - public RemoteException mapSystemException(SystemException ex) - { - if (ex instanceof UnknownException) { - Throwable orig = ((UnknownException)ex).originalEx; - if (orig instanceof Error) { - return new ServerError("Error occurred in server thread",(Error)orig); - } else if (orig instanceof RemoteException) { - return new ServerException("RemoteException occurred in server thread", - (Exception)orig); - } else if (orig instanceof RuntimeException) { - throw (RuntimeException) orig; - } - } - - // Build the message string... - String name = ex.getClass().getName(); - String corbaName = name.substring(name.lastIndexOf('.')+1); - String status; - switch (ex.completed.value()) { - case CompletionStatus._COMPLETED_YES: - status = "Yes"; - break; - case CompletionStatus._COMPLETED_NO: - status = "No"; - break; - case CompletionStatus._COMPLETED_MAYBE: - default: - status = "Maybe"; - break; - } - - String message = "CORBA " + corbaName + " " + ex.minor + " " + status; - - // Now map to the correct RemoteException type... - if (ex instanceof COMM_FAILURE) { - return new MarshalException(message, ex); - } else if (ex instanceof INV_OBJREF) { - RemoteException newEx = new NoSuchObjectException(message); - newEx.detail = ex; - return newEx; - } else if (ex instanceof NO_PERMISSION) { - return new AccessException(message, ex); - } else if (ex instanceof MARSHAL) { - return new MarshalException(message, ex); - } else if (ex instanceof OBJECT_NOT_EXIST) { - RemoteException newEx = new NoSuchObjectException(message); - newEx.detail = ex; - return newEx; - } else if (ex instanceof TRANSACTION_REQUIRED) { - RemoteException newEx = new TransactionRequiredException(message); - newEx.detail = ex; - return newEx; - } else if (ex instanceof TRANSACTION_ROLLEDBACK) { - RemoteException newEx = new TransactionRolledbackException(message); - newEx.detail = ex; - return newEx; - } else if (ex instanceof INVALID_TRANSACTION) { - RemoteException newEx = new InvalidTransactionException(message); - newEx.detail = ex; - return newEx; - } else if (ex instanceof BAD_PARAM) { - Exception inner = ex; - - // Pre-Merlin Sun ORBs used the incorrect minor code for - // this case. See Java to IDL ptc-00-01-08 1.4.8. - if (ex.minor == ORBConstants.LEGACY_SUN_NOT_SERIALIZABLE || - ex.minor == OMGSystemException.NOT_SERIALIZABLE) { - - if (ex.getMessage() != null) - inner = new NotSerializableException(ex.getMessage()); - else - inner = new NotSerializableException(); - - inner.initCause( ex ) ; - } - - return new MarshalException(message,inner); - } else if (ex instanceof ACTIVITY_REQUIRED) { - try { - Class cl = SharedSecrets.getJavaCorbaAccess().loadClass( - "javax.activity.ActivityRequiredException"); - Class[] params = new Class[2]; - params[0] = java.lang.String.class; - params[1] = java.lang.Throwable.class; - Constructor cr = cl.getConstructor(params); - Object[] args = new Object[2]; - args[0] = message; - args[1] = ex; - return (RemoteException) cr.newInstance(args); - } catch (Throwable e) { - utilWrapper.classNotFound( - e, "javax.activity.ActivityRequiredException"); - } - } else if (ex instanceof ACTIVITY_COMPLETED) { - try { - Class cl = SharedSecrets.getJavaCorbaAccess().loadClass( - "javax.activity.ActivityCompletedException"); - Class[] params = new Class[2]; - params[0] = java.lang.String.class; - params[1] = java.lang.Throwable.class; - Constructor cr = cl.getConstructor(params); - Object[] args = new Object[2]; - args[0] = message; - args[1] = ex; - return (RemoteException) cr.newInstance(args); - } catch (Throwable e) { - utilWrapper.classNotFound( - e, "javax.activity.ActivityCompletedException"); - } - } else if (ex instanceof INVALID_ACTIVITY) { - try { - Class cl = SharedSecrets.getJavaCorbaAccess().loadClass( - "javax.activity.InvalidActivityException"); - Class[] params = new Class[2]; - params[0] = java.lang.String.class; - params[1] = java.lang.Throwable.class; - Constructor cr = cl.getConstructor(params); - Object[] args = new Object[2]; - args[0] = message; - args[1] = ex; - return (RemoteException) cr.newInstance(args); - } catch (Throwable e) { - utilWrapper.classNotFound( - e, "javax.activity.InvalidActivityException"); - } - } - - // Just map to a generic RemoteException... - return new RemoteException(message, ex); - } - - /** - * Writes any java.lang.Object as a CORBA any. - * @param out the stream in which to write the any. - * @param obj the object to write as an any. - */ - public void writeAny( org.omg.CORBA.portable.OutputStream out, - java.lang.Object obj) - { - org.omg.CORBA.ORB orb = out.orb(); - - // Create Any - Any any = orb.create_any(); - - // Make sure we have a connected object... - java.lang.Object newObj = Utility.autoConnect(obj,orb,false); - - if (newObj instanceof org.omg.CORBA.Object) { - any.insert_Object((org.omg.CORBA.Object)newObj); - } else { - if (newObj == null) { - // Handle the null case, including backwards - // compatibility issues - any.insert_Value(null, createTypeCodeForNull(orb)); - } else { - if (newObj instanceof Serializable) { - // If they're our Any and ORB implementations, - // we may want to do type code related versioning. - TypeCode tc = createTypeCode((Serializable)newObj, any, orb); - if (tc == null) - any.insert_Value((Serializable)newObj); - else - any.insert_Value((Serializable)newObj, tc); - } else if (newObj instanceof Remote) { - ORBUtility.throwNotSerializableForCorba(newObj.getClass().getName()); - } else { - ORBUtility.throwNotSerializableForCorba(newObj.getClass().getName()); - } - } - } - - out.write_any(any); - } - - /** - * When using our own ORB and Any implementations, we need to get - * the ORB version and create the type code appropriately. This is - * to overcome a bug in which the JDK 1.3.x ORBs used a tk_char - * rather than a tk_wchar to describe a Java char field. - * - * This only works in RMI-IIOP with Util.writeAny since we actually - * know what ORB and stream we're writing with when we insert - * the value. - * - * Returns null if it wasn't possible to create the TypeCode (means - * it wasn't our ORB or Any implementation). - * - * This does not handle null objs. - */ - private TypeCode createTypeCode(Serializable obj, - org.omg.CORBA.Any any, - org.omg.CORBA.ORB orb) { - - if (any instanceof com.sun.corba.se.impl.corba.AnyImpl && - orb instanceof ORB) { - - com.sun.corba.se.impl.corba.AnyImpl anyImpl - = (com.sun.corba.se.impl.corba.AnyImpl)any; - - ORB ourORB = (ORB)orb; - - return anyImpl.createTypeCodeForClass(obj.getClass(), ourORB); - - } else - return null; - } - - - /** - * This is used to create the TypeCode for a null reference. - * It also handles backwards compatibility with JDK 1.3.x. - * - * This method will not return null. - */ - private TypeCode createTypeCodeForNull(org.omg.CORBA.ORB orb) - { - if (orb instanceof ORB) { - - ORB ourORB = (ORB)orb; - - // Preserve backwards compatibility with Kestrel and Ladybird - // by not fully implementing interop issue resolution 3857, - // and returning a null TypeCode with a tk_value TCKind. - // If we're not talking to Kestrel or Ladybird, fall through - // to the abstract interface case (also used for foreign ORBs). - if (!ORBVersionFactory.getFOREIGN().equals(ourORB.getORBVersion()) && - ORBVersionFactory.getNEWER().compareTo(ourORB.getORBVersion()) > 0) { - - return orb.get_primitive_tc(TCKind.tk_value); - } - } - - // Use tk_abstract_interface as detailed in the resolution - - // REVISIT: Define this in IDL and get the ID in generated code - String abstractBaseID = "IDL:omg.org/CORBA/AbstractBase:1.0"; - - return orb.create_abstract_interface_tc(abstractBaseID, ""); - } - - /** - * Reads a java.lang.Object as a CORBA any. - * @param in the stream from which to read the any. - * @return the object read from the stream. - */ - public Object readAny(InputStream in) - { - Any any = in.read_any(); - if ( any.type().kind().value() == TCKind._tk_objref ) - return any.extract_Object (); - else - return any.extract_Value(); - } - - /** - * Writes a java.lang.Object as a CORBA Object. If {@code obj} is - * an exported RMI-IIOP server object, the tie is found - * and wired to {@code obj}, then written to {@code out.write_Object(org.omg.CORBA.Object)}. - * If {@code obj} is a CORBA Object, it is written to - * {@code out.write_Object(org.omg.CORBA.Object)}. - * @param out the stream in which to write the object. - * @param obj the object to write. - */ - public void writeRemoteObject(OutputStream out, java.lang.Object obj) - { - // Make sure we have a connected object, then - // write it out... - - Object newObj = Utility.autoConnect(obj,out.orb(),false); - out.write_Object((org.omg.CORBA.Object)newObj); - } - - /** - * Writes a java.lang.Object as either a value or a CORBA Object. - * If {@code obj} is a value object or a stub object, it is written to - * {@code out.write_abstract_interface(java.lang.Object)}. If {@code obj} is an exported - * RMI-IIOP server object, the tie is found and wired to {@code obj}, - * then written to {@code out.write_abstract_interface(java.lang.Object)}. - * @param out the stream in which to write the object. - * @param obj the object to write. - */ - public void writeAbstractObject( OutputStream out, java.lang.Object obj ) - { - // Make sure we have a connected object, then - // write it out... - - Object newObj = Utility.autoConnect(obj,out.orb(),false); - ((org.omg.CORBA_2_3.portable.OutputStream)out).write_abstract_interface(newObj); - } - - /** - * Registers a target for a tie. Adds the tie to an internal table and calls - * {@link Tie#setTarget} on the tie object. - * @param tie the tie to register. - * @param target the target for the tie. - */ - public void registerTarget(javax.rmi.CORBA.Tie tie, java.rmi.Remote target) - { - synchronized (exportedServants) { - // Do we already have this target registered? - if (lookupTie(target) == null) { - // No, so register it and set the target... - exportedServants.put(target,tie); - tie.setTarget(target); - - // Do we need to instantiate our keep-alive thread? - if (keepAlive == null) { - // Yes. Instantiate our keep-alive thread and start - // it up... - keepAlive = (KeepAlive)AccessController.doPrivileged(new PrivilegedAction() { - public java.lang.Object run() { - return new KeepAlive(); - } - }); - keepAlive.start(); - } - } - } - } - - /** - * Removes the associated tie from an internal table and calls {@link Tie#deactivate} - * to deactivate the object. - * @param target the object to unexport. - */ - public void unexportObject(java.rmi.Remote target) - throws java.rmi.NoSuchObjectException - { - synchronized (exportedServants) { - Tie cachedTie = lookupTie(target); - if (cachedTie != null) { - exportedServants.remove(target); - Utility.purgeStubForTie(cachedTie); - Utility.purgeTieAndServant(cachedTie); - try { - cleanUpTie(cachedTie); - } catch (BAD_OPERATION e) { - // ignore - } catch (org.omg.CORBA.OBJ_ADAPTER e) { - // This can happen when the target was never associated with a POA. - // We can safely ignore this case. - } - - // Is it time to shut down our keep alive thread? - if (exportedServants.isEmpty()) { - keepAlive.quit(); - keepAlive = null; - } - } else { - throw new java.rmi.NoSuchObjectException("Tie not found" ); - } - } - } - - protected void cleanUpTie(Tie cachedTie) - throws java.rmi.NoSuchObjectException - { - cachedTie.setTarget(null); - cachedTie.deactivate(); - } - - /** - * Returns the tie (if any) for a given target object. - * @return the tie or null if no tie is registered for the given target. - */ - public Tie getTie (Remote target) - { - synchronized (exportedServants) { - return lookupTie(target); - } - } - - /** - * An unsynchronized version of getTie() for internal use. - */ - private static Tie lookupTie (Remote target) - { - Tie result = (Tie)exportedServants.get(target); - if (result == null && target instanceof Tie) { - if (exportedServants.contains(target)) { - result = (Tie)target; - } - } - return result; - } - - /** - * Returns a singleton instance of a class that implements the - * {@link ValueHandler} interface. - * @return a class which implements the ValueHandler interface. - */ - public ValueHandler createValueHandler() - { - return valueHandlerSingleton; - } - - /** - * Returns the codebase, if any, for the given class. - * @param clz the class to get a codebase for. - * @return a space-separated list of URLs, or null. - */ - public String getCodebase(java.lang.Class clz) { - return RMIClassLoader.getClassAnnotation(clz); - } - - /** - * Returns a class instance for the specified class. - * @param className the name of the class. - * @param remoteCodebase a space-separated list of URLs at which - * the class might be found. May be null. - * @param loader a class whose ClassLoader may be used to - * load the class if all other methods fail. - * @return the {@code Class} object representing the loaded class. - * @exception ClassNotFoundException if class cannot be loaded. - */ - public Class loadClass( String className, String remoteCodebase, - ClassLoader loader) throws ClassNotFoundException - { - return JDKBridge.loadClass(className,remoteCodebase,loader); - } - - /** - * The {@code isLocal} method has the same semantics as the - * ObjectImpl._is_local method, except that it can throw a RemoteException. - * (no it doesn't but the spec says it should.) - * - * The {@code _is_local()} method is provided so that stubs may determine - * if a particular object is implemented by a local servant and hence local - * invocation APIs may be used. - * - * @param stub the stub to test. - * - * @return The {@code _is_local()} method returns true if - * the servant incarnating the object is located in the same process as - * the stub and they both share the same ORB instance. The {@code _is_local()} - * method returns false otherwise. The default behavior of {@code _is_local()} is - * to return false. - * - * @throws RemoteException The Java to IDL specification does to - * specify the conditions that cause a RemoteException to be thrown. - */ - public boolean isLocal(javax.rmi.CORBA.Stub stub) throws RemoteException - { - boolean result = false ; - - try { - org.omg.CORBA.portable.Delegate delegate = stub._get_delegate() ; - if (delegate instanceof CorbaClientDelegate) { - // For the Sun ORB - CorbaClientDelegate cdel = (CorbaClientDelegate)delegate ; - ContactInfoList cil = cdel.getContactInfoList() ; - if (cil instanceof CorbaContactInfoList) { - CorbaContactInfoList ccil = (CorbaContactInfoList)cil ; - LocalClientRequestDispatcher lcs = ccil.getLocalClientRequestDispatcher() ; - result = lcs.useLocalInvocation( null ) ; - } - } else { - // For a non-Sun ORB - result = delegate.is_local( stub ) ; - } - } catch (SystemException e) { - throw javax.rmi.CORBA.Util.mapSystemException(e); - } - - return result ; - } - - /** - * Wraps an exception thrown by an implementation - * method. It returns the corresponding client-side exception. - * @param orig the exception to wrap. - * @return the wrapped exception. - */ - public RemoteException wrapException(Throwable orig) - { - if (orig instanceof SystemException) { - return mapSystemException((SystemException)orig); - } - - if (orig instanceof Error) { - return new ServerError("Error occurred in server thread",(Error)orig); - } else if (orig instanceof RemoteException) { - return new ServerException("RemoteException occurred in server thread", - (Exception)orig); - } else if (orig instanceof RuntimeException) { - throw (RuntimeException) orig; - } - - if (orig instanceof Exception) - return new UnexpectedException( orig.toString(), (Exception)orig ); - else - return new UnexpectedException( orig.toString()); - } - - /** - * Copies or connects an array of objects. Used by local stubs - * to copy any number of actual parameters, preserving sharing - * across parameters as necessary to support RMI semantics. - * @param obj the objects to copy or connect. - * @param orb the ORB. - * @return the copied or connected objects. - * @exception RemoteException if any object could not be copied or connected. - */ - public Object[] copyObjects (Object[] obj, org.omg.CORBA.ORB orb) - throws RemoteException - { - if (obj == null) - // Bug fix for 5018613: JCK test expects copyObjects to throw - // NPE when obj==null. This is actually not in the spec, since - // obj is not really an RMI-IDL data type, but we follow our - // test here, and force this error to be thrown. - throw new NullPointerException() ; - - Class compType = obj.getClass().getComponentType() ; - if (Remote.class.isAssignableFrom( compType ) && !compType.isInterface()) { - // obj is an array of remote impl types. This - // causes problems with stream copier, so we copy - // it over to an array of Remotes instead. - Remote[] result = new Remote[obj.length] ; - System.arraycopy( (Object)obj, 0, (Object)result, 0, obj.length ) ; - return (Object[])copyObject( result, orb ) ; - } else - return (Object[])copyObject( obj, orb ) ; - } - - /** - * Copies or connects an object. Used by local stubs to copy - * an actual parameter, result object, or exception. - * @param obj the object to copy. - * @param orb the ORB. - * @return the copy or connected object. - * @exception RemoteException if the object could not be copied or connected. - */ - public Object copyObject (Object obj, org.omg.CORBA.ORB orb) - throws RemoteException - { - if (orb instanceof ORB) { - ORB lorb = (ORB)orb ; - - try { - try { - // This gets the copier for the current invocation, which was - // previously set by preinvoke. - return lorb.peekInvocationInfo().getCopierFactory().make().copy( obj ) ; - } catch (java.util.EmptyStackException exc) { - // copyObject was invoked outside of an invocation, probably by - // a test. Get the default copier from the ORB. - // XXX should we just make the default copier available directly - // and avoid constructing one on each call? - CopierManager cm = lorb.getCopierManager() ; - ObjectCopier copier = cm.getDefaultObjectCopierFactory().make() ; - return copier.copy( obj ) ; - } - } catch (ReflectiveCopyException exc) { - RemoteException rexc = new RemoteException() ; - rexc.initCause( exc ) ; - throw rexc ; - } - } else { - org.omg.CORBA_2_3.portable.OutputStream out = - (org.omg.CORBA_2_3.portable.OutputStream)orb.create_output_stream(); - out.write_value((Serializable)obj); - org.omg.CORBA_2_3.portable.InputStream in = - (org.omg.CORBA_2_3.portable.InputStream)out.create_input_stream(); - return in.read_value(); - } - } -} - -class KeepAlive extends Thread -{ - boolean quit = false; - - public KeepAlive () - { - super(null, null, "Servant-KeepAlive-Thread", 0, false); - setDaemon(false); - } - - public synchronized void run () - { - while (!quit) { - try { - wait(); - } catch (InterruptedException e) {} - } - } - - public synchronized void quit () - { - quit = true; - notifyAll(); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/javax/rmi/PortableRemoteObject.java b/src/java.corba/share/classes/com/sun/corba/se/impl/javax/rmi/PortableRemoteObject.java deleted file mode 100644 index 822de35ecbf..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/javax/rmi/PortableRemoteObject.java +++ /dev/null @@ -1,362 +0,0 @@ -/* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.javax.rmi; - -import java.lang.reflect.Method ; - -import javax.rmi.CORBA.Tie; -import javax.rmi.CORBA.Util; - -import java.rmi.RemoteException; -import java.rmi.NoSuchObjectException; -import java.rmi.Remote; - -import java.util.Properties; - -import org.omg.CORBA.ORB; -import org.omg.CORBA.portable.Delegate; -import org.omg.CORBA.SystemException; - -import java.rmi.server.UnicastRemoteObject; -import java.rmi.server.RemoteStub; -import java.rmi.server.ExportException; - -import java.net.URL; - -import com.sun.corba.se.impl.util.JDKBridge; -import com.sun.corba.se.impl.util.Utility; -import com.sun.corba.se.impl.util.RepositoryId; - -import com.sun.corba.se.spi.presentation.rmi.StubAdapter; - -import java.security.AccessController; -import com.sun.corba.se.impl.orbutil.GetPropertyAction; - -/** - * Server implementation objects may either inherit from - * javax.rmi.PortableRemoteObject or they may implement a remote interface - * and then use the exportObject method to register themselves as a server object. - * The toStub method takes a server implementation and returns a stub that - * can be used to access that server object. - * The connect method makes a Remote object ready for remote communication. - * The unexportObject method is used to deregister a server object, allowing it to become - * available for garbage collection. - * The narrow method takes an object reference or abstract interface type and - * attempts to narrow it to conform to - * the given interface. If the operation is successful the result will be an - * object of the specified type, otherwise an exception will be thrown. - */ -public class PortableRemoteObject - implements javax.rmi.CORBA.PortableRemoteObjectDelegate { - - /** - * Makes a server object ready to receive remote calls. Note - * that subclasses of PortableRemoteObject do not need to call this - * method, as it is called by the constructor. - * @param obj the server object to export. - * @exception RemoteException if export fails. - */ - public void exportObject(Remote obj) - throws RemoteException { - - if (obj == null) { - throw new NullPointerException("invalid argument"); - } - - // Has this object already been exported to IIOP? - - if (Util.getTie(obj) != null) { - - // Yes, so this is an error... - - throw new ExportException (obj.getClass().getName() + " already exported"); - } - - // Can we load a Tie? - - Tie theTie = Utility.loadTie(obj); - - if (theTie != null) { - - // Yes, so export it to IIOP... - - Util.registerTarget(theTie,obj); - - } else { - - // No, so export to JRMP. If this is called twice for the - // same object, it will throw an ExportException... - - UnicastRemoteObject.exportObject(obj); - } - } - - /** - * Returns a stub for the given server object. - * @param obj the server object for which a stub is required. Must either be a subclass - * of PortableRemoteObject or have been previously the target of a call to - * {@link #exportObject}. - * @return the most derived stub for the object. - * @exception NoSuchObjectException if a stub cannot be located for the given server object. - */ - public Remote toStub (Remote obj) - throws NoSuchObjectException - { - Remote result = null; - if (obj == null) { - throw new NullPointerException("invalid argument"); - } - - // If the class is already an IIOP stub then return it. - if (StubAdapter.isStub( obj )) { - return obj; - } - - // If the class is already a JRMP stub then return it. - if (obj instanceof java.rmi.server.RemoteStub) { - return obj; - } - - // Has it been exported to IIOP? - Tie theTie = Util.getTie(obj); - - if (theTie != null) { - result = Utility.loadStub(theTie,null,null,true); - } else { - if (Utility.loadTie(obj) == null) { - result = java.rmi.server.RemoteObject.toStub(obj); - } - } - - if (result == null) { - throw new NoSuchObjectException("object not exported"); - } - - return result; - } - - /** - * Deregisters a server object from the runtime, allowing the object to become - * available for garbage collection. - * @param obj the object to unexport. - * @exception NoSuchObjectException if the remote object is not - * currently exported. - */ - public void unexportObject(Remote obj) - throws NoSuchObjectException { - - if (obj == null) { - throw new NullPointerException("invalid argument"); - } - - if (StubAdapter.isStub(obj) || - obj instanceof java.rmi.server.RemoteStub) { - throw new NoSuchObjectException( - "Can only unexport a server object."); - } - - Tie theTie = Util.getTie(obj); - if (theTie != null) { - Util.unexportObject(obj); - } else { - if (Utility.loadTie(obj) == null) { - UnicastRemoteObject.unexportObject(obj,true); - } else { - throw new NoSuchObjectException("Object not exported."); - } - } - } - - /** - * Checks to ensure that an object of a remote or abstract interface type - * can be cast to a desired type. - * @param narrowFrom the object to check. - * @param narrowTo the desired type. - * @return an object which can be cast to the desired type. - * @throws ClassCastException if narrowFrom cannot be cast to narrowTo. - */ - public java.lang.Object narrow ( java.lang.Object narrowFrom, - java.lang.Class narrowTo) throws ClassCastException - { - java.lang.Object result = null; - - if (narrowFrom == null) - return null; - - if (narrowTo == null) - throw new NullPointerException("invalid argument"); - - try { - if (narrowTo.isAssignableFrom(narrowFrom.getClass())) - return narrowFrom; - - // Is narrowTo an interface that might be - // implemented by a servant running on iiop? - if (narrowTo.isInterface() && - narrowTo != java.io.Serializable.class && - narrowTo != java.io.Externalizable.class) { - - org.omg.CORBA.Object narrowObj - = (org.omg.CORBA.Object) narrowFrom; - - // Create an id from the narrowTo type... - String id = RepositoryId.createForAnyType(narrowTo); - - if (narrowObj._is_a(id)) { - return Utility.loadStub(narrowObj,narrowTo); - } else { - throw new ClassCastException( "Object is not of remote type " + - narrowTo.getName() ) ; - } - } else { - throw new ClassCastException( "Class " + narrowTo.getName() + - " is not a valid remote interface" ) ; - } - } catch(Exception error) { - ClassCastException cce = new ClassCastException() ; - cce.initCause( error ) ; - throw cce ; - } - } - - /** - * Makes a Remote object ready for remote communication. This normally - * happens implicitly when the object is sent or received as an argument - * on a remote method call, but in some circumstances it is useful to - * perform this action by making an explicit call. See the - * {@link Stub#connect} method for more information. - * @param target the object to connect. - * @param source a previously connected object. - * @throws RemoteException if source is not connected - * or if target is already connected to a different ORB than - * source. - */ - public void connect (Remote target, Remote source) - throws RemoteException - { - if (target == null || source == null) { - throw new NullPointerException("invalid argument"); - } - - ORB orb = null; - try { - if (StubAdapter.isStub( source )) { - orb = StubAdapter.getORB( source ) ; - } else { - // Is this a servant that was exported to iiop? - Tie tie = Util.getTie(source); - if (tie == null) { - /* loadTie always succeeds for dynamic RMI-IIOP - // No, can we get a tie for it? If not, - // assume that source is a JRMP object... - if (Utility.loadTie(source) != null) { - // Yes, so it is an iiop object which - // has not been exported... - throw new RemoteException( - "'source' object not exported"); - } - */ - } else { - orb = tie.orb(); - } - } - } catch (SystemException e) { - throw new RemoteException("'source' object not connected", e ); - } - - boolean targetIsIIOP = false ; - Tie targetTie = null; - if (StubAdapter.isStub(target)) { - targetIsIIOP = true; - } else { - targetTie = Util.getTie(target); - if (targetTie != null) { - targetIsIIOP = true; - } else { - /* loadTie always succeeds for dynamic RMI-IIOP - if (Utility.loadTie(target) != null) { - throw new RemoteException("'target' servant not exported"); - } - */ - } - } - - if (!targetIsIIOP) { - // Yes. Do we have an ORB from the source object? - // If not, we're done - there is nothing to do to - // connect a JRMP object. If so, it is an error because - // the caller mixed JRMP and IIOP... - if (orb != null) { - throw new RemoteException( - "'source' object exported to IIOP, 'target' is JRMP"); - } - } else { - // The target object is IIOP. Make sure we have a - // valid ORB from the source object... - if (orb == null) { - throw new RemoteException( - "'source' object is JRMP, 'target' is IIOP"); - } - - // And, finally, connect it up... - try { - if (targetTie != null) { - // Is the tie already connected? - try { - ORB existingOrb = targetTie.orb(); - - // Yes. Is it the same orb? - if (existingOrb == orb) { - - // Yes, so nothing to do... - return; - } else { - // No, so this is an error... - throw new RemoteException( - "'target' object was already connected"); - } - } catch (SystemException e) {} - - // No, so do it... - targetTie.orb(orb); - } else { - StubAdapter.connect( target, orb ) ; - } - } catch (SystemException e) { - - // The stub or tie was already connected... - throw new RemoteException( - "'target' object was already connected", e ); - } - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/DefaultSocketFactory.java b/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/DefaultSocketFactory.java deleted file mode 100644 index 93f6e3f705d..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/DefaultSocketFactory.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.legacy.connection; - -import java.io.IOException; -import java.net.InetSocketAddress; -import java.net.ServerSocket; -import java.net.Socket; -import java.net.UnknownHostException; -import java.nio.channels.ServerSocketChannel; -import java.nio.channels.SocketChannel; - -import org.omg.CORBA.ORB; -import org.omg.CORBA.COMM_FAILURE; -import org.omg.CORBA.CompletionStatus; - -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate ; -import com.sun.corba.se.spi.ior.iiop.IIOPAddress ; -import com.sun.corba.se.spi.legacy.connection.GetEndPointInfoAgainException; -import com.sun.corba.se.spi.legacy.connection.ORBSocketFactory; -import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.spi.transport.SocketInfo; - -import com.sun.corba.se.impl.legacy.connection.EndPointInfoImpl; -import com.sun.corba.se.impl.logging.ORBUtilSystemException; -import com.sun.corba.se.impl.orbutil.ORBConstants; - -public class DefaultSocketFactory - implements - ORBSocketFactory -{ - private com.sun.corba.se.spi.orb.ORB orb; - private static ORBUtilSystemException wrapper = ORBUtilSystemException.get( - CORBALogDomains.RPC_TRANSPORT ) ; - - public DefaultSocketFactory() - { - } - - public void setORB(com.sun.corba.se.spi.orb.ORB orb) - { - this.orb = orb; - } - - public ServerSocket createServerSocket(String type, int port) - throws - IOException - { - if (! type.equals(ORBSocketFactory.IIOP_CLEAR_TEXT)) { - throw wrapper.defaultCreateServerSocketGivenNonIiopClearText( type ) ; - } - - ServerSocket serverSocket; - - if (orb.getORBData().acceptorSocketType().equals(ORBConstants.SOCKETCHANNEL)) { - ServerSocketChannel serverSocketChannel = - ServerSocketChannel.open(); - serverSocket = serverSocketChannel.socket(); - } else { - serverSocket = new ServerSocket(); - } - serverSocket.bind(new InetSocketAddress(port)); - return serverSocket; - } - - public SocketInfo getEndPointInfo(ORB orb, - IOR ior, - SocketInfo socketInfo) - { - IIOPProfileTemplate temp = - (IIOPProfileTemplate)ior.getProfile().getTaggedProfileTemplate() ; - IIOPAddress primary = temp.getPrimaryAddress() ; - - return new EndPointInfoImpl(ORBSocketFactory.IIOP_CLEAR_TEXT, - primary.getPort(), - primary.getHost().toLowerCase()); - } - - public Socket createSocket(SocketInfo socketInfo) - throws - IOException, - GetEndPointInfoAgainException - { - Socket socket; - - if (orb.getORBData().acceptorSocketType().equals(ORBConstants.SOCKETCHANNEL)) { - InetSocketAddress address = - new InetSocketAddress(socketInfo.getHost(), - socketInfo.getPort()); - SocketChannel socketChannel = SocketChannel.open(address); - socket = socketChannel.socket(); - } else { - socket = new Socket(socketInfo.getHost(), - socketInfo.getPort()); - } - - // REVISIT - this is done in SocketOrChannelConnectionImpl - try { - socket.setTcpNoDelay(true); - } catch (Exception e) { - ; - } - return socket; - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/EndPointInfoImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/EndPointInfoImpl.java deleted file mode 100644 index 76711e187e3..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/EndPointInfoImpl.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.legacy.connection; - -import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketEndPointInfo; -import com.sun.corba.se.spi.transport.SocketInfo; - -public class EndPointInfoImpl - implements - SocketInfo, - LegacyServerSocketEndPointInfo -{ - - protected String type; - protected String hostname; - protected int port; - protected int locatorPort; - protected String name; - - public EndPointInfoImpl(String type, int port, String hostname) { - this.type = type; - this.port = port; - this.hostname = hostname; - this.locatorPort = -1; - this.name = LegacyServerSocketEndPointInfo.NO_NAME; - } - - public String getType() { - return type; - } - - public String getHost() { - return hostname; - } - - public String getHostName() { - return hostname; - } - - public int getPort() { - return port; - } - - public int getLocatorPort () - { - return locatorPort; - } - - public void setLocatorPort (int port) - { - locatorPort = port; - } - - public String getName() - { - return name; - } - - public int hashCode() { - return type.hashCode() ^ hostname.hashCode() ^ port; - } - - public boolean equals(Object obj) { - if (!(obj instanceof EndPointInfoImpl)) { - return false; - } - EndPointInfoImpl other = (EndPointInfoImpl)obj; - if (type == null) { - if (other.type != null) { - return false; - } - } else if (!type.equals(other.type)) { - return false; - } - if (port != other.port) { - return false; - } - if (!hostname.equals(other.hostname)) { - return false; - } - return true; - } - - public String toString () - { - return - type + " " + - name + " " + - hostname + " " + - port; - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/LegacyServerSocketManagerImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/LegacyServerSocketManagerImpl.java deleted file mode 100644 index 3a5ca90958a..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/LegacyServerSocketManagerImpl.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.legacy.connection; - -import java.net.ServerSocket; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; - -import org.omg.CORBA.INITIALIZE; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.CompletionStatus; - -import com.sun.corba.se.pept.transport.Acceptor; -import com.sun.corba.se.pept.transport.ByteBufferPool; -import com.sun.corba.se.pept.transport.ContactInfo; -import com.sun.corba.se.pept.transport.Selector; - -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.iiop.IIOPProfile ; -import com.sun.corba.se.spi.ior.ObjectKeyTemplate; -import com.sun.corba.se.spi.ior.ObjectId ; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.transport.CorbaTransportManager; -import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketEndPointInfo; -import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketManager; -import com.sun.corba.se.spi.transport.SocketOrChannelAcceptor; -import com.sun.corba.se.spi.logging.CORBALogDomains; - -import com.sun.corba.se.impl.encoding.EncapsOutputStream; -import com.sun.corba.se.impl.legacy.connection.SocketFactoryAcceptorImpl; -import com.sun.corba.se.impl.legacy.connection.USLPort; -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.transport.SocketOrChannelAcceptorImpl; -import com.sun.corba.se.impl.logging.ORBUtilSystemException; - -public class LegacyServerSocketManagerImpl - implements - LegacyServerSocketManager -{ - protected ORB orb; - private ORBUtilSystemException wrapper ; - - public LegacyServerSocketManagerImpl(ORB orb) - { - this.orb = orb; - wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_TRANSPORT ) ; - } - - //////////////////////////////////////////////////// - // - // LegacyServerSocketManager - // - - // Only used in ServerManagerImpl. - public int legacyGetTransientServerPort(String type) - { - return legacyGetServerPort(type, false); - } - - // Only used by POAPolicyMediatorBase. - public synchronized int legacyGetPersistentServerPort(String socketType) - { - if (orb.getORBData().getServerIsORBActivated()) { - // this server is activated by orbd - return legacyGetServerPort(socketType, true); - } else if (orb.getORBData().getPersistentPortInitialized()) { - // this is a user-activated server - return orb.getORBData().getPersistentServerPort(); - } else { - throw wrapper.persistentServerportNotSet( - CompletionStatus.COMPLETED_MAYBE); - } - } - - // Only used by PI IORInfoImpl. - public synchronized int legacyGetTransientOrPersistentServerPort( - String socketType) - { - return legacyGetServerPort(socketType, - orb.getORBData() - .getServerIsORBActivated()); - } - - // Used in RepositoryImpl, ServerManagerImpl, POAImpl, - // POAPolicyMediatorBase, TOAImpl. - // To get either default or bootnaming endpoint. - public synchronized LegacyServerSocketEndPointInfo legacyGetEndpoint( - String name) - { - Iterator iterator = getAcceptorIterator(); - while (iterator.hasNext()) { - LegacyServerSocketEndPointInfo endPoint = cast(iterator.next()); - if (endPoint != null && name.equals(endPoint.getName())) { - return endPoint; - } - } - throw new INTERNAL("No acceptor for: " + name); - } - - // Check to see if the given port is equal to any of the ORB Server Ports. - // XXX Does this need to change for the multi-homed case? - // Used in IIOPProfileImpl, ORBImpl. - public boolean legacyIsLocalServerPort(int port) - { - Iterator iterator = getAcceptorIterator(); - while (iterator.hasNext()) { - LegacyServerSocketEndPointInfo endPoint = cast(iterator.next()); - if (endPoint != null && endPoint.getPort() == port) { - return true; - } - } - return false; - } - - //////////////////////////////////////////////////// - // - // Implementation. - // - - private int legacyGetServerPort (String socketType, boolean isPersistent) - { - Iterator endpoints = getAcceptorIterator(); - while (endpoints.hasNext()) { - LegacyServerSocketEndPointInfo ep = cast(endpoints.next()); - if (ep != null && ep.getType().equals(socketType)) { - if (isPersistent) { - return ep.getLocatorPort(); - } else { - return ep.getPort(); - } - } - } - return -1; - } - - private Iterator getAcceptorIterator() - { - Collection acceptors = - orb.getCorbaTransportManager().getAcceptors(null, null); - if (acceptors != null) { - return acceptors.iterator(); - } - - throw wrapper.getServerPortCalledBeforeEndpointsInitialized() ; - } - - private LegacyServerSocketEndPointInfo cast(Object o) - { - if (o instanceof LegacyServerSocketEndPointInfo) { - return (LegacyServerSocketEndPointInfo) o; - } - return null; - } - - protected void dprint(String msg) - { - ORBUtility.dprint("LegacyServerSocketManagerImpl", msg); - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/SocketFactoryAcceptorImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/SocketFactoryAcceptorImpl.java deleted file mode 100644 index f62d7f6cf50..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/SocketFactoryAcceptorImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.legacy.connection; - -import java.io.IOException; -import java.net.InetSocketAddress; -import java.net.ServerSocket; - -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.INTERNAL; - -import com.sun.corba.se.spi.orb.ORB; - -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.transport.SocketOrChannelContactInfoImpl; -import com.sun.corba.se.impl.transport.SocketOrChannelAcceptorImpl; - -/** - * @author Harold Carr - */ -public class SocketFactoryAcceptorImpl - extends - SocketOrChannelAcceptorImpl -{ - public SocketFactoryAcceptorImpl(ORB orb, int port, - String name, String type) - { - super(orb, port, name, type); - } - - //////////////////////////////////////////////////// - // - // pept Acceptor - // - - public boolean initialize() - { - if (initialized) { - return false; - } - if (orb.transportDebugFlag) { - dprint("initialize: " + this); - } - try { - serverSocket = orb.getORBData() - .getLegacySocketFactory().createServerSocket(type, port); - internalInitialize(); - } catch (Throwable t) { - throw wrapper.createListenerFailed( t, Integer.toString(port) ) ; - } - initialized = true; - return true; - } - - //////////////////////////////////////////////////// - // - // Implementation. - // - - protected String toStringName() - { - return "SocketFactoryAcceptorImpl"; - } - - protected void dprint(String msg) - { - ORBUtility.dprint(toStringName(), msg); - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/SocketFactoryConnectionImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/SocketFactoryConnectionImpl.java deleted file mode 100644 index af96c924bfd..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/SocketFactoryConnectionImpl.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.legacy.connection; - -import java.net.Socket; -import java.nio.channels.SocketChannel; -import java.util.Collections; - -import org.omg.CORBA.COMM_FAILURE; -import org.omg.CORBA.CompletionStatus; - -import com.sun.corba.se.pept.transport.Acceptor; -import com.sun.corba.se.pept.transport.ContactInfo; - -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.legacy.connection.GetEndPointInfoAgainException; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.transport.CorbaConnection; -import com.sun.corba.se.spi.transport.CorbaContactInfo; -import com.sun.corba.se.spi.transport.SocketInfo; - -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.transport.SocketOrChannelContactInfoImpl; -import com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl; - -/** - * @author Harold Carr - */ -public class SocketFactoryConnectionImpl - extends - SocketOrChannelConnectionImpl -{ - // Socket-factory client constructor. - public SocketFactoryConnectionImpl(ORB orb, - CorbaContactInfo contactInfo, - boolean useSelectThreadToWait, - boolean useWorkerThread) - { - super(orb, useSelectThreadToWait, useWorkerThread); - - // REVISIT - probably need a contact info for both - // client and server for removing connections from cache? - this.contactInfo = contactInfo; - - boolean isBlocking = !useSelectThreadToWait; - SocketInfo socketInfo = - // REVISIT - case - needs interface method - ((SocketFactoryContactInfoImpl)contactInfo).socketInfo; - try { - socket = - orb.getORBData().getLegacySocketFactory().createSocket(socketInfo); - socketChannel = socket.getChannel(); - if (socketChannel != null) { - socketChannel.configureBlocking(isBlocking); - } else { - // IMPORTANT: non-channel-backed sockets must use - // dedicated reader threads. - setUseSelectThreadToWait(false); - } - if (orb.transportDebugFlag) { - dprint(".initialize: connection created: " + socket); - } - } catch (GetEndPointInfoAgainException ex) { - throw wrapper.connectFailure( - ex, socketInfo.getType(), socketInfo.getHost(), - Integer.toString(socketInfo.getPort())) ; - } catch (Exception ex) { - throw wrapper.connectFailure( - ex, socketInfo.getType(), socketInfo.getHost(), - Integer.toString(socketInfo.getPort())) ; - } - state = OPENING; - } - - public String toString() - { - synchronized ( stateEvent ){ - return - "SocketFactoryConnectionImpl[" + " " - + (socketChannel == null ? - socket.toString() : socketChannel.toString()) + " " - + getStateString( state ) + " " - + shouldUseSelectThreadToWait() + " " - + shouldUseWorkerThreadForEvent() - + "]" ; - } - } - - // Note: public to override parent. - public void dprint(String msg) - { - ORBUtility.dprint("SocketFactoryConnectionImpl", msg); - } - -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/SocketFactoryContactInfoImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/SocketFactoryContactInfoImpl.java deleted file mode 100644 index 52d287e4dec..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/SocketFactoryContactInfoImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.legacy.connection; - -import com.sun.corba.se.pept.transport.Connection; - -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.spi.transport.CorbaContactInfoList; -import com.sun.corba.se.spi.transport.SocketInfo; - -import com.sun.corba.se.impl.logging.ORBUtilSystemException; -import com.sun.corba.se.impl.transport.SocketOrChannelContactInfoImpl; - - -/** - * @author Harold Carr - */ -public class SocketFactoryContactInfoImpl - extends - SocketOrChannelContactInfoImpl -{ - protected ORBUtilSystemException wrapper; - protected SocketInfo socketInfo; - - // XREVISIT - // See SocketOrChannelAcceptorImpl.createMessageMediator - // See SocketFactoryContactInfoImpl.constructor() - // See SocketOrChannelContactInfoImpl.constructor() - public SocketFactoryContactInfoImpl() - { - } - - public SocketFactoryContactInfoImpl( - ORB orb, - CorbaContactInfoList contactInfoList, - IOR effectiveTargetIOR, - short addressingDisposition, - SocketInfo cookie) - { - super(orb, contactInfoList); - this.effectiveTargetIOR = effectiveTargetIOR; - this.addressingDisposition = addressingDisposition; - - wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_TRANSPORT ) ; - - socketInfo = - orb.getORBData().getLegacySocketFactory() - .getEndPointInfo(orb, effectiveTargetIOR, cookie); - - socketType = socketInfo.getType(); - hostname = socketInfo.getHost(); - port = socketInfo.getPort(); - } - - //////////////////////////////////////////////////// - // - // pept.transport.ContactInfo - // - - public Connection createConnection() - { - Connection connection = - new SocketFactoryConnectionImpl( - orb, this, - orb.getORBData().connectionSocketUseSelectThreadToWait(), - orb.getORBData().connectionSocketUseWorkerThreadForEvent()); - return connection; - } - - //////////////////////////////////////////////////// - // - // java.lang.Object - // - - public String toString() - { - return - "SocketFactoryContactInfoImpl[" - + socketType + " " - + hostname + " " - + port - + "]"; - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/SocketFactoryContactInfoListImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/SocketFactoryContactInfoListImpl.java deleted file mode 100644 index 4f209d072ca..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/SocketFactoryContactInfoListImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.legacy.connection; - -import java.util.Iterator; - -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.impl.transport.CorbaContactInfoListImpl; -import com.sun.corba.se.impl.transport.CorbaContactInfoListIteratorImpl; - -/** - * @author Harold Carr - */ -public class SocketFactoryContactInfoListImpl - extends - CorbaContactInfoListImpl -{ - // XREVISIT - is this used? - public SocketFactoryContactInfoListImpl(ORB orb) - { - super(orb); - } - - public SocketFactoryContactInfoListImpl(ORB orb, IOR targetIOR) - { - super(orb, targetIOR); - } - - //////////////////////////////////////////////////// - // - // pept.transport.ContactInfoList - // - - public Iterator iterator() - { - return new SocketFactoryContactInfoListIteratorImpl(orb, this); - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/SocketFactoryContactInfoListIteratorImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/SocketFactoryContactInfoListIteratorImpl.java deleted file mode 100644 index 63081b1a87e..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/SocketFactoryContactInfoListIteratorImpl.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.legacy.connection; - -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.SystemException; - -import com.sun.corba.se.pept.transport.ContactInfo; - -import com.sun.corba.se.spi.legacy.connection.GetEndPointInfoAgainException; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.transport.CorbaContactInfo; -import com.sun.corba.se.spi.transport.CorbaContactInfoList; -import com.sun.corba.se.spi.transport.SocketInfo; - -import com.sun.corba.se.impl.transport.CorbaContactInfoListIteratorImpl; -import com.sun.corba.se.impl.transport.SharedCDRContactInfoImpl; - -public class SocketFactoryContactInfoListIteratorImpl - extends CorbaContactInfoListIteratorImpl -{ - private SocketInfo socketInfoCookie; - - public SocketFactoryContactInfoListIteratorImpl( - ORB orb, - CorbaContactInfoList corbaContactInfoList) - { - super(orb, corbaContactInfoList, null, null); - } - - //////////////////////////////////////////////////// - // - // java.util.Iterator - // - - public boolean hasNext() - { - return true; - } - - public Object next() - { - if (contactInfoList.getEffectiveTargetIOR().getProfile().isLocal()){ - return new SharedCDRContactInfoImpl( - orb, contactInfoList, - contactInfoList.getEffectiveTargetIOR(), - orb.getORBData().getGIOPAddressDisposition()); - } else { - // REVISIT: - // on comm_failure maybe need to give IOR instead of located. - return new SocketFactoryContactInfoImpl( - orb, contactInfoList, - contactInfoList.getEffectiveTargetIOR(), - orb.getORBData().getGIOPAddressDisposition(), - socketInfoCookie); - } - } - - //////////////////////////////////////////////////// - // - // pept.ContactInfoListIterator - // - - public boolean reportException(ContactInfo contactInfo, - RuntimeException ex) - { - this.failureContactInfo = (CorbaContactInfo)contactInfo; - this.failureException = ex; - if (ex instanceof org.omg.CORBA.COMM_FAILURE) { - - if (ex.getCause() instanceof GetEndPointInfoAgainException) { - socketInfoCookie = - ((GetEndPointInfoAgainException) ex.getCause()) - .getEndPointInfo(); - return true; - } - - SystemException se = (SystemException) ex; - if (se.completed == CompletionStatus.COMPLETED_NO) { - if (contactInfoList.getEffectiveTargetIOR() != - contactInfoList.getTargetIOR()) - { - // retry from root ior - contactInfoList.setEffectiveTargetIOR( - contactInfoList.getTargetIOR()); - return true; - } - } - } - return false; - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/USLPort.java b/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/USLPort.java deleted file mode 100644 index fb509571553..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/legacy/connection/USLPort.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.legacy.connection; - -public class USLPort -{ - private String type; - private int port; - - public USLPort (String type, int port) - { - this.type = type; - this.port = port; - } - - public String getType () { return type; } - public int getPort () { return port; } - public String toString () { return type + ":" + port; } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/monitoring/MonitoredAttributeInfoFactoryImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/monitoring/MonitoredAttributeInfoFactoryImpl.java deleted file mode 100644 index 087fc1f5d23..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/monitoring/MonitoredAttributeInfoFactoryImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.monitoring; - -import com.sun.corba.se.spi.monitoring.MonitoredAttributeInfoFactory; -import com.sun.corba.se.spi.monitoring.MonitoredAttributeInfo; - -public class MonitoredAttributeInfoFactoryImpl - implements MonitoredAttributeInfoFactory -{ - public MonitoredAttributeInfo createMonitoredAttributeInfo( - String description, Class type, boolean isWritable, - boolean isStatistic ) - { - return new MonitoredAttributeInfoImpl( description, type, - isWritable, isStatistic ); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/monitoring/MonitoredAttributeInfoImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/monitoring/MonitoredAttributeInfoImpl.java deleted file mode 100644 index 3b7539efbb4..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/monitoring/MonitoredAttributeInfoImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.monitoring; - -import com.sun.corba.se.spi.monitoring.MonitoredAttributeInfo; - -public class MonitoredAttributeInfoImpl implements MonitoredAttributeInfo { - private final String description; - private final Class type; - private final boolean writableFlag, statisticFlag; - - MonitoredAttributeInfoImpl( String description, Class type, - boolean isWritable, boolean isStatistic ) - { - this.description = description; - this.type = type; - this.writableFlag = isWritable; - this.statisticFlag = isStatistic; - } - - public String getDescription( ) { - return this.description; - } - - public Class type( ) { - return this.type; - } - - public boolean isWritable( ) { - return this.writableFlag; - } - - public boolean isStatistic( ) { - return this.statisticFlag; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/monitoring/MonitoredObjectFactoryImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/monitoring/MonitoredObjectFactoryImpl.java deleted file mode 100644 index 3e99affe69e..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/monitoring/MonitoredObjectFactoryImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.monitoring; - -import com.sun.corba.se.spi.monitoring.MonitoredObjectFactory; -import com.sun.corba.se.spi.monitoring.MonitoredObject; - -public class MonitoredObjectFactoryImpl implements MonitoredObjectFactory { - - public MonitoredObject createMonitoredObject( String name, - String description ) - { - return new MonitoredObjectImpl( name, description ); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/monitoring/MonitoredObjectImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/monitoring/MonitoredObjectImpl.java deleted file mode 100644 index edec5b7b600..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/monitoring/MonitoredObjectImpl.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.monitoring; - -import java.util.Map; -import java.util.HashMap; -import java.util.Collection; -import java.util.Iterator; - -import com.sun.corba.se.spi.monitoring.MonitoredObject; -import com.sun.corba.se.spi.monitoring.MonitoredAttribute; - -public class MonitoredObjectImpl implements MonitoredObject { - private final String name; - private final String description; - - // List of all child Monitored Objects - private Map children = new HashMap(); - - // All the Attributes of this Monitored Object instance - private Map monitoredAttributes = new HashMap(); - - private MonitoredObject parent = null; - - - // Constructor - MonitoredObjectImpl( String name, String description ) { - this.name = name; - this.description = description; - } - - public MonitoredObject getChild( String name ) { - synchronized( this ) { - return (MonitoredObject) children.get( name ); - } - } - - public Collection getChildren( ) { - synchronized( this ) { - return children.values(); - } - } - - public void addChild( MonitoredObject m ) { - if (m != null){ - synchronized( this ) { - children.put( m.getName(), m); - m.setParent( this ); - } - } - } - - public void removeChild( String name ) { - if (name != null){ - synchronized( this ) { - children.remove( name ); - } - } - } - - public synchronized MonitoredObject getParent( ) { - return parent; - } - - public synchronized void setParent( MonitoredObject p ) { - parent = p; - } - - public MonitoredAttribute getAttribute( String name ) { - synchronized( this ) { - return (MonitoredAttribute) monitoredAttributes.get( name ); - } - } - - public Collection getAttributes( ) { - synchronized( this ) { - return monitoredAttributes.values(); - } - } - - public void addAttribute( MonitoredAttribute value ) { - if (value != null) { - synchronized( this ) { - monitoredAttributes.put( value.getName(), value ); - } - } - } - - public void removeAttribute( String name ) { - if (name != null) { - synchronized( this ) { - monitoredAttributes.remove( name ); - } - } - } - - /** - * calls clearState() on all the registered children MonitoredObjects and - * MonitoredAttributes. - */ - public void clearState( ) { - synchronized( this ) { - Iterator i = monitoredAttributes.values().iterator(); - // First call clearState on all the local attributes - while( i.hasNext( ) ) { - ((MonitoredAttribute)i.next()).clearState(); - } - i = children.values().iterator(); - // next call clearState on all the children MonitoredObjects - while( i.hasNext() ) { - ((MonitoredObject)i.next()).clearState(); - } - } - } - - public String getName( ) { - return name; - } - - public String getDescription( ) { - return description; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/monitoring/MonitoringManagerFactoryImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/monitoring/MonitoringManagerFactoryImpl.java deleted file mode 100644 index a88d2f2f697..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/monitoring/MonitoringManagerFactoryImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.monitoring; - -import java.util.HashMap; -import com.sun.corba.se.spi.monitoring.MonitoringManagerFactory; -import com.sun.corba.se.spi.monitoring.MonitoringManager; - -public class MonitoringManagerFactoryImpl implements MonitoringManagerFactory { - - private HashMap monitoringManagerTable = new HashMap(); - - public synchronized MonitoringManager createMonitoringManager( - String nameOfTheRoot, String description) - { - MonitoringManagerImpl m = null; - m = (MonitoringManagerImpl)monitoringManagerTable.get(nameOfTheRoot); - if (m == null) { - m = new MonitoringManagerImpl(nameOfTheRoot, description); - monitoringManagerTable.put(nameOfTheRoot, m); - } - return m; - } - - public synchronized void remove(String nameOfTheRoot) { - monitoringManagerTable.remove(nameOfTheRoot); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/monitoring/MonitoringManagerImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/monitoring/MonitoringManagerImpl.java deleted file mode 100644 index b7e676eafed..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/monitoring/MonitoringManagerImpl.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.monitoring; - -import com.sun.corba.se.spi.monitoring.MonitoringManager; -import com.sun.corba.se.spi.monitoring.MonitoringManagerFactory; -import com.sun.corba.se.spi.monitoring.MonitoredObject; -import com.sun.corba.se.spi.monitoring.MonitoredObjectFactory; -import com.sun.corba.se.spi.monitoring.MonitoringFactories; - -public class MonitoringManagerImpl implements MonitoringManager { - private final MonitoredObject rootMonitoredObject; - - MonitoringManagerImpl(String nameOfTheRoot, String description) { - MonitoredObjectFactory f = - MonitoringFactories.getMonitoredObjectFactory(); - rootMonitoredObject = - f.createMonitoredObject(nameOfTheRoot, description); - } - - public void clearState() { - rootMonitoredObject.clearState(); - } - - public MonitoredObject getRootMonitoredObject() { - return rootMonitoredObject; - } - - public void close() { - MonitoringManagerFactory f = - MonitoringFactories.getMonitoringManagerFactory(); - f.remove(rootMonitoredObject.getName()); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/BindingIteratorImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/BindingIteratorImpl.java deleted file mode 100644 index df8faeb7fa6..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/BindingIteratorImpl.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.naming.cosnaming; - -// Import general CORBA classes -import org.omg.CORBA.ORB; -import org.omg.CORBA.Object; - -// Import org.omg.CosNaming classes -import org.omg.CosNaming.Binding; -import org.omg.CosNaming.BindingType; -import org.omg.CosNaming.BindingHolder; -import org.omg.CosNaming.BindingListHolder; -import org.omg.CosNaming.BindingIteratorHolder; -import org.omg.CosNaming.BindingIteratorPOA; -import org.omg.CORBA.BAD_PARAM; - -/** - * Class BindingIteratorImpl implements the org.omg.CosNaming::BindingIterator - * interface, but does not implement the method to retrieve the next - * binding in the NamingContext for which it was created. This is left - * to a subclass, which is why this class is abstract; BindingIteratorImpl - * provides an implementation of the interface operations on top of two - * subclass methods, allowing multiple implementations of iterators that - * differ in storage and access to the contents of a NamingContext - * implementation. - *

            - * The operation next_one() is implemented by the subclass, whereas - * next_n() is implemented on top of the next_one() implementation. - * Destroy must also be implemented by the subclass. - *

            - * A subclass must implement NextOne() and Destroy(); these - * methods are invoked from synchronized methods and need therefore - * not be synchronized themselves. - */ -public abstract class BindingIteratorImpl extends BindingIteratorPOA -{ - protected ORB orb ; - - /** - * Create a binding iterator servant. - * runs the super constructor. - * @param orb an ORB object. - * @exception java.lang.Exception a Java exception. - */ - public BindingIteratorImpl(ORB orb) - throws java.lang.Exception - { - super(); - this.orb = orb ; - } - - /** - * Return the next binding. It also returns true or false, indicating - * whether there were more bindings. - * @param b The Binding as an out parameter. - * @return true if there were more bindings. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA - * system exceptions. - * @see NextOne - */ - public synchronized boolean next_one(org.omg.CosNaming.BindingHolder b) - { - // NextOne actually returns the next one - return NextOne(b); - } - - /** - * Return the next n bindings. It also returns true or false, indicating - * whether there were more bindings. - * @param how_many The number of requested bindings in the BindingList. - * @param blh The BindingList as an out parameter. - * @return true if there were more bindings. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA - * system exceptions. - * @see NextOne - */ - public synchronized boolean next_n(int how_many, - org.omg.CosNaming.BindingListHolder blh) - { - if( how_many == 0 ) { - throw new BAD_PARAM( " 'how_many' parameter is set to 0 which is" + - " invalid" ); - } - return list( how_many, blh ); - } - - /** - * lists next n bindings. It returns true or false, indicating - * whether there were more bindings. This method has the package private - * scope, It will be called from NamingContext.list() operation or - * this.next_n(). - * @param how_many The number of requested bindings in the BindingList. - * @param blh The BindingList as an out parameter. - * @return true if there were more bindings. - */ - public boolean list( int how_many, org.omg.CosNaming.BindingListHolder blh) - { - // Take the smallest of what's left and what's being asked for - int numberToGet = Math.min(RemainingElements(),how_many); - - // Create a resulting BindingList - Binding[] bl = new Binding[numberToGet]; - BindingHolder bh = new BindingHolder(); - int i = 0; - // Keep iterating as long as there are entries - while (i < numberToGet && this.NextOne(bh) == true) { - bl[i] = bh.value; - i++; - } - // Found any at all? - if (i == 0) { - // No - blh.value = new Binding[0]; - return false; - } - - // Set into holder - blh.value = bl; - - return true; - } - - - - - /** - * Destroy this BindingIterator object. The object corresponding to this - * object reference is destroyed. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA - * system exceptions. - * @see Destroy - */ - public synchronized void destroy() - { - // Destroy actually destroys - this.Destroy(); - } - - /** - * Abstract method for returning the next binding in the NamingContext - * for which this BindingIterator was created. - * @param b The Binding as an out parameter. - * @return true if there were more bindings. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA - * system exceptions. - */ - protected abstract boolean NextOne(org.omg.CosNaming.BindingHolder b); - - /** - * Abstract method for destroying this BindingIterator. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA - * system exceptions. - */ - protected abstract void Destroy(); - - /** - * Abstract method for returning the remaining number of elements. - * @return the remaining number of elements in the iterator. - */ - protected abstract int RemainingElements(); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/InterOperableNamingImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/InterOperableNamingImpl.java deleted file mode 100644 index 74a44a9050e..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/InterOperableNamingImpl.java +++ /dev/null @@ -1,413 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.naming.cosnaming; - -import org.omg.CosNaming.NamingContextExtPackage.*; -import java.io.StringWriter; - -// Import general CORBA classes -import org.omg.CORBA.SystemException; -import org.omg.CORBA.Object; - -// Import org.omg.CosNaming types -import org.omg.CosNaming.NameComponent; -import org.omg.CosNaming.NamingContext; - - -/** - * Class InteroperableNamingImpl implements the methods defined - * for NamingContextExt which is part of Interoperable Naming - * Service specifications. This class is added for doing more - * of Parsing and Building of Stringified names according to INS - * Spec. - */ -public class InterOperableNamingImpl -{ - /** - * Method which stringifies the Name Components given as the input - * parameter. - * - * @param n Array of Name Components (Simple or Compound Names) - * @return string which is the stringified reference. - */ - public String convertToString( org.omg.CosNaming.NameComponent[] - theNameComponents ) - { - String theConvertedString = - convertNameComponentToString( theNameComponents[0] ); - String temp; - for( int i = 1; i < theNameComponents.length; i++ ) { - temp = convertNameComponentToString( theNameComponents[i] ); - if( temp != null ) { - theConvertedString = - theConvertedString + "/" + convertNameComponentToString( - theNameComponents[i] ); - } - } - return theConvertedString; - } - - /** This method converts a single Namecomponent to String, By adding Escapes - * If neccessary. - */ - private String convertNameComponentToString( - org.omg.CosNaming.NameComponent theNameComponent ) - { - if( ( ( theNameComponent.id == null ) - ||( theNameComponent.id.length() == 0 ) ) - &&( ( theNameComponent.kind == null ) - ||( theNameComponent.kind.length() == 0 ) ) ) - { - return "."; - } - else if( ( theNameComponent.id == null ) - ||( theNameComponent.id.length() == 0 ) ) - { - String kind = addEscape( theNameComponent.kind ); - return "." + kind; - } - else if( ( theNameComponent.kind == null ) - ||( theNameComponent.kind.length() == 0 ) ) - { - String id = addEscape( theNameComponent.id ); - return id; - } - else { - String id = addEscape( theNameComponent.id ); - String kind = addEscape( theNameComponent.kind ); - return (id + "." + kind); - } - } - - - /** This method adds escape '\' for the Namecomponent if neccessary - */ - private String addEscape( String value ) - { - StringBuffer theNewValue; - if( (value != null) && ( (value.indexOf('.') != -1 ) || - (value.indexOf('/') != -1))) - { - char c; - theNewValue = new StringBuffer( ); - for( int i = 0; i < value.length( ); i++ ) { - c = value.charAt( i ); - if( ( c != '.' ) && (c != '/' ) ) - { - theNewValue.append( c ); - } - else { - // Adding escape for the "." - theNewValue.append( '\\' ); - theNewValue.append( c ); - } - } - } - else { - return value; - } - return new String( theNewValue ); - } - - /** - * Method which converts the Stringified name into Array of Name Components. - * - * @param string which is the stringified name. - * @return Array of Name Components (Simple or Compound Names) - */ - public org.omg.CosNaming.NameComponent[] convertToNameComponent( - String theStringifiedName ) - throws org.omg.CosNaming.NamingContextPackage.InvalidName - { - String[] theStringifiedNameComponents = - breakStringToNameComponents( theStringifiedName ); - if( ( theStringifiedNameComponents == null ) - || (theStringifiedNameComponents.length == 0 ) ) - { - return null; - } - NameComponent[] theNameComponents = - new NameComponent[theStringifiedNameComponents.length]; - for( int i = 0; i < theStringifiedNameComponents.length; i++ ) { - theNameComponents[i] = createNameComponentFromString( - theStringifiedNameComponents[i] ); - } - return theNameComponents; - } - - /** Step1 in converting Stringified name into array of Name Component - * is breaking the String into multiple name components - */ - private String[] breakStringToNameComponents( String theStringifiedName ) { - int[] theIndices = new int[100]; - int theIndicesIndex = 0; - - for(int index = 0; index <= theStringifiedName.length(); ) { - theIndices[theIndicesIndex] = theStringifiedName.indexOf( '/', - index ); - if( theIndices[theIndicesIndex] == -1 ) { - // This is the end of all the occurence of '/' and hence come - // out of the loop - index = theStringifiedName.length()+1; - } - else { - // If the '/' is found, first check whether it is - // preceded by escape '\' - // If not then set theIndices and increment theIndicesIndex - // and also set the index else just ignore the '/' - if( (theIndices[theIndicesIndex] > 0 ) - && (theStringifiedName.charAt( - theIndices[theIndicesIndex]-1) == '\\') ) - { - index = theIndices[theIndicesIndex] + 1; - theIndices[theIndicesIndex] = -1; - } - else { - index = theIndices[theIndicesIndex] + 1; - theIndicesIndex++; - } - } - } - if( theIndicesIndex == 0 ) { - String[] tempString = new String[1]; - tempString[0] = theStringifiedName; - return tempString; - } - if( theIndicesIndex != 0 ) { - theIndicesIndex++; - } - return StringComponentsFromIndices( theIndices, theIndicesIndex, - theStringifiedName ); - } - - /** This method breaks one big String into multiple substrings based - * on the array of index passed in. - */ - private String[] StringComponentsFromIndices( int[] theIndices, - int indicesCount, String theStringifiedName ) - { - String[] theStringComponents = new String[indicesCount]; - int firstIndex = 0; - int lastIndex = theIndices[0]; - for( int i = 0; i < indicesCount; i++ ) { - theStringComponents[i] = theStringifiedName.substring( firstIndex, - lastIndex ); - if( ( theIndices[i] < theStringifiedName.length() - 1 ) - &&( theIndices[i] != -1 ) ) - { - firstIndex = theIndices[i]+1; - } - else { - firstIndex = 0; - i = indicesCount; - } - if( (i+1 < theIndices.length) - && (theIndices[i+1] < (theStringifiedName.length() - 1)) - && (theIndices[i+1] != -1) ) - { - lastIndex = theIndices[i+1]; - } - else { - i = indicesCount; - } - // This is done for the last component - if( firstIndex != 0 && i == indicesCount ) { - theStringComponents[indicesCount-1] = - theStringifiedName.substring( firstIndex ); - } - } - return theStringComponents; - } - - /** Step 2: After Breaking the Stringified name into set of NameComponent - * Strings, The next step is to create Namecomponents from the substring - * by removing the escapes if there are any. - */ - private NameComponent createNameComponentFromString( - String theStringifiedNameComponent ) - throws org.omg.CosNaming.NamingContextPackage.InvalidName - - { - String id = null; - String kind = null; - if( ( theStringifiedNameComponent == null ) - || ( theStringifiedNameComponent.length( ) == 0) - || ( theStringifiedNameComponent.endsWith(".") ) ) - { - // If any of the above is true, then we create an invalid Name - // Component to indicate that it is an invalid name. - throw new org.omg.CosNaming.NamingContextPackage.InvalidName( ); - } - - int index = theStringifiedNameComponent.indexOf( '.', 0 ); - // The format could be XYZ (Without kind) - if( index == -1 ) { - id = theStringifiedNameComponent; - } - // The format is .XYZ (Without ID) - else if( index == 0 ) { - // This check is for the Namecomponent which is just "." meaning Id - // and Kinds are null - if( theStringifiedNameComponent.length( ) != 1 ) { - kind = theStringifiedNameComponent.substring(1); - } - } - else - { - if( theStringifiedNameComponent.charAt(index-1) != '\\' ) { - id = theStringifiedNameComponent.substring( 0, index); - kind = theStringifiedNameComponent.substring( index + 1 ); - } - else { - boolean kindfound = false; - while( (index < theStringifiedNameComponent.length() ) - &&( kindfound != true ) ) - { - index = theStringifiedNameComponent.indexOf( '.',index + 1); - if( index > 0 ) { - if( theStringifiedNameComponent.charAt( - index - 1 ) != '\\' ) - { - kindfound = true; - } - } - else - { - // No more '.', which means there is no Kind - index = theStringifiedNameComponent.length(); - } - } - if( kindfound == true ) { - id = theStringifiedNameComponent.substring( 0, index); - kind = theStringifiedNameComponent.substring(index + 1 ); - } - else { - id = theStringifiedNameComponent; - } - } - } - id = cleanEscapeCharacter( id ); - kind = cleanEscapeCharacter( kind ); - if( id == null ) { - id = ""; - } - if( kind == null ) { - kind = ""; - } - return new NameComponent( id, kind ); - } - - - /** This method cleans the escapes in the Stringified name and returns the - * correct String - */ - private String cleanEscapeCharacter( String theString ) - { - if( ( theString == null ) || (theString.length() == 0 ) ) { - return theString; - } - int index = theString.indexOf( '\\' ); - if( index == 0 ) { - return theString; - } - else { - StringBuffer src = new StringBuffer( theString ); - StringBuffer dest = new StringBuffer( ); - char c; - for( int i = 0; i < theString.length( ); i++ ) { - c = src.charAt( i ); - if( c != '\\' ) { - dest.append( c ); - } else { - if( i+1 < theString.length() ) { - char d = src.charAt( i + 1 ); - // If there is a AlphaNumeric character after a \ - // then include slash, as it is not intended as an - // escape character. - if( Character.isLetterOrDigit(d) ) { - dest.append( c ); - } - } - } - } - return new String(dest); - } - } - - /** - * Method which converts the Stringified name and Host Name Address into - * a URL based Name - * - * @param address which is ip based host name - * @param name which is the stringified name. - * @return url based Name. - */ - public String createURLBasedAddress( String address, String name ) - throws InvalidAddress - { - String theurl = null; - if( ( address == null ) - ||( address.length() == 0 ) ) { - throw new InvalidAddress(); - } - else { - theurl = "corbaname:" + address + "#" + encode( name ); - } - return theurl; - } - - /** Encodes the string according to RFC 2396 IETF spec required by INS. - */ - private String encode( String stringToEncode ) { - StringWriter theStringAfterEscape = new StringWriter(); - int byteCount = 0; - for( int i = 0; i < stringToEncode.length(); i++ ) - { - char c = stringToEncode.charAt( i ) ; - if( Character.isLetterOrDigit( c ) ) { - theStringAfterEscape.write( c ); - } - // Do no Escape for characters in this list - // RFC 2396 - else if((c == ';') || (c == '/') || (c == '?') - || (c == ':') || (c == '@') || (c == '&') || (c == '=') - || (c == '+') || (c == '$') || (c == ';') || (c == '-') - || (c == '_') || (c == '.') || (c == '!') || (c == '~') - || (c == '*') || (c == ' ') || (c == '(') || (c == ')') ) - { - theStringAfterEscape.write( c ); - } - else { - // Add escape - theStringAfterEscape.write( '%' ); - String hexString = Integer.toHexString( (int) c ); - theStringAfterEscape.write( hexString ); - } - } - return theStringAfterEscape.toString(); - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/InternalBindingKey.java b/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/InternalBindingKey.java deleted file mode 100644 index 8385c6c7676..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/InternalBindingKey.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.naming.cosnaming; - -import org.omg.CosNaming.NameComponent; - -/** - * Class InternalBindingKey implements the necessary wrapper code - * around the org.omg.CosNaming::NameComponent class to implement the proper - * equals() method and the hashCode() method for use in a hash table. - * It computes the hashCode once and stores it, and also precomputes - * the lengths of the id and kind strings for faster comparison. - */ -public class InternalBindingKey -{ - // A key contains a name - public NameComponent name; - private int idLen; - private int kindLen; - private int hashVal; - - // Default Constructor - public InternalBindingKey() {} - - // Normal constructor - public InternalBindingKey(NameComponent n) - { - idLen = 0; - kindLen = 0; - setup(n); - } - - // Setup the object - protected void setup(NameComponent n) { - this.name = n; - // Precompute lengths and values since they will not change - if( this.name.id != null ) { - idLen = this.name.id.length(); - } - if( this.name.kind != null ) { - kindLen = this.name.kind.length(); - } - hashVal = 0; - if (idLen > 0) - hashVal += this.name.id.hashCode(); - if (kindLen > 0) - hashVal += this.name.kind.hashCode(); - } - - // Compare the keys by comparing name's id and kind - public boolean equals(java.lang.Object o) { - if (o == null) - return false; - if (o instanceof InternalBindingKey) { - InternalBindingKey that = (InternalBindingKey)o; - // Both lengths must match - if (this.idLen != that.idLen || this.kindLen != that.kindLen) { - return false; - } - // If id is set is must be equal - if (this.idLen > 0 && this.name.id.equals(that.name.id) == false) { - return false; - } - // If kind is set it must be equal - if (this.kindLen > 0 && this.name.kind.equals(that.name.kind) == false) { - return false; - } - // Must be the same - return true; - } else { - return false; - } - } - // Return precomputed value - public int hashCode() { - return this.hashVal; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/InternalBindingValue.java b/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/InternalBindingValue.java deleted file mode 100644 index cf6322b2dd3..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/InternalBindingValue.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.naming.cosnaming; - -import org.omg.CORBA.Object; -import org.omg.CosNaming.Binding; -import org.omg.CosNaming.NameComponent; - -/** - * Class InternalBindingKey acts as a container for two objects, namely - * a org.omg.CosNaming::Binding and an CORBA object reference, which are the two - * components associated with the binding. - */ -public class InternalBindingValue -{ - public Binding theBinding; - public String strObjectRef; - public org.omg.CORBA.Object theObjectRef; - - // Default constructor - public InternalBindingValue() {} - - // Normal constructor - public InternalBindingValue(Binding b, String o) { - theBinding = b; - strObjectRef = o; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/NamingContextDataStore.java b/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/NamingContextDataStore.java deleted file mode 100644 index 042f3a997fe..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/NamingContextDataStore.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.naming.cosnaming; - -// Import general CORBA classes -import org.omg.CORBA.Object; - -// Import org.omg.CosNaming classes -import org.omg.CosNaming.BindingType; -import org.omg.CosNaming.BindingTypeHolder; -import org.omg.CosNaming.BindingListHolder; -import org.omg.CosNaming.BindingIteratorHolder; -import org.omg.CosNaming.NameComponent; -import org.omg.CosNaming.NamingContext; -import org.omg.PortableServer.POA; - -/** - * This interface defines a set of methods that must be implemented by the - * "data store" associated with a NamingContext implementation. - * It allows for different implementations of naming contexts that - * support the same API but differ in storage mechanism. - */ -public interface NamingContextDataStore { - /** - * Method which implements binding a name to an object as - * the specified binding type. - * @param n a NameComponent which is the name under which the object - * will be bound. - * @param obj the object reference to be bound. - * @param bt Type of binding (as object or as context). - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - */ - void Bind(NameComponent n, org.omg.CORBA.Object obj, BindingType bt) - throws org.omg.CORBA.SystemException; - - /** - * Method which implements resolving the specified name, - * returning the type of the binding and the bound object reference. - * If the id and kind of the NameComponent are both empty, the initial - * naming context (i.e., the local root) must be returned. - * @param n a NameComponent which is the name to be resolved. - * @param bth the BindingType as an out parameter. - * @return the object reference bound under the supplied name. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - */ - org.omg.CORBA.Object Resolve(NameComponent n,BindingTypeHolder bth) - throws org.omg.CORBA.SystemException; - - /** - * Method which implements unbinding a name. - * @return the object reference bound to the name, or null if not found. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - */ - org.omg.CORBA.Object Unbind(NameComponent n) - throws org.omg.CORBA.SystemException; - - /** - * Method which implements listing the contents of this - * NamingContext and return a binding list and a binding iterator. - * @param how_many The number of requested bindings in the BindingList. - * @param bl The BindingList as an out parameter. - * @param bi The BindingIterator as an out parameter. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - */ - void List(int how_many, BindingListHolder bl, BindingIteratorHolder bi) - throws org.omg.CORBA.SystemException; - - /** - * Method which implements creating a new NamingContext. - * @return an object reference for a new NamingContext object implemented - * by this Name Server. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - */ - NamingContext NewContext() - throws org.omg.CORBA.SystemException; - - /** - * Method which implements destroying this NamingContext. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - */ - void Destroy() - throws org.omg.CORBA.SystemException; - - /** - * Method which returns whether this NamingContext is empty - * or not. - * @return true if this NamingContext contains no bindings. - */ - boolean IsEmpty(); - - POA getNSPOA( ); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/NamingContextImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/NamingContextImpl.java deleted file mode 100644 index 3b2c19f3dd2..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/NamingContextImpl.java +++ /dev/null @@ -1,1025 +0,0 @@ -/* - * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.naming.cosnaming; - -// Imports for Logging -import java.util.logging.Logger; -import java.util.logging.Level; -import com.sun.corba.se.impl.orbutil.LogKeywords; - -// Import general CORBA classes -import org.omg.CORBA.Object; -import org.omg.CORBA.BAD_PARAM; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.CompletionStatus; -import org.omg.PortableServer.POA; -import org.omg.PortableServer.Servant; - -// Import org.omg.CosNaming classes -import org.omg.CosNaming.BindingType; -import org.omg.CosNaming.BindingTypeHolder; -import org.omg.CosNaming.BindingListHolder; -import org.omg.CosNaming.BindingIteratorHolder; -import org.omg.CosNaming.NameComponent; -import org.omg.CosNaming.NamingContextHelper; -import org.omg.CosNaming.NamingContext; -import org.omg.CosNaming.NamingContextPackage.*; -import org.omg.CosNaming._NamingContextImplBase; -import org.omg.CosNaming.NamingContextExtHelper; -import org.omg.CosNaming.NamingContextExt; -import org.omg.CosNaming.NamingContextExtPOA; -import org.omg.CosNaming.NamingContextExtPackage.*; -import org.omg.CosNaming.NamingContextPackage.NotFound; - -import com.sun.corba.se.impl.naming.cosnaming.NamingContextDataStore; - -import com.sun.corba.se.impl.naming.namingutil.INSURLHandler; -import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.impl.logging.NamingSystemException ; - -import com.sun.corba.se.spi.orb.ORB; - -/** - * Class NamingContextImpl implements the org.omg.CosNaming::NamingContext - * interface, but does not implement the methods associated with - * maintaining the "table" of current bindings in a NamingContext. - * Instead, this implementation assumes that the derived implementation - * implements the NamingContextDataStore interface, which has the necessary - * methods. This allows multiple - * NamingContext implementations that differ in storage of the bindings, - * as well as implementations of interfaces derived from - * CosNaming::NamingContext that still reuses the implementation. - *

            - * The operations bind(), rebind(), bind_context() and rebind_context() - * are all really implemented by doBind(). resolve() is really implemented - * by doResolve(), unbind() by doUnbind(). list(), new_context() and - * destroy() uses the NamingContextDataStore interface directly. All the - * doX() methods are public static. - * They synchronize on the NamingContextDataStore object. - *

            - * An implementation a NamingContext must extend this class and implement - * the NamingContextDataStore interface with the operations: - * Bind(), Resolve(), - * Unbind(), List(), NewContext() and Destroy(). Calls - * to these methods are synchronized; these methods should - * therefore not be synchronized. - */ -public abstract class NamingContextImpl - extends NamingContextExtPOA - implements NamingContextDataStore -{ - - protected POA nsPOA; - private Logger readLogger, updateLogger, lifecycleLogger; - private NamingSystemException wrapper ; - private static NamingSystemException staticWrapper = - NamingSystemException.get( CORBALogDomains.NAMING_UPDATE ) ; - - // The grammer for Parsing and Building Interoperable Stringified Names - // are implemented in this class - private InterOperableNamingImpl insImpl; - /** - * Create a naming context servant. - * Runs the super constructor. - * @param orb an ORB object. - * @exception java.lang.Exception a Java exception. - */ - public NamingContextImpl(ORB orb, POA poa) throws java.lang.Exception { - super(); - this.orb = orb; - wrapper = NamingSystemException.get( orb, - CORBALogDomains.NAMING_UPDATE ) ; - - insImpl = new InterOperableNamingImpl( ); - this.nsPOA = poa; - readLogger = orb.getLogger( CORBALogDomains.NAMING_READ); - updateLogger = orb.getLogger( CORBALogDomains.NAMING_UPDATE); - lifecycleLogger = orb.getLogger( - CORBALogDomains.NAMING_LIFECYCLE); - } - - public POA getNSPOA( ) { - return nsPOA; - } - - /** - * Bind an object under a name in this NamingContext. If the name - * contains multiple (n) components, n-1 will be resolved in this - * NamingContext and the object bound in resulting NamingContext. - * An exception is thrown if a binding with the supplied name already - * exists. If the - * object to be bound is a NamingContext it will not participate in - * a recursive resolve. - * @param n a sequence of NameComponents which is the name under which - * the object will be bound. - * @param obj the object reference to be bound. - * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with - * multiple components was supplied, but the first component could not be - * resolved. - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could - * not proceed in resolving the n-1 components of the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The - * supplied name is invalid (i.e., has length less than 1). - * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound An object - * is already bound under the supplied name. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA - * system exceptions. - * @see doBind - */ - public void bind(NameComponent[] n, org.omg.CORBA.Object obj) - throws org.omg.CosNaming.NamingContextPackage.NotFound, - org.omg.CosNaming.NamingContextPackage.CannotProceed, - org.omg.CosNaming.NamingContextPackage.InvalidName, - org.omg.CosNaming.NamingContextPackage.AlreadyBound - { - if( obj == null ) - { - updateLogger.warning( LogKeywords.NAMING_BIND + - " unsuccessful because NULL Object cannot be Bound " ); - throw wrapper.objectIsNull() ; - } - // doBind implements all four flavors of binding - NamingContextDataStore impl = (NamingContextDataStore)this; - doBind(impl,n,obj,false,BindingType.nobject); - if( updateLogger.isLoggable( Level.FINE ) ) { - // isLoggable call to make sure that we save some precious - // processor cycles, if there is no need to log. - updateLogger.fine( LogKeywords.NAMING_BIND_SUCCESS + " Name = " + - NamingUtils.getDirectoryStructuredName( n ) ); - } - } - - - /** - * Bind a NamingContext under a name in this NamingContext. If the name - * contains multiple (n) components, n-1 will be resolved in this - * NamingContext and the object bound in resulting NamingContext. - * An exception is thrown if a binding with the supplied name already - * exists. The NamingContext will participate in recursive resolving. - * @param n a sequence of NameComponents which is the name under which - * the object will be bound. - * @param nc the NamingContext object reference to be bound. - * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with - * multiple components was supplied, but the first component could not be - * resolved. - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could - * not proceed in resolving the n-1 components of the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The - * supplied name is invalid (i.e., has length less than 1). - * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound An object - * is already bound under the supplied name. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA - * system exceptions. - * @see doBind - */ - public void bind_context(NameComponent[] n, NamingContext nc) - throws org.omg.CosNaming.NamingContextPackage.NotFound, - org.omg.CosNaming.NamingContextPackage.CannotProceed, - org.omg.CosNaming.NamingContextPackage.InvalidName, - org.omg.CosNaming.NamingContextPackage.AlreadyBound - { - if( nc == null ) { - updateLogger.warning( LogKeywords.NAMING_BIND_FAILURE + - " NULL Context cannot be Bound " ); - throw new BAD_PARAM( "Naming Context should not be null " ); - } - // doBind implements all four flavors of binding - NamingContextDataStore impl = (NamingContextDataStore)this; - doBind(impl,n,nc,false,BindingType.ncontext); - if( updateLogger.isLoggable( Level.FINE ) ) { - // isLoggable call to make sure that we save some precious - // processor cycles, if there is no need to log. - updateLogger.fine( LogKeywords.NAMING_BIND_SUCCESS + " Name = " + - NamingUtils.getDirectoryStructuredName( n ) ); - } - } - - /** - * Bind an object under a name in this NamingContext. If the name - * contains multiple (n) components, n-1 will be resolved in this - * NamingContext and the object bound in resulting NamingContext. - * If a binding under the supplied name already exists it will be - * unbound first. If the - * object to be bound is a NamingContext it will not participate in - * a recursive resolve. - * @param n a sequence of NameComponents which is the name under which - * the object will be bound. - * @param obj the object reference to be bound. - * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with - * multiple components was supplied, but the first component could not be - * resolved. - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not - * proceed in resolving the n-1 components of the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The - * supplied name is invalid (i.e., has length less than 1). - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA - * system exceptions. - * @see doBind - */ - public void rebind(NameComponent[] n, org.omg.CORBA.Object obj) - throws org.omg.CosNaming.NamingContextPackage.NotFound, - org.omg.CosNaming.NamingContextPackage.CannotProceed, - org.omg.CosNaming.NamingContextPackage.InvalidName - { - if( obj == null ) - { - updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE + - " NULL Object cannot be Bound " ); - throw wrapper.objectIsNull() ; - } - try { - // doBind implements all four flavors of binding - NamingContextDataStore impl = (NamingContextDataStore)this; - doBind(impl,n,obj,true,BindingType.nobject); - } catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound ex) { - updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE + - NamingUtils.getDirectoryStructuredName( n ) + - " is already bound to a Naming Context" ); - // This should not happen - throw wrapper.namingCtxRebindAlreadyBound( ex ) ; - } - if( updateLogger.isLoggable( Level.FINE ) ) { - // isLoggable call to make sure that we save some precious - // processor cycles, if there is no need to log. - updateLogger.fine( LogKeywords.NAMING_REBIND_SUCCESS + " Name = " + - NamingUtils.getDirectoryStructuredName( n ) ); - } - } - - /** - * Bind a NamingContext under a name in this NamingContext. If the name - * contains multiple (n) components, the first n-1 components will be - * resolved in this NamingContext and the object bound in resulting - * NamingContext. If a binding under the supplied name already exists it - * will be unbound first. The NamingContext will participate in recursive - * resolving. - * @param n a sequence of NameComponents which is the name under which - * the object will be bound. - * @param nc the object reference to be bound. - * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with - * multiple components was supplied, but the first component could not be - * resolved. - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not - * proceed in resolving the n-1 components of the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The - * supplied name is invalid (i.e., has length less than 1). - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA - * system exceptions. - * @see doBind - */ - public void rebind_context(NameComponent[] n, NamingContext nc) - throws org.omg.CosNaming.NamingContextPackage.NotFound, - org.omg.CosNaming.NamingContextPackage.CannotProceed, - org.omg.CosNaming.NamingContextPackage.InvalidName - { - if( nc == null ) - { - updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE + - " NULL Context cannot be Bound " ); - throw wrapper.objectIsNull() ; - } - try { - // doBind implements all four flavors of binding - NamingContextDataStore impl = (NamingContextDataStore)this; - doBind(impl,n,nc,true,BindingType.ncontext); - } catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound ex) { - // This should not happen - updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE + - NamingUtils.getDirectoryStructuredName( n ) + - " is already bound to a CORBA Object" ); - throw wrapper.namingCtxRebindctxAlreadyBound( ex ) ; - } - if( updateLogger.isLoggable( Level.FINE ) ) { - // isLoggable call to make sure that we save some precious - // processor cycles, if there is no need to log. - updateLogger.fine( LogKeywords.NAMING_REBIND_SUCCESS + " Name = " + - NamingUtils.getDirectoryStructuredName( n ) ); - } - } - - /** - * Resolve a name in this NamingContext and return the object reference - * bound to the name. If the name contains multiple (n) components, - * the first component will be resolved in this NamingContext and the - * remaining components resolved in the resulting NamingContext, provided - * that the NamingContext bound to the first component of the name was - * bound with bind_context(). - * @param n a sequence of NameComponents which is the name to be resolved. - * @return the object reference bound under the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with - * multiple components was supplied, but the first component could not be - * resolved. - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not - * proceed in resolving the n-1 components of the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The - * supplied name is invalid (i.e., has length less than 1). - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA - * system exceptions. - * @see doResolve - */ - public org.omg.CORBA.Object resolve(NameComponent[] n) - throws org.omg.CosNaming.NamingContextPackage.NotFound, - org.omg.CosNaming.NamingContextPackage.CannotProceed, - org.omg.CosNaming.NamingContextPackage.InvalidName - { - // doResolve actually resolves - NamingContextDataStore impl = (NamingContextDataStore)this; - org.omg.CORBA.Object obj = doResolve(impl,n); - if( obj != null ) { - if( readLogger.isLoggable( Level.FINE ) ) { - readLogger.fine( LogKeywords.NAMING_RESOLVE_SUCCESS + - " Name: " + NamingUtils.getDirectoryStructuredName( n ) ); - } - } else { - readLogger.warning( LogKeywords.NAMING_RESOLVE_FAILURE + - " Name: " + NamingUtils.getDirectoryStructuredName( n ) ); - } - return obj; - } - - - /** - * Remove a binding from this NamingContext. If the name contains - * multiple (n) components, the first n-1 components will be resolved - * from this NamingContext and the final component unbound in - * the resulting NamingContext. - * @param n a sequence of NameComponents which is the name to be unbound. - * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with - * multiple components was supplied, but the first component could not be - * resolved. - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not - * proceed in resolving the n-1 components of the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The - * supplied name is invalid (i.e., has length less than 1). - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA - * system exceptions. - * @see doUnbind - */ - public void unbind(NameComponent[] n) - throws org.omg.CosNaming.NamingContextPackage.NotFound, - org.omg.CosNaming.NamingContextPackage.CannotProceed, - org.omg.CosNaming.NamingContextPackage.InvalidName - { - // doUnbind actually unbinds - NamingContextDataStore impl = (NamingContextDataStore)this; - doUnbind(impl,n); - if( updateLogger.isLoggable( Level.FINE ) ) { - // isLoggable call to make sure that we save some precious - // processor cycles, if there is no need to log. - updateLogger.fine( LogKeywords.NAMING_UNBIND_SUCCESS + - " Name: " + NamingUtils.getDirectoryStructuredName( n ) ); - } - } - - /** - * List the contents of this NamingContest. A sequence of bindings - * is returned (a BindingList) containing up to the number of requested - * bindings, and a BindingIterator object reference is returned for - * iterating over the remaining bindings. - * @param how_many The number of requested bindings in the BindingList. - * @param bl The BindingList as an out parameter. - * @param bi The BindingIterator as an out parameter. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA - * system exceptions. - * @see BindingListHolder - * @see BindingIteratorImpl - */ - public void list(int how_many, BindingListHolder bl, - BindingIteratorHolder bi) - { - // List actually generates the list - NamingContextDataStore impl = (NamingContextDataStore)this; - synchronized (impl) { - impl.List(how_many,bl,bi); - } - if( readLogger.isLoggable( Level.FINE ) && (bl.value != null )) { - // isLoggable call to make sure that we save some precious - // processor cycles, if there is no need to log. - readLogger.fine ( LogKeywords.NAMING_LIST_SUCCESS + - "list(" + how_many + ") -> bindings[" + bl.value.length + - "] + iterator: " + bi.value); - } - } - - /** - * Create a NamingContext object and return its object reference. - * @return an object reference for a new NamingContext object implemented - * by this Name Server. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA - * system exceptions. - */ - public synchronized NamingContext new_context() - { - // Create actually creates a new naming context - lifecycleLogger.fine( "Creating New Naming Context " ); - NamingContextDataStore impl = (NamingContextDataStore)this; - synchronized (impl) { - NamingContext nctx = impl.NewContext(); - if( nctx != null ) { - lifecycleLogger.fine( LogKeywords.LIFECYCLE_CREATE_SUCCESS ); - } else { - // If naming context is null, then that must be a serious - // error. - lifecycleLogger.severe ( LogKeywords.LIFECYCLE_CREATE_FAILURE ); - } - return nctx; - } - } - - /** - * Create a new NamingContext, bind it in this Naming Context and return - * its object reference. This is equivalent to using new_context() followed - * by bind_context() with the supplied name and the object reference for - * the newly created NamingContext. - * @param n a sequence of NameComponents which is the name to be unbound. - * @return an object reference for a new NamingContext object implemented - * by this Name Server, bound to the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound An object - * is already bound under the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with - * multiple components was supplied, but the first component could not be - * resolved. - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not - * proceed in resolving the n-1 components of the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The - * supplied name is invalid (i.e., has length less than 1). - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA - * system exceptions. - * @see new_context - * @see bind_context - */ - public NamingContext bind_new_context(NameComponent[] n) - throws org.omg.CosNaming.NamingContextPackage.NotFound, - org.omg.CosNaming.NamingContextPackage.AlreadyBound, - org.omg.CosNaming.NamingContextPackage.CannotProceed, - org.omg.CosNaming.NamingContextPackage.InvalidName - { - NamingContext nc = null; - NamingContext rnc = null; - try { - if (debug) - dprint("bind_new_context " + nameToString(n)); - // The obvious solution: - nc = this.new_context(); - this.bind_context(n,nc); - rnc = nc; - nc = null; - } finally { - try { - if(nc != null) - nc.destroy(); - } catch (org.omg.CosNaming.NamingContextPackage.NotEmpty e) { - } - } - if( updateLogger.isLoggable( Level.FINE ) ) { - // isLoggable call to make sure that we save some precious - // processor cycles, if there is no need to log. - updateLogger.fine ( LogKeywords.NAMING_BIND + - "New Context Bound To " + - NamingUtils.getDirectoryStructuredName( n ) ); - } - return rnc; - } - - /** - * Destroy this NamingContext object. If this NamingContext contains - * no bindings, the NamingContext is deleted. - * @exception org.omg.CosNaming.NamingContextPackage.NotEmpty This - * NamingContext is not empty (i.e., contains bindings). - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA - * system exceptions. - */ - public void destroy() - throws org.omg.CosNaming.NamingContextPackage.NotEmpty - { - lifecycleLogger.fine( "Destroying Naming Context " ); - NamingContextDataStore impl = (NamingContextDataStore)this; - synchronized (impl) { - if (impl.IsEmpty() == true) { - // The context is empty so it can be destroyed - impl.Destroy(); - lifecycleLogger.fine ( LogKeywords.LIFECYCLE_DESTROY_SUCCESS ); - } - else { - // This context is not empty! - // Not a fatal error, warning should do. - lifecycleLogger.warning( LogKeywords.LIFECYCLE_DESTROY_FAILURE + - " NamingContext children are not destroyed still.." ); - throw new NotEmpty(); - } - } - } - - /** - * Implements all four flavors of binding. It uses Resolve() to - * check if a binding already exists (for bind and bind_context), and - * unbind() to ensure that a binding does not already exist. - * If the length of the name is 1, then Bind() is called with - * the name and the object to bind. Otherwise, the first component - * of the name is resolved in this NamingContext and the appropriate - * form of bind passed to the resulting NamingContext. - * This method is static for maximal reuse - even for extended naming - * context implementations where the recursive semantics still apply. - * @param impl an implementation of NamingContextDataStore - * @param n a sequence of NameComponents which is the name under which - * the object will be bound. - * @param obj the object reference to be bound. - * @param rebind Replace an existing binding or not. - * @param bt Type of binding (as object or as context). - * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with - * multiple components was supplied, but the first component could not be - * resolved. - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not * proceed - * in resolving the first component of the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The - * supplied name is invalid (i.e., has length less than 1). - * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound An object - * is already bound under the supplied name. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA - * system exceptions. - * @see resolve - * @see unbind - * @see bind - * @see bind_context - * @see rebind - * @see rebind_context - */ - public static void doBind(NamingContextDataStore impl, - NameComponent[] n, - org.omg.CORBA.Object obj, - boolean rebind, - org.omg.CosNaming.BindingType bt) - throws org.omg.CosNaming.NamingContextPackage.NotFound, - org.omg.CosNaming.NamingContextPackage.CannotProceed, - org.omg.CosNaming.NamingContextPackage.InvalidName, - org.omg.CosNaming.NamingContextPackage.AlreadyBound - { - // Valid name? - if (n.length < 1) - throw new InvalidName(); - - // At bottom level? - if (n.length == 1) { - // The identifier must be set - if ( (n[0].id.length() == 0) && (n[0].kind.length() == 0 ) ) { - throw new InvalidName(); - } - - // Ensure synchronization of backend - synchronized (impl) { - // Yes: bind object in this context under the name - BindingTypeHolder bth = new BindingTypeHolder(); - if (rebind) { - org.omg.CORBA.Object objRef = impl.Resolve( n[0], bth ); - if( objRef != null ) { - // Refer Naming Service Doc:00-11-01 section 2.2.3.4 - // If there is an object already bound with the name - // and the binding type is not ncontext a NotFound - // Exception with a reason of not a context has to be - // raised. - // Fix for bug Id: 4384628 - if ( bth.value.value() == BindingType.nobject.value() ){ - if ( bt.value() == BindingType.ncontext.value() ) { - throw new NotFound( - NotFoundReason.not_context, n); - } - } else { - // Previously a Context was bound and now trying to - // bind Object. It is invalid. - if ( bt.value() == BindingType.nobject.value() ) { - throw new NotFound( - NotFoundReason.not_object, n); - } - } - impl.Unbind(n[0]); - } - - } else { - if (impl.Resolve(n[0],bth) != null) - // "Resistence is futile." [Borg pickup line] - throw new AlreadyBound(); - } - - // Now there are no other bindings under this name - impl.Bind(n[0],obj,bt); - } - } else { - // No: bind in a different context - NamingContext context = resolveFirstAsContext(impl,n); - - // Compute tail - NameComponent[] tail = new NameComponent[n.length - 1]; - System.arraycopy(n,1,tail,0,n.length-1); - - // How should we propagate the bind - switch (bt.value()) { - case BindingType._nobject: - { - // Bind as object - if (rebind) - context.rebind(tail,obj); - else - context.bind(tail,obj); - } - break; - case BindingType._ncontext: - { - // Narrow to a naming context using Java casts. It must - // work. - NamingContext objContext = (NamingContext)obj; - // Bind as context - if (rebind) - context.rebind_context(tail,objContext); - else - context.bind_context(tail,objContext); - } - break; - default: - // This should not happen - throw staticWrapper.namingCtxBadBindingtype() ; - } - } - } - - /** - * Implements resolving names in this NamingContext. The first component - * of the supplied name is resolved in this NamingContext by calling - * Resolve(). If there are no more components in the name, the - * resulting object reference is returned. Otherwise, the resulting object - * reference must have been bound as a context and be narrowable to - * a NamingContext. If this is the case, the remaining - * components of the name is resolved in the resulting NamingContext. - * This method is static for maximal reuse - even for extended naming - * context implementations where the recursive semantics still apply. - * @param impl an implementation of NamingContextDataStore - * @param n a sequence of NameComponents which is the name to be resolved. - * @return the object reference bound under the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with - * multiple components was supplied, but the first component could not be - * resolved. - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not - * proceed - * in resolving the first component of the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The supplied - * name is invalid (i.e., has length less than 1). - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system - * exceptions. - * @see resolve - */ - public static org.omg.CORBA.Object doResolve(NamingContextDataStore impl, - NameComponent[] n) - throws org.omg.CosNaming.NamingContextPackage.NotFound, - org.omg.CosNaming.NamingContextPackage.CannotProceed, - org.omg.CosNaming.NamingContextPackage.InvalidName - { - org.omg.CORBA.Object obj = null; - BindingTypeHolder bth = new BindingTypeHolder(); - - - // Length must be greater than 0 - if (n.length < 1) - throw new InvalidName(); - - // The identifier must be set - if (n.length == 1) { - synchronized (impl) { - // Resolve first level in this context - obj = impl.Resolve(n[0],bth); - } - if (obj == null) { - // Object was not found - throw new NotFound(NotFoundReason.missing_node,n); - } - return obj; - } else { - // n.length > 1 - if ( (n[1].id.length() == 0) && (n[1].kind.length() == 0) ) { - throw new InvalidName(); - } - - NamingContext context = resolveFirstAsContext(impl,n); - - // Compute restOfName = name[1..length] - NameComponent[] tail = new NameComponent[n.length -1]; - System.arraycopy(n,1,tail,0,n.length-1); - - // Resolve rest of name in context - try { - // First try to resolve using the local call, this should work - // most of the time unless there are federated naming contexts. - Servant servant = impl.getNSPOA().reference_to_servant( - context ); - return doResolve(((NamingContextDataStore)servant), tail) ; - } catch( Exception e ) { - return context.resolve(tail); - } - } - } - - /** - * Implements unbinding bound names in this NamingContext. If the - * name contains only one component, the name is unbound in this - * NamingContext using Unbind(). Otherwise, the first component - * of the name is resolved in this NamingContext and - * unbind passed to the resulting NamingContext. - * This method is static for maximal reuse - even for extended naming - * context implementations where the recursive semantics still apply. - * @param impl an implementation of NamingContextDataStore - * @param n a sequence of NameComponents which is the name to be unbound. - * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with multiple - * components was supplied, but the first component could not be - * resolved. - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not proceed - * in resolving the n-1 components of the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The supplied name - * is invalid (i.e., has length less than 1). - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - * @see resolve - */ - public static void doUnbind(NamingContextDataStore impl, - NameComponent[] n) - throws org.omg.CosNaming.NamingContextPackage.NotFound, - org.omg.CosNaming.NamingContextPackage.CannotProceed, - org.omg.CosNaming.NamingContextPackage.InvalidName - { - // Name valid? - if (n.length < 1) - throw new InvalidName(); - - // Unbind here? - if (n.length == 1) { - // The identifier must be set - if ( (n[0].id.length() == 0) && (n[0].kind.length() == 0 ) ) { - throw new InvalidName(); - } - - org.omg.CORBA.Object objRef = null; - synchronized (impl) { - // Yes: unbind in this context - objRef = impl.Unbind(n[0]); - } - - if (objRef == null) - // It was not bound - throw new NotFound(NotFoundReason.missing_node,n); - // Done - return; - } else { - // No: unbind in a different context - - // Resolve first - must be resolveable - NamingContext context = resolveFirstAsContext(impl,n); - - // Compute tail - NameComponent[] tail = new NameComponent[n.length - 1]; - System.arraycopy(n,1,tail,0,n.length-1); - - // Propagate unbind to this context - context.unbind(tail); - } - } - - /** - * Implements resolving a NameComponent in this context and - * narrowing it to CosNaming::NamingContext. It will throw appropriate - * exceptions if not found or not narrowable. - * @param impl an implementation of NamingContextDataStore - * @param n a NameComponents which is the name to be found. - * @exception org.omg.CosNaming.NamingContextPackage.NotFound The - * first component could not be resolved. - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not proceed - * in resolving the first component of the supplied name. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - * @see resolve - */ - protected static NamingContext resolveFirstAsContext(NamingContextDataStore impl, - NameComponent[] n) - throws org.omg.CosNaming.NamingContextPackage.NotFound { - org.omg.CORBA.Object topRef = null; - BindingTypeHolder bth = new BindingTypeHolder(); - NamingContext context = null; - - synchronized (impl) { - // Resolve first - must be resolveable - topRef = impl.Resolve(n[0],bth); - if (topRef == null) { - // It was not bound - throw new NotFound(NotFoundReason.missing_node,n); - } - } - - // Was it bound as a context? - if (bth.value != BindingType.ncontext) { - // It was not a context - throw new NotFound(NotFoundReason.not_context,n); - } - - // Narrow to a naming context - try { - context = NamingContextHelper.narrow(topRef); - } catch (org.omg.CORBA.BAD_PARAM ex) { - // It was not a context - throw new NotFound(NotFoundReason.not_context,n); - } - - // Hmm. must be ok - return context; - } - - - /** - * This operation creates a stringified name from the array of Name - * components. - * @param n Name of the object - * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName - * Indicates the name does not identify a binding. - */ - public String to_string(org.omg.CosNaming.NameComponent[] n) - throws org.omg.CosNaming.NamingContextPackage.InvalidName - { - // Name valid? - if ( (n == null ) || (n.length == 0) ) - { - throw new InvalidName(); - } - NamingContextDataStore impl = (NamingContextDataStore)this; - - String theStringifiedName = insImpl.convertToString( n ); - - if( theStringifiedName == null ) - { - throw new InvalidName(); - } - - return theStringifiedName; - } - - - /** - * This operation converts a Stringified Name into an equivalent array - * of Name Components. - * @param sn Stringified Name of the object - * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName - * Indicates the name does not identify a binding. - */ - public org.omg.CosNaming.NameComponent[] to_name(String sn) - throws org.omg.CosNaming.NamingContextPackage.InvalidName - { - // Name valid? - if ( (sn == null ) || (sn.length() == 0) ) - { - throw new InvalidName(); - } - NamingContextDataStore impl = (NamingContextDataStore)this; - org.omg.CosNaming.NameComponent[] theNameComponents = - insImpl.convertToNameComponent( sn ); - if( ( theNameComponents == null ) || (theNameComponents.length == 0 ) ) - { - throw new InvalidName(); - } - for( int i = 0; i < theNameComponents.length; i++ ) { - // If there is a name component whose id and kind null or - // zero length string, then an invalid name exception needs to be - // raised. - if ( ( ( theNameComponents[i].id == null ) - ||( theNameComponents[i].id.length() == 0 ) ) - &&( ( theNameComponents[i].kind == null ) - ||( theNameComponents[i].kind.length() == 0 ) ) ) { - throw new InvalidName(); - } - } - return theNameComponents; - } - - /** - * This operation creates a URL based "iiopname://" format name - * from the Stringified Name of the object. - * @param addr internet based address of the host machine where - * Name Service is running - * @param sn Stringified Name of the object - * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName - * Indicates the name does not identify a binding. - * @exception org.omg.CosNaming.NamingContextPackage.InvalidAddress - * Indicates the internet based address of the host machine is - * incorrect - */ - - public String to_url(String addr, String sn) - throws org.omg.CosNaming.NamingContextExtPackage.InvalidAddress, - org.omg.CosNaming.NamingContextPackage.InvalidName - { - // Name valid? - if ( (sn == null ) || (sn.length() == 0) ) - { - throw new InvalidName(); - } - if( addr == null ) - { - throw new - org.omg.CosNaming.NamingContextExtPackage.InvalidAddress(); - } - NamingContextDataStore impl = (NamingContextDataStore)this; - String urlBasedAddress = null; - urlBasedAddress = insImpl.createURLBasedAddress( addr, sn ); - // Extra check to see that corba name url created is valid as per - // INS spec grammer. - try { - INSURLHandler.getINSURLHandler( ).parseURL( urlBasedAddress ); - } catch( BAD_PARAM e ) { - throw new - org.omg.CosNaming.NamingContextExtPackage.InvalidAddress(); - } - return urlBasedAddress; - } - - /** - * This operation resolves the Stringified name into the object - * reference. - * @param sn Stringified Name of the object - * @exception org.omg.CosNaming.NamingContextPackage.NotFound - * Indicates there is no object reference for the given name. - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed - * Indicates that the given compound name is incorrect - * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName - * Indicates the name does not identify a binding. - * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound - * Indicates the name is already bound. - * - */ - public org.omg.CORBA.Object resolve_str(String sn) - throws org.omg.CosNaming.NamingContextPackage.NotFound, - org.omg.CosNaming.NamingContextPackage.CannotProceed, - org.omg.CosNaming.NamingContextPackage.InvalidName - { - org.omg.CORBA.Object theObject = null; - // Name valid? - if ( (sn == null ) || (sn.length() == 0) ) - { - throw new InvalidName(); - } - NamingContextDataStore impl = (NamingContextDataStore)this; - org.omg.CosNaming.NameComponent[] theNameComponents = - insImpl.convertToNameComponent( sn ); - - if( ( theNameComponents == null ) || (theNameComponents.length == 0 ) ) - { - throw new InvalidName(); - } - theObject = resolve( theNameComponents ); - return theObject; - } - - - transient protected ORB orb; - - public static String nameToString(NameComponent[] name) - { - StringBuffer s = new StringBuffer("{"); - if (name != null || name.length > 0) { - for (int i=0;i0) - s.append(","); - s.append("["). - append(name[i].id). - append(","). - append(name[i].kind). - append("]"); - } - } - s.append("}"); - return s.toString(); - } - - // Debugging aids. - public static final boolean debug = false; - - private static void dprint(String msg) { - NamingUtils.dprint("NamingContextImpl(" + - Thread.currentThread().getName() + " at " + - System.currentTimeMillis() + - " ems): " + msg); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/NamingUtils.java b/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/NamingUtils.java deleted file mode 100644 index d141d4d4967..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/NamingUtils.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.naming.cosnaming; - -import java.io.*; -import org.omg.CosNaming.NameComponent; - - -public class NamingUtils { - // Do not instantiate this class - private NamingUtils() {}; - - /** - * Debug flag which must be true for debug streams to be created and - * dprint output to be generated. - */ - public static boolean debug = false; - - /** - * Prints the message to the debug stream if debugging is enabled. - * @param msg the debug message to print. - */ - public static void dprint(String msg) { - if (debug && debugStream != null) - debugStream.println(msg); - } - - /** - * Prints the message to the error stream (System.err is default). - * @param msg the error message to print. - */ - public static void errprint(String msg) { - if (errStream != null) - errStream.println(msg); - else - System.err.println(msg); - } - - /** - * Prints the stacktrace of the supplied exception to the error stream. - * @param e any Java exception. - */ - public static void printException(java.lang.Exception e) { - if (errStream != null) - e.printStackTrace(errStream); - else - e.printStackTrace(); - } - - /** - * Create a debug print stream to the supplied log file. - * @param logFile the file to which debug output will go. - * @exception IOException thrown if the file cannot be opened for output. - */ - public static void makeDebugStream(File logFile) - throws java.io.IOException { - // Create an outputstream for debugging - java.io.OutputStream logOStream = - new java.io.FileOutputStream(logFile); - java.io.DataOutputStream logDStream = - new java.io.DataOutputStream(logOStream); - debugStream = new java.io.PrintStream(logDStream); - - // Emit first message - debugStream.println("Debug Stream Enabled."); - } - - /** - * Create a error print stream to the supplied file. - * @param errFile the file to which error messages will go. - * @exception IOException thrown if the file cannot be opened for output. - */ - public static void makeErrStream(File errFile) - throws java.io.IOException { - if (debug) { - // Create an outputstream for errors - java.io.OutputStream errOStream = - new java.io.FileOutputStream(errFile); - java.io.DataOutputStream errDStream = - new java.io.DataOutputStream(errOStream); - errStream = new java.io.PrintStream(errDStream); - dprint("Error stream setup completed."); - } - } - - - /** - * A utility method that takes Array of NameComponent and converts - * into a directory structured name in the format of /id1.kind1/id2.kind2.. - * This is used mainly for Logging. - */ - static String getDirectoryStructuredName( NameComponent[] name ) { - StringBuffer directoryStructuredName = new StringBuffer("/"); - for( int i = 0; i < name.length; i++ ) { - directoryStructuredName.append( name[i].id + "." + name[i].kind ); - } - return directoryStructuredName.toString( ); - } - - /** - * The debug printstream. - */ - public static java.io.PrintStream debugStream; - - /** - * The error printstream. - */ - public static java.io.PrintStream errStream; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/TransientBindingIterator.java b/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/TransientBindingIterator.java deleted file mode 100644 index 468a5339299..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/TransientBindingIterator.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.naming.cosnaming; - -// Import general CORBA classes -import org.omg.CORBA.SystemException; -import org.omg.CORBA.ORB; -import org.omg.PortableServer.POA; - -// Get org.omg.CosNaming Types -import org.omg.CosNaming.Binding; -import org.omg.CosNaming.BindingType; -import org.omg.CosNaming.BindingTypeHolder; -import org.omg.CosNaming.NameComponent; - -// Get base implementation -import com.sun.corba.se.impl.naming.cosnaming.NamingContextImpl; -import com.sun.corba.se.impl.naming.cosnaming.InternalBindingValue; - -// Get a hash table -import java.util.Hashtable; -import java.util.Enumeration; - -/** - * Class TransientBindingIterator implements the abstract methods - * defined by BindingIteratorImpl, to use with the TransientNamingContext - * implementation of the NamingContextImpl. The TransientBindingIterator - * implementation receives a hash table of InternalBindingValues, and uses - * an Enumeration to iterate over the contents of the hash table. - * @see BindingIteratorImpl - * @see TransientNamingContext - */ -public class TransientBindingIterator extends BindingIteratorImpl -{ - // There is only one POA used for both TransientNamingContext and - // TransientBindingIteraor servants. - private POA nsPOA; - /** - * Constructs a new TransientBindingIterator object. - * @param orb a org.omg.CORBA.ORB object. - * @param aTable A hashtable containing InternalBindingValues which is - * the content of the TransientNamingContext. - * @exception Exception a Java exception thrown of the base class cannot - * initialize. - */ - public TransientBindingIterator(ORB orb, Hashtable aTable, - POA thePOA ) - throws java.lang.Exception - { - super(orb); - theHashtable = aTable; - theEnumeration = this.theHashtable.elements(); - currentSize = this.theHashtable.size(); - this.nsPOA = thePOA; - } - - /** - * Returns the next binding in the NamingContext. Uses the enumeration - * object to determine if there are more bindings and if so, returns - * the next binding from the InternalBindingValue. - * @param b The Binding as an out parameter. - * @return true if there were more bindings. - */ - final public boolean NextOne(org.omg.CosNaming.BindingHolder b) - { - // If there are more elements get the next element - boolean hasMore = theEnumeration.hasMoreElements(); - if (hasMore) { - b.value = - ((InternalBindingValue)theEnumeration.nextElement()).theBinding; - currentSize--; - } else { - // Return empty but marshalable binding - b.value = new Binding(new NameComponent[0],BindingType.nobject); - } - return hasMore; - } - - /** - * Destroys this BindingIterator by disconnecting from the ORB - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA - * system exceptions. - */ - final public void Destroy() - { - // Remove the object from the Active Object Map. - try { - byte[] objectId = nsPOA.servant_to_id( this ); - if( objectId != null ) { - nsPOA.deactivate_object( objectId ); - } - } - catch( Exception e ) { - NamingUtils.errprint("BindingIterator.Destroy():caught exception:"); - NamingUtils.printException(e); - } - } - - /** - * Returns the remaining number of elements in the iterator. - * @return the remaining number of elements in the iterator. - */ - public final int RemainingElements() { - return currentSize; - } - - private int currentSize; - private Hashtable theHashtable; - private Enumeration theEnumeration; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/TransientNameServer.java b/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/TransientNameServer.java deleted file mode 100644 index c9e250fee94..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/TransientNameServer.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.naming.cosnaming; - -import java.util.Properties; -import java.net.InetAddress; - -import org.omg.CORBA.ORB; - -import org.omg.CosNaming.NamingContext; - -import com.sun.corba.se.spi.logging.CORBALogDomains; - -import com.sun.corba.se.impl.naming.cosnaming.TransientNameService; - -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.impl.orbutil.CorbaResourceUtil; -import com.sun.corba.se.impl.logging.NamingSystemException; - -/** - * Class TransientNameServer is a standalone application which - * implements a transient name service. It uses the TransientNameService - * class for the name service implementation, and the BootstrapServer - * for implementing bootstrapping, i.e., to get the initial NamingContext. - *

            - * The BootstrapServer uses a Properties object specify the initial service - * object references supported; such as Properties object is created containing - * only a "NameService" entry together with the stringified object reference - * for the initial NamingContext. The BootstrapServer's listening port - * is set by first checking the supplied arguments to the name server - * (-ORBInitialPort), and if not set, defaults to the standard port number. - * The BootstrapServer is created supplying the Properties object, using no - * external File object for storage, and the derived initial port number. - * @see TransientNameService - * @see BootstrapServer - */ -public class TransientNameServer -{ - static private boolean debug = false ; - static NamingSystemException wrapper = NamingSystemException.get( - CORBALogDomains.NAMING ) ; - - static public void trace( String msg ) { - if (debug) - System.out.println( msg ) ; - } - - static public void initDebug( String[] args ) { - // If debug was compiled to be true for testing purposes, - // don't change it. - if (debug) - return ; - - for (int ctr=0; ctr 0 ) { - initialPort = java.lang.Integer.parseInt(ips); - // -Dorg.omg.CORBA.ORBInitialPort=0 is invalid - if( initialPort == 0 ) { - orbInitialPort0 = true; - throw wrapper.transientNameServerBadPort() ; - } - } - String hostName = - System.getProperty( ORBConstants.INITIAL_HOST_PROPERTY ) ; - if( hostName != null ) { - invalidHostOption = true; - throw wrapper.transientNameServerBadHost() ; - } - } catch (java.lang.NumberFormatException e) { - // do nothing - } - - // Let arguments override - for (int i=0;i - * The TransientNameService creates the initial NamingContext object. - * @see NamingContextImpl - * @see BindingIteratorImpl - * @see TransientNamingContext - * @see TransientBindingIterator - */ -public class TransientNameService -{ - /** - * Constructs a new TransientNameService, and creates an initial - * NamingContext, whose object - * reference can be obtained by the initialNamingContext method. - * @param orb The ORB object - * @exception org.omg.CORBA.INITIALIZE Thrown if - * the TransientNameService cannot initialize. - */ - public TransientNameService(com.sun.corba.se.spi.orb.ORB orb ) - throws org.omg.CORBA.INITIALIZE - { - // Default constructor uses "NameService" as the key for the Root Naming - // Context. If default constructor is used then INS's object key for - // Transient Name Service is "NameService" - initialize( orb, "NameService" ); - } - - /** - * Constructs a new TransientNameService, and creates an initial - * NamingContext, whose object - * reference can be obtained by the initialNamingContext method. - * @param orb The ORB object - * @param serviceName Stringified key used for INS Service registry - * @exception org.omg.CORBA.INITIALIZE Thrown if - * the TransientNameService cannot initialize. - */ - public TransientNameService(com.sun.corba.se.spi.orb.ORB orb, - String serviceName ) throws org.omg.CORBA.INITIALIZE - { - // This constructor gives the flexibility of providing the Object Key - // for the Root Naming Context that is registered with INS. - initialize( orb, serviceName ); - } - - - /** - * This method initializes Transient Name Service by associating Root - * context with POA and registering the root context with INS Object Keymap. - */ - private void initialize( com.sun.corba.se.spi.orb.ORB orb, - String nameServiceName ) - throws org.omg.CORBA.INITIALIZE - { - NamingSystemException wrapper = NamingSystemException.get( orb, - CORBALogDomains.NAMING ) ; - - try { - POA rootPOA = (POA) orb.resolve_initial_references( - ORBConstants.ROOT_POA_NAME ); - rootPOA.the_POAManager().activate(); - - int i = 0; - Policy[] poaPolicy = new Policy[3]; - poaPolicy[i++] = rootPOA.create_lifespan_policy( - LifespanPolicyValue.TRANSIENT); - poaPolicy[i++] = rootPOA.create_id_assignment_policy( - IdAssignmentPolicyValue.SYSTEM_ID); - poaPolicy[i++] = rootPOA.create_servant_retention_policy( - ServantRetentionPolicyValue.RETAIN); - - POA nsPOA = rootPOA.create_POA( "TNameService", null, poaPolicy ); - nsPOA.the_POAManager().activate(); - - // Create an initial context - TransientNamingContext initialContext = - new TransientNamingContext(orb, null, nsPOA); - byte[] rootContextId = nsPOA.activate_object( initialContext ); - initialContext.localRoot = - nsPOA.id_to_reference( rootContextId ); - theInitialNamingContext = initialContext.localRoot; - orb.register_initial_reference( nameServiceName, - theInitialNamingContext ); - } catch (org.omg.CORBA.SystemException e) { - throw wrapper.transNsCannotCreateInitialNcSys( e ) ; - } catch (Exception e) { - throw wrapper.transNsCannotCreateInitialNc( e ) ; - } - } - - - /** - * Return the initial NamingContext. - * @return the object reference for the initial NamingContext. - */ - public org.omg.CORBA.Object initialNamingContext() - { - return theInitialNamingContext; - } - - - // The initial naming context for this name service - private org.omg.CORBA.Object theInitialNamingContext; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/TransientNamingContext.java b/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/TransientNamingContext.java deleted file mode 100644 index cef11cbfba6..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/TransientNamingContext.java +++ /dev/null @@ -1,357 +0,0 @@ -/* - * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.naming.cosnaming; - -// Import general CORBA classes -import org.omg.CORBA.SystemException; -import org.omg.CORBA.Object; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.ORB; -import org.omg.PortableServer.POA; - -// Import org.omg.CosNaming types -import org.omg.CosNaming.Binding; -import org.omg.CosNaming.BindingType; -import org.omg.CosNaming.BindingTypeHolder; -import org.omg.CosNaming.BindingListHolder; -import org.omg.CosNaming.BindingIteratorHolder; -import org.omg.CosNaming.NameComponent; -import org.omg.CosNaming.NamingContext; - -import java.util.logging.Logger; -import java.util.logging.Level; - -import java.util.Hashtable; -import com.sun.corba.se.impl.orbutil.LogKeywords; -import com.sun.corba.se.impl.logging.NamingSystemException; -import com.sun.corba.se.spi.logging.CORBALogDomains; - -/** - * Class TransientNamingContext implements the methods defined - * by NamingContextDataStore, and extends the NamingContextImpl class to - * provide a servant implementation of CosNaming::NamingContext. - * The TransientNamingContext uses a hash table - * to store the mappings between bindings and object references and the - * hash table is not persistent; thereby the name "transient". - * This class should not be used directly; instead, the class - * TransientNameService should be instantiated. - *

            - * The keys in the hash table are InternalBindingKey objects, containing - * a single NameComponent and implementing the proper functions, i.e., - * equals() and hashCode() in an efficient manner. The values in the hash - * table are InternalBindingValues and store a org.omg.CosNaming::Binding and - * the object reference associated with the binding. For iteration, - * TransientBindingIterator objects are created, which are passed a cloned - * copy of the hashtable. Since elements are inserted and deleted and - * never modified, this provides stable iterators at the cost of cloning - * the hash table. - *

            - * To create and destroy object references, the TransientNamingContext - * uses the orb.connect() and orb.disconnect() methods. - * - * @see NamingContextImpl - * @see NamingContextDataStore - * @see TransientBindingIterator - * @see TransientNameService - */ -public class TransientNamingContext extends NamingContextImpl implements NamingContextDataStore -{ - private Logger readLogger, updateLogger, lifecycleLogger; - - // XXX: the wrapper calls are all preceded by logger updates. - // These can be combined, and then we simply use 3 NamingSystemException wrappers, - // for read, update, and lifecycl. - private NamingSystemException wrapper ; - - /** - * Constructs a new TransientNamingContext object. - * @param orb an orb object. - * @param initial the initial naming context. - * @exception Exception a Java exception thrown of the base class cannot - * initialize. - */ - public TransientNamingContext(com.sun.corba.se.spi.orb.ORB orb, - org.omg.CORBA.Object initial, - POA nsPOA ) - throws java.lang.Exception - { - super(orb, nsPOA ); - wrapper = NamingSystemException.get( orb, CORBALogDomains.NAMING ) ; - - this.localRoot = initial; - readLogger = orb.getLogger( CORBALogDomains.NAMING_READ); - updateLogger = orb.getLogger( CORBALogDomains.NAMING_UPDATE); - lifecycleLogger = orb.getLogger( - CORBALogDomains.NAMING_LIFECYCLE); - lifecycleLogger.fine( "Root TransientNamingContext LIFECYCLE.CREATED" ); - } - - /** - * Binds the object to the name component as the specified binding type. - * It creates a InternalBindingKey object and a InternalBindingValue - * object and inserts them in the hash table. - * @param n A single org.omg.CosNaming::NameComponent under which the - * object will be bound. - * @param obj An object reference to be bound under the supplied name. - * @param bt The type of the binding (i.e., as object or as context). - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA - * system exceptions. - */ - public final void Bind(NameComponent n, org.omg.CORBA.Object obj, - BindingType bt) - throws org.omg.CORBA.SystemException - { - // Create a key and a value - InternalBindingKey key = new InternalBindingKey(n); - NameComponent[] name = new NameComponent[1]; - name[0] = n; - Binding b = new Binding(name,bt); - InternalBindingValue value = new InternalBindingValue(b,null); - value.theObjectRef = obj; - // insert it - InternalBindingValue oldValue = - (InternalBindingValue)this.theHashtable.put(key,value); - - if (oldValue != null) { - updateLogger.warning( LogKeywords.NAMING_BIND + "Name " + - getName( n ) + " Was Already Bound" ); - throw wrapper.transNcBindAlreadyBound() ; - } - if( updateLogger.isLoggable( Level.FINE ) ) { - updateLogger.fine( LogKeywords.NAMING_BIND_SUCCESS + - "Name Component: " + n.id + "." + n.kind ); - } - } - - /** - * Resolves the supplied name to an object reference and returns - * the type of the resolved binding. It creates a InternalBindingKey - * and uses the key for looking up in the hash table. If nothing - * is found an exception is thrown, otherwise the object reference - * is returned and the binding type set. - * @param n a NameComponent which is the name to be resolved. - * @param bth the BindingType as an out parameter. - * @return the object reference bound under the supplied name, null if not - * found. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA - * system exceptions. - */ - public final org.omg.CORBA.Object Resolve(NameComponent n, - BindingTypeHolder bth) - throws org.omg.CORBA.SystemException - { - // Is the initial naming context requested? - if ( (n.id.length() == 0) - &&(n.kind.length() == 0 ) ) - { - bth.value = BindingType.ncontext; - return localRoot; - } - - // Create a key and lookup the value - InternalBindingKey key = new InternalBindingKey(n); - - InternalBindingValue value = - (InternalBindingValue) this.theHashtable.get(key); - if (value == null) return null; - if( readLogger.isLoggable( Level.FINE ) ) { - readLogger.fine( LogKeywords.NAMING_RESOLVE_SUCCESS - + "Namecomponent :" + getName( n ) ); - } - - // Copy out binding type and object reference - bth.value = value.theBinding.binding_type; - return value.theObjectRef; - } - - /** - * Deletes the binding with the supplied name. It creates a - * InternalBindingKey and uses it to remove the value associated - * with the key. If nothing is found an exception is thrown, otherwise - * the element is removed from the hash table. - * @param n a NameComponent which is the name to unbind - * @return the object reference bound to the name, or null if not found. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA - * system exceptions. - */ - public final org.omg.CORBA.Object Unbind(NameComponent n) - throws org.omg.CORBA.SystemException - { - // Create a key and remove it from the hashtable - InternalBindingKey key = new InternalBindingKey(n); - InternalBindingValue value = - (InternalBindingValue)this.theHashtable.remove(key); - - // Return what was found - if (value == null) { - if( updateLogger.isLoggable( Level.FINE ) ) { - updateLogger.fine( LogKeywords.NAMING_UNBIND_FAILURE + - " There was no binding with the name " + getName( n ) + - " to Unbind " ); - } - return null; - } else { - if( updateLogger.isLoggable( Level.FINE ) ) { - updateLogger.fine( LogKeywords.NAMING_UNBIND_SUCCESS + - " NameComponent: " + getName( n ) ); - } - return value.theObjectRef; - } - } - - /** - * List the contents of this NamingContext. It creates a new - * TransientBindingIterator object and passes it a clone of the - * hash table and an orb object. It then uses the - * newly created object to return the required number of bindings. - * @param how_many The number of requested bindings in the BindingList. - * @param bl The BindingList as an out parameter. - * @param bi The BindingIterator as an out parameter. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA - * system exceptions. - */ - public final void List(int how_many, BindingListHolder bl, - BindingIteratorHolder bi) - throws org.omg.CORBA.SystemException - { - try { - // Create a new binding iterator servant with a copy of this - // hashtable. nsPOA is passed to the object so that it can - // de-activate itself from the Active Object Map when - // Binding Iterator.destroy is called. - TransientBindingIterator bindingIterator = - new TransientBindingIterator(this.orb, - (Hashtable)this.theHashtable.clone(), nsPOA); - // Have it set the binding list - bindingIterator.list(how_many,bl); - - byte[] objectId = nsPOA.activate_object( bindingIterator ); - org.omg.CORBA.Object obj = nsPOA.id_to_reference( objectId ); - - // Get the object reference for the binding iterator servant - org.omg.CosNaming.BindingIterator bindingRef = - org.omg.CosNaming.BindingIteratorHelper.narrow( obj ); - - bi.value = bindingRef; - } catch (org.omg.CORBA.SystemException e) { - readLogger.warning( LogKeywords.NAMING_LIST_FAILURE + e ); - throw e; - } catch (Exception e) { - // Convert to a CORBA system exception - readLogger.severe( LogKeywords.NAMING_LIST_FAILURE + e ); - throw wrapper.transNcListGotExc( e ) ; - } - } - - /** - * Create a new NamingContext. It creates a new TransientNamingContext - * object, passing it the orb object. - * @return an object reference for a new NamingContext object implemented - * by this Name Server. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA - * system exceptions. - */ - public final org.omg.CosNaming.NamingContext NewContext() - throws org.omg.CORBA.SystemException - { - try { - // Create a new servant - TransientNamingContext transContext = - new TransientNamingContext( - (com.sun.corba.se.spi.orb.ORB) orb,localRoot, nsPOA); - - byte[] objectId = nsPOA.activate_object( transContext ); - org.omg.CORBA.Object obj = nsPOA.id_to_reference( objectId ); - lifecycleLogger.fine( "TransientNamingContext " + - "LIFECYCLE.CREATE SUCCESSFUL" ); - return org.omg.CosNaming.NamingContextHelper.narrow( obj ); - - } catch (org.omg.CORBA.SystemException e) { - lifecycleLogger.log( - Level.WARNING, LogKeywords.LIFECYCLE_CREATE_FAILURE, e ); - throw e; - } catch (Exception e) { - lifecycleLogger.log( - Level.WARNING, LogKeywords.LIFECYCLE_CREATE_FAILURE, e ); - throw wrapper.transNcNewctxGotExc( e ) ; - } - } - - /** - * Destroys this NamingContext by disconnecting from the ORB. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA - * system exceptions. - */ - public final void Destroy() - throws org.omg.CORBA.SystemException - { - // Destroy the object reference by disconnecting from the ORB - try { - byte[] objectId = nsPOA.servant_to_id( this ); - if( objectId != null ) { - nsPOA.deactivate_object( objectId ); - } - if( lifecycleLogger.isLoggable( Level.FINE ) ) { - lifecycleLogger.fine( - LogKeywords.LIFECYCLE_DESTROY_SUCCESS ); - } - } catch (org.omg.CORBA.SystemException e) { - lifecycleLogger.log( Level.WARNING, - LogKeywords.LIFECYCLE_DESTROY_FAILURE, e ); - throw e; - } catch (Exception e) { - lifecycleLogger.log( Level.WARNING, - LogKeywords.LIFECYCLE_DESTROY_FAILURE, e ); - throw wrapper.transNcDestroyGotExc( e ) ; - } - } - - /** - * A Utility Method For Logging.. - */ - private String getName( NameComponent n ) { - return n.id + "." + n.kind; - } - - /** - * Return whether this NamingContext contains any bindings. It forwards - * this request to the hash table. - * @return true if this NamingContext contains no bindings. - */ - public final boolean IsEmpty() - { - return this.theHashtable.isEmpty(); - } - - // A hashtable to store the bindings - private final Hashtable theHashtable = new Hashtable(); - - /** - * The local root naming context. - */ - public org.omg.CORBA.Object localRoot; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/CorbalocURL.java b/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/CorbalocURL.java deleted file mode 100644 index eb911cd83ce..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/CorbalocURL.java +++ /dev/null @@ -1,288 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.naming.namingutil; - -import java.util.*; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.impl.logging.NamingSystemException ; - -/** - * The corbaloc: URL definitions from the -ORBInitDef and -ORBDefaultInitDef's - * will be parsed and converted to this object. This object is capable of - * storing multiple Host profiles as defined in the CorbaLoc grammer. - * - * @author Hemanth - */ -public class CorbalocURL extends INSURLBase -{ - static NamingSystemException wrapper = NamingSystemException.get( - CORBALogDomains.NAMING_READ ) ; - - /** - * This constructor parses the URL and initializes all the variables. Once - * the URL Object is constructed it is immutable. URL parameter is a - * corbaloc: URL string with 'corbaloc:' prefix stripped. - */ - public CorbalocURL( String aURL ) { - String url = aURL; - - if( url != null ) { - try { - // First Clean the URL Escapes if there are any - url = Utility.cleanEscapes( url ); - } catch( Exception e ) { - // There is something wrong with the URL escapes used - // so throw an exception - badAddress( e ); - } - int endIndex = url.indexOf( '/' ); - if( endIndex == -1 ) { - // If there is no '/' then the endIndex is at the end of the URL - endIndex = url.length(); - } - // _REVISIT_: Add a testcase to check 'corbaloc:/' - if( endIndex == 0 ) { - // The url starts with a '/', it's an error - badAddress( null ); - } - // Anything between corbaloc: and / is the host,port information - // of the server where the Service Object is located - StringTokenizer endpoints = new StringTokenizer( - url.substring( 0, endIndex ), "," ); - // NOTE: - // There should be atleast one token, because there are checks - // to make sure that there is host information before the - // delimiter '/'. So no need to explicitly check for number of - // tokens != 0 - while( endpoints.hasMoreTokens( ) ) { - String endpointInfo = endpoints.nextToken(); - IIOPEndpointInfo iiopEndpointInfo = null; - if( endpointInfo.startsWith( "iiop:" ) ) { - iiopEndpointInfo = handleIIOPColon( endpointInfo ); - } else if( endpointInfo.startsWith( "rir:" ) ) { - handleRIRColon( endpointInfo ); - rirFlag = true; - } else if( endpointInfo.startsWith( ":" ) ) { - iiopEndpointInfo = handleColon( endpointInfo ); - } else { - // Right now we are not allowing any other protocol - // other than iiop:, rir: so raise exception indicating - // that the URL is malformed - badAddress( null ); - } - if ( rirFlag == false ) { - // Add the Host information if RIR flag is set, - // If RIR is set then it means use the internal Boot - // Strap protocol for Key String resolution - if( theEndpointInfo == null ) { - theEndpointInfo = new java.util.ArrayList( ); - } - theEndpointInfo.add( iiopEndpointInfo ); - } - } - // If there is something after corbaloc:endpointInfo/ - // then that is the keyString - if( url.length() > (endIndex + 1) ) { - theKeyString = url.substring( endIndex + 1 ); - } - } - } - - - /** - * A Utility method to throw BAD_PARAM exception to signal malformed - * INS URL. - */ - private void badAddress( java.lang.Throwable e ) - { - throw wrapper.insBadAddress( e ) ; - } - - /** - * If there is 'iiop:' token in the URL, this method will parses - * and validates that host and port information. - */ - private IIOPEndpointInfo handleIIOPColon( String iiopInfo ) - { - // Check the iiop syntax - iiopInfo = iiopInfo.substring( NamingConstants.IIOP_LENGTH ); - return handleColon( iiopInfo ); - } - - - /** - * This is to handle the case of host information with no 'iiop:' prefix. - * instead if ':' is specified then iiop is assumed. - */ - private IIOPEndpointInfo handleColon( String iiopInfo ) { - // String after ":" - iiopInfo = iiopInfo.substring( 1 ); - String hostandport = iiopInfo; - // The format can be 1.2@: - StringTokenizer tokenizer = new StringTokenizer( iiopInfo, "@" ); - IIOPEndpointInfo iiopEndpointInfo = new IIOPEndpointInfo( ); - int tokenCount = tokenizer.countTokens( ); - // There can be 1 or 2 tokens with '@' as the delimiter - // - if there is only 1 token then there is no GIOP version - // information. A Default GIOP version of 1.2 is used. - // - if there are 2 tokens then there is GIOP version is specified - // - if there are no tokens or more than 2 tokens, then that's an - // error - if( ( tokenCount == 0 ) - ||( tokenCount > 2 )) - { - badAddress( null ); - } - if( tokenCount == 2 ) { - // There is VersionInformation after iiop: - String version = tokenizer.nextToken( ); - int dot = version.indexOf('.'); - // There is a version without ., which means - // Malformed list - if (dot == -1) { - badAddress( null ); - } - try { - iiopEndpointInfo.setVersion( - Integer.parseInt( version.substring( 0, dot )), - Integer.parseInt( version.substring(dot+1)) ); - hostandport = tokenizer.nextToken( ); - } catch( Throwable e ) { - badAddress( e ); - } - } - try { - // A Hack to differentiate IPV6 address - // from IPV4 address, Current Resolution - // is to use [ ] to differentiate ipv6 host - int squareBracketBeginIndex = hostandport.indexOf ( '[' ); - if( squareBracketBeginIndex != -1 ) { - // ipv6Host should be enclosed in - // [ ], if not it will result in a - // BAD_PARAM exception - String ipv6Port = getIPV6Port( hostandport ); - if( ipv6Port != null ) { - iiopEndpointInfo.setPort( Integer.parseInt( ipv6Port )); - } - iiopEndpointInfo.setHost( getIPV6Host( hostandport )); - return iiopEndpointInfo; - } - tokenizer = new StringTokenizer( hostandport, ":" ); - // There are three possible cases here - // 1. Host and Port is explicitly specified by using ":" as a - // a separator - // 2. Only Host is specified without the port - // 3. HostAndPort info is null - if( tokenizer.countTokens( ) == 2 ) { - // Case 1: There is Host and Port Info - iiopEndpointInfo.setHost( tokenizer.nextToken( ) ); - iiopEndpointInfo.setPort( Integer.parseInt( - tokenizer.nextToken( ))); - } else { - if( ( hostandport != null ) - &&( hostandport.length() != 0 ) ) - { - // Case 2: Only Host is specified. iiopEndpointInfo is - // initialized to use the default INS port, if no port is - // specified - iiopEndpointInfo.setHost( hostandport ); - } - // Case 3: If no Host and Port info is provided then we use the - // the default LocalHost and INSPort. iiopEndpointInfo is - // already initialized with this info. - } - } catch( Throwable e ) { - // Any kind of Exception is bad here. - // Possible causes: A Number Format exception because port info is - // malformed - badAddress( e ); - } - Utility.validateGIOPVersion( iiopEndpointInfo ); - return iiopEndpointInfo; - } - - /** - * Validate 'rir:' case. - */ - private void handleRIRColon( String rirInfo ) - { - if( rirInfo.length() != NamingConstants.RIRCOLON_LENGTH ) { - badAddress( null ); - } - } - - /** - * Returns an IPV6 Port that is after []:. There is no validation - * done here, if it is an incorrect port then the request through - * this URL results in a COMM_FAILURE, otherwise malformed list will - * result in BAD_PARAM exception thrown in checkcorbalocGrammer. - */ - private String getIPV6Port( String endpointInfo ) - { - int squareBracketEndIndex = endpointInfo.indexOf ( ']' ); - // If there is port information, then it has to be after ] bracket - // indexOf returns the count from the index of zero as the base, so - // equality check requires squareBracketEndIndex + 1. - if( (squareBracketEndIndex + 1) != (endpointInfo.length( )) ) { - if( endpointInfo.charAt( squareBracketEndIndex + 1 ) != ':' ) { - throw new RuntimeException( - "Host and Port is not separated by ':'" ); - } - // PortInformation should be after ']:' delimiter - // If there is an exception then it will be caught in - // checkcorbaGrammer method and rethrown as BAD_PARAM - return endpointInfo.substring( squareBracketEndIndex + 2 ); - } - return null; - } - - - /** - * Returns an IPV6 Host that is inside [ ] tokens. There is no validation - * done here, if it is an incorrect IPV6 address then the request through - * this URL results in a COMM_FAILURE, otherwise malformed list will - * result in BAD_PARAM exception thrown in checkcorbalocGrammer. - */ - private String getIPV6Host( String endpointInfo ) { - // ipv6Host should be enclosed in - // [ ], if not it will result in a - // BAD_PARAM exception - int squareBracketEndIndex = endpointInfo.indexOf ( ']' ); - // get the host between [ ] - String ipv6Host = endpointInfo.substring( 1, squareBracketEndIndex ); - return ipv6Host; - } - - /** - * Will be true only in CorbanameURL class. - */ - public boolean isCorbanameURL( ) { - return false; - } - - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/CorbanameURL.java b/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/CorbanameURL.java deleted file mode 100644 index 1ebae7192ad..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/CorbanameURL.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.naming.namingutil; - -import com.sun.corba.se.impl.logging.NamingSystemException; -import com.sun.corba.se.spi.logging.CORBALogDomains; - -/** - * The corbaname: URL definitions from the -ORBInitDef and -ORBDefaultInitDef's - * will be stored in this object. This object is capable of storing CorbaLoc - * profiles as defined in the CorbaName grammer. - * - * @author Hemanth - */ -public class CorbanameURL extends INSURLBase -{ - private static NamingSystemException wrapper = - NamingSystemException.get( CORBALogDomains.NAMING ) ; - - /** - * This constructor takes a corbaname: url with 'corbaname:' prefix stripped - * and initializes all the variables accordingly. If there are any parsing - * errors then BAD_PARAM exception is raised. - */ - public CorbanameURL( String aURL ) { - String url = aURL; - - // First Clean the URL Escapes if there are any - try { - url = Utility.cleanEscapes( url ); - } catch( Exception e ) { - badAddress( e ); - } - - int delimiterIndex = url.indexOf( '#' ); - String corbalocString = null; - if( delimiterIndex != -1 ) { - // Append corbaloc: for Grammar check, Get the string between - // corbaname: and # which forms the corbaloc string - corbalocString = "corbaloc:" + - url.substring( 0, delimiterIndex ) + "/"; - } else { - // Build a corbaloc string to check the grammar. - // 10 is the length of corbaname: - corbalocString = "corbaloc:" + url.substring( 0, url.length() ); - // If the string doesnot end with a / then add one to end the - // URL correctly - if( corbalocString.endsWith( "/" ) != true ) { - corbalocString = corbalocString + "/"; - } - } - try { - // Check the corbaloc grammar and set the returned corbaloc - // object to the CorbaName Object - INSURL insURL = - INSURLHandler.getINSURLHandler().parseURL( corbalocString ); - copyINSURL( insURL ); - // String after '#' is the Stringified name used to resolve - // the Object reference from the rootnaming context. If - // the String is null then the Root Naming context is passed - // back - if((delimiterIndex > -1) && - (delimiterIndex < (aURL.length() - 1))) - { - int start = delimiterIndex + 1 ; - String result = url.substring(start) ; - theStringifiedName = result ; - } - } catch( Exception e ) { - badAddress( e ); - } - } - - /** - * A Utility method to throw BAD_PARAM exception. - */ - private void badAddress( java.lang.Throwable e ) - throws org.omg.CORBA.BAD_PARAM - { - throw wrapper.insBadAddress( e ) ; - } - - /** - * A Utility method to copy all the variables from CorbalocURL object to - * this instance. - */ - private void copyINSURL( INSURL url ) { - rirFlag = url.getRIRFlag( ); - theEndpointInfo = (java.util.ArrayList) url.getEndpointInfo( ); - theKeyString = url.getKeyString( ); - theStringifiedName = url.getStringifiedName( ); - } - - public boolean isCorbanameURL( ) { - return true; - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/IIOPEndpointInfo.java b/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/IIOPEndpointInfo.java deleted file mode 100644 index 3cee5e8042c..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/IIOPEndpointInfo.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.naming.namingutil; - -import com.sun.corba.se.impl.orbutil.ORBConstants; - -/** - * EndpointInfo is used internally by CorbaLoc object to store the - * host information used in creating the Service Object reference - * from the -ORBInitDef and -ORBDefaultInitDef definitions. - * - * @author Hemanth - */ -public class IIOPEndpointInfo -{ - // Version information - private int major, minor; - - // Host Name and Port Number - private String host; - private int port; - - IIOPEndpointInfo( ) { - // Default IIOP Version - major = ORBConstants.DEFAULT_INS_GIOP_MAJOR_VERSION; - minor = ORBConstants.DEFAULT_INS_GIOP_MINOR_VERSION; - // Default host is localhost - host = ORBConstants.DEFAULT_INS_HOST; - // Default INS Port - port = ORBConstants.DEFAULT_INS_PORT; - } - - public void setHost( String theHost ) { - host = theHost; - } - - public String getHost( ) { - return host; - } - - public void setPort( int thePort ) { - port = thePort; - } - - public int getPort( ) { - return port; - } - - public void setVersion( int theMajor, int theMinor ) { - major = theMajor; - minor = theMinor; - } - - public int getMajor( ) { - return major; - } - - public int getMinor( ) { - return minor; - } - - /** Internal Debug Method. - */ - public void dump( ) { - System.out.println( " Major -> " + major + " Minor -> " + minor ); - System.out.println( "host -> " + host ); - System.out.println( "port -> " + port ); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/INSURL.java b/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/INSURL.java deleted file mode 100644 index a8f54f1b8d8..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/INSURL.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.naming.namingutil; - -/** - * INS URL is a generic interface for two different types of URL's specified - * in INS spec. - * - * @author Hemanth - */ -public interface INSURL { - public boolean getRIRFlag( ); - - // There can be one or more Endpoint's in the URL, so the return value is - // a List - public java.util.List getEndpointInfo( ); - - public String getKeyString( ); - - public String getStringifiedName( ); - - // This method will return true only in CorbanameURL, It is provided because - // corbaname: URL needs special handling. - public boolean isCorbanameURL( ); - - // A debug method, which is not required for normal operation - public void dPrint( ); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/INSURLBase.java b/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/INSURLBase.java deleted file mode 100644 index 72471cf7f3d..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/INSURLBase.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.naming.namingutil; - -/** The corbaloc: URL definitions from the -ORBInitDef and -ORBDefaultInitDef's - * will be stored in this object. This object is capable of storing multiple - * Host profiles as defined in the CorbaLoc grammer. - * - * @author Hemanth - */ -public abstract class INSURLBase implements INSURL { - - // If rirFlag is set to true that means internal - // boot strapping technique will be used. If set to - // false then the EndpointInfo will be used to create the - // Service Object reference. - protected boolean rirFlag = false ; - protected java.util.ArrayList theEndpointInfo = null ; - protected String theKeyString = "NameService" ; - protected String theStringifiedName = null ; - - public boolean getRIRFlag( ) { - return rirFlag; - } - - public java.util.List getEndpointInfo( ) { - return theEndpointInfo; - } - - public String getKeyString( ) { - return theKeyString; - } - - public String getStringifiedName( ) { - return theStringifiedName; - } - - public abstract boolean isCorbanameURL( ); - - public void dPrint( ) { - System.out.println( "URL Dump..." ); - System.out.println( "Key String = " + getKeyString( ) ); - System.out.println( "RIR Flag = " + getRIRFlag( ) ); - System.out.println( "isCorbanameURL = " + isCorbanameURL() ); - for( int i = 0; i < theEndpointInfo.size( ); i++ ) { - ((IIOPEndpointInfo) theEndpointInfo.get( i )).dump( ); - } - if( isCorbanameURL( ) ) { - System.out.println( "Stringified Name = " + getStringifiedName() ); - } - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/INSURLHandler.java b/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/INSURLHandler.java deleted file mode 100644 index 45b45faf20c..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/INSURLHandler.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.naming.namingutil; - -import org.omg.CORBA.CompletionStatus; -import java.util.StringTokenizer; - -/** - * This class is the entry point to parse different types of INS URL's. - * - * @author Hemanth - */ - -public class INSURLHandler { - - private static INSURLHandler insURLHandler = null; - - // Length of corbaloc: - private static final int CORBALOC_PREFIX_LENGTH = 9; - - // Length of corbaname: - private static final int CORBANAME_PREFIX_LENGTH = 10; - - private INSURLHandler( ) { - } - - public synchronized static INSURLHandler getINSURLHandler( ) { - if( insURLHandler == null ) { - insURLHandler = new INSURLHandler( ); - } - return insURLHandler; - } - - public INSURL parseURL( String aUrl ) { - String url = aUrl; - if ( url.startsWith( "corbaloc:" ) == true ) { - return new CorbalocURL( url.substring( CORBALOC_PREFIX_LENGTH ) ); - } else if ( url.startsWith ( "corbaname:" ) == true ) { - return new CorbanameURL( url.substring( CORBANAME_PREFIX_LENGTH ) ); - } - return null; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/NamingConstants.java b/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/NamingConstants.java deleted file mode 100644 index 5465ae96c79..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/NamingConstants.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.naming.namingutil; - -/** - * Constants specific to INS parsing and validation. - */ -public class NamingConstants { - - // iiop length - public static final int IIOP_LENGTH = 4; - - // rir: length - public static final int RIRCOLON_LENGTH = 4; - - public static final int MAJORNUMBER_SUPPORTED = 1; - - public static final int MINORNUMBERMAX = 2; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/Utility.java b/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/Utility.java deleted file mode 100644 index 8d692604ebf..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/Utility.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.naming.namingutil; - -import java.io.StringWriter; - -import org.omg.CORBA.DATA_CONVERSION; -import org.omg.CORBA.CompletionStatus; - -import com.sun.corba.se.impl.logging.NamingSystemException; -import com.sun.corba.se.spi.logging.CORBALogDomains; - -/** - * Utility methods for Naming. - * - * @author Hemanth - */ -class Utility { - private static NamingSystemException wrapper = - NamingSystemException.get( CORBALogDomains.NAMING ) ; - - /** - * cleanEscapes removes URL escapes as per IETF 2386 RFP. - */ - static String cleanEscapes( String stringToDecode ) { - StringWriter theStringWithoutEscape = new StringWriter(); - for( int i = 0; i < stringToDecode.length(); i++ ) { - char c = stringToDecode.charAt( i ) ; - if( c != '%' ) { - theStringWithoutEscape.write( c ); - } else { - // Get the two hexadecimal digits and convert that into int - i++; - int Hex1 = hexOf( stringToDecode.charAt(i) ); - i++; - int Hex2 = hexOf( stringToDecode.charAt(i) ); - int value = (Hex1 * 16) + Hex2; - // Convert the integer to ASCII - theStringWithoutEscape.write( (char) value ); - } - } - return theStringWithoutEscape.toString(); - } - - /** - * Converts an Ascii Character into Hexadecimal digit - * NOTE: THIS METHOD IS DUPLICATED TO DELIVER NAMING AS A SEPARATE - * COMPONENT TO RI. - **/ - static int hexOf( char x ) - { - int val; - - val = x - '0'; - if (val >=0 && val <= 9) - return val; - - val = (x - 'a') + 10; - if (val >= 10 && val <= 15) - return val; - - val = (x - 'A') + 10; - if (val >= 10 && val <= 15) - return val; - - throw new DATA_CONVERSION( ); - } - - /** - * If GIOP Version is not correct, This method throws a BAD_PARAM - * Exception. - **/ - static void validateGIOPVersion( IIOPEndpointInfo endpointInfo ) { - if ((endpointInfo.getMajor() > NamingConstants.MAJORNUMBER_SUPPORTED) || - (endpointInfo.getMinor() > NamingConstants.MINORNUMBERMAX ) ) - { - throw wrapper.insBadAddress() ; - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/InternalBindingKey.java b/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/InternalBindingKey.java deleted file mode 100644 index d7aad37d058..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/InternalBindingKey.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.naming.pcosnaming; - -import java.io.Serializable; -import org.omg.CosNaming.NameComponent; - - -/** - * Class InternalBindingKey implements the necessary wrapper code - * around the org.omg.CosNaming::NameComponent class to implement the proper - * equals() method and the hashCode() method for use in a hash table. - * It computes the hashCode once and stores it, and also precomputes - * the lengths of the id and kind strings for faster comparison. - */ -public class InternalBindingKey - implements Serializable -{ - - // computed by serialver tool - private static final long serialVersionUID = -5410796631793704055L; - - public String id; - public String kind; - - // Default Constructor - public InternalBindingKey() {} - - // Normal constructor - public InternalBindingKey(NameComponent n) - { - setup(n); - } - - // Setup the object - protected void setup(NameComponent n) { - this.id = n.id; - this.kind = n.kind; - } - - // Compare the keys by comparing name's id and kind - public boolean equals(java.lang.Object o) { - if (o == null) - return false; - if (o instanceof InternalBindingKey) { - InternalBindingKey that = (InternalBindingKey)o; - if( this.id != null && that.id != null ) - { - if (this.id.length() != that.id.length() ) - { - return false; - } - // If id is set is must be equal - if (this.id.length() > 0 && this.id.equals(that.id) == false) - { - return false; - } - } - else - { - // If One is Null and the other is not then it's a mismatch - // So, return false - if( ( this.id == null && that.id != null ) - || ( this.id !=null && that.id == null ) ) - { - return false; - } - } - if( this.kind != null && that.kind != null ) - { - if (this.kind.length() != that.kind.length() ) - { - return false; - } - // If kind is set it must be equal - if (this.kind.length() > 0 && this.kind.equals(that.kind) == false) - { - return false; - } - } - else - { - // If One is Null and the other is not then it's a mismatch - // So, return false - if( ( this.kind == null && that.kind != null ) - || ( this.kind !=null && that.kind == null ) ) - { - return false; - } - } - // We have checked all the possibilities, so return true - return true; - } else { - return false; - } - } - - - // Return precomputed value - public int hashCode() { - int hashVal = 0; - if (this.id.length() > 0) - { - hashVal += this.id.hashCode(); - } - if (this.kind.length() > 0) - { - hashVal += this.kind.hashCode(); - } - return hashVal; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/InternalBindingValue.java b/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/InternalBindingValue.java deleted file mode 100644 index 26747ae3760..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/InternalBindingValue.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.naming.pcosnaming; - -import org.omg.CORBA.Object; -import org.omg.CosNaming.BindingType; -import java.io.Serializable; - -/** - * Class InternalBindingKey acts as a container for two objects, namely - * a org.omg.CosNaming::Binding and an CORBA object reference, which are the two - * components associated with the binding. - */ -public class InternalBindingValue - implements Serializable -{ - public BindingType theBindingType; - // The value stores both Stringified Object Reference and - // Non-Stringified Object Reference. This is done to avoid - // calling orb.string_to_object( ) everytime. Instead it - // will be set once and then the result will be used everytime. - public String strObjectRef; - transient private org.omg.CORBA.Object theObjectRef; - - // Default constructor - public InternalBindingValue() { - } - - // Normal constructor - public InternalBindingValue(BindingType b, String o) { - // Objectreference or Context - theBindingType = b; - strObjectRef = o; - } - - public org.omg.CORBA.Object getObjectRef( ) - { - return theObjectRef; - } - - public void setObjectRef( org.omg.CORBA.Object ObjectRef ) - { - theObjectRef = ObjectRef; - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/NameServer.java b/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/NameServer.java deleted file mode 100644 index ef8dc5825dc..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/NameServer.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.naming.pcosnaming; - -import java.io.File; -import java.util.Properties; - -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.impl.orbutil.CorbaResourceUtil; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.activation.InitialNameService; -import com.sun.corba.se.spi.activation.InitialNameServiceHelper; -import org.omg.CosNaming.NamingContext; -/** - * Class NameServer is a standalone application which - * implements a persistent and a transient name service. - * It uses the PersistentNameService and TransientNameService - * classes for the name service implementation. - * - * @author Hemanth Puttaswamy - * @since JDK1.2 - */ - -public class NameServer -{ - private ORB orb; - - private File dbDir; // name server database directory - - private final static String dbName = "names.db"; - - public static void main(String args[]) - { - NameServer ns = new NameServer(args); - ns.run(); - } - - protected NameServer(String args[]) - { - // create the ORB Object - java.util.Properties props = System.getProperties(); - props.put( ORBConstants.SERVER_ID_PROPERTY, "1000" ) ; - props.put("org.omg.CORBA.ORBClass", - "com.sun.corba.se.impl.orb.ORBImpl"); - orb = (ORB) org.omg.CORBA.ORB.init(args,props); - - // set up the database directory - String dbDirName = props.getProperty( ORBConstants.DB_DIR_PROPERTY ) + - props.getProperty("file.separator") + dbName + - props.getProperty("file.separator"); - - dbDir = new File(dbDirName); - if (!dbDir.exists()) dbDir.mkdir(); - } - - protected void run() - { - try { - - // create the persistent name service - NameService ns = new NameService(orb, dbDir); - - // add root naming context to initial naming - NamingContext rootContext = ns.initialNamingContext(); - InitialNameService ins = InitialNameServiceHelper.narrow( - orb.resolve_initial_references( - ORBConstants.INITIAL_NAME_SERVICE_NAME )); - ins.bind( "NameService", rootContext, true); - System.out.println(CorbaResourceUtil.getText("pnameserv.success")); - - // wait for invocations - orb.run(); - - } catch (Exception ex) { - - ex.printStackTrace(System.err); - } - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/NameService.java b/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/NameService.java deleted file mode 100644 index 992919b950f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/NameService.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.naming.pcosnaming; - -import java.io.File; -import java.util.Properties; - -import org.omg.CORBA.Policy; -import org.omg.PortableServer.POA; -import org.omg.PortableServer.LifespanPolicyValue; -import org.omg.PortableServer.RequestProcessingPolicyValue; -import org.omg.PortableServer.IdAssignmentPolicyValue; -import org.omg.PortableServer.ServantRetentionPolicyValue; -import org.omg.CosNaming.NamingContext; -import org.omg.CosNaming.NamingContextHelper; -import org.omg.PortableServer.*; - -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.impl.orbutil.ORBConstants ; - -/** - * @author Hemanth Puttaswamy - * @since JDK1.2 - */ - -public class NameService -{ - private NamingContext rootContext = null; - private POA nsPOA = null; - private ServantManagerImpl contextMgr; - private ORB theorb; - - /** - * Create NameService which starts the Root Naming Context in Persistent CosNaming - * @param orb an ORB object. - * @param logDir a File - * @exception java.lang.Exception a Java exception. - */ - public NameService(ORB orb, File logDir) - throws Exception - { - theorb = orb; - - // Moved this to the creation of the ORB that is passed into this - // constructor. - // - // This is required for creating Persistent Servants under this ORB - // Right now the Persistent NameService and ORBD are launched together - // Find out a better way of doing this, Since ORBD is an important - // process which should not be killed because of some external process - // orb.setPersistentServerId( (int) 1000 ); - - // get and activate the root naming POA - POA rootPOA = (POA)orb.resolve_initial_references( - ORBConstants.ROOT_POA_NAME ) ; - rootPOA.the_POAManager().activate(); - - // create a new POA for persistent Naming Contexts - // With Non-Retain policy, So that every time Servant Manager - // will be contacted when the reference is made for the context - // The id assignment is made by the NameServer, The Naming Context - // id's will be in the format NC - int i=0; - Policy[] poaPolicy = new Policy[4]; - poaPolicy[i++] = rootPOA.create_lifespan_policy( - LifespanPolicyValue.PERSISTENT); - poaPolicy[i++] = rootPOA.create_request_processing_policy( - RequestProcessingPolicyValue.USE_SERVANT_MANAGER); - poaPolicy[i++] = rootPOA.create_id_assignment_policy( - IdAssignmentPolicyValue.USER_ID); - poaPolicy[i++] = rootPOA.create_servant_retention_policy( - ServantRetentionPolicyValue.NON_RETAIN); - - - nsPOA = rootPOA.create_POA("NameService", null, poaPolicy); - nsPOA.the_POAManager().activate( ); - - // create and set the servant manager - contextMgr = new - ServantManagerImpl(orb, logDir, this ); - - // The RootObject key will be NC0 - String rootKey = contextMgr.getRootObjectKey( ); - // initialize the root Naming Context - NamingContextImpl nc = - new NamingContextImpl( orb, rootKey, this, contextMgr ); - nc = contextMgr.addContext( rootKey, nc ); - nc.setServantManagerImpl( contextMgr ); - nc.setORB( orb ); - nc.setRootNameService( this ); - - nsPOA.set_servant_manager(contextMgr); - rootContext = NamingContextHelper.narrow( - nsPOA.create_reference_with_id( rootKey.getBytes( ), - NamingContextHelper.id( ) ) ); - } - - /** - * This method returns the Root Naming Context - */ - public NamingContext initialNamingContext() - { - return rootContext; - } - - /** - * This method returns nsPOA which is the only POA that we use for - * Persistent Naming Contexts. - */ - POA getNSPOA( ) { - return nsPOA; - } - - - /** - * This method creates a NewContext, This will internally invoked from - * NamingContextImpl. It is not a public API. NewContext is in this class - * because a Persiten reference has to be created with Persistent NameService - * POA. - */ - public NamingContext NewContext( ) throws org.omg.CORBA.SystemException - { - try - { - // Get the new Naming Context Key from - // the ServantManager - String newKey = - contextMgr.getNewObjectKey( ); - // Create the new Naming context and create the Persistent - // reference - NamingContextImpl theContext = - new NamingContextImpl( theorb, newKey, - this, contextMgr ); - NamingContextImpl tempContext = contextMgr.addContext( newKey, - theContext ); - if( tempContext != null ) - { - theContext = tempContext; - } - // If the context is read from the File, The following three entries - // will be null. So a fresh setup may be required. - theContext.setServantManagerImpl( contextMgr ); - theContext.setORB( theorb ); - theContext.setRootNameService( this ); - NamingContext theNewContext = - NamingContextHelper.narrow( - nsPOA.create_reference_with_id( newKey.getBytes( ), - NamingContextHelper.id( )) ); - return theNewContext; - } - catch( org.omg.CORBA.SystemException e ) - { - throw e; - } - catch( java.lang.Exception e ) - { - //throw e; - } - return null; - } - - /** - * getObjectReferenceFromKey returns the Object reference from the objectkey using POA.create_reference_with_id method - * @param Object Key as String - * @return a CORBA.Object reference. - */ - org.omg.CORBA.Object getObjectReferenceFromKey( String key ) - { - org.omg.CORBA.Object theObject = null; - try - { - theObject = nsPOA.create_reference_with_id( key.getBytes( ), NamingContextHelper.id( ) ); - } - catch (Exception e ) - { - theObject = null; - } - return theObject; - } - - /** - * getObjectKey gets the Object Key from the reference using POA.reference_to_id method - * @param reference an CORBA.Object. - * @return Object Key as String - */ - String getObjectKey( org.omg.CORBA.Object reference ) - { - byte theId[]; - try - { - theId = nsPOA.reference_to_id( reference ); - } - catch( org.omg.PortableServer.POAPackage.WrongAdapter e ) - { - return null; - } - catch( org.omg.PortableServer.POAPackage.WrongPolicy e ) - { - return null; - } - catch( Exception e ) - { - return null; - } - String theKey = new String( theId ); - return theKey; - } - - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/NamingContextImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/NamingContextImpl.java deleted file mode 100644 index 67483e0d35b..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/NamingContextImpl.java +++ /dev/null @@ -1,1302 +0,0 @@ -/* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.naming.pcosnaming; - - -import org.omg.CORBA.Object; -import org.omg.CORBA.SystemException; -import org.omg.CORBA.BAD_PARAM; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.Policy; -import org.omg.PortableServer.POA; -import org.omg.PortableServer.LifespanPolicyValue; -import org.omg.PortableServer.RequestProcessingPolicyValue; -import org.omg.PortableServer.IdAssignmentPolicyValue; -import org.omg.PortableServer.ServantRetentionPolicyValue; - -import org.omg.CosNaming.*; -import org.omg.CosNaming.NamingContextPackage.*; -import org.omg.CosNaming.NamingContextExtPackage.*; - -import com.sun.corba.se.impl.naming.cosnaming.NamingContextDataStore; -import com.sun.corba.se.impl.naming.cosnaming.NamingUtils; - -import com.sun.corba.se.impl.naming.namingutil.INSURLHandler; - -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.logging.CORBALogDomains; - -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.impl.logging.NamingSystemException; - -import java.io.Serializable; -import java.util.Hashtable; - -/** - * Class NamingContextImpl implements the org.omg.CosNaming::NamingContext and - * NamingContextExt interface. - *

            - * The operations bind(), rebind(), bind_context() and rebind_context() - * are all really implemented by doBind(). resolve() is really implemented - * by doResolve(), unbind() by doUnbind(). list(), new_context() and - * destroy() uses the NamingContextDataStore interface directly. All the - * doX() methods are public static. - * They synchronize on the NamingContextDataStore object. - *

            - * None of the methods here are Synchronized because These methods will be - * invoked from Super class's doBind( ), doResolve( ) which are already - * Synchronized. - */ - - -public class NamingContextImpl - extends NamingContextExtPOA - implements NamingContextDataStore, Serializable -{ - - // The ORB is required to do string_to_object() operations - // All the references are stored in the files in the form of IOR strings - private transient ORB orb; - - // The ObjectKey will be in the format NC which uniquely identifies - // The NamingContext internaly - private final String objKey; - - // Hash table contains all the entries in the NamingContexts. The - // CORBA.Object references will be stored in the form of IOR strings - // and the Child Naming Contexts will have it's key as the entry in the - // table. This table is written into File everytime an update is made - // on this context. - private final Hashtable theHashtable = new Hashtable( ); - - // The NameServiceHandle is required to get the ObjectId from the - // NamingContext's references. These references are created using - // POA in the NameService. - private transient NameService theNameServiceHandle; - - // ServantManager is the single point of contact to Read, Write and - // Update the NamingContextFile - private transient ServantManagerImpl theServantManagerImplHandle; - - // All the INS (Interoperable Naming Service) methods are defined in this class - // All the calls to INS will be delegated to this class. - private transient com.sun.corba.se.impl.naming.cosnaming.InterOperableNamingImpl insImpl; - - private transient NamingSystemException readWrapper ; - - private transient NamingSystemException updateWrapper ; - - private static POA biPOA = null; - - /** - * Create a naming context servant. - * Runs the super constructor. - * @param orb an ORB object. - * @param objKey as String - * @param theNameService as NameService - * @param theServantManagerImpl as ServantManagerImpl - * @exception java.lang.Exception a Java exception. - */ - - public NamingContextImpl(ORB orb, String objKey, - NameService theNameService, ServantManagerImpl theServantManagerImpl ) - throws Exception - { - super(); - - this.orb = orb; - readWrapper = NamingSystemException.get( orb, - CORBALogDomains.NAMING_READ ) ; - updateWrapper = NamingSystemException.get( orb, - CORBALogDomains.NAMING_UPDATE ) ; - - debug = true ; // orb.namingDebugFlag ; - this.objKey = objKey; - theNameServiceHandle = theNameService; - theServantManagerImplHandle = theServantManagerImpl; - insImpl = - new com.sun.corba.se.impl.naming.cosnaming.InterOperableNamingImpl(); - } - - com.sun.corba.se.impl.naming.cosnaming.InterOperableNamingImpl getINSImpl( ) - { - if( insImpl == null ) - { - // insImpl will be null if the NamingContext graph is rebuilt from - // the persistence store. - insImpl = - new com.sun.corba.se.impl.naming.cosnaming.InterOperableNamingImpl(); - } - return insImpl; - } - - - public void setRootNameService( NameService theNameService ) { - theNameServiceHandle = theNameService; - } - - public void setORB( ORB theOrb ) { - orb = theOrb; - } - - public void setServantManagerImpl( - ServantManagerImpl theServantManagerImpl ) - { - theServantManagerImplHandle = theServantManagerImpl; - } - - public POA getNSPOA( ) { - return theNameServiceHandle.getNSPOA( ); - } - - - - - /** - * Bind an object under a name in this NamingContext. If the name - * contains multiple (n) components, n-1 will be resolved in this - * NamingContext and the object bound in resulting NamingContext. - * An exception is thrown if a binding with the supplied name already - * exists. If the - * object to be bound is a NamingContext it will not participate in - * a recursive resolve. - * @param n a sequence of NameComponents which is the name under which - * the object will be bound. - * @param obj the object reference to be bound. - * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with multiple - * components was supplied, but the first component could not be - * resolved. - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not proceed - * in resolving the n-1 components of the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The supplied name - * is invalid (i.e., has length less than 1). - * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound The supplied name - * is already bound. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - * @see doBind - */ - public void bind(NameComponent[] n, org.omg.CORBA.Object obj) - throws org.omg.CosNaming.NamingContextPackage.NotFound, - org.omg.CosNaming.NamingContextPackage.CannotProceed, - org.omg.CosNaming.NamingContextPackage.InvalidName, - org.omg.CosNaming.NamingContextPackage.AlreadyBound - { - if( obj == null ) { - throw updateWrapper.objectIsNull() ; - } - - if (debug) - dprint("bind " + nameToString(n) + " to " + obj); - // doBind implements all four flavors of binding - NamingContextDataStore impl = (NamingContextDataStore)this; - doBind(impl,n,obj,false,BindingType.nobject); - } - - /** - * Bind a NamingContext under a name in this NamingContext. If the name - * contains multiple (n) components, n-1 will be resolved in this - * NamingContext and the object bound in resulting NamingContext. - * An exception is thrown if a binding with the supplied name already - * exists. The NamingContext will participate in recursive resolving. - * @param n a sequence of NameComponents which is the name under which - * the object will be bound. - * @param nc the NamingContect object reference to be bound. - * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with multiple - * components was supplied, but the first component could not be - * resolved. - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not proceed - * in resolving the n-1 components of the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The supplied name - * is invalid (i.e., has length less than 1). - * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound An object is - * already bound under the supplied name. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - * @see doBind - */ - public void bind_context(NameComponent[] n, NamingContext nc) - throws org.omg.CosNaming.NamingContextPackage.NotFound, - org.omg.CosNaming.NamingContextPackage.CannotProceed, - org.omg.CosNaming.NamingContextPackage.InvalidName, - org.omg.CosNaming.NamingContextPackage.AlreadyBound - { - if( nc == null ) { - throw updateWrapper.objectIsNull() ; - } - // doBind implements all four flavors of binding - NamingContextDataStore impl = (NamingContextDataStore)this; - doBind(impl,n,nc,false,BindingType.ncontext); - } - - /** - * Bind an object under a name in this NamingContext. If the name - * contains multiple (n) components, n-1 will be resolved in this - * NamingContext and the object bound in resulting NamingContext. - * If a binding under the supplied name already exists it will be - * unbound first. If the - * object to be bound is a NamingContext it will not participate in - * a recursive resolve. - * @param n a sequence of NameComponents which is the name under which - * the object will be bound. - * @param obj the object reference to be bound. - * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with multiple - * components was supplied, but the first component could not be - * resolved. - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not proceed - * in resolving the n-1 components of the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The supplied name - * is invalid (i.e., has length less than 1). - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - * @see doBind - */ - public void rebind(NameComponent[] n, org.omg.CORBA.Object obj) - throws org.omg.CosNaming.NamingContextPackage.NotFound, - org.omg.CosNaming.NamingContextPackage.CannotProceed, - org.omg.CosNaming.NamingContextPackage.InvalidName - { - if( obj == null ) - { - throw updateWrapper.objectIsNull() ; - } - try { - if (debug) - dprint("rebind " + nameToString(n) + " to " + obj); - // doBind implements all four flavors of binding - NamingContextDataStore impl = (NamingContextDataStore)this; - doBind(impl,n,obj,true,BindingType.nobject); - } catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound ex) { - // This should not happen - throw updateWrapper.namingCtxRebindAlreadyBound( ex ) ; - } - } - - /** - * Bind a NamingContext under a name in this NamingContext. If the name - * contains multiple (n) components, the first n-1 components will be - * resolved in this - * NamingContext and the object bound in resulting NamingContext. - * If a binding under the supplied name already exists it will be - * unbound first. The NamingContext will participate in recursive resolving. - * @param n a sequence of NameComponents which is the name under which - * the object will be bound. - * @param nc the object reference to be bound. - * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with multiple - * components was supplied, but the first component could not be - * resolved. - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not proceed - * in resolving the n-1 components of the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The supplied name - * is invalid (i.e., has length less than 1). - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - * @see doBind - */ - public void rebind_context(NameComponent[] n, NamingContext nc) - throws org.omg.CosNaming.NamingContextPackage.NotFound, - org.omg.CosNaming.NamingContextPackage.CannotProceed, - org.omg.CosNaming.NamingContextPackage.InvalidName - { - try { - if (debug) - dprint("rebind_context " + nameToString(n) + " to " + nc); - // doBind implements all four flavors of binding - NamingContextDataStore impl = (NamingContextDataStore)this; - doBind(impl,n,nc,true,BindingType.ncontext); - } catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound ex) { - // This should not happen - throw updateWrapper.namingCtxRebindAlreadyBound( ex ) ; - } - } - - /** - * Resolve a name in this NamingContext and return the object reference - * bound to the name. If the name contains multiple (n) components, - * the first component will be resolved in this NamingContext and the - * remaining components resolved in the resulting NamingContext, provided - * that the NamingContext bound to the first component of the name was - * bound with bind_context(). - * @param n a sequence of NameComponents which is the name to be resolved. - * @return the object reference bound under the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with multiple - * components was supplied, but the first component could not be - * resolved. - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not proceed - * in resolving the n-1 components of the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The supplied name - * is invalid (i.e., has length less than 1). - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - * @see doResolve - */ - public org.omg.CORBA.Object resolve(NameComponent[] n) - throws org.omg.CosNaming.NamingContextPackage.NotFound, - org.omg.CosNaming.NamingContextPackage.CannotProceed, - org.omg.CosNaming.NamingContextPackage.InvalidName - { - if (debug) - dprint("resolve " + nameToString(n)); - // doResolve actually resolves - NamingContextDataStore impl = (NamingContextDataStore)this; - return doResolve(impl,n); - } - - /** - * Remove a binding from this NamingContext. If the name contains - * multiple (n) components, the first n-1 components will be resolved - * from this NamingContext and the final component unbound in - * the resulting NamingContext. - * @param n a sequence of NameComponents which is the name to be unbound. - * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with multiple - * components was supplied, but the first component could not be - * resolved. - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not proceed - * in resolving the n-1 components of the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The supplied name - * is invalid (i.e., has length less than 1). - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - * @see doUnbind - */ - public void unbind(NameComponent[] n) - throws org.omg.CosNaming.NamingContextPackage.NotFound, - org.omg.CosNaming.NamingContextPackage.CannotProceed, - org.omg.CosNaming.NamingContextPackage.InvalidName - { - if (debug) - dprint("unbind " + nameToString(n)); - // doUnbind actually unbinds - NamingContextDataStore impl = (NamingContextDataStore)this; - doUnbind(impl,n); - } - - /** - * List the contents of this NamingContest. A sequence of bindings - * is returned (a BindingList) containing up to the number of requested - * bindings, and a BindingIterator object reference is returned for - * iterating over the remaining bindings. - * @param how_many The number of requested bindings in the BindingList. - * @param bl The BindingList as an out parameter. - * @param bi The BindingIterator as an out parameter. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - * @see BindingListHolder - * @see BindingIteratorImpl - */ - public void list(int how_many, BindingListHolder bl, BindingIteratorHolder bi) - { - if (debug) - dprint("list(" + how_many + ")"); - // List actually generates the list - NamingContextDataStore impl = (NamingContextDataStore)this; - synchronized (impl) { - impl.List(how_many,bl,bi); - } - if (debug && bl.value != null) - dprint("list(" + how_many + ") -> bindings[" + bl.value.length + - "] + iterator: " + bi.value); - } - - - /** - * Create a NamingContext object and return its object reference. - * @return an object reference for a new NamingContext object implemented - * by this Name Server. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - */ - public synchronized NamingContext new_context() - { - // Create actually creates a new naming context - if (debug) - dprint("new_context()"); - NamingContextDataStore impl = (NamingContextDataStore)this; - synchronized (impl) { - return impl.NewContext(); - } - } - - - /** - * Create a new NamingContext, bind it in this Naming Context and return - * its object reference. This is equivalent to using new_context() followed - * by bind_context() with the supplied name and the object reference for - * the newly created NamingContext. - * @param n a sequence of NameComponents which is the name to be unbound. - * @return an object reference for a new NamingContext object implemented - * by this Name Server, bound to the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound An object is - * already bound under the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with multiple - * components was supplied, but the first component could not be - * resolved. - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not proceed - * in resolving the n-1 components of the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The supplied name - * is invalid (i.e., has length less than 1). - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - * @see new_context - * @see bind_context - */ - public NamingContext bind_new_context(NameComponent[] n) - throws org.omg.CosNaming.NamingContextPackage.NotFound, - org.omg.CosNaming.NamingContextPackage.AlreadyBound, - org.omg.CosNaming.NamingContextPackage.CannotProceed, - org.omg.CosNaming.NamingContextPackage.InvalidName - { - NamingContext nc = null; - NamingContext rnc = null; - try { - if (debug) - dprint("bind_new_context " + nameToString(n)); - // The obvious solution: - nc = this.new_context(); - this.bind_context(n,nc); - rnc = nc; - nc = null; - } finally { - try { - if(nc != null) - nc.destroy(); - } catch (org.omg.CosNaming.NamingContextPackage.NotEmpty e) { - } - } - return rnc; - } - - /** - * Destroy this NamingContext object. If this NamingContext contains - * no bindings, the NamingContext is deleted. - * @exception org.omg.CosNaming.NamingContextPackage.NotEmpty This NamingContext - * is not empty (i.e., contains bindings). - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - */ - public void destroy() - throws org.omg.CosNaming.NamingContextPackage.NotEmpty - { - if (debug) - dprint("destroy "); - NamingContextDataStore impl = (NamingContextDataStore)this; - synchronized (impl) { - if (impl.IsEmpty() == true) - // The context is empty so it can be destroyed - impl.Destroy(); - else - // This context is not empty! - throw new org.omg.CosNaming.NamingContextPackage.NotEmpty(); - } - } - - /** - * Implements all four flavors of binding. It uses Resolve() to - * check if a binding already exists (for bind and bind_context), and - * unbind() to ensure that a binding does not already exist. - * If the length of the name is 1, then Bind() is called with - * the name and the object to bind. Otherwise, the first component - * of the name is resolved in this NamingContext and the appropriate - * form of bind passed to the resulting NamingContext. - * This method is static for maximal reuse - even for extended naming - * context implementations where the recursive semantics still apply. - * @param impl an implementation of NamingContextDataStore - * @param n a sequence of NameComponents which is the name under which - * the object will be bound. - * @param obj the object reference to be bound. - * @param rebind Replace an existing binding or not. - * @param bt Type of binding (as object or as context). - * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with multiple - * components was supplied, but the first component could not be - * resolved. - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not proceed - * in resolving the first component of the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The supplied name - * is invalid (i.e., has length less than 1). - * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound An object is - * already bound under the supplied name. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - * @see resolve - * @see unbind - * @see bind - * @see bind_context - * @see rebind - * @see rebind_context - */ - private void doBind(NamingContextDataStore impl, - NameComponent[] n, - org.omg.CORBA.Object obj, - boolean rebind, - org.omg.CosNaming.BindingType bt) - throws org.omg.CosNaming.NamingContextPackage.NotFound, - org.omg.CosNaming.NamingContextPackage.CannotProceed, - org.omg.CosNaming.NamingContextPackage.InvalidName, - org.omg.CosNaming.NamingContextPackage.AlreadyBound - { - // Valid name? - if (n.length < 1) - throw new org.omg.CosNaming.NamingContextPackage.InvalidName(); - - // At bottom level? - if (n.length == 1) { - // The identifier must be set - if( (n[0].id.length() == 0) && (n[0].kind.length() == 0) ) - throw new org.omg.CosNaming.NamingContextPackage.InvalidName(); - - // Ensure synchronization of backend - synchronized (impl) { - // Yes: bind object in this context under the name - BindingTypeHolder bth = new BindingTypeHolder(); - if (rebind) { - org.omg.CORBA.Object objRef = impl.Resolve( n[0], bth ); - if( objRef != null ) { - // Refer Naming Service Doc:00-11-01 section 2.2.3.4 - // If there is an object already bound with the name - // and the binding type is not ncontext a NotFound - // Exception with a reason of not a context has to be - // raised. - // Fix for bug Id: 4384628 - if ( bth.value.value() == BindingType.nobject.value() ) { - if ( bt.value() == BindingType.ncontext.value() ) { - throw new NotFound(NotFoundReason.not_context, n); - } - } else { - // Previously a Context was bound and now trying to - // bind Object. It is invalid. - if ( bt.value() == BindingType.nobject.value() ) { - throw new NotFound(NotFoundReason.not_object, n); - } - } - impl.Unbind(n[0]); - } - } else { - if (impl.Resolve(n[0],bth) != null) - throw new org.omg.CosNaming.NamingContextPackage.AlreadyBound(); - } - - // Now there are no other bindings under this name - impl.Bind(n[0],obj,bt); - } - } else { - // No: bind in a different context - NamingContext context = resolveFirstAsContext(impl,n); - - // Compute tail - NameComponent[] tail = new NameComponent[n.length - 1]; - System.arraycopy(n,1,tail,0,n.length-1); - - // How should we propagate the bind - switch (bt.value()) { - case BindingType._nobject: - { - // Bind as object - if (rebind) - context.rebind(tail,obj); - else - context.bind(tail,obj); - } - break; - case BindingType._ncontext: - { - // Narrow to a naming context using Java casts. It must work. - NamingContext objContext = (NamingContext)obj; - // Bind as context - if (rebind) - context.rebind_context(tail,objContext); - else - context.bind_context(tail,objContext); - } - break; - default: - // This should not happen - throw updateWrapper.namingCtxBadBindingtype() ; - } - } - } - - - /** - * Implements resolving names in this NamingContext. The first component - * of the supplied name is resolved in this NamingContext by calling - * Resolve(). If there are no more components in the name, the - * resulting object reference is returned. Otherwise, the resulting object - * reference must have been bound as a context and be narrowable to - * a NamingContext. If this is the case, the remaining - * components of the name is resolved in the resulting NamingContext. - * This method is static for maximal reuse - even for extended naming - * context implementations where the recursive semantics still apply. - * @param impl an implementation of NamingContextDataStore - * @param n a sequence of NameComponents which is the name to be resolved. - * @return the object reference bound under the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with multiple - * components was supplied, but the first component could not be - * resolved. - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not proceed - * in resolving the first component of the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The supplied name - * is invalid (i.e., has length less than 1). - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - * @see resolve - */ - public static org.omg.CORBA.Object doResolve(NamingContextDataStore impl, - NameComponent[] n) - throws org.omg.CosNaming.NamingContextPackage.NotFound, - org.omg.CosNaming.NamingContextPackage.CannotProceed, - org.omg.CosNaming.NamingContextPackage.InvalidName - { - org.omg.CORBA.Object obj = null; - BindingTypeHolder bth = new BindingTypeHolder(); - - // Length must be greater than 0 - if (n.length < 1) - throw new org.omg.CosNaming.NamingContextPackage.InvalidName(); - - // The identifier must be set - if (n.length == 1) { - synchronized (impl) { - // Resolve first level in this context - obj = impl.Resolve(n[0],bth); - } - if (obj == null) { - // Object was not found - throw new org.omg.CosNaming.NamingContextPackage.NotFound(NotFoundReason.missing_node,n); - } - return obj; - } else { - // n.length > 1 - if ( (n[1].id.length() == 0) && (n[1].kind.length() == 0 ) ) - throw new org.omg.CosNaming.NamingContextPackage.InvalidName(); - - NamingContext context = resolveFirstAsContext(impl,n); - - // Compute restOfName = name[1..length] - NameComponent[] tail = new NameComponent[n.length -1]; - System.arraycopy(n,1,tail,0,n.length-1); - - // Resolve rest of name in context - return context.resolve(tail); - } - } - - /** - * Implements unbinding bound names in this NamingContext. If the - * name contains only one component, the name is unbound in this - * NamingContext using Unbind(). Otherwise, the first component - * of the name is resolved in this NamingContext and - * unbind passed to the resulting NamingContext. - * This method is static for maximal reuse - even for extended naming - * context implementations where the recursive semantics still apply. - * @param impl an implementation of NamingContextDataStore - * @param n a sequence of NameComponents which is the name to be unbound. - * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with multiple - * components was supplied, but the first component could not be - * resolved. - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not proceed - * in resolving the n-1 components of the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The supplied name - * is invalid (i.e., has length less than 1). - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - * @see resolve - */ - public static void doUnbind(NamingContextDataStore impl, - NameComponent[] n) - throws org.omg.CosNaming.NamingContextPackage.NotFound, - org.omg.CosNaming.NamingContextPackage.CannotProceed, - org.omg.CosNaming.NamingContextPackage.InvalidName - { - // Name valid? - if (n.length < 1) - throw new org.omg.CosNaming.NamingContextPackage.InvalidName(); - - // Unbind here? - if (n.length == 1) { - // The identifier must be set - if ( (n[0].id.length() == 0) && (n[0].kind.length() == 0 ) ) - throw new org.omg.CosNaming.NamingContextPackage.InvalidName(); - - org.omg.CORBA.Object objRef = null; - synchronized (impl) { - // Yes: unbind in this context - objRef = impl.Unbind(n[0]); - } - - if (objRef == null) - // It was not bound - throw new org.omg.CosNaming.NamingContextPackage.NotFound(NotFoundReason.missing_node,n); - // Done - return; - } else { - // No: unbind in a different context - - // Resolve first - must be resolveable - NamingContext context = resolveFirstAsContext(impl,n); - - // Compute tail - NameComponent[] tail = new NameComponent[n.length - 1]; - System.arraycopy(n,1,tail,0,n.length-1); - - // Propagate unbind to this context - context.unbind(tail); - } - } - - /** - * Implements resolving a NameComponent in this context and - * narrowing it to CosNaming::NamingContext. It will throw appropriate - * exceptions if not found or not narrowable. - * @param impl an implementation of NamingContextDataStore - * @param n a NameComponents which is the name to be found. - * @exception org.omg.CosNaming.NamingContextPackage.NotFound The - * first component could not be resolved. - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not proceed - * in resolving the first component of the supplied name. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - * @see resolve - */ - protected static NamingContext resolveFirstAsContext(NamingContextDataStore impl, - NameComponent[] n) - throws org.omg.CosNaming.NamingContextPackage.NotFound { - org.omg.CORBA.Object topRef = null; - BindingTypeHolder bth = new BindingTypeHolder(); - NamingContext context = null; - - synchronized (impl) { - // Resolve first - must be resolveable - topRef = impl.Resolve(n[0],bth); - if (topRef == null) { - // It was not bound - throw new org.omg.CosNaming.NamingContextPackage.NotFound(NotFoundReason.missing_node,n); - } - } - - // Was it bound as a context? - if (bth.value != BindingType.ncontext) { - // It was not a context - throw new org.omg.CosNaming.NamingContextPackage.NotFound(NotFoundReason.not_context,n); - } - - // Narrow to a naming context - try { - context = NamingContextHelper.narrow(topRef); - } catch (org.omg.CORBA.BAD_PARAM ex) { - // It was not a context - throw new org.omg.CosNaming.NamingContextPackage.NotFound(NotFoundReason.not_context,n); - } - - // Hmm. must be ok - return context; - } - - public static String nameToString(NameComponent[] name) - { - StringBuffer s = new StringBuffer("{"); - if (name != null || name.length > 0) { - for (int i=0;i0) - s.append(","); - s.append("["). - append(name[i].id). - append(","). - append(name[i].kind). - append("]"); - } - } - s.append("}"); - return s.toString(); - } - - // Debugging aids. - private static boolean debug ; - - private static void dprint(String msg) { - NamingUtils.dprint("NamingContextImpl(" + - Thread.currentThread().getName() + " at " + - System.currentTimeMillis() + - " ems): " + msg); - } - - - /** - * Implements all flavors of binding( bind and bindcontext) - * This method will be called from the superclass's doBind( ) method - * which takes care of all the conditions before calling this method. - * i.e., It checks whether the Name is already Bounded, Then in the - * case of rebind it calls Unbind first. - * This method does one level binding only, To have n-level binding - * with compound names, doBind( ) calls this method recursively. - * @param n a sequence of NameComponents which is the name under which - * the object will be bound. - * @param obj the object reference to be bound. - * @param bt Type of binding (as object or as context). - * @exception org.omg.CosNaming.NamingContextPackage.NotFound raised - * if the NameComoponent list is invalid - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed - * Could not proceed in resolving the Name from the given NameComponent - * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound An object - * is already bound under the supplied name. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA - * system exceptions - * @see Resolve - * @see Unbind - */ - public void Bind(NameComponent n, org.omg.CORBA.Object obj, BindingType bt) - { - if( obj == null ) { - // Raise a Valid Exception and Return - return; - } - - InternalBindingKey key = new InternalBindingKey(n); - InternalBindingValue value; - - try { - if( bt.value() == BindingType._nobject ) { - // If the BindingType is an ObjectRef then Stringify this ref and - // Store it in InternalBindingValue instance. This is required - // because the Object References has to be stored in file - value = new InternalBindingValue(bt, orb.object_to_string(obj) ); - value.setObjectRef( obj ); - } else { - // If the BindingType is a NamingContext then get it's object key - // from the NameService and store it in the Internal Binding Value instance - String theNCKey = theNameServiceHandle.getObjectKey( obj ); - value = new InternalBindingValue( bt, theNCKey ); - value.setObjectRef( obj ); - } - - InternalBindingValue oldValue = - (InternalBindingValue)this.theHashtable.put(key,value); - - if( oldValue != null) { - // There was an entry with this name in the Hashtable and hence throw CTX_ALREADY_BOUND - // exception - throw updateWrapper.namingCtxRebindAlreadyBound() ; - } else { - try { - // Everything went smooth so update the NamingContext file with the - // latest Hashtable image - theServantManagerImplHandle.updateContext( objKey, this ); - } catch( Exception e ) { - // Something went wrong while updating the context - // so speak the error - throw updateWrapper.bindUpdateContextFailed( e ) ; - } - } - } catch( Exception e ) { - // Something went wrong while Binding the Object Reference - // Speak the error again. - throw updateWrapper.bindFailure( e ) ; - } - } - - /** - * This method resolves the NamingContext or Object Reference for one level - * The doResolve( ) method calls Resolve( ) recursively to resolve n level - * Names. - * @param n a sequence of NameComponents which is the name to be resolved. - * @param bth Type of binding (as object or as context). - * @return the object reference bound under the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.NotFound Neither a NamingContext - * or a Corba Object reference not found under this Name - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not proceed - * in resolving the the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The supplied name - * is invalid (i.e., has length less than 1). - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - * @see Bind - */ - public Object Resolve(NameComponent n, BindingTypeHolder bth) - throws SystemException - { - if( ( n.id.length() == 0 ) &&( n.kind.length() == 0 ) ) { - // If the NameComponent list has no entry then it means the current - // context was requested - bth.value = BindingType.ncontext; - return theNameServiceHandle.getObjectReferenceFromKey( - this.objKey ); - } - - InternalBindingKey key = new InternalBindingKey(n); - InternalBindingValue value = - (InternalBindingValue) this.theHashtable.get(key); - - if( value == null ) { - // No entry was found for the given name and hence return NULL - // NamingContextDataStore throws appropriate exception if - // required. - return null; - } - - Object theObjectFromStringifiedReference = null; - bth.value = value.theBindingType; - - try { - // Check whether the entry found in the Hashtable starts with NC - // Which means it's a name context. So get the NamingContext reference - // from ServantManager, which would either return from the cache or - // read it from the File. - if( value.strObjectRef.startsWith( "NC" ) ) { - bth.value = BindingType.ncontext; - return theNameServiceHandle.getObjectReferenceFromKey( value.strObjectRef ); - } else { - // Else, It is a Object Reference. Check whether Object Reference - // can be obtained directly, If not then convert the stringified - // reference to object and return. - theObjectFromStringifiedReference = value.getObjectRef( ); - - if (theObjectFromStringifiedReference == null ) { - try { - theObjectFromStringifiedReference = - orb.string_to_object( value.strObjectRef ); - value.setObjectRef( theObjectFromStringifiedReference ); - } catch( Exception e ) { - throw readWrapper.resolveConversionFailure( - CompletionStatus.COMPLETED_MAYBE, e ); - } - } - } - } catch ( Exception e ) { - throw readWrapper.resolveFailure( - CompletionStatus.COMPLETED_MAYBE, e ); - } - - return theObjectFromStringifiedReference; - } - - /** - * This method Unbinds the NamingContext or Object Reference for one level - * The doUnbind( ) method from superclass calls Unbind() to recursively - * Unbind using compound Names. - * @param n a sequence of NameComponents which is the name to be resolved. - * @return the object reference bound under the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.NotFound Neither a NamingContext - * or a Corba Object reference not found under this Name - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not proceed - * in resolving the the supplied name. - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The supplied name - * is invalid (i.e., has length less than 1). - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - * @see Bind - */ - - public Object Unbind(NameComponent n) throws SystemException - { - try { - InternalBindingKey key = new InternalBindingKey(n); - InternalBindingValue value = null; - - try { - value = (InternalBindingValue) this.theHashtable.remove(key); - } catch( Exception e ) { - // Ignore the exception in Hashtable.remove - } - - theServantManagerImplHandle.updateContext( objKey, this ); - - if( value == null ) { - return null; - } - - if( value.strObjectRef.startsWith( "NC" ) ) { - theServantManagerImplHandle.readInContext( value.strObjectRef ); - Object theObjectFromStringfiedReference = - theNameServiceHandle.getObjectReferenceFromKey( value.strObjectRef ); - return theObjectFromStringfiedReference; - } else { - Object theObjectFromStringifiedReference = value.getObjectRef( ); - - if( theObjectFromStringifiedReference == null ) { - theObjectFromStringifiedReference = - orb.string_to_object( value.strObjectRef ); - } - - return theObjectFromStringifiedReference; - } - } catch( Exception e ) { - throw updateWrapper.unbindFailure( CompletionStatus.COMPLETED_MAYBE, e ); - } - } - - /** - * List the contents of this NamingContext. It creates a new - * PersistentBindingIterator object and passes it a clone of the - * hash table and an orb object. It then uses the - * newly created object to return the required number of bindings. - * @param how_many The number of requested bindings in the BindingList. - * @param bl The BindingList as an out parameter. - * @param bi The BindingIterator as an out parameter. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - */ - - public void List(int how_many, BindingListHolder bl, - BindingIteratorHolder bi) throws SystemException - { - if( biPOA == null ) { - createbiPOA( ); - } - try { - PersistentBindingIterator bindingIterator = - new PersistentBindingIterator(this.orb, - (Hashtable)this.theHashtable.clone(), biPOA); - // Have it set the binding list - bindingIterator.list(how_many,bl); - - byte[] objectId = biPOA.activate_object( bindingIterator ); - org.omg.CORBA.Object obj = biPOA.id_to_reference( objectId ); - - // Get the object reference for the binding iterator servant - org.omg.CosNaming.BindingIterator bindingRef = - org.omg.CosNaming.BindingIteratorHelper.narrow( obj ); - - bi.value = bindingRef; - } catch (org.omg.CORBA.SystemException e) { - throw e; - } catch( Exception e ) { - throw readWrapper.transNcListGotExc( e ) ; - } - } - - private synchronized void createbiPOA( ) { - if( biPOA != null ) { - return; - } - try { - POA rootPOA = (POA) orb.resolve_initial_references( - ORBConstants.ROOT_POA_NAME ); - rootPOA.the_POAManager().activate( ); - - int i = 0; - Policy[] poaPolicy = new Policy[3]; - poaPolicy[i++] = rootPOA.create_lifespan_policy( - LifespanPolicyValue.TRANSIENT); - poaPolicy[i++] = rootPOA.create_id_assignment_policy( - IdAssignmentPolicyValue.SYSTEM_ID); - poaPolicy[i++] = rootPOA.create_servant_retention_policy( - ServantRetentionPolicyValue.RETAIN); - biPOA = rootPOA.create_POA("BindingIteratorPOA", null, poaPolicy ); - biPOA.the_POAManager().activate( ); - } catch( Exception e ) { - throw readWrapper.namingCtxBindingIteratorCreate( e ) ; - } - } - - - /** - * Create a NamingContext object and return its object reference. - * @return an object reference for a new NamingContext object implemented - * by this Name Server. - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - */ - public NamingContext NewContext() throws SystemException - { - try { - return theNameServiceHandle.NewContext( ); - } catch( org.omg.CORBA.SystemException e ) { - throw e; - } catch( Exception e ) { - throw updateWrapper.transNcNewctxGotExc( e ) ; - } - } - - - /** - * Destroys the NamingContext. - */ - public void Destroy() throws SystemException - { - // XXX note that orb.disconnect is illegal here, since the - // POA is used. However, there may be some associated state - // that needs to be cleaned up in ServerManagerImpl which we will - // look into further at another time. - /* - // XXX This needs to be replaced by cleaning up the - // file that backs up the naming context. No explicit - // action is necessary at the POA level, since this is - // created with the non-retain policy. - /* - try { orb.disconnect( - theNameServiceHandle.getObjectReferenceFromKey( this.objKey ) ); - } catch( org.omg.CORBA.SystemException e ) { - throw e; - } catch( Exception e ) { - throw updateWrapper.transNcDestroyGotEx( e ) ; - } - */ - } - - /** - * This operation creates a stringified name from the array of Name - * components. - * @param n Name of the object - * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName - * Indicates the name does not identify a binding. - */ - public String to_string(org.omg.CosNaming.NameComponent[] n) - throws org.omg.CosNaming.NamingContextPackage.InvalidName - { - // Name valid? - if ( (n == null ) || (n.length == 0) ) - { - throw new org.omg.CosNaming.NamingContextPackage.InvalidName(); - } - - String theStringifiedName = getINSImpl().convertToString( n ); - - if( theStringifiedName == null ) - { - throw new org.omg.CosNaming.NamingContextPackage.InvalidName(); - } - - return theStringifiedName; - } - - /** - * This operation converts a Stringified Name into an equivalent array - * of Name Components. - * @param sn Stringified Name of the object - * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName - * Indicates the name does not identify a binding. - */ - public org.omg.CosNaming.NameComponent[] to_name(String sn) - throws org.omg.CosNaming.NamingContextPackage.InvalidName - { - // Name valid? - if ( (sn == null ) || (sn.length() == 0) ) - { - throw new org.omg.CosNaming.NamingContextPackage.InvalidName(); - } - org.omg.CosNaming.NameComponent[] theNameComponents = - getINSImpl().convertToNameComponent( sn ); - if( ( theNameComponents == null ) || (theNameComponents.length == 0 ) ) - { - throw new org.omg.CosNaming.NamingContextPackage.InvalidName(); - } - for( int i = 0; i < theNameComponents.length; i++ ) { - // If there is a name component whose id and kind null or - // zero length string, then an invalid name exception needs to be - // raised. - if ( ( ( theNameComponents[i].id == null ) - ||( theNameComponents[i].id.length() == 0 ) ) - &&( ( theNameComponents[i].kind == null ) - ||( theNameComponents[i].kind.length() == 0 ) ) ) { - throw new InvalidName(); - } - } - return theNameComponents; - } - - /** - * This operation creates a URL based "iiopname://" format name - * from the Stringified Name of the object. - * @param addr internet based address of the host machine where - * Name Service is running - * @param sn Stringified Name of the object - * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName - * Indicates the name does not identify a binding. - * @exception org.omg.CosNaming.NamingContextPackage.InvalidAddress - * Indicates the internet based address of the host machine is - * incorrect - */ - - public String to_url(String addr, String sn) - throws org.omg.CosNaming.NamingContextExtPackage.InvalidAddress, - org.omg.CosNaming.NamingContextPackage.InvalidName - { - // Name valid? - if ( (sn == null ) || (sn.length() == 0) ) - { - throw new org.omg.CosNaming.NamingContextPackage.InvalidName(); - } - if( addr == null ) - { - throw new org.omg.CosNaming.NamingContextExtPackage.InvalidAddress(); - } - String urlBasedAddress = null; - try { - urlBasedAddress = getINSImpl().createURLBasedAddress( addr, sn ); - } catch (Exception e ) { - urlBasedAddress = null; - } - // Extra check to see that corba name url created is valid as per - // INS spec grammer. - try { - INSURLHandler.getINSURLHandler().parseURL( urlBasedAddress ); - } catch( BAD_PARAM e ) { - throw new - org.omg.CosNaming.NamingContextExtPackage.InvalidAddress(); - } - return urlBasedAddress; - } - - /** - * This operation resolves the Stringified name into the object - * reference. - * @param sn Stringified Name of the object - * @exception org.omg.CosNaming.NamingContextPackage.NotFound - * Indicates there is no object reference for the given name. - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed - * Indicates that the given compound name is incorrect - * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName - * Indicates the name does not identify a binding. - */ - public org.omg.CORBA.Object resolve_str(String sn) - throws org.omg.CosNaming.NamingContextPackage.NotFound, - org.omg.CosNaming.NamingContextPackage.CannotProceed, - org.omg.CosNaming.NamingContextPackage.InvalidName - { - org.omg.CORBA.Object theObject = null; - // Name valid? - if ( (sn == null ) || (sn.length() == 0) ) - { - throw new org.omg.CosNaming.NamingContextPackage.InvalidName(); - } - org.omg.CosNaming.NameComponent[] theNameComponents = - getINSImpl().convertToNameComponent( sn ); - if( ( theNameComponents == null ) || (theNameComponents.length == 0 ) ) - { - throw new org.omg.CosNaming.NamingContextPackage.InvalidName(); - } - theObject = resolve( theNameComponents ); - return theObject; - } - - /** - * This is a Debugging Method - */ - public boolean IsEmpty() - { - return this.theHashtable.isEmpty(); - } - - /** - * This is a Debugging Method - */ - public void printSize( ) - { - System.out.println( "Hashtable Size = " + theHashtable.size( ) ); - java.util.Enumeration e = theHashtable.keys( ); - for( ; e.hasMoreElements(); ) - { - InternalBindingValue thevalue = - (InternalBindingValue) this.theHashtable.get(e.nextElement()); - if( thevalue != null ) - { - System.out.println( "value = " + thevalue.strObjectRef); - } - } - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/PersistentBindingIterator.java b/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/PersistentBindingIterator.java deleted file mode 100644 index 7c43e6baea0..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/PersistentBindingIterator.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.naming.pcosnaming; - -// Import general CORBA classes -import org.omg.CORBA.SystemException; -import org.omg.CORBA.ORB; -import org.omg.CORBA.INTERNAL; - -// Get org.omg.CosNaming Types -import org.omg.CosNaming.Binding; -import org.omg.CosNaming.BindingType; -import org.omg.CosNaming.BindingTypeHolder; -import org.omg.CosNaming.NameComponent; -import org.omg.PortableServer.POA; - -// Get base implementation -import com.sun.corba.se.impl.naming.pcosnaming.NamingContextImpl; -import com.sun.corba.se.impl.naming.pcosnaming.InternalBindingValue; - -import com.sun.corba.se.impl.naming.cosnaming.BindingIteratorImpl; - -// Get a hash table -import java.util.Hashtable; -import java.util.Enumeration; - -/** - * Class TransientBindingIterator implements the abstract methods - * defined by BindingIteratorImpl, to use with the TransientNamingContext - * implementation of the NamingContextImpl. The TransientBindingIterator - * implementation receives a hash table of InternalBindingValues, and uses - * an Enumeration to iterate over the contents of the hash table. - * @see BindingIteratorImpl - * @see TransientNamingContext - */ -public class PersistentBindingIterator extends BindingIteratorImpl -{ - private POA biPOA; - /** - * Constructs a new PersistentBindingIterator object. - * @param orb a org.omg.CORBA.ORB object. - * @param aTable A hashtable containing InternalBindingValues which is - * the content of the PersistentNamingContext. - * @exception Exception a Java exception thrown of the base class cannot - * initialize. - */ - public PersistentBindingIterator(org.omg.CORBA.ORB orb, Hashtable aTable, - POA thePOA ) throws java.lang.Exception - { - super(orb); - this.orb = orb; - theHashtable = aTable; - theEnumeration = this.theHashtable.keys(); - currentSize = this.theHashtable.size(); - biPOA = thePOA; - } - - /** - * Returns the next binding in the NamingContext. Uses the enumeration - * object to determine if there are more bindings and if so, returns - * the next binding from the InternalBindingValue. - * @param b The Binding as an out parameter. - * @return true if there were more bindings. - */ - final public boolean NextOne(org.omg.CosNaming.BindingHolder b) - { - // If there are more elements get the next element - boolean hasMore = theEnumeration.hasMoreElements(); - if (hasMore) { - InternalBindingKey theBindingKey = - ((InternalBindingKey)theEnumeration.nextElement()); - InternalBindingValue theElement = - (InternalBindingValue)theHashtable.get( theBindingKey ); - NameComponent n = new NameComponent( theBindingKey.id, theBindingKey.kind ); - NameComponent[] nlist = new NameComponent[1]; - nlist[0] = n; - BindingType theType = theElement.theBindingType; - - b.value = - new Binding( nlist, theType ); - } else { - // Return empty but marshalable binding - b.value = new Binding(new NameComponent[0],BindingType.nobject); - } - return hasMore; - } - - /** - * Destroys this BindingIterator by disconnecting from the ORB - * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. - */ - final public void Destroy() - { - // Remove the object from the Active Object Map. - try { - byte[] objectId = biPOA.servant_to_id( this ); - if( objectId != null ) { - biPOA.deactivate_object( objectId ); - } - } - catch( Exception e ) { - throw new INTERNAL( "Exception in BindingIterator.Destroy " + e ); - } - } - - /** - * Returns the remaining number of elements in the iterator. - * @return the remaining number of elements in the iterator. - */ - public final int RemainingElements() { - return currentSize; - } - - private int currentSize; - private Hashtable theHashtable; - private Enumeration theEnumeration; - private org.omg.CORBA.ORB orb; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/ServantManagerImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/ServantManagerImpl.java deleted file mode 100644 index 4a2fff6b559..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/ServantManagerImpl.java +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.naming.pcosnaming; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; -import java.util.Hashtable; - -import org.omg.CORBA.Policy; -import org.omg.CORBA.LocalObject; - -import org.omg.PortableServer.POA; -import org.omg.PortableServer.Servant; -import org.omg.PortableServer.ForwardRequest; -import org.omg.PortableServer.ServantLocator; -import org.omg.PortableServer.LifespanPolicyValue; -import org.omg.PortableServer.RequestProcessingPolicyValue; -import org.omg.PortableServer.IdAssignmentPolicyValue; -import org.omg.PortableServer.ServantRetentionPolicyValue; -import org.omg.PortableServer.ServantLocatorPackage.CookieHolder; - -import com.sun.corba.se.spi.orb.ORB; - -/** - * @author Rohit Garg - * @since JDK1.2 - */ - -public class ServantManagerImpl extends org.omg.CORBA.LocalObject implements ServantLocator -{ - - // computed using serialver tool - - private static final long serialVersionUID = 4028710359865748280L; - private ORB orb; - - private NameService theNameService; - - private File logDir; - - private Hashtable contexts; - - private CounterDB counterDb; - - private int counter; - - private final static String objKeyPrefix = "NC"; - - ServantManagerImpl(ORB orb, File logDir, NameService aNameService) - { - this.logDir = logDir; - this.orb = orb; - // initialize the counter database - counterDb = new CounterDB(logDir); - contexts = new Hashtable(); - theNameService = aNameService; - } - - - public Servant preinvoke(byte[] oid, POA adapter, String operation, - CookieHolder cookie) throws ForwardRequest - { - - String objKey = new String(oid); - - Servant servant = (Servant) contexts.get(objKey); - - if (servant == null) - { - servant = readInContext(objKey); - } - - return servant; - } - - public void postinvoke(byte[] oid, POA adapter, String operation, - java.lang.Object cookie, Servant servant) - { - // nada - } - - public NamingContextImpl readInContext(String objKey) - { - NamingContextImpl context = (NamingContextImpl) contexts.get(objKey); - if( context != null ) - { - // Returning Context from Cache - return context; - } - - File contextFile = new File(logDir, objKey); - if (contextFile.exists()) { - try { - FileInputStream fis = new FileInputStream(contextFile); - ObjectInputStream ois = new ObjectInputStream(fis); - context = (NamingContextImpl) ois.readObject(); - context.setORB( orb ); - context.setServantManagerImpl( this ); - context.setRootNameService( theNameService ); - ois.close(); - } catch (Exception ex) { - } - } - - if (context != null) - { - contexts.put(objKey, context); - } - return context; - } - - public NamingContextImpl addContext(String objKey, - NamingContextImpl context) - { - File contextFile = new File(logDir, objKey); - - if (contextFile.exists()) - { - context = readInContext(objKey); - } - else { - try { - FileOutputStream fos = new FileOutputStream(contextFile); - ObjectOutputStream oos = new ObjectOutputStream(fos); - oos.writeObject(context); - oos.close(); - } catch (Exception ex) { - } - } - try - { - contexts.remove( objKey ); - } - catch( Exception e) - { - } - contexts.put(objKey, context); - - return context; - } - - public void updateContext( String objKey, - NamingContextImpl context ) - { - File contextFile = new File(logDir, objKey); - if (contextFile.exists()) - { - contextFile.delete( ); - contextFile = new File(logDir, objKey); - } - - try { - FileOutputStream fos = new FileOutputStream(contextFile); - ObjectOutputStream oos = new ObjectOutputStream(fos); - oos.writeObject(context); - oos.close(); - } catch (Exception ex) { - ex.printStackTrace( ); - } - } - - public static String getRootObjectKey() - { - return objKeyPrefix + CounterDB.rootCounter; - } - - public String getNewObjectKey() - { - return objKeyPrefix + counterDb.getNextCounter(); - } - - - -} - -class CounterDB implements Serializable -{ - - CounterDB (File logDir) - { - counterFileName = "counter"; - counterFile = new File(logDir, counterFileName); - if (!counterFile.exists()) { - counter = new Integer(rootCounter); - writeCounter(); - } else { - readCounter(); - } - } - - private void readCounter() - { - try { - FileInputStream fis = new FileInputStream(counterFile); - ObjectInputStream ois = new ObjectInputStream(fis); - counter = (Integer) ois.readObject(); - ois.close(); - } catch (Exception ex) { - } - } - - private void writeCounter() - { - try { - counterFile.delete(); - FileOutputStream fos = new FileOutputStream(counterFile); - ObjectOutputStream oos = new ObjectOutputStream(fos); - oos.writeObject(counter); - oos.flush(); - oos.close(); - - } catch (Exception ex) { - } - } - - public synchronized int getNextCounter() - { - int counterVal = counter.intValue(); - counter = new Integer(++counterVal); - writeCounter(); - - return counterVal; - } - - - - private Integer counter; - - private static String counterFileName = "counter"; - - private transient File counterFile; - - public final static int rootCounter = 0; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/NullServantImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/oa/NullServantImpl.java deleted file mode 100644 index 2e911d955ce..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/NullServantImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.oa ; - -import org.omg.CORBA.SystemException ; - -import com.sun.corba.se.spi.oa.NullServant ; - -public class NullServantImpl implements NullServant -{ - private SystemException sysex ; - - public NullServantImpl( SystemException ex ) - { - this.sysex = ex ; - } - - public SystemException getException() - { - return sysex ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/AOMEntry.java b/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/AOMEntry.java deleted file mode 100644 index d906afef923..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/AOMEntry.java +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.oa.poa ; - -import org.omg.CORBA.INTERNAL ; - -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.spi.orbutil.fsm.Action ; -import com.sun.corba.se.spi.orbutil.fsm.ActionBase ; -import com.sun.corba.se.spi.orbutil.fsm.Guard ; -import com.sun.corba.se.spi.orbutil.fsm.GuardBase ; -import com.sun.corba.se.spi.orbutil.fsm.State ; -import com.sun.corba.se.spi.orbutil.fsm.StateImpl ; -import com.sun.corba.se.spi.orbutil.fsm.Input ; -import com.sun.corba.se.spi.orbutil.fsm.InputImpl ; -import com.sun.corba.se.spi.orbutil.fsm.FSM ; -import com.sun.corba.se.spi.orbutil.fsm.FSMImpl ; -import com.sun.corba.se.spi.orbutil.fsm.StateEngine ; -import com.sun.corba.se.spi.orbutil.fsm.StateEngineFactory ; - -import com.sun.corba.se.impl.orbutil.concurrent.Mutex ; -import com.sun.corba.se.impl.orbutil.concurrent.CondVar ; - -import org.omg.CORBA.SystemException ; - -import org.omg.PortableServer.POAPackage.ObjectAlreadyActive ; - -/** AOMEntry represents a Servant or potential Servant in the ActiveObjectMap. -* It may be in several states to allow for long incarnate or etherealize operations. -* The methods on this class mostly represent input symbols to the state machine -* that controls the lifecycle of the entry. A library is used to build the state -* machine rather than the more usual state pattern so that the state machine -* transitions are explicitly visible. -*/ -public class AOMEntry extends FSMImpl { - private final Thread[] etherealizer ; // The actual etherealize operation - // for this entry. It is - // represented as a Thread because - // the POA.deactivate_object never - // waits for the completion. - private final int[] counter ; // single element holder for counter - // accessed in actions - private final CondVar wait ; // accessed in actions - - final POAImpl poa ; - - public static final State INVALID = new StateImpl( "Invalid" ) ; - public static final State INCARN = new StateImpl( "Incarnating" ) { - public void postAction( FSM fsm ) { - AOMEntry entry = (AOMEntry)fsm ; - entry.wait.broadcast() ; - } - }; - public static final State VALID = new StateImpl( "Valid" ) ; - public static final State ETHP = new StateImpl( "EtherealizePending" ) ; - public static final State ETH = new StateImpl( "Etherealizing" ) { - public void preAction( FSM fsm ) { - AOMEntry entry = (AOMEntry)fsm ; - Thread etherealizer = entry.etherealizer[0] ; - if (etherealizer != null) - etherealizer.start() ; - } - - public void postAction( FSM fsm ) { - AOMEntry entry = (AOMEntry)fsm ; - entry.wait.broadcast() ; - } - }; - public static final State DESTROYED = new StateImpl( "Destroyed" ) ; - - static final Input START_ETH = new InputImpl( "startEtherealize" ) ; - static final Input ETH_DONE = new InputImpl( "etherealizeDone" ) ; - static final Input INC_DONE = new InputImpl( "incarnateDone" ) ; - static final Input INC_FAIL = new InputImpl( "incarnateFailure" ) ; - static final Input ACTIVATE = new InputImpl( "activateObject" ) ; - static final Input ENTER = new InputImpl( "enter" ) ; - static final Input EXIT = new InputImpl( "exit" ) ; - - private static Action incrementAction = new ActionBase( "increment" ) { - public void doIt( FSM fsm, Input in ) { - AOMEntry entry = (AOMEntry)fsm ; - entry.counter[0]++ ; - } - } ; - - private static Action decrementAction = new ActionBase( "decrement" ) { - public void doIt( FSM fsm, Input in ) { - AOMEntry entry = (AOMEntry)fsm ; - if (entry.counter[0] > 0) - entry.counter[0]-- ; - else - throw entry.poa.lifecycleWrapper().aomEntryDecZero() ; - } - } ; - - private static Action throwIllegalStateExceptionAction = new ActionBase( - "throwIllegalStateException" ) { - public void doIt( FSM fsm, Input in ) { - throw new IllegalStateException( - "No transitions allowed from the DESTROYED state" ) ; - } - } ; - - private static Action oaaAction = new ActionBase( "throwObjectAlreadyActive" ) { - public void doIt( FSM fsm, Input in ) { - throw new RuntimeException( new ObjectAlreadyActive() ) ; - } - } ; - - private static Guard waitGuard = new GuardBase( "wait" ) { - public Guard.Result evaluate( FSM fsm, Input in ) { - AOMEntry entry = (AOMEntry)fsm ; - try { - entry.wait.await() ; - } catch (InterruptedException exc) { - // XXX Log this - // NO-OP - } - - return Guard.Result.DEFERED ; - } - } ; - - - private static class CounterGuard extends GuardBase { - private int value ; - - public CounterGuard( int value ) - { - super( "counter>" + value ) ; - this.value = value ; - } - - public Guard.Result evaluate( FSM fsm, Input in ) - { - AOMEntry entry = (AOMEntry)fsm ; - return Guard.Result.convert( entry.counter[0] > value ) ; - } - } ; - - private static GuardBase greaterZeroGuard = new CounterGuard( 0 ) ; - private static Guard zeroGuard = new Guard.Complement( greaterZeroGuard ) ; - private static GuardBase greaterOneGuard = new CounterGuard( 1 ) ; - private static Guard oneGuard = new Guard.Complement( greaterOneGuard ) ; - - private static StateEngine engine ; - - static { - engine = StateEngineFactory.create() ; - - // State, Input, Guard, Action, new State - - engine.add( INVALID, ENTER, incrementAction, INCARN ) ; - engine.add( INVALID, ACTIVATE, null, VALID ) ; - engine.setDefault( INVALID ) ; - - engine.add( INCARN, ENTER, waitGuard, null, INCARN ) ; - engine.add( INCARN, EXIT, null, INCARN ) ; - engine.add( INCARN, START_ETH, waitGuard, null, INCARN ) ; - engine.add( INCARN, INC_DONE, null, VALID ) ; - engine.add( INCARN, INC_FAIL, decrementAction, INVALID ) ; - engine.add( INCARN, ACTIVATE, oaaAction, INCARN ) ; - - engine.add( VALID, ENTER, incrementAction, VALID ) ; - engine.add( VALID, EXIT, decrementAction, VALID ) ; - engine.add( VALID, START_ETH, greaterZeroGuard, null, ETHP ) ; - engine.add( VALID, START_ETH, zeroGuard, null, ETH ) ; - engine.add( VALID, ACTIVATE, oaaAction, VALID ) ; - - engine.add( ETHP, ENTER, waitGuard, null, ETHP ) ; - engine.add( ETHP, START_ETH, null, ETHP ) ; - engine.add( ETHP, EXIT, greaterOneGuard, decrementAction, ETHP ) ; - engine.add( ETHP, EXIT, oneGuard, decrementAction, ETH ) ; - engine.add( ETHP, ACTIVATE, oaaAction, ETHP ) ; - - engine.add( ETH, START_ETH, null, ETH ) ; - engine.add( ETH, ETH_DONE, null, DESTROYED ) ; - engine.add( ETH, ACTIVATE, oaaAction, ETH ) ; - engine.add( ETH, ENTER, waitGuard, null, ETH ) ; - - engine.setDefault( DESTROYED, throwIllegalStateExceptionAction, DESTROYED ) ; - - engine.done() ; - } - - public AOMEntry( POAImpl poa ) - { - super( engine, INVALID, ((ORB)poa.getORB()).poaFSMDebugFlag ) ; - this.poa = poa ; - etherealizer = new Thread[1] ; - etherealizer[0] = null ; - counter = new int[1] ; - counter[0] = 0 ; - wait = new CondVar( poa.poaMutex, - ((ORB)poa.getORB()).poaConcurrencyDebugFlag ) ; - } - - // Methods that drive the FSM: the real interface to this class - // Most just call the doIt method, but startEtherealize needs - // the etherealizer. - public void startEtherealize( Thread etherealizer ) - { - this.etherealizer[0] = etherealizer ; - doIt( START_ETH ) ; - } - - public void etherealizeComplete() { doIt( ETH_DONE ) ; } - public void incarnateComplete() { doIt( INC_DONE ) ; } - public void incarnateFailure() { doIt( INC_FAIL ) ; } - public void activateObject() throws ObjectAlreadyActive { - try { - doIt( ACTIVATE ) ; - } catch (RuntimeException exc) { - Throwable thr = exc.getCause() ; - if (thr instanceof ObjectAlreadyActive) - throw (ObjectAlreadyActive)thr ; - else - throw exc ; - } - } - public void enter() { doIt( ENTER ) ; } - public void exit() { doIt( EXIT ) ; } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/ActiveObjectMap.java b/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/ActiveObjectMap.java deleted file mode 100644 index f1136df2325..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/ActiveObjectMap.java +++ /dev/null @@ -1,265 +0,0 @@ -/* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.oa.poa; - -import java.util.Set ; -import java.util.HashSet ; -import java.util.Map ; -import java.util.HashMap ; -import java.util.Iterator ; -import java.util.Vector ; - -import org.omg.PortableServer.Servant ; -import org.omg.PortableServer.POAPackage.WrongPolicy ; -import org.omg.CORBA.INTERNAL ; - -/** The ActiveObjectMap maintains associations between servants and - * their keys. There are two variants, to support whether or not - * multiple IDs per servant are allowed. This class suppots bidirectional - * traversal of the key-servant association. Access to an instance of this - * class is serialized by the POA mutex. - */ -public abstract class ActiveObjectMap -{ - public static class Key { - public byte[] id; - - Key(byte[] id) { - this.id = id; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - for(int i = 0; i < id.length; i++) { - buffer.append(Integer.toString((int) id[i], 16)); - if (i != id.length-1) - buffer.append(":"); - } - return buffer.toString(); - } - - public boolean equals(java.lang.Object key) { - if (!(key instanceof Key)) - return false; - Key k = (Key) key; - if (k.id.length != this.id.length) - return false; - for(int i = 0; i < this.id.length; i++) - if (this.id[i] != k.id[i]) - return false; - return true; - } - - // Use the same hash function as for String - public int hashCode() { - int h = 0; - for (int i = 0; i < id.length; i++) - h = 31*h + id[i]; - return h; - } - } - - protected POAImpl poa ; - - protected ActiveObjectMap( POAImpl poa ) - { - this.poa = poa ; - } - - public static ActiveObjectMap create( POAImpl poa, boolean multipleIDsAllowed ) - { - if (multipleIDsAllowed) - return new MultipleObjectMap( poa ) ; - else - return new SingleObjectMap(poa ) ; - } - - private Map keyToEntry = new HashMap() ; // Map< Key, AOMEntry > - private Map entryToServant = new HashMap() ; // Map< AOMEntry, Servant > - private Map servantToEntry = new HashMap() ; // Map< Servant, AOMEntry > - - public final boolean contains(Servant value) - { - return servantToEntry.containsKey( value ) ; - } - - public final boolean containsKey(Key key) - { - return keyToEntry.containsKey(key); - } - - /** get Returbs the entry assigned to the key, or creates a new - * entry in state INVALID if none is present. - */ - public final AOMEntry get(Key key) - { - AOMEntry result = (AOMEntry)keyToEntry.get(key); - if (result == null) { - result = new AOMEntry( poa ) ; - putEntry( key, result ) ; - } - - return result ; - } - - public final Servant getServant( AOMEntry entry ) - { - return (Servant)entryToServant.get( entry ) ; - } - - public abstract Key getKey(AOMEntry value) throws WrongPolicy ; - - public Key getKey(Servant value) throws WrongPolicy - { - AOMEntry entry = (AOMEntry)servantToEntry.get( value ) ; - return getKey( entry ) ; - } - - protected void putEntry( Key key, AOMEntry value ) - { - keyToEntry.put( key, value ) ; - } - - public final void putServant( Servant servant, AOMEntry value ) - { - entryToServant.put( value, servant ) ; - servantToEntry.put( servant, value ) ; - } - - protected abstract void removeEntry( AOMEntry entry, Key key ) ; - - public final void remove( Key key ) - { - AOMEntry entry = (AOMEntry)keyToEntry.remove( key ) ; - Servant servant = (Servant)entryToServant.remove( entry ) ; - if (servant != null) - servantToEntry.remove( servant ) ; - - removeEntry( entry, key ) ; - } - - public abstract boolean hasMultipleIDs(AOMEntry value) ; - - protected void clear() - { - keyToEntry.clear(); - } - - public final Set keySet() - { - return keyToEntry.keySet() ; - } -} - -class SingleObjectMap extends ActiveObjectMap -{ - private Map entryToKey = new HashMap() ; // Map< AOMEntry, Key > - - public SingleObjectMap( POAImpl poa ) - { - super( poa ) ; - } - - public Key getKey(AOMEntry value) throws WrongPolicy - { - return (Key)entryToKey.get( value ) ; - } - - protected void putEntry(Key key, AOMEntry value) - { - super.putEntry( key, value); - - entryToKey.put( value, key ) ; - } - - public boolean hasMultipleIDs(AOMEntry value) - { - return false; - } - - // This case does not need the key. - protected void removeEntry(AOMEntry entry, Key key) - { - entryToKey.remove( entry ) ; - } - - public void clear() - { - super.clear() ; - entryToKey.clear() ; - } -} - -class MultipleObjectMap extends ActiveObjectMap -{ - private Map entryToKeys = new HashMap() ; // Map< AOMEntry, Set< Key > > - - public MultipleObjectMap( POAImpl poa ) - { - super( poa ) ; - } - - public Key getKey(AOMEntry value) throws WrongPolicy - { - throw new WrongPolicy() ; - } - - protected void putEntry(Key key, AOMEntry value) - { - super.putEntry( key, value); - - Set set = (Set)entryToKeys.get( value ) ; - if (set == null) { - set = new HashSet() ; - entryToKeys.put( value, set ) ; - } - set.add( key ) ; - } - - public boolean hasMultipleIDs(AOMEntry value) - { - Set set = (Set)entryToKeys.get( value ) ; - if (set == null) - return false ; - return set.size() > 1 ; - } - - protected void removeEntry(AOMEntry entry, Key key) - { - Set keys = (Set)entryToKeys.get( entry ) ; - if (keys != null) { - keys.remove( key ) ; - if (keys.isEmpty()) - entryToKeys.remove( entry ) ; - } - } - - public void clear() - { - super.clear() ; - entryToKeys.clear() ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/BadServerIdHandler.java b/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/BadServerIdHandler.java deleted file mode 100644 index 5899cd6039a..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/BadServerIdHandler.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.oa.poa; - -import com.sun.corba.se.spi.ior.ObjectKey; - -/** - * The bad server id handler is used to locate persistent objects. - * The Locator object registers the BadServerIdHandler with the ORB - * and when requests for persistent objects for servers (other than - * itself) comes, it throws a ForwardException with the IOR pointing - * to the active server. - */ -public interface BadServerIdHandler -{ - void handle(ObjectKey objectKey) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/DelegateImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/DelegateImpl.java deleted file mode 100644 index 2cc2cad7e9d..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/DelegateImpl.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.oa.poa; - -import java.util.EmptyStackException; - -import org.omg.PortableServer.*; - -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; - -import com.sun.corba.se.impl.logging.POASystemException ; - -public class DelegateImpl implements org.omg.PortableServer.portable.Delegate -{ - private ORB orb ; - private POASystemException wrapper ; - private POAFactory factory; - - public DelegateImpl(ORB orb, POAFactory factory){ - this.orb = orb ; - this.wrapper = POASystemException.get( orb, - CORBALogDomains.OA ) ; - this.factory = factory; - } - - public org.omg.CORBA.ORB orb(Servant self) - { - return orb; - } - - public org.omg.CORBA.Object this_object(Servant self) - { - byte[] oid; - POA poa; - try { - oid = orb.peekInvocationInfo().id(); - poa = (POA)orb.peekInvocationInfo().oa(); - String repId = self._all_interfaces(poa,oid)[0] ; - return poa.create_reference_with_id(oid, repId); - } catch (EmptyStackException notInInvocationE) { - //Not within an invocation context - POAImpl defaultPOA = null; - try { - defaultPOA = (POAImpl)self._default_POA(); - } catch (ClassCastException exception){ - throw wrapper.defaultPoaNotPoaimpl( exception ) ; - } - - try { - if (defaultPOA.getPolicies().isImplicitlyActivated() || - (defaultPOA.getPolicies().isUniqueIds() && - defaultPOA.getPolicies().retainServants())) { - return defaultPOA.servant_to_reference(self); - } else { - throw wrapper.wrongPoliciesForThisObject() ; - } - } catch ( org.omg.PortableServer.POAPackage.ServantNotActive e) { - throw wrapper.thisObjectServantNotActive( e ) ; - } catch ( org.omg.PortableServer.POAPackage.WrongPolicy e) { - throw wrapper.thisObjectWrongPolicy( e ) ; - } - } catch (ClassCastException e) { - throw wrapper.defaultPoaNotPoaimpl( e ) ; - } - } - - public POA poa(Servant self) - { - try { - return (POA)orb.peekInvocationInfo().oa(); - } catch (EmptyStackException exception){ - POA returnValue = factory.lookupPOA(self); - if (returnValue != null) { - return returnValue; - } - - throw wrapper.noContext( exception ) ; - } - } - - public byte[] object_id(Servant self) - { - try{ - return orb.peekInvocationInfo().id(); - } catch (EmptyStackException exception){ - throw wrapper.noContext(exception) ; - } - } - - public POA default_POA(Servant self) - { - return factory.getRootPOA(); - } - - public boolean is_a(Servant self, String repId) - { - String[] repositoryIds = self._all_interfaces(poa(self),object_id(self)); - for ( int i=0; icreate_POA - * Section 3.3.8.2 - */ - public POA create_POA(String name, POAManager - theManager, Policy[] policies) throws AdapterAlreadyExists, - InvalidPolicy - { - try { - lock() ; - - if (debug) { - ORBUtility.dprint( this, "Calling create_POA(name=" + name + - " theManager=" + theManager + " policies=" + policies + - ") on poa " + this ) ; - } - - // We cannot create children of a POA that is (being) destroyed. - // This has been added to the CORBA 3.0 spec. - if (state > STATE_RUN) - throw omgLifecycleWrapper().createPoaDestroy() ; - - POAImpl poa = (POAImpl)(children.get(name)) ; - - if (poa == null) { - poa = new POAImpl( name, this, getORB(), STATE_START ) ; - } - - try { - poa.lock() ; - - if (debug) { - ORBUtility.dprint( this, - "Calling create_POA: new poa is " + poa ) ; - } - - if ((poa.state != STATE_START) && (poa.state != STATE_INIT)) - throw new AdapterAlreadyExists(); - - POAManagerImpl newManager = (POAManagerImpl)theManager ; - if (newManager == null) - newManager = new POAManagerImpl( manager.getFactory(), - manager.getPIHandler() ); - - int defaultCopierId = - getORB().getCopierManager().getDefaultId() ; - Policies POAPolicies = - new Policies( policies, defaultCopierId ) ; - - poa.initialize( newManager, POAPolicies ) ; - - return poa; - } finally { - poa.unlock() ; - } - } finally { - unlock() ; - } - } - - /** - * find_POA - * Section 3.3.8.3 - */ - public POA find_POA(String name, boolean activate) - throws AdapterNonExistent - { - POAImpl found = null ; - AdapterActivator act = null ; - - lock() ; - - if (debug) { - ORBUtility.dprint( this, "Calling find_POA(name=" + name + - " activate=" + activate + ") on poa " + this ) ; - } - - found = (POAImpl) children.get(name); - - if (found != null) { - if (debug) { - ORBUtility.dprint( this, - "Calling find_POA: found poa " + found ) ; - } - - try { - found.lock() ; - - // Do not hold the parent POA lock while - // waiting for child to complete initialization. - unlock() ; - - // Make sure that the child has completed its initialization, - // if it was created by an AdapterActivator, otherwise throw - // a standard TRANSIENT exception with minor code 4 (see - // CORBA 3.0 11.3.9.3, in reference to unknown_adapter) - if (!found.waitUntilRunning()) - throw omgLifecycleWrapper().poaDestroyed() ; - - // Note that found may be in state DESTROYING or DESTROYED at - // this point. That's OK, since destruction could start at - // any time. - } finally { - found.unlock() ; - } - } else { - try { - if (debug) { - ORBUtility.dprint( this, - "Calling find_POA: no poa found" ) ; - } - - if (activate && (activator != null)) { - // Create a child, but don't initialize it. The newly - // created POA will be in state STATE_START, which will - // cause other calls to find_POA that are creating the same - // POA to block on the waitUntilRunning call above. - // Initialization must be completed by a call to create_POA - // inside the unknown_adapter upcall. Note that - // this.poaMutex must be held here so that this.children - // can be safely updated. The state is set to STATE_INIT - // so that initialize can make the correct state transition - // when create_POA is called inside the AdapterActivator. - // This avoids activating the new POA too soon - // by transitioning to STATE_RUN after unknown_adapter - // returns. - found = new POAImpl( name, this, getORB(), STATE_INIT ) ; - - if (debug) { - ORBUtility.dprint( this, - "Calling find_POA: created poa " + found ) ; - } - - act = activator ; - } else { - throw new AdapterNonExistent(); - } - } finally { - unlock() ; - } - } - - // assert (found != null) - // assert not holding this.poaMutex OR found.poaMutex - - // We must not hold either this.poaMutex or found.poaMutex here while - // waiting for intialization of found to complete to prevent possible - // deadlocks. - - if (act != null) { - boolean status = false ; - boolean adapterResult = false ; - - if (debug) { - ORBUtility.dprint( this, - "Calling find_POA: calling AdapterActivator" ) ; - } - - try { - // Prevent more than one thread at a time from executing in act - // in case act is shared between multiple POAs. - synchronized (act) { - status = act.unknown_adapter(this, name); - } - } catch (SystemException exc) { - throw omgLifecycleWrapper().adapterActivatorException( exc, - name, poaId.toString() ) ; - } catch (Throwable thr) { - // ignore most non-system exceptions, but log them for - // diagnostic purposes. - lifecycleWrapper().unexpectedException( thr, this.toString() ) ; - - if (thr instanceof ThreadDeath) - throw (ThreadDeath)thr ; - } finally { - // At this point, we have completed adapter activation. - // Whether this was successful or not, we must call - // destroyIfNotInitDone so that calls to enter() and create_POA() - // that are waiting can execute again. Failing to do this - // will cause the system to hang in complex tests. - adapterResult = found.destroyIfNotInitDone() ; - } - - if (status) { - if (!adapterResult) - throw omgLifecycleWrapper().adapterActivatorException( name, - poaId.toString() ) ; - } else { - if (debug) { - ORBUtility.dprint( this, - "Calling find_POA: AdapterActivator returned false" ) ; - } - - // OMG Issue 3740 is resolved to throw AdapterNonExistent if - // unknown_adapter() returns false. - throw new AdapterNonExistent(); - } - } - - return found; - } - - /** - * destroy - * Section 3.3.8.4 - */ - public void destroy(boolean etherealize, boolean wait_for_completion) - { - // This is to avoid deadlock - if (wait_for_completion && getORB().isDuringDispatch()) { - throw lifecycleWrapper().destroyDeadlock() ; - } - - DestroyThread destroyer = new DestroyThread( etherealize, debug ); - destroyer.doIt( this, wait_for_completion ) ; - } - - /** - * create_thread_policy - * Section 3.3.8.5 - */ - public ThreadPolicy create_thread_policy( - ThreadPolicyValue value) - { - return new ThreadPolicyImpl(value); - } - - /** - * create_lifespan_policy - * Section 3.3.8.5 - */ - public LifespanPolicy create_lifespan_policy( - LifespanPolicyValue value) - { - return new LifespanPolicyImpl(value); - } - - /** - * create_id_uniqueness_policy - * Section 3.3.8.5 - */ - public IdUniquenessPolicy create_id_uniqueness_policy( - IdUniquenessPolicyValue value) - { - return new IdUniquenessPolicyImpl(value); - } - - /** - * create_id_assignment_policy - * Section 3.3.8.5 - */ - public IdAssignmentPolicy create_id_assignment_policy( - IdAssignmentPolicyValue value) - { - return new IdAssignmentPolicyImpl(value); - } - - /** - * create_implicit_activation_policy - * Section 3.3.8.5 - */ - public ImplicitActivationPolicy create_implicit_activation_policy( - ImplicitActivationPolicyValue value) - { - return new ImplicitActivationPolicyImpl(value); - } - - /** - * create_servant_retention_policy - * Section 3.3.8.5 - */ - public ServantRetentionPolicy create_servant_retention_policy( - ServantRetentionPolicyValue value) - { - return new ServantRetentionPolicyImpl(value); - } - - /** - * create_request_processing_policy - * Section 3.3.8.5 - */ - public RequestProcessingPolicy create_request_processing_policy( - RequestProcessingPolicyValue value) - { - return new RequestProcessingPolicyImpl(value); - } - - /** - * the_name - * Section 3.3.8.6 - */ - public String the_name() - { - try { - lock() ; - - return name; - } finally { - unlock() ; - } - } - - /** - * the_parent - * Section 3.3.8.7 - */ - public POA the_parent() - { - try { - lock() ; - - return parent; - } finally { - unlock() ; - } - } - - /** - * the_children - */ - public org.omg.PortableServer.POA[] the_children() - { - try { - lock() ; - - Collection coll = children.values() ; - int size = coll.size() ; - POA[] result = new POA[ size ] ; - int index = 0 ; - Iterator iter = coll.iterator() ; - while (iter.hasNext()) { - POA poa = (POA)(iter.next()) ; - result[ index++ ] = poa ; - } - - return result ; - } finally { - unlock() ; - } - } - - /** - * the_POAManager - * Section 3.3.8.8 - */ - public POAManager the_POAManager() - { - try { - lock() ; - - return manager; - } finally { - unlock() ; - } - } - - /** - * the_activator - * Section 3.3.8.9 - */ - public AdapterActivator the_activator() - { - try { - lock() ; - - return activator; - } finally { - unlock() ; - } - } - - /** - * the_activator - * Section 3.3.8.9 - */ - public void the_activator(AdapterActivator activator) - { - try { - lock() ; - - if (debug) { - ORBUtility.dprint( this, "Calling the_activator on poa " + - this + " activator=" + activator ) ; - } - - this.activator = activator; - } finally { - unlock() ; - } - } - - /** - * get_servant_manager - * Section 3.3.8.10 - */ - public ServantManager get_servant_manager() throws WrongPolicy - { - try { - lock() ; - - return mediator.getServantManager() ; - } finally { - unlock() ; - } - } - - /** - * set_servant_manager - * Section 3.3.8.10 - */ - public void set_servant_manager(ServantManager servantManager) - throws WrongPolicy - { - try { - lock() ; - - if (debug) { - ORBUtility.dprint( this, "Calling set_servant_manager on poa " + - this + " servantManager=" + servantManager ) ; - } - - mediator.setServantManager( servantManager ) ; - } finally { - unlock() ; - } - } - - /** - * get_servant - * Section 3.3.8.12 - */ - public Servant get_servant() throws NoServant, WrongPolicy - { - try { - lock() ; - - return mediator.getDefaultServant() ; - } finally { - unlock() ; - } - } - - /** - * set_servant - * Section 3.3.8.13 - */ - public void set_servant(Servant defaultServant) - throws WrongPolicy - { - try { - lock() ; - - if (debug) { - ORBUtility.dprint( this, "Calling set_servant on poa " + - this + " defaultServant=" + defaultServant ) ; - } - - mediator.setDefaultServant( defaultServant ) ; - } finally { - unlock() ; - } - } - - /** - * activate_object - * Section 3.3.8.14 - */ - public byte[] activate_object(Servant servant) - throws ServantAlreadyActive, WrongPolicy - { - try { - lock() ; - - if (debug) { - ORBUtility.dprint( this, - "Calling activate_object on poa " + this + - " (servant=" + servant + ")" ) ; - } - - // Allocate a new system-generated object-id. - // This will throw WrongPolicy if not SYSTEM_ID - // policy. - byte[] id = mediator.newSystemId(); - - try { - mediator.activateObject( id, servant ) ; - } catch (ObjectAlreadyActive oaa) { - // This exception can not occur in this case, - // since id is always brand new. - // - } - - return id ; - } finally { - if (debug) { - ORBUtility.dprint( this, - "Exiting activate_object on poa " + this ) ; - } - - unlock() ; - } - } - - /** - * activate_object_with_id - * Section 3.3.8.15 - */ - public void activate_object_with_id(byte[] id, - Servant servant) - throws ObjectAlreadyActive, ServantAlreadyActive, WrongPolicy - { - try { - lock() ; - - if (debug) { - ORBUtility.dprint( this, - "Calling activate_object_with_id on poa " + this + - " (servant=" + servant + " id=" + id + ")" ) ; - } - - // Clone the id to avoid possible errors due to aliasing - // (e.g. the client passes the id in and then changes it later). - byte[] idClone = (byte[])(id.clone()) ; - - mediator.activateObject( idClone, servant ) ; - } finally { - if (debug) { - ORBUtility.dprint( this, - "Exiting activate_object_with_id on poa " + this ) ; - } - - unlock() ; - } - } - - /** - * deactivate_object - * 3.3.8.16 - */ - public void deactivate_object(byte[] id) - throws ObjectNotActive, WrongPolicy - { - try { - lock() ; - - if (debug) { - ORBUtility.dprint( this, - "Calling deactivate_object on poa " + this + - " (id=" + id + ")" ) ; - } - - mediator.deactivateObject( id ) ; - } finally { - if (debug) { - ORBUtility.dprint( this, - "Exiting deactivate_object on poa " + this ) ; - } - - unlock() ; - } - } - - /** - * create_reference - * 3.3.8.17 - */ - public org.omg.CORBA.Object create_reference(String repId) - throws WrongPolicy - { - try { - lock() ; - - if (debug) { - ORBUtility.dprint( this, "Calling create_reference(repId=" + - repId + ") on poa " + this ) ; - } - - return makeObject( repId, mediator.newSystemId()) ; - } finally { - unlock() ; - } - } - - /** - * create_reference_with_id - * 3.3.8.18 - */ - public org.omg.CORBA.Object - create_reference_with_id(byte[] oid, String repId) - { - try { - lock() ; - - if (debug) { - ORBUtility.dprint( this, - "Calling create_reference_with_id(oid=" + - oid + " repId=" + repId + ") on poa " + this ) ; - } - - // Clone the id to avoid possible errors due to aliasing - // (e.g. the client passes the id in and then changes it later). - byte[] idClone = (byte[])(oid.clone()) ; - - return makeObject( repId, idClone ) ; - } finally { - unlock() ; - } - } - - /** - * servant_to_id - * 3.3.8.19 - */ - public byte[] servant_to_id(Servant servant) - throws ServantNotActive, WrongPolicy - { - try { - lock() ; - - if (debug) { - ORBUtility.dprint( this, "Calling servant_to_id(servant=" + - servant + ") on poa " + this ) ; - } - - return mediator.servantToId( servant ) ; - } finally { - unlock() ; - } - } - - /** - * servant_to_reference - * 3.3.8.20 - */ - public org.omg.CORBA.Object servant_to_reference(Servant servant) - throws ServantNotActive, WrongPolicy - { - try { - lock() ; - - if (debug) { - ORBUtility.dprint( this, - "Calling servant_to_reference(servant=" + - servant + ") on poa " + this ) ; - } - - byte[] oid = mediator.servantToId(servant); - String repId = servant._all_interfaces( this, oid )[0] ; - return create_reference_with_id(oid, repId); - } finally { - unlock() ; - } - } - - /** - * reference_to_servant - * 3.3.8.21 - */ - public Servant reference_to_servant(org.omg.CORBA.Object reference) - throws ObjectNotActive, WrongPolicy, WrongAdapter - { - try { - lock() ; - - if (debug) { - ORBUtility.dprint( this, - "Calling reference_to_servant(reference=" + - reference + ") on poa " + this ) ; - } - - if ( state >= STATE_DESTROYING ) { - throw lifecycleWrapper().adapterDestroyed() ; - } - - // reference_to_id should throw WrongAdapter - // if the objref was not created by this POA - byte [] id = internalReferenceToId(reference); - - return mediator.idToServant( id ) ; - } finally { - unlock() ; - } - } - - /** - * reference_to_id - * 3.3.8.22 - */ - public byte[] reference_to_id(org.omg.CORBA.Object reference) - throws WrongAdapter, WrongPolicy - { - try { - lock() ; - - if (debug) { - ORBUtility.dprint( this, "Calling reference_to_id(reference=" + - reference + ") on poa " + this ) ; - } - - if( state >= STATE_DESTROYING ) { - throw lifecycleWrapper().adapterDestroyed() ; - } - - return internalReferenceToId( reference ) ; - } finally { - unlock() ; - } - } - - /** - * id_to_servant - * 3.3.8.23 - */ - public Servant id_to_servant(byte[] id) - throws ObjectNotActive, WrongPolicy - { - try { - lock() ; - - if (debug) { - ORBUtility.dprint( this, "Calling id_to_servant(id=" + - id + ") on poa " + this ) ; - } - - if( state >= STATE_DESTROYING ) { - throw lifecycleWrapper().adapterDestroyed() ; - } - return mediator.idToServant( id ) ; - } finally { - unlock() ; - } - } - - /** - * id_to_reference - * 3.3.8.24 - */ - public org.omg.CORBA.Object id_to_reference(byte[] id) - throws ObjectNotActive, WrongPolicy - - { - try { - lock() ; - - if (debug) { - ORBUtility.dprint( this, "Calling id_to_reference(id=" + - id + ") on poa " + this ) ; - } - - if( state >= STATE_DESTROYING ) { - throw lifecycleWrapper().adapterDestroyed() ; - } - - Servant s = mediator.idToServant( id ) ; - String repId = s._all_interfaces( this, id )[0] ; - return makeObject(repId, id ); - } finally { - unlock() ; - } - } - - /** - * id - * 11.3.8.26 in ptc/00-08-06 - */ - public byte[] id() - { - try { - lock() ; - - return getAdapterId() ; - } finally { - unlock() ; - } - } - - //*************************************************************** - //Implementation of ObjectAdapter interface - //*************************************************************** - - public Policy getEffectivePolicy( int type ) - { - return mediator.getPolicies().get_effective_policy( type ) ; - } - - public int getManagerId() - { - return manager.getManagerId() ; - } - - public short getState() - { - return manager.getORTState() ; - } - - public String[] getInterfaces( java.lang.Object servant, byte[] objectId ) - { - Servant serv = (Servant)servant ; - return serv._all_interfaces( this, objectId ) ; - } - - protected ObjectCopierFactory getObjectCopierFactory() - { - int copierId = mediator.getPolicies().getCopierId() ; - CopierManager cm = getORB().getCopierManager() ; - return cm.getObjectCopierFactory( copierId ) ; - } - - public void enter() throws OADestroyed - { - try { - lock() ; - - if (debug) { - ORBUtility.dprint( this, "Calling enter on poa " + this ) ; - } - - // Avoid deadlock if this is the thread that is processing the - // POA.destroy because this is the only thread that can notify - // waiters on beingDestroyedCV. This can happen if an - // etherealize upcall invokes a method on a colocated object - // served by this POA. - while ((state == STATE_DESTROYING) && - (isDestroying.get() == Boolean.FALSE)) { - try { - beingDestroyedCV.await(); - } catch (InterruptedException ex) { - // NO-OP - } - } - - if (!waitUntilRunning()) - throw new OADestroyed() ; - - invocationCount++; - } finally { - if (debug) { - ORBUtility.dprint( this, "Exiting enter on poa " + this ) ; - } - - unlock() ; - } - - manager.enter(); - } - - public void exit() - { - try { - lock() ; - - if (debug) { - ORBUtility.dprint( this, "Calling exit on poa " + this ) ; - } - - invocationCount--; - - if ((invocationCount == 0) && (state == STATE_DESTROYING)) { - invokeCV.broadcast(); - } - } finally { - if (debug) { - ORBUtility.dprint( this, "Exiting exit on poa " + this ) ; - } - - unlock() ; - } - - manager.exit(); - } - - public void getInvocationServant( OAInvocationInfo info ) - { - try { - lock() ; - - if (debug) { - ORBUtility.dprint( this, - "Calling getInvocationServant on poa " + this ) ; - } - - java.lang.Object servant = null ; - - try { - servant = mediator.getInvocationServant( info.id(), - info.getOperation() ); - } catch (ForwardRequest freq) { - throw new ForwardException( getORB(), freq.forward_reference ) ; - } - - info.setServant( servant ) ; - } finally { - if (debug) { - ORBUtility.dprint( this, - "Exiting getInvocationServant on poa " + this ) ; - } - - unlock() ; - } - } - - public org.omg.CORBA.Object getLocalServant( byte[] objectId ) - { - return null ; - } - - /** Called from the subcontract to let this POA cleanup after an - * invocation. Note: If getServant was called, then returnServant - * MUST be called, even in the case of exceptions. This may be - * called multiple times for a single request. - */ - public void returnServant() - { - try { - lock() ; - - if (debug) { - ORBUtility.dprint( this, - "Calling returnServant on poa " + this ) ; - } - - mediator.returnServant(); - } catch (Throwable thr) { - if (debug) { - ORBUtility.dprint( this, - "Exception " + thr + " in returnServant on poa " + this ) ; - } - - if (thr instanceof Error) - throw (Error)thr ; - else if (thr instanceof RuntimeException) - throw (RuntimeException)thr ; - - } finally { - if (debug) { - ORBUtility.dprint( this, - "Exiting returnServant on poa " + this ) ; - } - - unlock() ; - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAManagerImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAManagerImpl.java deleted file mode 100644 index eb51310fcd3..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAManagerImpl.java +++ /dev/null @@ -1,547 +0,0 @@ -/* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.oa.poa; - -import java.util.Iterator; -import java.util.Collections; -import java.util.Set; -import java.util.HashSet; - -import org.omg.CORBA.LocalObject; -import org.omg.CORBA.CompletionStatus ; - -import org.omg.PortableServer.POAManager; -import org.omg.PortableServer.POAManagerPackage.State; -import org.omg.PortableServer.POA; - -import org.omg.PortableInterceptor.DISCARDING ; -import org.omg.PortableInterceptor.ACTIVE ; -import org.omg.PortableInterceptor.HOLDING ; -import org.omg.PortableInterceptor.INACTIVE ; -import org.omg.PortableInterceptor.NON_EXISTENT ; - -import com.sun.corba.se.spi.protocol.PIHandler ; - -import com.sun.corba.se.impl.logging.POASystemException ; - -import com.sun.corba.se.impl.orbutil.ORBUtility ; - -/** POAManagerImpl is the implementation of the POAManager interface. - * Its public methods are activate(), hold_requests(), discard_requests() - * and deactivate(). - */ - -public class POAManagerImpl extends org.omg.CORBA.LocalObject implements - POAManager -{ - private final POAFactory factory ; // factory which contains global state - // for all POAManagers - private PIHandler pihandler ; // for adapterManagerStateChanged - private State state; // current state of this POAManager - private Set poas = new HashSet(4) ; // all poas controlled by this POAManager - private int nInvocations=0; // Number of invocations in progress - private int nWaiters=0; // Number of threads waiting for - // invocations to complete - private int myId = 0 ; // This POAManager's ID - private boolean debug ; - private boolean explicitStateChange ; // initially false, set true as soon as - // one of activate, hold_request, - // discard_request, or deactivate is called. - - private String stateToString( State state ) - { - switch (state.value()) { - case State._HOLDING : return "State[HOLDING]" ; - case State._ACTIVE : return "State[ACTIVE]" ; - case State._DISCARDING : return "State[DISCARDING]" ; - case State._INACTIVE : return "State[INACTIVE]" ; - } - - return "State[UNKNOWN]" ; - } - - public String toString() - { - return "POAManagerImpl[myId=" + myId + - " state=" + stateToString(state) + - " nInvocations=" + nInvocations + - " nWaiters=" + nWaiters + "]" ; - } - - POAFactory getFactory() - { - return factory ; - } - - PIHandler getPIHandler() - { - return pihandler ; - } - - private void countedWait() - { - try { - if (debug) { - ORBUtility.dprint( this, "Calling countedWait on POAManager " + - this + " nWaiters=" + nWaiters ) ; - } - - nWaiters++ ; - wait(); - } catch ( java.lang.InterruptedException ex ) { - // NOP - } finally { - nWaiters-- ; - - if (debug) { - ORBUtility.dprint( this, "Exiting countedWait on POAManager " + - this + " nWaiters=" + nWaiters ) ; - } - } - } - - private void notifyWaiters() - { - if (debug) { - ORBUtility.dprint( this, "Calling notifyWaiters on POAManager " + - this + " nWaiters=" + nWaiters ) ; - } - - if (nWaiters >0) - notifyAll() ; - } - - public int getManagerId() - { - return myId ; - } - - POAManagerImpl( POAFactory factory, PIHandler pihandler ) - { - this.factory = factory ; - factory.addPoaManager(this); - this.pihandler = pihandler ; - myId = factory.newPOAManagerId() ; - state = State.HOLDING; - debug = factory.getORB().poaDebugFlag ; - explicitStateChange = false ; - - if (debug) { - ORBUtility.dprint( this, "Creating POAManagerImpl " + this ) ; - } - } - - synchronized void addPOA(POA poa) - { - // XXX This is probably not the correct error - if (state.value() == State._INACTIVE) { - POASystemException wrapper = factory.getWrapper(); - throw wrapper.addPoaInactive( CompletionStatus.COMPLETED_NO ) ; - } - - poas.add(poa); - } - - synchronized void removePOA(POA poa) - { - poas.remove(poa); - if ( poas.isEmpty() ) { - factory.removePoaManager(this); - } - } - - public short getORTState() - { - switch (state.value()) { - case State._HOLDING : return HOLDING.value ; - case State._ACTIVE : return ACTIVE.value ; - case State._INACTIVE : return INACTIVE.value ; - case State._DISCARDING : return DISCARDING.value ; - default : return NON_EXISTENT.value ; - } - } - -/**************************************************************************** - * The following four public methods are used to change the POAManager's state. - * - * A note on the design of synchronization code: - * There are 4 places where a thread would need to wait for a condition: - * - in hold_requests, discard_requests, deactivate, enter - * There are 5 places where a thread notifies a condition: - * - in activate, hold_requests, discard_requests, deactivate, exit - * - * Since each notify needs to awaken waiters in several of the 4 places, - * and since wait() in Java has the nice property of releasing the lock - * on its monitor before sleeping, it seemed simplest to have just one - * monitor object: "this". Thus all notifies will awaken all waiters. - * On waking up, each waiter verifies that the condition it was waiting - * for is satisfied, otherwise it goes back into a wait(). - * - ****************************************************************************/ - - /** - * activate - * Spec: pages 3-14 thru 3-18 - */ - public synchronized void activate() - throws org.omg.PortableServer.POAManagerPackage.AdapterInactive - { - explicitStateChange = true ; - - if (debug) { - ORBUtility.dprint( this, - "Calling activate on POAManager " + this ) ; - } - - try { - if ( state.value() == State._INACTIVE ) - throw new org.omg.PortableServer.POAManagerPackage.AdapterInactive(); - - // set the state to ACTIVE - state = State.ACTIVE; - - pihandler.adapterManagerStateChanged( myId, getORTState() ) ; - - // Notify any invocations that were waiting because the previous - // state was HOLDING, as well as notify any threads that were waiting - // inside hold_requests() or discard_requests(). - notifyWaiters(); - } finally { - if (debug) { - ORBUtility.dprint( this, - "Exiting activate on POAManager " + this ) ; - } - } - } - - /** - * hold_requests - * Spec: pages 3-14 thru 3-18 - */ - public synchronized void hold_requests(boolean wait_for_completion) - throws org.omg.PortableServer.POAManagerPackage.AdapterInactive - { - explicitStateChange = true ; - - if (debug) { - ORBUtility.dprint( this, - "Calling hold_requests on POAManager " + this ) ; - } - - try { - if ( state.value() == State._INACTIVE ) - throw new org.omg.PortableServer.POAManagerPackage.AdapterInactive(); - // set the state to HOLDING - state = State.HOLDING; - - pihandler.adapterManagerStateChanged( myId, getORTState() ) ; - - // Notify any threads that were waiting in the wait() inside - // discard_requests. This will cause discard_requests to return - // (which is in conformance with the spec). - notifyWaiters(); - - if ( wait_for_completion ) { - while ( state.value() == State._HOLDING && nInvocations > 0 ) { - countedWait() ; - } - } - } finally { - if (debug) { - ORBUtility.dprint( this, - "Exiting hold_requests on POAManager " + this ) ; - } - } - } - - /** - * discard_requests - * Spec: pages 3-14 thru 3-18 - */ - public synchronized void discard_requests(boolean wait_for_completion) - throws org.omg.PortableServer.POAManagerPackage.AdapterInactive - { - explicitStateChange = true ; - - if (debug) { - ORBUtility.dprint( this, - "Calling hold_requests on POAManager " + this ) ; - } - - try { - if ( state.value() == State._INACTIVE ) - throw new org.omg.PortableServer.POAManagerPackage.AdapterInactive(); - - // set the state to DISCARDING - state = State.DISCARDING; - - pihandler.adapterManagerStateChanged( myId, getORTState() ) ; - - // Notify any invocations that were waiting because the previous - // state was HOLDING. Those invocations will henceforth be rejected with - // a TRANSIENT exception. Also notify any threads that were waiting - // inside hold_requests(). - notifyWaiters(); - - if ( wait_for_completion ) { - while ( state.value() == State._DISCARDING && nInvocations > 0 ) { - countedWait() ; - } - } - } finally { - if (debug) { - ORBUtility.dprint( this, - "Exiting hold_requests on POAManager " + this ) ; - } - } - } - - /** - * deactivate - * Spec: pages 3-14 thru 3-18 - * Note: INACTIVE is a permanent state. - */ - - public void deactivate(boolean etherealize_objects, boolean wait_for_completion) - throws org.omg.PortableServer.POAManagerPackage.AdapterInactive - { - explicitStateChange = true ; - - try { - synchronized( this ) { - if (debug) { - ORBUtility.dprint( this, - "Calling deactivate on POAManager " + this ) ; - } - - if ( state.value() == State._INACTIVE ) - throw new org.omg.PortableServer.POAManagerPackage.AdapterInactive(); - - state = State.INACTIVE; - - pihandler.adapterManagerStateChanged( myId, getORTState() ) ; - - // Notify any invocations that were waiting because the previous - // state was HOLDING. Those invocations will then be rejected with - // an OBJ_ADAPTER exception. Also notify any threads that were waiting - // inside hold_requests() or discard_requests(). - notifyWaiters(); - } - - POAManagerDeactivator deactivator = new POAManagerDeactivator( this, - etherealize_objects, debug ) ; - - if (wait_for_completion) - deactivator.run() ; - else { - Thread thr = new Thread(null, deactivator, "POA-Deactivator-Thread", 0, false) ; - thr.start() ; - } - } finally { - synchronized(this) { - if (debug) { - ORBUtility.dprint( this, - "Exiting deactivate on POAManager " + this ) ; - } - } - } - } - - private class POAManagerDeactivator implements Runnable - { - private boolean etherealize_objects ; - private POAManagerImpl pmi ; - private boolean debug ; - - POAManagerDeactivator( POAManagerImpl pmi, boolean etherealize_objects, - boolean debug ) - { - this.etherealize_objects = etherealize_objects ; - this.pmi = pmi ; - this.debug = debug ; - } - - public void run() - { - try { - synchronized (pmi) { - if (debug) { - ORBUtility.dprint( this, - "Calling run with etherealize_objects=" + - etherealize_objects + " pmi=" + pmi ) ; - } - - while ( pmi.nInvocations > 0 ) { - countedWait() ; - } - } - - if (etherealize_objects) { - Iterator iterator = null ; - - // Make sure that poas cannot change while we copy it! - synchronized (pmi) { - if (debug) { - ORBUtility.dprint( this, - "run: Preparing to etherealize with pmi=" + - pmi ) ; - } - - iterator = (new HashSet(pmi.poas)).iterator(); - } - - while (iterator.hasNext()) { - // Each RETAIN+USE_SERVANT_MGR poa - // must call etherealize for all its objects - ((POAImpl)iterator.next()).etherealizeAll(); - } - - synchronized (pmi) { - if (debug) { - ORBUtility.dprint( this, - "run: removing POAManager and clearing poas " + - "with pmi=" + pmi ) ; - } - - factory.removePoaManager(pmi); - poas.clear(); - } - } - } finally { - if (debug) { - synchronized (pmi) { - ORBUtility.dprint( this, "Exiting run" ) ; - } - } - } - } - } - - /** - * Added according to the spec CORBA V2.3; this returns the - * state of the POAManager - */ - - public org.omg.PortableServer.POAManagerPackage.State get_state () { - return state; - } - -/**************************************************************************** - * The following methods are used on the invocation path. - ****************************************************************************/ - - // called from POA.find_POA before calling - // AdapterActivator.unknown_adapter. - synchronized void checkIfActive() - { - try { - if (debug) { - ORBUtility.dprint( this, - "Calling checkIfActive for POAManagerImpl " + this ) ; - } - - checkState(); - } finally { - if (debug) { - ORBUtility.dprint( this, - "Exiting checkIfActive for POAManagerImpl " + this ) ; - } - } - } - - private void checkState() - { - while ( state.value() != State._ACTIVE ) { - switch ( state.value() ) { - case State._HOLDING: - while ( state.value() == State._HOLDING ) { - countedWait() ; - } - break; - - case State._DISCARDING: - throw factory.getWrapper().poaDiscarding() ; - - case State._INACTIVE: - throw factory.getWrapper().poaInactive() ; - } - } - } - - synchronized void enter() - { - try { - if (debug) { - ORBUtility.dprint( this, - "Calling enter for POAManagerImpl " + this ) ; - } - - checkState(); - nInvocations++; - } finally { - if (debug) { - ORBUtility.dprint( this, - "Exiting enter for POAManagerImpl " + this ) ; - } - } - } - - synchronized void exit() - { - try { - if (debug) { - ORBUtility.dprint( this, - "Calling exit for POAManagerImpl " + this ) ; - } - - nInvocations--; - - if ( nInvocations == 0 ) { - // This notifies any threads that were in the - // wait_for_completion loop in hold/discard/deactivate(). - notifyWaiters(); - } - } finally { - if (debug) { - ORBUtility.dprint( this, - "Exiting exit for POAManagerImpl " + this ) ; - } - } - } - - /** Activate the POAManager if no explicit state change has ever been - * previously invoked. - */ - public synchronized void implicitActivation() - { - if (!explicitStateChange) - try { - activate() ; - } catch (org.omg.PortableServer.POAManagerPackage.AdapterInactive ai) { - // ignore the exception. - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediator.java b/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediator.java deleted file mode 100644 index 7ee572242a4..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediator.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.oa.poa ; - -import org.omg.PortableServer.Servant ; -import org.omg.PortableServer.ServantManager ; -import org.omg.PortableServer.ForwardRequest ; - -import org.omg.PortableServer.POAPackage.ObjectAlreadyActive ; -import org.omg.PortableServer.POAPackage.ServantAlreadyActive ; -import org.omg.PortableServer.POAPackage.ServantNotActive ; -import org.omg.PortableServer.POAPackage.NoServant ; -import org.omg.PortableServer.POAPackage.WrongPolicy ; -import org.omg.PortableServer.POAPackage.ObjectNotActive ; - -/** POAPolicyMediator defines an interface to which the POA delegates all - * policy specific operations. This permits code paths for different - * policies to be optimized by creating the correct code at POA creation - * time. Also note that as much as possible, this interface does not - * do any concurrency control, except as noted. The POA is responsible - * for concurrency control. - */ -public interface POAPolicyMediator { - /** Return the policies object that was used to create this - * POAPolicyMediator. - */ - Policies getPolicies() ; - - /** Return the subcontract ID to use in the IIOP profile in IORs - * created by this POAPolicyMediator's POA. This is initialized - * according to the policies and the POA used to construct this - * POAPolicyMediator in the POAPolicyMediatorFactory. - */ - int getScid() ; - - /** Return the server ID to use in the IIOP profile in IORs - * created by this POAPolicyMediator's POA. This is initialized - * according to the policies and the POA used to construct this - * POAPolicyMediator in the POAPolicyMediatorFactory. - */ - int getServerId() ; - - /** Get the servant to use for an invocation with the - * given id and operation. - * @param id the object ID for which we are requesting a servant - * @param operation the name of the operation to be performed on - * the servant - * @return the resulting Servant. - */ - java.lang.Object getInvocationServant( byte[] id, - String operation ) throws ForwardRequest ; - - /** Release a servant that was obtained from getInvocationServant. - */ - void returnServant() ; - - /** Etherealize all servants associated with this POAPolicyMediator. - * Does nothing if the retention policy is non-retain. - */ - void etherealizeAll() ; - - /** Delete everything in the active object map. - */ - void clearAOM() ; - - /** Return the servant manager. Will throw WrongPolicy - * if the request processing policy is not USE_SERVANT_MANAGER. - */ - ServantManager getServantManager() throws WrongPolicy ; - - /** Set the servant manager. Will throw WrongPolicy - * if the request processing policy is not USE_SERVANT_MANAGER. - */ - void setServantManager( ServantManager servantManager ) throws WrongPolicy ; - - /** Return the default servant. Will throw WrongPolicy - * if the request processing policy is not USE_DEFAULT_SERVANT. - */ - Servant getDefaultServant() throws NoServant, WrongPolicy ; - - /** Set the default servant. Will throw WrongPolicy - * if the request processing policy is not USE_DEFAULT_SERVANT. - */ - void setDefaultServant( Servant servant ) throws WrongPolicy ; - - void activateObject( byte[] id, Servant servant ) - throws ObjectAlreadyActive, ServantAlreadyActive, WrongPolicy ; - - /** Deactivate the object that is associated with the given id. - * Returns the servant for id. - */ - Servant deactivateObject( byte[] id ) throws ObjectNotActive, WrongPolicy ; - - /** Allocate a new, unique system ID. Requires the ID assignment policy - * to be SYSTEM. - */ - byte[] newSystemId() throws WrongPolicy ; - - byte[] servantToId( Servant servant ) throws ServantNotActive, WrongPolicy ; - - Servant idToServant( byte[] id ) throws ObjectNotActive, WrongPolicy ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorBase.java b/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorBase.java deleted file mode 100644 index 60fe0e4b6d9..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorBase.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.oa.poa ; - -import java.util.Collection; -import java.util.Enumeration ; - -import org.omg.PortableServer.Servant ; -import org.omg.PortableServer.ForwardRequest ; -import org.omg.PortableServer.POAPackage.WrongPolicy ; - -import com.sun.corba.se.spi.extension.ServantCachingPolicy ; -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.transport.SocketOrChannelAcceptor; - -import com.sun.corba.se.impl.orbutil.ORBConstants ; -import com.sun.corba.se.impl.orbutil.ORBUtility ; -import com.sun.corba.se.impl.orbutil.concurrent.SyncUtil ; - - -/** Implementation of POARequesHandler that provides policy specific - * operations on the POA. - */ -public abstract class POAPolicyMediatorBase implements POAPolicyMediator { - protected POAImpl poa ; - protected ORB orb ; - - private int sysIdCounter ; - private Policies policies ; - private DelegateImpl delegateImpl ; - - private int serverid ; - private int scid ; - - protected boolean isImplicit ; - protected boolean isUnique ; - protected boolean isSystemId ; - - public final Policies getPolicies() - { - return policies ; - } - - public final int getScid() - { - return scid ; - } - - public final int getServerId() - { - return serverid ; - } - - POAPolicyMediatorBase( Policies policies, POAImpl poa ) - { - if (policies.isSingleThreaded()) - throw poa.invocationWrapper().singleThreadNotSupported() ; - - POAManagerImpl poam = (POAManagerImpl)(poa.the_POAManager()) ; - POAFactory poaf = poam.getFactory() ; - delegateImpl = (DelegateImpl)(poaf.getDelegateImpl()) ; - this.policies = policies ; - this.poa = poa ; - orb = (ORB)poa.getORB() ; - - switch (policies.servantCachingLevel()) { - case ServantCachingPolicy.NO_SERVANT_CACHING : - scid = ORBConstants.TRANSIENT_SCID ; - break ; - case ServantCachingPolicy.FULL_SEMANTICS : - scid = ORBConstants.SC_TRANSIENT_SCID ; - break ; - case ServantCachingPolicy.INFO_ONLY_SEMANTICS : - scid = ORBConstants.IISC_TRANSIENT_SCID ; - break ; - case ServantCachingPolicy.MINIMAL_SEMANTICS : - scid = ORBConstants.MINSC_TRANSIENT_SCID ; - break ; - } - - if ( policies.isTransient() ) { - serverid = orb.getTransientServerId(); - } else { - serverid = orb.getORBData().getPersistentServerId(); - scid = ORBConstants.makePersistent( scid ) ; - } - - isImplicit = policies.isImplicitlyActivated() ; - isUnique = policies.isUniqueIds() ; - isSystemId = policies.isSystemAssignedIds() ; - - sysIdCounter = 0 ; - } - - public final java.lang.Object getInvocationServant( byte[] id, - String operation ) throws ForwardRequest - { - java.lang.Object result = internalGetServant( id, operation ) ; - - return result ; - } - - // Create a delegate and stick it in the servant. - // This delegate is needed during dispatch for the ObjectImpl._orb() - // method to work. - protected final void setDelegate(Servant servant, byte[] id) - { - //This new servant delegate no longer needs the id for - // its initialization. - servant._set_delegate(delegateImpl); - } - - public synchronized byte[] newSystemId() throws WrongPolicy - { - if (!isSystemId) - throw new WrongPolicy() ; - - byte[] array = new byte[8]; - ORBUtility.intToBytes(++sysIdCounter, array, 0); - ORBUtility.intToBytes( poa.getPOAId(), array, 4); - return array; - } - - protected abstract java.lang.Object internalGetServant( byte[] id, - String operation ) throws ForwardRequest ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorBase_R.java b/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorBase_R.java deleted file mode 100644 index 3b14616947a..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorBase_R.java +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.oa.poa ; - -import org.omg.PortableServer.Servant ; - -import org.omg.PortableServer.POAPackage.WrongPolicy ; -import org.omg.PortableServer.POAPackage.ServantNotActive ; -import org.omg.PortableServer.POAPackage.ServantAlreadyActive ; -import org.omg.PortableServer.POAPackage.ObjectNotActive ; -import org.omg.PortableServer.POAPackage.ObjectAlreadyActive ; - -import com.sun.corba.se.impl.orbutil.concurrent.SyncUtil ; - -import com.sun.corba.se.impl.orbutil.ORBUtility ; -import com.sun.corba.se.impl.orbutil.ORBConstants ; - -import com.sun.corba.se.impl.javax.rmi.CORBA.Util ; - -import com.sun.corba.se.impl.oa.NullServantImpl ; - -public abstract class POAPolicyMediatorBase_R extends POAPolicyMediatorBase { - protected ActiveObjectMap activeObjectMap ; - - POAPolicyMediatorBase_R( Policies policies, POAImpl poa ) - { - super( policies, poa ) ; - - // assert policies.retainServants() && policies.useActiveObjectMapOnly() - if (!policies.retainServants()) - throw poa.invocationWrapper().policyMediatorBadPolicyInFactory() ; - - activeObjectMap = ActiveObjectMap.create(poa, !isUnique); - } - - public void returnServant() - { - // NO-OP - } - - public void clearAOM() - { - activeObjectMap.clear() ; - activeObjectMap = null ; - } - - protected Servant internalKeyToServant( ActiveObjectMap.Key key ) - { - AOMEntry entry = activeObjectMap.get(key); - if (entry == null) - return null ; - - return activeObjectMap.getServant( entry ) ; - } - - protected Servant internalIdToServant( byte[] id ) - { - ActiveObjectMap.Key key = new ActiveObjectMap.Key( id ) ; - return internalKeyToServant( key ) ; - } - - protected void activateServant( ActiveObjectMap.Key key, AOMEntry entry, Servant servant ) - { - setDelegate(servant, key.id ); - - if (orb.shutdownDebugFlag) { - System.out.println("Activating object " + servant + - " with POA " + poa); - } - - activeObjectMap.putServant( servant, entry ) ; - - if (Util.isInstanceDefined()) { - POAManagerImpl pm = (POAManagerImpl)poa.the_POAManager() ; - POAFactory factory = pm.getFactory() ; - factory.registerPOAForServant(poa, servant); - } - } - - public final void activateObject(byte[] id, Servant servant) - throws WrongPolicy, ServantAlreadyActive, ObjectAlreadyActive - { - if (isUnique && activeObjectMap.contains(servant)) - throw new ServantAlreadyActive(); - ActiveObjectMap.Key key = new ActiveObjectMap.Key( id ) ; - - AOMEntry entry = activeObjectMap.get( key ) ; - - // Check for an ObjectAlreadyActive error - entry.activateObject() ; - activateServant( key, entry, servant ) ; - } - - public Servant deactivateObject( byte[] id ) - throws ObjectNotActive, WrongPolicy - { - ActiveObjectMap.Key key = new ActiveObjectMap.Key( id ) ; - return deactivateObject( key ) ; - } - - protected void deactivateHelper( ActiveObjectMap.Key key, AOMEntry entry, - Servant s ) throws ObjectNotActive, WrongPolicy - { - // Default does nothing, but the USE_SERVANT_MANAGER case - // must handle etherealization - - activeObjectMap.remove(key); - - if (Util.isInstanceDefined()) { - POAManagerImpl pm = (POAManagerImpl)poa.the_POAManager() ; - POAFactory factory = pm.getFactory() ; - factory.unregisterPOAForServant(poa, s); - } - } - - public Servant deactivateObject( ActiveObjectMap.Key key ) - throws ObjectNotActive, WrongPolicy - { - if (orb.poaDebugFlag) { - ORBUtility.dprint( this, - "Calling deactivateObject for key " + key ) ; - } - - try { - AOMEntry entry = activeObjectMap.get(key); - if (entry == null) - throw new ObjectNotActive(); - - Servant s = activeObjectMap.getServant( entry ) ; - if (s == null) - throw new ObjectNotActive(); - - if (orb.poaDebugFlag) { - System.out.println("Deactivating object " + s + " with POA " + poa); - } - - deactivateHelper( key, entry, s ) ; - - return s ; - } finally { - if (orb.poaDebugFlag) { - ORBUtility.dprint( this, - "Exiting deactivateObject" ) ; - } - } - } - - public byte[] servantToId( Servant servant ) throws ServantNotActive, WrongPolicy - { - // XXX needs to handle call from an invocation on this POA - - if (!isUnique && !isImplicit) - throw new WrongPolicy(); - - if (isUnique) { - ActiveObjectMap.Key key = activeObjectMap.getKey(servant); - if (key != null) - return key.id ; - } - - // assert !isUnique || (servant not in activateObjectMap) - - if (isImplicit) - try { - byte[] id = newSystemId() ; - activateObject( id, servant ) ; - return id ; - } catch (ObjectAlreadyActive oaa) { - // This can't occur here, since id is always brand new. - throw poa.invocationWrapper().servantToIdOaa( oaa ) ; - } catch (ServantAlreadyActive s) { - throw poa.invocationWrapper().servantToIdSaa( s ) ; - } catch (WrongPolicy w) { - throw poa.invocationWrapper().servantToIdWp( w ) ; - } - - throw new ServantNotActive(); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorFactory.java b/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorFactory.java deleted file mode 100644 index 9b78e1c9133..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorFactory.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.oa.poa ; - -abstract class POAPolicyMediatorFactory { - // create an appropriate policy mediator based on the policies. - // Note that the policies object has already been validated before - // this call, so it can only contain valid combinations of POA policies. - static POAPolicyMediator create( Policies policies, POAImpl poa ) - { - if (policies.retainServants()) { - if (policies.useActiveMapOnly()) - return new POAPolicyMediatorImpl_R_AOM( policies, poa ) ; - else if (policies.useDefaultServant()) - return new POAPolicyMediatorImpl_R_UDS( policies, poa ) ; - else if (policies.useServantManager()) - return new POAPolicyMediatorImpl_R_USM( policies, poa ) ; - else - throw poa.invocationWrapper().pmfCreateRetain() ; - } else { - if (policies.useDefaultServant()) - return new POAPolicyMediatorImpl_NR_UDS( policies, poa ) ; - else if (policies.useServantManager()) - return new POAPolicyMediatorImpl_NR_USM( policies, poa ) ; - else - throw poa.invocationWrapper().pmfCreateNonRetain() ; - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorImpl_NR_UDS.java b/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorImpl_NR_UDS.java deleted file mode 100644 index 8ad5a6453e5..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorImpl_NR_UDS.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.oa.poa ; - -import java.util.Enumeration ; - -import org.omg.PortableServer.Servant ; -import org.omg.PortableServer.ServantManager ; -import org.omg.PortableServer.ForwardRequest ; -import org.omg.PortableServer.POAPackage.WrongPolicy ; -import org.omg.PortableServer.POAPackage.ObjectNotActive ; -import org.omg.PortableServer.POAPackage.ServantNotActive ; -import org.omg.PortableServer.POAPackage.ObjectAlreadyActive ; -import org.omg.PortableServer.POAPackage.ServantAlreadyActive ; -import org.omg.PortableServer.POAPackage.NoServant ; - -import com.sun.corba.se.impl.orbutil.concurrent.SyncUtil ; -import com.sun.corba.se.impl.orbutil.ORBUtility ; -import com.sun.corba.se.impl.orbutil.ORBConstants ; - -/** Implementation of POAPolicyMediator that provides policy specific - * operations on the POA. - */ -public class POAPolicyMediatorImpl_NR_UDS extends POAPolicyMediatorBase { - private Servant defaultServant ; - - POAPolicyMediatorImpl_NR_UDS( Policies policies, POAImpl poa ) - { - super( policies, poa ) ; - - // assert !policies.retainServants() && policies.useDefaultServant() - if (policies.retainServants()) - throw poa.invocationWrapper().policyMediatorBadPolicyInFactory() ; - - if (!policies.useDefaultServant()) - throw poa.invocationWrapper().policyMediatorBadPolicyInFactory() ; - - defaultServant = null ; - } - - protected java.lang.Object internalGetServant( byte[] id, - String operation ) throws ForwardRequest - { - if (defaultServant == null) - throw poa.invocationWrapper().poaNoDefaultServant() ; - - return defaultServant; - } - - public void returnServant() - { - // NO-OP - } - - public void etherealizeAll() - { - // NO-OP - } - - public void clearAOM() - { - // NO-OP - } - - public ServantManager getServantManager() throws WrongPolicy - { - throw new WrongPolicy(); - } - - public void setServantManager( ServantManager servantManager ) throws WrongPolicy - { - throw new WrongPolicy(); - } - - public Servant getDefaultServant() throws NoServant, WrongPolicy - { - if (defaultServant == null) - throw new NoServant(); - return defaultServant; - } - - public void setDefaultServant( Servant servant ) throws WrongPolicy - { - this.defaultServant = servant; - setDelegate(defaultServant, "DefaultServant".getBytes()); - } - - public final void activateObject(byte[] id, Servant servant) - throws WrongPolicy, ServantAlreadyActive, ObjectAlreadyActive - { - throw new WrongPolicy(); - } - - public Servant deactivateObject( byte[] id ) throws ObjectNotActive, WrongPolicy - { - throw new WrongPolicy(); - } - - public byte[] servantToId( Servant servant ) throws ServantNotActive, WrongPolicy - { - throw new WrongPolicy(); - } - - public Servant idToServant( byte[] id ) - throws WrongPolicy, ObjectNotActive - { - if (defaultServant != null) - return defaultServant; - - throw new ObjectNotActive() ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorImpl_NR_USM.java b/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorImpl_NR_USM.java deleted file mode 100644 index 280b8b1e530..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorImpl_NR_USM.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.oa.poa ; - -import java.util.Enumeration ; - -import org.omg.PortableServer.POA ; -import org.omg.PortableServer.Servant ; -import org.omg.PortableServer.ServantManager ; -import org.omg.PortableServer.ServantLocator ; -import org.omg.PortableServer.ForwardRequest ; -import org.omg.PortableServer.POAPackage.NoServant ; -import org.omg.PortableServer.POAPackage.WrongPolicy ; -import org.omg.PortableServer.POAPackage.ObjectNotActive ; -import org.omg.PortableServer.POAPackage.ServantNotActive ; -import org.omg.PortableServer.POAPackage.ObjectAlreadyActive ; -import org.omg.PortableServer.POAPackage.ServantAlreadyActive ; -import org.omg.PortableServer.ServantLocatorPackage.CookieHolder ; - -import com.sun.corba.se.impl.orbutil.concurrent.SyncUtil ; -import com.sun.corba.se.impl.orbutil.ORBUtility ; -import com.sun.corba.se.impl.orbutil.ORBConstants ; - -import com.sun.corba.se.spi.oa.OAInvocationInfo ; -import com.sun.corba.se.impl.oa.NullServantImpl ; - -/** Implementation of POARequesHandler that provides policy specific - * operations on the POA. - */ -public class POAPolicyMediatorImpl_NR_USM extends POAPolicyMediatorBase { - private ServantLocator locator ; - - POAPolicyMediatorImpl_NR_USM( Policies policies, POAImpl poa ) - { - super( policies, poa ) ; - - // assert !policies.retainServants() && policies.useServantManager() - if (policies.retainServants()) - throw poa.invocationWrapper().policyMediatorBadPolicyInFactory() ; - - if (!policies.useServantManager()) - throw poa.invocationWrapper().policyMediatorBadPolicyInFactory() ; - - locator = null ; - } - - protected java.lang.Object internalGetServant( byte[] id, - String operation ) throws ForwardRequest - { - if (locator == null) - throw poa.invocationWrapper().poaNoServantManager() ; - - CookieHolder cookieHolder = orb.peekInvocationInfo().getCookieHolder() ; - - // Try - finally is J2EE requirement. - java.lang.Object servant; - try{ - poa.unlock() ; - - servant = locator.preinvoke(id, poa, operation, cookieHolder); - if (servant == null) - servant = new NullServantImpl( poa.omgInvocationWrapper().nullServantReturned() ) ; - else - setDelegate( (Servant)servant, id); - } finally { - poa.lock() ; - } - - return servant; - } - - public void returnServant() - { - OAInvocationInfo info = orb.peekInvocationInfo(); - if (locator == null) - return; - - try { - poa.unlock() ; - locator.postinvoke(info.id(), (POA)(info.oa()), - info.getOperation(), info.getCookieHolder().value, - (Servant)(info.getServantContainer()) ); - } finally { - poa.lock() ; - } - } - - public void etherealizeAll() - { - // NO-OP - } - - public void clearAOM() - { - // NO-OP - } - - public ServantManager getServantManager() throws WrongPolicy - { - return locator ; - } - - public void setServantManager( ServantManager servantManager ) throws WrongPolicy - { - if (locator != null) - throw poa.invocationWrapper().servantManagerAlreadySet() ; - - if (servantManager instanceof ServantLocator) - locator = (ServantLocator)servantManager; - else - throw poa.invocationWrapper().servantManagerBadType() ; - } - - public Servant getDefaultServant() throws NoServant, WrongPolicy - { - throw new WrongPolicy(); - } - - public void setDefaultServant( Servant servant ) throws WrongPolicy - { - throw new WrongPolicy(); - } - - public final void activateObject(byte[] id, Servant servant) - throws WrongPolicy, ServantAlreadyActive, ObjectAlreadyActive - { - throw new WrongPolicy(); - } - - public Servant deactivateObject( byte[] id ) throws ObjectNotActive, WrongPolicy - { - throw new WrongPolicy(); - } - - public byte[] servantToId( Servant servant ) throws ServantNotActive, WrongPolicy - { - throw new WrongPolicy(); - } - - public Servant idToServant( byte[] id ) - throws WrongPolicy, ObjectNotActive - { - throw new WrongPolicy(); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorImpl_R_AOM.java b/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorImpl_R_AOM.java deleted file mode 100644 index 795514ebc90..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorImpl_R_AOM.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.oa.poa ; - -import org.omg.PortableServer.Servant ; -import org.omg.PortableServer.ServantManager ; -import org.omg.PortableServer.ForwardRequest ; -import org.omg.PortableServer.POAPackage.WrongPolicy ; -import org.omg.PortableServer.POAPackage.ObjectNotActive ; -import org.omg.PortableServer.POAPackage.ServantNotActive ; -import org.omg.PortableServer.POAPackage.ObjectAlreadyActive ; -import org.omg.PortableServer.POAPackage.ServantAlreadyActive ; -import org.omg.PortableServer.POAPackage.NoServant ; - -import com.sun.corba.se.impl.orbutil.concurrent.SyncUtil ; -import com.sun.corba.se.impl.orbutil.ORBUtility ; -import com.sun.corba.se.impl.orbutil.ORBConstants ; - -import com.sun.corba.se.impl.oa.NullServantImpl ; - -/** Implementation of POARequesHandler that provides policy specific - * operations on the POA in the case: - *

              - *
            • retain
            • - *
            • useActiveObjectMapOnly
            • - *
            - */ -public class POAPolicyMediatorImpl_R_AOM extends POAPolicyMediatorBase_R { - POAPolicyMediatorImpl_R_AOM( Policies policies, POAImpl poa ) - { - // assert policies.retainServants() - super( policies, poa ) ; - - // policies.useActiveObjectMapOnly() - if (!policies.useActiveMapOnly()) - throw poa.invocationWrapper().policyMediatorBadPolicyInFactory() ; - } - - protected java.lang.Object internalGetServant( byte[] id, - String operation ) throws ForwardRequest - { - java.lang.Object servant = internalIdToServant( id ) ; - if (servant == null) - servant = new NullServantImpl( - poa.invocationWrapper().nullServant() ) ; - return servant ; - } - - public void etherealizeAll() - { - // NO-OP - } - - public ServantManager getServantManager() throws WrongPolicy - { - throw new WrongPolicy(); - } - - public void setServantManager( ServantManager servantManager ) - throws WrongPolicy - { - throw new WrongPolicy(); - } - - public Servant getDefaultServant() throws NoServant, WrongPolicy - { - throw new WrongPolicy(); - } - - public void setDefaultServant( Servant servant ) throws WrongPolicy - { - throw new WrongPolicy(); - } - - public Servant idToServant( byte[] id ) - throws WrongPolicy, ObjectNotActive - { - Servant s = internalIdToServant( id ) ; - - if (s == null) - throw new ObjectNotActive() ; - else - return s; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorImpl_R_UDS.java b/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorImpl_R_UDS.java deleted file mode 100644 index 8eb00dcbc81..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorImpl_R_UDS.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.oa.poa ; - -import java.util.Enumeration ; - -import org.omg.PortableServer.Servant ; -import org.omg.PortableServer.ServantManager ; -import org.omg.PortableServer.ForwardRequest ; -import org.omg.PortableServer.POAPackage.WrongPolicy ; -import org.omg.PortableServer.POAPackage.ObjectNotActive ; -import org.omg.PortableServer.POAPackage.ServantNotActive ; -import org.omg.PortableServer.POAPackage.ObjectAlreadyActive ; -import org.omg.PortableServer.POAPackage.ServantAlreadyActive ; -import org.omg.PortableServer.POAPackage.NoServant ; - -import com.sun.corba.se.impl.orbutil.concurrent.SyncUtil ; -import com.sun.corba.se.impl.orbutil.ORBUtility ; -import com.sun.corba.se.impl.orbutil.ORBConstants ; - -/** Implementation of POARequesHandler that provides policy specific - * operations on the POA. - */ -public class POAPolicyMediatorImpl_R_UDS extends POAPolicyMediatorBase_R { - private Servant defaultServant ; - - POAPolicyMediatorImpl_R_UDS( Policies policies, POAImpl poa ) - { - // assert policies.retainServants() - super( policies, poa ) ; - defaultServant = null ; - - // policies.useDefaultServant() - if (!policies.useDefaultServant()) - throw poa.invocationWrapper().policyMediatorBadPolicyInFactory() ; - } - - protected java.lang.Object internalGetServant( byte[] id, - String operation ) throws ForwardRequest - { - Servant servant = internalIdToServant( id ) ; - if (servant == null) - servant = defaultServant ; - - if (servant == null) - throw poa.invocationWrapper().poaNoDefaultServant() ; - - return servant ; - } - - public void etherealizeAll() - { - // NO-OP - } - - public ServantManager getServantManager() throws WrongPolicy - { - throw new WrongPolicy(); - } - - public void setServantManager( ServantManager servantManager ) throws WrongPolicy - { - throw new WrongPolicy(); - } - - public Servant getDefaultServant() throws NoServant, WrongPolicy - { - if (defaultServant == null) - throw new NoServant(); - else - return defaultServant; - } - - public void setDefaultServant( Servant servant ) throws WrongPolicy - { - defaultServant = servant; - setDelegate(defaultServant, "DefaultServant".getBytes()); - } - - public Servant idToServant( byte[] id ) - throws WrongPolicy, ObjectNotActive - { - ActiveObjectMap.Key key = new ActiveObjectMap.Key( id ) ; - Servant s = internalKeyToServant(key); - - if (s == null) - if (defaultServant != null) - s = defaultServant; - - if (s == null) - throw new ObjectNotActive() ; - - return s; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorImpl_R_USM.java b/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorImpl_R_USM.java deleted file mode 100644 index 1a8badc0930..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorImpl_R_USM.java +++ /dev/null @@ -1,381 +0,0 @@ -/* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.oa.poa ; - -import java.util.Set ; -import org.omg.CORBA.SystemException ; - -import org.omg.PortableServer.ServantActivator ; -import org.omg.PortableServer.Servant ; -import org.omg.PortableServer.ServantManager ; -import org.omg.PortableServer.ForwardRequest ; -import org.omg.PortableServer.POAPackage.WrongPolicy ; -import org.omg.PortableServer.POAPackage.ObjectNotActive ; -import org.omg.PortableServer.POAPackage.ServantNotActive ; -import org.omg.PortableServer.POAPackage.ObjectAlreadyActive ; -import org.omg.PortableServer.POAPackage.ServantAlreadyActive ; -import org.omg.PortableServer.POAPackage.NoServant ; - -import com.sun.corba.se.impl.orbutil.concurrent.SyncUtil ; -import com.sun.corba.se.impl.orbutil.ORBUtility ; -import com.sun.corba.se.impl.orbutil.ORBConstants ; - -import com.sun.corba.se.impl.oa.NullServantImpl ; - -import com.sun.corba.se.impl.javax.rmi.CORBA.Util ; - -import com.sun.corba.se.spi.oa.OAInvocationInfo ; -import com.sun.corba.se.spi.oa.NullServant ; - -/** Implementation of POARequesHandler that provides policy specific - * operations on the POA. - */ -public class POAPolicyMediatorImpl_R_USM extends POAPolicyMediatorBase_R { - protected ServantActivator activator ; - - POAPolicyMediatorImpl_R_USM( Policies policies, POAImpl poa ) - { - // assert policies.retainServants() - super( policies, poa ) ; - activator = null ; - - if (!policies.useServantManager()) - throw poa.invocationWrapper().policyMediatorBadPolicyInFactory() ; - } - - /* This handles a rather subtle bug (4939892). The problem is that - * enter will wait on the entry if it is being etherealized. When the - * deferred state transition completes, the entry is no longer in the - * AOM, and so we need to get a new entry, otherwise activator.incarnate - * will be called twice, once for the old entry, and again when a new - * entry is created. This fix also required extending the FSM StateEngine - * to allow actions to throw exceptions, and adding a new state in the - * AOMEntry FSM to detect this condition. - */ - private AOMEntry enterEntry( ActiveObjectMap.Key key ) - { - AOMEntry result = null ; - boolean failed ; - do { - failed = false ; - result = activeObjectMap.get(key) ; - - try { - result.enter() ; - } catch (Exception exc) { - failed = true ; - } - } while (failed) ; - - return result ; - } - - protected java.lang.Object internalGetServant( byte[] id, - String operation ) throws ForwardRequest - { - if (poa.getDebug()) { - ORBUtility.dprint( this, - "Calling POAPolicyMediatorImpl_R_USM.internalGetServant " + - "for poa " + poa + " operation=" + operation ) ; - } - - try { - ActiveObjectMap.Key key = new ActiveObjectMap.Key( id ) ; - AOMEntry entry = enterEntry(key) ; - java.lang.Object servant = activeObjectMap.getServant( entry ) ; - if (servant != null) { - if (poa.getDebug()) { - ORBUtility.dprint( this, - "internalGetServant: servant already activated" ) ; - } - - return servant ; - } - - if (activator == null) { - if (poa.getDebug()) { - ORBUtility.dprint( this, - "internalGetServant: no servant activator in POA" ) ; - } - - entry.incarnateFailure() ; - throw poa.invocationWrapper().poaNoServantManager() ; - } - - // Drop the POA lock during the incarnate call and - // re-acquire it afterwards. The entry state machine - // prevents more than one thread from executing the - // incarnate method at a time within the same POA. - try { - if (poa.getDebug()) { - ORBUtility.dprint( this, - "internalGetServant: upcall to incarnate" ) ; - } - - poa.unlock() ; - - servant = activator.incarnate(id, poa); - - if (servant == null) - servant = new NullServantImpl( - poa.omgInvocationWrapper().nullServantReturned() ) ; - } catch (ForwardRequest freq) { - if (poa.getDebug()) { - ORBUtility.dprint( this, - "internalGetServant: incarnate threw ForwardRequest" ) ; - } - - throw freq ; - } catch (SystemException exc) { - if (poa.getDebug()) { - ORBUtility.dprint( this, - "internalGetServant: incarnate threw SystemException " + exc ) ; - } - - throw exc ; - } catch (Throwable exc) { - if (poa.getDebug()) { - ORBUtility.dprint( this, - "internalGetServant: incarnate threw Throwable " + exc ) ; - } - - throw poa.invocationWrapper().poaServantActivatorLookupFailed( - exc ) ; - } finally { - poa.lock() ; - - // servant == null means incarnate threw an exception, - // while servant instanceof NullServant means incarnate returned a - // null servant. Either case is an incarnate failure to the - // entry state machine. - if ((servant == null) || (servant instanceof NullServant)) { - if (poa.getDebug()) { - ORBUtility.dprint( this, - "internalGetServant: incarnate failed" ) ; - } - - // XXX Does the AOM leak in this case? Yes, - // but the problem is hard to fix. There may be - // a number of threads waiting for the state to change - // from INCARN to something else, which is VALID or - // INVALID, depending on the incarnate result. - // The activeObjectMap.get() call above creates an - // ActiveObjectMap.Entry if one does not already exist, - // and stores it in the keyToEntry map in the AOM. - entry.incarnateFailure() ; - } else { - // here check for unique_id policy, and if the servant - // is already registered for a different ID, then throw - // OBJ_ADAPTER exception, else activate it. Section 11.3.5.1 - // 99-10-07.pdf - if (isUnique) { - // check if the servant already is associated with some id - if (activeObjectMap.contains((Servant)servant)) { - if (poa.getDebug()) { - ORBUtility.dprint( this, - "internalGetServant: servant already assigned to ID" ) ; - } - - entry.incarnateFailure() ; - throw poa.invocationWrapper().poaServantNotUnique() ; - } - } - - if (poa.getDebug()) { - ORBUtility.dprint( this, - "internalGetServant: incarnate complete" ) ; - } - - entry.incarnateComplete() ; - activateServant(key, entry, (Servant)servant); - } - } - - return servant ; - } finally { - if (poa.getDebug()) { - ORBUtility.dprint( this, - "Exiting POAPolicyMediatorImpl_R_USM.internalGetServant " + - "for poa " + poa ) ; - } - } - } - - public void returnServant() - { - OAInvocationInfo info = orb.peekInvocationInfo(); - byte[] id = info.id() ; - ActiveObjectMap.Key key = new ActiveObjectMap.Key( id ) ; - AOMEntry entry = activeObjectMap.get( key ) ; - entry.exit() ; - } - - public void etherealizeAll() - { - if (activator != null) { - Set keySet = activeObjectMap.keySet() ; - - // Copy the elements in the set to an array to avoid - // changes in the set due to concurrent modification - ActiveObjectMap.Key[] keys = - (ActiveObjectMap.Key[])keySet.toArray( - new ActiveObjectMap.Key[ keySet.size() ] ) ; - - for (int ctr=0; ctr= 0) { - setPolicyValue( key.intValue(), POAPolicyValue ) ; - - // if the value of this POA policy was previously set to a - // different value than the current value given in - // POAPolicyValue, record an error. - if ((prev != null) && - (getPOAPolicyValue( prev ) != POAPolicyValue)) - errorSet.set( i ) ; - } - } - - // Check for bad policy combinations - - // NON_RETAIN requires USE_DEFAULT_SERVANT or USE_SERVANT_MANAGER - if (!retainServants() && useActiveMapOnly() ) { - addToErrorSet( policies, SERVANT_RETENTION_POLICY_ID.value, - errorSet ) ; - addToErrorSet( policies, REQUEST_PROCESSING_POLICY_ID.value, - errorSet ) ; - } - - // IMPLICIT_ACTIVATION requires SYSTEM_ID and RETAIN - if (isImplicitlyActivated()) { - if (!retainServants()) { - addToErrorSet( policies, IMPLICIT_ACTIVATION_POLICY_ID.value, - errorSet ) ; - addToErrorSet( policies, SERVANT_RETENTION_POLICY_ID.value, - errorSet ) ; - } - - if (!isSystemAssignedIds()) { - addToErrorSet( policies, IMPLICIT_ACTIVATION_POLICY_ID.value, - errorSet ) ; - addToErrorSet( policies, ID_ASSIGNMENT_POLICY_ID.value, - errorSet ) ; - } - } - - checkForPolicyError( errorSet ) ; - } - - public Policy get_effective_policy( int type ) - { - Integer key = new Integer( type ) ; - Policy result = (Policy)(policyMap.get(key)) ; - return result ; - } - - /* Thread Policies */ - public final boolean isOrbControlledThreads() { - return getPolicyValue( THREAD_POLICY_ID.value ) == - ThreadPolicyValue._ORB_CTRL_MODEL; - } - public final boolean isSingleThreaded() { - return getPolicyValue( THREAD_POLICY_ID.value ) == - ThreadPolicyValue._SINGLE_THREAD_MODEL; - } - - /* Lifespan */ - public final boolean isTransient() { - return getPolicyValue( LIFESPAN_POLICY_ID.value ) == - LifespanPolicyValue._TRANSIENT; - } - public final boolean isPersistent() { - return getPolicyValue( LIFESPAN_POLICY_ID.value ) == - LifespanPolicyValue._PERSISTENT; - } - - /* ID Uniqueness */ - public final boolean isUniqueIds() { - return getPolicyValue( ID_UNIQUENESS_POLICY_ID.value ) == - IdUniquenessPolicyValue._UNIQUE_ID; - } - public final boolean isMultipleIds() { - return getPolicyValue( ID_UNIQUENESS_POLICY_ID.value ) == - IdUniquenessPolicyValue._MULTIPLE_ID; - } - - /* ID Assignment */ - public final boolean isUserAssignedIds() { - return getPolicyValue( ID_ASSIGNMENT_POLICY_ID.value ) == - IdAssignmentPolicyValue._USER_ID; - } - public final boolean isSystemAssignedIds() { - return getPolicyValue( ID_ASSIGNMENT_POLICY_ID.value ) == - IdAssignmentPolicyValue._SYSTEM_ID; - } - - /* Servant Rentention */ - public final boolean retainServants() { - return getPolicyValue( SERVANT_RETENTION_POLICY_ID.value ) == - ServantRetentionPolicyValue._RETAIN; - } - - /* Request Processing */ - public final boolean useActiveMapOnly() { - return getPolicyValue( REQUEST_PROCESSING_POLICY_ID.value ) == - RequestProcessingPolicyValue._USE_ACTIVE_OBJECT_MAP_ONLY; - } - public final boolean useDefaultServant() { - return getPolicyValue( REQUEST_PROCESSING_POLICY_ID.value ) == - RequestProcessingPolicyValue._USE_DEFAULT_SERVANT; - } - public final boolean useServantManager() { - return getPolicyValue( REQUEST_PROCESSING_POLICY_ID.value ) == - RequestProcessingPolicyValue._USE_SERVANT_MANAGER; - } - - /* Implicit Activation */ - public final boolean isImplicitlyActivated() { - return getPolicyValue( IMPLICIT_ACTIVATION_POLICY_ID.value ) == - ImplicitActivationPolicyValue._IMPLICIT_ACTIVATION; - } - - /* proprietary servant caching policy */ - public final int servantCachingLevel() - { - Integer key = new Integer( ORBConstants.SERVANT_CACHING_POLICY ) ; - ServantCachingPolicy policy = (ServantCachingPolicy)policyMap.get( key ) ; - if (policy == null) - return ServantCachingPolicy.NO_SERVANT_CACHING ; - else - return policy.getType() ; - } - - public final boolean forceZeroPort() - { - Integer key = new Integer( ORBConstants.ZERO_PORT_POLICY ) ; - ZeroPortPolicy policy = (ZeroPortPolicy)policyMap.get( key ) ; - if (policy == null) - return false ; - else - return policy.forceZeroPort() ; - } - - public final int getCopierId() - { - Integer key = new Integer( ORBConstants.COPY_OBJECT_POLICY ) ; - CopyObjectPolicy policy = (CopyObjectPolicy)policyMap.get( key ) ; - if (policy != null) - return policy.getValue() ; - else - return defaultObjectCopierFactoryId ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/RequestProcessingPolicyImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/RequestProcessingPolicyImpl.java deleted file mode 100644 index 4ef1bd7fd37..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/RequestProcessingPolicyImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.oa.poa; - -import org.omg.CORBA.*; -import org.omg.PortableServer.*; - -public class RequestProcessingPolicyImpl - extends org.omg.CORBA.LocalObject implements RequestProcessingPolicy { - - public RequestProcessingPolicyImpl(RequestProcessingPolicyValue - value) { - this.value = value; - } - - public RequestProcessingPolicyValue value() { - return value; - } - - public int policy_type() - { - return REQUEST_PROCESSING_POLICY_ID.value ; - } - - public Policy copy() { - return new RequestProcessingPolicyImpl(value); - } - - public void destroy() { - value = null; - } - - private RequestProcessingPolicyValue value; - - public String toString() - { - String type = null ; - switch (value.value()) { - case RequestProcessingPolicyValue._USE_ACTIVE_OBJECT_MAP_ONLY : - type = "USE_ACTIVE_OBJECT_MAP_ONLY" ; - break ; - case RequestProcessingPolicyValue._USE_DEFAULT_SERVANT : - type = "USE_DEFAULT_SERVANT" ; - break ; - case RequestProcessingPolicyValue._USE_SERVANT_MANAGER : - type = "USE_SERVANT_MANAGER" ; - break ; - } - - return "RequestProcessingPolicy[" + type + "]" ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/ServantRetentionPolicyImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/ServantRetentionPolicyImpl.java deleted file mode 100644 index c6c8801cfd2..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/ServantRetentionPolicyImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.oa.poa; - -import org.omg.CORBA.*; -import org.omg.PortableServer.*; - -final class ServantRetentionPolicyImpl - extends org.omg.CORBA.LocalObject implements ServantRetentionPolicy { - - public ServantRetentionPolicyImpl(ServantRetentionPolicyValue value) { - this.value = value; - } - - public ServantRetentionPolicyValue value() { - return value; - } - - public int policy_type() - { - return SERVANT_RETENTION_POLICY_ID.value ; - } - - public Policy copy() { - return new ServantRetentionPolicyImpl(value); - } - - public void destroy() { - value = null; - } - - private ServantRetentionPolicyValue value; - - public String toString() - { - return "ServantRetentionPolicy[" + - ((value.value() == ServantRetentionPolicyValue._RETAIN) ? - "RETAIN" : "NON_RETAIN" + "]") ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/ThreadPolicyImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/ThreadPolicyImpl.java deleted file mode 100644 index f75d0feadbf..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/ThreadPolicyImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.oa.poa; - -import org.omg.CORBA.*; -import org.omg.PortableServer.*; - -final class ThreadPolicyImpl - extends org.omg.CORBA.LocalObject implements ThreadPolicy { - - public ThreadPolicyImpl(ThreadPolicyValue value) { - this.value = value; - } - - public ThreadPolicyValue value() { - return value; - } - - public int policy_type() - { - return THREAD_POLICY_ID.value ; - } - - public Policy copy() { - return new ThreadPolicyImpl(value); - } - - public void destroy() { - value = null; - } - - private ThreadPolicyValue value; - - public String toString() - { - return "ThreadPolicy[" + - ((value.value() == ThreadPolicyValue._SINGLE_THREAD_MODEL) ? - "SINGLE_THREAD_MODEL" : "ORB_CTRL_MODEL" + "]") ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/minor_code_example.txt b/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/minor_code_example.txt deleted file mode 100644 index 3cb3fc30a9f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/minor_code_example.txt +++ /dev/null @@ -1,61 +0,0 @@ -package @PKGNAME@ ; - -import org.omg.CORBA.OMGVMCID ; -import org.omg.CORBA.CompletionStatus ; - -import org.omg.CORBA.@SYSEX@ ; - -public abstract class StandardException { - // @SYSEX@ BAD_CONTEXT - - public void IdlContextNotFound( CompletionStatus completed ) - { - throw new BAD_CONTEXT( "IDL context not found", - OMGVMCID.value + 1, completed ) ; - } - - public void IdlContextNotFound( ) - { - IdlContextNotFound( CompletionStatus.COMPLETED_NO ) ; - } - -Data structures: list[ ... ] vector[ ... ] ( record ) - -list[ ( string{exception name} list[ ( string{code name} int{value} string{description} ] ) ] - -Processing: - - - open file (fname) - fr = new FileReader( fname ) - br = new BufferedReader( fr ) - br.readLine() returns null at EOF - - want a BufferedReader - - while not eol read line - if (line start with spaces) - add to current index - else - new exception - - create StandardException class - - foreach ( excname vec ) in data - add import statement for execname to output - - foreach ( codename value descr ) in vec - generate full method - generate short method - - -(define (read-file fname) - (begin - (let port (open-input-port fname)) - (let obj (read port)) - obj - ) -) - - - diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/standard_minor_codes.txt b/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/standard_minor_codes.txt deleted file mode 100644 index 294ed5d4bae..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/standard_minor_codes.txt +++ /dev/null @@ -1,160 +0,0 @@ -( -(BAD_CONTEXT - (IDL_CONTEXT_NOT_FOUND 1 "IDL context not found") - (NO_MATCHING_IDL_CONTEXT 2 "No matching IDL context property") -) -(BAD_INV_ORDER - (DEP_PREVENT_DESTRUCTION 1 "Dependency exists in IFR preventing destruction of this object") - (DESTROY_INDESTRUCTIBLE 2 "Attempt to destroy indestructible objects in IFR") - (OPERATION_DEADLOCK 3 "Operation would deadlock") - (ORB_SHUTDOWN 4 "ORB has shutdown") - (BAD_INVOKE 5 "Attempt to invoke send or invoke operation of the same Request object more than once ") - (BAD_SET_SERVANT_MANAGER 6 "Attempt to set a servent manager after one has already been set") - (BAD_ARGUMENTS_CALL 7 "ServerRequest::arguments called more than once or after a call to ServerRequest::set_exception") - (BAD_CTX_CALL 8 "ServerRequest::ctx called more than once or before ServerRequest::arguments or after ServerRequest::ctx, ServerRequest::set_result or ServerRequest::set_exception") - (BAD_RESULT_CALL 9 "ServerRequest::set_result called more than once or before ServerRequest::arguments or after ServerRequest::set_result or ServerRequest::set_exception") - (BAD_SEND 10 "Attempt to send a DII request after it was sent previously") - (BAD_POLL_BEFORE 11 "Attempt to poll a DII request or to retrieve its result before the request was sent") - (BAD_POLL_AFTER 12 "Attempt to poll a DII request or to retrieve its result after the result was retrieved previously") - (BAD_POLL_SYNC 13 "Attempt to poll a synchronous DII request or to retrieve results from a synchronous DII request") - (BAD_PI_CALL 14 "Invalid portable interceptor call") - (BAD_PI_ADD_SERVICE_CONTEXT 15 "Service context add failed in portable interceptor because a service context with the given id already exists") - (DUPLICATE_POLICY_FACTORY 16 "Registration of PolicyFactory failed because a factory already exists for the given PolicyType") - (CREATE_POA_DESTROY 17 "POA cannot create POAs while undergoing destruction") - (PRIORITY_REASSIGN 18 "Attempt to reassign priority") - (XA_START_OUTSIZE 19 "An OTS/XA integration xa_start() call returned XAER_OUTSIDE") - (XA_START_PROTO 20 "An OTS/XA integration xa_ call returned XAER_PROTO") -) -(BAD_OPERATION - (BAD_SERVANT_MANAGER_TYPE 1 "ServantManager returned wrong servant type") - (OPERATION_UNKNOWN_TO_TARGET 2 "Operation or attribute not known to target object ") -) -(BAD_PARAM - (VALUE_FACTORY_REG_ERROR 1 "Failure to register, unregister or lookup value factory") - (RID_ALREADY_DEFINED 2 "RID already defined in IFR") - (NAME_USED_IFR 3 "Name already used in the context in IFR ") - (TARGET_NOT_CONTAINER 4 "Target is not a valid container") - (NAME_CLASH 5 "Name clash in inherited context") - (BAD_ABSTRACT_INTERFACE_TYPE 6 "Incorrect type for abstract interface") - (SO_BAD_SCHEME_NAME 7 "string_to_object conversion failed due to bad scheme name") - (SO_BAD_ADDRESS 8 "string_to_object conversion failed due to bad address") - (SO_BAD_SCHEMA_SPECIFIC 9 "string_to_object conversion failed due to bad bad schema specific part") - (SO_NON_SPECIFIC 10 "string_to_object conversion failed due to non specific reason") - (IR_DERIVE_ABS_INT_BASE 11 "Attempt to derive abstract interface from non-abstract base interface in the Interface Repository") - (IR_VALUE_SUPPORT 12 "Attempt to let a ValueDef support more than one non-abstract interface in the Interface Repository") - (INCOMPLETE_TYPECODE 13 "Attempt to use an incomplete TypeCode as a parameter") - (INVALID_OBJECT_ID 14 "Invalid object id passed to POA::create_reference_by_id ") - (TYPECODE_BAD_NAME 15 "Bad name argument in TypeCode operation") - (TYPECODE_BAD_REPID 16 "Bad RepositoryId argument in TypeCode operation") - (TYPECODE_INV_MEMBER 17 "Invalid member name in TypeCode operation ") - (TC_UNION_DUP_LABEL 18 "Duplicate label value in create_union_tc ") - (TC_UNION_INCOMPATIBLE 19 "Incompatible TypeCode of label and discriminator in create_union_tc ") - (TC_UNION_BAD_DISC 20 "Supplied discriminator type illegitimate in create_union_tc ") - (SET_EXCEPTION_BAD_ANY 21 "Any passed to ServerRequest::set_exception does not contain an exception ") - (SET_EXCEPTION_UNLISTED 22 "Unlisted user exception passed to ServerRequest::set_exception ") - (NO_WCHAR_CODE_SET 23 "wchar transmission code set not in service context") - (ILLEGAL_SERVICE_CONTEXT 24 "Service context is not in OMG-defined range") - (ENUM_OUT_OF_RANGE 25 "Enum value out of range") - (PI_BAD_SERVICE_CONTEXT 26 "Invalid service context Id in portable interceptor") - (REG_INITIAL_NULL 27 "Attempt to call register_initial_reference with a null Object") - (PI_INV_COMPONENT_ID 28 "Invalid component Id in portable interceptor") - (PI_INV_PROFILE_ID 29 "Invalid profile Id in portable interceptor") - (POLICY_TYPE_DUPLICATE 30 "Two or more Policy objects with the same PolicyType value supplied to Object::set_policy_overrides or PolicyManager::set_policy_overrides") - (BAD_ONEWAY_DEFINITION 31 "Attempt to define a oneway operation with non-void result, out or inout parameters or user exceptions") - (DII_FOR_IMPLICIT_OPERATION 32 "DII asked to create request for an implicit operation") - (XA_CALL_INVAL 33 "An OTS/XA integration xa_ call returned XAER_INVAL") - (UNION_BAD_DISCRIMINATOR 34 "Union branch modifier method called with bad case label discriminator") - (CTX_ILLEGAL_PROPERTY_NAME 35 "Illegal IDL context property name") - (CTX_ILLEGAL_SEARCH_STRING 36 "Illegal IDL property search string") - (CTX_ILLEGAL_NAME 37 "Illegal IDL context name") - (CTX_NON_EMPTY 38 "Non-empty IDL context") - (RMI_STREAM_FORMAT 39 "Unsupported RMI/IDL custom value type stream format") - (OUTPUT_STREAM_NOT_VALUE 40 "ORB output stream does not support ValueOutputStream interface") - (INPUT_STREAM_NOT_VALUE 41 "ORB input stream does not support ValueInputStream interface") -) -(BAD_TYPECODE - (MARSHALL_INCOMPLETE_TYPECODE 1 "Attempt to marshal incomplete TypeCode") - (BAD_MEMBER_TYPECODE 2 "Member type code illegitimate in TypeCode operation") - (ILLEGAL_PARAMETER 3 "Illegal parameter type") -) -(DATA_CONVERSION - (CHAR_NOT_MAP_TCS 1 "Character does not map to negotiated transmission code set") - (PRIORITY_MAP_FAILRE 2 "Failure of PriorityMapping object") -) -(IMP_LIMIT - (NO_USABLE_PROFILE 1 "Unable to use any profile in IOR") -) -(INITIALIZE - (PRIORITY_RANGE_RESTRICT 1 "Priority range too restricted for ORB") -) -(INV_OBJREF - (NO_WCHAR_CODE_SET 1 "wchar Code Set support not specified") - (CODESET_COMPONENT_REQUIRED 2 "Codeset component required for type using wchar or wstring data") -) -(INV_POLICY - (IOR_POLICY_RECONCILE_ERROR 1 "Unable to reconcile IOR specified policy with effective policy override") - (INVALID_POLICY_TYPE 2 "Invalid PolicyType") - (NO_POLICY_FACTORY 3 "No PolicyFactory has been registered for the given PolicyType") -) -(INTERNAL - (XA_RMERR 1 "An OTS/XA integration xa_ call returned XAER_RMERR") - (XA_RMFAIL 2 "An OTS/XA integration xa_ call returned XAER_RMFAIL") -) -(INTF_REPOS - (NO_IR 1 "Interface Repository not available") - (NO_INTERFACE_IN_IR 2 "No entry for requested interface in Interface Repository") -) -(MARSHAL - (NO_VALUE_FACTORY 1 "Unable to locate value factory") - (SET_RESULT_BEFORE_CTX 2 "ServerRequest::set_result called before ServerRequest::ctx when the operation IDL contains a context clause ") - (BAD_NVLIST 3 "NVList passed to ServerRequest::arguments does not describe all parameters passed by client") - (MARSHAL_LOCAL_OBJECT 4 "Attempt to marshal Local object") - (WCHAR_BAD_GIOP_VERSION_SENT 5 "wchar or wstring data erroneosly sent by client over GIOP 1.0 connection ") - (WCHAR_BAD_GIOP_VERSION_RETURNED 6 "wchar or wstring data erroneously returned by server over GIOP 1.0 connection ") - (RMI_STREAM_FORMAT_2 7 "Unsupported RMI/IDL custom value type stream "format -) -(NO_IMPLEMENT - (NO_LOCAL_VALUE_IMPLEMENTATION 1 "Missing local value implementation") - (INCOMPAT_VALUE_IMPLEMENTATION 2 "Incompatible value implementation version") - (NO_USABLE_PROFILE_2 3 "Unable to use any profile in IOR") - (DII_LOCAL_OBJECT 4 "Attempt to use DII on Local object") - (BIO_RESET 5 "Biomolecular Sequence Analysis iterator cannot be reset") - (BIO_NOT_AVAILABLE 6 "Biomolecular Sequence Analysis metadata is not available as XML") - (BIO_GENOMIC_NO_ITERATOR 7 "Genomic Maps iterator cannot be reset") -) -(NO_RESOURCES - (PI_OPERATION_NOT_SUPPORTED 1 "Portable Interceptor operation not supported in this binding") - (NO_CONNECTION_PRIORITY 2 "No connection for request's priority") -) -(TRANSACTION_ROLLEDBACK - (XA_RB 1 "An OTS/XA integration xa_ call returned XAER_RB") - (XA_NOTA 2 "An OTS/XA integration xa_ call returned XAER_NOTA") - (XA_END_TRUE_ROLLBACK_DEFERRED 3 "OTS/XA integration end() was called with success set to TRUE while transaction rollback was deferred") -) -(TRANSIENT - (POA_REQUEST_DISCARD 1 "Request discarded because of resource exhaustion in POA or because POA is in DISCARDING state") - (NO_USABLE_PROFILE_3 2 "No usable profile in IOR") - (REQUEST_CANCELLED 3 "Request cancelled") - (POA_DESTROYED 4 "POA destroyed") -) -(OBJECT_NOT_EXIST - "(UNREGISTERED_VALUE_AS_OBJREF 1 Attempt to pass an unactivated (unregistered) value as an object reference") - (NO_OBJECT_ADAPTOR 2 "Failed to create or locate Object Adaptor") - (BIO_NOT_AVAILABLE 3 "Biomolecular Sequence Analysis Service is no longer available") - (OBJECT_ADAPTER_INACTIVE 4 "Object Adapter Inactive") -) -(OBJ_ADAPTER - (UNKNOWN_ADAPTER_SYS_EXCEPTION 1 "System exception in POA::unknown_adapter") - (BAD_SERVANT_TYPE 2 "Incorrect servant type returned by servant manager ") - (NO_DEFAULT_SERVANT 3 "No default servant available [POA policy"]) - (NO_SERVANT_MANAGER 4 "No servant manager available [POA Policy"]) - (BAD_POLICY_INCARNATE 5 "Violation of POA policy by ServantActivator::incarnate") - (PI_EXC_COMP_ESTABLISHED 6 "Exception in PortableInterceptor::IORInterceptor.components_established") - (NULL_SERVANT_RETURNED 7 "Null servant returned by servant manager") -) -(UNKNOWN - (UNLISTED_EXCEPTION_RECEIVED 1 "Unlisted user exception received by client ") - (UNSUPPORTED_SYSTEM_EXCEPTION 2 "Non-standard System Exception not supported") - (PI_UNKNOWN_USER_EXCEPTION 3 "An unknown user exception received by a portable interceptor") -) -) diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/toa/TOA.java b/src/java.corba/share/classes/com/sun/corba/se/impl/oa/toa/TOA.java deleted file mode 100644 index 655ce07c245..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/toa/TOA.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.oa.toa ; - -import com.sun.corba.se.spi.oa.ObjectAdapter ; - -/** The Transient Object Adapter is used for standard RMI-IIOP and Java-IDL - * (legacy JDK 1.2) object implementations. Its protocol for managing objects is very - * simple: just connect and disconnect. There is only a single TOA instance per ORB, - * and its lifetime is the same as the ORB. The TOA instance is always ready to receive - * messages except when the ORB is shutting down. - */ -public interface TOA extends ObjectAdapter { - /** Connect the given servant to the ORB by allocating a transient object key - * and creating an IOR and object reference using the current factory. - */ - void connect( org.omg.CORBA.Object servant ) ; - - /** Disconnect the object from this ORB. - */ - void disconnect( org.omg.CORBA.Object obj ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/toa/TOAFactory.java b/src/java.corba/share/classes/com/sun/corba/se/impl/oa/toa/TOAFactory.java deleted file mode 100644 index 58823229069..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/toa/TOAFactory.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.oa.toa ; - -import java.util.Map ; -import java.util.HashMap ; - -import org.omg.CORBA.INTERNAL ; -import org.omg.CORBA.CompletionStatus ; - -import com.sun.corba.se.spi.oa.ObjectAdapterFactory ; -import com.sun.corba.se.spi.oa.ObjectAdapter ; - -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.spi.ior.ObjectAdapterId ; - -import com.sun.corba.se.impl.oa.toa.TOAImpl ; -import com.sun.corba.se.impl.oa.toa.TransientObjectManager ; - -import com.sun.corba.se.impl.javax.rmi.CORBA.Util ; - -import com.sun.corba.se.impl.ior.ObjectKeyTemplateBase ; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -public class TOAFactory implements ObjectAdapterFactory -{ - private ORB orb ; - private ORBUtilSystemException wrapper ; - - private TOAImpl toa ; - private Map codebaseToTOA ; - private TransientObjectManager tom ; - - public ObjectAdapter find ( ObjectAdapterId oaid ) - { - if (oaid.equals( ObjectKeyTemplateBase.JIDL_OAID ) ) - // Return the dispatch-only TOA, which can dispatch - // request for objects created by any TOA. - return getTOA() ; - else - throw wrapper.badToaOaid() ; - } - - public void init( ORB orb ) - { - this.orb = orb ; - wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.OA_LIFECYCLE ) ; - tom = new TransientObjectManager( orb ) ; - codebaseToTOA = new HashMap() ; - } - - public void shutdown( boolean waitForCompletion ) - { - if (Util.isInstanceDefined()) { - Util.getInstance().unregisterTargetsForORB(orb); - } - } - - public synchronized TOA getTOA( String codebase ) - { - TOA toa = (TOA)(codebaseToTOA.get( codebase )) ; - if (toa == null) { - toa = new TOAImpl( orb, tom, codebase ) ; - - codebaseToTOA.put( codebase, toa ) ; - } - - return toa ; - } - - public synchronized TOA getTOA() - { - if (toa == null) - // The dispatch-only TOA is not used for creating - // objrefs, so its codebase can be null (and must - // be, since we do not have a servant at this point) - toa = new TOAImpl( orb, tom, null ) ; - - return toa ; - } - - public ORB getORB() - { - return orb ; - } -} ; diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/toa/TOAImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/oa/toa/TOAImpl.java deleted file mode 100644 index 8290e179f58..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/toa/TOAImpl.java +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.oa.toa ; - -import org.omg.CORBA.Policy ; -import org.omg.PortableInterceptor.ObjectReferenceTemplate ; -import org.omg.PortableInterceptor.ObjectReferenceFactory ; -import org.omg.PortableInterceptor.ACTIVE; -import org.omg.PortableServer.ServantLocatorPackage.CookieHolder ; - -import com.sun.corba.se.pept.protocol.ClientDelegate ; - -import com.sun.corba.se.spi.copyobject.CopierManager ; -import com.sun.corba.se.spi.copyobject.ObjectCopier ; -import com.sun.corba.se.spi.copyobject.ObjectCopierFactory ; -import com.sun.corba.se.spi.ior.ObjectKeyTemplate ; -import com.sun.corba.se.spi.ior.iiop.IIOPAddress ; -import com.sun.corba.se.spi.ior.iiop.IIOPFactories ; -import com.sun.corba.se.spi.oa.OAInvocationInfo ; -import com.sun.corba.se.spi.oa.OADestroyed ; -import com.sun.corba.se.spi.oa.ObjectAdapterBase ; -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.presentation.rmi.StubAdapter ; -import com.sun.corba.se.spi.protocol.RequestDispatcherRegistry ; -import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcher ; -import com.sun.corba.se.spi.transport.CorbaContactInfoList ; - -import com.sun.corba.se.impl.ior.JIDLObjectKeyTemplate ; -import com.sun.corba.se.impl.oa.NullServantImpl; -import com.sun.corba.se.impl.oa.poa.Policies; -import com.sun.corba.se.impl.oa.toa.TransientObjectManager ; -import com.sun.corba.se.impl.orbutil.ORBConstants ; -import com.sun.corba.se.impl.protocol.JIDLLocalCRDImpl ; - -/** The Transient Object Adapter (TOA) represents the OA for purely transient -* objects. It is used for standard RMI-IIOP as well as backwards compatible -* server support (i.e. the ORB.connect() method) -* Its characteristics include: -*
              -*
            • There is only one OA instance of the TOA. Its OAId is { "TOA" }
            • -*
            • There is not adapter manager. The TOA manager ID is fixed.
            • -*
            • State is the same as ORB state (TBD)
            • -*
            -* Other requirements: -*
              -*
            • All object adapters must invoke ORB.adapterCreated when they are created. -*
            • -*
            • All adapter managers must invoke ORB.adapterManagerStateChanged when -* their state changes, mapping the internal state to an ORT state.
            • -*
            • AdapterStateChanged must be invoked (from somewhere) whenever -* an adapter state changes that is not due to an adapter manager state change.
            • -*
            -*/ -public class TOAImpl extends ObjectAdapterBase implements TOA -{ - private TransientObjectManager servants ; - - public TOAImpl( ORB orb, TransientObjectManager tom, String codebase ) - { - super( orb ) ; - servants = tom ; - - // Make the object key template - int serverid = ((ORB)getORB()).getTransientServerId(); - int scid = ORBConstants.TOA_SCID ; - - ObjectKeyTemplate oktemp = new JIDLObjectKeyTemplate( orb, scid, serverid ) ; - - // REVISIT - POA specific - Policies policies = Policies.defaultPolicies; - - // REVISIT - absorb codebase into a policy - initializeTemplate( oktemp, true, - policies, - codebase, - null, // manager id - oktemp.getObjectAdapterId() - ) ; - } - - // Methods required for dispatching requests - - public ObjectCopierFactory getObjectCopierFactory() - { - CopierManager cm = getORB().getCopierManager() ; - return cm.getDefaultObjectCopierFactory() ; - } - - public org.omg.CORBA.Object getLocalServant( byte[] objectId ) - { - return (org.omg.CORBA.Object)(servants.lookupServant( objectId ) ) ; - } - - /** Get the servant for the request given by the parameters. - * This will update thread Current, so that subsequent calls to - * returnServant and removeCurrent from the same thread are for the - * same request. - * @param info is the request containing the rest of the request - */ - public void getInvocationServant( OAInvocationInfo info ) - { - java.lang.Object servant = servants.lookupServant( info.id() ) ; - if (servant == null) - // This is expected to result in an RMI-IIOP NoSuchObjectException. - // See bug 4973160. - servant = new NullServantImpl( lifecycleWrapper().nullServant() ) ; - info.setServant( servant ) ; - } - - public void returnServant() - { - // NO-OP - } - - /** Return the most derived interface for the given servant and objectId. - */ - public String[] getInterfaces( Object servant, byte[] objectId ) - { - return StubAdapter.getTypeIds( servant ) ; - } - - // XXX For now, this does nothing. - // This will need fixing once we support ORB and thread level policies, - // but for now, there is no way to associate policies with the TOA, so - // getEffectivePolicy must always return null. - public Policy getEffectivePolicy( int type ) - { - return null ; - } - - public int getManagerId() - { - return -1 ; - } - - public short getState() - { - return ACTIVE.value ; - } - - public void enter() throws OADestroyed - { - } - - public void exit() - { - } - - // Methods unique to the TOA - - public void connect( org.omg.CORBA.Object objref) - { - // Store the objref and get a userkey allocated by the transient - // object manager. - byte[] key = servants.storeServant(objref, null); - - // Find out the repository ID for this objref. - String id = StubAdapter.getTypeIds( objref )[0] ; - - // Create the new objref - ObjectReferenceFactory orf = getCurrentFactory() ; - org.omg.CORBA.Object obj = orf.make_object( id, key ) ; - - // Copy the delegate from the new objref to the argument - // XXX handle the case of an attempt to connect a local object. - - org.omg.CORBA.portable.Delegate delegate = StubAdapter.getDelegate( - obj ) ; - CorbaContactInfoList ccil = (CorbaContactInfoList) - ((ClientDelegate)delegate).getContactInfoList() ; - LocalClientRequestDispatcher lcs = - ccil.getLocalClientRequestDispatcher() ; - - if (lcs instanceof JIDLLocalCRDImpl) { - JIDLLocalCRDImpl jlcs = (JIDLLocalCRDImpl)lcs ; - jlcs.setServant( objref ) ; - } else { - throw new RuntimeException( - "TOAImpl.connect can not be called on " + lcs ) ; - } - - StubAdapter.setDelegate( objref, delegate ) ; - } - - public void disconnect( org.omg.CORBA.Object objref ) - { - // Get the delegate, then ior, then transientKey, then delete servant - org.omg.CORBA.portable.Delegate del = StubAdapter.getDelegate( - objref ) ; - CorbaContactInfoList ccil = (CorbaContactInfoList) - ((ClientDelegate)del).getContactInfoList() ; - LocalClientRequestDispatcher lcs = - ccil.getLocalClientRequestDispatcher() ; - - if (lcs instanceof JIDLLocalCRDImpl) { - JIDLLocalCRDImpl jlcs = (JIDLLocalCRDImpl)lcs ; - byte[] oid = jlcs.getObjectId() ; - servants.deleteServant(oid); - jlcs.unexport() ; - } else { - throw new RuntimeException( - "TOAImpl.disconnect can not be called on " + lcs ) ; - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/toa/TransientObjectManager.java b/src/java.corba/share/classes/com/sun/corba/se/impl/oa/toa/TransientObjectManager.java deleted file mode 100644 index 827b666d633..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/oa/toa/TransientObjectManager.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.oa.toa; - -import com.sun.corba.se.impl.orbutil.ORBUtility ; -import com.sun.corba.se.spi.orb.ORB ; - -public final class TransientObjectManager { - private ORB orb ; - private int maxSize = 128; - private Element[] elementArray; - private Element freeList; - - void dprint( String msg ) { - ORBUtility.dprint( this, msg ) ; - } - - public TransientObjectManager( ORB orb ) - { - this.orb = orb ; - - elementArray = new Element[maxSize]; - elementArray[maxSize-1] = new Element(maxSize-1,null); - for ( int i=maxSize-2; i>=0; i-- ) - elementArray[i] = new Element(i,elementArray[i+1]); - freeList = elementArray[0]; - } - - public synchronized byte[] storeServant(java.lang.Object servant, java.lang.Object servantData) - { - if ( freeList == null ) - doubleSize(); - - Element elem = freeList; - freeList = (Element)freeList.servant; - - byte[] result = elem.getKey(servant, servantData); - if (orb.transientObjectManagerDebugFlag) - dprint( "storeServant returns key for element " + elem ) ; - return result ; - } - - public synchronized java.lang.Object lookupServant(byte transientKey[]) - { - int index = ORBUtility.bytesToInt(transientKey,0); - int counter = ORBUtility.bytesToInt(transientKey,4); - - if (orb.transientObjectManagerDebugFlag) - dprint( "lookupServant called with index=" + index + ", counter=" + counter ) ; - - if (elementArray[index].counter == counter && - elementArray[index].valid ) { - if (orb.transientObjectManagerDebugFlag) - dprint( "\tcounter is valid" ) ; - return elementArray[index].servant; - } - - // servant not found - if (orb.transientObjectManagerDebugFlag) - dprint( "\tcounter is invalid" ) ; - return null; - } - - public synchronized java.lang.Object lookupServantData(byte transientKey[]) - { - int index = ORBUtility.bytesToInt(transientKey,0); - int counter = ORBUtility.bytesToInt(transientKey,4); - - if (orb.transientObjectManagerDebugFlag) - dprint( "lookupServantData called with index=" + index + ", counter=" + counter ) ; - - if (elementArray[index].counter == counter && - elementArray[index].valid ) { - if (orb.transientObjectManagerDebugFlag) - dprint( "\tcounter is valid" ) ; - return elementArray[index].servantData; - } - - // servant not found - if (orb.transientObjectManagerDebugFlag) - dprint( "\tcounter is invalid" ) ; - return null; - } - - public synchronized void deleteServant(byte transientKey[]) - { - int index = ORBUtility.bytesToInt(transientKey,0); - if (orb.transientObjectManagerDebugFlag) - dprint( "deleting servant at index=" + index ) ; - - elementArray[index].delete(freeList); - freeList = elementArray[index]; - } - - public synchronized byte[] getKey(java.lang.Object servant) - { - for ( int i=0; i=oldSize; i-- ) - elementArray[i] = new Element(i,elementArray[i+1]); - freeList = elementArray[oldSize]; - } -} - - -final class Element { - java.lang.Object servant=null; // also stores "next pointer" in free list - java.lang.Object servantData=null; - int index=-1; - int counter=0; - boolean valid=false; // valid=true if this Element contains - // a valid servant - - Element(int i, java.lang.Object next) - { - servant = next; - index = i; - } - - byte[] getKey(java.lang.Object servant, java.lang.Object servantData) - { - this.servant = servant; - this.servantData = servantData; - this.valid = true; - - return toBytes(); - } - - byte[] toBytes() - { - // Convert the index+counter into an 8-byte (big-endian) key. - - byte key[] = new byte[8]; - ORBUtility.intToBytes(index, key, 0); - ORBUtility.intToBytes(counter, key, 4); - - return key; - } - - void delete(Element freeList) - { - if ( !valid ) // prevent double deletion - return; - counter++; - servantData = null; - valid = false; - - // add this to freeList - servant = freeList; - } - - public String toString() - { - return "Element[" + index + ", " + counter + "]" ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/AppletDataCollector.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orb/AppletDataCollector.java deleted file mode 100644 index ed2c984cb29..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/AppletDataCollector.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orb ; - -import java.applet.Applet ; -import java.util.Properties ; - -public class AppletDataCollector extends DataCollectorBase { - private Applet applet ; - - AppletDataCollector( Applet app, Properties props, String localHostName, - String configurationHostName ) - { - super( props, localHostName, configurationHostName ) ; - this.applet = app ; - } - - public boolean isApplet() - { - return true ; - } - - protected void collect( ) - { - checkPropertyDefaults() ; - - findPropertiesFromFile() ; - - // We do not use system properties for applets in order to - // avoid security exceptions. - - findPropertiesFromProperties() ; - findPropertiesFromApplet( applet ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/DataCollectorBase.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orb/DataCollectorBase.java deleted file mode 100644 index 56b38991528..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/DataCollectorBase.java +++ /dev/null @@ -1,473 +0,0 @@ -/* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orb ; - -import com.sun.corba.se.impl.orbutil.GetPropertyAction ; - -import java.security.PrivilegedAction ; -import java.security.AccessController ; - -import java.applet.Applet ; - -import java.util.Properties ; -import java.util.Vector ; -import java.util.Set ; -import java.util.HashSet ; -import java.util.Enumeration ; -import java.util.Iterator ; -import java.util.StringTokenizer ; - -import java.net.URL ; - -import java.security.AccessController ; - -import java.io.File ; -import java.io.FileInputStream ; - -import com.sun.corba.se.spi.orb.DataCollector ; -import com.sun.corba.se.spi.orb.PropertyParser ; - -import com.sun.corba.se.impl.orbutil.ORBConstants ; -import com.sun.corba.se.impl.orbutil.ORBUtility; - -public abstract class DataCollectorBase implements DataCollector { - private PropertyParser parser ; - private Set propertyNames ; - private Set propertyPrefixes ; - private Set URLPropertyNames ; - protected String localHostName ; - protected String configurationHostName ; - private boolean setParserCalled ; - private Properties originalProps ; - private Properties resultProps ; - - public DataCollectorBase( Properties props, String localHostName, - String configurationHostName ) - { - // XXX This is fully initialized here. So do we ever want to - // generalize this (or perhaps this is the wrong place for this?) - URLPropertyNames = new HashSet() ; - URLPropertyNames.add( ORBConstants.INITIAL_SERVICES_PROPERTY ) ; - - propertyNames = new HashSet() ; - - // Make sure that we are ready to handle -ORBInitRef. This is special - // due to the need to handle multiple -ORBInitRef args as prefix - // parsing. - propertyNames.add( ORBConstants.ORB_INIT_REF_PROPERTY ) ; - - propertyPrefixes = new HashSet() ; - - this.originalProps = props ; - this.localHostName = localHostName ; - this.configurationHostName = configurationHostName ; - setParserCalled = false ; - resultProps = new Properties() ; - } - -////////////////////////////////////////////////////////// -// Public interface defined in DataCollector -////////////////////////////////////////////////////////// - - public boolean initialHostIsLocal() - { - checkSetParserCalled() ; - return localHostName.equals( resultProps.getProperty( - ORBConstants.INITIAL_HOST_PROPERTY ) ) ; - } - - public void setParser( PropertyParser parser ) - { - Iterator iter = parser.iterator() ; - while (iter.hasNext()) { - ParserAction pa = (ParserAction)(iter.next()) ; - if (pa.isPrefix()) - propertyPrefixes.add( pa.getPropertyName() ) ; - else - propertyNames.add( pa.getPropertyName() ) ; - } - - collect() ; - setParserCalled = true ; - } - - public Properties getProperties() - { - checkSetParserCalled() ; - return resultProps ; - } - -////////////////////////////////////////////////////////// -// public interface from DataCollector that must be defined -// in subclasses -////////////////////////////////////////////////////////// - - public abstract boolean isApplet() ; - -////////////////////////////////////////////////////////// -// Implementation methods needed in subclasses -////////////////////////////////////////////////////////// - - protected abstract void collect() ; - -////////////////////////////////////////////////////////// -// methods for use by subclasses -////////////////////////////////////////////////////////// - - protected void checkPropertyDefaults() - { - String host = - resultProps.getProperty( ORBConstants.INITIAL_HOST_PROPERTY ) ; - - if ((host == null) || (host.equals(""))) - setProperty( ORBConstants.INITIAL_HOST_PROPERTY, - configurationHostName ); - - String serverHost = - resultProps.getProperty( ORBConstants.SERVER_HOST_PROPERTY ) ; - - if (serverHost == null || - serverHost.equals("") || - serverHost.equals("0.0.0.0") || - serverHost.equals("::") || - serverHost.toLowerCase().equals("::ffff:0.0.0.0")) - { - setProperty(ORBConstants.SERVER_HOST_PROPERTY, - localHostName); - setProperty(ORBConstants.LISTEN_ON_ALL_INTERFACES, - ORBConstants.LISTEN_ON_ALL_INTERFACES); - } - } - - protected void findPropertiesFromArgs( String[] params ) - { - if (params == null) - return; - - // All command-line args are of the form "-ORBkey value". - // The key is mapped to .ORBkey. - - String name ; - String value ; - - for ( int i=0; i= - StringTokenizer st = new StringTokenizer( value, "=" ) ; - if (st.countTokens() != 2) - throw new IllegalArgumentException() ; - - String refName = st.nextToken() ; - String refValue = st.nextToken() ; - - resultProps.setProperty( name + "." + refName, refValue ) ; - } else { - resultProps.setProperty( name, value ) ; - } - } - - private void checkSetParserCalled() - { - if (!setParserCalled) - throw new IllegalStateException( "setParser not called." ) ; - } - - // For each prefix in prefixes, For each name in propertyNames, - // if (prefix is a prefix of name) get value from getProperties and - // setProperty (name, value). - private void findPropertiesByPrefix( Set prefixes, - Iterator propertyNames, PropertyCallback getProperty ) - { - while (propertyNames.hasNext()) { - String name = (String)(propertyNames.next()) ; - Iterator iter = prefixes.iterator() ; - while (iter.hasNext()) { - String prefix = (String)(iter.next()) ; - if (name.startsWith( prefix )) { - String value = getProperty.get( name ) ; - - // Note: do a put even if value is null since just - // the presence of the property may be significant. - setProperty( name, value ) ; - } - } - } - } - - // For each prefix in names, get the corresponding property - // value from the callback, and store the name/value pair in - // the result. - private void findPropertiesByName( Iterator names, - PropertyCallback getProperty ) - { - while (names.hasNext()) { - String name = (String)(names.next()) ; - String value = getProperty.get( name ) ; - if (value != null) - setProperty( name, value ) ; - } - } - - private static String getSystemProperty(final String name) - { - return (String)AccessController.doPrivileged( - new GetPropertyAction(name)); - } - - // Map command-line arguments to ORB properties. - // - private String findMatchingPropertyName( Set names, - String suffix ) - { - Iterator iter = names.iterator() ; - while (iter.hasNext()) { - String name = (String)(iter.next()) ; - if (name.endsWith( suffix )) - return name ; - } - - return null ; - } - - private static Iterator makeIterator( final Enumeration enumeration ) - { - return new Iterator() { - public boolean hasNext() { return enumeration.hasMoreElements() ; } - public Object next() { return enumeration.nextElement() ; } - public void remove() { throw new UnsupportedOperationException() ; } - } ; - } - - private static Iterator getSystemPropertyNames() - { - // This will not throw a SecurityException because this - // class was loaded from rt.jar using the bootstrap classloader. - Enumeration enumeration = (Enumeration) - AccessController.doPrivileged( - new PrivilegedAction() { - public java.lang.Object run() { - return System.getProperties().propertyNames(); - } - } - ); - - return makeIterator( enumeration ) ; - } - - private void getPropertiesFromFile( Properties props, String fileName ) - { - try { - File file = new File( fileName ) ; - if (!file.exists()) - return ; - - FileInputStream in = new FileInputStream( file ) ; - - try { - props.load( in ) ; - } finally { - in.close() ; - } - } catch (Exception exc) { - // if (ORBInitDebug) - // dprint( "ORB properties file " + fileName + " not found: " + - // exc) ; - } - } - - private Properties getFileProperties() - { - Properties defaults = new Properties() ; - - String javaHome = getSystemProperty( "java.home" ) ; - String fileName = javaHome + File.separator + "lib" + File.separator + - "orb.properties" ; - - getPropertiesFromFile( defaults, fileName ) ; - - Properties results = new Properties( defaults ) ; - - String userHome = getSystemProperty( "user.home" ) ; - fileName = userHome + File.separator + "orb.properties" ; - - getPropertiesFromFile( results, fileName ) ; - return results ; - } - - private boolean hasCORBAPrefix( String prefix ) - { - return prefix.startsWith( ORBConstants.ORG_OMG_PREFIX ) || - prefix.startsWith( ORBConstants.SUN_PREFIX ) || - prefix.startsWith( ORBConstants.SUN_LC_PREFIX ) || - prefix.startsWith( ORBConstants.SUN_LC_VERSION_PREFIX ) ; - } - - // Return only those element of prefixes for which hasCORBAPrefix - // is true. - private Set getCORBAPrefixes( final Set prefixes ) - { - Set result = new HashSet() ; - Iterator iter = prefixes.iterator() ; - while (iter.hasNext()) { - String element = (String)(iter.next()) ; - if (hasCORBAPrefix( element )) - result.add( element ) ; - } - - return result ; - } -} - -// Used to collect properties from various sources. -abstract class PropertyCallback -{ - abstract public String get(String name); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/DataCollectorFactory.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orb/DataCollectorFactory.java deleted file mode 100644 index b28b4b94749..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/DataCollectorFactory.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orb ; - -import java.applet.Applet ; -import java.util.Properties ; -import java.net.URL ; - -import com.sun.corba.se.spi.orb.DataCollector ; - -public abstract class DataCollectorFactory { - private DataCollectorFactory() {} - - public static DataCollector create( Applet app, Properties props, - String localHostName ) - { - String appletHost = localHostName ; - - if (app != null) { - URL appletCodeBase = app.getCodeBase() ; - - if (appletCodeBase != null) - appletHost = appletCodeBase.getHost() ; - } - - return new AppletDataCollector( app, props, localHostName, - appletHost ) ; - } - - public static DataCollector create( String[] args, Properties props, - String localHostName ) - { - return new NormalDataCollector( args, props, localHostName, - localHostName ) ; - } - - public static DataCollector create( Properties props, - String localHostName ) - { - return new PropertyOnlyDataCollector( props, localHostName, - localHostName ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/NormalDataCollector.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orb/NormalDataCollector.java deleted file mode 100644 index aba45bc0fd0..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/NormalDataCollector.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orb ; - -import java.net.InetAddress ; - -import java.util.Properties ; - -import org.omg.CORBA.INTERNAL ; -import org.omg.CORBA.CompletionStatus ; - -public class NormalDataCollector extends DataCollectorBase { - private String[] args ; - - public NormalDataCollector( String[] args, Properties props, - String localHostName, String configurationHostName ) - { - super( props, localHostName, configurationHostName ) ; - this.args = args ; - } - - public boolean isApplet() - { - return false ; - } - - protected void collect() - { - checkPropertyDefaults() ; - - findPropertiesFromFile() ; - findPropertiesFromSystem() ; - findPropertiesFromProperties() ; - findPropertiesFromArgs( args ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/NormalParserAction.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orb/NormalParserAction.java deleted file mode 100644 index cad8276da95..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/NormalParserAction.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orb ; - -import java.util.Properties ; - -import com.sun.corba.se.spi.orb.Operation ; - -public class NormalParserAction extends ParserActionBase { - public NormalParserAction( String propertyName, - Operation operation, String fieldName ) - { - super( propertyName, false, operation, fieldName ) ; - } - - /** Create a String[] of all suffixes of property names that - * match the propertyName prefix, pass this to op, and return the - * result. - */ - public Object apply( Properties props ) - { - Object value = props.getProperty( getPropertyName() ) ; - if (value != null) - return getOperation().operate( value ) ; - else - return null ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/NormalParserData.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orb/NormalParserData.java deleted file mode 100644 index 4a7cff3aaa7..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/NormalParserData.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orb ; - -import java.util.Properties ; - -import com.sun.corba.se.spi.orb.Operation ; -import com.sun.corba.se.spi.orb.PropertyParser ; - -public class NormalParserData extends ParserDataBase { - private String testData ; - - public NormalParserData( String propertyName, - Operation operation, String fieldName, Object defaultValue, - Object testValue, String testData ) - { - super( propertyName, operation, fieldName, defaultValue, testValue ) ; - this.testData = testData ; - } - public void addToParser( PropertyParser parser ) - { - parser.add( getPropertyName(), getOperation(), getFieldName() ) ; - } - - public void addToProperties( Properties props ) - { - props.setProperty( getPropertyName(), testData ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ORBConfiguratorImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ORBConfiguratorImpl.java deleted file mode 100644 index 1d2684d30da..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ORBConfiguratorImpl.java +++ /dev/null @@ -1,628 +0,0 @@ -/* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orb ; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.InetAddress ; -import java.security.PrivilegedAction ; -import java.security.PrivilegedExceptionAction ; -import java.security.AccessController ; -import java.util.Collection ; -import java.util.Iterator ; - -import org.omg.CORBA.CompletionStatus ; -import org.omg.CORBA.portable.ValueFactory ; - -import com.sun.corba.se.pept.protocol.ClientRequestDispatcher ; -import com.sun.corba.se.pept.transport.Acceptor; - -import com.sun.corba.se.spi.activation.Locator ; -import com.sun.corba.se.spi.activation.Activator ; -import com.sun.corba.se.spi.activation.LocatorHelper ; -import com.sun.corba.se.spi.activation.ActivatorHelper ; -import com.sun.corba.se.spi.activation.EndPointInfo ; - -import com.sun.corba.se.spi.copyobject.ObjectCopierFactory ; -import com.sun.corba.se.spi.copyobject.CopyobjectDefaults ; -import com.sun.corba.se.spi.copyobject.CopierManager ; - -import com.sun.corba.se.spi.ior.IdentifiableFactoryFinder ; -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.IORFactories ; - -import com.sun.corba.se.spi.ior.iiop.IIOPFactories ; - -import com.sun.corba.se.spi.legacy.connection.ORBSocketFactory; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; - -import com.sun.corba.se.spi.oa.OADefault ; -import com.sun.corba.se.spi.oa.ObjectAdapter ; -import com.sun.corba.se.spi.oa.ObjectAdapterFactory ; - -import com.sun.corba.se.spi.orb.Operation ; -import com.sun.corba.se.spi.orb.OperationFactory ; -import com.sun.corba.se.spi.orb.ORBData ; -import com.sun.corba.se.spi.orb.DataCollector ; -import com.sun.corba.se.spi.orb.ORBConfigurator ; -import com.sun.corba.se.spi.orb.ParserImplBase ; -import com.sun.corba.se.spi.orb.PropertyParser ; -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.spi.orbutil.closure.Closure ; -import com.sun.corba.se.spi.orbutil.closure.ClosureFactory ; - -import com.sun.corba.se.spi.protocol.RequestDispatcherRegistry ; -import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher ; -import com.sun.corba.se.spi.protocol.RequestDispatcherDefault ; -import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcherFactory ; - -import com.sun.corba.se.spi.resolver.LocalResolver ; -import com.sun.corba.se.spi.resolver.Resolver ; -import com.sun.corba.se.spi.resolver.ResolverDefault ; - -import com.sun.corba.se.spi.transport.CorbaContactInfoList; -import com.sun.corba.se.spi.transport.CorbaContactInfoListFactory; -import com.sun.corba.se.spi.transport.SocketInfo; -import com.sun.corba.se.spi.transport.TransportDefault ; - -import com.sun.corba.se.spi.presentation.rmi.PresentationManager ; -import com.sun.corba.se.spi.presentation.rmi.PresentationDefaults ; - -import com.sun.corba.se.spi.servicecontext.ServiceContext ; -import com.sun.corba.se.spi.servicecontext.ServiceContextRegistry ; -import com.sun.corba.se.spi.servicecontext.UEInfoServiceContext ; -import com.sun.corba.se.spi.servicecontext.CodeSetServiceContext ; -import com.sun.corba.se.spi.servicecontext.SendingContextServiceContext ; -import com.sun.corba.se.spi.servicecontext.ORBVersionServiceContext ; -import com.sun.corba.se.spi.servicecontext.MaxStreamFormatVersionServiceContext ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; -import com.sun.corba.se.impl.transport.SocketOrChannelAcceptorImpl; - -// XXX This should go away once we get rid of the port exchange for ORBD -import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketEndPointInfo; -import com.sun.corba.se.impl.legacy.connection.SocketFactoryAcceptorImpl; -import com.sun.corba.se.impl.legacy.connection.SocketFactoryContactInfoListImpl; -import com.sun.corba.se.impl.legacy.connection.USLPort; - -// XXX These should move to SPI -import com.sun.corba.se.impl.orbutil.ORBConstants ; - -// XXX This needs an SPI -import com.sun.corba.se.impl.dynamicany.DynAnyFactoryImpl ; - -public class ORBConfiguratorImpl implements ORBConfigurator { - private ORBUtilSystemException wrapper ; - - public static class ConfigParser extends ParserImplBase { - public Class[] userConfigurators = null ; - - public PropertyParser makeParser() - { - PropertyParser parser = new PropertyParser() ; - Operation action = OperationFactory.compose( - OperationFactory.suffixAction(), - OperationFactory.classAction() - ) ; - parser.addPrefix( ORBConstants.SUN_PREFIX + "ORBUserConfigurators", - action, "userConfigurators", Class.class ) ; - return parser ; - } - } - - public void configure( DataCollector collector, ORB orb ) - { - ORB theOrb = orb ; - wrapper = ORBUtilSystemException.get( orb, CORBALogDomains.ORB_LIFECYCLE ) ; - - initObjectCopiers( theOrb ) ; - initIORFinders( theOrb ) ; - - theOrb.setClientDelegateFactory( - // REVISIT: this should be ProtocolDefault. - TransportDefault.makeClientDelegateFactory( theOrb )) ; - - initializeTransport(theOrb) ; - - initializeNaming( theOrb ) ; - initServiceContextRegistry( theOrb ) ; - initRequestDispatcherRegistry( theOrb ) ; - registerInitialReferences( theOrb ) ; - - persistentServerInitialization( theOrb ) ; - - runUserConfigurators( collector, theOrb ) ; - } - - private void runUserConfigurators( DataCollector collector, ORB orb ) - { - // Run any pluggable configurators. This is a lot like - // ORBInitializers, only it uses the internal ORB and has - // access to all data for parsing. - ConfigParser parser = new ConfigParser() ; - parser.init( collector ) ; - if (parser.userConfigurators != null) { - for (int ctr=0; ctr() { - public String run() { - String props = System - .getProperty(IORTYPECHECKREGISTRY_FILTER_PROPNAME); - if (props == null) { - props = Security - .getProperty(IORTYPECHECKREGISTRY_FILTER_PROPNAME); - } - return props; - } - }); - if (filterProps != null) { - try { - iorTypeCheckRegistry = new IORTypeCheckRegistryImpl(filterProps, this); - } catch (Exception ex) { - throw wrapper.bootstrapException(ex); - } - - if (this.orbInitDebugFlag) { - dprint(".initIORTypeCheckRegistry, IORTypeCheckRegistryImpl created for properties == " - + filterProps); - } - } else { - if (this.orbInitDebugFlag) { - dprint(".initIORTypeCheckRegistry, IORTypeCheckRegistryImpl NOT created for properties == "); - } - } - } - - protected void setDebugFlags( String[] args ) - { - for (int ctr=0; ctr"Y", and an - * object, YY, then a subsequent call to - * ORB.resolve_initial_references( "Y" ) will - * return object YY. - * - * @param id The ID by which the initial reference will be known. - * @param obj The initial reference itself. - * @throws InvalidName if this operation is called with an empty string id - * or this operation is called with an id that is already registered, - * including the default names defined by OMG. - * @throws BAD_PARAM if the obj parameter is null. - */ - public void register_initial_reference( - String id, org.omg.CORBA.Object obj ) throws InvalidName - { - CorbaServerRequestDispatcher insnd ; - - synchronized (this) { - checkShutdownState(); - } - - if ((id == null) || (id.length() == 0)) - throw new InvalidName() ; - - synchronized (this) { - checkShutdownState(); - } - - synchronized (resolverLock) { - insnd = insNamingDelegate ; - - java.lang.Object obj2 = localResolver.resolve( id ) ; - if (obj2 != null) - throw new InvalidName(id + " already registered") ; - - localResolver.register( id, ClosureFactory.makeConstant( obj )) ; - } - - synchronized (this) { - if (StubAdapter.isStub(obj)) - // Make all remote object references available for INS. - requestDispatcherRegistry.registerServerRequestDispatcher( - insnd, id ) ; - } - } - -/**************************************************************************** - * The following methods (introduced in POA / CORBA2.1) deal with - * shutdown / single threading. - ****************************************************************************/ - - public void run() - { - synchronized (this) { - checkShutdownState(); - } - - synchronized (runObj) { - try { - runObj.wait(); - } catch ( InterruptedException ex ) {} - } - } - - public void shutdown(boolean wait_for_completion) { - boolean wait = false; - - synchronized (this) { - checkShutdownState(); - - // This is to avoid deadlock: don't allow a thread that is - // processing a request to call shutdown( true ), because - // the shutdown would block waiting for the request to complete, - // while the request would block waiting for shutdown to complete. - if (wait_for_completion && - isProcessingInvocation.get() == Boolean.TRUE) { - throw omgWrapper.shutdownWaitForCompletionDeadlock(); - } - - if (status == STATUS_SHUTTING_DOWN) { - if (wait_for_completion) { - wait = true; - } else { - return; - } - } - - status = STATUS_SHUTTING_DOWN; - } - - // Avoid more than one thread performing shutdown at a time. - synchronized (shutdownObj) { - // At this point, the ORB status is certainly STATUS_SHUTTING_DOWN. - // If wait is true, another thread already called shutdown( true ), - // and so we wait for completion - if (wait) { - while (true) { - synchronized (this) { - if (status == STATUS_SHUTDOWN) - break; - } - - try { - shutdownObj.wait(); - } catch (InterruptedException exc) { - // NOP: just loop and wait until state is changed - } - } - } else { - // perform the actual shutdown - shutdownServants(wait_for_completion); - - if (wait_for_completion) { - synchronized ( waitForCompletionObj ) { - while (numInvocations > 0) { - try { - waitForCompletionObj.wait(); - } catch (InterruptedException ex) {} - } - } - } - - synchronized (runObj) { - runObj.notifyAll(); - } - - status = STATUS_SHUTDOWN; - - shutdownObj.notifyAll(); - } - } - } - - // Cause all ObjectAdapaterFactories to clean up all of their internal state, which - // may include activated objects that have associated state and callbacks that must - // complete in order to shutdown. This will cause new request to be rejected. - protected void shutdownServants(boolean wait_for_completion) { - Set oaset; - synchronized (this) { - oaset = new HashSet<>(requestDispatcherRegistry.getObjectAdapterFactories()); - } - - for (ObjectAdapterFactory oaf : oaset) - oaf.shutdown(wait_for_completion); - } - - // Note that the caller must hold the ORBImpl lock. - public void checkShutdownState() - { - if (status == STATUS_DESTROYED) { - throw wrapper.orbDestroyed() ; - } - - if (status == STATUS_SHUTDOWN) { - throw omgWrapper.badOperationAfterShutdown() ; - } - } - - public boolean isDuringDispatch() - { - synchronized (this) { - checkShutdownState(); - } - Boolean value = (Boolean)(isProcessingInvocation.get()) ; - return value.booleanValue() ; - } - - public void startingDispatch() - { - synchronized (this) { - checkShutdownState(); - } - synchronized (invocationObj) { - isProcessingInvocation.set(Boolean.TRUE); - numInvocations++; - } - } - - public void finishedDispatch() - { - synchronized (this) { - checkShutdownState(); - } - synchronized (invocationObj) { - numInvocations--; - isProcessingInvocation.set(false); - if (numInvocations == 0) { - synchronized (waitForCompletionObj) { - waitForCompletionObj.notifyAll(); - } - } else if (numInvocations < 0) { - throw wrapper.numInvocationsAlreadyZero( - CompletionStatus.COMPLETED_YES); - } - } - } - - /** - * formal/99-10-07 p 159: "If destroy is called on an ORB that has - * not been shut down, it will start the shutdown process and block until - * the ORB has shut down before it destroys the ORB." - */ - public void destroy() - { - boolean shutdownFirst = false; - - synchronized (this) { - shutdownFirst = (status == STATUS_OPERATING); - } - - if (shutdownFirst) { - shutdown(true); - } - - synchronized (this) { - if (status < STATUS_DESTROYED) { - getCorbaTransportManager().close(); - getPIHandler().destroyInterceptors(); - status = STATUS_DESTROYED; - } - } - synchronized (threadPoolManagerAccessLock) { - if (orbOwnsThreadPoolManager) { - try { - threadpoolMgr.close(); - threadpoolMgr = null; - } catch (IOException exc) { - wrapper.ioExceptionOnClose(exc); - } - } - } - - try { - monitoringManager.close(); - monitoringManager = null; - } catch (IOException exc) { - wrapper.ioExceptionOnClose(exc); - } - - CachedCodeBase.cleanCache(this); - try { - pihandler.close(); - } catch (IOException exc) { - wrapper.ioExceptionOnClose(exc); - } - - super.destroy(); - - badServerIdHandlerAccessLock = null; - clientDelegateFactoryAccessorLock = null; - corbaContactInfoListFactoryAccessLock = null; - - objectKeyFactoryAccessLock = null; - legacyServerSocketManagerAccessLock = null; - threadPoolManagerAccessLock = null; - transportManager = null; - legacyServerSocketManager = null; - OAInvocationInfoStack = null; - clientInvocationInfoStack = null; - codeBaseIOR = null; - dynamicRequests = null; - svResponseReceived = null; - runObj = null; - shutdownObj = null; - waitForCompletionObj = null; - invocationObj = null; - isProcessingInvocation = null; - typeCodeForClassMap = null; - valueFactoryCache = null; - orbVersionThreadLocal = null; - requestDispatcherRegistry = null; - copierManager = null; - toaFactory = null; - poaFactory = null; - pihandler = null; - configData = null; - badServerIdHandler = null; - clientDelegateFactory = null; - corbaContactInfoListFactory = null; - resolver = null; - localResolver = null; - insNamingDelegate = null; - urlOperation = null; - taggedComponentFactoryFinder = null; - taggedProfileFactoryFinder = null; - taggedProfileTemplateFactoryFinder = null; - objectKeyFactory = null; - } - - /** - * Registers a value factory for a particular repository ID. - * - * @param repositoryID the repository ID. - * @param factory the factory. - * @return the previously registered factory for the given repository ID, - * or null if no such factory was previously registered. - * @exception org.omg.CORBA.BAD_PARAM if the registration fails. - **/ - public synchronized ValueFactory register_value_factory(String repositoryID, - ValueFactory factory) - { - checkShutdownState(); - - if ((repositoryID == null) || (factory == null)) - throw omgWrapper.unableRegisterValueFactory() ; - - return (ValueFactory)valueFactoryCache.put(repositoryID, factory); - } - - /** - * Unregisters a value factory for a particular repository ID. - * - * @param repositoryID the repository ID. - **/ - public synchronized void unregister_value_factory(String repositoryID) - { - checkShutdownState(); - - if (valueFactoryCache.remove(repositoryID) == null) - throw wrapper.nullParam() ; - } - - /** - * Finds and returns a value factory for the given repository ID. - * The value factory returned was previously registered by a call to - * {@link #register_value_factory} or is the default factory. - * - * @param repositoryID the repository ID. - * @return the value factory. - * @exception org.omg.CORBA.BAD_PARAM if unable to locate a factory. - **/ - public synchronized ValueFactory lookup_value_factory(String repositoryID) - { - checkShutdownState(); - - ValueFactory factory = - (ValueFactory)valueFactoryCache.get(repositoryID); - - if (factory == null) { - try { - factory = Utility.getFactory(null, null, null, repositoryID); - } catch(org.omg.CORBA.MARSHAL ex) { - throw wrapper.unableFindValueFactory( ex ) ; - } - } - - return factory ; - } - - public OAInvocationInfo peekInvocationInfo() - { - synchronized (this) { - checkShutdownState(); - } - StackImpl stack = (StackImpl)(OAInvocationInfoStack.get()) ; - return (OAInvocationInfo)(stack.peek()) ; - } - - public void pushInvocationInfo( OAInvocationInfo info ) - { - synchronized (this) { - checkShutdownState(); - } - StackImpl stack = (StackImpl)(OAInvocationInfoStack.get()) ; - stack.push( info ) ; - } - - public OAInvocationInfo popInvocationInfo() - { - synchronized (this) { - checkShutdownState(); - } - StackImpl stack = (StackImpl)(OAInvocationInfoStack.get()) ; - return (OAInvocationInfo)(stack.pop()) ; - } - - /** - * The bad server id handler is used by the Locator to - * send back the location of a persistant server to the client. - */ - - private Object badServerIdHandlerAccessLock = new Object(); - - public void initBadServerIdHandler() - { - synchronized (this) { - checkShutdownState(); - } - synchronized (badServerIdHandlerAccessLock) { - Class cls = configData.getBadServerIdHandler() ; - if (cls != null) { - try { - Class[] params = new Class[] { org.omg.CORBA.ORB.class }; - java.lang.Object[] args = new java.lang.Object[]{this}; - Constructor cons = cls.getConstructor(params); - badServerIdHandler = - (BadServerIdHandler) cons.newInstance(args); - } catch (Exception e) { - throw wrapper.errorInitBadserveridhandler( e ) ; - } - } - } - } - - public void setBadServerIdHandler( BadServerIdHandler handler ) - { - synchronized (this) { - checkShutdownState(); - } - synchronized (badServerIdHandlerAccessLock) { - badServerIdHandler = handler; - } - } - - public void handleBadServerId( ObjectKey okey ) - { - synchronized (this) { - checkShutdownState(); - } - synchronized (badServerIdHandlerAccessLock) { - if (badServerIdHandler == null) - throw wrapper.badServerId() ; - else - badServerIdHandler.handle( okey ) ; - } - } - - public synchronized org.omg.CORBA.Policy create_policy( int type, - org.omg.CORBA.Any val ) throws org.omg.CORBA.PolicyError - { - checkShutdownState() ; - - return pihandler.create_policy( type, val ) ; - } - - /** This is the implementation of the public API used to connect - * a servant-skeleton to the ORB. - */ - public synchronized void connect(org.omg.CORBA.Object servant) - { - checkShutdownState(); - if (getTOAFactory() == null) - throw wrapper.noToa() ; - - try { - String codebase = javax.rmi.CORBA.Util.getCodebase( servant.getClass() ) ; - getTOAFactory().getTOA( codebase ).connect( servant ) ; - } catch ( Exception ex ) { - throw wrapper.orbConnectError( ex ) ; - } - } - - public synchronized void disconnect(org.omg.CORBA.Object obj) - { - checkShutdownState(); - if (getTOAFactory() == null) - throw wrapper.noToa() ; - - try { - getTOAFactory().getTOA().disconnect( obj ) ; - } catch ( Exception ex ) { - throw wrapper.orbConnectError( ex ) ; - } - } - - public int getTransientServerId() - { - synchronized (this) { - checkShutdownState(); - } - if( configData.getORBServerIdPropertySpecified( ) ) { - // ORBServerId is specified then use that value - return configData.getPersistentServerId( ); - } - return transientServerId; - } - - public RequestDispatcherRegistry getRequestDispatcherRegistry() - { - synchronized (this) { - checkShutdownState(); - } - return requestDispatcherRegistry; - } - - public ServiceContextRegistry getServiceContextRegistry() - { - synchronized (this) { - checkShutdownState(); - } - return serviceContextRegistry ; - } - - // XXX All of the isLocalXXX checking needs to be revisited. - // First of all, all three of these methods are called from - // only one place in impl.ior.IORImpl. Second, we have problems - // both with multi-homed hosts and with multi-profile IORs. - // A possible strategy: like the LocalClientRequestDispatcher, we need - // to determine this more abstractly at the ContactInfo level. - // This level should probably just get the CorbaContactInfoList from - // the IOR, then iterator over ContactInfo. If any ContactInfo is - // local, the IOR is local, and we can pick one to create the - // LocalClientRequestDispatcher as well. Bottom line: this code needs to move. - - // XXX What about multi-homed host? - public boolean isLocalHost( String hostName ) - { - synchronized (this) { - checkShutdownState(); - } - return hostName.equals( configData.getORBServerHost() ) || - hostName.equals( getLocalHostName() ) ; - } - - public boolean isLocalServerId( int subcontractId, int serverId ) - { - synchronized (this) { - checkShutdownState(); - } - if ((subcontractId < ORBConstants.FIRST_POA_SCID) || - (subcontractId > ORBConstants.MAX_POA_SCID)) - return serverId == getTransientServerId( ) ; - - // XXX isTransient info should be stored in subcontract registry - if (ORBConstants.isTransient( subcontractId )) - return (serverId == getTransientServerId()) ; - else if (configData.getPersistentServerIdInitialized()) - return (serverId == configData.getPersistentServerId()) ; - else - return false ; - } - - /************************************************************************* - * The following public methods are for ORB shutdown. - *************************************************************************/ - - private String getHostName(String host) - throws java.net.UnknownHostException - { - return InetAddress.getByName( host ).getHostAddress(); - } - - /* keeping a copy of the getLocalHostName so that it can only be called - * internally and the unauthorized clients cannot have access to the - * localHost information, originally, the above code was calling - * getLocalHostName from Connection.java. If the hostname is cached in - * Connection.java, then - * it is a security hole, since any unauthorized client has access to - * the host information. With this change it is used internally so the - * security problem is resolved. Also in Connection.java, the - * getLocalHost() implementation has changed to always call the - * InetAddress.getLocalHost().getHostAddress() - * The above mentioned method has been removed from the connection class - */ - - private static String localHostString = null; - - private synchronized String getLocalHostName() - { - if (localHostString == null) { - try { - localHostString = InetAddress.getLocalHost().getHostAddress(); - } catch (Exception ex) { - throw wrapper.getLocalHostFailed( ex ) ; - } - } - return localHostString ; - } - - /****************************************************************************** - * The following public methods are for ORB shutdown. - * - ******************************************************************************/ - - /** This method always returns false because the ORB never needs the - * main thread to do work. - */ - public synchronized boolean work_pending() - { - checkShutdownState(); - throw wrapper.genericNoImpl() ; - } - - /** This method does nothing. It is not required by the spec to do anything! - */ - public synchronized void perform_work() - { - checkShutdownState(); - throw wrapper.genericNoImpl() ; - } - - public synchronized void set_delegate(java.lang.Object servant){ - checkShutdownState(); - - POAFactory poaFactory = getPOAFactory() ; - if (poaFactory != null) - ((org.omg.PortableServer.Servant)servant) - ._set_delegate( poaFactory.getDelegateImpl() ) ; - else - throw wrapper.noPoa() ; - } - - //////////////////////////////////////////////////// - // - // pept.broker.Broker - // - - public ClientInvocationInfo createOrIncrementInvocationInfo() - { - synchronized (this) { - checkShutdownState(); - } - StackImpl invocationInfoStack = - (StackImpl) clientInvocationInfoStack.get(); - ClientInvocationInfo clientInvocationInfo = null; - if (!invocationInfoStack.empty()) { - clientInvocationInfo = - (ClientInvocationInfo) invocationInfoStack.peek(); - } - if ((clientInvocationInfo == null) || - (!clientInvocationInfo.isRetryInvocation())) - { - // This is a new call - not a retry. - clientInvocationInfo = new CorbaInvocationInfo(this); - startingDispatch(); - invocationInfoStack.push(clientInvocationInfo); - } - // Reset retry so recursive calls will get a new info object. - clientInvocationInfo.setIsRetryInvocation(false); - clientInvocationInfo.incrementEntryCount(); - return clientInvocationInfo; - } - - public void releaseOrDecrementInvocationInfo() - { - synchronized (this) { - checkShutdownState(); - } - int entryCount = -1; - ClientInvocationInfo clientInvocationInfo = null; - StackImpl invocationInfoStack = - (StackImpl)clientInvocationInfoStack.get(); - if (!invocationInfoStack.empty()) { - clientInvocationInfo = - (ClientInvocationInfo)invocationInfoStack.peek(); - } else { - throw wrapper.invocationInfoStackEmpty() ; - } - clientInvocationInfo.decrementEntryCount(); - entryCount = clientInvocationInfo.getEntryCount(); - if (clientInvocationInfo.getEntryCount() == 0) { - // 6763340: don't pop if this is a retry! - if (!clientInvocationInfo.isRetryInvocation()) { - invocationInfoStack.pop(); - } - finishedDispatch(); - } - } - - public ClientInvocationInfo getInvocationInfo() - { - synchronized (this) { - checkShutdownState(); - } - StackImpl invocationInfoStack = - (StackImpl) clientInvocationInfoStack.get(); - return (ClientInvocationInfo) invocationInfoStack.peek(); - } - - //////////////////////////////////////////////////// - // - // - // - - private Object clientDelegateFactoryAccessorLock = new Object(); - - public void setClientDelegateFactory( ClientDelegateFactory factory ) - { - synchronized (this) { - checkShutdownState(); - } - synchronized (clientDelegateFactoryAccessorLock) { - clientDelegateFactory = factory ; - } - } - - public ClientDelegateFactory getClientDelegateFactory() - { - synchronized (this) { - checkShutdownState(); - } - synchronized (clientDelegateFactoryAccessorLock) { - return clientDelegateFactory ; - } - } - - private Object corbaContactInfoListFactoryAccessLock = new Object(); - - public void setCorbaContactInfoListFactory( CorbaContactInfoListFactory factory ) - { - synchronized (this) { - checkShutdownState(); - } - synchronized (corbaContactInfoListFactoryAccessLock) { - corbaContactInfoListFactory = factory ; - } - } - - public synchronized CorbaContactInfoListFactory getCorbaContactInfoListFactory() - { - checkShutdownState(); - return corbaContactInfoListFactory ; - } - - /** Set the resolver used in this ORB. This resolver will be used for list_initial_services - * and resolve_initial_references. - */ - public void setResolver( Resolver resolver ) - { - synchronized (this) { - checkShutdownState(); - } - synchronized (resolverLock) { - this.resolver = resolver ; - } - } - - /** Get the resolver used in this ORB. This resolver will be used for list_initial_services - * and resolve_initial_references. - */ - public Resolver getResolver() - { - synchronized (this) { - checkShutdownState(); - } - synchronized (resolverLock) { - return resolver ; - } - } - - /** Set the LocalResolver used in this ORB. This LocalResolver is used for - * register_initial_reference only. - */ - public void setLocalResolver( LocalResolver resolver ) - { - synchronized (this) { - checkShutdownState(); - } - synchronized (resolverLock) { - this.localResolver = resolver ; - } - } - - /** Get the LocalResolver used in this ORB. This LocalResolver is used for - * register_initial_reference only. - */ - public LocalResolver getLocalResolver() - { - synchronized (this) { - checkShutdownState(); - } - synchronized (resolverLock) { - return localResolver ; - } - } - - /** Set the operation used in string_to_object calls. The Operation must expect a - * String and return an org.omg.CORBA.Object. - */ - public void setURLOperation( Operation stringToObject ) - { - synchronized (this) { - checkShutdownState(); - } - synchronized (urlOperationLock) { - urlOperation = stringToObject ; - } - } - - /** Get the operation used in string_to_object calls. The Operation must expect a - * String and return an org.omg.CORBA.Object. - */ - public Operation getURLOperation() - { - synchronized (this) { - checkShutdownState(); - } - synchronized (urlOperationLock) { - return urlOperation ; - } - } - - public void setINSDelegate( CorbaServerRequestDispatcher sdel ) - { - synchronized (this) { - checkShutdownState(); - } - synchronized (resolverLock) { - insNamingDelegate = sdel ; - } - } - - public TaggedComponentFactoryFinder getTaggedComponentFactoryFinder() - { - synchronized (this) { - checkShutdownState(); - } - return taggedComponentFactoryFinder ; - } - - public IdentifiableFactoryFinder getTaggedProfileFactoryFinder() - { - synchronized (this) { - checkShutdownState(); - } - return taggedProfileFactoryFinder ; - } - - public IdentifiableFactoryFinder getTaggedProfileTemplateFactoryFinder() - { - synchronized (this) { - checkShutdownState(); - } - return taggedProfileTemplateFactoryFinder ; - } - - private Object objectKeyFactoryAccessLock = new Object(); - - public ObjectKeyFactory getObjectKeyFactory() - { - synchronized (this) { - checkShutdownState(); - } - synchronized (objectKeyFactoryAccessLock) { - return objectKeyFactory ; - } - } - - public void setObjectKeyFactory( ObjectKeyFactory factory ) - { - synchronized (this) { - checkShutdownState(); - } - synchronized (objectKeyFactoryAccessLock) { - objectKeyFactory = factory ; - } - } - - private Object transportManagerAccessorLock = new Object(); - - public TransportManager getTransportManager() - { - synchronized (transportManagerAccessorLock) { - if (transportManager == null) { - transportManager = new CorbaTransportManagerImpl(this); - } - return transportManager; - } - } - - public CorbaTransportManager getCorbaTransportManager() - { - return (CorbaTransportManager) getTransportManager(); - } - - private Object legacyServerSocketManagerAccessLock = new Object(); - - public LegacyServerSocketManager getLegacyServerSocketManager() - { - synchronized (this) { - checkShutdownState(); - } - synchronized (legacyServerSocketManagerAccessLock) { - if (legacyServerSocketManager == null) { - legacyServerSocketManager = new LegacyServerSocketManagerImpl(this); - } - return legacyServerSocketManager; - } - } - - private Object threadPoolManagerAccessLock = new Object(); - - public void setThreadPoolManager(ThreadPoolManager mgr) - { - synchronized (this) { - checkShutdownState(); - } - synchronized (threadPoolManagerAccessLock) { - threadpoolMgr = mgr; - } - } - - public ThreadPoolManager getThreadPoolManager() - { - synchronized (this) { - checkShutdownState(); - } - synchronized (threadPoolManagerAccessLock) { - if (threadpoolMgr == null) { - threadpoolMgr = new ThreadPoolManagerImpl(); - orbOwnsThreadPoolManager = true; - } - return threadpoolMgr; - } - } - - public CopierManager getCopierManager() - { - synchronized (this) { - checkShutdownState(); - } - return copierManager ; - } - - @Override - public void validateIORClass(String iorClassName) { - if (iorTypeCheckRegistry != null) { - if (!iorTypeCheckRegistry.isValidIORType(iorClassName)) { - throw ORBUtilSystemException.get( this, - CORBALogDomains.OA_IOR ).badStringifiedIor(); - } - } - } - -} // Class ORBImpl - -//////////////////////////////////////////////////////////////////////// -/// Helper class for a Synchronization Variable -//////////////////////////////////////////////////////////////////////// - -class SynchVariable -{ - // Synchronization Variable - public boolean _flag; - - // Constructor - SynchVariable() - { - _flag = false; - } - - // set Flag to true - public void set() - { - _flag = true; - } - - // get value - public boolean value() - { - return _flag; - } - - // reset Flag to true - public void reset() - { - _flag = false; - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ORBSingleton.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ORBSingleton.java deleted file mode 100644 index 3430a4406a5..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ORBSingleton.java +++ /dev/null @@ -1,780 +0,0 @@ -/* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.orb; - -import java.util.Collection; -import java.util.Properties; -import java.util.Hashtable; - -import java.applet.Applet; - -import java.net.URL; - -import java.io.IOException ; - -import java.util.logging.Logger ; - -import org.omg.CORBA.Context; -import org.omg.CORBA.ContextList; -import org.omg.CORBA.Environment; -import org.omg.CORBA.ExceptionList; -import org.omg.CORBA.ORBPackage.InvalidName; -import org.omg.CORBA.NVList; -import org.omg.CORBA.TCKind; -import org.omg.CORBA.NamedValue; -import org.omg.CORBA.NO_IMPLEMENT; -import org.omg.CORBA.Object; -import org.omg.CORBA.Request; -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.Any; -import org.omg.CORBA.StructMember; -import org.omg.CORBA.UnionMember; -import org.omg.CORBA.ValueMember; -import org.omg.CORBA.Policy; -import org.omg.CORBA.PolicyError; - -import org.omg.CORBA.portable.OutputStream; -import org.omg.CORBA.portable.RemarshalException; - -import com.sun.corba.se.pept.protocol.ClientInvocationInfo ; -import com.sun.corba.se.pept.transport.ContactInfo; -import com.sun.corba.se.pept.transport.ConnectionCache; -import com.sun.corba.se.pept.transport.Selector ; -import com.sun.corba.se.pept.transport.TransportManager; - -import com.sun.corba.se.spi.legacy.connection.ORBSocketFactory; -import com.sun.corba.se.spi.orb.ORBData; -import com.sun.corba.se.spi.orb.Operation; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.orb.ORBVersion; -import com.sun.corba.se.spi.orb.ORBVersionFactory; -import com.sun.corba.se.spi.oa.OAInvocationInfo; -import com.sun.corba.se.spi.oa.ObjectAdapter; -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; -import com.sun.corba.se.spi.protocol.ClientDelegateFactory; -import com.sun.corba.se.spi.protocol.RequestDispatcherRegistry; -import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher; -import com.sun.corba.se.spi.protocol.PIHandler; -import com.sun.corba.se.spi.resolver.Resolver; -import com.sun.corba.se.spi.resolver.LocalResolver; -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.IdentifiableFactoryFinder; -import com.sun.corba.se.spi.ior.TaggedComponentFactoryFinder; -import com.sun.corba.se.spi.ior.ObjectKey; -import com.sun.corba.se.spi.ior.ObjectKeyFactory; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.pept.transport.ByteBufferPool ; -import com.sun.corba.se.spi.transport.CorbaContactInfoListFactory ; -import com.sun.corba.se.spi.transport.CorbaTransportManager; -import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketManager; -import com.sun.corba.se.spi.orbutil.closure.Closure; -import com.sun.corba.se.spi.orbutil.threadpool.ThreadPoolManager; -import com.sun.corba.se.spi.logging.LogWrapperFactory; -import com.sun.corba.se.spi.logging.LogWrapperBase; -import com.sun.corba.se.spi.copyobject.CopierManager; -import com.sun.corba.se.spi.presentation.rmi.PresentationManager; -import com.sun.corba.se.spi.presentation.rmi.PresentationDefaults; - -import com.sun.corba.se.spi.servicecontext.ServiceContextRegistry; -import com.sun.corba.se.spi.servicecontext.ServiceContexts; - -import com.sun.corba.se.impl.corba.TypeCodeFactory; -import com.sun.corba.se.impl.corba.TypeCodeImpl; -import com.sun.corba.se.impl.corba.NVListImpl; -import com.sun.corba.se.impl.corba.NamedValueImpl; -import com.sun.corba.se.impl.corba.ExceptionListImpl; -import com.sun.corba.se.impl.corba.ContextListImpl; -import com.sun.corba.se.impl.corba.EnvironmentImpl; -import com.sun.corba.se.impl.corba.AnyImpl; -import com.sun.corba.se.impl.encoding.BufferManagerFactory; -import com.sun.corba.se.impl.encoding.CodeSetComponentInfo; -import com.sun.corba.se.impl.encoding.MarshalInputStream; -import com.sun.corba.se.impl.encoding.EncapsOutputStream; -import com.sun.corba.se.impl.encoding.MarshalOutputStream; -import com.sun.corba.se.impl.oa.poa.BadServerIdHandler; -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketEndPointInfo; - -/* - * The restricted singleton ORB implementation. - * - * For now, this class must implement just enough functionality to be - * used as a factory for immutable TypeCode instances. - * - * See ORBImpl.java for the real ORB implementation. - */ -public class ORBSingleton extends ORB -{ - // This is used to support read_Object. - private ORB fullORB; - private static PresentationManager.StubFactoryFactory staticStubFactoryFactory = - PresentationDefaults.getStaticStubFactoryFactory() ; - - public void set_parameters( Properties props ) { - } - - protected void set_parameters(Applet app, Properties props) { - } - - protected void set_parameters (String params[], Properties props) { - } - - public OutputStream create_output_stream() { - return sun.corba.OutputStreamFactory.newEncapsOutputStream(this); - } - - public TypeCode create_struct_tc(String id, - String name, - StructMember[] members) - { - return new TypeCodeImpl(this, TCKind._tk_struct, id, name, members); - } - - public TypeCode create_union_tc(String id, - String name, - TypeCode discriminator_type, - UnionMember[] members) - { - return new TypeCodeImpl(this, - TCKind._tk_union, - id, - name, - discriminator_type, - members); - } - - public TypeCode create_enum_tc(String id, - String name, - String[] members) - { - return new TypeCodeImpl(this, TCKind._tk_enum, id, name, members); - } - - public TypeCode create_alias_tc(String id, - String name, - TypeCode original_type) - { - return new TypeCodeImpl(this, TCKind._tk_alias, id, name, original_type); - } - - public TypeCode create_exception_tc(String id, - String name, - StructMember[] members) - { - return new TypeCodeImpl(this, TCKind._tk_except, id, name, members); - } - - public TypeCode create_interface_tc(String id, - String name) - { - return new TypeCodeImpl(this, TCKind._tk_objref, id, name); - } - - public TypeCode create_string_tc(int bound) { - return new TypeCodeImpl(this, TCKind._tk_string, bound); - } - - public TypeCode create_wstring_tc(int bound) { - return new TypeCodeImpl(this, TCKind._tk_wstring, bound); - } - - public TypeCode create_sequence_tc(int bound, - TypeCode element_type) - { - return new TypeCodeImpl(this, TCKind._tk_sequence, bound, element_type); - } - - public TypeCode create_recursive_sequence_tc(int bound, - int offset) - { - return new TypeCodeImpl(this, TCKind._tk_sequence, bound, offset); - } - - public TypeCode create_array_tc(int length, - TypeCode element_type) - { - return new TypeCodeImpl(this, TCKind._tk_array, length, element_type); - } - - public org.omg.CORBA.TypeCode create_native_tc(String id, - String name) - { - return new TypeCodeImpl(this, TCKind._tk_native, id, name); - } - - public org.omg.CORBA.TypeCode create_abstract_interface_tc( - String id, - String name) - { - return new TypeCodeImpl(this, TCKind._tk_abstract_interface, id, name); - } - - public org.omg.CORBA.TypeCode create_fixed_tc(short digits, short scale) - { - return new TypeCodeImpl(this, TCKind._tk_fixed, digits, scale); - } - - // orbos 98-01-18: Objects By Value -- begin - - public org.omg.CORBA.TypeCode create_value_tc(String id, - String name, - short type_modifier, - TypeCode concrete_base, - ValueMember[] members) - { - return new TypeCodeImpl(this, TCKind._tk_value, id, name, - type_modifier, concrete_base, members); - } - - public org.omg.CORBA.TypeCode create_recursive_tc(String id) { - return new TypeCodeImpl(this, id); - } - - public org.omg.CORBA.TypeCode create_value_box_tc(String id, - String name, - TypeCode boxed_type) - { - return new TypeCodeImpl(this, TCKind._tk_value_box, id, name, boxed_type); - } - - public TypeCode get_primitive_tc( TCKind tckind ) - { - return get_primitive_tc( tckind.value() ) ; - } - - public Any create_any() { - return new AnyImpl(this); - } - - // TypeCodeFactory interface methods. - // Keeping track of type codes by repository id. - /* - * Not strictly needed for TypeCode factory duty but these seem - * harmless enough. - */ - - public NVList create_list(int count) { - return new NVListImpl(this, count); - } - - public org.omg.CORBA.NVList - create_operation_list(org.omg.CORBA.Object oper) { - throw wrapper.genericNoImpl() ; - } - - public org.omg.CORBA.NamedValue - create_named_value(String s, Any any, int flags) { - return new NamedValueImpl(this, s, any, flags); - } - - public org.omg.CORBA.ExceptionList create_exception_list() { - return new ExceptionListImpl(); - } - - public org.omg.CORBA.ContextList create_context_list() { - return new ContextListImpl(this); - } - - public org.omg.CORBA.Context get_default_context() - { - throw wrapper.genericNoImpl() ; - } - - public org.omg.CORBA.Environment create_environment() - { - return new EnvironmentImpl(); - } - - public org.omg.CORBA.Current get_current() - { - throw wrapper.genericNoImpl() ; - } - - /* - * Things that aren't allowed. - */ - - public String[] list_initial_services () - { - throw wrapper.genericNoImpl() ; - } - - public org.omg.CORBA.Object resolve_initial_references(String identifier) - throws InvalidName - { - throw wrapper.genericNoImpl() ; - } - - public void register_initial_reference( - String id, org.omg.CORBA.Object obj ) throws InvalidName - { - throw wrapper.genericNoImpl() ; - } - - public void send_multiple_requests_oneway(Request[] req) { - throw new SecurityException("ORBSingleton: access denied"); - } - - public void send_multiple_requests_deferred(Request[] req) { - throw new SecurityException("ORBSingleton: access denied"); - } - - public boolean poll_next_response() { - throw new SecurityException("ORBSingleton: access denied"); - } - - public org.omg.CORBA.Request get_next_response() { - throw new SecurityException("ORBSingleton: access denied"); - } - - public String object_to_string(org.omg.CORBA.Object obj) { - throw new SecurityException("ORBSingleton: access denied"); - } - - public org.omg.CORBA.Object string_to_object(String s) { - throw new SecurityException("ORBSingleton: access denied"); - } - - public java.rmi.Remote string_to_remote(String s) - throws java.rmi.RemoteException - { - throw new SecurityException("ORBSingleton: access denied"); - } - - public void connect(org.omg.CORBA.Object servant) { - throw new SecurityException("ORBSingleton: access denied"); - } - - public void disconnect(org.omg.CORBA.Object obj) { - throw new SecurityException("ORBSingleton: access denied"); - } - - public void run() - { - throw new SecurityException("ORBSingleton: access denied"); - } - - public void shutdown(boolean wait_for_completion) - { - throw new SecurityException("ORBSingleton: access denied"); - } - - protected void shutdownServants(boolean wait_for_completion) { - throw new SecurityException("ORBSingleton: access denied"); - } - - protected void destroyConnections() { - throw new SecurityException("ORBSingleton: access denied"); - } - - public void destroy() { - throw new SecurityException("ORBSingleton: access denied"); - } - - public boolean work_pending() - { - throw new SecurityException("ORBSingleton: access denied"); - } - - public void perform_work() - { - throw new SecurityException("ORBSingleton: access denied"); - } - - public org.omg.CORBA.portable.ValueFactory register_value_factory(String repositoryID, - org.omg.CORBA.portable.ValueFactory factory) - { - throw new SecurityException("ORBSingleton: access denied"); - } - - public void unregister_value_factory(String repositoryID) - { - throw new SecurityException("ORBSingleton: access denied"); - } - - public org.omg.CORBA.portable.ValueFactory lookup_value_factory(String repositoryID) - { - throw new SecurityException("ORBSingleton: access denied"); - } - - public TransportManager getTransportManager() - { - throw new SecurityException("ORBSingleton: access denied"); - } - - public CorbaTransportManager getCorbaTransportManager() - { - throw new SecurityException("ORBSingleton: access denied"); - } - - public LegacyServerSocketManager getLegacyServerSocketManager() - { - throw new SecurityException("ORBSingleton: access denied"); - } - -/************************************************************************* - These are methods from com.sun.corba.se.impl.se.core.ORB - ************************************************************************/ - - private synchronized ORB getFullORB() - { - if (fullORB == null) { - Properties props = new Properties() ; - fullORB = new ORBImpl() ; - fullORB.set_parameters( props ) ; - } - - return fullORB ; - } - - public RequestDispatcherRegistry getRequestDispatcherRegistry() - { - // To enable read_Object. - - return getFullORB().getRequestDispatcherRegistry(); - } - - /** - * Return the service context registry - */ - public ServiceContextRegistry getServiceContextRegistry() - { - throw new SecurityException("ORBSingleton: access denied"); - } - - /** - * Get the transient server ID - */ - public int getTransientServerId() - { - throw new SecurityException("ORBSingleton: access denied"); - } - - /** - * Return the bootstrap naming port specified in the ORBInitialPort param. - */ - public int getORBInitialPort() - { - throw new SecurityException("ORBSingleton: access denied"); - } - - /** - * Return the bootstrap naming host specified in the ORBInitialHost param. - */ - public String getORBInitialHost() - { - throw new SecurityException("ORBSingleton: access denied"); - } - - public String getORBServerHost() - { - throw new SecurityException("ORBSingleton: access denied"); - } - - public int getORBServerPort() - { - throw new SecurityException("ORBSingleton: access denied"); - } - - public CodeSetComponentInfo getCodeSetComponentInfo() - { - return new CodeSetComponentInfo(); - } - - public boolean isLocalHost( String host ) - { - // To enable read_Object. - return false; - } - - public boolean isLocalServerId( int subcontractId, int serverId ) - { - // To enable read_Object. - return false; - } - - /* - * Things from corba.ORB. - */ - - public ORBVersion getORBVersion() - { - // Always use our latest ORB version (latest fixes, etc) - return ORBVersionFactory.getORBVersion(); - } - - public void setORBVersion(ORBVersion verObj) - { - throw new SecurityException("ORBSingleton: access denied"); - } - - public String getAppletHost() - { - throw new SecurityException("ORBSingleton: access denied"); - } - - public URL getAppletCodeBase() - { - throw new SecurityException("ORBSingleton: access denied"); - } - - public int getHighWaterMark(){ - throw new SecurityException("ORBSingleton: access denied"); - } - - public int getLowWaterMark(){ - throw new SecurityException("ORBSingleton: access denied"); - } - - public int getNumberToReclaim(){ - throw new SecurityException("ORBSingleton: access denied"); - } - - public int getGIOPFragmentSize() { - return ORBConstants.GIOP_DEFAULT_BUFFER_SIZE; - } - - public int getGIOPBuffMgrStrategy(GIOPVersion gv) { - return BufferManagerFactory.GROW; - } - - public IOR getFVDCodeBaseIOR(){ - throw new SecurityException("ORBSingleton: access denied"); - } - - public Policy create_policy( int type, Any val ) throws PolicyError - { - throw new NO_IMPLEMENT(); - } - - public LegacyServerSocketEndPointInfo getServerEndpoint() - { - return null ; - } - - public void setPersistentServerId( int id ) - { - } - - public TypeCodeImpl getTypeCodeForClass( Class c ) - { - return null ; - } - - public void setTypeCodeForClass( Class c, TypeCodeImpl tcimpl ) - { - } - - public boolean alwaysSendCodeSetServiceContext() - { - return true ; - } - - public boolean isDuringDispatch() - { - return false ; - } - - public void notifyORB() { } - - public PIHandler getPIHandler() - { - return null ; - } - - public void checkShutdownState() - { - } - - public void startingDispatch() - { - } - - public void finishedDispatch() - { - } - - public void registerInitialReference( String id, Closure closure ) - { - } - - public ORBData getORBData() - { - return getFullORB().getORBData() ; - } - - public void setClientDelegateFactory( ClientDelegateFactory factory ) - { - } - - public ClientDelegateFactory getClientDelegateFactory() - { - return getFullORB().getClientDelegateFactory() ; - } - - public void setCorbaContactInfoListFactory( CorbaContactInfoListFactory factory ) - { - } - - public CorbaContactInfoListFactory getCorbaContactInfoListFactory() - { - return getFullORB().getCorbaContactInfoListFactory() ; - } - - public Operation getURLOperation() - { - return null ; - } - - public void setINSDelegate( CorbaServerRequestDispatcher sdel ) - { - } - - public TaggedComponentFactoryFinder getTaggedComponentFactoryFinder() - { - return getFullORB().getTaggedComponentFactoryFinder() ; - } - - public IdentifiableFactoryFinder getTaggedProfileFactoryFinder() - { - return getFullORB().getTaggedProfileFactoryFinder() ; - } - - public IdentifiableFactoryFinder getTaggedProfileTemplateFactoryFinder() - { - return getFullORB().getTaggedProfileTemplateFactoryFinder() ; - } - - public ObjectKeyFactory getObjectKeyFactory() - { - return getFullORB().getObjectKeyFactory() ; - } - - public void setObjectKeyFactory( ObjectKeyFactory factory ) - { - throw new SecurityException("ORBSingleton: access denied"); - } - - public void handleBadServerId( ObjectKey okey ) - { - } - - public OAInvocationInfo peekInvocationInfo() - { - return null ; - } - - public void pushInvocationInfo( OAInvocationInfo info ) - { - } - - public OAInvocationInfo popInvocationInfo() - { - return null ; - } - - public ClientInvocationInfo createOrIncrementInvocationInfo() - { - return null ; - } - - public void releaseOrDecrementInvocationInfo() - { - } - - public ClientInvocationInfo getInvocationInfo() - { - return null ; - } - - public ConnectionCache getConnectionCache(ContactInfo contactInfo) - { - return null; - } - - public void setResolver( Resolver resolver ) - { - } - - public Resolver getResolver() - { - return null ; - } - - public void setLocalResolver( LocalResolver resolver ) - { - } - - public LocalResolver getLocalResolver() - { - return null ; - } - - public void setURLOperation( Operation stringToObject ) - { - } - - // NOTE: REMOVE THIS METHOD ONCE WE HAVE A ORT BASED ORBD - public void setBadServerIdHandler( BadServerIdHandler handler ) - { - } - - // NOTE: REMOVE THIS METHOD ONCE WE HAVE A ORT BASED ORBD - public void initBadServerIdHandler() - { - } - - public Selector getSelector(int x) - { - return null; - } - - public void setThreadPoolManager(ThreadPoolManager mgr) { - } - - public ThreadPoolManager getThreadPoolManager() { - return null; - } - - public CopierManager getCopierManager() { - return null ; - } - - @Override - public void validateIORClass(String iorClassName) { - getFullORB().validateIORClass(iorClassName); - - } - -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ORBVersionImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ORBVersionImpl.java deleted file mode 100644 index 5307c4b6911..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ORBVersionImpl.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orb ; - -import org.omg.CORBA.portable.OutputStream ; - -import com.sun.corba.se.spi.orb.ORBVersion ; - -public class ORBVersionImpl implements ORBVersion { - private byte orbType ; - - public ORBVersionImpl( byte orbType ) - { - this.orbType = orbType ; - } - - public static final ORBVersion FOREIGN = new ORBVersionImpl( - ORBVersion.FOREIGN ) ; - - public static final ORBVersion OLD = new ORBVersionImpl( - ORBVersion.OLD ) ; - - public static final ORBVersion NEW = new ORBVersionImpl( - ORBVersion.NEW ) ; - - public static final ORBVersion JDK1_3_1_01 = new ORBVersionImpl( - ORBVersion.JDK1_3_1_01 ) ; - - public static final ORBVersion NEWER = new ORBVersionImpl( - ORBVersion.NEWER ) ; - - public static final ORBVersion PEORB = new ORBVersionImpl( - ORBVersion.PEORB ) ; - - public byte getORBType() - { - return orbType ; - } - - public void write( OutputStream os ) - { - os.write_octet( (byte)orbType ) ; - } - - public String toString() - { - return "ORBVersionImpl[" + Byte.toString( orbType ) + "]" ; - } - - public boolean equals( Object obj ) - { - if (!(obj instanceof ORBVersion)) - return false ; - - ORBVersion version = (ORBVersion)obj ; - return version.getORBType() == orbType ; - } - - public int hashCode() - { - return orbType ; - } - - public boolean lessThan(ORBVersion version) { - return orbType < version.getORBType(); - } - - public int compareTo(Object obj) { - // The Comparable interface says that this - // method throws a ClassCastException if the - // given object's type prevents it from being - // compared. - return getORBType() - ((ORBVersion)obj).getORBType(); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ParserAction.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ParserAction.java deleted file mode 100644 index 0d783cc0340..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ParserAction.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orb ; - -import java.util.Properties ; - -public interface ParserAction { - /** Return the property name or prefix for which this action - * is applied. - */ - String getPropertyName() ; - - /** Return whether this action is for an exact match or a prefix - * match (true). - */ - boolean isPrefix() ; - - /** Return the field name in an object that is set with the result - */ - String getFieldName() ; - - /** Apply this action to props and return the result. - */ - Object apply( Properties props ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ParserActionBase.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ParserActionBase.java deleted file mode 100644 index 43c2909efee..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ParserActionBase.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orb ; - -import java.util.Properties ; - -import com.sun.corba.se.spi.orb.Operation ; - -public abstract class ParserActionBase implements ParserAction { - private String propertyName ; - private boolean prefix ; - private Operation operation ; - private String fieldName ; - - public int hashCode() - { - return propertyName.hashCode() ^ operation.hashCode() ^ - fieldName.hashCode() ^ (prefix ? 0 : 1) ; - } - - public boolean equals( Object obj ) - { - if (obj == this) - return true ; - - if (!(obj instanceof ParserActionBase)) - return false ; - - ParserActionBase other = (ParserActionBase)obj ; - - return propertyName.equals( other.propertyName ) && - prefix == other.prefix && - operation.equals( other.operation ) && - fieldName.equals( other.fieldName ) ; - } - - public ParserActionBase( String propertyName, boolean prefix, - Operation operation, String fieldName ) - { - this.propertyName = propertyName ; - this.prefix = prefix ; - this.operation = operation ; - this.fieldName = fieldName ; - } - - public String getPropertyName() - { - return propertyName ; - } - - public boolean isPrefix() - { - return prefix ; - } - - public String getFieldName() - { - return fieldName ; - } - - public abstract Object apply( Properties props ) ; - - protected Operation getOperation() - { - return operation ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ParserActionFactory.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ParserActionFactory.java deleted file mode 100644 index 01df18f7b44..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ParserActionFactory.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orb ; - -import com.sun.corba.se.spi.orb.Operation ; - -public class ParserActionFactory{ - private ParserActionFactory() {} - - public static ParserAction makeNormalAction( String propertyName, - Operation operation, String fieldName ) - { - return new NormalParserAction( propertyName, operation, fieldName ) ; - } - - public static ParserAction makePrefixAction( String propertyName, - Operation operation, String fieldName, Class componentType ) - { - return new PrefixParserAction( propertyName, operation, fieldName, componentType ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ParserDataBase.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ParserDataBase.java deleted file mode 100644 index 84dd09a5202..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ParserDataBase.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orb ; - -import com.sun.corba.se.spi.orb.ParserData ; -import com.sun.corba.se.spi.orb.Operation ; - -public abstract class ParserDataBase implements ParserData { - private String propertyName ; - private Operation operation ; - private String fieldName ; - private Object defaultValue ; - private Object testValue ; - - protected ParserDataBase( String propertyName, - Operation operation, String fieldName, Object defaultValue, - Object testValue ) - { - this.propertyName = propertyName ; - this.operation = operation ; - this.fieldName = fieldName ; - this.defaultValue = defaultValue ; - this.testValue = testValue ; - } - - public String getPropertyName() { return propertyName ; } - public Operation getOperation() { return operation ; } - public String getFieldName() { return fieldName ; } - public Object getDefaultValue() { return defaultValue ; } - public Object getTestValue() { return testValue ; } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ParserTable.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ParserTable.java deleted file mode 100644 index f1ddd172ce9..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ParserTable.java +++ /dev/null @@ -1,1110 +0,0 @@ -/* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orb ; - -import java.net.URL ; -import java.net.InetSocketAddress; -import java.net.Socket ; -import java.net.ServerSocket ; - -import java.io.IOException ; - -import java.util.HashMap ; -import java.util.List; -import java.util.Map ; - -import java.security.AccessController ; -import java.security.PrivilegedExceptionAction ; -import java.security.PrivilegedActionException ; - -import org.omg.PortableInterceptor.ORBInitializer ; -import org.omg.PortableInterceptor.ORBInitInfo ; - -import com.sun.corba.se.pept.broker.Broker; -import com.sun.corba.se.pept.encoding.InputObject; -import com.sun.corba.se.pept.encoding.OutputObject; -import com.sun.corba.se.pept.protocol.MessageMediator; -import com.sun.corba.se.pept.transport.Acceptor; -import com.sun.corba.se.pept.transport.Connection; -import com.sun.corba.se.pept.transport.ContactInfo; -import com.sun.corba.se.pept.transport.ContactInfoList; -import com.sun.corba.se.pept.transport.EventHandler; -import com.sun.corba.se.pept.transport.InboundConnectionCache; - -import com.sun.corba.se.spi.ior.IOR ; -import com.sun.corba.se.spi.ior.ObjectKey ; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion ; -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.orb.Operation ; -import com.sun.corba.se.spi.orb.OperationFactory ; -import com.sun.corba.se.spi.orb.ParserData ; -import com.sun.corba.se.spi.orb.ParserDataFactory ; -import com.sun.corba.se.spi.orb.StringPair ; -import com.sun.corba.se.spi.transport.CorbaContactInfoList; -import com.sun.corba.se.spi.transport.CorbaContactInfoListFactory; -import com.sun.corba.se.spi.transport.CorbaTransportManager; -import com.sun.corba.se.spi.transport.IORToSocketInfo; -import com.sun.corba.se.spi.transport.ReadTimeouts; -import com.sun.corba.se.spi.transport.SocketInfo; -import com.sun.corba.se.spi.transport.IIOPPrimaryToContactInfo; -import com.sun.corba.se.spi.transport.TransportDefault; - -import com.sun.corba.se.impl.encoding.CodeSetComponentInfo ; -import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry ; -import com.sun.corba.se.impl.legacy.connection.USLPort ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; -import com.sun.corba.se.impl.oa.poa.BadServerIdHandler ; -import com.sun.corba.se.impl.orbutil.ORBConstants ; -import com.sun.corba.se.impl.protocol.giopmsgheaders.KeyAddr ; -import com.sun.corba.se.impl.protocol.giopmsgheaders.ProfileAddr ; -import com.sun.corba.se.impl.protocol.giopmsgheaders.ReferenceAddr ; -import com.sun.corba.se.impl.transport.DefaultIORToSocketInfoImpl; -import com.sun.corba.se.impl.transport.DefaultSocketFactoryImpl; - -import sun.corba.SharedSecrets; - -/** Initialize the parser data for the standard ORB parser. This is used both - * to implement ORBDataParserImpl and to provide the basic testing framework - * for ORBDataParserImpl. - */ -public class ParserTable { - private static String MY_CLASS_NAME = ParserTable.class.getName() ; - - private static ParserTable myInstance = new ParserTable() ; - - private ORBUtilSystemException wrapper ; - - public static ParserTable get() - { - return myInstance ; - } - - private ParserData[] parserData ; - - public ParserData[] getParserData() - { - ParserData[] parserArray = new ParserData[parserData.length]; - System.arraycopy(parserData, 0, parserArray, 0, parserData.length); - return parserArray; - } - - private ParserTable() { - wrapper = ORBUtilSystemException.get( CORBALogDomains.ORB_LIFECYCLE ) ; - - String codeSetTestString = - OSFCodeSetRegistry.ISO_8859_1_VALUE + "," + - OSFCodeSetRegistry.UTF_16_VALUE + "," + - OSFCodeSetRegistry.ISO_646_VALUE ; - - String[] debugTestData = { "subcontract", "poa", "transport" } ; - - USLPort[] USLPorts = { new USLPort( "FOO", 2701 ), new USLPort( "BAR", 3333 ) } ; - - ReadTimeouts readTimeouts = - TransportDefault.makeReadTimeoutsFactory().create( - ORBConstants.TRANSPORT_TCP_INITIAL_TIME_TO_WAIT, - ORBConstants.TRANSPORT_TCP_MAX_TIME_TO_WAIT, - ORBConstants.TRANSPORT_TCP_GIOP_HEADER_MAX_TIME_TO_WAIT, - ORBConstants.TRANSPORT_TCP_TIME_TO_WAIT_BACKOFF_FACTOR); - - ORBInitializer[] TestORBInitializers = - { null, - new TestORBInitializer1(), - new TestORBInitializer2() } ; - StringPair[] TestORBInitData = { - new StringPair( "foo.bar.blech.NonExistent", "dummy" ), - new StringPair( MY_CLASS_NAME + "$TestORBInitializer1", "dummy" ), - new StringPair( MY_CLASS_NAME + "$TestORBInitializer2", "dummy" ) } ; - - Acceptor[] TestAcceptors = - { new TestAcceptor2(), - new TestAcceptor1(), - null } ; - // REVISIT: The test data gets put into a Properties object where - // order is not guaranteed. Thus the above array is in reverse. - StringPair[] TestAcceptorData = { - new StringPair( "foo.bar.blech.NonExistent", "dummy" ), - new StringPair( MY_CLASS_NAME + "$TestAcceptor1", "dummy" ), - new StringPair( MY_CLASS_NAME + "$TestAcceptor2", "dummy" ) } ; - - StringPair[] TestORBInitRefData = - { new StringPair( "Foo", "ior:930492049394" ), - new StringPair( "Bar", "ior:3453465785633576" ) } ; - - URL testServicesURL = null ; - String testServicesString = "corbaloc::camelot/NameService" ; - - try { - testServicesURL = new URL( testServicesString ) ; - } catch (Exception exc) { - } - - // propertyName, - // operation, - // fieldName, defaultValue, - // testValue, testData (string or Pair[]) - ParserData[] pd = { - ParserDataFactory.make( ORBConstants.DEBUG_PROPERTY, - OperationFactory.listAction( ",", OperationFactory.stringAction()), - "debugFlags", new String[0], - debugTestData, "subcontract,poa,transport" ), - ParserDataFactory.make( ORBConstants.INITIAL_HOST_PROPERTY, - OperationFactory.stringAction(), - "ORBInitialHost", "", - "Foo", "Foo" ), - ParserDataFactory.make( ORBConstants.INITIAL_PORT_PROPERTY, - OperationFactory.integerAction(), - "ORBInitialPort", new Integer( ORBConstants.DEFAULT_INITIAL_PORT ), - new Integer( 27314 ), "27314" ), - // Where did this come from? - //ParserDataFactory.make( ORBConstants.INITIAL_PORT_PROPERTY, - //OperationFactory.booleanAction(), - //"ORBInitialPortInitialized", Boolean.FALSE, - //Boolean.TRUE, "27314" ), - ParserDataFactory.make( ORBConstants.SERVER_HOST_PROPERTY, - OperationFactory.stringAction(), - "ORBServerHost", "", - "camelot", "camelot" ), - ParserDataFactory.make( ORBConstants.SERVER_PORT_PROPERTY, - OperationFactory.integerAction(), - "ORBServerPort", new Integer( 0 ), - new Integer( 38143 ), "38143" ), - // NOTE: We are putting SERVER_HOST_NAME configuration info into - // DataCollectorBase to avoid a security hole. However, that forces - // us to also set LISTEN_ON_ALL_INTERFACES at the same time. - // This all needs to be cleaned up for two reasons: to get configuration - // out of DataCollectorBase and to correctly support multihoming. - ParserDataFactory.make( ORBConstants.LISTEN_ON_ALL_INTERFACES, - OperationFactory.stringAction(), - "listenOnAllInterfaces", ORBConstants.LISTEN_ON_ALL_INTERFACES, - "foo", "foo" ), - ParserDataFactory.make( ORBConstants.ORB_ID_PROPERTY, - OperationFactory.stringAction(), - "orbId", "", - "foo", "foo" ), - ParserDataFactory.make( ORBConstants.OLD_ORB_ID_PROPERTY, - OperationFactory.stringAction(), - "orbId", "", - "foo", "foo" ), - ParserDataFactory.make( ORBConstants.ORB_SERVER_ID_PROPERTY, - OperationFactory.integerAction(), - "persistentServerId", new Integer(-1), - new Integer( 1234), "1234" ), - ParserDataFactory.make( - ORBConstants.ORB_SERVER_ID_PROPERTY, - OperationFactory.setFlagAction(), - "persistentServerIdInitialized", Boolean.FALSE, - Boolean.TRUE, "1234" ), - ParserDataFactory.make( - ORBConstants.ORB_SERVER_ID_PROPERTY, - OperationFactory.setFlagAction(), - "orbServerIdPropertySpecified", Boolean.FALSE, - Boolean.TRUE, "1234" ), - // REVISIT after switch - // ParserDataFactory.make( ORBConstants.INITIAL_SERVICES_PROPERTY, - // OperationFactory.URLAction(), - // "servicesURL", null, - // testServicesURL, testServicesString ), - // ParserDataFactory.make( ORBConstants.DEFAULT_INIT_REF_PROPERTY, - // OperationFactory.stringAction(), - // "defaultInitRef", null, - // "Fooref", "Fooref" ), - ParserDataFactory.make( ORBConstants.HIGH_WATER_MARK_PROPERTY, - OperationFactory.integerAction(), - "highWaterMark", new Integer( 240 ), - new Integer( 3745 ), "3745" ), - ParserDataFactory.make( ORBConstants.LOW_WATER_MARK_PROPERTY, - OperationFactory.integerAction(), - "lowWaterMark", new Integer( 100 ), - new Integer( 12 ), "12" ), - ParserDataFactory.make( ORBConstants.NUMBER_TO_RECLAIM_PROPERTY, - OperationFactory.integerAction(), - "numberToReclaim", new Integer( 5 ), - new Integer( 231 ), "231" ), - ParserDataFactory.make( ORBConstants.GIOP_VERSION, - makeGVOperation(), - "giopVersion", GIOPVersion.DEFAULT_VERSION, - new GIOPVersion( 2, 3 ), "2.3" ), - ParserDataFactory.make( ORBConstants.GIOP_FRAGMENT_SIZE, - makeFSOperation(), "giopFragmentSize", - new Integer( ORBConstants.GIOP_DEFAULT_FRAGMENT_SIZE ), - new Integer( 65536 ), "65536" ), - ParserDataFactory.make( ORBConstants.GIOP_BUFFER_SIZE, - OperationFactory.integerAction(), - "giopBufferSize", new Integer( ORBConstants.GIOP_DEFAULT_BUFFER_SIZE ), - new Integer( 234000 ), "234000" ), - ParserDataFactory.make( ORBConstants.GIOP_11_BUFFMGR, - makeBMGROperation(), - "giop11BuffMgr", new Integer( ORBConstants.DEFAULT_GIOP_11_BUFFMGR ), - new Integer( 1 ), "CLCT" ), - ParserDataFactory.make( ORBConstants.GIOP_12_BUFFMGR, - makeBMGROperation(), - "giop12BuffMgr", new Integer( ORBConstants.DEFAULT_GIOP_12_BUFFMGR ), - new Integer( 0 ), "GROW" ), - - // Note that the same property is used to set two different - // fields here. This requires that both entries use the same test - // data, or the test will fail. - ParserDataFactory.make( ORBConstants.GIOP_TARGET_ADDRESSING, - OperationFactory.compose( OperationFactory.integerRangeAction( 0, 3 ), - OperationFactory.convertIntegerToShort() ), - "giopTargetAddressPreference", - new Short( ORBConstants.ADDR_DISP_HANDLE_ALL ), - new Short( (short)2 ), "2" ), - ParserDataFactory.make( ORBConstants.GIOP_TARGET_ADDRESSING, - makeADOperation(), - "giopAddressDisposition", new Short( KeyAddr.value ), - new Short( (short)2 ), "2" ), - ParserDataFactory.make( ORBConstants.ALWAYS_SEND_CODESET_CTX_PROPERTY, - OperationFactory.booleanAction(), - "alwaysSendCodeSetCtx", Boolean.TRUE, - Boolean.FALSE, "false"), - ParserDataFactory.make( ORBConstants.USE_BOMS, - OperationFactory.booleanAction(), - "useByteOrderMarkers", - Boolean.valueOf( ORBConstants.DEFAULT_USE_BYTE_ORDER_MARKERS ), - Boolean.FALSE, "false" ), - ParserDataFactory.make( ORBConstants.USE_BOMS_IN_ENCAPS, - OperationFactory.booleanAction(), - "useByteOrderMarkersInEncaps", - Boolean.valueOf( ORBConstants.DEFAULT_USE_BYTE_ORDER_MARKERS_IN_ENCAPS ), - Boolean.FALSE, "false" ), - ParserDataFactory.make( ORBConstants.CHAR_CODESETS, - makeCSOperation(), - "charData", CodeSetComponentInfo.JAVASOFT_DEFAULT_CODESETS.getCharComponent(), - CodeSetComponentInfo.createFromString( codeSetTestString ), codeSetTestString ), - ParserDataFactory.make( ORBConstants.WCHAR_CODESETS, - makeCSOperation(), - "wcharData", CodeSetComponentInfo.JAVASOFT_DEFAULT_CODESETS.getWCharComponent(), - CodeSetComponentInfo.createFromString( codeSetTestString ), codeSetTestString ), - ParserDataFactory.make( ORBConstants.ALLOW_LOCAL_OPTIMIZATION, - OperationFactory.booleanAction(), - "allowLocalOptimization", Boolean.FALSE, - Boolean.TRUE, "true" ), - ParserDataFactory.make( ORBConstants.LEGACY_SOCKET_FACTORY_CLASS_PROPERTY, - makeLegacySocketFactoryOperation(), - // No default - must be set by user if they are using - // legacy socket factory. - "legacySocketFactory", null, - new TestLegacyORBSocketFactory(), - MY_CLASS_NAME + "$TestLegacyORBSocketFactory" ), - ParserDataFactory.make( ORBConstants.SOCKET_FACTORY_CLASS_PROPERTY, - makeSocketFactoryOperation(), - "socketFactory", new DefaultSocketFactoryImpl(), - new TestORBSocketFactory(), - MY_CLASS_NAME + "$TestORBSocketFactory" ), - ParserDataFactory.make( ORBConstants.LISTEN_SOCKET_PROPERTY, - makeUSLOperation() , - "userSpecifiedListenPorts", new USLPort[0], - USLPorts, "FOO:2701,BAR:3333" ), - ParserDataFactory.make( ORBConstants.IOR_TO_SOCKET_INFO_CLASS_PROPERTY, - makeIORToSocketInfoOperation(), - "iorToSocketInfo", new DefaultIORToSocketInfoImpl(), - new TestIORToSocketInfo(), - MY_CLASS_NAME + "$TestIORToSocketInfo" ), - ParserDataFactory.make( ORBConstants.IIOP_PRIMARY_TO_CONTACT_INFO_CLASS_PROPERTY, - makeIIOPPrimaryToContactInfoOperation(), - "iiopPrimaryToContactInfo", null, - new TestIIOPPrimaryToContactInfo(), - MY_CLASS_NAME + "$TestIIOPPrimaryToContactInfo" ), - ParserDataFactory.make( ORBConstants.CONTACT_INFO_LIST_FACTORY_CLASS_PROPERTY, - makeContactInfoListFactoryOperation(), - "corbaContactInfoListFactory", null, - new TestContactInfoListFactory(), - MY_CLASS_NAME + "$TestContactInfoListFactory" ), - ParserDataFactory.make( ORBConstants.PERSISTENT_SERVER_PORT_PROPERTY, - OperationFactory.integerAction(), - "persistentServerPort", new Integer( 0 ), - new Integer( 2743 ), "2743" ), - ParserDataFactory.make( ORBConstants.PERSISTENT_SERVER_PORT_PROPERTY, - OperationFactory.setFlagAction(), - "persistentPortInitialized", Boolean.FALSE, - Boolean.TRUE, "2743" ), - ParserDataFactory.make( ORBConstants.SERVER_ID_PROPERTY, - OperationFactory.integerAction(), - "persistentServerId", new Integer( 0 ), - new Integer( 294 ), "294" ), - ParserDataFactory.make( ORBConstants.SERVER_ID_PROPERTY, - OperationFactory.setFlagAction(), - "persistentServerIdInitialized", Boolean.FALSE, - Boolean.TRUE, "294" ), - ParserDataFactory.make( ORBConstants.SERVER_ID_PROPERTY, - OperationFactory.setFlagAction(), - "orbServerIdPropertySpecified", Boolean.FALSE, - Boolean.TRUE, "294" ), - ParserDataFactory.make( ORBConstants.ACTIVATED_PROPERTY, - OperationFactory.booleanAction(), - "serverIsORBActivated", Boolean.FALSE, - Boolean.TRUE, "true" ), - ParserDataFactory.make( ORBConstants.BAD_SERVER_ID_HANDLER_CLASS_PROPERTY, - OperationFactory.classAction(), - "badServerIdHandlerClass", null, - TestBadServerIdHandler.class, MY_CLASS_NAME + "$TestBadServerIdHandler" ), - ParserDataFactory.make( ORBConstants.PI_ORB_INITIALIZER_CLASS_PREFIX, - makeROIOperation(), - "orbInitializers", new ORBInitializer[0], - TestORBInitializers, TestORBInitData, ORBInitializer.class ), - ParserDataFactory.make( ORBConstants.ACCEPTOR_CLASS_PREFIX_PROPERTY, - makeAcceptorInstantiationOperation(), - "acceptors", new Acceptor[0], - TestAcceptors, TestAcceptorData, Acceptor.class ), - - // - // Socket/Channel control - // - - // Acceptor: - // useNIOSelector == true - // useSelectThreadToWait = true - // useWorkerThreadForEvent = false - // else - // useSelectThreadToWait = false - // useWorkerThreadForEvent = true - - // Connection: - // useNIOSelector == true - // useSelectThreadToWait = true - // useWorkerThreadForEvent = true - // else - // useSelectThreadToWait = false - // useWorkerThreadForEvent = true - - ParserDataFactory.make( ORBConstants.ACCEPTOR_SOCKET_TYPE_PROPERTY, - OperationFactory.stringAction(), - "acceptorSocketType", ORBConstants.SOCKETCHANNEL, - "foo", "foo" ), - - ParserDataFactory.make( ORBConstants.USE_NIO_SELECT_TO_WAIT_PROPERTY, - OperationFactory.booleanAction(), - "acceptorSocketUseSelectThreadToWait", Boolean.TRUE, - Boolean.TRUE, "true" ), - ParserDataFactory.make( ORBConstants.ACCEPTOR_SOCKET_USE_WORKER_THREAD_FOR_EVENT_PROPERTY, - OperationFactory.booleanAction(), - "acceptorSocketUseWorkerThreadForEvent", Boolean.TRUE, - Boolean.TRUE, "true" ), - ParserDataFactory.make( ORBConstants.CONNECTION_SOCKET_TYPE_PROPERTY, - OperationFactory.stringAction(), - "connectionSocketType", ORBConstants.SOCKETCHANNEL, - "foo", "foo" ), - ParserDataFactory.make( ORBConstants.USE_NIO_SELECT_TO_WAIT_PROPERTY, - OperationFactory.booleanAction(), - "connectionSocketUseSelectThreadToWait", Boolean.TRUE, - Boolean.TRUE, "true" ), - ParserDataFactory.make( ORBConstants.CONNECTION_SOCKET_USE_WORKER_THREAD_FOR_EVENT_PROPERTY, - OperationFactory.booleanAction(), - "connectionSocketUseWorkerThreadForEvent", Boolean.TRUE, - Boolean.TRUE, "true" ), - ParserDataFactory.make( ORBConstants.DISABLE_DIRECT_BYTE_BUFFER_USE_PROPERTY, - OperationFactory.booleanAction(), - "disableDirectByteBufferUse", Boolean.FALSE, - Boolean.TRUE, "true" ), - ParserDataFactory.make(ORBConstants.TRANSPORT_TCP_READ_TIMEOUTS_PROPERTY, - makeTTCPRTOperation(), - "readTimeouts", TransportDefault.makeReadTimeoutsFactory().create( - ORBConstants.TRANSPORT_TCP_INITIAL_TIME_TO_WAIT, - ORBConstants.TRANSPORT_TCP_MAX_TIME_TO_WAIT, - ORBConstants.TRANSPORT_TCP_GIOP_HEADER_MAX_TIME_TO_WAIT, - ORBConstants.TRANSPORT_TCP_TIME_TO_WAIT_BACKOFF_FACTOR), - readTimeouts, "100:3000:300:20" ), - ParserDataFactory.make( - ORBConstants.ENABLE_JAVA_SERIALIZATION_PROPERTY, - OperationFactory.booleanAction(), - "enableJavaSerialization", Boolean.FALSE, - Boolean.FALSE, "false"), - ParserDataFactory.make( - ORBConstants.USE_REP_ID, - OperationFactory.booleanAction(), - "useRepId", Boolean.TRUE, - Boolean.TRUE, "true"), - ParserDataFactory.make( ORBConstants.ORB_INIT_REF_PROPERTY, - OperationFactory.identityAction(), - "orbInitialReferences", new StringPair[0], - TestORBInitRefData, TestORBInitRefData, StringPair.class ) - } ; - - parserData = pd ; - } - - public final class TestBadServerIdHandler implements BadServerIdHandler - { - public boolean equals( Object other ) - { - return other instanceof TestBadServerIdHandler ; - } - - public int hashCode() { - return 1; - } - - public void handle( ObjectKey objectKey ) - { - } - } - - private Operation makeTTCPRTOperation() - { - Operation[] fourIop = { OperationFactory.integerAction(), - OperationFactory.integerAction(), - OperationFactory.integerAction(), - OperationFactory.integerAction() } ; - - Operation op2 = OperationFactory.sequenceAction( ":", fourIop ) ; - - Operation rtOp = new Operation() { - public Object operate(Object value) - { - Object[] values = (Object[])value ; - Integer initialTime = (Integer)(values[0]) ; - Integer maxGIOPHdrTime = (Integer)(values[1]) ; - Integer maxGIOPBodyTime = (Integer)(values[2]) ; - Integer backoffPercent = (Integer)(values[3]) ; - return TransportDefault.makeReadTimeoutsFactory().create( - initialTime.intValue(), - maxGIOPHdrTime.intValue(), - maxGIOPBodyTime.intValue(), - backoffPercent.intValue()); - } - } ; - - Operation ttcprtOp = OperationFactory.compose(op2, rtOp); - return ttcprtOp; - } - - private Operation makeUSLOperation() - { - Operation[] siop = { OperationFactory.stringAction(), - OperationFactory.integerAction() } ; - Operation op2 = OperationFactory.sequenceAction( ":", siop ) ; - - Operation uslop = new Operation() { - public Object operate( Object value ) - { - Object[] values = (Object[])value ; - String type = (String)(values[0]) ; - Integer port = (Integer)(values[1]) ; - return new USLPort( type, port.intValue() ) ; - } - } ; - - Operation op3 = OperationFactory.compose( op2, uslop ) ; - Operation listenop = OperationFactory.listAction( ",", op3 ) ; - return listenop ; - } - - public static final class TestLegacyORBSocketFactory - implements com.sun.corba.se.spi.legacy.connection.ORBSocketFactory - { - public boolean equals( Object other ) - { - return other instanceof TestLegacyORBSocketFactory ; - } - - public int hashCode() { - return 1; - } - - public ServerSocket createServerSocket( String type, int port ) - { - return null ; - } - - public SocketInfo getEndPointInfo( org.omg.CORBA.ORB orb, - IOR ior, SocketInfo socketInfo ) - { - return null ; - } - - public Socket createSocket( SocketInfo socketInfo ) - { - return null ; - } - } - - public static final class TestORBSocketFactory - implements com.sun.corba.se.spi.transport.ORBSocketFactory - { - public boolean equals( Object other ) - { - return other instanceof TestORBSocketFactory ; - } - - public int hashCode() { - return 1; - } - - public void setORB(ORB orb) - { - } - - public ServerSocket createServerSocket( String type, InetSocketAddress a ) - { - return null ; - } - - public Socket createSocket( String type, InetSocketAddress a ) - { - return null ; - } - - public void setAcceptedSocketOptions(Acceptor acceptor, - ServerSocket serverSocket, - Socket socket) - { - } - } - - public static final class TestIORToSocketInfo - implements IORToSocketInfo - { - public boolean equals( Object other ) - { - return other instanceof TestIORToSocketInfo; - } - - public int hashCode() { - return 1; - } - - public List getSocketInfo(IOR ior) - { - return null; - } - } - - public static final class TestIIOPPrimaryToContactInfo - implements IIOPPrimaryToContactInfo - { - public void reset(ContactInfo primary) - { - } - - public boolean hasNext(ContactInfo primary, - ContactInfo previous, - List contactInfos) - { - return true; - } - - public ContactInfo next(ContactInfo primary, - ContactInfo previous, - List contactInfos) - { - return null; - } - } - - public static final class TestContactInfoListFactory - implements CorbaContactInfoListFactory - { - public boolean equals( Object other ) - { - return other instanceof TestContactInfoListFactory; - } - - public int hashCode() { - return 1; - } - - public void setORB(ORB orb) { } - - public CorbaContactInfoList create( IOR ior ) { return null; } - } - - private Operation makeMapOperation( final Map map ) - { - return new Operation() { - public Object operate( Object value ) - { - return map.get( value ) ; - } - } ; - } - - private Operation makeBMGROperation() - { - Map map = new HashMap() ; - map.put( "GROW", new Integer(0) ) ; - map.put( "CLCT", new Integer(1) ) ; - map.put( "STRM", new Integer(2) ) ; - return makeMapOperation( map ) ; - } - - private Operation makeLegacySocketFactoryOperation() - { - Operation sfop = new Operation() { - public Object operate( Object value ) - { - String param = (String)value ; - - try { - Class legacySocketFactoryClass = - SharedSecrets.getJavaCorbaAccess().loadClass(param); - // For security reasons avoid creating an instance if - // this socket factory class is not one that would fail - // the class cast anyway. - if (com.sun.corba.se.spi.legacy.connection.ORBSocketFactory.class.isAssignableFrom(legacySocketFactoryClass)) { - return legacySocketFactoryClass.newInstance(); - } else { - throw wrapper.illegalSocketFactoryType( legacySocketFactoryClass.toString() ) ; - } - } catch (Exception ex) { - // ClassNotFoundException, IllegalAccessException, - // InstantiationException, SecurityException or - // ClassCastException - throw wrapper.badCustomSocketFactory( ex, param ) ; - } - } - } ; - - return sfop ; - } - - private Operation makeSocketFactoryOperation() - { - Operation sfop = new Operation() { - public Object operate( Object value ) - { - String param = (String)value ; - - try { - Class socketFactoryClass = - SharedSecrets.getJavaCorbaAccess().loadClass(param); - // For security reasons avoid creating an instance if - // this socket factory class is not one that would fail - // the class cast anyway. - if (com.sun.corba.se.spi.transport.ORBSocketFactory.class.isAssignableFrom(socketFactoryClass)) { - return socketFactoryClass.newInstance(); - } else { - throw wrapper.illegalSocketFactoryType( socketFactoryClass.toString() ) ; - } - } catch (Exception ex) { - // ClassNotFoundException, IllegalAccessException, - // InstantiationException, SecurityException or - // ClassCastException - throw wrapper.badCustomSocketFactory( ex, param ) ; - } - } - } ; - - return sfop ; - } - - private Operation makeIORToSocketInfoOperation() - { - Operation op = new Operation() { - public Object operate( Object value ) - { - String param = (String)value ; - - try { - Class iorToSocketInfoClass = - SharedSecrets.getJavaCorbaAccess().loadClass(param); - // For security reasons avoid creating an instance if - // this socket factory class is not one that would fail - // the class cast anyway. - if (IORToSocketInfo.class.isAssignableFrom(iorToSocketInfoClass)) { - return iorToSocketInfoClass.newInstance(); - } else { - throw wrapper.illegalIorToSocketInfoType( iorToSocketInfoClass.toString() ) ; - } - } catch (Exception ex) { - // ClassNotFoundException, IllegalAccessException, - // InstantiationException, SecurityException or - // ClassCastException - throw wrapper.badCustomIorToSocketInfo( ex, param ) ; - } - } - } ; - - return op ; - } - - private Operation makeIIOPPrimaryToContactInfoOperation() - { - Operation op = new Operation() { - public Object operate( Object value ) - { - String param = (String)value ; - - try { - Class iiopPrimaryToContactInfoClass = - SharedSecrets.getJavaCorbaAccess().loadClass(param); - // For security reasons avoid creating an instance if - // this socket factory class is not one that would fail - // the class cast anyway. - if (IIOPPrimaryToContactInfo.class.isAssignableFrom(iiopPrimaryToContactInfoClass)) { - return iiopPrimaryToContactInfoClass.newInstance(); - } else { - throw wrapper.illegalIiopPrimaryToContactInfoType( iiopPrimaryToContactInfoClass.toString() ) ; - } - } catch (Exception ex) { - // ClassNotFoundException, IllegalAccessException, - // InstantiationException, SecurityException or - // ClassCastException - throw wrapper.badCustomIiopPrimaryToContactInfo( ex, param ) ; - } - } - } ; - - return op ; - } - - private Operation makeContactInfoListFactoryOperation() - { - Operation op = new Operation() { - public Object operate( Object value ) - { - String param = (String)value ; - - try { - Class contactInfoListFactoryClass = - SharedSecrets.getJavaCorbaAccess().loadClass(param); - // For security reasons avoid creating an instance if - // this socket factory class is not one that would fail - // the class cast anyway. - if (CorbaContactInfoListFactory.class.isAssignableFrom( - contactInfoListFactoryClass)) { - return contactInfoListFactoryClass.newInstance(); - } else { - throw wrapper.illegalContactInfoListFactoryType( - contactInfoListFactoryClass.toString() ) ; - } - } catch (Exception ex) { - // ClassNotFoundException, IllegalAccessException, - // InstantiationException, SecurityException or - // ClassCastException - throw wrapper.badContactInfoListFactory( ex, param ) ; - } - } - } ; - - return op ; - } - - private Operation makeCSOperation() - { - Operation csop = new Operation() { - public Object operate( Object value ) - { - String val = (String)value ; - return CodeSetComponentInfo.createFromString( val ) ; - } - } ; - - return csop ; - } - - private Operation makeADOperation() - { - Operation admap = new Operation() { - private Integer[] map = { - new Integer( KeyAddr.value ), - new Integer( ProfileAddr.value ), - new Integer( ReferenceAddr.value ), - new Integer( KeyAddr.value ) } ; - - public Object operate( Object value ) - { - int val = ((Integer)value).intValue() ; - return map[val] ; - } - } ; - - Operation rangeop = OperationFactory.integerRangeAction( 0, 3 ) ; - Operation op1 = OperationFactory.compose( rangeop, admap ) ; - Operation result = OperationFactory.compose( op1, OperationFactory.convertIntegerToShort() ) ; - return result ; - } - - private Operation makeFSOperation() { - Operation fschecker = new Operation() { - public Object operate( Object value ) - { - int giopFragmentSize = ((Integer)value).intValue() ; - if (giopFragmentSize < ORBConstants.GIOP_FRAGMENT_MINIMUM_SIZE){ - throw wrapper.fragmentSizeMinimum( new Integer( giopFragmentSize ), - new Integer( ORBConstants.GIOP_FRAGMENT_MINIMUM_SIZE ) ) ; - } - - if (giopFragmentSize % ORBConstants.GIOP_FRAGMENT_DIVISOR != 0) - throw wrapper.fragmentSizeDiv( new Integer( giopFragmentSize ), - new Integer( ORBConstants.GIOP_FRAGMENT_DIVISOR ) ) ; - - return value ; - } - } ; - - Operation result = OperationFactory.compose( OperationFactory.integerAction(), - fschecker ) ; - return result ; - } - - private Operation makeGVOperation() { - Operation gvHelper = OperationFactory.listAction( ".", - OperationFactory.integerAction() ) ; - Operation gvMain = new Operation() { - public Object operate( Object value ) - { - Object[] nums = (Object[])value ; - int major = ((Integer)(nums[0])).intValue() ; - int minor = ((Integer)(nums[1])).intValue() ; - - return new GIOPVersion( major, minor ) ; - } - } ; - - Operation result = OperationFactory.compose( gvHelper, gvMain ); - return result ; - } - - public static final class TestORBInitializer1 extends org.omg.CORBA.LocalObject - implements ORBInitializer - { - public boolean equals( Object other ) - { - return other instanceof TestORBInitializer1 ; - } - - public int hashCode() { - return 1; - } - - public void pre_init( ORBInitInfo info ) - { - } - - public void post_init( ORBInitInfo info ) - { - } - } - - public static final class TestORBInitializer2 extends org.omg.CORBA.LocalObject - implements ORBInitializer - { - public boolean equals( Object other ) - { - return other instanceof TestORBInitializer2 ; - } - - public int hashCode() { - return 1; - } - - public void pre_init( ORBInitInfo info ) - { - } - - public void post_init( ORBInitInfo info ) - { - } - } - - private Operation makeROIOperation() { - Operation clsop = OperationFactory.classAction() ; - Operation indexOp = OperationFactory.suffixAction() ; - Operation op1 = OperationFactory.compose( indexOp, clsop ) ; - Operation mop = OperationFactory.maskErrorAction( op1 ) ; - - Operation mkinst = new Operation() { - public Object operate( Object value ) - { - final Class initClass = (Class)value ; - if (initClass == null) - return null ; - - // For security reasons avoid creating an instance - // if this class is one that would fail the class cast - // to ORBInitializer anyway. - if( org.omg.PortableInterceptor.ORBInitializer.class.isAssignableFrom( - initClass ) ) { - // Now that we have a class object, instantiate one and - // remember it: - ORBInitializer initializer = null ; - - try { - initializer = (ORBInitializer)AccessController.doPrivileged( - new PrivilegedExceptionAction() { - public Object run() - throws InstantiationException, IllegalAccessException - { - return initClass.newInstance() ; - } - } - ) ; - } catch (PrivilegedActionException exc) { - // Unwrap the exception, as we don't care exc here - throw wrapper.orbInitializerFailure( exc.getException(), - initClass.getName() ) ; - } catch (Exception exc) { - throw wrapper.orbInitializerFailure( exc, initClass.getName() ) ; - } - - return initializer ; - } else { - throw wrapper.orbInitializerType( initClass.getName() ) ; - } - } - } ; - - Operation result = OperationFactory.compose( mop, mkinst ) ; - - return result ; - } - - public static final class TestAcceptor1 - implements Acceptor - { - public boolean equals( Object other ) - { - return other instanceof TestAcceptor1 ; - } - - public int hashCode() { return 1; } - public boolean initialize() { return true; } - public boolean initialized() { return true; } - public String getConnectionCacheType() { return "FOO"; } - public void setConnectionCache(InboundConnectionCache connectionCache){} - public InboundConnectionCache getConnectionCache() { return null; } - public boolean shouldRegisterAcceptEvent() { return true; } - public void setUseSelectThreadForConnections(boolean x) { } - public boolean shouldUseSelectThreadForConnections() { return true; } - public void setUseWorkerThreadForConnections(boolean x) { } - public boolean shouldUseWorkerThreadForConnections() { return true; } - public void accept() { } - public void close() { } - public EventHandler getEventHandler() { return null; } - public MessageMediator createMessageMediator( - Broker xbroker, Connection xconnection) { return null; } - public MessageMediator finishCreatingMessageMediator( - Broker xbroker, Connection xconnection, - MessageMediator messageMediator) { return null; } - public InputObject createInputObject( - Broker broker, MessageMediator messageMediator) { return null; } - public OutputObject createOutputObject( - Broker broker, MessageMediator messageMediator) { return null; } - } - - public static final class TestAcceptor2 - implements Acceptor - { - public boolean equals( Object other ) - { - return other instanceof TestAcceptor2 ; - } - public int hashCode() { return 1; } - public boolean initialize() { return true; } - public boolean initialized() { return true; } - public String getConnectionCacheType() { return "FOO"; } - public void setConnectionCache(InboundConnectionCache connectionCache){} - public InboundConnectionCache getConnectionCache() { return null; } - public boolean shouldRegisterAcceptEvent() { return true; } - public void setUseSelectThreadForConnections(boolean x) { } - public boolean shouldUseSelectThreadForConnections() { return true; } - public void setUseWorkerThreadForConnections(boolean x) { } - public boolean shouldUseWorkerThreadForConnections() { return true; } - public void accept() { } - public void close() { } - public EventHandler getEventHandler() { return null; } - public MessageMediator createMessageMediator( - Broker xbroker, Connection xconnection) { return null; } - public MessageMediator finishCreatingMessageMediator( - Broker xbroker, Connection xconnection, - MessageMediator messageMediator) { return null; } - public InputObject createInputObject( - Broker broker, MessageMediator messageMediator) { return null; } - public OutputObject createOutputObject( - Broker broker, MessageMediator messageMediator) { return null; } - } - - // REVISIT - this is a cut and paste modification of makeROIOperation. - private Operation makeAcceptorInstantiationOperation() { - Operation clsop = OperationFactory.classAction() ; - Operation indexOp = OperationFactory.suffixAction() ; - Operation op1 = OperationFactory.compose( indexOp, clsop ) ; - Operation mop = OperationFactory.maskErrorAction( op1 ) ; - - Operation mkinst = new Operation() { - public Object operate( Object value ) - { - final Class initClass = (Class)value ; - if (initClass == null) - return null ; - - // For security reasons avoid creating an instance - // if this class is one that would fail the class cast - // to ORBInitializer anyway. - if( Acceptor.class.isAssignableFrom( initClass ) ) { - // Now that we have a class object, instantiate one and - // remember it: - Acceptor acceptor = null ; - - try { - acceptor = (Acceptor)AccessController.doPrivileged( - new PrivilegedExceptionAction() { - public Object run() - throws InstantiationException, IllegalAccessException - { - return initClass.newInstance() ; - } - } - ) ; - } catch (PrivilegedActionException exc) { - // Unwrap the exception, as we don't care exc here - throw wrapper.acceptorInstantiationFailure( exc.getException(), - initClass.getName() ) ; - } catch (Exception exc) { - throw wrapper.acceptorInstantiationFailure( exc, initClass.getName() ) ; - } - - return acceptor ; - } else { - throw wrapper.acceptorInstantiationTypeFailure( initClass.getName() ) ; - } - } - } ; - - Operation result = OperationFactory.compose( mop, mkinst ) ; - - return result ; - } - - private Operation makeInitRefOperation() { - return new Operation() { - public Object operate( Object value ) - { - // Object is String[] of length 2. - String[] values = (String[])value ; - if (values.length != 2) - throw wrapper.orbInitialreferenceSyntax() ; - - return values[0] + "=" + values[1] ; - } - } ; - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/PrefixParserAction.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orb/PrefixParserAction.java deleted file mode 100644 index ace0d795d15..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/PrefixParserAction.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orb ; - -import org.omg.CORBA.INITIALIZE ; - -import java.util.Properties ; -import java.util.List ; -import java.util.LinkedList ; -import java.util.Iterator ; - -import java.lang.reflect.Array ; - -import com.sun.corba.se.spi.orb.Operation ; -import com.sun.corba.se.spi.orb.StringPair ; -import com.sun.corba.se.spi.logging.CORBALogDomains ; - -import com.sun.corba.se.impl.orbutil.ObjectUtility ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -public class PrefixParserAction extends ParserActionBase { - private Class componentType ; - private ORBUtilSystemException wrapper ; - - public PrefixParserAction( String propertyName, - Operation operation, String fieldName, Class componentType ) - { - super( propertyName, true, operation, fieldName ) ; - this.componentType = componentType ; - this.wrapper = ORBUtilSystemException.get( - CORBALogDomains.ORB_LIFECYCLE ) ; - } - - /** For each String s that matches the prefix given by getPropertyName(), - * apply getOperation() to { suffix( s ), value } - * and add the result to an Object[] - * which forms the result of apply. Returns null if there are no - * matches. - */ - public Object apply( Properties props ) - { - String prefix = getPropertyName() ; - int prefixLength = prefix.length() ; - if (prefix.charAt( prefixLength - 1 ) != '.') { - prefix += '.' ; - prefixLength++ ; - } - - List matches = new LinkedList() ; - - // Find all keys in props that start with propertyName - Iterator iter = props.keySet().iterator() ; - while (iter.hasNext()) { - String key = (String)(iter.next()) ; - if (key.startsWith( prefix )) { - String suffix = key.substring( prefixLength ) ; - String value = props.getProperty( key ) ; - StringPair data = new StringPair( suffix, value ) ; - Object result = getOperation().operate( data ) ; - matches.add( result ) ; - } - } - - int size = matches.size() ; - if (size > 0) { - // Convert the list into an array of the proper type. - // An Object[] as a result does NOT work. Also report - // any errors carefully, as errors here or in parsers that - // use this Operation often show up at ORB.init(). - Object result = null ; - try { - result = Array.newInstance( componentType, size ) ; - } catch (Throwable thr) { - throw wrapper.couldNotCreateArray( thr, - getPropertyName(), componentType, - new Integer( size ) ) ; - } - - Iterator iter2 = matches.iterator() ; - int ctr = 0 ; - while (iter2.hasNext()) { - Object obj = iter2.next() ; - - try { - Array.set( result, ctr, obj ) ; - } catch (Throwable thr) { - throw wrapper.couldNotSetArray( thr, - getPropertyName(), new Integer(ctr), - componentType, new Integer(size), - obj.toString() ) ; - } - ctr++ ; - } - - return result ; - } else - return null ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/PrefixParserData.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orb/PrefixParserData.java deleted file mode 100644 index c6adfbc62e5..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orb/PrefixParserData.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orb ; - -import java.util.Properties ; - -import com.sun.corba.se.spi.orb.StringPair ; -import com.sun.corba.se.spi.orb.Operation ; -import com.sun.corba.se.spi.orb.PropertyParser ; - -public class PrefixParserData extends ParserDataBase { - - private StringPair[] testData ; - private Class componentType ; - - public PrefixParserData( String propertyName, - Operation operation, String fieldName, Object defaultValue, - Object testValue, StringPair[] testData, Class componentType ) - { - super( propertyName, operation, fieldName, defaultValue, testValue ) ; - this.testData = testData ; - this.componentType = componentType ; - } - - public void addToParser( PropertyParser parser ) - { - parser.addPrefix( getPropertyName(), getOperation(), getFieldName(), - componentType ) ; - } - - public void addToProperties( Properties props ) - { - for (int ctr=0; ctr - class combine - init : X - add( X, Y ) : X - op1( String ) : X - op2( String ) : Y - - reduce( sep, op1, op2, comb ) ( String ) : X - - operate(data) - if (sep in data) // either first from left orfirst from right - split data into prefix, rest - return comb.add( op2.operate( rest ), op1.operate( prefix ) ) - else - return comb.add( comb.init(), op1.operate( data ) ) - - example - - op = reduce( ":", op1, null, comb ) - op.setop2( op ) - - op.operate( "A:B:C" ) = - comb.add( op.operate( "B:C" ), op1.operate( "A" ) ) = - comb.add( comb.add( op.operate("C"), op1.operate("B") ), op1.operate( "A" ) = - comb.add( comb.add( comb.add( comb.init(), op1.operate("C") ), op1.operate("B") ), - op1.operate("A") ) - - -Splitter interface - -interface Splitter { - List split( String str ) -} - -variations: - - separated list SL - - first sep rest FSR - - fail if not present one arg - - default value two args - - rest sep last RSL - - fail if not present one arg - - default value two args - -Have we just pushed the real problem off a level? - -How do we combine: - op1 = FSR("@",v12) - op2 = LSR(":",9090) - - str = 1.2@myhost:2345 - - op1(str) = ( "1.2" "myhost:2345" ) - - define splice( int index, Operator op ) on a list of strings, with op( String ) : (String) - to replace the indexth element of a list of strings with the list returned - from op( element ). - - compose( op1, splice( 1, op2 )) is the correct parser. - - -A grammar for parsers? - -parser : simple_parser - | parser ":" simple_parser ; - -simple_parser : ident - | ident "(" param_list ")" ; - -param_list : param - | param_list "," param ; - -param : constant - | parser ; - -constant is a Java constant -ident x is interpreted as either a public static method on OperationFactory -named xAction which takes as arguments the types of the param list, or as -the fully qualified class name of a class that implements Operation and has -a constructor which takes as arguments the types of the param list. - -From parser table: - -debugFlags string -ORBInitialHost string -ORBInitialPort integer -ORBServerHost string -ORBServerPort integer -orbId string -highWaterMark integer -lowWaterMark integer -etc. - -giopVersion construct(GIOPVersion.class):map(integer):list('.') -giopFragmentSize mod(ORBConstants.GIOP_FRAGMENT_DIVISOR):min(ORBConstants.GIOP_FRAGMENT_SIZE):integer - -Lisp notation: - parse((mod ORBConstants.GIOP_FRAGMENT_DIVISOR) (min ...) (integer)) - -giop11BuffMgr makeMap(map) where map is constructed in java with - map.get("GROW") = Integer(0) - map.get("CLCT") = Integer(1) - map.get("STRM") = Integer(2) - -giopTargetAddressPreference intToShort:integerRange(0,3) -giopAddressDisposition another map variant - -charData construct(CodeSetComponentInfo.class):string - - -What about corbaloc:? - -v12 = GIOPVersion.v12 ; - -giopVersion = construct( GIOPVersion.class ):mapSequence( [integer,integer] ):FSR(".") - -iiopAddress = mapSequence( [giopVersion,identity,integer] ): - splice( 1, LSR( ":" 9090 )): - FSR( "@", v12 ) - -addressHandler = choice( - "iiop:", iiopAddress - ":", iiopAddress -) - -addressList = map(addressHandler):SL(",") - -choice( - "corbaloc:", mapSequence( [addressList,string] ):RSL("/", "NameService"), - "corbaname:", ... -) diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/CacheTable.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/CacheTable.java deleted file mode 100644 index 04ca47e376f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/CacheTable.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.CompletionStatus; - -import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.spi.orb.ORB; - -import com.sun.corba.se.impl.logging.ORBUtilSystemException; - -public class CacheTable { - class Entry { - java.lang.Object key; - int val; - Entry next; // this chains the collision list of table "map" - Entry rnext; // this chains the collision list of table "rmap" - public Entry(java.lang.Object k, int v) { - key = k; - val = v; - next = null; - rnext = null; - } - } - private boolean noReverseMap; - // size must be power of 2 - static final int INITIAL_SIZE = 16; - static final int MAX_SIZE = 1 << 30; - int size; - int entryCount; - private Entry [] map; - private Entry [] rmap; - - private ORB orb; - private ORBUtilSystemException wrapper; - - private CacheTable() {} - public CacheTable(ORB orb, boolean u) { - //System.out.println("using new cache table"); - this.orb = orb; - wrapper = ORBUtilSystemException.get(orb, - CORBALogDomains.RPC_ENCODING); - noReverseMap = u; - size = INITIAL_SIZE; - entryCount = 0; - initTables(); - } - private void initTables() { - map = new Entry[size]; - rmap = noReverseMap ? null : new Entry[size]; - } - private void grow() { - if (size == MAX_SIZE) - return; - Entry [] oldMap = map; - int oldSize = size; - size <<= 1; - initTables(); - // now rehash the entries into the new table - for (int i = 0; i < oldSize; i++) { - for (Entry e = oldMap[i]; e != null; e = e.next) - put_table(e.key, e.val); - } - } - private int moduloTableSize(int h) { - // these are the "supplemental hash function" copied from - // java.util.HashMap, supposed to be "critical" - h += ~(h << 9); - h ^= (h >>> 14); - h += (h << 4); - h ^= (h >>> 10); - return h & (size - 1); - } - private int hash(java.lang.Object key) { - return moduloTableSize(System.identityHashCode(key)); - } - private int hash(int val) { - return moduloTableSize(val); - } - public final void put(java.lang.Object key, int val) { - if (put_table(key, val)) { - entryCount++; - if (entryCount > size * 3 / 4) - grow(); - } - } - private boolean put_table(java.lang.Object key, int val) { - int index = hash(key); - for (Entry e = map[index]; e != null; e = e.next) { - if (e.key == key) { - if (e.val != val) { - throw wrapper.duplicateIndirectionOffset(); - } - // if we get here we are trying to put in the same key/val pair - // this is a no-op, so we just return - return false; - } - } - // this means the key is not present in our table - // then it shouldnt be present in our reverse table either - Entry newEntry = new Entry(key, val); - newEntry.next = map[index]; - map[index] = newEntry; - if (!noReverseMap) { - int rindex = hash(val); - newEntry.rnext = rmap[rindex]; - rmap[rindex] = newEntry; - } - return true; - } - public final boolean containsKey(java.lang.Object key) { - return (getVal(key) != -1); - } - public final int getVal(java.lang.Object key) { - int index = hash(key); - for (Entry e = map[index]; e != null; e = e.next) { - if (e.key == key) - return e.val; - } - return -1; - } - public final boolean containsVal(int val) { - return (getKey(val) != null); - } - public final boolean containsOrderedVal(int val) { - return containsVal(val); - } - public final java.lang.Object getKey(int val) { - int index = hash(val); - for (Entry e = rmap[index]; e != null; e = e.rnext) { - if (e.val == val) - return e.key; - } - return null; - } - public void done() { - map = null; - rmap = null; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/CorbaResourceUtil.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/CorbaResourceUtil.java deleted file mode 100644 index 5f141201392..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/CorbaResourceUtil.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil; - -import java.util.ResourceBundle; -import java.util.MissingResourceException; - -public class CorbaResourceUtil { - public static String getString(String key) { - if (!resourcesInitialized) { - initResources(); - } - - try { - return resources.getString(key); - } catch (MissingResourceException ignore) { - } - return null; - } - - public static String getText(String key) { - String message = getString(key); - if (message == null) { - message = "no text found: \"" + key + "\""; - } - return message; - } - - public static String getText(String key, int num) { - return getText(key, Integer.toString(num), null, null); - } - - public static String getText(String key, String arg0) { - return getText(key, arg0, null, null); - } - - public static String getText(String key, String arg0, String arg1) { - return getText(key, arg0, arg1, null); - } - - public static String getText(String key, - String arg0, String arg1, String arg2) - { - String format = getString(key); - if (format == null) { - format = "no text found: key = \"" + key + "\", " + - "arguments = \"{0}\", \"{1}\", \"{2}\""; - } - - String[] args = new String[3]; - args[0] = (arg0 != null ? arg0.toString() : "null"); - args[1] = (arg1 != null ? arg1.toString() : "null"); - args[2] = (arg2 != null ? arg2.toString() : "null"); - - return java.text.MessageFormat.format(format, (Object[]) args); - } - - private static boolean resourcesInitialized = false; - private static ResourceBundle resources; - - private static void initResources() { - try { - resources = - ResourceBundle.getBundle("com.sun.corba.se.impl.orbutil.resources.sunorb"); - resourcesInitialized = true; - } catch (MissingResourceException e) { - throw new Error("fatal: missing resource bundle: " + - e.getClassName()); - } - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/DenseIntMapImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/DenseIntMapImpl.java deleted file mode 100644 index 95be1654dc0..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/DenseIntMapImpl.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil ; - -import java.util.ArrayList ; - -/** Utility for managing mappings from densely allocated integer - * keys to arbitrary objects. This should only be used for - * keys in the range 0..max such that "most" of the key space is actually - * used. - */ -public class DenseIntMapImpl -{ - private ArrayList list = new ArrayList() ; - - private void checkKey( int key ) - { - if (key < 0) - throw new IllegalArgumentException( "Key must be >= 0." ) ; - } - - /** - * If {@code key >= 0}, return the value bound to key, or null if none. - * Throws IllegalArgumentException if {@code key < 0}. - */ - public Object get( int key ) - { - checkKey( key ) ; - - Object result = null ; - if (key < list.size()) - result = list.get( key ) ; - - return result ; - } - - /** - * If {@code key >= 0}, bind value to the key. - * Throws IllegalArgumentException if {@code key < 0}. - */ - public void set( int key, Object value ) - { - checkKey( key ) ; - extend( key ) ; - list.set( key, value ) ; - } - - private void extend( int index ) - { - if (index >= list.size()) { - list.ensureCapacity( index + 1 ) ; - int max = list.size() ; - while (max++ <= index) - list.add( null ) ; - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/GetPropertyAction.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/GetPropertyAction.java deleted file mode 100644 index 9cb69d875b7..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/GetPropertyAction.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil ; - -/** - * A convenience class for retrieving the string value of a system - * property as a privileged action. This class is directly copied - * from sun.security.action.GetPropertyAction in order to avoid - * depending on the sun.security.action package. - * - *

            An instance of this class can be used as the argument of - * AccessController.doPrivileged. - * - *

            The following code retrieves the value of the system - * property named "prop" as a privileged action: - * - *

            - * String s = (String) java.security.AccessController.doPrivileged(
            - *                         new GetPropertyAction("prop"));
            - * 
            - * - * @author Roland Schemers - * @author Ken Cavanaugh - * @see java.security.PrivilegedAction - * @see java.security.AccessController - */ - -public class GetPropertyAction implements java.security.PrivilegedAction { - private String theProp; - private String defaultVal; - - /** - * Constructor that takes the name of the system property whose - * string value needs to be determined. - * - * @param theProp the name of the system property. - */ - public GetPropertyAction(String theProp) { - this.theProp = theProp; - } - - /** - * Constructor that takes the name of the system property and the default - * value of that property. - * - * @param theProp the name of the system property. - * @param defaultVal the default value. - */ - public GetPropertyAction(String theProp, String defaultVal) { - this.theProp = theProp; - this.defaultVal = defaultVal; - } - - /** - * Determines the string value of the system property whose - * name was specified in the constructor. - * - * @return the string value of the system property, - * or the default value if there is no property with that key. - */ - public Object run() { - String value = System.getProperty(theProp); - return (value == null) ? defaultVal : value; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/HexOutputStream.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/HexOutputStream.java deleted file mode 100644 index 0502a95a4eb..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/HexOutputStream.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 1996, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil; - -import java.io.StringWriter; -import java.io.OutputStream; -import java.io.IOException; - -/** - * Writes each input byte as a 2 byte hexidecimal output pair making it - * possible to turn arbitrary binary data into an ASCII format. - * The high 4 bits of the byte is translated into the first byte. - * - * @author Jeff Nisewanger - */ -public class HexOutputStream extends OutputStream -{ - static private final char hex[] = { - '0', '1', '2', '3', '4', '5', '6', '7', - '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' - }; - - private StringWriter writer; - - /** - * Creates a new HexOutputStream. - * @param w The underlying StringWriter. - */ - public - HexOutputStream(StringWriter w) { - writer = w; - } - - - /** - * Writes a byte. Will block until the byte is actually - * written. - * param b The byte to write out. - * @exception java.io.IOException I/O error occurred. - */ - public synchronized void write(int b) throws IOException { - writer.write(hex[((b >> 4) & 0xF)]); - writer.write(hex[((b >> 0) & 0xF)]); - } - - public synchronized void write(byte[] b) throws IOException { - write(b, 0, b.length); - } - - public synchronized void write(byte[] b, int off, int len) - throws IOException - { - for(int i=0; i < len; i++) { - write(b[off + i]); - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/LegacyHookGetFields.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/LegacyHookGetFields.java deleted file mode 100644 index b05e8a9d3ab..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/LegacyHookGetFields.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - */ -package com.sun.corba.se.impl.orbutil; - -import java.io.*; -import java.util.Hashtable; - -class LegacyHookGetFields extends ObjectInputStream.GetField { - private Hashtable fields = null; - - LegacyHookGetFields(Hashtable fields){ - this.fields = fields; - } - - /** - * Get the ObjectStreamClass that describes the fields in the stream. - */ - public java.io.ObjectStreamClass getObjectStreamClass() { - return null; - } - - /** - * Return true if the named field is defaulted and has no value - * in this stream. - */ - public boolean defaulted(String name) - throws IOException, IllegalArgumentException { - return (!fields.containsKey(name)); - } - - /** - * Get the value of the named boolean field from the persistent field. - */ - public boolean get(String name, boolean defvalue) - throws IOException, IllegalArgumentException { - if (defaulted(name)) - return defvalue; - else return ((Boolean)fields.get(name)).booleanValue(); - } - - /** - * Get the value of the named char field from the persistent fields. - */ - public char get(String name, char defvalue) - throws IOException, IllegalArgumentException { - if (defaulted(name)) - return defvalue; - else return ((Character)fields.get(name)).charValue(); - - } - - /** - * Get the value of the named byte field from the persistent fields. - */ - public byte get(String name, byte defvalue) - throws IOException, IllegalArgumentException { - if (defaulted(name)) - return defvalue; - else return ((Byte)fields.get(name)).byteValue(); - - } - - /** - * Get the value of the named short field from the persistent fields. - */ - public short get(String name, short defvalue) - throws IOException, IllegalArgumentException { - if (defaulted(name)) - return defvalue; - else return ((Short)fields.get(name)).shortValue(); - - } - - /** - * Get the value of the named int field from the persistent fields. - */ - public int get(String name, int defvalue) - throws IOException, IllegalArgumentException { - if (defaulted(name)) - return defvalue; - else return ((Integer)fields.get(name)).intValue(); - - } - - /** - * Get the value of the named long field from the persistent fields. - */ - public long get(String name, long defvalue) - throws IOException, IllegalArgumentException { - if (defaulted(name)) - return defvalue; - else return ((Long)fields.get(name)).longValue(); - - } - - /** - * Get the value of the named float field from the persistent fields. - */ - public float get(String name, float defvalue) - throws IOException, IllegalArgumentException { - if (defaulted(name)) - return defvalue; - else return ((Float)fields.get(name)).floatValue(); - - } - - /** - * Get the value of the named double field from the persistent field. - */ - public double get(String name, double defvalue) - throws IOException, IllegalArgumentException { - if (defaulted(name)) - return defvalue; - else return ((Double)fields.get(name)).doubleValue(); - - } - - /** - * Get the value of the named Object field from the persistent field. - */ - public Object get(String name, Object defvalue) - throws IOException, IllegalArgumentException { - if (defaulted(name)) - return defvalue; - else return fields.get(name); - - } - - public String toString(){ - return fields.toString(); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/LegacyHookPutFields.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/LegacyHookPutFields.java deleted file mode 100644 index 74bc2001853..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/LegacyHookPutFields.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - */ -package com.sun.corba.se.impl.orbutil; - -import java.io.*; -import java.util.Hashtable; - -/** - * Since ObjectOutputStream.PutField methods specify no exceptions, - * we are not checking for null parameters on put methods. - */ -class LegacyHookPutFields extends ObjectOutputStream.PutField -{ - private Hashtable fields = new Hashtable(); - - /** - * Put the value of the named boolean field into the persistent field. - */ - public void put(String name, boolean value){ - fields.put(name, new Boolean(value)); - } - - /** - * Put the value of the named char field into the persistent fields. - */ - public void put(String name, char value){ - fields.put(name, new Character(value)); - } - - /** - * Put the value of the named byte field into the persistent fields. - */ - public void put(String name, byte value){ - fields.put(name, new Byte(value)); - } - - /** - * Put the value of the named short field into the persistent fields. - */ - public void put(String name, short value){ - fields.put(name, new Short(value)); - } - - /** - * Put the value of the named int field into the persistent fields. - */ - public void put(String name, int value){ - fields.put(name, new Integer(value)); - } - - /** - * Put the value of the named long field into the persistent fields. - */ - public void put(String name, long value){ - fields.put(name, new Long(value)); - } - - /** - * Put the value of the named float field into the persistent fields. - * - */ - public void put(String name, float value){ - fields.put(name, new Float(value)); - } - - /** - * Put the value of the named double field into the persistent field. - */ - public void put(String name, double value){ - fields.put(name, new Double(value)); - } - - /** - * Put the value of the named Object field into the persistent field. - */ - public void put(String name, Object value){ - fields.put(name, value); - } - - /** - * Write the data and fields to the specified ObjectOutput stream. - */ - public void write(ObjectOutput out) throws IOException { - out.writeObject(fields); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/LogKeywords.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/LogKeywords.java deleted file mode 100644 index 32ce53d5c05..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/LogKeywords.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil; -/** - * All the Keywords that will be used in Logging Messages for CORBA need to - * be defined here. The LogKeywords will be useful for searching log messages - * based on the standard keywords, it is also useful to work with LogAnalyzing - * tools. - * We will try to standardize these keywords in JSR 117 Logging - */ -public class LogKeywords { - - /** - ** Keywords for Lifecycle Loggers. - ** _REVISIT_ After it is clearly defined in JSR 117 - **/ - public final static String LIFECYCLE_CREATE = "<>"; - public final static String LIFECYCLE_INITIALIZE = "<>"; - public final static String LIFECYCLE_SHUTDOWN = "<>"; - public final static String LIFECYCLE_DESTROY = "<>"; - - - public final static String LIFECYCLE_CREATE_SUCCESS = - LIFECYCLE_CREATE + "<>"; - public final static String LIFECYCLE_CREATE_FAILURE = - LIFECYCLE_CREATE + "<>"; - public final static String LIFECYCLE_INITIALIZE_SUCCESS = - LIFECYCLE_INITIALIZE + "<>"; - public final static String LIFECYCLE_INITIALIZE_FAILURE = - LIFECYCLE_INITIALIZE + "<>"; - public final static String LIFECYCLE_SHUTDOWN_SUCCESS = - LIFECYCLE_SHUTDOWN + "<>"; - public final static String LIFECYCLE_SHUTDOWN_FAILURE = - LIFECYCLE_SHUTDOWN + "<>"; - public final static String LIFECYCLE_DESTROY_SUCCESS = - LIFECYCLE_DESTROY + "<>"; - public final static String LIFECYCLE_DESTROY_FAILURE = - LIFECYCLE_DESTROY + "<>"; - - /** - ** Keywords for Naming Read Loggers. - **/ - public final static String NAMING_RESOLVE = "<>"; - public final static String NAMING_LIST = "<>"; - - public final static String NAMING_RESOLVE_SUCCESS = - NAMING_RESOLVE + "<>"; - public final static String NAMING_RESOLVE_FAILURE = - NAMING_RESOLVE + "<>"; - public final static String NAMING_LIST_SUCCESS = - NAMING_LIST + "<>"; - public final static String NAMING_LIST_FAILURE = - NAMING_LIST + "<>"; - - /** - ** Keywords for Naming Update Loggers. - **/ - public final static String NAMING_BIND = "<>"; - public final static String NAMING_UNBIND = "<>"; - public final static String NAMING_REBIND = "<>"; - - public final static String NAMING_BIND_SUCCESS = - NAMING_BIND + "<>"; - public final static String NAMING_BIND_FAILURE = - NAMING_BIND + "<>"; - public final static String NAMING_UNBIND_SUCCESS = - NAMING_UNBIND + "<>"; - public final static String NAMING_UNBIND_FAILURE = - NAMING_UNBIND + "<>"; - public final static String NAMING_REBIND_SUCCESS = - NAMING_REBIND + "<>"; - public final static String NAMING_REBIND_FAILURE = - NAMING_REBIND + "<>"; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/ORBConstants.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/ORBConstants.java deleted file mode 100644 index 68a901fd60e..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/ORBConstants.java +++ /dev/null @@ -1,471 +0,0 @@ -/* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil; - -import com.sun.corba.se.impl.util.SUNVMCID ; - -public class ORBConstants { - private ORBConstants() {} - - public static final String STRINGIFY_PREFIX = "IOR:" ; - - /* TAGS - tag-request@omg.org - FAQ on tags and tag allocation: http://doc.omg.org/ptc/99-02-01. - http://doc.omg.org/standard-tags - http://doc.omg.org/vendor-tags - - Last update: 19th August 2003 (ptc/03-08-14) - - // Legacy - 1 profile tag 0x4f4e4300 ("ONC\x00") - 1 profile tag 0x4e454f00 ("NEO\x00") - 1 profile tag 0x434f4f4c ("COOL") - 16 service tags 0x4e454f00 - 0x4e454f0f ("NEO\x00" - "NEO\x0f") - - // Current - 16 VMCID 0x5355xxxx ("SU\x00\x00" - "SU\xff\xff") - 16 profile tags 0x53554e00 - 0x53554e0f ("SUN\x00" - "SUN\x0f") - 16 ORB Type IDs 0x53554e00 - 0x53554e0f ("SUN\x00" - "SUN\x0f") - 64 service tags 0x53554e00 - 0x53554e3f ("SUN\x00" - "SUN\x3f") - 64 component tags 0x53554e00 - 0x53554e3f ("SUN\x00" - "SUN\x3f") - */ - - // All NEO service contexts must be in the range - // NEO_FIRST_SERVICE_CONTEXT to - // NEO_FIRST_SERVICE_CONTEXT + NUM_NEO_SERVICE_CONTEXTS - 1 - public static final int NEO_FIRST_SERVICE_CONTEXT = 0x4e454f00 ; - public static final int NUM_NEO_SERVICE_CONTEXTS = 15 ; - public static final int TAG_ORB_VERSION = NEO_FIRST_SERVICE_CONTEXT ; - - public static final int SUN_TAGGED_COMPONENT_ID_BASE = 0x53554e00; - public static final int SUN_SERVICE_CONTEXT_ID_BASE = 0x53554e00; - - // - // Tagged Components Ids - // - - // Used by AS 7 for IIOP failover. - public static final int TAG_CONTAINER_ID = - SUN_TAGGED_COMPONENT_ID_BASE + 0; - // Used by AS 8.1 for Request Partioning - public static final int TAG_REQUEST_PARTITIONING_ID = - SUN_TAGGED_COMPONENT_ID_BASE + 1; - // TaggedComponentId for Java serialization tagged component. - public static final int TAG_JAVA_SERIALIZATION_ID = - SUN_TAGGED_COMPONENT_ID_BASE + 2; - - // - // Service Context Ids - // - - // Used by AS 7 for IIOP failover. - public static final int CONTAINER_ID_SERVICE_CONTEXT = - SUN_SERVICE_CONTEXT_ID_BASE + 0; - - // All Sun policies are allocated using the SUNVMCID, which is also - // used for minor codes. This allows 12 bits of offset, so - // the largest legal Sun policy is SUNVMCID.value + 4095. - public static final int SERVANT_CACHING_POLICY = SUNVMCID.value + 0 ; - public static final int ZERO_PORT_POLICY = SUNVMCID.value + 1 ; - public static final int COPY_OBJECT_POLICY = SUNVMCID.value + 2 ; - public static final int REQUEST_PARTITIONING_POLICY = SUNVMCID.value + 3 ; - - // These are the subcontract IDs for various qualities of - // service/implementation. - // Persistent SCIDs have the second bit as 1. - // SCIDs less than FIRST_POA_SCID are JavaIDL SCIDs. - public static final int TOA_SCID = 2 ; - - public static final int DEFAULT_SCID = TOA_SCID ; - - public static final int FIRST_POA_SCID = 32; - public static final int MAX_POA_SCID = 63; - public static final int TRANSIENT_SCID = FIRST_POA_SCID ; - public static final int PERSISTENT_SCID = makePersistent( TRANSIENT_SCID ) ; - public static final int SC_TRANSIENT_SCID = FIRST_POA_SCID + 4 ; - public static final int SC_PERSISTENT_SCID = makePersistent( SC_TRANSIENT_SCID ) ; - public static final int IISC_TRANSIENT_SCID = FIRST_POA_SCID + 8 ; - public static final int IISC_PERSISTENT_SCID = makePersistent( IISC_TRANSIENT_SCID ) ; - public static final int MINSC_TRANSIENT_SCID = FIRST_POA_SCID + 12 ; - public static final int MINSC_PERSISTENT_SCID = makePersistent( MINSC_TRANSIENT_SCID ) ; - - public static boolean isTransient( int scid ) - { - return (scid & 2) == 0 ; - } - - public static int makePersistent( int scid ) - { - return scid | 2 ; - } - - // Constants for ORB properties ************************************************************** - - // All ORB properties must follow the following rules: - // 1. Property names must start with either - // ORG_OMG_CORBA_PREFIX or SUN_PREFIX. - // 2. Property names must have unique suffixes after the last ".". - // 3. Property names must have "ORB" as the first 3 letters - // in their suffix. - // 4. proprietary property names should have a subsystem - // where appropriate after the prefix. - - // org.omg.CORBA properties must be defined by OMG standards - // The well known org.omg.CORBA.ORBClass and - // org.omg.CORBA.ORBSingletonClass are not included here - // since they occur in org.omg.CORBA.ORB. - - public static final String ORG_OMG_PREFIX = "org.omg." ; - public static final String ORG_OMG_CORBA_PREFIX = "org.omg.CORBA." ; - - public static final String INITIAL_HOST_PROPERTY = - ORG_OMG_CORBA_PREFIX + "ORBInitialHost" ; - public static final String INITIAL_PORT_PROPERTY = - ORG_OMG_CORBA_PREFIX + "ORBInitialPort" ; - public static final String INITIAL_SERVICES_PROPERTY = - ORG_OMG_CORBA_PREFIX + "ORBInitialServices" ; - public static final String DEFAULT_INIT_REF_PROPERTY = - ORG_OMG_CORBA_PREFIX + "ORBDefaultInitRef" ; - public static final String ORB_INIT_REF_PROPERTY = - ORG_OMG_CORBA_PREFIX + "ORBInitRef" ; - - // All of our proprietary properties must start with com.sun.CORBA - public static final String SUN_PREFIX = "com.sun.CORBA." ; - - // general properties - public static final String ALLOW_LOCAL_OPTIMIZATION = SUN_PREFIX + "ORBAllowLocalOptimization" ; - public static final String SERVER_PORT_PROPERTY = SUN_PREFIX + "ORBServerPort" ; - public static final String SERVER_HOST_PROPERTY = SUN_PREFIX + "ORBServerHost" ; - public static final String ORB_ID_PROPERTY = ORG_OMG_CORBA_PREFIX + "ORBId" ; - // This property is provided for backward compatibility reasons - public static final String OLD_ORB_ID_PROPERTY = SUN_PREFIX + "ORBid" ; - public static final String ORB_SERVER_ID_PROPERTY = ORG_OMG_CORBA_PREFIX + "ORBServerId" ; - public static final String DEBUG_PROPERTY = SUN_PREFIX + "ORBDebug" ; - // Property for setting use of repository Ids during serialization. - public static final String USE_REP_ID = SUN_PREFIX + "ORBUseRepId"; - - // NOTE: This is an internal property. It should never be set by - // a user. That is the reason it has spaces in its name - to make it - // harder to use. - public static final String LISTEN_ON_ALL_INTERFACES = SUN_PREFIX + "INTERNAL USE ONLY: listen on all interfaces"; - - // giop related properties - default settings in decimal form - public static final String GIOP_VERSION = SUN_PREFIX + "giop.ORBGIOPVersion" ; - public static final String GIOP_FRAGMENT_SIZE = SUN_PREFIX + "giop.ORBFragmentSize" ; - public static final String GIOP_BUFFER_SIZE = SUN_PREFIX + "giop.ORBBufferSize" ; - public static final String GIOP_11_BUFFMGR = SUN_PREFIX + "giop.ORBGIOP11BuffMgr"; - public static final String GIOP_12_BUFFMGR = SUN_PREFIX + "giop.ORBGIOP12BuffMgr"; - public static final String GIOP_TARGET_ADDRESSING = SUN_PREFIX + "giop.ORBTargetAddressing"; - public static final int GIOP_DEFAULT_FRAGMENT_SIZE = 1024; - public static final int GIOP_DEFAULT_BUFFER_SIZE = 1024; - public static final int DEFAULT_GIOP_11_BUFFMGR = 0; //Growing - public static final int DEFAULT_GIOP_12_BUFFMGR = 2; //Streaming - public static final short ADDR_DISP_OBJKEY = 0; // object key used for target addressing - public static final short ADDR_DISP_PROFILE = 1; // iop profile used for target addressing - public static final short ADDR_DISP_IOR = 2; // ior used for target addressing - public static final short ADDR_DISP_HANDLE_ALL = 3; // accept all target addressing dispositions (default) - - // CORBA formal 00-11-03 sections 15.4.2.2, 15.4.3.2, 15.4.6.2 - // state that the GIOP 1.2 RequestMessage, ReplyMessage, and - // LocateReply message bodies must begin on 8 byte boundaries. - public static final int GIOP_12_MSG_BODY_ALIGNMENT = 8; - - // The GIOP 1.2 fragments must be divisible by 8. We generalize this - // to GIOP 1.1 fragments, as well. - public static final int GIOP_FRAGMENT_DIVISOR = 8; - public static final int GIOP_FRAGMENT_MINIMUM_SIZE = 32; - - // connection management properties - public static final String HIGH_WATER_MARK_PROPERTY = - SUN_PREFIX + "connection.ORBHighWaterMark" ; - public static final String LOW_WATER_MARK_PROPERTY = - SUN_PREFIX + "connection.ORBLowWaterMark" ; - public static final String NUMBER_TO_RECLAIM_PROPERTY = - SUN_PREFIX + "connection.ORBNumberToReclaim" ; - - public static final String ACCEPTOR_CLASS_PREFIX_PROPERTY = - SUN_PREFIX + "transport.ORBAcceptor"; - - public static final String CONTACT_INFO_LIST_FACTORY_CLASS_PROPERTY = - SUN_PREFIX + "transport.ORBContactInfoList"; - - // Legacy: - public static final String LEGACY_SOCKET_FACTORY_CLASS_PROPERTY = - SUN_PREFIX + "legacy.connection.ORBSocketFactoryClass" ; - - - public static final String SOCKET_FACTORY_CLASS_PROPERTY = - SUN_PREFIX + "transport.ORBSocketFactoryClass" ; - public static final String LISTEN_SOCKET_PROPERTY = - SUN_PREFIX + "transport.ORBListenSocket"; - public static final String IOR_TO_SOCKET_INFO_CLASS_PROPERTY = - SUN_PREFIX + "transport.ORBIORToSocketInfoClass"; - public static final String IIOP_PRIMARY_TO_CONTACT_INFO_CLASS_PROPERTY = - SUN_PREFIX + "transport.ORBIIOPPrimaryToContactInfoClass"; - - // Request partitioning maximum and minimum thread pool id constants. - public static final int REQUEST_PARTITIONING_MIN_THREAD_POOL_ID = 0; - public static final int REQUEST_PARTITIONING_MAX_THREAD_POOL_ID = 63; - - // transport read tcp timeout property, colon separated property - // with syntax - public static final String TRANSPORT_TCP_READ_TIMEOUTS_PROPERTY = - SUN_PREFIX + "transport.ORBTCPReadTimeouts"; - - // initial time to wait in milliseconds if a transport - // tcp read returns 0 bytes - public static final int TRANSPORT_TCP_INITIAL_TIME_TO_WAIT = 100; - - // max time to spend in cumulative waits in milliseconds - // if a transport tcp read returns 0 bytes - public static final int TRANSPORT_TCP_MAX_TIME_TO_WAIT = 3000; - - // max time to spend in cumulative waits in milliseconds - // if a transport tcp read of GIOP header returns 0 bytes - public static final int TRANSPORT_TCP_GIOP_HEADER_MAX_TIME_TO_WAIT = 300; - - // A backoff percentage used to compute the next amount of time to - // wait on a subsequent transport tcp read of 0 bytes - public static final int TRANSPORT_TCP_TIME_TO_WAIT_BACKOFF_FACTOR = 20; - - public static final String USE_NIO_SELECT_TO_WAIT_PROPERTY = - SUN_PREFIX + "transport.ORBUseNIOSelectToWait"; - - // "Socket" | "SocketChannel" - // Note: Connections accepted by SocketChannel will be SocketChannel. - public static final String ACCEPTOR_SOCKET_TYPE_PROPERTY = - SUN_PREFIX + "transport.ORBAcceptorSocketType"; - - // Applicable if using SocketChannel and using select thread. - public static final String ACCEPTOR_SOCKET_USE_WORKER_THREAD_FOR_EVENT_PROPERTY = - SUN_PREFIX + "transport.ORBAcceptorSocketUseWorkerThreadForEvent"; - - // Applicable on client-side. "Socket" | "SocketChannel" - public static final String CONNECTION_SOCKET_TYPE_PROPERTY = - SUN_PREFIX + "transport.ORBConnectionSocketType"; - - // Applicable if using SocketChannel and using select thread - public static final String CONNECTION_SOCKET_USE_WORKER_THREAD_FOR_EVENT_PROPERTY = - SUN_PREFIX + "transport.ORBConnectionSocketUseWorkerThreadForEvent"; - - // Used to disable the use of direct byte buffers. This enables much easier - // debugging, because the contents of a direct byte buffer cannot be - // viewed in most (all?) debuggers. - public static final String DISABLE_DIRECT_BYTE_BUFFER_USE_PROPERTY = - SUN_PREFIX + "transport.ORBDisableDirectByteBufferUse" ; - - public static final String SOCKET = "Socket"; - public static final String SOCKETCHANNEL = "SocketChannel"; - - // POA related policies - public static final String PERSISTENT_SERVER_PORT_PROPERTY = SUN_PREFIX + "POA.ORBPersistentServerPort" ; - public static final String SERVER_ID_PROPERTY = SUN_PREFIX + "POA.ORBServerId" ; - public static final String BAD_SERVER_ID_HANDLER_CLASS_PROPERTY - = SUN_PREFIX + "POA.ORBBadServerIdHandlerClass" ; - public static final String ACTIVATED_PROPERTY = SUN_PREFIX + "POA.ORBActivated" ; - public static final String SERVER_NAME_PROPERTY = SUN_PREFIX + "POA.ORBServerName" ; - - // Server Properties; e.g. when properties passed to ORB activated - // servers - - public static final String SERVER_DEF_VERIFY_PROPERTY = SUN_PREFIX + "activation.ORBServerVerify" ; - - // This one is an exception, but it may be externally visible - public static final String SUN_LC_PREFIX = "com.sun.corba." ; - - // Necessary for package renaming to work correctly - public static final String SUN_LC_VERSION_PREFIX = "com.sun.corba.se."; - - public static final String JTS_CLASS_PROPERTY = SUN_LC_VERSION_PREFIX + "CosTransactions.ORBJTSClass" ; - - // Property for enabling ORB's use of Java serialization. - public static final String ENABLE_JAVA_SERIALIZATION_PROPERTY = - SUN_PREFIX + "encoding.ORBEnableJavaSerialization"; - - // Constants for ORB prefixes ************************************************************** - - public static final String PI_ORB_INITIALIZER_CLASS_PREFIX = - "org.omg.PortableInterceptor.ORBInitializerClass."; - - public static final String USE_DYNAMIC_STUB_PROPERTY = SUN_PREFIX + "ORBUseDynamicStub" ; - - public static final String DYNAMIC_STUB_FACTORY_FACTORY_CLASS = - SUN_PREFIX + "ORBDynamicStubFactoryFactoryClass" ; - - // Constants for NameService properties ************************************ - - public static final int DEFAULT_INITIAL_PORT = 900; - - public static final String DEFAULT_INS_HOST = "localhost"; - - public static final int DEFAULT_INS_PORT = 2089; - - public static final int DEFAULT_INS_GIOP_MAJOR_VERSION = 1; - - // http://www.omg.org/cgi-bin/doc?ptc/00-08-07 [ Section 13.6.7.3 ] - // defines the default GIOP minor version to be 0. - public static final int DEFAULT_INS_GIOP_MINOR_VERSION = 0; - - - // Constants for INS properties ******************************************** - - // GIOP Version number for validation of INS URL format addresses - public static final int MAJORNUMBER_SUPPORTED = 1; - public static final int MINORNUMBERMAX = 2; - - // Subcontract's differentiation using the TRANSIENT and PERSISTENT - // Name Service Property. - public static final int TRANSIENT = 1; - public static final int PERSISTENT = 2; - - // Constants for ORBD properties **************************************************************** - - // These properties are never passed on ORB init: they are only passed to ORBD. - - public static final String DB_DIR_PROPERTY = SUN_PREFIX + "activation.DbDir" ; - public static final String DB_PROPERTY = SUN_PREFIX + "activation.db" ; - public static final String ORBD_PORT_PROPERTY = SUN_PREFIX + "activation.Port" ; - public static final String SERVER_POLLING_TIME = SUN_PREFIX + "activation.ServerPollingTime"; - public static final String SERVER_STARTUP_DELAY = SUN_PREFIX + "activation.ServerStartupDelay"; - - public static final int DEFAULT_ACTIVATION_PORT = 1049 ; - - // If RI is starting the NameService then they would indicate that by - // passing the RI flag. That would start a Persistent Port to listen to - // INS request. - public static final int RI_NAMESERVICE_PORT = 1050; - - public static final int DEFAULT_SERVER_POLLING_TIME = 1000; - - public static final int DEFAULT_SERVER_STARTUP_DELAY = 1000; - - - //***************** Constants for Logging **************** - - public static final String LOG_LEVEL_PROPERTY = SUN_PREFIX + "ORBLogLevel"; - - public static final String LOG_RESOURCE_FILE = - "com.sun.corba.se.impl.logging.LogStrings"; - - // Constants for initial references ************************************************************* - - public static final String TRANSIENT_NAME_SERVICE_NAME = "TNameService" ; - public static final String PERSISTENT_NAME_SERVICE_NAME = "NameService" ; - - // A large Number to make sure that other ServerIds doesn't collide - // with NameServer Persistent Server Id - public static final String NAME_SERVICE_SERVER_ID = "1000000" ; - - public static final String ROOT_POA_NAME = "RootPOA" ; - public static final String POA_CURRENT_NAME = "POACurrent" ; - public static final String SERVER_ACTIVATOR_NAME = "ServerActivator" ; - public static final String SERVER_LOCATOR_NAME = "ServerLocator" ; - public static final String SERVER_REPOSITORY_NAME = "ServerRepository" ; - public static final String INITIAL_NAME_SERVICE_NAME= "InitialNameService" ; - public static final String TRANSACTION_CURRENT_NAME = "TransactionCurrent" ; - public static final String DYN_ANY_FACTORY_NAME = "DynAnyFactory" ; - - // New for Portable Interceptors - public static final String PI_CURRENT_NAME = "PICurrent" ; - public static final String CODEC_FACTORY_NAME = "CodecFactory" ; - - // Constants for ORBD DB *********************************************************************** - - public static final String DEFAULT_DB_DIR = "orb.db" ; - public static final String DEFAULT_DB_NAME = "db" ; - public static final String INITIAL_ORB_DB = "initial.db" ; - public static final String SERVER_LOG_DIR = "logs" ; - public static final String ORBID_DIR_BASE = "orbids" ; - public static final String ORBID_DB_FILE_NAME = "orbids.db" ; - - // Constants for ThreadPool ******************************************************************** - - // Default value for when inactive threads in the pool can stop running (ms) - public static final int DEFAULT_INACTIVITY_TIMEOUT = 120000; - // Default name of the threadpool - public static final String THREADPOOL_DEFAULT_NAME = "default-threadpool"; - // Default name of the workqueue - public static final String WORKQUEUE_DEFAULT_NAME = "default-workqueue"; - - // Constants for minor code bases ************************************************************** - // This is the value that pre-Merlin Sun ORBs incorrectly used. We preserve this - // here for backwards compatibility, but note that the current ORB must never - // create a BAD_PARAM system exception with this minor code. - public static final int LEGACY_SUN_NOT_SERIALIZABLE = SUNVMCID.value + 1 ; - - // Code Set related ******************************************************* - - // If we don't always send the code set context, there's a possibility - // of failure when fragments of a smaller request are interleved with - // those of a first request with other large service contexts. - // - public static final boolean DEFAULT_ALWAYS_SEND_CODESET_CTX = true; - public static final String ALWAYS_SEND_CODESET_CTX_PROPERTY - = SUN_PREFIX + "codeset.AlwaysSendCodeSetCtx"; - - // Use byte order markers in streams when applicable? This won't apply to - // GIOP 1.1 due to limitations in the CDR encoding. - public static final boolean DEFAULT_USE_BYTE_ORDER_MARKERS = true; - public static final String USE_BOMS = SUN_PREFIX + "codeset.UseByteOrderMarkers"; - - // Use byte order markers in encapsulations when applicable? - public static final boolean DEFAULT_USE_BYTE_ORDER_MARKERS_IN_ENCAPS = false; - public static final String USE_BOMS_IN_ENCAPS = SUN_PREFIX + "codeset.UseByteOrderMarkersInEncaps"; - - // The CHAR_CODESETS and WCHAR_CODESETS allow the user to override the default - // connection code sets. The value should be a comma separated list of OSF - // registry numbers. The first number in the list will be the native code - // set. - // - // Number can be specified as hex if preceded by 0x, otherwise they are - // interpreted as decimal. - // - // Code sets that we accept currently (see core/OSFCodeSetRegistry): - // - // char/string: - // - // ISO8859-1 (Latin-1) 0x00010001 - // ISO646 (ASCII) 0x00010020 - // UTF-8 0x05010001 - // - // wchar/string: - // - // UTF-16 0x00010109 - // UCS-2 0x00010100 - // UTF-8 0x05010001 - // - // Note: The ORB will let you assign any of the above values to - // either of the following properties, but the above assignments - // are the only ones that won't get you into trouble. - public static final String CHAR_CODESETS = SUN_PREFIX + "codeset.charsets"; - public static final String WCHAR_CODESETS = SUN_PREFIX + "codeset.wcharsets"; - - // Constants to make stream format version code easier to read - public static final byte STREAM_FORMAT_VERSION_1 = (byte)1; - public static final byte STREAM_FORMAT_VERSION_2 = (byte)2; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/ORBUtility.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/ORBUtility.java deleted file mode 100644 index a368ee9d30e..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/ORBUtility.java +++ /dev/null @@ -1,846 +0,0 @@ -/* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil; - -import java.lang.Character; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.rmi.NoSuchObjectException; -import java.security.AccessController; -import java.security.PermissionCollection; -import java.security.Policy; -import java.security.PrivilegedAction; -import java.security.ProtectionDomain; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.Enumeration; -import java.util.StringTokenizer; -import java.util.NoSuchElementException; - -import javax.rmi.CORBA.ValueHandler; -import javax.rmi.CORBA.ValueHandlerMultiFormat; -import javax.rmi.CORBA.Util; - -import org.omg.CORBA.StructMember ; -import org.omg.CORBA.TypeCode ; -import org.omg.CORBA.Any ; -import org.omg.CORBA.TCKind ; -import org.omg.CORBA.SystemException ; -import org.omg.CORBA.CompletionStatus ; -import org.omg.CORBA.DATA_CONVERSION ; -import org.omg.CORBA.BAD_PARAM ; -import org.omg.CORBA.BAD_OPERATION ; -import org.omg.CORBA.INTERNAL ; -import org.omg.CORBA.TypeCodePackage.BadKind ; -import org.omg.CORBA.portable.OutputStream ; -import org.omg.CORBA.portable.InputStream ; - -import com.sun.corba.se.pept.transport.ContactInfoList ; - -import com.sun.corba.se.spi.ior.IOR ; -import com.sun.corba.se.spi.presentation.rmi.StubAdapter ; -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.orb.ORBVersion ; -import com.sun.corba.se.spi.orb.ORBVersionFactory ; -import com.sun.corba.se.spi.protocol.CorbaClientDelegate ; -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; -import com.sun.corba.se.spi.transport.CorbaContactInfoList ; -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.spi.ior.iiop.IIOPProfile; -import com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate; - -import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; -import com.sun.corba.se.impl.corba.CORBAObjectImpl ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; -import com.sun.corba.se.impl.logging.OMGSystemException ; -import com.sun.corba.se.impl.ior.iiop.JavaSerializationComponent; - -import sun.corba.SharedSecrets; - -/** - * Handy class full of static functions that don't belong in util.Utility for pure ORB reasons. - */ -public final class ORBUtility { - private ORBUtility() {} - - private static ORBUtilSystemException wrapper = ORBUtilSystemException.get( - CORBALogDomains.UTIL ) ; - private static OMGSystemException omgWrapper = OMGSystemException.get( - CORBALogDomains.UTIL ) ; - - private static StructMember[] members = null; - - private static StructMember[] systemExceptionMembers (ORB orb) { - if (members == null) { - members = new StructMember[3]; - members[0] = new StructMember("id", orb.create_string_tc(0), null); - members[1] = new StructMember("minor", orb.get_primitive_tc(TCKind.tk_long), null); - members[2] = new StructMember("completed", orb.get_primitive_tc(TCKind.tk_long), null); - } - return members; - } - - private static TypeCode getSystemExceptionTypeCode(ORB orb, String repID, String name) { - synchronized (TypeCode.class) { - return orb.create_exception_tc(repID, name, systemExceptionMembers(orb)); - } - } - - private static boolean isSystemExceptionTypeCode(TypeCode type, ORB orb) { - StructMember[] systemExceptionMembers = systemExceptionMembers(orb); - try { - return (type.kind().value() == TCKind._tk_except && - type.member_count() == 3 && - type.member_type(0).equal(systemExceptionMembers[0].type) && - type.member_type(1).equal(systemExceptionMembers[1].type) && - type.member_type(2).equal(systemExceptionMembers[2].type)); - } catch (BadKind ex) { - return false; - } catch (org.omg.CORBA.TypeCodePackage.Bounds ex) { - return false; - } - } - - /** - * Static method for writing a CORBA standard exception to an Any. - * @param any The Any to write the SystemException into. - */ - public static void insertSystemException(SystemException ex, Any any) { - OutputStream out = any.create_output_stream(); - ORB orb = (ORB)(out.orb()); - String name = ex.getClass().getName(); - String repID = ORBUtility.repositoryIdOf(name); - out.write_string(repID); - out.write_long(ex.minor); - out.write_long(ex.completed.value()); - any.read_value(out.create_input_stream(), - getSystemExceptionTypeCode(orb, repID, name)); - } - - public static SystemException extractSystemException(Any any) { - InputStream in = any.create_input_stream(); - ORB orb = (ORB)(in.orb()); - if ( ! isSystemExceptionTypeCode(any.type(), orb)) { - throw wrapper.unknownDsiSysex(CompletionStatus.COMPLETED_MAYBE); - } - return ORBUtility.readSystemException(in); - } - - /** - * Return default ValueHandler - */ - public static ValueHandler createValueHandler() { - ValueHandler vh; - try { - vh = AccessController.doPrivileged(new PrivilegedExceptionAction() { - public ValueHandler run() throws Exception { - return Util.createValueHandler(); - } - }); - } catch (PrivilegedActionException e) { - throw new InternalError(e.getCause()); - } - return vh; - } - - /** - * Returns true if it was accurately determined that the remote ORB is - * a foreign (non-JavaSoft) ORB. Note: If passed the ORBSingleton, this - * will return false. - */ - public static boolean isForeignORB(ORB orb) - { - if (orb == null) - return false; - - try { - return orb.getORBVersion().equals(ORBVersionFactory.getFOREIGN()); - } catch (SecurityException se) { - return false; - } - } - - /** Unmarshal a byte array to an integer. - Assume the bytes are in BIGENDIAN order. - i.e. array[offset] is the most-significant-byte - and array[offset+3] is the least-significant-byte. - @param array The array of bytes. - @param offset The offset from which to start unmarshalling. - */ - public static int bytesToInt(byte[] array, int offset) - { - int b1, b2, b3, b4; - - b1 = (array[offset++] << 24) & 0xFF000000; - b2 = (array[offset++] << 16) & 0x00FF0000; - b3 = (array[offset++] << 8) & 0x0000FF00; - b4 = (array[offset++] << 0) & 0x000000FF; - - return (b1 | b2 | b3 | b4); - } - - /** Marshal an integer to a byte array. - The bytes are in BIGENDIAN order. - i.e. array[offset] is the most-significant-byte - and array[offset+3] is the least-significant-byte. - @param array The array of bytes. - @param offset The offset from which to start marshalling. - */ - public static void intToBytes(int value, byte[] array, int offset) - { - array[offset++] = (byte)((value >>> 24) & 0xFF); - array[offset++] = (byte)((value >>> 16) & 0xFF); - array[offset++] = (byte)((value >>> 8) & 0xFF); - array[offset++] = (byte)((value >>> 0) & 0xFF); - } - - /** Converts an Ascii Character into Hexadecimal digit - */ - public static int hexOf( char x ) - { - int val; - - val = x - '0'; - if (val >=0 && val <= 9) - return val; - - val = (x - 'a') + 10; - if (val >= 10 && val <= 15) - return val; - - val = (x - 'A') + 10; - if (val >= 10 && val <= 15) - return val; - - throw wrapper.badHexDigit() ; - } - - // method moved from util.Utility - - /** - * Static method for writing a CORBA standard exception to a stream. - * @param strm The OutputStream to use for marshaling. - */ - public static void writeSystemException(SystemException ex, OutputStream strm) - { - String s; - - s = repositoryIdOf(ex.getClass().getName()); - strm.write_string(s); - strm.write_long(ex.minor); - strm.write_long(ex.completed.value()); - } - - /** - * Static method for reading a CORBA standard exception from a stream. - * @param strm The InputStream to use for unmarshaling. - */ - public static SystemException readSystemException(InputStream strm) - { - try { - String name = classNameOf(strm.read_string()); - SystemException ex = (SystemException)SharedSecrets. - getJavaCorbaAccess().loadClass(name).newInstance(); - ex.minor = strm.read_long(); - ex.completed = CompletionStatus.from_int(strm.read_long()); - return ex; - } catch ( Exception ex ) { - throw wrapper.unknownSysex( CompletionStatus.COMPLETED_MAYBE, ex ); - } - } - - /** - * Get the class name corresponding to a particular repository Id. - * This is used by the system to unmarshal (instantiate) the - * appropriate exception class for an marshaled as the value of - * its repository Id. - * @param repositoryId The repository Id for which we want a class name. - */ - public static String classNameOf(String repositoryId) - { - String className=null; - - className = (String) exceptionClassNames.get(repositoryId); - if (className == null) - className = "org.omg.CORBA.UNKNOWN"; - - return className; - } - - /** - * Return true if this repositoryId is a SystemException. - * @param repositoryId The repository Id to check. - */ - public static boolean isSystemException(String repositoryId) - { - String className=null; - - className = (String) exceptionClassNames.get(repositoryId); - if (className == null) - return false; - else - return true; - } - - /** - * @return the Java serialization encoding version. - */ - public static byte getEncodingVersion(ORB orb, IOR ior) { - - // Is Java serialization enabled? - // Check the JavaSerializationComponent (tagged component) - // in the IIOPProfile. If present, the peer ORB's GIOP is capable - // of using Java serialization instead of CDR serialization. - // In such a case, use Java serialization, iff the java serialization - // versions match. - - if (orb.getORBData().isJavaSerializationEnabled()) { - IIOPProfile prof = ior.getProfile(); - IIOPProfileTemplate profTemp = - (IIOPProfileTemplate) prof.getTaggedProfileTemplate(); - java.util.Iterator iter = profTemp.iteratorById( - ORBConstants.TAG_JAVA_SERIALIZATION_ID); - if (iter.hasNext()) { - JavaSerializationComponent jc = - (JavaSerializationComponent) iter.next(); - byte jcVersion = jc.javaSerializationVersion(); - if (jcVersion >= Message.JAVA_ENC_VERSION) { - return Message.JAVA_ENC_VERSION; - } else if (jcVersion > Message.CDR_ENC_VERSION) { - return jc.javaSerializationVersion(); - } else { - // throw error? - // Since encodingVersion is <= 0 (CDR_ENC_VERSION). - } - } - } - return Message.CDR_ENC_VERSION; // default - } - - /** - * Get the repository id corresponding to a particular class. - * This is used by the system to write the - * appropriate repository id for a system exception. - * @param name The class name of the system exception. - */ - public static String repositoryIdOf(String name) - { - String id; - - id = (String) exceptionRepositoryIds.get(name); - if (id == null) - id = "IDL:omg.org/CORBA/UNKNOWN:1.0"; - - return id; - } - - private static final Hashtable exceptionClassNames = new Hashtable(); - private static final Hashtable exceptionRepositoryIds = new Hashtable(); - - static { - - // - // construct repositoryId -> className hashtable - // - exceptionClassNames.put("IDL:omg.org/CORBA/BAD_CONTEXT:1.0", - "org.omg.CORBA.BAD_CONTEXT"); - exceptionClassNames.put("IDL:omg.org/CORBA/BAD_INV_ORDER:1.0", - "org.omg.CORBA.BAD_INV_ORDER"); - exceptionClassNames.put("IDL:omg.org/CORBA/BAD_OPERATION:1.0", - "org.omg.CORBA.BAD_OPERATION"); - exceptionClassNames.put("IDL:omg.org/CORBA/BAD_PARAM:1.0", - "org.omg.CORBA.BAD_PARAM"); - exceptionClassNames.put("IDL:omg.org/CORBA/BAD_TYPECODE:1.0", - "org.omg.CORBA.BAD_TYPECODE"); - exceptionClassNames.put("IDL:omg.org/CORBA/COMM_FAILURE:1.0", - "org.omg.CORBA.COMM_FAILURE"); - exceptionClassNames.put("IDL:omg.org/CORBA/DATA_CONVERSION:1.0", - "org.omg.CORBA.DATA_CONVERSION"); - exceptionClassNames.put("IDL:omg.org/CORBA/IMP_LIMIT:1.0", - "org.omg.CORBA.IMP_LIMIT"); - exceptionClassNames.put("IDL:omg.org/CORBA/INTF_REPOS:1.0", - "org.omg.CORBA.INTF_REPOS"); - exceptionClassNames.put("IDL:omg.org/CORBA/INTERNAL:1.0", - "org.omg.CORBA.INTERNAL"); - exceptionClassNames.put("IDL:omg.org/CORBA/INV_FLAG:1.0", - "org.omg.CORBA.INV_FLAG"); - exceptionClassNames.put("IDL:omg.org/CORBA/INV_IDENT:1.0", - "org.omg.CORBA.INV_IDENT"); - exceptionClassNames.put("IDL:omg.org/CORBA/INV_OBJREF:1.0", - "org.omg.CORBA.INV_OBJREF"); - exceptionClassNames.put("IDL:omg.org/CORBA/MARSHAL:1.0", - "org.omg.CORBA.MARSHAL"); - exceptionClassNames.put("IDL:omg.org/CORBA/NO_MEMORY:1.0", - "org.omg.CORBA.NO_MEMORY"); - exceptionClassNames.put("IDL:omg.org/CORBA/FREE_MEM:1.0", - "org.omg.CORBA.FREE_MEM"); - exceptionClassNames.put("IDL:omg.org/CORBA/NO_IMPLEMENT:1.0", - "org.omg.CORBA.NO_IMPLEMENT"); - exceptionClassNames.put("IDL:omg.org/CORBA/NO_PERMISSION:1.0", - "org.omg.CORBA.NO_PERMISSION"); - exceptionClassNames.put("IDL:omg.org/CORBA/NO_RESOURCES:1.0", - "org.omg.CORBA.NO_RESOURCES"); - exceptionClassNames.put("IDL:omg.org/CORBA/NO_RESPONSE:1.0", - "org.omg.CORBA.NO_RESPONSE"); - exceptionClassNames.put("IDL:omg.org/CORBA/OBJ_ADAPTER:1.0", - "org.omg.CORBA.OBJ_ADAPTER"); - exceptionClassNames.put("IDL:omg.org/CORBA/INITIALIZE:1.0", - "org.omg.CORBA.INITIALIZE"); - exceptionClassNames.put("IDL:omg.org/CORBA/PERSIST_STORE:1.0", - "org.omg.CORBA.PERSIST_STORE"); - exceptionClassNames.put("IDL:omg.org/CORBA/TRANSIENT:1.0", - "org.omg.CORBA.TRANSIENT"); - exceptionClassNames.put("IDL:omg.org/CORBA/UNKNOWN:1.0", - "org.omg.CORBA.UNKNOWN"); - exceptionClassNames.put("IDL:omg.org/CORBA/OBJECT_NOT_EXIST:1.0", - "org.omg.CORBA.OBJECT_NOT_EXIST"); - - // SystemExceptions from OMG Transactions Service Spec - exceptionClassNames.put("IDL:omg.org/CORBA/INVALID_TRANSACTION:1.0", - "org.omg.CORBA.INVALID_TRANSACTION"); - exceptionClassNames.put("IDL:omg.org/CORBA/TRANSACTION_REQUIRED:1.0", - "org.omg.CORBA.TRANSACTION_REQUIRED"); - exceptionClassNames.put("IDL:omg.org/CORBA/TRANSACTION_ROLLEDBACK:1.0", - "org.omg.CORBA.TRANSACTION_ROLLEDBACK"); - - // from portability RTF 98-07-01.txt - exceptionClassNames.put("IDL:omg.org/CORBA/INV_POLICY:1.0", - "org.omg.CORBA.INV_POLICY"); - - // from orbrev/00-09-01 (CORBA 2.4 Draft Specification) - exceptionClassNames. - put("IDL:omg.org/CORBA/TRANSACTION_UNAVAILABLE:1.0", - "org.omg.CORBA.TRANSACTION_UNAVAILABLE"); - exceptionClassNames.put("IDL:omg.org/CORBA/TRANSACTION_MODE:1.0", - "org.omg.CORBA.TRANSACTION_MODE"); - - // Exception types introduced between CORBA 2.4 and 3.0 - exceptionClassNames.put("IDL:omg.org/CORBA/CODESET_INCOMPATIBLE:1.0", - "org.omg.CORBA.CODESET_INCOMPATIBLE"); - exceptionClassNames.put("IDL:omg.org/CORBA/REBIND:1.0", - "org.omg.CORBA.REBIND"); - exceptionClassNames.put("IDL:omg.org/CORBA/TIMEOUT:1.0", - "org.omg.CORBA.TIMEOUT"); - exceptionClassNames.put("IDL:omg.org/CORBA/BAD_QOS:1.0", - "org.omg.CORBA.BAD_QOS"); - - // Exception types introduced in CORBA 3.0 - exceptionClassNames.put("IDL:omg.org/CORBA/INVALID_ACTIVITY:1.0", - "org.omg.CORBA.INVALID_ACTIVITY"); - exceptionClassNames.put("IDL:omg.org/CORBA/ACTIVITY_COMPLETED:1.0", - "org.omg.CORBA.ACTIVITY_COMPLETED"); - exceptionClassNames.put("IDL:omg.org/CORBA/ACTIVITY_REQUIRED:1.0", - "org.omg.CORBA.ACTIVITY_REQUIRED"); - - // - // construct className -> repositoryId hashtable - // - Enumeration keys = exceptionClassNames.keys(); - java.lang.Object s; - String rId; - String cName; - - try{ - while (keys.hasMoreElements()) { - s = keys.nextElement(); - rId = (String) s; - cName = (String) exceptionClassNames.get(rId); - exceptionRepositoryIds.put (cName, rId); - } - } catch (NoSuchElementException e) { } - } - - /** Parse a version string such as "1.1.6" or "jdk1.2fcs" into - a version array of integers {1, 1, 6} or {1, 2}. - A string of "n." or "n..m" is equivalent to "n.0" or "n.0.m" respectively. - */ - public static int[] parseVersion(String version) { - if (version == null) - return new int[0]; - char[] s = version.toCharArray(); - //find the maximum span of the string "n.n.n..." where n is an integer - int start = 0; - for (; start < s.length && (s[start] < '0' || s[start] > '9'); ++start) - if (start == s.length) //no digit found - return new int[0]; - int end = start + 1; - int size = 1; - for (; end < s.length; ++end) - if (s[end] == '.') - ++size; - else if (s[end] < '0' || s[end] > '9') - break; - int[] val = new int[size]; - for (int i = 0; i < size; ++i) { - int dot = version.indexOf('.', start); - if (dot == -1 || dot > end) - dot = end; - if (start >= dot) //cases like "n." or "n..m" - val[i] = 0; //convert equivalent to "n.0" or "n.0.m" - else - val[i] = Integer.parseInt(version.substring(start, dot)); - start = dot + 1; - } - return val; - } - - /** Compare two version arrays. - Return 1, 0 or -1 if v1 is greater than, equal to, or less than v2. - */ - public static int compareVersion(int[] v1, int[] v2) { - if (v1 == null) - v1 = new int[0]; - if (v2 == null) - v2 = new int[0]; - for (int i = 0; i < v1.length; ++i) { - if (i >= v2.length || v1[i] > v2[i]) //v1 is longer or greater than v2 - return 1; - if (v1[i] < v2[i]) - return -1; - } - return v1.length == v2.length ? 0 : -1; - } - - /** Compare two version strings. - Return 1, 0 or -1 if v1 is greater than, equal to, or less than v2. - */ - public static synchronized int compareVersion(String v1, String v2) { - return compareVersion(parseVersion(v1), parseVersion(v2)); - } - - private static String compressClassName( String name ) - { - // Note that this must end in . in order to be renamed correctly. - String prefix = "com.sun.corba.se." ; - if (name.startsWith( prefix ) ) { - return "(ORB)." + name.substring( prefix.length() ) ; - } else - return name ; - } - - // Return a compressed representation of the thread name. This is particularly - // useful on the server side, where there are many SelectReaderThreads, and - // we need a short unambiguous name for such threads. - public static String getThreadName( Thread thr ) - { - if (thr == null) - return "null" ; - - // This depends on the formatting in SelectReaderThread and CorbaConnectionImpl. - // Pattern for SelectReaderThreads: - // SelectReaderThread CorbaConnectionImpl[ ] - // Any other pattern in the Thread's name is just returned. - String name = thr.getName() ; - StringTokenizer st = new StringTokenizer( name ) ; - int numTokens = st.countTokens() ; - if (numTokens != 5) - return name ; - - String[] tokens = new String[numTokens] ; - for (int ctr=0; ctr= 0 ? - "(" + ste.getFileName() + ":" + ste.getLineNumber() + ")" : - (ste.getFileName() != null ? "("+ste.getFileName()+")" : "(Unknown Source)"))); - } - - private static void printStackTrace( StackTraceElement[] trace ) - { - System.out.println( " Stack Trace:" ) ; - // print the stack trace, ommitting the zeroth element, which is - // always this method. - for ( int ctr = 1; ctr < trace.length; ctr++ ) { - System.out.print( " >" ) ; - System.out.println( formatStackTraceElement( trace[ctr] ) ) ; - } - } - - // - // Implements all dprint calls in this package. - // - public static synchronized void dprint(java.lang.Object obj, String msg) { - System.out.println( - compressClassName( obj.getClass().getName() ) + "(" + - getThreadName( Thread.currentThread() ) + "): " + msg); - } - - public static synchronized void dprint(String className, String msg) { - System.out.println( - compressClassName( className ) + "(" + - getThreadName( Thread.currentThread() ) + "): " + msg); - } - - public synchronized void dprint(String msg) { - ORBUtility.dprint(this, msg); - } - - public static synchronized void dprintTrace(Object obj, String msg) { - ORBUtility.dprint(obj, msg); - - Throwable thr = new Throwable() ; - printStackTrace( thr.getStackTrace() ) ; - } - - public static synchronized void dprint(java.lang.Object caller, - String msg, Throwable t) - { - System.out.println( - compressClassName( caller.getClass().getName() ) + - '(' + Thread.currentThread() + "): " + msg); - - if (t != null) - printStackTrace( t.getStackTrace() ) ; - } - - public static String[] concatenateStringArrays( String[] arr1, String[] arr2 ) - { - String[] result = new String[ - arr1.length + arr2.length ] ; - - for (int ctr = 0; ctr() { - public ValueHandler run() throws Exception { - return Util.createValueHandler(); - } - }); - } catch (PrivilegedActionException e) { - throw new InternalError(e.getCause()); - } - - if (!(vh instanceof javax.rmi.CORBA.ValueHandlerMultiFormat)) - return ORBConstants.STREAM_FORMAT_VERSION_1; - else - return ((ValueHandlerMultiFormat)vh).getMaximumStreamFormatVersion(); - } - - public static CorbaClientDelegate makeClientDelegate( IOR ior ) - { - ORB orb = ior.getORB() ; - CorbaContactInfoList ccil = orb.getCorbaContactInfoListFactory().create( ior ) ; - CorbaClientDelegate del = orb.getClientDelegateFactory().create(ccil); - return del ; - } - - /** This method is used to create untyped object references. - */ - public static org.omg.CORBA.Object makeObjectReference( IOR ior ) - { - CorbaClientDelegate del = makeClientDelegate( ior ) ; - org.omg.CORBA.Object objectImpl = new CORBAObjectImpl() ; - StubAdapter.setDelegate( objectImpl, del ) ; - return objectImpl ; - } - - /** This method obtains an IOR from a CORBA object reference. - * It will return null if obj is a local object, a null object, - * or an object implemented by a different ORB. It will - * throw BAD_OPERATION if obj is an unconnected RMI-IIOP object. - * @return IOR the IOR that represents this objref. This will - * never be null. - * @exception BAD_OPERATION (from oi._get_delegate) if obj is a - * normal objref, but does not have a delegate set. - * @exception BAD_PARAM if obj is a local object, or else was - * created by a foreign ORB. - */ - public static IOR getIOR( org.omg.CORBA.Object obj ) - { - if (obj == null) - throw wrapper.nullObjectReference() ; - - IOR ior = null ; - if (StubAdapter.isStub(obj)) { - org.omg.CORBA.portable.Delegate del = StubAdapter.getDelegate( - obj ) ; - - if (del instanceof CorbaClientDelegate) { - CorbaClientDelegate cdel = (CorbaClientDelegate)del ; - ContactInfoList cil = cdel.getContactInfoList() ; - - if (cil instanceof CorbaContactInfoList) { - CorbaContactInfoList ccil = (CorbaContactInfoList)cil ; - ior = ccil.getTargetIOR() ; - if (ior == null) - throw wrapper.nullIor() ; - - return ior ; - } else { - // This is our code, but the ContactInfoList is not a - // CorbaContactInfoList. This should not happen, because - // we are in the CORBA application of the DCSA framework. - // This is a coding error, and thus an INTERNAL exception - // should be thrown. - // XXX needs minor code - throw new INTERNAL() ; - } - } - - // obj is implemented by a foreign ORB, because the Delegate is not a - // ClientDelegate. - // XXX this case could be handled by marshalling and - // unmarshalling. However, object_to_string cannot be used - // here, as it is implemented with getIOR. Note that this - // will require access to an ORB, so that we can create streams - // as needed. The ORB is available simply as io._orb(). - throw wrapper.objrefFromForeignOrb() ; - } else - throw wrapper.localObjectNotAllowed() ; - } - - /** Obtains an IOR for the object reference obj, first connecting it to - * the ORB if necessary. - * @return IOR the IOR that represents this objref. This will - * never be null. - * @exception BAD_OPERATION if the object could not be connected, - * if a connection attempt was needed. - * @exception BAD_PARAM if obj is a local object, or else was - * created by a foreign ORB. - */ - public static IOR connectAndGetIOR( ORB orb, org.omg.CORBA.Object obj ) - { - IOR result ; - try { - result = getIOR( obj ) ; - } catch (BAD_OPERATION bop) { - if (StubAdapter.isStub(obj)) { - try { - StubAdapter.connect( obj, orb ) ; - } catch (java.rmi.RemoteException exc) { - throw wrapper.connectingServant( exc ) ; - } - } else { - orb.connect( obj ) ; - } - - result = getIOR( obj ) ; - } - - return result ; - } - - public static String operationNameAndRequestId(CorbaMessageMediator m) - { - return "op/" + m.getOperationName() + " id/" + m.getRequestId(); - } - - public static boolean isPrintable(char c) - { - if (Character.isJavaIdentifierStart(c)) { - // Letters and $ _ - return true; - } - if (Character.isDigit(c)) { - return true; - } - switch (Character.getType(c)) { - case Character.MODIFIER_SYMBOL : return true; // ` ^ - case Character.DASH_PUNCTUATION : return true; // - - case Character.MATH_SYMBOL : return true; // = ~ + | < > - case Character.OTHER_PUNCTUATION : return true; // !@#%&*;':",./? - case Character.START_PUNCTUATION : return true; // ( [ { - case Character.END_PUNCTUATION : return true; // ) ] } - } - return false; - } - - public static String getClassSecurityInfo(final Class cl) - { - // Returns a String which looks similar to: - // PermissionCollection java.security.Permissions@1053693 ... - // (java.io.FilePermission <> ....) - // (java.io.FilePermission /export0/sunwappserv/lib/- ...) - // ... other permissions ... - // Domain ProtectionDomain (file:/export0/sunwappserv/lib-) - // java.security.Permissions@141fedb ( - // (java.io.FilePermission <> ...) - // (java.io.FilePermission /var/tmp//- ...) - - String result = - (String)AccessController.doPrivileged(new PrivilegedAction() { - public java.lang.Object run() { - StringBuffer sb = new StringBuffer(500); - ProtectionDomain pd = cl.getProtectionDomain(); - Policy policy = Policy.getPolicy(); - PermissionCollection pc = policy.getPermissions(pd); - sb.append("\nPermissionCollection "); - sb.append(pc.toString()); - // Don't need to add 'Protection Domain' string, it's - // in ProtectionDomain.toString() already. - sb.append(pd.toString()); - return sb.toString(); - } - }); - return result; - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/ObjectStreamClassUtil_1_3.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/ObjectStreamClassUtil_1_3.java deleted file mode 100644 index 8a4fdc0ee34..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/ObjectStreamClassUtil_1_3.java +++ /dev/null @@ -1,558 +0,0 @@ -/* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil; - -// for computing the structural UID -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.security.DigestOutputStream; -import java.security.AccessController; -import java.security.PrivilegedExceptionAction; -import java.security.PrivilegedActionException; -import java.security.PrivilegedAction; -import java.io.DataOutputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; - -import java.util.Arrays; -import java.util.Comparator; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.lang.reflect.Array; -import java.lang.reflect.Member; -import java.lang.reflect.Method; -import java.lang.reflect.Constructor; - - -import com.sun.corba.se.impl.io.ObjectStreamClass; - -public final class ObjectStreamClassUtil_1_3 { - - // maintained here for backward compatability with JDK 1.3, where - // writeObject method was not being checked at all, so there is - // no need to lookup the ObjectStreamClass - - public static long computeSerialVersionUID(final Class cl) { - - long csuid = ObjectStreamClass.getSerialVersionUID(cl); - if (csuid == 0) - return csuid; // for non-serializable/proxy classes - - csuid = (ObjectStreamClassUtil_1_3.getSerialVersion(csuid, cl).longValue()); - return csuid; - } - - - // to maintain same suid as the JDK 1.3, we pick - // up suid only for classes with private,static,final - // declarations, and compute it for all others - - private static Long getSerialVersion(final long csuid, final Class cl) - { - return (Long) AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - long suid; - try { - final Field f = cl.getDeclaredField("serialVersionUID"); - int mods = f.getModifiers(); - if (Modifier.isStatic(mods) && - Modifier.isFinal(mods) && Modifier.isPrivate(mods)) { - suid = csuid; - } else { - suid = _computeSerialVersionUID(cl); - } - } catch (NoSuchFieldException ex) { - suid = _computeSerialVersionUID(cl); - //} catch (IllegalAccessException ex) { - // suid = _computeSerialVersionUID(cl); - } - return new Long(suid); - } - }); - } - - public static long computeStructuralUID(boolean hasWriteObject, Class cl) { - ByteArrayOutputStream devnull = new ByteArrayOutputStream(512); - - long h = 0; - try { - - if ((!java.io.Serializable.class.isAssignableFrom(cl)) || - (cl.isInterface())){ - return 0; - } - - if (java.io.Externalizable.class.isAssignableFrom(cl)) { - return 1; - } - - MessageDigest md = MessageDigest.getInstance("SHA"); - DigestOutputStream mdo = new DigestOutputStream(devnull, md); - DataOutputStream data = new DataOutputStream(mdo); - - //In the old case, for the caller class, the write Method wasn't considered - // for rep-id calculations correctly, but for parent classes it was taken - // into account. That is the reason there is the klude of getting the write - // Object method in there - - // Get SUID of parent - Class parent = cl.getSuperclass(); - if ((parent != null) && (parent != java.lang.Object.class)) { - boolean hasWriteObjectFlag = false; - Class [] args = {java.io.ObjectOutputStream.class}; - Method hasWriteObjectMethod = ObjectStreamClassUtil_1_3.getDeclaredMethod(parent, "writeObject", args, - Modifier.PRIVATE, Modifier.STATIC); - if (hasWriteObjectMethod != null) - hasWriteObjectFlag = true; - data.writeLong(ObjectStreamClassUtil_1_3.computeStructuralUID(hasWriteObjectFlag, parent)); - } - - if (hasWriteObject) - data.writeInt(2); - else - data.writeInt(1); - - /* Sort the field names to get a deterministic order */ - Field[] field = ObjectStreamClassUtil_1_3.getDeclaredFields(cl); - Arrays.sort(field, compareMemberByName); - - for (int i = 0; i < field.length; i++) { - Field f = field[i]; - - /* Include in the hash all fields except those that are - * transient or static. - */ - int m = f.getModifiers(); - if (Modifier.isTransient(m) || Modifier.isStatic(m)) - continue; - - data.writeUTF(f.getName()); - data.writeUTF(getSignature(f.getType())); - } - - /* Compute the hash value for this class. - * Use only the first 64 bits of the hash. - */ - data.flush(); - byte hasharray[] = md.digest(); - int minimum = Math.min(8, hasharray.length); - for (int i = minimum; i > 0; i--) { - h += (long)(hasharray[i] & 255) << (i * 8); - } - } catch (IOException ignore) { - /* can't happen, but be deterministic anyway. */ - h = -1; - } catch (NoSuchAlgorithmException complain) { - throw new SecurityException(complain.getMessage()); - } - return h; - } - - /* - * Compute a hash for the specified class. Incrementally add - * items to the hash accumulating in the digest stream. - * Fold the hash into a long. Use the SHA secure hash function. - */ - private static long _computeSerialVersionUID(Class cl) { - ByteArrayOutputStream devnull = new ByteArrayOutputStream(512); - - long h = 0; - try { - MessageDigest md = MessageDigest.getInstance("SHA"); - DigestOutputStream mdo = new DigestOutputStream(devnull, md); - DataOutputStream data = new DataOutputStream(mdo); - - - data.writeUTF(cl.getName()); - - int classaccess = cl.getModifiers(); - classaccess &= (Modifier.PUBLIC | Modifier.FINAL | - Modifier.INTERFACE | Modifier.ABSTRACT); - - /* Workaround for javac bug that only set ABSTRACT for - * interfaces if the interface had some methods. - * The ABSTRACT bit reflects that the number of methods > 0. - * This is required so correct hashes can be computed - * for existing class files. - * Previously this hack was previously present in the VM. - */ - Method[] method = cl.getDeclaredMethods(); - if ((classaccess & Modifier.INTERFACE) != 0) { - classaccess &= (~Modifier.ABSTRACT); - if (method.length > 0) { - classaccess |= Modifier.ABSTRACT; - } - } - - data.writeInt(classaccess); - - /* - * Get the list of interfaces supported, - * Accumulate their names their names in Lexical order - * and add them to the hash - */ - if (!cl.isArray()) { - /* In 1.2fcs, getInterfaces() was modified to return - * {java.lang.Cloneable, java.io.Serializable} when - * called on array classes. These values would upset - * the computation of the hash, so we explicitly omit - * them from its computation. - */ - - Class interfaces[] = cl.getInterfaces(); - Arrays.sort(interfaces, compareClassByName); - - for (int i = 0; i < interfaces.length; i++) { - data.writeUTF(interfaces[i].getName()); - } - } - - /* Sort the field names to get a deterministic order */ - Field[] field = cl.getDeclaredFields(); - Arrays.sort(field, compareMemberByName); - - for (int i = 0; i < field.length; i++) { - Field f = field[i]; - - /* Include in the hash all fields except those that are - * private transient and private static. - */ - int m = f.getModifiers(); - if (Modifier.isPrivate(m) && - (Modifier.isTransient(m) || Modifier.isStatic(m))) - continue; - - data.writeUTF(f.getName()); - data.writeInt(m); - data.writeUTF(getSignature(f.getType())); - } - - // need to find the java replacement for hasStaticInitializer - if (hasStaticInitializer(cl)) { - data.writeUTF(""); - data.writeInt(Modifier.STATIC); // TBD: what modifiers does it have - data.writeUTF("()V"); - } - - /* - * Get the list of constructors including name and signature - * Sort lexically, add all except the private constructors - * to the hash with their access flags - */ - - MethodSignature[] constructors = - MethodSignature.removePrivateAndSort(cl.getDeclaredConstructors()); - for (int i = 0; i < constructors.length; i++) { - MethodSignature c = constructors[i]; - String mname = ""; - String desc = c.signature; - desc = desc.replace('/', '.'); - data.writeUTF(mname); - data.writeInt(c.member.getModifiers()); - data.writeUTF(desc); - } - - /* Include in the hash all methods except those that are - * private transient and private static. - */ - MethodSignature[] methods = - MethodSignature.removePrivateAndSort(method); - for (int i = 0; i < methods.length; i++ ) { - MethodSignature m = methods[i]; - String desc = m.signature; - desc = desc.replace('/', '.'); - data.writeUTF(m.member.getName()); - data.writeInt(m.member.getModifiers()); - data.writeUTF(desc); - } - - /* Compute the hash value for this class. - * Use only the first 64 bits of the hash. - */ - data.flush(); - byte hasharray[] = md.digest(); - for (int i = 0; i < Math.min(8, hasharray.length); i++) { - h += (long)(hasharray[i] & 255) << (i * 8); - } - } catch (IOException ignore) { - /* can't happen, but be deterministic anyway. */ - h = -1; - } catch (NoSuchAlgorithmException complain) { - throw new SecurityException(complain.getMessage()); - } - return h; - } - - /* - * Comparator object for Classes and Interfaces - */ - private static Comparator compareClassByName = - new CompareClassByName(); - - private static class CompareClassByName implements Comparator { - public int compare(Object o1, Object o2) { - Class c1 = (Class)o1; - Class c2 = (Class)o2; - return (c1.getName()).compareTo(c2.getName()); - } - } - - /* - * Comparator object for Members, Fields, and Methods - */ - private static Comparator compareMemberByName = - new CompareMemberByName(); - - private static class CompareMemberByName implements Comparator { - public int compare(Object o1, Object o2) { - String s1 = ((Member)o1).getName(); - String s2 = ((Member)o2).getName(); - - if (o1 instanceof Method) { - s1 += getSignature((Method)o1); - s2 += getSignature((Method)o2); - } else if (o1 instanceof Constructor) { - s1 += getSignature((Constructor)o1); - s2 += getSignature((Constructor)o2); - } - return s1.compareTo(s2); - } - } - - /** - * Compute the JVM signature for the class. - */ - private static String getSignature(Class clazz) { - String type = null; - if (clazz.isArray()) { - Class cl = clazz; - int dimensions = 0; - while (cl.isArray()) { - dimensions++; - cl = cl.getComponentType(); - } - StringBuffer sb = new StringBuffer(); - for (int i = 0; i < dimensions; i++) { - sb.append("["); - } - sb.append(getSignature(cl)); - type = sb.toString(); - } else if (clazz.isPrimitive()) { - if (clazz == Integer.TYPE) { - type = "I"; - } else if (clazz == Byte.TYPE) { - type = "B"; - } else if (clazz == Long.TYPE) { - type = "J"; - } else if (clazz == Float.TYPE) { - type = "F"; - } else if (clazz == Double.TYPE) { - type = "D"; - } else if (clazz == Short.TYPE) { - type = "S"; - } else if (clazz == Character.TYPE) { - type = "C"; - } else if (clazz == Boolean.TYPE) { - type = "Z"; - } else if (clazz == Void.TYPE) { - type = "V"; - } - } else { - type = "L" + clazz.getName().replace('.', '/') + ";"; - } - return type; - } - - /* - * Compute the JVM method descriptor for the method. - */ - private static String getSignature(Method meth) { - StringBuffer sb = new StringBuffer(); - - sb.append("("); - - Class[] params = meth.getParameterTypes(); // avoid clone - for (int j = 0; j < params.length; j++) { - sb.append(getSignature(params[j])); - } - sb.append(")"); - sb.append(getSignature(meth.getReturnType())); - return sb.toString(); - } - - /* - * Compute the JVM constructor descriptor for the constructor. - */ - private static String getSignature(Constructor cons) { - StringBuffer sb = new StringBuffer(); - - sb.append("("); - - Class[] params = cons.getParameterTypes(); // avoid clone - for (int j = 0; j < params.length; j++) { - sb.append(getSignature(params[j])); - } - sb.append(")V"); - return sb.toString(); - } - - private static Field[] getDeclaredFields(final Class clz) { - return (Field[]) AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - return clz.getDeclaredFields(); - } - }); - } - - private static class MethodSignature implements Comparator { - Member member; - String signature; // cached parameter signature - - /* Given an array of Method or Constructor members, - return a sorted array of the non-private members.*/ - /* A better implementation would be to implement the returned data - structure as an insertion sorted link list.*/ - static MethodSignature[] removePrivateAndSort(Member[] m) { - int numNonPrivate = 0; - for (int i = 0; i < m.length; i++) { - if (! Modifier.isPrivate(m[i].getModifiers())) { - numNonPrivate++; - } - } - MethodSignature[] cm = new MethodSignature[numNonPrivate]; - int cmi = 0; - for (int i = 0; i < m.length; i++) { - if (! Modifier.isPrivate(m[i].getModifiers())) { - cm[cmi] = new MethodSignature(m[i]); - cmi++; - } - } - if (cmi > 0) - Arrays.sort(cm, cm[0]); - return cm; - } - - /* Assumes that o1 and o2 are either both methods - or both constructors.*/ - public int compare(Object o1, Object o2) { - /* Arrays.sort calls compare when o1 and o2 are equal.*/ - if (o1 == o2) - return 0; - - MethodSignature c1 = (MethodSignature)o1; - MethodSignature c2 = (MethodSignature)o2; - - int result; - if (isConstructor()) { - result = c1.signature.compareTo(c2.signature); - } else { // is a Method. - result = c1.member.getName().compareTo(c2.member.getName()); - if (result == 0) - result = c1.signature.compareTo(c2.signature); - } - return result; - } - - final private boolean isConstructor() { - return member instanceof Constructor; - } - private MethodSignature(Member m) { - member = m; - if (isConstructor()) { - signature = ObjectStreamClassUtil_1_3.getSignature((Constructor)m); - } else { - signature = ObjectStreamClassUtil_1_3.getSignature((Method)m); - } - } - } - - /* Find out if the class has a static class initializer */ - // use java.io.ObjectStream's hasStaticInitializer method - // private static native boolean hasStaticInitializer(Class cl); - - private static Method hasStaticInitializerMethod = null; - /** - * Returns true if the given class defines a static initializer method, - * false otherwise. - */ - private static boolean hasStaticInitializer(Class cl) { - if (hasStaticInitializerMethod == null) { - Class classWithThisMethod = null; - - try { - if (classWithThisMethod == null) - classWithThisMethod = java.io.ObjectStreamClass.class; - - hasStaticInitializerMethod = - classWithThisMethod.getDeclaredMethod("hasStaticInitializer", - new Class[] { Class.class }); - } catch (NoSuchMethodException ex) { - } - - if (hasStaticInitializerMethod == null) { - throw new InternalError("Can't find hasStaticInitializer method on " - + classWithThisMethod.getName()); - } - hasStaticInitializerMethod.setAccessible(true); - } - try { - Boolean retval = (Boolean) - hasStaticInitializerMethod.invoke(null, new Object[] { cl }); - return retval.booleanValue(); - } catch (Exception ex) { - throw new InternalError("Error invoking hasStaticInitializer: " - + ex); - } - } - - private static Method getDeclaredMethod(final Class cl, final String methodName, final Class[] args, - final int requiredModifierMask, - final int disallowedModifierMask) { - return (Method) AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - Method method = null; - try { - method = - cl.getDeclaredMethod(methodName, args); - int mods = method.getModifiers(); - if ((mods & disallowedModifierMask) != 0 || - (mods & requiredModifierMask) != requiredModifierMask) { - method = null; - } - //if (!Modifier.isPrivate(mods) || - // Modifier.isStatic(mods)) { - // method = null; - //} - } catch (NoSuchMethodException e) { - // Since it is alright if methodName does not exist, - // no need to do anything special here. - } - return method; - } - }); - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/ObjectStreamClass_1_3_1.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/ObjectStreamClass_1_3_1.java deleted file mode 100644 index 5188975ff76..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/ObjectStreamClass_1_3_1.java +++ /dev/null @@ -1,1262 +0,0 @@ -/* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.orbutil; - -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.security.DigestOutputStream; -import java.security.AccessController; -import java.security.PrivilegedExceptionAction; -import java.security.PrivilegedActionException; -import java.security.PrivilegedAction; - -import java.lang.reflect.Modifier; -import java.lang.reflect.Array; -import java.lang.reflect.Field; -import java.lang.reflect.Member; -import java.lang.reflect.Method; -import java.lang.reflect.Constructor; -import java.lang.reflect.Proxy; -import java.lang.reflect.InvocationTargetException; - -import java.io.IOException; -import java.io.DataOutputStream; -import java.io.ByteArrayOutputStream; -import java.io.InvalidClassException; -import java.io.Serializable; -import java.io.Externalizable; - -import java.util.Arrays; -import java.util.Comparator; -import java.util.Hashtable; - -import org.omg.CORBA.ValueMember; - -import com.sun.corba.se.impl.io.ValueUtility; -import com.sun.corba.se.impl.io.ObjectStreamClass; - -/** - * This is duplicated here to preserve the JDK 1.3.1FCS behavior - * of calculating the OMG hash code incorrectly when serialPersistentFields - * is used, but some of the fields no longer exist in the class itself. - * - * We have to duplicate it since we aren't allowed to modify the - * com.sun.corba.se.impl.io version further, and can't make it - * public outside of its package for security reasons. - */ -/** - * A ObjectStreamClass_1_3_1 describes a class that can be serialized to a stream - * or a class that was serialized to a stream. It contains the name - * and the serialVersionUID of the class. - *
            - * The ObjectStreamClass_1_3_1 for a specific class loaded in this Java VM can - * be found using the lookup method. - * - * @author Roger Riggs - * @since JDK1.1 - */ -public class ObjectStreamClass_1_3_1 implements java.io.Serializable { - - public static final long kDefaultUID = -1; - - private static Object noArgsList[] = {}; - private static Class noTypesList[] = {}; - - private static Hashtable translatedFields; - - /** Find the descriptor for a class that can be serialized. Null - * is returned if the specified class does not implement - * java.io.Serializable or java.io.Externalizable. - */ - static final ObjectStreamClass_1_3_1 lookup(Class cl) - { - ObjectStreamClass_1_3_1 desc = lookupInternal(cl); - if (desc.isSerializable() || desc.isExternalizable()) - return desc; - return null; - } - - /* - * Find the class descriptor for the specified class. - * Package access only so it can be called from ObjectIn/OutStream. - */ - static ObjectStreamClass_1_3_1 lookupInternal(Class cl) - { - /* Synchronize on the hashtable so no two threads will do - * this at the same time. - */ - ObjectStreamClass_1_3_1 desc = null; - synchronized (descriptorFor) { - /* Find the matching descriptor if it already known */ - desc = findDescriptorFor(cl); - if (desc != null) { - return desc; - } - - /* Check if it's serializable */ - boolean serializable = Serializable.class.isAssignableFrom(cl); - /* If the class is only Serializable, - * lookup the descriptor for the superclass. - */ - ObjectStreamClass_1_3_1 superdesc = null; - if (serializable) { - Class superclass = cl.getSuperclass(); - if (superclass != null) - superdesc = lookup(superclass); - } - - /* Check if its' externalizable. - * If it's Externalizable, clear the serializable flag. - * Only one or the other may be set in the protocol. - */ - boolean externalizable = false; - if (serializable) { - externalizable = - ((superdesc != null) && superdesc.isExternalizable()) || - Externalizable.class.isAssignableFrom(cl); - if (externalizable) { - serializable = false; - } - } - - /* Create a new version descriptor, - * it put itself in the known table. - */ - desc = new ObjectStreamClass_1_3_1(cl, superdesc, - serializable, externalizable); - } - desc.init(); - return desc; - } - - /** - * The name of the class described by this descriptor. - */ - public final String getName() { - return name; - } - - /** - * Return the serialVersionUID for this class. - * The serialVersionUID defines a set of classes all with the same name - * that have evolved from a common root class and agree to be serialized - * and deserialized using a common format. - */ - public static final long getSerialVersionUID( java.lang.Class clazz) { - ObjectStreamClass_1_3_1 theosc = ObjectStreamClass_1_3_1.lookup( clazz ); - if( theosc != null ) - { - return theosc.getSerialVersionUID( ); - } - return 0; - } - - /** - * Return the serialVersionUID for this class. - * The serialVersionUID defines a set of classes all with the same name - * that have evolved from a common root class and agree to be serialized - * and deserialized using a common format. - */ - public final long getSerialVersionUID() { - return suid; - } - - /** - * Return the serialVersionUID string for this class. - * The serialVersionUID defines a set of classes all with the same name - * that have evolved from a common root class and agree to be serialized - * and deserialized using a common format. - */ - public final String getSerialVersionUIDStr() { - if (suidStr == null) - suidStr = Long.toHexString(suid).toUpperCase(); - return suidStr; - } - - /** - * Return the actual (computed) serialVersionUID for this class. - */ - public static final long getActualSerialVersionUID( java.lang.Class clazz ) - { - ObjectStreamClass_1_3_1 theosc = ObjectStreamClass_1_3_1.lookup( clazz ); - if( theosc != null ) - { - return theosc.getActualSerialVersionUID( ); - } - return 0; - } - - /** - * Return the actual (computed) serialVersionUID for this class. - */ - public final long getActualSerialVersionUID() { - return actualSuid; - } - - /** - * Return the actual (computed) serialVersionUID for this class. - */ - public final String getActualSerialVersionUIDStr() { - if (actualSuidStr == null) - actualSuidStr = Long.toHexString(actualSuid).toUpperCase(); - return actualSuidStr; - } - - /** - * Return the class in the local VM that this version is mapped to. - * Null is returned if there is no corresponding local class. - */ - public final Class forClass() { - return ofClass; - } - - /** - * Return an array of the fields of this serializable class. - * @return an array containing an element for each persistent - * field of this class. Returns an array of length zero if - * there are no fields. - * @since JDK1.2 - */ - public ObjectStreamField[] getFields() { - // Return a copy so the caller can't change the fields. - if (fields.length > 0) { - ObjectStreamField[] dup = new ObjectStreamField[fields.length]; - System.arraycopy(fields, 0, dup, 0, fields.length); - return dup; - } else { - return fields; - } - } - - public boolean hasField(ValueMember field){ - - for (int i = 0; i < fields.length; i++){ - try{ - if (fields[i].getName().equals(field.name)) { - - if (fields[i].getSignature().equals(ValueUtility.getSignature(field))) - return true; - } - } - catch(Throwable t){} - } - return false; - } - - /* Avoid unnecessary allocations. */ - final ObjectStreamField[] getFieldsNoCopy() { - return fields; - } - - /** - * Get the field of this class by name. - * @return The ObjectStreamField object of the named field or null if there - * is no such named field. - */ - public final ObjectStreamField getField(String name) { - /* Binary search of fields by name. - */ - for (int i = fields.length-1; i >= 0; i--) { - if (name.equals(fields[i].getName())) { - return fields[i]; - } - } - return null; - } - - public Serializable writeReplace(Serializable value) { - if (writeReplaceObjectMethod != null) { - try { - return (Serializable) writeReplaceObjectMethod.invoke(value,noArgsList); - } - catch(Throwable t) { - throw new RuntimeException(t.getMessage()); - } - } - else return value; - } - - public Object readResolve(Object value) { - if (readResolveObjectMethod != null) { - try { - return readResolveObjectMethod.invoke(value,noArgsList); - } - catch(Throwable t) { - throw new RuntimeException(t.getMessage()); - } - } - else return value; - } - - /** - * Return a string describing this ObjectStreamClass_1_3_1. - */ - public final String toString() { - StringBuffer sb = new StringBuffer(); - - sb.append(name); - sb.append(": static final long serialVersionUID = "); - sb.append(Long.toString(suid)); - sb.append("L;"); - return sb.toString(); - } - - /* - * Create a new ObjectStreamClass_1_3_1 from a loaded class. - * Don't call this directly, call lookup instead. - */ - private ObjectStreamClass_1_3_1(java.lang.Class cl, ObjectStreamClass_1_3_1 superdesc, - boolean serial, boolean extern) - { - ofClass = cl; /* created from this class */ - - if (Proxy.isProxyClass(cl)) { - forProxyClass = true; - } - - name = cl.getName(); - superclass = superdesc; - serializable = serial; - if (!forProxyClass) { - // proxy classes are never externalizable - externalizable = extern; - } - - /* - * Enter this class in the table of known descriptors. - * Otherwise, when the fields are read it may recurse - * trying to find the descriptor for itself. - */ - insertDescriptorFor(this); - - /* - * The remainder of initialization occurs in init(), which is called - * after the lock on the global class descriptor table has been - * released. - */ - } - - /* - * Initialize class descriptor. This method is only invoked on class - * descriptors created via calls to lookupInternal(). This method is kept - * separate from the ObjectStreamClass_1_3_1 constructor so that lookupInternal - * does not have to hold onto a global class descriptor table lock while the - * class descriptor is being initialized (see bug 4165204). - */ - - - private void init() { - synchronized (lock) { - - final Class cl = ofClass; - - if (fields != null) // already initialized - return; - - - if (!serializable || - externalizable || - forProxyClass || - name.equals("java.lang.String")) { - fields = NO_FIELDS; - } else if (serializable) { - - /* Ask for permission to override field access checks. - */ - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - /* Fill in the list of persistent fields. - * If it is declared, use the declared serialPersistentFields. - * Otherwise, extract the fields from the class itself. - */ - try { - Field pf = cl.getDeclaredField("serialPersistentFields"); - // serial bug 7; the serialPersistentFields were not - // being read and stored as Accessible bit was not set - pf.setAccessible(true); - // serial bug 7; need to find if the field is of type - // java.io.ObjectStreamField - java.io.ObjectStreamField[] f = - (java.io.ObjectStreamField[])pf.get(cl); - int mods = pf.getModifiers(); - if ((Modifier.isPrivate(mods)) && - (Modifier.isStatic(mods)) && - (Modifier.isFinal(mods))) - { - fields = (ObjectStreamField[])translateFields((Object[])pf.get(cl)); - } - } catch (NoSuchFieldException e) { - fields = null; - } catch (IllegalAccessException e) { - fields = null; - } catch (IllegalArgumentException e) { - fields = null; - } catch (ClassCastException e) { - /* Thrown if a field serialPersistentField exists - * but it is not of type ObjectStreamField. - */ - fields = null; - } - - - if (fields == null) { - /* Get all of the declared fields for this - * Class. setAccessible on all fields so they - * can be accessed later. Create a temporary - * ObjectStreamField array to hold each - * non-static, non-transient field. Then copy the - * temporary array into an array of the correct - * size once the number of fields is known. - */ - Field[] actualfields = cl.getDeclaredFields(); - - int numFields = 0; - ObjectStreamField[] tempFields = - new ObjectStreamField[actualfields.length]; - for (int i = 0; i < actualfields.length; i++) { - int modifiers = actualfields[i].getModifiers(); - if (!Modifier.isStatic(modifiers) && - !Modifier.isTransient(modifiers)) { - tempFields[numFields++] = - new ObjectStreamField(actualfields[i]); - } - } - fields = new ObjectStreamField[numFields]; - System.arraycopy(tempFields, 0, fields, 0, numFields); - - } else { - // For each declared persistent field, look for an actual - // reflected Field. If there is one, make sure it's the correct - // type and cache it in the ObjectStreamClass_1_3_1 for that field. - for (int j = fields.length-1; j >= 0; j--) { - try { - Field reflField = cl.getDeclaredField(fields[j].getName()); - if (fields[j].getType() == reflField.getType()) { - // reflField.setAccessible(true); - fields[j].setField(reflField); - } - } catch (NoSuchFieldException e) { - // Nothing to do - } - } - } - return null; - } - }); - - if (fields.length > 1) - Arrays.sort(fields); - - /* Set up field data for use while writing using the API api. */ - computeFieldInfo(); - } - - /* Get the serialVersionUID from the class. - * It uses the access override mechanism so make sure - * the field objects is only used here. - * - * NonSerializable classes have a serialVerisonUID of 0L. - */ - if (isNonSerializable()) { - suid = 0L; - } else { - // Lookup special Serializable members using reflection. - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - if (forProxyClass) { - // proxy classes always have serialVersionUID of 0L - suid = 0L; - } else { - try { - final Field f = cl.getDeclaredField("serialVersionUID"); - int mods = f.getModifiers(); - // SerialBug 5: static final SUID should be read - if (Modifier.isStatic(mods) && - Modifier.isFinal(mods) ) { - f.setAccessible(true); - suid = f.getLong(cl); - // get rid of native code - // suid = getSerialVersionUIDField(cl); - // SerialBug 2: should be computed after writeObject - // actualSuid = computeStructuralUID(cl); - } else { - suid = ObjectStreamClass.getSerialVersionUID(cl); - // SerialBug 2: should be computed after writeObject - // actualSuid = computeStructuralUID(cl); - } - } catch (NoSuchFieldException ex) { - suid = ObjectStreamClass.getSerialVersionUID(cl); - // SerialBug 2: should be computed after writeObject - // actualSuid = computeStructuralUID(cl); - } catch (IllegalAccessException ex) { - suid = ObjectStreamClass.getSerialVersionUID(cl); - } - } - - - try { - writeReplaceObjectMethod = cl.getDeclaredMethod("writeReplace", noTypesList); - if (Modifier.isStatic(writeReplaceObjectMethod.getModifiers())) { - writeReplaceObjectMethod = null; - } else { - writeReplaceObjectMethod.setAccessible(true); - } - - } catch (NoSuchMethodException e2) { - - } - - try { - readResolveObjectMethod = cl.getDeclaredMethod("readResolve", noTypesList); - if (Modifier.isStatic(readResolveObjectMethod.getModifiers())) { - readResolveObjectMethod = null; - } else { - readResolveObjectMethod.setAccessible(true); - } - - } catch (NoSuchMethodException e2) { - - } - - /* Cache lookup of writeObject and readObject for - * Serializable classes. (Do not lookup for - * Externalizable) - */ - - if (serializable && !forProxyClass) { - - /* Look for the writeObject method - * Set the accessible flag on it here. ObjectOutputStream - * will call it as necessary. - */ - try { - Class[] args = {java.io.ObjectOutputStream.class}; - writeObjectMethod = cl.getDeclaredMethod("writeObject", args); - hasWriteObjectMethod = true; - int mods = writeObjectMethod.getModifiers(); - - // Method must be private and non-static - if (!Modifier.isPrivate(mods) || - Modifier.isStatic(mods)) { - writeObjectMethod = null; - hasWriteObjectMethod = false; - } - - } catch (NoSuchMethodException e) { - } - - /* Look for the readObject method - * set the access override and save the reference for - * ObjectInputStream so it can all the method directly. - */ - try { - Class[] args = {java.io.ObjectInputStream.class}; - readObjectMethod = cl.getDeclaredMethod("readObject", args); - int mods = readObjectMethod.getModifiers(); - - // Method must be private and non-static - if (!Modifier.isPrivate(mods) || - Modifier.isStatic(mods)) { - readObjectMethod = null; - } - } catch (NoSuchMethodException e) { - } - // Compute the structural UID. This must be done after the - // calculation for writeObject. Fixed 4/20/2000, eea1 - // SerialBug 2: to have correct value in RepId - } - return null; - } - }); - } - - actualSuid = computeStructuralUID(this, cl); - } - - } - - /* - * Create an empty ObjectStreamClass_1_3_1 for a class about to be read. - * This is separate from read so ObjectInputStream can assign the - * wire handle early, before any nested ObjectStreamClass_1_3_1 might - * be read. - */ - ObjectStreamClass_1_3_1(String n, long s) { - name = n; - suid = s; - superclass = null; - } - - private static Object[] translateFields(Object objs[]) - throws NoSuchFieldException { - try{ - java.io.ObjectStreamField fields[] = (java.io.ObjectStreamField[])objs; - Object translation[] = null; - - if (translatedFields == null) - translatedFields = new Hashtable(); - - translation = (Object[])translatedFields.get(fields); - - if (translation != null) - return translation; - else { - Class osfClass = com.sun.corba.se.impl.orbutil.ObjectStreamField.class; - - translation = (Object[])java.lang.reflect.Array.newInstance(osfClass, objs.length); - Object arg[] = new Object[2]; - Class types[] = {String.class, Class.class}; - Constructor constructor = osfClass.getDeclaredConstructor(types); - for (int i = fields.length -1; i >= 0; i--){ - arg[0] = fields[i].getName(); - arg[1] = fields[i].getType(); - - translation[i] = constructor.newInstance(arg); - } - translatedFields.put(fields, translation); - - } - - return (Object[])translation; - } - catch(Throwable t){ - throw new NoSuchFieldException(); - } - } - - /* Compare the base class names of streamName and localName. - * - * @return Return true iff the base class name compare. - * @param streamName Fully qualified class name. - * @param localName Fully qualified class name. - * @param pkgSeparator class names use either '.' or '/'. - * - * Only compare base class name to allow package renaming. - */ - static boolean compareClassNames(String streamName, - String localName, - char pkgSeparator) { - /* compare the class names, stripping off package names. */ - int streamNameIndex = streamName.lastIndexOf(pkgSeparator); - if (streamNameIndex < 0) - streamNameIndex = 0; - - int localNameIndex = localName.lastIndexOf(pkgSeparator); - if (localNameIndex < 0) - localNameIndex = 0; - - return streamName.regionMatches(false, streamNameIndex, - localName, localNameIndex, - streamName.length() - streamNameIndex); - } - - /* - * Compare the types of two class descriptors. - * They match if they have the same class name and suid - */ - final boolean typeEquals(ObjectStreamClass_1_3_1 other) { - return (suid == other.suid) && - compareClassNames(name, other.name, '.'); - } - - /* - * Return the superclass descriptor of this descriptor. - */ - final void setSuperclass(ObjectStreamClass_1_3_1 s) { - superclass = s; - } - - /* - * Return the superclass descriptor of this descriptor. - */ - final ObjectStreamClass_1_3_1 getSuperclass() { - return superclass; - } - - /* - * Return whether the class has a writeObject method - */ - final boolean hasWriteObject() { - return hasWriteObjectMethod; - } - - final boolean isCustomMarshaled() { - return (hasWriteObject() || isExternalizable()); - } - - /* - * Return true if all instances of 'this' Externalizable class - * are written in block-data mode from the stream that 'this' was read - * from.

            - * - * In JDK 1.1, all Externalizable instances are not written - * in block-data mode. - * In JDK 1.2, all Externalizable instances, by default, are written - * in block-data mode and the Externalizable instance is terminated with - * tag TC_ENDBLOCKDATA. Change enabled the ability to skip Externalizable - * instances. - * - * IMPLEMENTATION NOTE: - * This should have been a mode maintained per stream; however, - * for compatibility reasons, it was only possible to record - * this change per class. All Externalizable classes within - * a given stream should either have this mode enabled or - * disabled. This is enforced by not allowing the PROTOCOL_VERSION - * of a stream to he changed after any objects have been written. - * - * @see ObjectOutputStream#useProtocolVersion - * @see ObjectStreamConstants#PROTOCOL_VERSION_1 - * @see ObjectStreamConstants#PROTOCOL_VERSION_2 - * - * @since JDK 1.2 - */ - boolean hasExternalizableBlockDataMode() { - return hasExternalizableBlockData; - } - - /* - * Return the ObjectStreamClass_1_3_1 of the local class this one is based on. - */ - final ObjectStreamClass_1_3_1 localClassDescriptor() { - return localClassDesc; - } - - /* - * Get the Serializability of the class. - */ - boolean isSerializable() { - return serializable; - } - - /* - * Get the externalizability of the class. - */ - boolean isExternalizable() { - return externalizable; - } - - boolean isNonSerializable() { - return ! (externalizable || serializable); - } - - /* - * Calculate the size of the array needed to store primitive data and the - * number of object references to read when reading from the input - * stream. - */ - private void computeFieldInfo() { - primBytes = 0; - objFields = 0; - - for (int i = 0; i < fields.length; i++ ) { - switch (fields[i].getTypeCode()) { - case 'B': - case 'Z': - primBytes += 1; - break; - case 'C': - case 'S': - primBytes += 2; - break; - - case 'I': - case 'F': - primBytes += 4; - break; - case 'J': - case 'D' : - primBytes += 8; - break; - - case 'L': - case '[': - objFields += 1; - break; - } - } - } - - private static long computeStructuralUID(ObjectStreamClass_1_3_1 osc, Class cl) { - ByteArrayOutputStream devnull = new ByteArrayOutputStream(512); - - long h = 0; - try { - - if ((!java.io.Serializable.class.isAssignableFrom(cl)) || - (cl.isInterface())){ - return 0; - } - - if (java.io.Externalizable.class.isAssignableFrom(cl)) { - return 1; - } - - MessageDigest md = MessageDigest.getInstance("SHA"); - DigestOutputStream mdo = new DigestOutputStream(devnull, md); - DataOutputStream data = new DataOutputStream(mdo); - - // Get SUID of parent - Class parent = cl.getSuperclass(); - if ((parent != null)) - // SerialBug 1; acc. to spec the one for - // java.lang.object - // should be computed and put - // && (parent != java.lang.Object.class)) - { - //data.writeLong(computeSerialVersionUID(null,parent)); - data.writeLong(computeStructuralUID(lookup(parent), parent)); - } - - if (osc.hasWriteObject()) - data.writeInt(2); - else - data.writeInt(1); - - /* Sort the field names to get a deterministic order */ - // Field[] field = ObjectStreamClass_1_3_1.getDeclaredFields(cl); - - ObjectStreamField[] fields = osc.getFields(); - - // Must make sure that the Field array we allocate - // below is exactly the right size. Bug fix for - // 4397133. - int numNonNullFields = 0; - for (int i = 0; i < fields.length; i++) - if (fields[i].getField() != null) - numNonNullFields++; - - Field [] field = new java.lang.reflect.Field[numNonNullFields]; - for (int i = 0, fieldNum = 0; i < fields.length; i++) { - if (fields[i].getField() != null) { - field[fieldNum++] = fields[i].getField(); - } - } - - if (field.length > 1) - Arrays.sort(field, compareMemberByName); - - for (int i = 0; i < field.length; i++) { - Field f = field[i]; - - /* Include in the hash all fields except those that are - * transient - */ - int m = f.getModifiers(); - //Serial 6 - //if (Modifier.isTransient(m) || Modifier.isStatic(m)) - // spec reference 00-01-06.pdf, 1.3.5.6, states non-static - // non-transient, public fields are mapped to Java IDL. - // - // Here's the quote from the first paragraph: - // Java non-static non-transient public fields are mapped to - // OMG IDL public data members, and other Java fields are - // not mapped. - - // if (Modifier.isTransient(m) || Modifier.isStatic(m)) - // continue; - - data.writeUTF(f.getName()); - data.writeUTF(getSignature(f.getType())); - } - - /* Compute the hash value for this class. - * Use only the first 64 bits of the hash. - */ - data.flush(); - byte hasharray[] = md.digest(); - // int minimum = Math.min(8, hasharray.length); - // SerialBug 3: SHA computation is wrong; for loop reversed - //for (int i = minimum; i > 0; i--) - for (int i = 0; i < Math.min(8, hasharray.length); i++) { - h += (long)(hasharray[i] & 255) << (i * 8); - } - } catch (IOException ignore) { - /* can't happen, but be deterministic anyway. */ - h = -1; - } catch (NoSuchAlgorithmException complain) { - throw new SecurityException(complain.getMessage()); - } - return h; - } - - /** - * Compute the JVM signature for the class. - */ - static String getSignature(Class clazz) { - String type = null; - if (clazz.isArray()) { - Class cl = clazz; - int dimensions = 0; - while (cl.isArray()) { - dimensions++; - cl = cl.getComponentType(); - } - StringBuffer sb = new StringBuffer(); - for (int i = 0; i < dimensions; i++) { - sb.append("["); - } - sb.append(getSignature(cl)); - type = sb.toString(); - } else if (clazz.isPrimitive()) { - if (clazz == Integer.TYPE) { - type = "I"; - } else if (clazz == Byte.TYPE) { - type = "B"; - } else if (clazz == Long.TYPE) { - type = "J"; - } else if (clazz == Float.TYPE) { - type = "F"; - } else if (clazz == Double.TYPE) { - type = "D"; - } else if (clazz == Short.TYPE) { - type = "S"; - } else if (clazz == Character.TYPE) { - type = "C"; - } else if (clazz == Boolean.TYPE) { - type = "Z"; - } else if (clazz == Void.TYPE) { - type = "V"; - } - } else { - type = "L" + clazz.getName().replace('.', '/') + ";"; - } - return type; - } - - /* - * Compute the JVM method descriptor for the method. - */ - static String getSignature(Method meth) { - StringBuffer sb = new StringBuffer(); - - sb.append("("); - - Class[] params = meth.getParameterTypes(); // avoid clone - for (int j = 0; j < params.length; j++) { - sb.append(getSignature(params[j])); - } - sb.append(")"); - sb.append(getSignature(meth.getReturnType())); - return sb.toString(); - } - - /* - * Compute the JVM constructor descriptor for the constructor. - */ - static String getSignature(Constructor cons) { - StringBuffer sb = new StringBuffer(); - - sb.append("("); - - Class[] params = cons.getParameterTypes(); // avoid clone - for (int j = 0; j < params.length; j++) { - sb.append(getSignature(params[j])); - } - sb.append(")V"); - return sb.toString(); - } - - /* - * Cache of Class -> ClassDescriptor Mappings. - */ - static private ObjectStreamClassEntry[] descriptorFor = new ObjectStreamClassEntry[61]; - - /* - * findDescriptorFor a Class. This looks in the cache for a - * mapping from Class -> ObjectStreamClass mappings. The hashCode - * of the Class is used for the lookup since the Class is the key. - * The entries are extended from java.lang.ref.SoftReference so the - * gc will be able to free them if needed. - */ - private static ObjectStreamClass_1_3_1 findDescriptorFor(Class cl) { - - int hash = cl.hashCode(); - int index = (hash & 0x7FFFFFFF) % descriptorFor.length; - ObjectStreamClassEntry e; - ObjectStreamClassEntry prev; - - /* Free any initial entries whose refs have been cleared */ - while ((e = descriptorFor[index]) != null && e.get() == null) { - descriptorFor[index] = e.next; - } - - /* Traverse the chain looking for a descriptor with ofClass == cl. - * unlink entries that are unresolved. - */ - prev = e; - while (e != null ) { - ObjectStreamClass_1_3_1 desc = (ObjectStreamClass_1_3_1)(e.get()); - if (desc == null) { - // This entry has been cleared, unlink it - prev.next = e.next; - } else { - if (desc.ofClass == cl) - return desc; - prev = e; - } - e = e.next; - } - return null; - } - - /* - * insertDescriptorFor a Class -> ObjectStreamClass_1_3_1 mapping. - */ - private static void insertDescriptorFor(ObjectStreamClass_1_3_1 desc) { - // Make sure not already present - if (findDescriptorFor(desc.ofClass) != null) { - return; - } - - int hash = desc.ofClass.hashCode(); - int index = (hash & 0x7FFFFFFF) % descriptorFor.length; - ObjectStreamClassEntry e = new ObjectStreamClassEntry(desc); - e.next = descriptorFor[index]; - descriptorFor[index] = e; - } - - private static Field[] getDeclaredFields(final Class clz) { - return (Field[]) AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - return clz.getDeclaredFields(); - } - }); - } - - - /* - * The name of this descriptor - */ - private String name; - - /* - * The descriptor of the supertype. - */ - private ObjectStreamClass_1_3_1 superclass; - - /* - * Flags for Serializable and Externalizable. - */ - private boolean serializable; - private boolean externalizable; - - /* - * Array of persistent fields of this class, sorted by - * type and name. - */ - private ObjectStreamField[] fields; - - /* - * Class that is a descriptor for in this virtual machine. - */ - private Class ofClass; - - /* - * True if descriptor for a proxy class. - */ - boolean forProxyClass; - - - /* - * SerialVersionUID for this class. - */ - private long suid = kDefaultUID; - private String suidStr = null; - - /* - * Actual (computed) SerialVersionUID for this class. - */ - private long actualSuid = kDefaultUID; - private String actualSuidStr = null; - - /* - * The total number of bytes of primitive fields. - * The total number of object fields. - */ - int primBytes; - int objFields; - - /* Internal lock object. */ - private Object lock = new Object(); - - /* True if this class has/had a writeObject method */ - private boolean hasWriteObjectMethod; - - /* In JDK 1.1, external data was not written in block mode. - * As of JDK 1.2, external data is written in block data mode. This - * flag enables JDK 1.2 to be able to read JDK 1.1 written external data. - * - * @since JDK 1.2 - */ - private boolean hasExternalizableBlockData; - Method writeObjectMethod; - Method readObjectMethod; - private transient Method writeReplaceObjectMethod; - private transient Method readResolveObjectMethod; - - /* - * ObjectStreamClass_1_3_1 that this one was built from. - */ - private ObjectStreamClass_1_3_1 localClassDesc; - - /* Get the private static final field for serial version UID */ - // private static native long getSerialVersionUIDField(Class cl); - - /** use serialVersionUID from JDK 1.1. for interoperability */ - private static final long serialVersionUID = -6120832682080437368L; - - /** - * Set serialPersistentFields of a Serializable class to this value to - * denote that the class has no Serializable fields. - */ - public static final ObjectStreamField[] NO_FIELDS = - new ObjectStreamField[0]; - - /* - * Entries held in the Cache of known ObjectStreamClass_1_3_1 objects. - * Entries are chained together with the same hash value (modulo array size). - */ - private static class ObjectStreamClassEntry // extends java.lang.ref.SoftReference - { - ObjectStreamClassEntry(ObjectStreamClass_1_3_1 c) { - //super(c); - this.c = c; - } - ObjectStreamClassEntry next; - - public Object get() - { - return c; - } - private ObjectStreamClass_1_3_1 c; - } - - /* - * Comparator object for Classes and Interfaces - */ - private static Comparator compareClassByName = - new CompareClassByName(); - - private static class CompareClassByName implements Comparator { - public int compare(Object o1, Object o2) { - Class c1 = (Class)o1; - Class c2 = (Class)o2; - return (c1.getName()).compareTo(c2.getName()); - } - } - - /* - * Comparator object for Members, Fields, and Methods - */ - private static Comparator compareMemberByName = - new CompareMemberByName(); - - private static class CompareMemberByName implements Comparator { - public int compare(Object o1, Object o2) { - String s1 = ((Member)o1).getName(); - String s2 = ((Member)o2).getName(); - - if (o1 instanceof Method) { - s1 += getSignature((Method)o1); - s2 += getSignature((Method)o2); - } else if (o1 instanceof Constructor) { - s1 += getSignature((Constructor)o1); - s2 += getSignature((Constructor)o2); - } - return s1.compareTo(s2); - } - } - - /* It is expensive to recompute a method or constructor signature - many times, so compute it only once using this data structure. */ - private static class MethodSignature implements Comparator { - Member member; - String signature; // cached parameter signature - - /* Given an array of Method or Constructor members, - return a sorted array of the non-private members.*/ - /* A better implementation would be to implement the returned data - structure as an insertion sorted link list.*/ - static MethodSignature[] removePrivateAndSort(Member[] m) { - int numNonPrivate = 0; - for (int i = 0; i < m.length; i++) { - if (! Modifier.isPrivate(m[i].getModifiers())) { - numNonPrivate++; - } - } - MethodSignature[] cm = new MethodSignature[numNonPrivate]; - int cmi = 0; - for (int i = 0; i < m.length; i++) { - if (! Modifier.isPrivate(m[i].getModifiers())) { - cm[cmi] = new MethodSignature(m[i]); - cmi++; - } - } - if (cmi > 0) - Arrays.sort(cm, cm[0]); - return cm; - } - - /* Assumes that o1 and o2 are either both methods - or both constructors.*/ - public int compare(Object o1, Object o2) { - /* Arrays.sort calls compare when o1 and o2 are equal.*/ - if (o1 == o2) - return 0; - - MethodSignature c1 = (MethodSignature)o1; - MethodSignature c2 = (MethodSignature)o2; - - int result; - if (isConstructor()) { - result = c1.signature.compareTo(c2.signature); - } else { // is a Method. - result = c1.member.getName().compareTo(c2.member.getName()); - if (result == 0) - result = c1.signature.compareTo(c2.signature); - } - return result; - } - - final private boolean isConstructor() { - return member instanceof Constructor; - } - private MethodSignature(Member m) { - member = m; - if (isConstructor()) { - signature = ObjectStreamClass_1_3_1.getSignature((Constructor)m); - } else { - signature = ObjectStreamClass_1_3_1.getSignature((Method)m); - } - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/ObjectStreamField.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/ObjectStreamField.java deleted file mode 100644 index e86b26825e5..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/ObjectStreamField.java +++ /dev/null @@ -1,270 +0,0 @@ -/* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.orbutil; - -import java.lang.reflect.Field; -import java.lang.Comparable; -import java.util.Hashtable; - -/** - * This is duplicated here somewhat in haste since we can't - * expose this class outside of the com.sun.corba.se.impl.io - * package for security reasons. - */ -/** - * A description of a field in a serializable class. - * A array of these is used to declare the persistent fields of - * a class. - * - */ -class ObjectStreamField implements Comparable { - /** - * Create a named field with the specified type. - */ - ObjectStreamField(String n, Class clazz) { - name = n; - this.clazz = clazz; - - // Compute the typecode for easy switching - if (clazz.isPrimitive()) { - if (clazz == Integer.TYPE) { - type = 'I'; - } else if (clazz == Byte.TYPE) { - type = 'B'; - } else if (clazz == Long.TYPE) { - type = 'J'; - } else if (clazz == Float.TYPE) { - type = 'F'; - } else if (clazz == Double.TYPE) { - type = 'D'; - } else if (clazz == Short.TYPE) { - type = 'S'; - } else if (clazz == Character.TYPE) { - type = 'C'; - } else if (clazz == Boolean.TYPE) { - type = 'Z'; - } - } else if (clazz.isArray()) { - type = '['; - typeString = ObjectStreamClass_1_3_1.getSignature(clazz); - } else { - type = 'L'; - typeString = ObjectStreamClass_1_3_1.getSignature(clazz); - } - - if (typeString != null) - signature = typeString; - else - signature = String.valueOf(type); - - } - - ObjectStreamField(Field field) { - this(field.getName(), field.getType()); - this.field = field; - } - - /** - * Create an ObjectStreamField containing a reflected Field. - */ - ObjectStreamField(String n, char t, Field f, String ts) - { - name = n; - type = t; - field = f; - typeString = ts; - - if (typeString != null) - signature = typeString; - else - signature = String.valueOf(type); - - } - - /** - * Get the name of this field. - */ - public String getName() { - return name; - } - - /** - * Get the type of the field. - */ - public Class getType() { - if (clazz != null) - return clazz; - switch (type) { - case 'B': clazz = Byte.TYPE; - break; - case 'C': clazz = Character.TYPE; - break; - case 'S': clazz = Short.TYPE; - break; - case 'I': clazz = Integer.TYPE; - break; - case 'J': clazz = Long.TYPE; - break; - case 'F': clazz = Float.TYPE; - break; - case 'D': clazz = Double.TYPE; - break; - case 'Z': clazz = Boolean.TYPE; - break; - case '[': - case 'L': - clazz = Object.class; - break; - } - - return clazz; - } - - public char getTypeCode() { - return type; - } - - public String getTypeString() { - return typeString; - } - - Field getField() { - return field; - } - - void setField(Field field) { - this.field = field; - this.fieldID = -1; - } - - /* - * Default constructor creates an empty field. - * Usually used just to get to the sort functions. - */ - ObjectStreamField() { - } - - /** - * test if this field is a primitive or not. - */ - public boolean isPrimitive() { - return (type != '[' && type != 'L'); - } - - /** - * Compare this with another ObjectStreamField. - * return -1 if this is smaller, 0 if equal, 1 if greater - * types that are primitives are "smaller" than objects. - * if equal, the names are compared. - */ - public int compareTo(Object o) { - ObjectStreamField f2 = (ObjectStreamField)o; - boolean thisprim = (this.typeString == null); - boolean otherprim = (f2.typeString == null); - - if (thisprim != otherprim) { - return (thisprim ? -1 : 1); - } - return this.name.compareTo(f2.name); - } - - /** - * Compare the types of two class descriptors. - * The match if they have the same primitive types. - * or if they are both objects and the object types match. - */ - public boolean typeEquals(ObjectStreamField other) { - if (other == null || type != other.type) - return false; - - /* Return true if the primitive types matched */ - if (typeString == null && other.typeString == null) - return true; - - return ObjectStreamClass_1_3_1.compareClassNames(typeString, - other.typeString, - '/'); - } - - /* Returns the signature of the Field. - * - */ - public String getSignature() { - - return signature; - - } - - /** - * Return a string describing this field. - */ - public String toString() { - if (typeString != null) - return typeString + " " + name; - else - return type + " " + name; - } - - public Class getClazz() { - return clazz; - } - - /* Returns the Field ID - * NOT USED, since this class is used only in ObjectStreamClass_1_3_1, - * which is used only in RepositoryId_1_3_1. - public long getFieldID( Class cl ) { - if (fieldID == -1) { - if (typeString != null) - fieldID = getFieldIDNative( cl, getName(), typeString ); - else - fieldID = getFieldIDNative( cl, getName(), getSignature() ); - } - return fieldID; - } - */ - - private String name; // the name of the field - private char type; // type first byte of the type signature - private Field field; // Reflected field - private String typeString; // iff object, typename - private Class clazz; // the type of this field, if has been resolved - - // the next 3 things are RMI-IIOP specific, it can be easily - // removed, if we can figure out all place where there are dependencies - // to this. Signature is esentially equal to typestring. Then - // essentially we can use the java.io.ObjectStreamField as such. - - private String signature; // the signature of the field - private long fieldID = -1; - // private static native long getFieldIDNative(Class c, String fieldName, String fieldSig); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/ObjectUtility.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/ObjectUtility.java deleted file mode 100644 index 237ef2258c8..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/ObjectUtility.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil; - -import java.security.PrivilegedAction; -import java.security.AccessController; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Map; -import java.util.List; -import java.util.ListIterator; -import java.util.Set; -import java.util.Map.Entry; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.Enumeration; -import java.util.Properties; -import java.util.IdentityHashMap; -import java.lang.reflect.Array; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.math.BigInteger ; -import java.math.BigDecimal ; - -public final class ObjectUtility { - private ObjectUtility() {} - - - /** If arr1 and arr2 are both arrays of the same component type, - * return an array of that component type that consists of the - * elements of arr1 followed by the elements of arr2. - * Throws IllegalArgumentException otherwise. - */ - public static Object concatenateArrays( Object arr1, Object arr2 ) - { - Class comp1 = arr1.getClass().getComponentType() ; - Class comp2 = arr2.getClass().getComponentType() ; - int len1 = Array.getLength( arr1 ) ; - int len2 = Array.getLength( arr2 ) ; - - if ((comp1 == null) || (comp2 == null)) - throw new IllegalStateException( "Arguments must be arrays" ) ; - if (!comp1.equals( comp2 )) - throw new IllegalStateException( - "Arguments must be arrays with the same component type" ) ; - - Object result = Array.newInstance( comp1, len1 + len2 ) ; - - int index = 0 ; - - for (int ctr=0; ctr" ) ; - Class compClass = obj.getClass().getComponentType() ; - - if (compClass != null) { - result.append( "[" ) ; - if (compClass == boolean.class) { - boolean[] arr = (boolean[])obj ; - result.append( arr.length ) ; - result.append( "]" ) ; - } else if (compClass == byte.class) { - byte[] arr = (byte[])obj ; - result.append( arr.length ) ; - result.append( "]" ) ; - } else if (compClass == short.class) { - short[] arr = (short[])obj ; - result.append( arr.length ) ; - result.append( "]" ) ; - } else if (compClass == int.class) { - int[] arr = (int[])obj ; - result.append( arr.length ) ; - result.append( "]" ) ; - } else if (compClass == long.class) { - long[] arr = (long[])obj ; - result.append( arr.length ) ; - result.append( "]" ) ; - } else if (compClass == char.class) { - char[] arr = (char[])obj ; - result.append( arr.length ) ; - result.append( "]" ) ; - } else if (compClass == float.class) { - float[] arr = (float[])obj ; - result.append( arr.length ) ; - result.append( "]" ) ; - } else if (compClass == double.class) { - double[] arr = (double[])obj ; - result.append( arr.length ) ; - result.append( "]" ) ; - } else { // array of object - java.lang.Object[] arr = (java.lang.Object[])obj ; - result.append( arr.length ) ; - result.append( "]" ) ; - } - } - - result.append( "(" ) ; - } - - /** Expected patterns: - * startObject endObject( str ) - * header( elem )\n - * startObject ( startElement append* endElement ) * endObject - * header(\n - * append*\n * - * )\n - */ - private static class IndentingObjectWriter extends ObjectWriter { - private int level ; - private int increment ; - - public IndentingObjectWriter( int initialLevel, int increment ) - { - this.level = initialLevel ; - this.increment = increment ; - startLine() ; - } - - private void startLine() - { - char[] fill = new char[ level * increment ] ; - Arrays.fill( fill, ' ' ) ; - result.append( fill ) ; - } - - public void startObject( java.lang.Object obj ) - { - appendObjectHeader( obj ) ; - level++ ; - } - - public void startElement() - { - result.append( "\n" ) ; - startLine() ; - } - - public void endElement() - { - } - - public void endObject( String str ) - { - level-- ; - result.append( str ) ; - result.append( ")" ) ; - } - - public void endObject( ) - { - level-- ; - result.append( "\n" ) ; - startLine() ; - result.append( ")" ) ; - } - } - - private static class SimpleObjectWriter extends ObjectWriter { - public void startObject( java.lang.Object obj ) - { - appendObjectHeader( obj ) ; - result.append( " " ) ; - } - - public void startElement() - { - result.append( " " ) ; - } - - public void endObject( String str ) - { - result.append( str ) ; - result.append( ")" ) ; - } - - public void endElement() - { - } - - public void endObject() - { - result.append( ")" ) ; - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/RepIdDelegator.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/RepIdDelegator.java deleted file mode 100644 index 32513609079..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/RepIdDelegator.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil; - -import org.omg.CORBA.ORB; -import java.io.Serializable; -import java.util.Hashtable; -import com.sun.corba.se.impl.io.TypeMismatchException; -import java.net.MalformedURLException; -import com.sun.corba.se.impl.util.RepositoryId; - -/** - * Delegates to the current RepositoryId implementation in - * com.sun.corba.se.impl.util. This is necessary to - * overcome the fact that many of RepositoryId's methods - * are static. - */ -public final class RepIdDelegator - implements RepositoryIdStrings, - RepositoryIdUtility, - RepositoryIdInterface -{ - // RepositoryIdFactory methods - - public String createForAnyType(Class type) { - return RepositoryId.createForAnyType(type); - } - - public String createForJavaType(Serializable ser) - throws TypeMismatchException - { - return RepositoryId.createForJavaType(ser); - } - - public String createForJavaType(Class clz) - throws TypeMismatchException - { - return RepositoryId.createForJavaType(clz); - } - - public String createSequenceRepID(java.lang.Object ser) { - return RepositoryId.createSequenceRepID(ser); - } - - public String createSequenceRepID(Class clazz) { - return RepositoryId.createSequenceRepID(clazz); - } - - public RepositoryIdInterface getFromString(String repIdString) { - return new RepIdDelegator(RepositoryId.cache.getId(repIdString)); - } - - // RepositoryIdUtility methods - - public boolean isChunkedEncoding(int valueTag) { - return RepositoryId.isChunkedEncoding(valueTag); - } - - public boolean isCodeBasePresent(int valueTag) { - return RepositoryId.isCodeBasePresent(valueTag); - } - - public String getClassDescValueRepId() { - return RepositoryId.kClassDescValueRepID; - } - - public String getWStringValueRepId() { - return RepositoryId.kWStringValueRepID; - } - - public int getTypeInfo(int valueTag) { - return RepositoryId.getTypeInfo(valueTag); - } - - public int getStandardRMIChunkedNoRepStrId() { - return RepositoryId.kPreComputed_StandardRMIChunked_NoRep; - } - - public int getCodeBaseRMIChunkedNoRepStrId() { - return RepositoryId.kPreComputed_CodeBaseRMIChunked_NoRep; - } - - public int getStandardRMIChunkedId() { - return RepositoryId.kPreComputed_StandardRMIChunked; - } - - public int getCodeBaseRMIChunkedId() { - return RepositoryId.kPreComputed_CodeBaseRMIChunked; - } - - public int getStandardRMIUnchunkedId() { - return RepositoryId.kPreComputed_StandardRMIUnchunked; - } - - public int getCodeBaseRMIUnchunkedId() { - return RepositoryId.kPreComputed_CodeBaseRMIUnchunked; - } - - public int getStandardRMIUnchunkedNoRepStrId() { - return RepositoryId.kPreComputed_StandardRMIUnchunked_NoRep; - } - - public int getCodeBaseRMIUnchunkedNoRepStrId() { - return RepositoryId.kPreComputed_CodeBaseRMIUnchunked_NoRep; - } - - // RepositoryIdInterface methods - - public Class getClassFromType() throws ClassNotFoundException { - return delegate.getClassFromType(); - } - - public Class getClassFromType(String codebaseURL) - throws ClassNotFoundException, MalformedURLException - { - return delegate.getClassFromType(codebaseURL); - } - - public Class getClassFromType(Class expectedType, - String codebaseURL) - throws ClassNotFoundException, MalformedURLException - { - return delegate.getClassFromType(expectedType, codebaseURL); - } - - public String getClassName() { - return delegate.getClassName(); - } - - // Constructor used for factory/utility cases - public RepIdDelegator() { - this(null); - } - - // Constructor used by getIdFromString. All non-static - // RepositoryId methods will use the provided delegate. - private RepIdDelegator(RepositoryId _delegate) { - this.delegate = _delegate; - } - - private final RepositoryId delegate; - - public String toString() { - if (delegate != null) - return delegate.toString(); - else - return this.getClass().getName(); - } - - public boolean equals(Object obj) { - if (delegate != null) - return delegate.equals(obj); - else - return super.equals(obj); - } - - public int hashCode() { - if (delegate != null) { - return delegate.hashCode(); - } else { - return super.hashCode(); - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/RepositoryIdFactory.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/RepositoryIdFactory.java deleted file mode 100644 index 5f3a237e995..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/RepositoryIdFactory.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil; - -import com.sun.corba.se.spi.orb.ORBVersion; -import com.sun.corba.se.spi.orb.ORB; - -public abstract class RepositoryIdFactory -{ - private static final RepIdDelegator currentDelegator - = new RepIdDelegator(); - - /** - * Returns the latest version RepositoryIdStrings instance - */ - public static RepositoryIdStrings getRepIdStringsFactory() - { - return currentDelegator; - } - - /** - * Returns the latest version RepositoryIdUtility instance - */ - public static RepositoryIdUtility getRepIdUtility() - { - return currentDelegator; - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/RepositoryIdInterface.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/RepositoryIdInterface.java deleted file mode 100644 index eb34e060c86..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/RepositoryIdInterface.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil; - -import org.omg.CORBA.ORB; -import java.io.Serializable; -import java.net.MalformedURLException; - -/** - * Methods on specific instances of RepositoryId. Hides - * versioning of our RepositoryId class. - */ -public interface RepositoryIdInterface -{ - Class getClassFromType() throws ClassNotFoundException; - - Class getClassFromType(String codebaseURL) - throws ClassNotFoundException, MalformedURLException; - - Class getClassFromType(Class expectedType, - String codebaseURL) - throws ClassNotFoundException, MalformedURLException; - - String getClassName(); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/RepositoryIdStrings.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/RepositoryIdStrings.java deleted file mode 100644 index 2337ab5a12e..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/RepositoryIdStrings.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil; - -import java.io.Serializable; -import com.sun.corba.se.impl.io.TypeMismatchException; - -/** - * Factory methods for creating various repository ID strings - * and instances. - */ -public interface RepositoryIdStrings -{ - String createForAnyType(Class type); - - String createForJavaType(Serializable ser) - throws TypeMismatchException; - - String createForJavaType(Class clz) - throws TypeMismatchException; - - String createSequenceRepID(java.lang.Object ser); - - String createSequenceRepID(java.lang.Class clazz); - - RepositoryIdInterface getFromString(String repIdString); - - String getClassDescValueRepId(); - String getWStringValueRepId(); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/RepositoryIdUtility.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/RepositoryIdUtility.java deleted file mode 100644 index 4664347f747..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/RepositoryIdUtility.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil; - -import org.omg.CORBA.ORB; -import com.sun.corba.se.impl.util.RepositoryId; - -/** - * Utility methods for working with repository IDs. - */ -public interface RepositoryIdUtility -{ - boolean isChunkedEncoding(int valueTag); - boolean isCodeBasePresent(int valueTag); - - // These are currently the same in both RepositoryId and - // RepositoryId_1_3, but provide the constants again here - // to eliminate awkardness when using this interface. - int NO_TYPE_INFO = RepositoryId.kNoTypeInfo; - int SINGLE_REP_TYPE_INFO = RepositoryId.kSingleRepTypeInfo; - int PARTIAL_LIST_TYPE_INFO = RepositoryId.kPartialListTypeInfo; - - // Determine how many (if any) repository IDs follow the value - // tag. - int getTypeInfo(int valueTag); - - // Accessors for precomputed value tags - int getStandardRMIChunkedNoRepStrId(); - int getCodeBaseRMIChunkedNoRepStrId(); - int getStandardRMIChunkedId(); - int getCodeBaseRMIChunkedId(); - int getStandardRMIUnchunkedId(); - int getCodeBaseRMIUnchunkedId(); - int getStandardRMIUnchunkedNoRepStrId(); - int getCodeBaseRMIUnchunkedNoRepStrId(); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/StackImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/StackImpl.java deleted file mode 100644 index 44228b31d70..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/StackImpl.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil ; - -import java.util.EmptyStackException ; - -// We implement a Stack here instead of using java.util.Stack because -// java.util.Stack is thread-safe, negatively impacting performance. -// We use an ArrayList instead since it is not thread-safe. -// RequestInfoStack is used quite frequently. -public class StackImpl { - // The stack for RequestInfo objects. - private Object[] data = new Object[3] ; - private int top = -1 ; - - // Tests if this stack is empty. - public final boolean empty() { - return top == -1; - } - - // Looks at the object at the top of this stack without removing it - // from the stack. - public final Object peek() { - if (empty()) - throw new EmptyStackException(); - - return data[ top ]; - } - - // Removes the object at the top of this stack and returns that - // object as the value of this function. - public final Object pop() { - Object obj = peek() ; - data[top] = null ; - top-- ; - return obj; - } - - private void ensure() - { - if (top == (data.length-1)) { - int newSize = 2*data.length ; - Object[] newData = new Object[ newSize ] ; - System.arraycopy( data, 0, newData, 0, data.length ) ; - data = newData ; - } - } - - // Pushes an item onto the top of the stack - public final Object push( Object item ) { - ensure() ; - top++ ; - data[top] = item; - return item; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/closure/Constant.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/closure/Constant.java deleted file mode 100644 index dbfb0eb8411..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/closure/Constant.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil.closure ; - -import com.sun.corba.se.spi.orbutil.closure.Closure ; - -public class Constant implements Closure { - private Object value ; - - public Constant( Object value ) - { - this.value = value ; - } - - public Object evaluate() - { - return value ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/closure/Future.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/closure/Future.java deleted file mode 100644 index 6527252cfd2..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/closure/Future.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil.closure ; - -import com.sun.corba.se.spi.orbutil.closure.Closure ; - -public class Future implements Closure { - private boolean evaluated ; - private Closure closure ; - private Object value ; - - public Future( Closure value ) - { - this.evaluated = false ; - this.closure = (Closure)value ; - this.value = null ; - } - - public synchronized Object evaluate() - { - if (!evaluated) { - evaluated = true ; - value = closure.evaluate() ; - } - - return value ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/CondVar.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/CondVar.java deleted file mode 100644 index fb605b51650..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/CondVar.java +++ /dev/null @@ -1,340 +0,0 @@ -/* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - File: ConditionVariable.java - - Originally written by Doug Lea and released into the public domain. - This may be used for any purposes whatsoever without acknowledgment. - Thanks for the assistance and support of Sun Microsystems Labs, - and everyone contributing, testing, and using this code. - - History: - Date Who What - 11Jun1998 dl Create public version - 08dec2001 kmc Added support for Reentrant Mutexes -*/ - -package com.sun.corba.se.impl.orbutil.concurrent; - -import com.sun.corba.se.impl.orbutil.ORBUtility ; - -/** - * This class is designed for fans of POSIX pthreads programming. - * If you restrict yourself to Mutexes and CondVars, you can - * use most of your favorite constructions. Don't randomly mix them - * with synchronized methods or blocks though. - *

            - * Method names and behavior are as close as is reasonable to - * those in POSIX. - *

            - * Sample Usage. Here is a full version of a bounded buffer - * that implements the BoundedChannel interface, written in - * a style reminscent of that in POSIX programming books. - *

            - * class CVBuffer implements BoundedChannel {
            - *   private final Mutex mutex;
            - *   private final CondVar notFull;
            - *   private final CondVar notEmpty;
            - *   private int count = 0;
            - *   private int takePtr = 0;
            - *   private int putPtr = 0;
            - *   private final Object[] array;
            - *
            - *   public CVBuffer(int capacity) {
            - *     array = new Object[capacity];
            - *     mutex = new Mutex();
            - *     notFull = new CondVar(mutex);
            - *     notEmpty = new CondVar(mutex);
            - *   }
            - *
            - *   public int capacity() { return array.length; }
            - *
            - *   public void put(Object x) throws InterruptedException {
            - *     mutex.acquire();
            - *     try {
            - *       while (count == array.length) {
            - *         notFull.await();
            - *       }
            - *       array[putPtr] = x;
            - *       putPtr = (putPtr + 1) % array.length;
            - *       ++count;
            - *       notEmpty.signal();
            - *     }
            - *     finally {
            - *       mutex.release();
            - *     }
            - *   }
            - *
            - *   public Object take() throws InterruptedException {
            - *     Object x = null;
            - *     mutex.acquire();
            - *     try {
            - *       while (count == 0) {
            - *         notEmpty.await();
            - *       }
            - *       x = array[takePtr];
            - *       array[takePtr] = null;
            - *       takePtr = (takePtr + 1) % array.length;
            - *       --count;
            - *       notFull.signal();
            - *     }
            - *     finally {
            - *       mutex.release();
            - *     }
            - *     return x;
            - *   }
            - *
            - *   public boolean offer(Object x, long msecs) throws InterruptedException {
            - *     mutex.acquire();
            - *     try {
            - *       if (count == array.length) {
            - *         notFull.timedwait(msecs);
            - *         if (count == array.length)
            - *           return false;
            - *       }
            - *       array[putPtr] = x;
            - *       putPtr = (putPtr + 1) % array.length;
            - *       ++count;
            - *       notEmpty.signal();
            - *       return true;
            - *     }
            - *     finally {
            - *       mutex.release();
            - *     }
            - *   }
            - *
            - *   public Object poll(long msecs) throws InterruptedException {
            - *     Object x = null;
            - *     mutex.acquire();
            - *     try {
            - *       if (count == 0) {
            - *         notEmpty.timedwait(msecs);
            - *         if (count == 0)
            - *           return null;
            - *       }
            - *       x = array[takePtr];
            - *       array[takePtr] = null;
            - *       takePtr = (takePtr + 1) % array.length;
            - *       --count;
            - *       notFull.signal();
            - *     }
            - *     finally {
            - *       mutex.release();
            - *     }
            - *     return x;
            - *   }
            - * }
            - *
            - * 
            - * @see Mutex - * [ Introduction to this package. ] - **/ - -public class CondVar { - - protected boolean debug_ ; - - /** The mutex **/ - protected final Sync mutex_; - protected final ReentrantMutex remutex_; - - private int releaseMutex() - { - int count = 1 ; - - if (remutex_!=null) - count = remutex_.releaseAll() ; - else - mutex_.release() ; - - return count ; - } - - private void acquireMutex( int count ) throws InterruptedException - { - if (remutex_!=null) - remutex_.acquireAll( count ) ; - else - mutex_.acquire() ; - } - - /** - * Create a new CondVar that relies on the given mutual - * exclusion lock. - * @param mutex A mutual exclusion lock which must either be non-reentrant, - * or else be ReentrantMutex. - * Standard usage is to supply an instance of Mutex, - * but, for example, a Semaphore initialized to 1 also works. - * On the other hand, many other Sync implementations would not - * work here, so some care is required to supply a sensible - * synchronization object. - * In normal use, the mutex should be one that is used for all - * synchronization of the object using the CondVar. Generally, - * to prevent nested monitor lockouts, this - * object should not use any native Java synchronized blocks. - **/ - - public CondVar(Sync mutex, boolean debug) { - debug_ = debug ; - mutex_ = mutex; - if (mutex instanceof ReentrantMutex) - remutex_ = (ReentrantMutex)mutex; - else - remutex_ = null; - } - - public CondVar( Sync mutex ) { - this( mutex, false ) ; - } - - /** - * Wait for notification. This operation at least momentarily - * releases the mutex. The mutex is always held upon return, - * even if interrupted. - * @exception InterruptedException if the thread was interrupted - * before or during the wait. However, if the thread is interrupted - * after the wait but during mutex re-acquisition, the interruption - * is ignored, while still ensuring - * that the currentThread's interruption state stays true, so can - * be probed by callers. - **/ - public void await() throws InterruptedException { - int count = 0 ; - if (Thread.interrupted()) - throw new InterruptedException(); - - try { - if (debug_) - ORBUtility.dprintTrace( this, "await enter" ) ; - - synchronized(this) { - count = releaseMutex() ; - try { - wait(); - } catch (InterruptedException ex) { - notify(); - throw ex; - } - } - } finally { - // Must ignore interrupt on re-acquire - boolean interrupted = false; - for (;;) { - try { - acquireMutex( count ); - break; - } catch (InterruptedException ex) { - interrupted = true; - } - } - - if (interrupted) { - Thread.currentThread().interrupt(); - } - - if (debug_) - ORBUtility.dprintTrace( this, "await exit" ) ; - } - } - - /** - * Wait for at most msecs for notification. - * This operation at least momentarily - * releases the mutex. The mutex is always held upon return, - * even if interrupted. - * @param msecs The time to wait. A value less than or equal to zero - * causes a momentarily release - * and re-acquire of the mutex, and always returns false. - * @return false if at least msecs have elapsed - * upon resumption; else true. A - * false return does NOT necessarily imply that the thread was - * not notified. For example, it might have been notified - * after the time elapsed but just before resuming. - * @exception InterruptedException if the thread was interrupted - * before or during the wait. - **/ - - public boolean timedwait(long msecs) throws InterruptedException { - - if (Thread.interrupted()) - throw new InterruptedException(); - - boolean success = false; - int count = 0; - - try { - if (debug_) - ORBUtility.dprintTrace( this, "timedwait enter" ) ; - - synchronized(this) { - count = releaseMutex() ; - try { - if (msecs > 0) { - long start = System.currentTimeMillis(); - wait(msecs); - success = System.currentTimeMillis() - start <= msecs; - } - } catch (InterruptedException ex) { - notify(); - throw ex; - } - } - } finally { - // Must ignore interrupt on re-acquire - boolean interrupted = false; - for (;;) { - try { - acquireMutex( count ) ; - break; - } catch (InterruptedException ex) { - interrupted = true; - } - } - - if (interrupted) { - Thread.currentThread().interrupt(); - } - - if (debug_) - ORBUtility.dprintTrace( this, "timedwait exit" ) ; - } - return success; - } - - /** - * Notify a waiting thread. - * If one exists, a non-interrupted thread will return - * normally (i.e., not via InterruptedException) from await or timedwait. - **/ - public synchronized void signal() { - notify(); - } - - /** Notify all waiting threads **/ - public synchronized void broadcast() { - notifyAll(); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/DebugMutex.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/DebugMutex.java deleted file mode 100644 index a35e6f89a4c..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/DebugMutex.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - File: Mutex.java - - Originally written by Doug Lea and released into the public domain. - This may be used for any purposes whatsoever without acknowledgment. - Thanks for the assistance and support of Sun Microsystems Labs, - and everyone contributing, testing, and using this code. - - History: - Date Who What - 11Jun1998 dl Create public version -*/ - -package com.sun.corba.se.impl.orbutil.concurrent; - -/** - * A simple non-reentrant mutual exclusion lock. - * The lock is free upon construction. Each acquire gets the - * lock, and each release frees it. Releasing a lock that - * is already free has no effect. - *

            - * This implementation makes no attempt to provide any fairness - * or ordering guarantees. If you need them, consider using one of - * the Semaphore implementations as a locking mechanism. - *

            - * Sample usage
            - *

            - * Mutex can be useful in constructions that cannot be - * expressed using java synchronized blocks because the - * acquire/release pairs do not occur in the same method or - * code block. For example, you can use them for hand-over-hand - * locking across the nodes of a linked list. This allows - * extremely fine-grained locking, and so increases - * potential concurrency, at the cost of additional complexity and - * overhead that would normally make this worthwhile only in cases of - * extreme contention. - *

            - * class Node {
            - *   Object item;
            - *   Node next;
            - *   Mutex lock = new Mutex(); // each node keeps its own lock
            - *
            - *   Node(Object x, Node n) { item = x; next = n; }
            - * }
            - *
            - * class List {
            - *    protected Node head; // pointer to first node of list
            - *
            - *    // Use plain java synchronization to protect head field.
            - *    //  (We could instead use a Mutex here too but there is no
            - *    //  reason to do so.)
            - *    protected synchronized Node getHead() { return head; }
            - *
            - *    boolean search(Object x) throws InterruptedException {
            - *      Node p = getHead();
            - *      if (p == null) return false;
            - *
            - *      //  (This could be made more compact, but for clarity of illustration,
            - *      //  all of the cases that can arise are handled separately.)
            - *
            - *      p.lock.acquire();              // Prime loop by acquiring first lock.
            - *                                     //    (If the acquire fails due to
            - *                                     //    interrupt, the method will throw
            - *                                     //    InterruptedException now,
            - *                                     //    so there is no need for any
            - *                                     //    further cleanup.)
            - *      for (;;) {
            - *        if (x.equals(p.item)) {
            - *          p.lock.release();          // release current before return
            - *          return true;
            - *        }
            - *        else {
            - *          Node nextp = p.next;
            - *          if (nextp == null) {
            - *            p.lock.release();       // release final lock that was held
            - *            return false;
            - *          }
            - *          else {
            - *            try {
            - *              nextp.lock.acquire(); // get next lock before releasing current
            - *            }
            - *            catch (InterruptedException ex) {
            - *              p.lock.release();    // also release current if acquire fails
            - *              throw ex;
            - *            }
            - *            p.lock.release();      // release old lock now that new one held
            - *            p = nextp;
            - *          }
            - *        }
            - *      }
            - *    }
            - *
            - *    synchronized void add(Object x) { // simple prepend
            - *      // The use of `synchronized'  here protects only head field.
            - *      // The method does not need to wait out other traversers
            - *      // who have already made it past head.
            - *
            - *      head = new Node(x, head);
            - *    }
            - *
            - *    // ...  other similar traversal and update methods ...
            - * }
            - * 
            - *

            - *

            This version adds some debugging capability: it will detect an attempt by a thread - * that holds the lock to acquire it for a second time, and also an attempt by a thread that - * does not hold the mutex to release it. - * @see Semaphore - *

            [ Introduction to this package. ] -**/ - -import org.omg.CORBA.INTERNAL ; - -public class DebugMutex implements Sync { - - /** The lock status **/ - protected boolean inuse_ = false; - protected Thread holder_ = null; - - public void acquire() throws InterruptedException { - if (Thread.interrupted()) throw new InterruptedException(); - synchronized(this) { - Thread thr = Thread.currentThread(); - if (holder_ == thr) - throw new INTERNAL( - "Attempt to acquire Mutex by thread holding the Mutex" ) ; - - try { - while (inuse_) wait(); - inuse_ = true; - holder_ = Thread.currentThread(); - } - catch (InterruptedException ex) { - notify(); - throw ex; - } - } - } - - public synchronized void release() { - Thread thr = Thread.currentThread(); - if (thr != holder_) - throw new INTERNAL( - "Attempt to release Mutex by thread not holding the Mutex" ) ; - holder_ = null; - inuse_ = false; - notify(); - } - - - public boolean attempt(long msecs) throws InterruptedException { - if (Thread.interrupted()) throw new InterruptedException(); - synchronized(this) { - Thread thr = Thread.currentThread() ; - - if (!inuse_) { - inuse_ = true; - holder_ = thr; - return true; - } else if (msecs <= 0) - return false; - else { - long waitTime = msecs; - long start = System.currentTimeMillis(); - try { - for (;;) { - wait(waitTime); - if (!inuse_) { - inuse_ = true; - holder_ = thr; - return true; - } - else { - waitTime = msecs - (System.currentTimeMillis() - start); - if (waitTime <= 0) - return false; - } - } - } - catch (InterruptedException ex) { - notify(); - throw ex; - } - } - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/Mutex.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/Mutex.java deleted file mode 100644 index 78d66113d6d..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/Mutex.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - File: Mutex.java - - Originally written by Doug Lea and released into the public domain. - This may be used for any purposes whatsoever without acknowledgment. - Thanks for the assistance and support of Sun Microsystems Labs, - and everyone contributing, testing, and using this code. - - History: - Date Who What - 11Jun1998 dl Create public version -*/ - -package com.sun.corba.se.impl.orbutil.concurrent; - -/** - * A simple non-reentrant mutual exclusion lock. - * The lock is free upon construction. Each acquire gets the - * lock, and each release frees it. Releasing a lock that - * is already free has no effect. - *

            - * This implementation makes no attempt to provide any fairness - * or ordering guarantees. If you need them, consider using one of - * the Semaphore implementations as a locking mechanism. - *

            - * Sample usage
            - *

            - * Mutex can be useful in constructions that cannot be - * expressed using java synchronized blocks because the - * acquire/release pairs do not occur in the same method or - * code block. For example, you can use them for hand-over-hand - * locking across the nodes of a linked list. This allows - * extremely fine-grained locking, and so increases - * potential concurrency, at the cost of additional complexity and - * overhead that would normally make this worthwhile only in cases of - * extreme contention. - *

            - * class Node {
            - *   Object item;
            - *   Node next;
            - *   Mutex lock = new Mutex(); // each node keeps its own lock
            - *
            - *   Node(Object x, Node n) { item = x; next = n; }
            - * }
            - *
            - * class List {
            - *    protected Node head; // pointer to first node of list
            - *
            - *    // Use plain java synchronization to protect head field.
            - *    //  (We could instead use a Mutex here too but there is no
            - *    //  reason to do so.)
            - *    protected synchronized Node getHead() { return head; }
            - *
            - *    boolean search(Object x) throws InterruptedException {
            - *      Node p = getHead();
            - *      if (p == null) return false;
            - *
            - *      //  (This could be made more compact, but for clarity of illustration,
            - *      //  all of the cases that can arise are handled separately.)
            - *
            - *      p.lock.acquire();              // Prime loop by acquiring first lock.
            - *                                     //    (If the acquire fails due to
            - *                                     //    interrupt, the method will throw
            - *                                     //    InterruptedException now,
            - *                                     //    so there is no need for any
            - *                                     //    further cleanup.)
            - *      for (;;) {
            - *        if (x.equals(p.item)) {
            - *          p.lock.release();          // release current before return
            - *          return true;
            - *        }
            - *        else {
            - *          Node nextp = p.next;
            - *          if (nextp == null) {
            - *            p.lock.release();       // release final lock that was held
            - *            return false;
            - *          }
            - *          else {
            - *            try {
            - *              nextp.lock.acquire(); // get next lock before releasing current
            - *            }
            - *            catch (InterruptedException ex) {
            - *              p.lock.release();    // also release current if acquire fails
            - *              throw ex;
            - *            }
            - *            p.lock.release();      // release old lock now that new one held
            - *            p = nextp;
            - *          }
            - *        }
            - *      }
            - *    }
            - *
            - *    synchronized void add(Object x) { // simple prepend
            - *      // The use of `synchronized'  here protects only head field.
            - *      // The method does not need to wait out other traversers
            - *      // who have already made it past head.
            - *
            - *      head = new Node(x, head);
            - *    }
            - *
            - *    // ...  other similar traversal and update methods ...
            - * }
            - * 
            - * @see Semaphore - *

            [ Introduction to this package. ] -**/ - -public class Mutex implements Sync { - - /** The lock status **/ - protected boolean inuse_ = false; - - public void acquire() throws InterruptedException { - if (Thread.interrupted()) throw new InterruptedException(); - synchronized(this) { - try { - while (inuse_) wait(); - inuse_ = true; - } - catch (InterruptedException ex) { - notify(); - throw ex; - } - } - } - - public synchronized void release() { - inuse_ = false; - notify(); - } - - - public boolean attempt(long msecs) throws InterruptedException { - if (Thread.interrupted()) throw new InterruptedException(); - synchronized(this) { - if (!inuse_) { - inuse_ = true; - return true; - } - else if (msecs <= 0) - return false; - else { - long waitTime = msecs; - long start = System.currentTimeMillis(); - try { - for (;;) { - wait(waitTime); - if (!inuse_) { - inuse_ = true; - return true; - } - else { - waitTime = msecs - (System.currentTimeMillis() - start); - if (waitTime <= 0) - return false; - } - } - } - catch (InterruptedException ex) { - notify(); - throw ex; - } - } - } - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/ReentrantMutex.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/ReentrantMutex.java deleted file mode 100644 index eaf4ff5e799..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/ReentrantMutex.java +++ /dev/null @@ -1,350 +0,0 @@ -/* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - File: Mutex.java - - Originally written by Doug Lea and released into the public domain. - This may be used for any purposes whatsoever without acknowledgment. - Thanks for the assistance and support of Sun Microsystems Labs, - and everyone contributing, testing, and using this code. - - History: - Date Who What - 11Jun1998 dl Create public version -*/ - -package com.sun.corba.se.impl.orbutil.concurrent; - -import com.sun.corba.se.impl.orbutil.ORBUtility ; - -/** - * A simple reentrant mutual exclusion lock. - * The lock is free upon construction. Each acquire gets the - * lock, and each release frees it. Releasing a lock that - * is already free has no effect. - *

            - * This implementation makes no attempt to provide any fairness - * or ordering guarantees. If you need them, consider using one of - * the Semaphore implementations as a locking mechanism. - *

            - * Sample usage
            - *

            - * Mutex can be useful in constructions that cannot be - * expressed using java synchronized blocks because the - * acquire/release pairs do not occur in the same method or - * code block. For example, you can use them for hand-over-hand - * locking across the nodes of a linked list. This allows - * extremely fine-grained locking, and so increases - * potential concurrency, at the cost of additional complexity and - * overhead that would normally make this worthwhile only in cases of - * extreme contention. - *

            - * class Node {
            - *   Object item;
            - *   Node next;
            - *   Mutex lock = new Mutex(); // each node keeps its own lock
            - *
            - *   Node(Object x, Node n) { item = x; next = n; }
            - * }
            - *
            - * class List {
            - *    protected Node head; // pointer to first node of list
            - *
            - *    // Use plain java synchronization to protect head field.
            - *    //  (We could instead use a Mutex here too but there is no
            - *    //  reason to do so.)
            - *    protected synchronized Node getHead() { return head; }
            - *
            - *    boolean search(Object x) throws InterruptedException {
            - *      Node p = getHead();
            - *      if (p == null) return false;
            - *
            - *      //  (This could be made more compact, but for clarity of illustration,
            - *      //  all of the cases that can arise are handled separately.)
            - *
            - *      p.lock.acquire();              // Prime loop by acquiring first lock.
            - *                                     //    (If the acquire fails due to
            - *                                     //    interrupt, the method will throw
            - *                                     //    InterruptedException now,
            - *                                     //    so there is no need for any
            - *                                     //    further cleanup.)
            - *      for (;;) {
            - *        if (x.equals(p.item)) {
            - *          p.lock.release();          // release current before return
            - *          return true;
            - *        }
            - *        else {
            - *          Node nextp = p.next;
            - *          if (nextp == null) {
            - *            p.lock.release();       // release final lock that was held
            - *            return false;
            - *          }
            - *          else {
            - *            try {
            - *              nextp.lock.acquire(); // get next lock before releasing current
            - *            }
            - *            catch (InterruptedException ex) {
            - *              p.lock.release();    // also release current if acquire fails
            - *              throw ex;
            - *            }
            - *            p.lock.release();      // release old lock now that new one held
            - *            p = nextp;
            - *          }
            - *        }
            - *      }
            - *    }
            - *
            - *    synchronized void add(Object x) { // simple prepend
            - *      // The use of `synchronized'  here protects only head field.
            - *      // The method does not need to wait out other traversers
            - *      // who have already made it past head.
            - *
            - *      head = new Node(x, head);
            - *    }
            - *
            - *    // ...  other similar traversal and update methods ...
            - * }
            - * 
            - *

            - *

            This version adds some debugging capability: it will detect - * an attempt by a thread that does not hold the mutex to release it. - * This version is reentrant: the same thread may acquire a mutex multiple - * times, in which case it must release the mutex the same number of times - * as it was acquired before another thread can acquire the mutex. - * @see Semaphore - *

            [ Introduction to this package. ] -**/ - -import org.omg.CORBA.INTERNAL ; - -public class ReentrantMutex implements Sync { - - /** The thread holding the lock **/ - protected Thread holder_ = null; - - /** number of times thread has acquired the lock **/ - protected int counter_ = 0 ; - - protected boolean debug = false ; - - public ReentrantMutex() - { - this( false ) ; - } - - public ReentrantMutex( boolean debug ) - { - this.debug = debug ; - } - - public void acquire() throws InterruptedException { - if (Thread.interrupted()) - throw new InterruptedException(); - - synchronized(this) { - try { - if (debug) - ORBUtility.dprintTrace( this, - "acquire enter: holder_=" + - ORBUtility.getThreadName(holder_) + - " counter_=" + counter_ ) ; - - Thread thr = Thread.currentThread(); - if (holder_ != thr) { - try { - while (counter_ > 0) - wait(); - - // This can't happen, but make sure anyway - if (counter_ != 0) - throw new INTERNAL( - "counter not 0 when first acquiring mutex" ) ; - - holder_ = thr; - } catch (InterruptedException ex) { - notify(); - throw ex; - } - } - - counter_ ++ ; - } finally { - if (debug) - ORBUtility.dprintTrace( this, "acquire exit: holder_=" + - ORBUtility.getThreadName(holder_) + " counter_=" + - counter_ ) ; - } - } - } - - void acquireAll( int count ) throws InterruptedException - { - if (Thread.interrupted()) - throw new InterruptedException(); - - synchronized(this) { - try { - if (debug) - ORBUtility.dprintTrace( this, - "acquireAll enter: count=" + count + " holder_=" + - ORBUtility.getThreadName(holder_) + " counter_=" + - counter_ ) ; - Thread thr = Thread.currentThread(); - if (holder_ == thr) { - throw new INTERNAL( - "Cannot acquireAll while holding the mutex" ) ; - } else { - try { - while (counter_ > 0) - wait(); - - // This can't happen, but make sure anyway - if (counter_ != 0) - throw new INTERNAL( - "counter not 0 when first acquiring mutex" ) ; - - holder_ = thr; - } catch (InterruptedException ex) { - notify(); - throw ex; - } - } - - counter_ = count ; - } finally { - if (debug) - ORBUtility.dprintTrace( this, "acquireAll exit: count=" + - count + " holder_=" + ORBUtility.getThreadName(holder_) + - " counter_=" + counter_ ) ; - } - } - } - - public synchronized void release() - { - try { - if (debug) - ORBUtility.dprintTrace( this, "release enter: " + - " holder_=" + ORBUtility.getThreadName(holder_) + - " counter_=" + counter_ ) ; - - Thread thr = Thread.currentThread(); - if (thr != holder_) - throw new INTERNAL( - "Attempt to release Mutex by thread not holding the Mutex" ) ; - else - counter_ -- ; - - if (counter_ == 0) { - holder_ = null; - notify(); - } - } finally { - if (debug) - ORBUtility.dprintTrace( this, "release exit: " + - " holder_=" + ORBUtility.getThreadName(holder_) + - " counter_=" + counter_ ) ; - } - } - - synchronized int releaseAll() - { - try { - if (debug) - ORBUtility.dprintTrace( this, "releaseAll enter: " + - " holder_=" + ORBUtility.getThreadName(holder_) + - " counter_=" + counter_ ) ; - - Thread thr = Thread.currentThread(); - if (thr != holder_) - throw new INTERNAL( - "Attempt to releaseAll Mutex by thread not holding the Mutex" ) ; - - int result = counter_ ; - counter_ = 0 ; - holder_ = null ; - notify() ; - return result ; - } finally { - if (debug) - ORBUtility.dprintTrace( this, "releaseAll exit: " + - " holder_=" + ORBUtility.getThreadName(holder_) + - " counter_=" + counter_ ) ; - } - } - - public boolean attempt(long msecs) throws InterruptedException { - if (Thread.interrupted()) - throw new InterruptedException(); - - synchronized(this) { - try { - if (debug) - ORBUtility.dprintTrace( this, "attempt enter: msecs=" + - msecs + " holder_=" + - ORBUtility.getThreadName(holder_) + - " counter_=" + counter_ ) ; - - Thread thr = Thread.currentThread() ; - - if (counter_==0) { - holder_ = thr; - counter_ = 1 ; - return true; - } else if (msecs <= 0) { - return false; - } else { - long waitTime = msecs; - long start = System.currentTimeMillis(); - try { - for (;;) { - wait(waitTime); - if (counter_==0) { - holder_ = thr; - counter_ = 1 ; - return true; - } else { - waitTime = msecs - - (System.currentTimeMillis() - start); - - if (waitTime <= 0) - return false; - } - } - } catch (InterruptedException ex) { - notify(); - throw ex; - } - } - } finally { - if (debug) - ORBUtility.dprintTrace( this, "attempt exit: " + - " holder_=" + ORBUtility.getThreadName(holder_) + - " counter_=" + counter_ ) ; - } - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/Sync.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/Sync.java deleted file mode 100644 index c696b795083..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/Sync.java +++ /dev/null @@ -1,362 +0,0 @@ -/* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - File: Sync.java - - Originally written by Doug Lea and released into the public domain. - This may be used for any purposes whatsoever without acknowledgment. - Thanks for the assistance and support of Sun Microsystems Labs, - and everyone contributing, testing, and using this code. - - History: - Date Who What - 11Jun1998 dl Create public version - 5Aug1998 dl Added some convenient time constants -*/ - -package com.sun.corba.se.impl.orbutil.concurrent; - -/** - * Main interface for locks, gates, and conditions. - *

            - * Sync objects isolate waiting and notification for particular - * logical states, resource availability, events, and the like that are - * shared across multiple threads. Use of Syncs sometimes - * (but by no means always) adds flexibility and efficiency - * compared to the use of plain java monitor methods - * and locking, and are sometimes (but by no means always) - * simpler to program with. - *

            - * - * Most Syncs are intended to be used primarily (although - * not exclusively) in before/after constructions such as: - *

            - * class X {
            - *   Sync gate;
            - *   // ...
            - *
            - *   public void m() {
            - *     try {
            - *       gate.acquire();  // block until condition holds
            - *       try {
            - *         // ... method body
            - *       }
            - *       finally {
            - *         gate.release()
            - *       }
            - *     }
            - *     catch (InterruptedException ex) {
            - *       // ... evasive action
            - *     }
            - *   }
            - *
            - *   public void m2(Sync cond) { // use supplied condition
            - *     try {
            - *       if (cond.attempt(10)) {         // try the condition for 10 ms
            - *         try {
            - *           // ... method body
            - *         }
            - *         finally {
            - *           cond.release()
            - *         }
            - *       }
            - *     }
            - *     catch (InterruptedException ex) {
            - *       // ... evasive action
            - *     }
            - *   }
            - * }
            - * 
            - * Syncs may be used in somewhat tedious but more flexible replacements - * for built-in Java synchronized blocks. For example: - *
            - * class HandSynched {
            - *   private double state_ = 0.0;
            - *   private final Sync lock;  // use lock type supplied in constructor
            - *   public HandSynched(Sync l) { lock = l; }
            - *
            - *   public void changeState(double d) {
            - *     try {
            - *       lock.acquire();
            - *       try     { state_ = updateFunction(d); }
            - *       finally { lock.release(); }
            - *     }
            - *     catch(InterruptedException ex) { }
            - *   }
            - *
            - *   public double getState() {
            - *     double d = 0.0;
            - *     try {
            - *       lock.acquire();
            - *       try     { d = accessFunction(state_); }
            - *       finally { lock.release(); }
            - *     }
            - *     catch(InterruptedException ex){}
            - *     return d;
            - *   }
            - *   private double updateFunction(double d) { ... }
            - *   private double accessFunction(double d) { ... }
            - * }
            - * 
            - * If you have a lot of such methods, and they take a common - * form, you can standardize this using wrappers. Some of these - * wrappers are standardized in LockedExecutor, but you can make others. - * For example: - *
            - * class HandSynchedV2 {
            - *   private double state_ = 0.0;
            - *   private final Sync lock;  // use lock type supplied in constructor
            - *   public HandSynchedV2(Sync l) { lock = l; }
            - *
            - *   protected void runSafely(Runnable r) {
            - *     try {
            - *       lock.acquire();
            - *       try { r.run(); }
            - *       finally { lock.release(); }
            - *     }
            - *     catch (InterruptedException ex) { // propagate without throwing
            - *       Thread.currentThread().interrupt();
            - *     }
            - *   }
            - *
            - *   public void changeState(double d) {
            - *     runSafely(new Runnable() {
            - *       public void run() { state_ = updateFunction(d); }
            - *     });
            - *   }
            - *   // ...
            - * }
            - * 
            - *

            - * One reason to bother with such constructions is to use deadlock- - * avoiding back-offs when dealing with locks involving multiple objects. - * For example, here is a Cell class that uses attempt to back-off - * and retry if two Cells are trying to swap values with each other - * at the same time. - *

            - * class Cell {
            - *   long value;
            - *   Sync lock = ... // some sync implementation class
            - *   void swapValue(Cell other) {
            - *     for (;;) {
            - *       try {
            - *         lock.acquire();
            - *         try {
            - *           if (other.lock.attempt(100)) {
            - *             try {
            - *               long t = value;
            - *               value = other.value;
            - *               other.value = t;
            - *               return;
            - *             }
            - *             finally { other.lock.release(); }
            - *           }
            - *         }
            - *         finally { lock.release(); }
            - *       }
            - *       catch (InterruptedException ex) { return; }
            - *     }
            - *   }
            - * }
            - * 
            - *

            - * Here is an even fancier version, that uses lock re-ordering - * upon conflict: - *

            {@code
            - * class Cell {
            - *   long value;
            - *   Sync lock = ...;
            - *   private static boolean trySwap(Cell a, Cell b) {
            - *     a.lock.acquire();
            - *     try {
            - *       if (!b.lock.attempt(0))
            - *         return false;
            - *       try {
            - *         long t = a.value;
            - *         a.value = b.value;
            - *         b.value = t;
            - *         return true;
            - *       }
            - *       finally { other.lock.release(); }
            - *     }
            - *     finally { lock.release(); }
            - *     return false;
            - *   }
            - *
            - *  void swapValue(Cell other) {
            - *    try {
            - *      while (!trySwap(this, other) &&
            - *            !tryswap(other, this))
            - *        Thread.sleep(1);
            - *    }
            - *    catch (InterruptedException ex) { return; }
            - *  }
            - * }
            - * }
            - *

            - * Interruptions are in general handled as early as possible. - * Normally, InterruptionExceptions are thrown - * in acquire and attempt(msec) if interruption - * is detected upon entry to the method, as well as in any - * later context surrounding waits. - * However, interruption status is ignored in release(); - *

            - * Timed versions of attempt report failure via return value. - * If so desired, you can transform such constructions to use exception - * throws via - *

            - *   if (!c.attempt(timeval)) throw new TimeoutException(timeval);
            - * 
            - *

            - * The TimoutSync wrapper class can be used to automate such usages. - *

            - * All time values are expressed in milliseconds as longs, which have a maximum - * value of Long.MAX_VALUE, or almost 300,000 centuries. It is not - * known whether JVMs actually deal correctly with such extreme values. - * For convenience, some useful time values are defined as static constants. - *

            - * All implementations of the three Sync methods guarantee to - * somehow employ Java synchronized methods or blocks, - * and so entail the memory operations described in JLS - * chapter 17 which ensure that variables are loaded and flushed - * within before/after constructions. - *

            - * Syncs may also be used in spinlock constructions. Although - * it is normally best to just use acquire(), various forms - * of busy waits can be implemented. For a simple example - * (but one that would probably never be preferable to using acquire()): - *

            {@code
            - * class X {
            - *   Sync lock = ...
            - *   void spinUntilAcquired() throws InterruptedException {
            - *     // Two phase.
            - *     // First spin without pausing.
            - *     int purespins = 10;
            - *     for (int i = 0; i < purespins; ++i) {
            - *       if (lock.attempt(0))
            - *         return true;
            - *     }
            - *     // Second phase - use timed waits
            - *     long waitTime = 1; // 1 millisecond
            - *     for (;;) {
            - *       if (lock.attempt(waitTime))
            - *         return true;
            - *       else
            - *         waitTime = waitTime * 3 / 2 + 1; // increase 50%
            - *     }
            - *   }
            - * }
            - * }
            - *

            - * In addition pure synchronization control, Syncs - * may be useful in any context requiring before/after methods. - * For example, you can use an ObservableSync - * (perhaps as part of a LayeredSync) in order to obtain callbacks - * before and after each method invocation for a given class. - * - * [ Introduction to this package. ] - **/ - - -public interface Sync { - - /** - * Wait (possibly forever) until successful passage. - * Fail only upon interuption. Interruptions always result in - * `clean' failures. On failure, you can be sure that it has not - * been acquired, and that no - * corresponding release should be performed. Conversely, - * a normal return guarantees that the acquire was successful. - **/ - - public void acquire() throws InterruptedException; - - /** - * Wait at most msecs to pass; report whether passed. - *

            - * The method has best-effort semantics: - * The msecs bound cannot - * be guaranteed to be a precise upper bound on wait time in Java. - * Implementations generally can only attempt to return as soon as possible - * after the specified bound. Also, timers in Java do not stop during garbage - * collection, so timeouts can occur just because a GC intervened. - * So, msecs arguments should be used in - * a coarse-grained manner. Further, - * implementations cannot always guarantee that this method - * will return at all without blocking indefinitely when used in - * unintended ways. For example, deadlocks may be encountered - * when called in an unintended context. - *

            - * @param msecs the number of milleseconds to wait. - * An argument less than or equal to zero means not to wait at all. - * However, this may still require - * access to a synchronization lock, which can impose unbounded - * delay if there is a lot of contention among threads. - * @return true if acquired - **/ - - public boolean attempt(long msecs) throws InterruptedException; - - /** - * Potentially enable others to pass. - *

            - * Because release does not raise exceptions, - * it can be used in `finally' clauses without requiring extra - * embedded try/catch blocks. But keep in mind that - * as with any java method, implementations may - * still throw unchecked exceptions such as Error or NullPointerException - * when faced with uncontinuable errors. However, these should normally - * only be caught by higher-level error handlers. - **/ - - public void release(); - - /** One second, in milliseconds; convenient as a time-out value **/ - public static final long ONE_SECOND = 1000; - - /** One minute, in milliseconds; convenient as a time-out value **/ - public static final long ONE_MINUTE = 60 * ONE_SECOND; - - /** One hour, in milliseconds; convenient as a time-out value **/ - public static final long ONE_HOUR = 60 * ONE_MINUTE; - - /** One day, in milliseconds; convenient as a time-out value **/ - public static final long ONE_DAY = 24 * ONE_HOUR; - - /** One week, in milliseconds; convenient as a time-out value **/ - public static final long ONE_WEEK = 7 * ONE_DAY; - - /** One year in milliseconds; convenient as a time-out value **/ - // Not that it matters, but there is some variation across - // standard sources about value at msec precision. - // The value used is the same as in java.util.GregorianCalendar - public static final long ONE_YEAR = (long)(365.2425 * ONE_DAY); - - /** One century in milliseconds; convenient as a time-out value **/ - public static final long ONE_CENTURY = 100 * ONE_YEAR; - - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/SyncUtil.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/SyncUtil.java deleted file mode 100644 index 2daa322d41f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/SyncUtil.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil.concurrent; - -import com.sun.corba.se.impl.orbutil.concurrent.Sync ; - -public class SyncUtil { - private SyncUtil() {} - - /** Method to acquire a Sync without ever throwing an - * InterruptedException. Useful when a mutex is being - * used in place of Java synchronization. - */ - public static void acquire( Sync sync ) - { - boolean held = false ; - while (!held) { - try { - sync.acquire() ; - held = true ; - } catch (InterruptedException exc) { - held = false ; - } - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/fsm/GuardedAction.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/fsm/GuardedAction.java deleted file mode 100644 index 6c237e86627..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/fsm/GuardedAction.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil.fsm ; - -import com.sun.corba.se.spi.orbutil.fsm.Guard ; -import com.sun.corba.se.spi.orbutil.fsm.GuardBase ; -import com.sun.corba.se.spi.orbutil.fsm.Input ; -import com.sun.corba.se.spi.orbutil.fsm.Action ; -import com.sun.corba.se.spi.orbutil.fsm.State ; -import com.sun.corba.se.spi.orbutil.fsm.FSM ; - -public class GuardedAction { - private static Guard trueGuard = new GuardBase( "true" ) { - public Guard.Result evaluate( FSM fsm, Input in ) - { - return Guard.Result.ENABLED ; - } - } ; - - private Guard guard ; - private Action action ; - private State nextState ; - - public GuardedAction( Action action, State nextState ) - { - this.guard = trueGuard ; - this.action = action ; - this.nextState = nextState ; - } - - public GuardedAction( Guard guard, Action action, State nextState ) - { - this.guard = guard ; - this.action = action ; - this.nextState = nextState ; - } - - public String toString() - { - return "GuardedAction[action=" + action + " guard=" + guard + - " nextState=" + nextState + "]" ; - } - - public Action getAction() { return action ; } - public Guard getGuard() { return guard ; } - public State getNextState() { return nextState ; } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/fsm/NameBase.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/fsm/NameBase.java deleted file mode 100644 index bc1bd9fbf68..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/fsm/NameBase.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil.fsm ; - -import com.sun.corba.se.spi.orbutil.fsm.Action ; -import com.sun.corba.se.spi.orbutil.fsm.State ; -import com.sun.corba.se.spi.orbutil.fsm.Guard ; -import com.sun.corba.se.spi.orbutil.fsm.Input ; - -import java.util.StringTokenizer ; - -public class NameBase { - private String name ; - private String toStringName ; - - // Return just the name of the class, not the full qualified name. - private String getClassName() - { - String fqn = this.getClass().getName() ; - StringTokenizer st = new StringTokenizer( fqn, "." ) ; - String token = st.nextToken() ; - while (st.hasMoreTokens()) - token = st.nextToken() ; - return token ; - } - - private String getPreferredClassName() - { - if (this instanceof Action) - return "Action" ; - if (this instanceof State) - return "State" ; - if (this instanceof Guard) - return "Guard" ; - if (this instanceof Input) - return "Input" ; - return getClassName() ; - } - - public NameBase( String name ) - { - this.name = name ; - toStringName = getPreferredClassName() + "[" + name + "]" ; - } - - public String getName() - { - return name ; - } - - public String toString() { - return toStringName ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/fsm/StateEngineImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/fsm/StateEngineImpl.java deleted file mode 100644 index 8a272fb8d8d..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/fsm/StateEngineImpl.java +++ /dev/null @@ -1,328 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil.fsm ; - -import java.util.HashMap ; -import java.util.HashSet ; -import java.util.Set ; -import java.util.Iterator ; - -import org.omg.CORBA.INTERNAL ; - -import com.sun.corba.se.impl.orbutil.ORBUtility ; - -import com.sun.corba.se.spi.orbutil.fsm.Input ; -import com.sun.corba.se.spi.orbutil.fsm.Guard ; -import com.sun.corba.se.spi.orbutil.fsm.Action ; -import com.sun.corba.se.spi.orbutil.fsm.ActionBase ; -import com.sun.corba.se.spi.orbutil.fsm.State ; -import com.sun.corba.se.spi.orbutil.fsm.StateEngine ; -import com.sun.corba.se.spi.orbutil.fsm.StateImpl ; -import com.sun.corba.se.spi.orbutil.fsm.FSM ; -import com.sun.corba.se.spi.orbutil.fsm.FSMImpl ; - -import com.sun.corba.se.impl.orbutil.fsm.GuardedAction ; - -/** - * Encodes the state transition function for a finite state machine. - * - * @author Ken Cavanaugh - */ -public class StateEngineImpl implements StateEngine -{ - // An action that does nothing at all. - private static Action emptyAction = new ActionBase( "Empty" ) - { - public void doIt( FSM fsm, Input in ) - { - } - } ; - - private boolean initializing ; - private Action defaultAction ; - - public StateEngineImpl() - { - initializing = true ; - defaultAction = new ActionBase("Invalid Transition") - { - public void doIt( FSM fsm, Input in ) - { - throw new INTERNAL( - "Invalid transition attempted from " + - fsm.getState() + " under " + in ) ; - } - } ; - } - - public StateEngine add( State oldState, Input input, Guard guard, Action action, - State newState ) throws IllegalArgumentException, - IllegalStateException - { - mustBeInitializing() ; - - StateImpl oldStateImpl = (StateImpl)oldState ; - GuardedAction ga = new GuardedAction( guard, action, newState ) ; - oldStateImpl.addGuardedAction( input, ga ) ; - - return this ; - } - - public StateEngine add( State oldState, Input input, Action action, - State newState ) throws IllegalArgumentException, - IllegalStateException - { - mustBeInitializing() ; - - StateImpl oldStateImpl = (StateImpl)oldState ; - GuardedAction ta = new GuardedAction( action, newState ) ; - oldStateImpl.addGuardedAction( input, ta ) ; - - return this ; - } - - public StateEngine setDefault( State oldState, Action action, State newState ) - throws IllegalArgumentException, IllegalStateException - { - mustBeInitializing() ; - - StateImpl oldStateImpl = (StateImpl)oldState ; - oldStateImpl.setDefaultAction( action ) ; - oldStateImpl.setDefaultNextState( newState ) ; - - return this ; - } - - public StateEngine setDefault( State oldState, State newState ) - throws IllegalArgumentException, IllegalStateException - { - return setDefault( oldState, emptyAction, newState ) ; - } - - public StateEngine setDefault( State oldState ) - throws IllegalArgumentException, IllegalStateException - { - return setDefault( oldState, oldState ) ; - } - - public void done() throws IllegalStateException - { - mustBeInitializing() ; - - // optimize FSM here if desired. For example, - // we could choose different strategies for implementing - // the state transition function based on the distribution - // of values for states and input labels. - - initializing = false ; - } - - public void setDefaultAction( Action act ) throws IllegalStateException - { - mustBeInitializing() ; - defaultAction = act ; - } - - public void doIt( FSM fsm, Input in, boolean debug ) - { - // This method is present only for debugging. - // innerDoIt does the actual transition. - - if (debug) - ORBUtility.dprint( this, "doIt enter: currentState = " + - fsm.getState() + " in = " + in ) ; - - try { - innerDoIt( fsm, in, debug ) ; - } finally { - if (debug) - ORBUtility.dprint( this, "doIt exit" ) ; - } - } - - private StateImpl getDefaultNextState( StateImpl currentState ) - { - // Use the currentState defaults if - // set, otherwise use the state engine default. - StateImpl nextState = (StateImpl)currentState.getDefaultNextState() ; - if (nextState == null) - // The state engine default never changes the state - nextState = currentState ; - - return nextState ; - } - - private Action getDefaultAction( StateImpl currentState ) - { - Action action = currentState.getDefaultAction() ; - if (action == null) - action = defaultAction ; - - return action ; - } - - private void innerDoIt( FSM fsm, Input in, boolean debug ) - { - if (debug) { - ORBUtility.dprint( this, "Calling innerDoIt with input " + in ) ; - } - - // Locals needed for performing the state transition, once we determine - // the required transition. - StateImpl currentState = null ; - StateImpl nextState = null ; - Action action = null ; - - // Do until no guard has deferred. - boolean deferral = false ; - do { - deferral = false ; // clear this after each deferral! - currentState = (StateImpl)fsm.getState() ; - nextState = getDefaultNextState( currentState ) ; - action = getDefaultAction( currentState ) ; - - if (debug) { - ORBUtility.dprint( this, "currentState = " + currentState ) ; - ORBUtility.dprint( this, "in = " + in ) ; - ORBUtility.dprint( this, "default nextState = " + nextState ) ; - ORBUtility.dprint( this, "default action = " + action ) ; - } - - Set gas = currentState.getGuardedActions(in) ; - if (gas != null) { - Iterator iter = gas.iterator() ; - - // Search for a guard that is not DISABLED. - // All DISABLED means use defaults. - while (iter.hasNext()) { - GuardedAction ga = (GuardedAction)iter.next() ; - Guard.Result gr = ga.getGuard().evaluate( fsm, in ) ; - if (debug) - ORBUtility.dprint( this, - "doIt: evaluated " + ga + " with result " + gr ) ; - - if (gr == Guard.Result.ENABLED) { - // ga has the next state and action. - nextState = (StateImpl)ga.getNextState() ; - action = ga.getAction() ; - if (debug) { - ORBUtility.dprint( this, "nextState = " + nextState ) ; - ORBUtility.dprint( this, "action = " + action ) ; - } - break ; - } else if (gr == Guard.Result.DEFERED) { - deferral = true ; - break ; - } - } - } - } while (deferral) ; - - performStateTransition( fsm, in, nextState, action, debug ) ; - } - - private void performStateTransition( FSM fsm, Input in, - StateImpl nextState, Action action, boolean debug ) - { - StateImpl currentState = (StateImpl)fsm.getState() ; - - // Perform the state transition. Pre and post actions are only - // performed if the state changes (see UML hidden transitions). - - boolean different = !currentState.equals( nextState ) ; - - if (different) { - if (debug) - ORBUtility.dprint( this, - "doIt: executing postAction for state " + currentState ) ; - try { - currentState.postAction( fsm ) ; - } catch (Throwable thr) { - if (debug) - ORBUtility.dprint( this, - "doIt: postAction threw " + thr ) ; - - if (thr instanceof ThreadDeath) - throw (ThreadDeath)thr ; - } - } - - try { - // Note that action may be null in a transition, which simply - // means that no action is needed. Note that action.doIt may - // throw an exception, in which case the exception is - // propagated after making sure that the transition is properly - // completed. - if (action != null) - action.doIt( fsm, in ) ; - } finally { - if (different) { - if (debug) - ORBUtility.dprint( this, - "doIt: executing preAction for state " + nextState ) ; - - try { - nextState.preAction( fsm ) ; - } catch (Throwable thr) { - if (debug) - ORBUtility.dprint( this, - "doIt: preAction threw " + thr ) ; - - if (thr instanceof ThreadDeath) - throw (ThreadDeath)thr ; - } - - ((FSMImpl)fsm).internalSetState( nextState ) ; - } - - if (debug) - ORBUtility.dprint( this, "doIt: state is now " + nextState ) ; - } - } - - public FSM makeFSM( State startState ) throws IllegalStateException - { - mustNotBeInitializing() ; - - return new FSMImpl( this, startState ) ; - } - - private void mustBeInitializing() throws IllegalStateException - { - if (!initializing) - throw new IllegalStateException( - "Invalid method call after initialization completed" ) ; - } - - private void mustNotBeInitializing() throws IllegalStateException - { - if (initializing) - throw new IllegalStateException( - "Invalid method call before initialization completed" ) ; - } -} - -// end of StateEngineImpl.java diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/graph/Graph.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/graph/Graph.java deleted file mode 100644 index d1ab1a05f90..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/graph/Graph.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil.graph ; - -import java.util.Set ; - -public interface Graph extends Set // Set -{ - NodeData getNodeData( Node node ) ; - - Set /* Set */ getRoots() ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/graph/GraphImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/graph/GraphImpl.java deleted file mode 100644 index fe75fbb0ffb..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/graph/GraphImpl.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil.graph ; - -import java.util.Collection ; -import java.util.AbstractSet ; -import java.util.Iterator ; -import java.util.Map ; -import java.util.HashMap ; -import java.util.Set ; -import java.util.HashSet ; - -public class GraphImpl extends AbstractSet implements Graph -{ - private Map /* Map */ nodeToData ; - - public GraphImpl() - { - nodeToData = new HashMap() ; - } - - public GraphImpl( Collection coll ) - { - this() ; - addAll( coll ) ; - } - -/***********************************************************************************/ -/************ AbstractSet implementation *******************************************/ -/***********************************************************************************/ - - // Required for AbstractSet - public boolean add( Object obj ) // obj must be a Node - { - if (!(obj instanceof Node)) - throw new IllegalArgumentException( "Graphs must contain only Node instances" ) ; - - Node node = (Node)obj ; - boolean found = nodeToData.keySet().contains( obj ) ; - - if (!found) { - NodeData nd = new NodeData() ; - nodeToData.put( node, nd ) ; - } - - return !found ; - } - - // Required for AbstractSet - public Iterator iterator() - { - return nodeToData.keySet().iterator() ; - } - - // Required for AbstractSet - public int size() - { - return nodeToData.keySet().size() ; - } - -/***********************************************************************************/ - - public NodeData getNodeData( Node node ) - { - return (NodeData)nodeToData.get( node ) ; - } - - private void clearNodeData() - { - // Clear every node - Iterator iter = nodeToData.entrySet().iterator() ; - while (iter.hasNext()) { - Map.Entry entry = (Map.Entry)iter.next() ; - NodeData nd = (NodeData)(entry.getValue()) ; - nd.clear( ) ; - } - } - - interface NodeVisitor - { - void visit( Graph graph, Node node, NodeData nd ) ; - } - - // This visits every node in the graph exactly once. A - // visitor is allowed to modify the graph during the - // traversal. - void visitAll( NodeVisitor nv ) - { - boolean done = false ; - - // Repeat the traversal until every node has been visited. Since - // it takes one pass to determine whether or not each node has - // already been visited, this loop always runs at least once. - do { - done = true ; - - // Copy entries to array to avoid concurrent modification - // problem with iterator if the visitor is updating the graph. - Map.Entry[] entries = - (Map.Entry[])nodeToData.entrySet().toArray( new Map.Entry[0] ) ; - - // Visit each node in the graph that has not already been visited. - // If any node is visited in this pass, we must run at least one more - // pass. - for (int ctr=0; ctr - while (iter.hasNext()) { - Node child = (Node)iter.next() ; - - // Make sure the child is in the graph so it can be - // visited later if necessary. - graph.add( child ) ; - - // Mark the child as a non-root, since a child is never a root. - NodeData cnd = graph.getNodeData( child ) ; - cnd.notRoot() ; - } - } - } ) ; - } - - private Set collectRootSet() - { - final Set result = new HashSet() ; - - Iterator iter = nodeToData.entrySet().iterator() ; - while (iter.hasNext()) { - Map.Entry entry = (Map.Entry)iter.next() ; - Node node = (Node)entry.getKey() ; - NodeData nd = (NodeData)entry.getValue() ; - if (nd.isRoot()) - result.add( node ) ; - } - - return result ; - } - - public Set /* Set */ getRoots() - { - clearNodeData() ; - markNonRoots() ; - return collectRootSet() ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/graph/Node.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/graph/Node.java deleted file mode 100644 index e2aad0011f2..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/graph/Node.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil.graph ; - -import java.util.Set ; - -/** Node in a graph. -*/ -public interface Node -{ - /** Get all the children of this node. - */ - Set /* Set */ getChildren() ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/graph/NodeData.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/graph/NodeData.java deleted file mode 100644 index ecdf2042fe9..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/graph/NodeData.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil.graph ; - -/** Data about a node in a graph. - */ -public class NodeData -{ - private boolean visited ; - private boolean root ; - - public NodeData() - { - clear() ; - } - - public void clear() - { - this.visited = false ; - this.root = true ; - } - - /** Return whether this node has been visited in a traversal. - * Note that we only support a single traversal at a time. - */ - boolean isVisited() - { - return visited ; - } - - void visited() - { - visited = true ; - } - - /** Return whether this node is a root. - */ - boolean isRoot() - { - return root ; - } - - void notRoot() - { - root = false ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb.properties b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb.properties deleted file mode 100644 index be50574ef6b..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb.properties +++ /dev/null @@ -1,193 +0,0 @@ -# -# Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -orbd.usage=Usage: {0} \ -\n\ -\nwhere includes:\ -\n -port Activation Port where the ORBD should be started, default 1049 (optional)\ -\n -defaultdb Directory for ORBD files, default "./orb.db" (optional)\ -\n -serverid Server Id for ORBD, default 1 (optional)\ -\n -ORBInitialPort Initial Port (required)\ -\n -ORBInitialHost Initial HostName (required)\ -\n\ - - -servertool.usage=Usage: {0} \ -\n\ -\nwhere includes:\ -\n -ORBInitialPort Initial Port (required)\ -\n -ORBInitialHost Initial HostName (required)\ -\n\ - -servertool.banner=\ -\n\ -\nWelcome to the Java IDL Server Tool \ -\nplease enter commands at the prompt \ -\n\ - -servertool.shorthelp=\ -\n\ -\n\tAvailable Commands: \ -\n\t------------------- \ -\n\ - -servertool.baddef=Bad server definition: {0} -servertool.nosuchserver=\tno such server found. -servertool.helddown=\tserver is held down. -servertool.nosuchorb=\tinvalid ORB. -servertool.serverup=\tserver is already up. -servertool.appname=\tapplicationName - {0} -servertool.name=\tname - {0} -servertool.classpath=\tclasspath - {0} -servertool.args=\targs - {0} -servertool.vmargs=\tvmargs - {0} -servertool.serverid=\tserver id - {0} -servertool.servernotrunning=\tserver is not running. -servertool.register=\ -\n\ -\n\tregister -server \ -\n\t -applicationName \ -\n\t -classpath \ -\n\t -args \ -\n\t -vmargs \ -\n\ - -servertool.register1=register an activatable server -servertool.register2=\tserver registered (serverid = {0}). -servertool.register3=\tserver registerd but held down (serverid = {0}). -servertool.register4=\tserver already registered (serverid = {0}). - -servertool.unregister=\ -\n\tunregister [ -serverid | -applicationName ] \ -\n\ - -servertool.unregister1=unregister a registered server -servertool.unregister2=\tserver unregistered. - -servertool.locate=\ -\n\tlocate [ -serverid | -applicationName ] [ <-endpointType ] \ -\n\ - -servertool.locate1=locate ports of specific type for a registered server -servertool.locate2=\ -\n\ -\n\tHost Name {0} \ -\n\ -\n\t\tPort\t\tPort Type\t\tORB Id\ -\n\t\t----\t\t---------\t\t------\ -\n\ - -servertool.locateorb=\ -\n\tlocateperorb [ -serverid | -applicationName ] [ -orbid ]\ -\n\ - -servertool.locateorb1=locate ports for a specific orb of registered server -servertool.locateorb2=\ -\n\ -\n\tHost Name {0} \ -\n\ -\n\t\tPort\t\tPortType\t\tORB Id\ -\n\t\t----\t\t--------\t\t------\ -\n\ - -servertool.getserverid=\n\tgetserverid [ -applicationName ] \ -\n\ - -servertool.getserverid1=return the server id for an applicationName -servertool.getserverid2=\tServer ID for applicationName {0} is {1} - -servertool.list=\n\tlist\ -\n\ - -servertool.list1=list all registered servers -servertool.list2=\ -\n\tServer Id\tServer Class Name\t\tServer Application\ -\n\t---------\t-----------------\t\t------------------\ -\n\ - -servertool.listactive=\n\tlistactive -servertool.listactive1=list currently active servers -servertool.listappnames=\tlistappnames\n -servertool.listappnames1=list applicationNames currently defined -servertool.listappnames2=Currently defined server applicationNames: - -servertool.shutdown=\ -\n\tshutdown [ -serverid | -applicationName ]\ -\n\ - -servertool.shutdown1=shutdown a registered server -servertool.shutdown2=\tserver sucessfully shutdown. -servertool.startserver=\ -\n\tstartup [ -serverid | -applicationName ]\ -\n\ - -servertool.startserver1=start a registered server -servertool.startserver2=\tserver sucessfully started up. - -servertool.quit=\n\tquit\n -servertool.quit1=quit this tool - -servertool.help=\thelp\ -\n\tOR\ -\n\thelp \ -\n\ - -servertool.help1=get help - -servertool.orbidmap=\tUsage: orblist [ -serverid | -applicationName ]\ -\n\ - -servertool.orbidmap1=list of orb names and their mapping -servertool.orbidmap2=\ -\n\tORB Id\t\tORB Name\ -\n\t------\t\t--------\ -\n\ - -pnameserv.success=Persistent NameServer Started Successfully - - -bootstrap.usage=Usage: {0} \ -\n\ -\nwhere includes:\ -\n -ORBInitialPort Initial Port (required)\ -\n -InitialServicesFile File containing list of initial services (required)\ -\n\ - -bootstrap.success=setting port to {0} and reading services from {1} -bootstrap.filenotreadable=the file {0} is not readable -bootstrap.filenotfound=the file {0} not found -bootstrap.exception=caught exception while saving Properties to file {0}: Exception {1} - -tnameserv.exception=caught an exception while starting the bootstrap service on port {0} -tnameserv.usage=try using a different port with commandline arguments -ORBInitialPort -tnameserv.invalidhostoption=ORBInitialHost is not a valid option for NameService -tnameserv.orbinitialport0=ORBInitialPort 0 is not valid option for NameService -tnameserv.hs1=Initial Naming Context:\n{0} -tnameserv.hs2=TransientNameServer: setting port for initial object references to: {0} -tnameserv.hs3=Ready. - -orbd.commfailure=\nFailed to start ORBD because ORBinitialPort is already in use -orbd.internalexception=\nFailed to start ORBD because of an Internal Exception. \nPossible Causes: \n1. Specified ORBInitialPort or ORBActivationPort is already in use \n2. No Write Permission to write orb.db - diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_de.properties b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_de.properties deleted file mode 100644 index edfff12bdd6..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_de.properties +++ /dev/null @@ -1,107 +0,0 @@ -# -# Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -orbd.usage=Verwendung: {0} \n\nwobei folgende m\u00F6glich sind:\n -port Aktivierungsport, an dem der ORBD gestartet werden sollte, Standardwert 1049 (optional)\n -defaultdb Verzeichnis f\u00FCr ORBD-Dateien, Standardwert "./orb.db" (optional)\n -serverid Server-ID f\u00FCr ORBD, Standardwert 1 (optional)\n -ORBInitialPort Anfangsport (erforderlich)\n -ORBInitialHost Anf\u00E4nglicher HostName (erforderlich)\n - -servertool.usage=Verwendung: {0} \n\nwobei folgende m\u00F6glich sind:\n -ORBInitialPort Anfangsport (erforderlich)\n -ORBInitialHost Anf\u00E4nglicher HostName (erforderlich)\n -servertool.banner=\n\nWillkommen beim Java IDL-Servertool \nGeben Sie die entsprechenden Befehle im Prompt ein \n -servertool.shorthelp=\n\n\tVerf\u00FCgbare Befehle: \n\t------------------- \n -servertool.baddef=Ung\u00FCltige Serverdefinition: {0} -servertool.nosuchserver=\tServer wurde nicht gefunden. -servertool.helddown=\tServer ist au\u00DFer Betrieb. -servertool.nosuchorb=\tUng\u00FCltiger ORB. -servertool.serverup=\tServer ist bereits hochgefahren. -servertool.appname=\tapplicationName - {0} -servertool.name=\tName - {0} -servertool.classpath=\tclasspath - {0} -servertool.args=\targs - {0} -servertool.vmargs=\tvmargs - {0} -servertool.serverid=\tServer-ID - {0} -servertool.servernotrunning=\tServer wird nicht ausgef\u00FChrt. -servertool.register=\n\n\tregister -server \n\t -applicationName \n\t -classpath \n\t -args \n\t -vmargs \n -servertool.register1=aktivierbaren Server registrieren -servertool.register2=\tServer registriert (serverid = {0}). -servertool.register3=\tServer registriert, aber au\u00DFer Betrieb (serverid = {0}). -servertool.register4=\tServer bereits registriert (serverid = {0}). - -servertool.unregister=\n\tunregister [ -serverid | -applicationName ] \n -servertool.unregister1=Registrierung eines registrierten Servers aufheben -servertool.unregister2=\tServerregistrierung aufgehoben. - -servertool.locate=\n\tlocate [ -serverid | -applicationName ] [ <-endpointType ] \n -servertool.locate1=Ports eines speziellen Typs f\u00FCr einen registrierten Server finden -servertool.locate2=\n\n\tHostname {0} \n\n\t\tPort\t\tPorttyp\t\tORB-ID\n\t\t----\t\t-------\t\t------\n -servertool.locateorb=\n\tlocateperorb [ -serverid | -applicationName ] [ -orbid ]\n -servertool.locateorb1=Ports f\u00FCr einen speziellen ORB bei einem registrierten Server finden -servertool.locateorb2=\n\n\tHostname {0} \n\n\t\tPort\t\tPortType\t\tORB-ID\n\t\t----\t\t-------\t\t------\n -servertool.getserverid=\n\tgetserverid [ -applicationName ] \n -servertool.getserverid1=Server-ID f\u00FCr applicationName zur\u00FCckgeben -servertool.getserverid2=\tServer-ID f\u00FCr applicationName {0} ist {1} - -servertool.list=\n\tlist\n -servertool.list1=alle registrierten Server auflisten -servertool.list2=\n\tServer-ID\tServerklassenname\t\tServeranwendung\n\t---------\t-----------------\t\t------------------\n -servertool.listactive=\n\tlistactive -servertool.listactive1=derzeit aktive Server auflisten -servertool.listappnames=\tlistappnames\n -servertool.listappnames1=derzeit definierte applicationNames auflisten -servertool.listappnames2=Derzeit definierte Server-applicationNames: - -servertool.shutdown=\n\tshutdown [ -serverid | -applicationName ]\n -servertool.shutdown1=registrierten Server herunterfahren -servertool.shutdown2=\tServer erfolgreich heruntergefahren. -servertool.startserver=\n\tstartup [ -serverid | -applicationName ]\n -servertool.startserver1=registrierten Server starten -servertool.startserver2=\tServer erfolgreich hochgefahren. - -servertool.quit=\n\tquit\n -servertool.quit1=dieses Tool beenden - -servertool.help=\thelp\n\tOR\n\thelp \n -servertool.help1=Hilfe abrufen - -servertool.orbidmap=\\Verwendung: orblist [ -serverid | -applicationName ]\n -servertool.orbidmap1=Liste von ORB-Namen und ihren Zuordnungen -servertool.orbidmap2=\n\tORB-ID\t\tORB-Name\n\t------\t\t--------\n -pnameserv.success=Persistenter NameServer erfolgreich gestartet - - -bootstrap.usage=Verwendung: {0} \n\nwobei folgende m\u00F6glich sind:\n -ORBInitialPort Anf\u00E4nglicher Port (erforderlich)\n -InitialServicesFile Datei mit Liste von anf\u00E4nglichen Services (erforderlich)\n -bootstrap.success=Port wird auf {0} gesetzt, Services werden aus {1} gelesen -bootstrap.filenotreadable=Datei {0} kann nicht gelesen werden -bootstrap.filenotfound=Datei {0} wurde nicht gefunden -bootstrap.exception=Beim Speichern von Eigenschaften in Datei {0} wurde eine Ausnahme abgefangen: Ausnahme {1} - -tnameserv.exception=Beim Hochfahren des Bootstrap-Services auf Port {0} wurde eine Ausnahme abgefangen -tnameserv.usage=Verwenden Sie einen anderen Port mit den Befehlszeilenargumenten -ORBInitialPort -tnameserv.invalidhostoption=ORBInitialHost ist keine g\u00FCltige Option f\u00FCr NameService -tnameserv.orbinitialport0=ORBInitialPort 0 ist keine g\u00FCltige Option f\u00FCr NameService -tnameserv.hs1=Anf\u00E4nglicher Namenskontext:\n{0} -tnameserv.hs2=TransientNameServer: Port f\u00FCr anf\u00E4ngliche Objektreferenzen wird auf {0} gesetzt -tnameserv.hs3=Bereit. - -orbd.commfailure=\nStart von ORBD nicht erfolgreich, da ORBinitialPort bereits verwendet wird -orbd.internalexception=\nStart von ORBD aufgrund einer internen Ausnahme nicht erfolgreich. \nM\u00F6gliche Ursachen: \n1. Der angegebene ORBInitialPort oder ORBActivationPort wird bereits verwendet \n2. Keine Berechtigung zum Schreiben von orb.db - diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_es.properties b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_es.properties deleted file mode 100644 index 74c6b3a40ca..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_es.properties +++ /dev/null @@ -1,107 +0,0 @@ -# -# Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -orbd.usage=Sintaxis: {0} \n\ndonde incluye:\n -port Puerto de activaci\u00F3n en el que se debe iniciar el ORBD, por defecto es el 1049 (opcional)\n -defaultdb Directorio para los archivos de ORBD, por defecto es "./orb.db" (opcional)\n -serverid Identificador de servidor para ORBD, por defecto es 1 (opcional)\n -ORBInitialPort Puerto inicial (necesario)\n -ORBInitialHost Nombre de host inicial (necesario)\n - -servertool.usage=Sintaxis: {0} \n\ndonde incluye:\n -ORBInitialPort Puerto inicial (necesario)\n -ORBInitialHost Nombre de host inicial (necesario)\n -servertool.banner=\n\nBienvenido a Java IDL Server Tool \nescriba los comandos en la petici\u00F3n de datos \n -servertool.shorthelp=\n\n\tComandos disponibles: \n\t------------------- \n -servertool.baddef=Definici\u00F3n de servidor incorrecta: {0} -servertool.nosuchserver=\tno se ha encontrado el servidor. -servertool.helddown=\tel servidor se mantiene desconectado. -servertool.nosuchorb=\tORB no v\u00E1lido. -servertool.serverup=\tel servidor ya est\u00E1 conectado. -servertool.appname=\tapplicationName - {0} -servertool.name=\tname - {0} -servertool.classpath=\tclasspath - {0} -servertool.args=\targs - {0} -servertool.vmargs=\tvmargs - {0} -servertool.serverid=\tserver id - {0} -servertool.servernotrunning=\tel servidor no se est\u00E1 ejecutando. -servertool.register=\n\n\tregister -server \n\t -applicationName \n\t -classpath \n\t -args \n\t -vmargs \n -servertool.register1=registrar un servidor que se pueda activar -servertool.register2=\tservidor registrado (identificador de servidor = {0}). -servertool.register3=\tservidor registrado pero desconectado (identificador de servidor = {0}). -servertool.register4=\tservidor ya registrado (identificador de servidor = {0}). - -servertool.unregister=\n\tunregister [ -serverid | -applicationName ] \n -servertool.unregister1=anular el registro de un servidor registrado -servertool.unregister2=\tanulado el registro del servidor. - -servertool.locate=\n\tlocate [ -serverid | -applicationName ] [ <-endpointType ] \n -servertool.locate1=localizar puertos de un tipo espec\u00EDfico para un servidor registrado -servertool.locate2=\n\n\tNombre de host {0} \n\n\t\tPuerto\t\tTipo de puerto\t\tIdentificador ORB\n\t\t----\t\t---------\t\t------\n -servertool.locateorb=\n\tlocateperorb [ -serverid | -applicationName ] [ -orbid ]\n -servertool.locateorb1=localizar puertos para un ORB espec\u00EDfico del servidor registrado -servertool.locateorb2=\n\n\tNombre de host {0} \n\n\t\tPuerto\t\tTipo de puerto\t\tIdentificador de ORB\n\t\t----\t\t--------\t\t------\n -servertool.getserverid=\n\tgetserverid [ -applicationName ] \n -servertool.getserverid1=devolver el identificador de servidor para un valor de applicationName -servertool.getserverid2=\tEl identificador de servidor para applicationName {0} es {1} - -servertool.list=\n\tlist\n -servertool.list1=enumerar todos los servidores registrados -servertool.list2=\n\tIdentificador de servidor\tNombre de clase del servidor\t\tAplicaci\u00F3n de servidor\n\t-------------------------\t----------------------------\t\t----------------------\n -servertool.listactive=\n\tlistactive -servertool.listactive1=enumerar los servidores actualmente activos -servertool.listappnames=\tlistappnames\n -servertool.listappnames1=enumerar los nombres de aplicaci\u00F3n actualmente definidos -servertool.listappnames2=Nombres de aplicaci\u00F3n de servidor actualmente definidos: - -servertool.shutdown=\n\tshutdown [ -serverid | -applicationName ]\n -servertool.shutdown1=apagar un servidor registrado -servertool.shutdown2=\tservidor apagado correctamente. -servertool.startserver=\n\tstartup [ -serverid | -applicationName ]\n -servertool.startserver1=iniciar un servidor registrado -servertool.startserver2=\tservidor iniciado correctamente. - -servertool.quit=\n\tquit\n -servertool.quit1=salir de esta herramienta - -servertool.help=\thelp\n\tO\n\thelp \n -servertool.help1=obtener ayuda - -servertool.orbidmap=\tSintaxis: orblist [ -serverid | -applicationName ]\n -servertool.orbidmap1=lista de nombres de ORB y su asignaci\u00F3n -servertool.orbidmap2=\n\tIdentificador de ORB\t\tNombre de ORB\n\t------\t\t--------\n -pnameserv.success=NameServer constante iniciado correctamente - - -bootstrap.usage=Sintaxis: {0} \n\ndonde incluye:\n -ORBInitialPort Puerto inicial (necesario)\n -InitialServicesFile Archivo que contiene una lista de los servicios iniciales (necesario)\n -bootstrap.success=definiendo puerto en {0} y leyendo servicios de {1} -bootstrap.filenotreadable=el archivo {0} no se puede leer -bootstrap.filenotfound=no se ha encontrado el archivo {0} -bootstrap.exception=se ha obtenido una excepci\u00F3n al guardar las propiedades en el archivo {0}: Excepci\u00F3n {1} - -tnameserv.exception=se ha obtenido una excepci\u00F3n al iniciar el servicio de inicializaci\u00F3n de datos en el puerto {0} -tnameserv.usage=intente utilizar un puerto distinto con argumentos de l\u00EDnea de comandos -ORBInitialPort -tnameserv.invalidhostoption=ORBInitialHost no es una opci\u00F3n v\u00E1lida para NameService -tnameserv.orbinitialport0=ORBInitialPort 0 no es una opci\u00F3n v\u00E1lida para NameService -tnameserv.hs1=Contexto de Nomenclatura Inicial:\n{0} -tnameserv.hs2=TransientNameServer: definiendo puerto para referencias a objeto iniciales en: {0} -tnameserv.hs3=Listo. - -orbd.commfailure=\nORBD no puede iniciarse porque ORBinitialPort ya est\u00E1 en uso -orbd.internalexception=\nORBD no puede iniciarse debido a una excepci\u00F3n interna. \nCausas posibles: \n1. El ORBInitialPort o el ORBActivationPort especificado ya est\u00E1 en uso \n2. No tiene permiso de escritura para orb.db - diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_fr.properties b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_fr.properties deleted file mode 100644 index 6071d09878f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_fr.properties +++ /dev/null @@ -1,107 +0,0 @@ -# -# Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -orbd.usage=Syntaxe : {0} \n\no\u00F9 comprend :\n -port Port d''activation o\u00F9 l''ORBD doit \u00EAtre d\u00E9marr\u00E9, 1049 par d\u00E9faut (facultatif)\n -defaultdb R\u00E9pertoire des fichiers ORBD, par d\u00E9faut "./orb.db" (facultatif)\n -serverid ID de serveur pour ORBD, 1 par d\u00E9faut (facultatif)\n -ORBInitialPort Port initial (obligatoire)\n -ORBInitialHost Nom d''h\u00F4te initial (obligatoire)\n - -servertool.usage=Syntaxe : {0} \n\no\u00F9 comprend :\n -ORBInitialPort Port initial (obligatoire)\n -ORBInitialHost Nom d''h\u00F4te initial (obligatoire)\n -servertool.banner=\n\nBienvenue dans l'outil Java IDL Server Tool \nSp\u00E9cifiez des commandes \u00E0 l'invite \n -servertool.shorthelp=\n\n\tCommandes disponibles : \n\t------------------- \n -servertool.baddef=D\u00E9finition de serveur incorrecte : {0} -servertool.nosuchserver=\tce serveur est introuvable. -servertool.helddown=\tserveur interrompu. -servertool.nosuchorb=\tORB non valide. -servertool.serverup=\tle serveur fonctionne d\u00E9j\u00E0. -servertool.appname=\tapplicationName - {0} -servertool.name=\tname - {0} -servertool.classpath=\tclasspath - {0} -servertool.args=\targs - {0} -servertool.vmargs=\tvmargs - {0} -servertool.serverid=\tID de serveur - {0} -servertool.servernotrunning=\tle serveur ne fonctionne pas. -servertool.register=\n\n\tregister -server \n\t -applicationName \n\t -classpath \n\t -args \n\t -vmargs \n -servertool.register1=inscrire un serveur activable -servertool.register2=\tserveur inscrit (ID serveur = {0}). -servertool.register3=\tserveur inscrit mais interrompu (ID serveur = {0}). -servertool.register4=\tserveur d\u00E9j\u00E0 inscrit (ID serveur = {0}). - -servertool.unregister=\n\tunregister [ -serverid | -applicationName ] \n -servertool.unregister1=d\u00E9sinscrire un serveur inscrit -servertool.unregister2=\tserveur d\u00E9sinscrit. - -servertool.locate=\n\tlocate [ -serverid | -applicationName ] [ <-endpointType ] \n -servertool.locate1=rep\u00E9rer des ports de type sp\u00E9cifique d'un serveur inscrit -servertool.locate2=\n\n\tNom d''h\u00F4te {0} \n\n\t\tPort\t\tType de port\t\tID ORB\n\t\t----\t\t---------\t\t------\n -servertool.locateorb=\n\tlocateperorb [ -serverid | -applicationName ] [ -orbid ]\n -servertool.locateorb1=rep\u00E9rer les ports d'un ORB sp\u00E9cifique de serveur inscrit -servertool.locateorb2=\n\n\tNom d''h\u00F4te {0} \n\n\t\tPort\t\tType de port\t\tID ORB\n\t\t----\t\t--------\t\t------\n -servertool.getserverid=\n\tgetserverid [ -applicationName ] \n -servertool.getserverid1=renvoyer l'ID serveur pour un nom d'application -servertool.getserverid2=\tL''ID serveur du nom d''application {0} est {1} - -servertool.list=\n\tlist\n -servertool.list1=lister tous les serveurs inscrits -servertool.list2=\n\tID serveur\tNom de classe serveur\t\tApplication serveur\n\t---------\t-----------------\t\t------------------\n -servertool.listactive=\n\tlistactive -servertool.listactive1=lister les serveurs actifs -servertool.listappnames=\tlistappnames\n -servertool.listappnames1=lister les noms d'application d\u00E9finis -servertool.listappnames2=Noms d'application du serveur d\u00E9finis : - -servertool.shutdown=\n\tshutdown [ -serverid | -applicationName ]\n -servertool.shutdown1=arr\u00EAter un serveur inscrit -servertool.shutdown2=\tserveur arr\u00EAt\u00E9. -servertool.startserver=\n\tstartup [ -serverid | -applicationName ]\n -servertool.startserver1=d\u00E9marrer un serveur inscrit -servertool.startserver2=\tserveur d\u00E9marr\u00E9. - -servertool.quit=\n\tquit\n -servertool.quit1=fermer cet outil - -servertool.help=\thelp\n\tOR\n\thelp \n -servertool.help1=afficher l'aide - -servertool.orbidmap=\tSyntaxe : orblist [ -serverid | -applicationName ]\n -servertool.orbidmap1=liste des noms ORB et de leur mappage -servertool.orbidmap2=\n\tID ORB\t\tNom ORB\n\t------\t\t--------\n -pnameserv.success=NameServer persistant d\u00E9marr\u00E9 - - -bootstrap.usage=Syntaxe : {0} \n\no\u00F9 comprend :\n -ORBInitialPort Port initial (obligatoire)\n -InitialServicesFile Fichier contenant la liste des services initiaux (obligatoire)\n -bootstrap.success=configuration du port sur {0} et lecture des services de {1} -bootstrap.filenotreadable=le fichier {0} n''est pas lisible -bootstrap.filenotfound=fichier {0} introuvable -bootstrap.exception=exception d\u00E9tect\u00E9e lors de l''enregistrement des propri\u00E9t\u00E9s dans le fichier {0}. Exception : {1} - -tnameserv.exception=exception d\u00E9tect\u00E9e lors du d\u00E9marrage du service bootstrap sur le port {0} -tnameserv.usage=essayez un autre port avec les arguments de ligne de commande -ORBInitialPort -tnameserv.invalidhostoption=ORBInitialHost n'est pas une option valide pour NameService -tnameserv.orbinitialport0=ORBInitialPort 0 n'est pas une option valide pour NameService -tnameserv.hs1=Contexte de d\u00E9nomination initial :\n{0} -tnameserv.hs2=TransientNameServer : configuration du port pour des r\u00E9f\u00E9rences d''objet initial sur {0} -tnameserv.hs3=Pr\u00EAt. - -orbd.commfailure=\nLe d\u00E9marrage d'ORBD a \u00E9chou\u00E9 car ORBinitialPort est d\u00E9j\u00E0 utilis\u00E9 -orbd.internalexception=\nLe d\u00E9marrage d'ORBD a \u00E9chou\u00E9 en raison d'une exception interne. \nCauses possibles\u00A0: \n1. L'\u00E9l\u00E9ment ORBInitialPort ou ORBActivationPort sp\u00E9cifi\u00E9 est d\u00E9j\u00E0 utilis\u00E9 \n2. Aucune autorisation en \u00E9criture permettant d'\u00E9crire orb.db - diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_it.properties b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_it.properties deleted file mode 100644 index 02f0f21731f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_it.properties +++ /dev/null @@ -1,107 +0,0 @@ -# -# Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -orbd.usage=Uso: {0} \n\ndove include:\n -port Porta di attivazione da cui avviare ORBD, valore predefinito 1049 (opzionale)\n -defaultdb Directory per i file ORBD, valore predefinito "./orb.db" (opzionale)\n -serverid ID server per ORBD, valore predefinito 1 (opzionale)\n -ORBInitialPort Porta iniziale (richiesta)\n -ORBInitialHost HostName iniziale (richiesto)\n - -servertool.usage=Uso: {0} \n\ndove include:\n -ORBInitialPort Porta iniziale (richiesta)\n -ORBInitialHost HostName iniziale (richiesto)\n -servertool.banner=\n\nBenvenuti in Java IDL Server Tool \nimmettere i comandi quando richiesto \n -servertool.shorthelp=\n\n\tComandi disponibili:\n\t-------------------- \n -servertool.baddef=Definizione server errata: {0} -servertool.nosuchserver=\timpossibile trovare il server indicato. -servertool.helddown=\til server \u00E8 mantenuto inattivo. -servertool.nosuchorb=\tORB non valido. -servertool.serverup=\til server \u00E8 gi\u00E0 attivo. -servertool.appname=\tapplicationName - {0} -servertool.name=\tnome - {0} -servertool.classpath=\tclasspath - {0} -servertool.args=\targom - {0} -servertool.vmargs=\targomvm - {0} -servertool.serverid=\tID server - {0} -servertool.servernotrunning=\til server non \u00E8 in funzione. -servertool.register=\n\n\tregister -server \n\t -applicationName \n\t -classpath \n\t -args \n\t -vmargs \n -servertool.register1=registra un server attivabile -servertool.register2=\tserver registrato (idserver = {0}). -servertool.register3=\tserver registrato ma mantenuto inattivo (idserver = {0}). -servertool.register4=\tserver gi\u00E0 registrato (idserver = {0}). - -servertool.unregister=\n\tunregister [ -serverid | -applicationName ] \n -servertool.unregister1=rimuovi un server registrato. -servertool.unregister2=\tserver rimosso dal registro. - -servertool.locate=\n\tlocate [ -serverid | -applicationName ] [ <-endpointType ] \n -servertool.locate1=individua le porte di un tipo specifico per un server registrato -servertool.locate2=\n\n\tNome host {0} \n\n\t\tPorta\t\tTipo porta\t\tId ORB\n\t\t-----\t\t----------\t\t------\n -servertool.locateorb=\n\tlocateperorb [ -serverid | -applicationName ] [ -orbid ]\n -servertool.locateorb1=individua le porte per un orb specifico di un server registrato -servertool.locateorb2=\n\n\tNome host {0} \n\n\t\tPorta\t\tPortType\t\tId ORB\n\t\t-----\t\t---------\t\t------\n -servertool.getserverid=\n\tgetserverid [ -applicationName ] \n -servertool.getserverid1=restituisce l'id server per un applicationName -servertool.getserverid2=\tL''ID server per applicationName {0} \u00E8 {1} - -servertool.list=\n\tlista\n -servertool.list1=elenca tutti i server registrati -servertool.list2=\n\tID server\tNome classe server\t\tApplicazione server\n\t---------\t------------------\t\t-------------------\n -servertool.listactive=\n\tlistactive -servertool.listactive1=elenca i server attivi al momento -servertool.listappnames=\tlistappnames\n -servertool.listappnames1=elenca applicationNames definiti al momento -servertool.listappnames2=applicationNames del server definiti al momento: - -servertool.shutdown=\n\tshutdown [ -serverid | -applicationName ]\n -servertool.shutdown1=arresta un server registrato -servertool.shutdown2=\tserver arrestato correttamente -servertool.startserver=\n\tstartup [ -serverid | -applicationName ]\n -servertool.startserver1=avvia un server registrato -servertool.startserver2=\tserver avviato correttamente. - -servertool.quit=\n\tesci\n -servertool.quit1=esci dall'applicazione corrente - -servertool.help=\thelp\n\tOR\n\thelp \n -servertool.help1=Guida - -servertool.orbidmap=\tUso: orblist [ -serverid | -applicationName ]\n -servertool.orbidmap1=lista nomi orb e relativa mappatura -servertool.orbidmap2=\n\tId ORB\t\tNome ORB\n\t------\t\t--------\n -pnameserv.success=NameServer persistente avviato correttamente - - -bootstrap.usage=Uso: {0} \n\ndove include:\n -ORBInitialPort Porta iniziale (richiesta)\n -InitialServicesFile File contenente la lista dei servizi iniziali (richiesto)\n -bootstrap.success=impostazione porta su {0} e lettura servizi da {1} in corso -bootstrap.filenotreadable=il file {0} non \u00E8 leggibile -bootstrap.filenotfound=impossibile trovare il file {0} -bootstrap.exception=rilevata un''eccezione durante il salvataggio delle propriet\u00E0 nel file {0}: eccezione {1} - -tnameserv.exception=rilevata un''eccezione durante l''avvio del servizio di bootstrap sulla porta {0} -tnameserv.usage=utilizzare un'altra porta con gli argomenti di riga di comando -ORBInitialPort -tnameserv.invalidhostoption=ORBInitialHost non \u00E8 un'opzione valida per NameService -tnameserv.orbinitialport0=ORBInitialPort 0 non \u00E8 un'opzione valida per NameService -tnameserv.hs1=Contesto di denominazione iniziale:\n{0} -tnameserv.hs2=TransientNameServer: impostazione della porta per i riferimenti degli oggetti iniziali a: {0} -tnameserv.hs3=Pronto. - -orbd.commfailure=\nImpossibile avviare ORBD perch\u00E9 ORBinitialPort \u00E8 gi\u00E0 in uso -orbd.internalexception=\nImpossibile avviare ORBD a causa di un'eccezione interna. \neCause possibili: \n1. ORBInitialPort o ORBActivationPort specificato gi\u00E0 in uso \n2. Non esistono autorizzazioni per scrivere orb.db - diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_ja.properties b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_ja.properties deleted file mode 100644 index 0ccd2ec229c..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_ja.properties +++ /dev/null @@ -1,107 +0,0 @@ -# -# Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -orbd.usage=\u4F7F\u7528\u65B9\u6CD5: {0} \n\n\u306B\u306F\u6B21\u306E\u3082\u306E\u304C\u3042\u308A\u307E\u3059\u3002\n -port ORBD\u306E\u8D77\u52D5\u30DD\u30FC\u30C8\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u306F1049(\u30AA\u30D7\u30B7\u30E7\u30F3)\n -defaultdb ORBD\u30D5\u30A1\u30A4\u30EB\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u306F"./orb.db"(\u30AA\u30D7\u30B7\u30E7\u30F3)\n -serverid ORBD\u306E\u30B5\u30FC\u30D0\u30FCId\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u306F1(\u30AA\u30D7\u30B7\u30E7\u30F3)\n -ORBInitialPort \u521D\u671F\u30DD\u30FC\u30C8(\u5FC5\u9808)\n -ORBInitialHost \u521D\u671F\u30DB\u30B9\u30C8\u540D(\u5FC5\u9808)\n - -servertool.usage=\u4F7F\u7528\u65B9\u6CD5: {0} \n\n\u306B\u306F\u6B21\u306E\u3082\u306E\u304C\u3042\u308A\u307E\u3059\u3002\n -ORBInitialPort \u521D\u671F\u30DD\u30FC\u30C8(\u5FC5\u9808)\n -ORBInitialHost \u521D\u671F\u30DB\u30B9\u30C8\u540D(\u5FC5\u9808)\n -servertool.banner=\n\nJava IDL Server Tool\u3078\u3088\u3046\u3053\u305D\n\u30D7\u30ED\u30F3\u30D7\u30C8\u306B\u30B3\u30DE\u30F3\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\n -servertool.shorthelp=\n\n\t\u4F7F\u7528\u53EF\u80FD\u306A\u30B3\u30DE\u30F3\u30C9: \n\t------------------- \n -servertool.baddef=\u4E0D\u6B63\u306A\u30B5\u30FC\u30D0\u30FC\u5B9A\u7FA9: {0} -servertool.nosuchserver=\t\u6307\u5B9A\u3055\u308C\u305F\u30B5\u30FC\u30D0\u30FC\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002 -servertool.helddown=\t\u30B5\u30FC\u30D0\u30FC\u306F\u505C\u6B62\u3057\u3066\u3044\u307E\u3059\u3002 -servertool.nosuchorb=\tORB\u304C\u7121\u52B9\u3067\u3059\u3002 -servertool.serverup=\t\u30B5\u30FC\u30D0\u30FC\u306F\u8D77\u52D5\u3057\u3066\u3044\u307E\u3059\u3002 -servertool.appname=\tapplicationName - {0} -servertool.name=\tname - {0} -servertool.classpath=\tclasspath - {0} -servertool.args=\targs - {0} -servertool.vmargs=\tvmargs - {0} -servertool.serverid=\tserver id - {0} -servertool.servernotrunning=\t\u30B5\u30FC\u30D0\u30FC\u306F\u7A3C\u50CD\u3057\u3066\u3044\u307E\u305B\u3093\u3002 -servertool.register=\n\n\tregister -server \n\t -applicationName \n\t -classpath \n\t -args \n\t -vmargs \n -servertool.register1=\u8D77\u52D5\u53EF\u80FD\u306A\u30B5\u30FC\u30D0\u30FC\u3092\u767B\u9332\u3057\u307E\u3059 -servertool.register2=\t\u767B\u9332\u3055\u308C\u305F\u30B5\u30FC\u30D0\u30FC(serverid={0})\u3002 -servertool.register3=\t\u767B\u9332\u3055\u308C\u3066\u3044\u308B\u304C\u8D77\u52D5\u3057\u3066\u3044\u306A\u3044\u30B5\u30FC\u30D0\u30FC(serverid={0})\u3002 -servertool.register4=\t\u767B\u9332\u6E08\u306E\u30B5\u30FC\u30D0\u30FC(serverid={0})\u3002 - -servertool.unregister=\n\tunregister [ -serverid | -applicationName ]\n -servertool.unregister1=\u767B\u9332\u3055\u308C\u305F\u30B5\u30FC\u30D0\u30FC\u306E\u767B\u9332\u3092\u89E3\u9664\u3057\u307E\u3059 -servertool.unregister2=\t\u30B5\u30FC\u30D0\u30FC\u306E\u767B\u9332\u304C\u89E3\u9664\u3055\u308C\u307E\u3057\u305F\u3002 - -servertool.locate=\n\tlocate [ -serverid | -applicationName ] [ <-endpointType ]\n -servertool.locate1=\u767B\u9332\u3055\u308C\u305F\u30B5\u30FC\u30D0\u30FC\u306E\u7279\u5B9A\u30BF\u30A4\u30D7\u306E\u30DD\u30FC\u30C8\u3092\u691C\u51FA\u3057\u307E\u3059 -servertool.locate2=\n\n\t\u30DB\u30B9\u30C8\u540D{0}\n\n\t\t\u30DD\u30FC\u30C8\t\t\u30DD\u30FC\u30C8\u30FB\u30BF\u30A4\u30D7\t\tORB ID\n\t\t------\t\t------------\t\t------\n -servertool.locateorb=\n\tlocateperorb [ -serverid | -applicationName ] [ -orbid ]\n -servertool.locateorb1=\u767B\u9332\u3055\u308C\u305F\u30B5\u30FC\u30D0\u30FC\u306E\u7279\u5B9AORB\u306E\u30DD\u30FC\u30C8\u3092\u691C\u51FA\u3057\u307E\u3059 -servertool.locateorb2=\n\n\t\u30DB\u30B9\u30C8\u540D{0}\n\n\t\t\u30DD\u30FC\u30C8\t\t\u30DD\u30FC\u30C8\u30FB\u30BF\u30A4\u30D7\t\tORB ID\n\t\t------\t\t------------\t\t------\n -servertool.getserverid=\n\tgetserverid [ -applicationName ]\n -servertool.getserverid1=applicationName\u306E\u30B5\u30FC\u30D0\u30FCID\u3092\u8FD4\u3057\u307E\u3059 -servertool.getserverid2=\tapplicationName {0}\u306E\u30B5\u30FC\u30D0\u30FCID\u306F{1}\u3067\u3059 - -servertool.list=\n\tlist\n -servertool.list1=\u767B\u9332\u3055\u308C\u305F\u3059\u3079\u3066\u306E\u30B5\u30FC\u30D0\u30FC\u306E\u30EA\u30B9\u30C8\u3092\u8868\u793A\u3057\u307E\u3059 -servertool.list2=\n\t\u30B5\u30FC\u30D0\u30FCID\t\u30B5\u30FC\u30D0\u30FC\u306E\u30AF\u30E9\u30B9\u540D\t\t\u30B5\u30FC\u30D0\u30FC\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\n\t---------\t----------------\t\t----------------------\n -servertool.listactive=\n\tlistactive -servertool.listactive1=\u73FE\u5728\u30A2\u30AF\u30C6\u30A3\u30D6\u306A\u30B5\u30FC\u30D0\u30FC\u306E\u30EA\u30B9\u30C8\u3092\u8868\u793A\u3057\u307E\u3059 -servertool.listappnames=\tlistappnames\n -servertool.listappnames1=\u73FE\u5728\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u308BapplicationNames\u306E\u30EA\u30B9\u30C8\u3092\u8868\u793A\u3057\u307E\u3059 -servertool.listappnames2=\u73FE\u5728\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u308B\u30B5\u30FC\u30D0\u30FCapplicationNames: - -servertool.shutdown=\n\tshutdown [ -serverid | -applicationName ]\n -servertool.shutdown1=\u767B\u9332\u3055\u308C\u305F\u30B5\u30FC\u30D0\u30FC\u3092\u505C\u6B62\u3057\u307E\u3059 -servertool.shutdown2=\t\u30B5\u30FC\u30D0\u30FC\u306E\u505C\u6B62\u306B\u6210\u529F\u3057\u307E\u3057\u305F\u3002 -servertool.startserver=\n\tstartup [ -serverid | -applicationName ]\n -servertool.startserver1=\u767B\u9332\u3055\u308C\u305F\u30B5\u30FC\u30D0\u30FC\u3092\u8D77\u52D5\u3057\u307E\u3059 -servertool.startserver2=\t\u30B5\u30FC\u30D0\u30FC\u306E\u8D77\u52D5\u306B\u6210\u529F\u3057\u307E\u3057\u305F\u3002 - -servertool.quit=\n\tquit\n -servertool.quit1=\u3053\u306E\u30C4\u30FC\u30EB\u3092\u7D42\u4E86\u3057\u307E\u3059 - -servertool.help=\thelp\n\t\u307E\u305F\u306F\n\thelp \n -servertool.help1=\u30D8\u30EB\u30D7\u3092\u8868\u793A\u3057\u307E\u3059 - -servertool.orbidmap=\t\u4F7F\u7528\u65B9\u6CD5: orblist [ -serverid | -applicationName ]\n -servertool.orbidmap1=ORB\u540D\u304A\u3088\u3073\u305D\u306E\u30DE\u30C3\u30D4\u30F3\u30B0\u306E\u30EA\u30B9\u30C8 -servertool.orbidmap2=\n\tORB ID\t\tORB\u540D\n\t------\t\t--------\n -pnameserv.success=\u6301\u7D9ANameServer\u306E\u8D77\u52D5\u306B\u6210\u529F\u3057\u307E\u3057\u305F - - -bootstrap.usage=\u4F7F\u7528\u65B9\u6CD5: {0} \n\n\u306B\u306F\u6B21\u306E\u3082\u306E\u304C\u3042\u308A\u307E\u3059\u3002\n -ORBInitialPort \u521D\u671F\u30DD\u30FC\u30C8(\u5FC5\u9808)\n -InitialServicesFile \u521D\u671F\u30B5\u30FC\u30D3\u30B9\u30FB\u30EA\u30B9\u30C8\u3092\u542B\u3080\u30D5\u30A1\u30A4\u30EB(\u5FC5\u9808)\n -bootstrap.success=\u30DD\u30FC\u30C8\u3092{0}\u306B\u8A2D\u5B9A\u3057\u3001{1}\u304B\u3089\u30B5\u30FC\u30D3\u30B9\u3092\u8AAD\u307F\u8FBC\u307F\u307E\u3059 -bootstrap.filenotreadable=\u30D5\u30A1\u30A4\u30EB{0}\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093 -bootstrap.filenotfound=\u30D5\u30A1\u30A4\u30EB{0}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093 -bootstrap.exception=\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u30D5\u30A1\u30A4\u30EB{0}\u306B\u4FDD\u5B58\u4E2D\u306B\u4F8B\u5916\u3092\u6355\u6349\u3057\u307E\u3057\u305F: \u4F8B\u5916{1} - -tnameserv.exception=\u30DD\u30FC\u30C8{0}\u3067\u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30B5\u30FC\u30D3\u30B9\u3092\u8D77\u52D5\u4E2D\u306B\u4F8B\u5916\u3092\u6355\u6349\u3057\u307E\u3057\u305F -tnameserv.usage=\u30B3\u30DE\u30F3\u30C9\u884C\u5F15\u6570-ORBInitialPort\u3092\u4F7F\u7528\u3057\u3066\u5225\u306E\u30DD\u30FC\u30C8\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044 -tnameserv.invalidhostoption=ORBInitialHost\u306FNameService\u306B\u6709\u52B9\u306A\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u306F\u3042\u308A\u307E\u305B\u3093 -tnameserv.orbinitialport0=ORBInitialPort 0\u306FNameService\u306B\u6709\u52B9\u306A\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u306F\u3042\u308A\u307E\u305B\u3093 -tnameserv.hs1=\u521D\u671F\u30CD\u30FC\u30DF\u30F3\u30B0\u30FB\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8:\n{0} -tnameserv.hs2=TransientNameServer: \u521D\u671F\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u53C2\u7167\u306E\u30DD\u30FC\u30C8\u3092{0}\u306B\u8A2D\u5B9A\u3057\u307E\u3059 -tnameserv.hs3=\u6E96\u5099\u304C\u5B8C\u4E86\u3057\u307E\u3057\u305F\u3002 - -orbd.commfailure=\nORBinitialPort\u304C\u4F7F\u7528\u4E2D\u3067\u3042\u308B\u305F\u3081\u3001ORBD\u306E\u8D77\u52D5\u306B\u5931\u6557\u3057\u307E\u3057\u305F -orbd.internalexception=\n\u5185\u90E8\u4F8B\u5916\u306E\u305F\u3081\u306BORBD\u306E\u8D77\u52D5\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\n\u8003\u3048\u3089\u308C\u308B\u539F\u56E0: \n1. \u6307\u5B9A\u3055\u308C\u305FORBInitialPort\u307E\u305F\u306FORBActivationPort\u304C\u4F7F\u7528\u4E2D\n2. orb.db\u3078\u306E\u66F8\u8FBC\u307F\u6A29\u9650\u304C\u306A\u3044 - diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_ko.properties b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_ko.properties deleted file mode 100644 index 9fde7fecaa4..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_ko.properties +++ /dev/null @@ -1,107 +0,0 @@ -# -# Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -orbd.usage=\uC0AC\uC6A9\uBC95: {0} \n\n\uC5EC\uAE30\uC11C \uB294 \uB2E4\uC74C\uACFC \uAC19\uC2B5\uB2C8\uB2E4.\n -port ORBD\uAC00 \uC2DC\uC791\uB418\uC5B4\uC57C \uD558\uB294 \uD65C\uC131 \uD3EC\uD2B8\uB85C, \uAE30\uBCF8\uAC12\uC740 1049\uC785\uB2C8\uB2E4(\uC120\uD0DD\uC0AC\uD56D).\n -defaultdb ORBD \uD30C\uC77C\uC758 \uB514\uB809\uD1A0\uB9AC\uB85C, \uAE30\uBCF8\uAC12\uC740 "./orb.db"\uC785\uB2C8\uB2E4(\uC120\uD0DD\uC0AC\uD56D).\n -serverid ORBD\uC758 \uC11C\uBC84 ID\uB85C, \uAE30\uBCF8\uAC12\uC740 1 \uC785\uB2C8\uB2E4(\uC120\uD0DD\uC0AC\uD56D).\n -ORBInitialPort \uCD08\uAE30 \uD3EC\uD2B8\uC785\uB2C8\uB2E4(\uD544\uC218).\n -ORBInitialHost \uCD08\uAE30 HostName\uC785\uB2C8\uB2E4(\uD544\uC218).\n - -servertool.usage=\uC0AC\uC6A9\uBC95: {0} \n\n\uC5EC\uAE30\uC11C \uB294 \uB2E4\uC74C\uACFC \uAC19\uC2B5\uB2C8\uB2E4.\n -ORBInitialPort \uCD08\uAE30 \uD3EC\uD2B8\uC785\uB2C8\uB2E4(\uD544\uC218).\n -ORBInitialHost \uCD08\uAE30 HostName\uC785\uB2C8\uB2E4(\uD544\uC218).\n -servertool.banner=\n\nJava IDL \uC11C\uBC84 \uD234 \uC2DC\uC791 \n\uD504\uB86C\uD504\uD2B8\uC5D0 \uBA85\uB839\uC744 \uC785\uB825\uD558\uC2ED\uC2DC\uC624. \n -servertool.shorthelp=\n\n\t\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uBA85\uB839: \n\t------------------- \n -servertool.baddef=\uC798\uBABB\uB41C \uC11C\uBC84 \uC815\uC758: {0} -servertool.nosuchserver=\t\uD574\uB2F9 \uC11C\uBC84\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. -servertool.helddown=\t\uC11C\uBC84\uC758 \uC791\uB3D9\uC774 \uC911\uC9C0\uB418\uC5C8\uC2B5\uB2C8\uB2E4. -servertool.nosuchorb=\tORB\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. -servertool.serverup=\t\uC11C\uBC84\uAC00 \uC774\uBBF8 \uC791\uB3D9 \uC911\uC785\uB2C8\uB2E4. -servertool.appname=\tapplicationName - {0} -servertool.name=\tname - {0} -servertool.classpath=\tclasspath - {0} -servertool.args=\targs - {0} -servertool.vmargs=\tvmargs - {0} -servertool.serverid=\tserver id - {0} -servertool.servernotrunning=\t\uC11C\uBC84\uAC00 \uC2E4\uD589 \uC911\uC774 \uC544\uB2D9\uB2C8\uB2E4. -servertool.register=\n\n\tregister -server \n\t -applicationName \n\t -classpath \n\t -args \n\t -vmargs \n -servertool.register1=\uD65C\uC131 \uAC00\uB2A5 \uC11C\uBC84 \uB4F1\uB85D -servertool.register2=\t\uC11C\uBC84\uAC00 \uB4F1\uB85D\uB418\uC5C8\uC2B5\uB2C8\uB2E4(serverid = {0}). -servertool.register3=\t\uC11C\uBC84\uAC00 \uB4F1\uB85D\uB418\uC5C8\uC9C0\uB9CC \uC791\uB3D9\uC774 \uC911\uC9C0\uB418\uC5C8\uC2B5\uB2C8\uB2E4(serverid = {0}). -servertool.register4=\t\uC11C\uBC84\uAC00 \uC774\uBBF8 \uB4F1\uB85D\uB418\uC5C8\uC2B5\uB2C8\uB2E4(serverid = {0}). - -servertool.unregister=\n\tunregister [ -serverid | -applicationName ] \n -servertool.unregister1=\uB4F1\uB85D\uB41C \uC11C\uBC84\uC758 \uB4F1\uB85D \uD574\uC81C -servertool.unregister2=\t\uC11C\uBC84\uC758 \uB4F1\uB85D\uC774 \uD574\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4. - -servertool.locate=\n\tlocate [ -serverid | -applicationName ] [ <-endpointType ] \n -servertool.locate1=\uB4F1\uB85D\uB41C \uC11C\uBC84\uC5D0 \uB300\uD55C \uD2B9\uC815 \uC720\uD615\uC758 \uD3EC\uD2B8 \uCC3E\uAE30 -servertool.locate2=\n\n\t\uD638\uC2A4\uD2B8 \uC774\uB984 {0} \n\n\t\t\uD3EC\uD2B8\t\t\uD3EC\uD2B8 \uC720\uD615\t\tORB ID\n\t\t----\t\t---------\t\t------\n -servertool.locateorb=\n\tlocateperorb [ -serverid | -applicationName ] [ -orbid ]\n -servertool.locateorb1=\uB4F1\uB85D\uB41C \uC11C\uBC84\uC5D0 \uB300\uD55C \uD2B9\uC815 ORB\uC758 \uD3EC\uD2B8 \uCC3E\uAE30 -servertool.locateorb2=\n\n\t\uD638\uC2A4\uD2B8 \uC774\uB984 {0} \n\n\t\t\uD3EC\uD2B8\t\tPortType\t\tORB ID\n\t\t----\t\t--------\t\t------\n -servertool.getserverid=\n\tgetserverid [ -applicationName ] \n -servertool.getserverid1=applicationName\uC5D0 \uB300\uD55C \uC11C\uBC84 ID \uBC18\uD658 -servertool.getserverid2=\tapplicationName {0}\uC5D0 \uB300\uD55C \uC11C\uBC84 ID\uB294 {1}\uC785\uB2C8\uB2E4. - -servertool.list=\n\t\uBAA9\uB85D\n -servertool.list1=\uB4F1\uB85D\uB41C \uC11C\uBC84 \uBAA8\uB450 \uB098\uC5F4 -servertool.list2=\n\t\uC11C\uBC84 ID\t\uC11C\uBC84 \uD074\uB798\uC2A4 \uC774\uB984\t\t\uC11C\uBC84 \uC560\uD50C\uB9AC\uCF00\uC774\uC158\n\t---------\t-----------------\t\t------------------\n -servertool.listactive=\n\tlistactive -servertool.listactive1=\uD604\uC7AC \uD65C\uC131 \uC11C\uBC84 \uB098\uC5F4 -servertool.listappnames=\tlistappnames\n -servertool.listappnames1=\uD604\uC7AC \uC815\uC758\uB41C applicationNames \uB098\uC5F4 -servertool.listappnames2=\uD604\uC7AC \uC815\uC758\uB41C \uC11C\uBC84 applicationNames: - -servertool.shutdown=\n\tshutdown [ -serverid | -applicationName ]\n -servertool.shutdown1=\uB4F1\uB85D\uB41C \uC11C\uBC84 \uC885\uB8CC -servertool.shutdown2=\t\uC11C\uBC84\uAC00 \uC131\uACF5\uC801\uC73C\uB85C \uC885\uB8CC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. -servertool.startserver=\n\tstartup [ -serverid | -applicationName ]\n -servertool.startserver1=\uB4F1\uB85D\uB41C \uC11C\uBC84 \uC2DC\uC791 -servertool.startserver2=\t\uC11C\uBC84\uAC00 \uC131\uACF5\uC801\uC73C\uB85C \uC2DC\uC791\uB418\uC5C8\uC2B5\uB2C8\uB2E4. - -servertool.quit=\n\tquit\n -servertool.quit1=\uC774 \uD234 \uC885\uB8CC - -servertool.help=\thelp\n\tOR\n\thelp \n -servertool.help1=\uB3C4\uC6C0\uB9D0 \uD45C\uC2DC - -servertool.orbidmap=\t\uC0AC\uC6A9\uBC95: orblist [ -serverid | -applicationName ]\n -servertool.orbidmap1=ORB \uC774\uB984\uACFC \uD574\uB2F9 \uB9E4\uD551 \uB098\uC5F4 -servertool.orbidmap2=\n\tORB ID\t\tORB \uC774\uB984\n\t------\t\t--------\n -pnameserv.success=\uC9C0\uC18D NameServer\uAC00 \uC131\uACF5\uC801\uC73C\uB85C \uC2DC\uC791\uB428 - - -bootstrap.usage=\uC0AC\uC6A9\uBC95: {0} \n\n\uC5EC\uAE30\uC11C \uB294 \uB2E4\uC74C\uACFC \uAC19\uC2B5\uB2C8\uB2E4.\n -ORBInitialPort \uCD08\uAE30 \uD3EC\uD2B8\uC785\uB2C8\uB2E4(\uD544\uC218).\n -InitialServicesFile \uCD08\uAE30 \uC11C\uBE44\uC2A4 \uBAA9\uB85D\uC774 \uB4E4\uC5B4 \uC788\uB294 \uD30C\uC77C\uC785\uB2C8\uB2E4(\uD544\uC218).\n -bootstrap.success=\uD3EC\uD2B8\uB97C {0}(\uC73C)\uB85C \uC124\uC815\uD558\uACE0 {1}\uC5D0\uC11C \uC11C\uBE44\uC2A4\uB97C \uC77D\uB294 \uC911 -bootstrap.filenotreadable={0} \uD30C\uC77C\uC744 \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. -bootstrap.filenotfound={0} \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. -bootstrap.exception={0} \uD30C\uC77C\uC5D0 \uC18D\uC131\uC744 \uC800\uC7A5\uD558\uB294 \uC911 \uC608\uC678\uC0AC\uD56D \uBC1C\uC0DD: {1} \uC608\uC678\uC0AC\uD56D - -tnameserv.exception={0} \uD3EC\uD2B8\uC5D0\uC11C \uBD80\uD2B8\uC2A4\uD2B8\uB7A9 \uC11C\uBE44\uC2A4\uB97C \uC2DC\uC791\uD558\uB294 \uC911 \uC608\uC678\uC0AC\uD56D\uC774 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. -tnameserv.usage=-ORBInitialPort \uBA85\uB839\uD589 \uC778\uC218\uB85C \uB2E4\uB978 \uD3EC\uD2B8 \uC0AC\uC6A9 \uC2DC\uB3C4 -tnameserv.invalidhostoption=ORBInitialHost\uB294 NameService\uC5D0 \uB300\uD574 \uC801\uD569\uD55C \uC635\uC158\uC774 \uC544\uB2D9\uB2C8\uB2E4. -tnameserv.orbinitialport0=ORBInitialPort 0\uC740 NameService\uC5D0 \uB300\uD574 \uC801\uD569\uD55C \uC635\uC158\uC774 \uC544\uB2D9\uB2C8\uB2E4. -tnameserv.hs1=\uCD08\uAE30 \uC774\uB984 \uC9C0\uC815 \uCEE8\uD14D\uC2A4\uD2B8:\n{0} -tnameserv.hs2=TransientNameServer: \uCD08\uAE30 \uAC1D\uCCB4 \uCC38\uC870\uB97C \uC704\uD55C \uD3EC\uD2B8\uB97C {0}(\uC73C)\uB85C \uC124\uC815\uD558\uB294 \uC911 -tnameserv.hs3=\uC900\uBE44\uB418\uC5C8\uC2B5\uB2C8\uB2E4. - -orbd.commfailure=\nORBinitialPort\uAC00 \uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC774\uC5B4\uC11C ORBD \uC2DC\uC791\uC744 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. -orbd.internalexception=\n\uB0B4\uBD80 \uC608\uC678\uC0AC\uD56D\uC73C\uB85C \uC778\uD574 ORBD \uC2DC\uC791\uC744 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \n\uAC00\uB2A5\uD55C \uC6D0\uC778: \n1. \uC9C0\uC815\uB41C ORBInitialPort \uB610\uB294 ORBActivationPort\uAC00 \uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC785\uB2C8\uB2E4.\n2. orb.db\uB97C \uC4F8 \uC218 \uC788\uB294 \uC4F0\uAE30 \uAD8C\uD55C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. - diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_pt_BR.properties b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_pt_BR.properties deleted file mode 100644 index c87e4c37601..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_pt_BR.properties +++ /dev/null @@ -1,107 +0,0 @@ -# -# Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -orbd.usage=Uso: {0} \n\nem que inclui:\n -port porta de ativa\u00E7\u00E3o na qual o ORBD deve ser iniciado, padr\u00E3o 1049 (opcional)\n -defaultdb diret\u00F3rio dos arquivos ORBD, padr\u00E3o "./orb.db" (opcional)\n -serverid id do servidor para ORBD, padr\u00E3o 1 (opcional)\n -ORBInitialPort porta inicial (obrigat\u00F3rio)\n -ORBInitialHost nome de host inicial (obrigat\u00F3rio)\n - -servertool.usage=Uso: {0} \n\nem que inclui:\n -ORBInitialPort porta inicial (obrigat\u00F3rio)\n -ORBInitialHost nome de host inicial (obrigat\u00F3rio)\n -servertool.banner=\n\nBem-vindo \u00E0 Ferramenta de Servidor IDL Java \ninsira os comandos no prompt \n -servertool.shorthelp=\n\n\tComandos Dispon\u00EDveis: \n\t------------------- \n -servertool.baddef=Defini\u00E7\u00E3o do servidor inv\u00E1lida: {0} -servertool.nosuchserver=\tservidor n\u00E3o encontrado. -servertool.helddown=\to servidor est\u00E1 em espera. -servertool.nosuchorb=\tORB inv\u00E1lido. -servertool.serverup=\to servidor j\u00E1 est\u00E1 ativo. -servertool.appname=\tapplicationName - {0} -servertool.name=\tname - {0} -servertool.classpath=\tclasspath - {0} -servertool.args=\targs - {0} -servertool.vmargs=\tvmargs - {0} -servertool.serverid=\tserver id - {0} -servertool.servernotrunning=\to servidor n\u00E3o est\u00E1 em execu\u00E7\u00E3o. -servertool.register=\n\n\tregister -server \n\t -applicationName \n\t -classpath \n\t -args \n\t -vmargs \n -servertool.register1=registra um servidor ativ\u00E1vel -servertool.register2=\tservidor registrado (serverid = {0}). -servertool.register3=\tservidor registrado, mas em espera (serverid = {0}). -servertool.register4=\tservidor j\u00E1 registrado (serverid = {0}). - -servertool.unregister=\n\tunregister [ -serverid | -applicationName ] \n -servertool.unregister1=cancela o registro de um servidor registrado -servertool.unregister2=\tservidor n\u00E3o registrado. - -servertool.locate=\n\tlocate [ -serverid | -applicationName ] [ <-endpointType ] \n -servertool.locate1=localiza portas de tipo espec\u00EDfico para um servidor registrado -servertool.locate2=\n\n\tNome do Host {0} \n\n\t\tPorta\t\tTipo de Porta\t\tId do ORB\n\t\t----\t\t---------\t\t------\n -servertool.locateorb=\n\tlocateperorb [ -serverid | -applicationName ] [ -orbid ]\n -servertool.locateorb1=localiza portas para um orb espec\u00EDfico de servidor registrado -servertool.locateorb2=\n\n\tNome do Host {0} \n\n\t\tPorta\t\tTipo de Porta\t\tId do ORB\n\t\t----\t\t--------\t\t------\n -servertool.getserverid=\n\tgetserverid [ -applicationName ] \n -servertool.getserverid1=retorna o id do servidor de um applicationName -servertool.getserverid2=\tID do Servidor de applicationName {0} \u00E9 {1} - -servertool.list=\n\tlist\n -servertool.list1=lista todos os servidores registrados -servertool.list2=\n\tId do Servidor\tNome de Classe do Servidor\t\tAplicativo do Servidor\n\t---------\t-----------------\t\t------------------\n -servertool.listactive=\n\tlistactive -servertool.listactive1=lista os servidores atualmente ativos -servertool.listappnames=\tlistappnames\n -servertool.listappnames1=lista os applicationNames atualmente definidos -servertool.listappnames2=applicationNames do servidor definidos atualmente: - -servertool.shutdown=\n\tshutdown [ -serverid | -applicationName ]\n -servertool.shutdown1=faz shutdown de um servidor registrado -servertool.shutdown2=\tshutdown do servidor bem-sucedido. -servertool.startserver=\n\tstartup [ -serverid | -applicationName ]\n -servertool.startserver1=inicia um servidor registrado -servertool.startserver2=\tservidor iniciado com \u00EAxito. - -servertool.quit=\n\tquit\n -servertool.quit1=sai desta ferramenta - -servertool.help=\thelp\n\tOR\n\thelp \n -servertool.help1=obt\u00E9m ajuda - -servertool.orbidmap=\tUso: orblist [ -serverid | -applicationName ]\n -servertool.orbidmap1=lista de nomes de orb e seus mapeamentos -servertool.orbidmap2=\n\tId de ORB\t\tNome de ORB\n\t------\t\t--------\n -pnameserv.success=NameServer Persistente Iniciado com \u00CAxito - - -bootstrap.usage=Uso: {0} \n\nem que inclui:\n -ORBInitialPort porta inicial (obrigat\u00F3rio)\n -InitialServicesFile arquivo que cont\u00E9m a lista de servi\u00E7os iniciais (obrigat\u00F3rio)\n -bootstrap.success=definindo porta para {0} e lendo servi\u00E7os de {1} -bootstrap.filenotreadable=o arquivo {0} n\u00E3o \u00E9 leg\u00EDvel -bootstrap.filenotfound=arquivo {0} n\u00E3o encontrado -bootstrap.exception=exce\u00E7\u00E3o capturada ao salvar as propriedades no Arquivo {0}: exce\u00E7\u00E3o {1} - -tnameserv.exception=uma exce\u00E7\u00E3o capturada ao iniciar o servi\u00E7o de inicializa\u00E7\u00E3o na porta {0} -tnameserv.usage=tente usar outra porta com os argumentos de linha de comandos -ORBInitialPort -tnameserv.invalidhostoption=ORBInitialHost n\u00E3o \u00E9 uma op\u00E7\u00E3o v\u00E1lida para NameService -tnameserv.orbinitialport0=ORBInitialPort 0 n\u00E3o \u00E9 uma op\u00E7\u00E3o v\u00E1lida para NameService -tnameserv.hs1=Contexto de Nomea\u00E7\u00E3o Inicial:\n{0} -tnameserv.hs2=TransientNameServer: definindo porta para as refer\u00EAncias de objeto iniciais: {0} -tnameserv.hs3=Pronto. - -orbd.commfailure=\nFalha ao iniciar ORBD porque ORBinitialPort j\u00E1 est\u00E1 em uso -orbd.internalexception=\nFalha ao iniciar ORBD devido a uma exce\u00E7\u00E3o interna. \nPoss\u00EDveis causas: \n1. ORBInitialPort especificado ou ORBActivationPort j\u00E1 em uso \n2. Sem permiss\u00E3o de grava\u00E7\u00E3o para gravar orb.db - diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_sv.properties b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_sv.properties deleted file mode 100644 index 677407a7043..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_sv.properties +++ /dev/null @@ -1,107 +0,0 @@ -# -# Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -orbd.usage=Syntax: {0} \n\nd\u00E4r inkluderar:\n -port Aktiveringsport d\u00E4r ORBD ska startas, standard 1049 (valfritt)\n -defaultdb Katalog f\u00F6r ORBD-filer, standard "./orb.db" (valfritt)\n -serverid Server-id f\u00F6r ORBD, standard 1 (valfritt)\n -ORBInitialPort Ursprunglig port (obligatoriskt)\n -ORBInitialHost Ursprungligt v\u00E4rdnamn (obligatoriskt)\n - -servertool.usage=Syntax: {0} \n\nd\u00E4r inkluderar:\n -ORBInitialPort Ursprunglig port (obligatoriskt)\n -ORBInitialHost Ursprungligt v\u00E4rdnamn (obligatoriskt)\n -servertool.banner=\n\nV\u00E4lkommen till Java IDL Server Tool \nange kommandona vid kommandoraden \n -servertool.shorthelp=\n\n\tTillg\u00E4ngliga kommandon: \n\t------------------- \n -servertool.baddef=Felaktig serverdefinition: {0} -servertool.nosuchserver=\tn\u00E5gon s\u00E5dan server kan inte hittas. -servertool.helddown=\tservern h\u00E5lls avst\u00E4ngd. -servertool.nosuchorb=\togiltig ORB. -servertool.serverup=\tserver \u00E4r redan startad -servertool.appname=\tapplicationName - {0} -servertool.name=\tnamn - {0} -servertool.classpath=\tclasspath - {0} -servertool.args=\targs - {0} -servertool.vmargs=\tvmargs - {0} -servertool.serverid=\tserver id - {0} -servertool.servernotrunning=\tserver k\u00F6rs inte. -servertool.register=\n\n\tregister -server \n\t -applicationName \n\t -classpath \n\t -args \n\t -vmargs \n -servertool.register1=registrera en aktiverbar server -servertool.register2=\tserver registrerad (serverid = {0}). -servertool.register3=\tserver registrerad men h\u00E5lls avst\u00E4ngd(serverid = {0}). -servertool.register4=\tserver har redan registrerats (serverid = {0}). - -servertool.unregister=\n\tunregister [ -serverid | -applicationName ] \n -servertool.unregister1=avregistrera en registrerad server -servertool.unregister2=\tserver avregistrerad. - -servertool.locate=\n\tlocate [ -serverid | -applicationName ] [ <-endpointType ] \n -servertool.locate1=hitta portar av en viss typ f\u00F6r en registrerad server -servertool.locate2=\n\n\tV\u00E4rdnamn {0} \n\n\t\tPort\t\tPorttyp\t\tORB-id\n\t\t----\t\t---------\t\t------\n -servertool.locateorb=\n\tlocateperorb [ -serverid | -applicationName ] [ -orbid ]\n -servertool.locateorb1=hitta portar f\u00F6r en viss ORB f\u00F6r en registrerad server -servertool.locateorb2=\n\n\tV\u00E4rdnamn {0} \n\n\t\tPort\t\tPorttyp\t\tORB-id\n\t\t----\t\t--------\t\t------\n -servertool.getserverid=\n\tgetserverid [ -applicationName ] \n -servertool.getserverid1=returnerar server-id f\u00F6r ett applicationName -servertool.getserverid2=\tServer-id f\u00F6r applicationName {0} \u00E4r {1} - -servertool.list=\n\tlist_\n -servertool.list1=listar alla registrerade servrar -servertool.list2=\n\tServer-id\tServerklassnamn\t\tServerapplikation\n\t---------\t-----------------\t\t------------------\n -servertool.listactive=\n\tlistactive -servertool.listactive1=listar alla f\u00F6r tillf\u00E4llet aktiva servrar -servertool.listappnames=\tlistappnames\n -servertool.listappnames1=listar de applicationNames som f\u00F6r tillf\u00E4llet \u00E4r definierade -servertool.listappnames2=Definierade applikationsnamn f\u00F6r servern: - -servertool.shutdown=\n\tshutdown [ -serverid | -applicationName ]\n -servertool.shutdown1=st\u00E4nger av en registrerad server -servertool.shutdown2=\tserver har st\u00E4ngts av. -servertool.startserver=\n\tstartup [ -serverid | -applicationName ]\n -servertool.startserver1=startar en registrerad server -servertool.startserver2=\tserver har startats. - -servertool.quit=\n\tquit\n -servertool.quit1=avsluta det h\u00E4r verktyget - -servertool.help=\thelp\n\tELLER\n\thelp \n -servertool.help1=f\u00E5 hj\u00E4lp - -servertool.orbidmap=\tSyntax: orblist [ -serverid | -applicationName ]\n -servertool.orbidmap1=lista \u00F6ver ORB-namn och deras mappning -servertool.orbidmap2=\n\tORB-id\t\tORB-namn\n\t------\t\t--------\n -pnameserv.success=Den best\u00E4ndiga namnservern har startats - - -bootstrap.usage=Syntax: {0} \n\nd\u00E4r inkluderar:\n -ORBInitialPort Ursprunglig port (obligatoriskt)\n -InitialServicesFile En fil som inneh\u00E5ller en lista \u00F6ver ursprungliga tj\u00E4nster (obligatoriskt)\n -bootstrap.success=st\u00E4ller in porten till {0} och l\u00E4ser tj\u00E4nster fr\u00E5n {1} -bootstrap.filenotreadable=filen {0} kan inte l\u00E4sas -bootstrap.filenotfound=filen {0} hittas inte -bootstrap.exception=p\u00E5tr\u00E4ffade undantag medan egenskaper sparades i filen {0}: Undantag {1} - -tnameserv.exception=p\u00E5tr\u00E4ffade ett undantag n\u00E4r starttj\u00E4nsten startades vid porten {0} -tnameserv.usage=f\u00F6rs\u00F6k att anv\u00E4nda en annan port med kommandoradsargument -ORBInitialPort -tnameserv.invalidhostoption=ORBInitialHost \u00E4r inte ett giltigt alternativ f\u00F6r NameService -tnameserv.orbinitialport0=ORBInitialPort 0 \u00E4r inte ett giltigt alternativ f\u00F6r NameService -tnameserv.hs1=Ursprunglig namngivningskontext:\n{0} -tnameserv.hs2=TransientNameServer: st\u00E4ller in port f\u00F6r ursprungliga objektreferenser till: {0} -tnameserv.hs3=Klar. - -orbd.commfailure=\nKunde inte starta ORBD eftersom ORBinitialport redan anv\u00E4nds -orbd.internalexception=\nKunde inte starta ORBD p\u00E5 grund av internt undantag. \nM\u00F6jliga orsaker: \n1. Angivet ORBInitialPort eller ORBActivationPort anv\u00E4ndas redan \n2. Ingen beh\u00F6righet att skriva till orb.db - diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_CN.properties b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_CN.properties deleted file mode 100644 index 7743117c56d..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_CN.properties +++ /dev/null @@ -1,107 +0,0 @@ -# -# Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -orbd.usage=\u7528\u6CD5: {0} <\u9009\u9879> \n\n\u5176\u4E2D, <\u9009\u9879> \u5305\u62EC: \n -port \u6FC0\u6D3B\u542F\u52A8 ORBD \u7684\u7AEF\u53E3, \u9ED8\u8BA4\u503C\u4E3A 1049 (\u53EF\u9009)\n -defaultdb ORBD \u6587\u4EF6\u7684\u76EE\u5F55, \u9ED8\u8BA4\u503C\u4E3A "./orb.db" (\u53EF\u9009)\n -serverid ORBD \u7684\u670D\u52A1\u5668 ID, \u9ED8\u8BA4\u503C\u4E3A 1 (\u53EF\u9009)\n -ORBInitialPort \u521D\u59CB\u7AEF\u53E3 (\u5FC5\u9700)\n -ORBInitialHost \u521D\u59CB HostName (\u5FC5\u9700)\n - -servertool.usage=\u7528\u6CD5: {0} <\u9009\u9879> \n\n\u5176\u4E2D, <\u9009\u9879> \u5305\u62EC: \n -ORBInitialPort \u521D\u59CB\u7AEF\u53E3 (\u5FC5\u9700)\n -ORBInitialHost \u521D\u59CB HostName (\u5FC5\u9700)\n -servertool.banner=\n\n\u6B22\u8FCE\u4F7F\u7528 Java IDL \u670D\u52A1\u5668\u5DE5\u5177 \n\u8BF7\u5728\u63D0\u793A\u5904\u8F93\u5165\u547D\u4EE4 \n -servertool.shorthelp=\n\n\t\u53EF\u7528\u547D\u4EE4: \n\t------------------- \n -servertool.baddef=\u9519\u8BEF\u7684\u670D\u52A1\u5668\u5B9A\u4E49: {0} -servertool.nosuchserver=\t\u627E\u4E0D\u5230\u8FD9\u79CD\u670D\u52A1\u5668\u3002 -servertool.helddown=\t\u670D\u52A1\u5668\u5DF2\u88AB\u5173\u95ED\u3002 -servertool.nosuchorb=\t\u65E0\u6548\u7684\u5BF9\u8C61\u8BF7\u6C42\u4EE3\u7406\u7A0B\u5E8F (ORB)\u3002 -servertool.serverup=\t\u670D\u52A1\u5668\u5DF2\u5728\u8FD0\u884C\u3002 -servertool.appname=\tapplicationName - {0} -servertool.name=\tname - {0} -servertool.classpath=\tclasspath - {0} -servertool.args=\targs - {0} -servertool.vmargs=\tvmargs - {0} -servertool.serverid=\t\u670D\u52A1\u5668 ID - {0} -servertool.servernotrunning=\t\u670D\u52A1\u5668\u6CA1\u6709\u8FD0\u884C\u3002 -servertool.register=\n\n\tregister -server<\u670D\u52A1\u5668\u7C7B\u540D\u79F0> \n\t -applicationName <\u5907\u7528\u670D\u52A1\u5668\u540D\u79F0> \n\t -classpath <\u670D\u52A1\u5668\u7684\u7C7B\u8DEF\u5F84> \n\t -args <\u670D\u52A1\u5668\u7684\u53C2\u6570> \n\t -vmargs <\u670D\u52A1\u5668 Java VM \u7684\u53C2\u6570>\n -servertool.register1=\u6CE8\u518C\u4E00\u4E2A\u53EF\u6FC0\u6D3B\u7684\u670D\u52A1\u5668 -servertool.register2=\t\u5DF2\u6CE8\u518C\u670D\u52A1\u5668 (serverid = {0})\u3002 -servertool.register3=\t\u5DF2\u6CE8\u518C\u670D\u52A1\u5668, \u4F46\u5DF2\u88AB\u5173\u95ED (serverid = {0})\u3002 -servertool.register4=\t\u670D\u52A1\u5668\u5DF2\u6CE8\u518C (serverid = {0})\u3002 - -servertool.unregister=\n\tunregister [ -serverid | -applicationName ] \n -servertool.unregister1=\u6CE8\u9500\u5DF2\u6CE8\u518C\u7684\u670D\u52A1\u5668 -servertool.unregister2=\t\u670D\u52A1\u5668\u5DF2\u6CE8\u9500\u3002 - -servertool.locate=\n\tlocate [ -serverid | -applicationName ] [ <-endpointType ] \n -servertool.locate1=\u4E3A\u5DF2\u6CE8\u518C\u670D\u52A1\u5668\u5B9A\u4F4D\u7279\u5B9A\u7C7B\u578B\u7684\u7AEF\u53E3 -servertool.locate2=\n\n\t\u4E3B\u673A\u540D\u79F0 {0} \n\n\t\t\u7AEF\u53E3\t\t\u7AEF\u53E3\u7C7B\u578B\t\tORB \u6807\u8BC6\n\t\t----\t\t---------\t\t------\n -servertool.locateorb=\n\tlocateperorb [ -serverid | -applicationName ] [ -orbid ]\n -servertool.locateorb1=\u4E3A\u5DF2\u6CE8\u518C\u670D\u52A1\u5668\u7684\u7279\u5B9A\u5BF9\u8C61\u8BF7\u6C42\u4EE3\u7406\u7A0B\u5E8F\u5B9A\u4F4D\u7AEF\u53E3\u3002 -servertool.locateorb2=\n\n\t\u4E3B\u673A\u540D\u79F0 {0} \n\n\t\t\u7AEF\u53E3\t\t\u7AEF\u53E3\u7C7B\u578B\t\tORB \u6807\u8BC6\n\t\t----\t\t--------\t\t------\n -servertool.getserverid=\n\tgetserverid [ -applicationName ] \n -servertool.getserverid1=\u8FD4\u56DE applicationName \u7684\u670D\u52A1\u5668 ID -servertool.getserverid2=\tapplicationName {0} \u7684\u670D\u52A1\u5668 ID \u662F {1} - -servertool.list=\n\t\u5217\u8868\n -servertool.list1=\u5217\u51FA\u6240\u6709\u5DF2\u6CE8\u518C\u670D\u52A1\u5668 -servertool.list2=\n\t\u670D\u52A1\u5668 ID\t\u670D\u52A1\u5668\u7C7B\u540D\u79F0\t\t\u670D\u52A1\u5668\u5E94\u7528\u7A0B\u5E8F\n\t---------\t-----------------\t\t------------------\n -servertool.listactive=\n\tlistactive -servertool.listactive1=\u5217\u51FA\u5F53\u524D\u6D3B\u52A8\u7684\u670D\u52A1\u5668 -servertool.listappnames=\tlistappnames\n -servertool.listappnames1=\u5217\u51FA\u5F53\u524D\u5B9A\u4E49\u7684 applicationName -servertool.listappnames2=\u5F53\u524D\u5B9A\u4E49\u7684\u670D\u52A1\u5668 applicationName: - -servertool.shutdown=\n\tshutdown [ -serverid | -applicationName ]\n -servertool.shutdown1=\u5173\u95ED\u4E00\u4E2A\u5DF2\u6CE8\u518C\u670D\u52A1\u5668 -servertool.shutdown2=\t\u670D\u52A1\u5668\u6210\u529F\u5173\u95ED\u3002 -servertool.startserver=\n\tstartup [ -serverid | -applicationName ]\n -servertool.startserver1=\u542F\u52A8\u4E00\u4E2A\u5DF2\u6CE8\u518C\u670D\u52A1\u5668 -servertool.startserver2=\t\u670D\u52A1\u5668\u6210\u529F\u542F\u52A8\u3002 - -servertool.quit=\n\t\u9000\u51FA\n -servertool.quit1=\u9000\u51FA\u6B64\u5DE5\u5177 - -servertool.help=\thelp\n\t\u6216\n\thelp \n -servertool.help1=\u83B7\u53D6\u5E2E\u52A9 - -servertool.orbidmap=\t\u7528\u6CD5: orblist [ -serverid | -applicationName ]\n -servertool.orbidmap1=\u5BF9\u8C61\u8BF7\u6C42\u4EE3\u7406\u7A0B\u5E8F (orb) \u540D\u79F0\u53CA\u5176\u6620\u5C04\u5217\u8868 -servertool.orbidmap2=\n\tORB \u6807\u8BC6\t\tORB \u540D\u79F0\n\t------\t\t--------\n -pnameserv.success=\u6301\u4E45\u6027\u540D\u79F0\u670D\u52A1\u5668\u6210\u529F\u542F\u52A8 - - -bootstrap.usage=\u7528\u6CD5: {0} <\u9009\u9879> \n\n\u5176\u4E2D, <\u9009\u9879> \u5305\u62EC: \n -ORBInitialPort \u521D\u59CB\u7AEF\u53E3 (\u5FC5\u9700)\n -InitialServicesFile \u5305\u542B\u521D\u59CB\u670D\u52A1\u5217\u8868\u7684\u6587\u4EF6 (\u5FC5\u9700)\n -bootstrap.success=\u5C06\u7AEF\u53E3\u8BBE\u7F6E\u4E3A{0}\u5E76\u4ECE{1}\u8BFB\u53D6\u670D\u52A1 -bootstrap.filenotreadable=\u6587\u4EF6{0}\u4E0D\u53EF\u8BFB\u53D6 -bootstrap.filenotfound=\u6CA1\u6709\u627E\u5230\u6587\u4EF6{0} -bootstrap.exception=\u5C06\u5C5E\u6027\u4FDD\u5B58\u5230\u6587\u4EF6{0}\u65F6\u51FA\u73B0\u5F02\u5E38\u9519\u8BEF: \u5F02\u5E38\u9519\u8BEF{1} - -tnameserv.exception=\u542F\u52A8{0}\u7AEF\u53E3\u4E0A\u7684\u5F15\u5BFC\u7A0B\u5E8F\u670D\u52A1\u65F6\u51FA\u73B0\u5F02\u5E38\u9519\u8BEF -tnameserv.usage=\u5C1D\u8BD5\u5229\u7528\u547D\u4EE4\u884C\u53C2\u6570 -ORBInitialPort \u4F7F\u7528\u4E0D\u540C\u7684\u7AEF\u53E3 -tnameserv.invalidhostoption=ORBInitialHost \u4E0D\u662F NameService \u7684\u6709\u6548\u9009\u9879 -tnameserv.orbinitialport0=ORBInitialPort 0 \u4E0D\u662F NameService \u7684\u6709\u6548\u9009\u9879 -tnameserv.hs1=\u521D\u59CB\u7684\u547D\u540D\u4E0A\u4E0B\u6587: \n{0} -tnameserv.hs2=TransientNameServer: \u5C06\u521D\u59CB\u5BF9\u8C61\u5F15\u7528\u7AEF\u53E3\u8BBE\u7F6E\u4E3A: {0} -tnameserv.hs3=\u51C6\u5907\u5C31\u7EEA\u3002 - -orbd.commfailure=\n\u7531\u4E8E ORBinitialPort \u5DF2\u5728\u4F7F\u7528\u4E2D, \u65E0\u6CD5\u542F\u52A8 ORBD -orbd.internalexception=\n\u7531\u4E8E\u5185\u90E8\u5F02\u5E38\u9519\u8BEF, \u65E0\u6CD5\u542F\u52A8 ORBD\u3002\n\u53EF\u80FD\u539F\u56E0: \n1. \u6307\u5B9A\u7684 ORBInitialPort \u6216 ORBActivationPort \u5DF2\u5728\u4F7F\u7528\u4E2D \n2. \u6CA1\u6709\u5199\u5165 orb.db \u7684\u6743\u9650 - diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_TW.properties b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_TW.properties deleted file mode 100644 index 84ada025a78..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_TW.properties +++ /dev/null @@ -1,107 +0,0 @@ -# -# Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -orbd.usage=\u7528\u6CD5: {0} \n\n\u5176\u4E2D \u5305\u62EC: \n -port ORBD \u61C9\u88AB\u555F\u52D5\u7684\u555F\u52D5\u9023\u63A5\u57E0\u6240\u5728\uFF0C\u9810\u8A2D\u70BA 1049 (\u53EF\u9078)\n -defaultdb ORBD \u6A94\u6848\u7684\u76EE\u9304\uFF0C\u9810\u8A2D "./orb.db" (\u53EF\u9078)\n -serverid ORBD \u4F3A\u670D\u5668 Id\uFF0C\u9810\u8A2D\u70BA 1 (\u53EF\u9078)\n -ORBInitialPort \u8D77\u59CB\u9023\u63A5\u57E0 (\u5FC5\u8981)\n -ORBInitialHost \u8D77\u59CB\u4E3B\u6A5F\u540D\u7A31 (\u5FC5\u8981)\n - -servertool.usage=\u7528\u6CD5: {0} \n\nwhere \u5305\u62EC:\n -ORBInitialPort \u8D77\u59CB\u9023\u63A5\u57E0 (\u5FC5\u8981)\n -ORBInitialHost \u8D77\u59CB\u4E3B\u6A5F\u540D\u7A31 (\u5FC5\u8981)\n -servertool.banner=\n\n\u6B61\u8FCE\u4F7F\u7528 Java IDL \u4F3A\u670D\u5668\u5DE5\u5177 \n\u8ACB\u5728\u63D0\u793A\u8655\u8F38\u5165\u547D\u4EE4 \n -servertool.shorthelp=\n\n\t\u53EF\u7528\u7684\u547D\u4EE4: \n\t------------------- \n -servertool.baddef=\u932F\u8AA4\u7684\u4F3A\u670D\u5668\u5B9A\u7FA9: {0} -servertool.nosuchserver=\t\u627E\u4E0D\u5230\u9019\u500B\u4F3A\u670D\u5668\u3002 -servertool.helddown=\t\u4F3A\u670D\u5668\u4E0D\u5728\u5DE5\u4F5C\u72C0\u614B\u3002 -servertool.nosuchorb=\t\u7121\u6548\u7684 ORB. -servertool.serverup=\t\u4F3A\u670D\u5668\u5DF2\u5728\u5DE5\u4F5C\u72C0\u614B\u3002 -servertool.appname=\tapplicationName - {0} -servertool.name=\tname - {0} -servertool.classpath=\tclasspath - {0} -servertool.args=\targs - {0} -servertool.vmargs=\tvmargs - {0} -servertool.serverid=\tserver id - {0} -servertool.servernotrunning=\t\u4F3A\u670D\u5668\u672A\u57F7\u884C\u3002 -servertool.register=\n\n\tregister -server \n\t -applicationName \n\t -classpath \n\t -args \n\t -vmargs \n -servertool.register1=\u8A3B\u518A\u4E00\u500B\u53EF\u555F\u52D5\u7684\u4F3A\u670D\u5668 -servertool.register2=\t\u5DF2\u8A3B\u518A\u904E\u7684\u4F3A\u670D\u5668 (serverid = {0})\u3002 -servertool.register3=\t\u5DF2\u8A3B\u518A\u904E\u7684\u4F3A\u670D\u5668\uFF0C\u4F46\u4E0D\u5728\u5DE5\u4F5C\u72C0\u614B (serverid = {0})\u3002 -servertool.register4=\t\u4F3A\u670D\u5668\u5DF2\u8A3B\u518A (serverid = {0})\u3002 - -servertool.unregister=\n\tunregister [ -serverid | -applicationName ] \n -servertool.unregister1=\u5C07\u5DF2\u8A3B\u518A\u7684\u4F3A\u670D\u5668\u53D6\u6D88\u8A3B\u518A -servertool.unregister2=\t\u4F3A\u670D\u5668\u5DF2\u53D6\u6D88\u8A3B\u518A\u3002 - -servertool.locate=\n\tlocate [ -serverid | -applicationName ] [ <-endpointType ] \n -servertool.locate1=\u91DD\u5C0D\u4E00\u500B\u5DF2\u8A3B\u518A\u904E\u7684\u4F3A\u670D\u5668\u5C0B\u627E\u7279\u5B9A\u985E\u578B\u7684\u9023\u63A5\u57E0 -servertool.locate2=\n\n\t\u4E3B\u6A5F\u540D\u7A31 {0} \n\n\t\t\u9023\u63A5\u57E0\t\t\u9023\u63A5\u57E0\u985E\u578B\t\tORB Id\n\t\t----\t\t---------\t\t------\n -servertool.locateorb=\n\tlocateperorb [ -serverid | -applicationName ] [ -orbid ]\n -servertool.locateorb1=\u91DD\u5C0D\u5DF2\u8A3B\u518A\u904E\u7684\u4F3A\u670D\u5668\u7684\u7279\u5B9A orb \u5C0B\u627E\u9023\u63A5\u57E0\u3002 -servertool.locateorb2=\n\n\t\u4E3B\u6A5F\u540D\u7A31 {0} \n\n\t\t\u9023\u63A5\u57E0\t\t\u9023\u63A5\u57E0\u985E\u578B\t\tORB Id\n\t\t----\t\t--------\t\t------\n -servertool.getserverid=\n\tgetserverid [ -applicationName ] \n -servertool.getserverid1=\u50B3\u56DE applicationName \u7684\u4F3A\u670D\u5668\u8B58\u5225\u78BC -servertool.getserverid2=\tapplicationName \u7684\u4F3A\u670D\u5668\u8B58\u5225\u78BC {0} \u70BA {1} - -servertool.list=\n\tlist\n -servertool.list1=\u5217\u51FA\u6240\u6709\u8A3B\u518A\u904E\u7684\u4F3A\u670D\u5668 -servertool.list2=\n\t\u4F3A\u670D\u5668\u8B58\u5225\u78BC\t\u4F3A\u670D\u5668\u985E\u5225\u540D\u7A31\t\t\u4F3A\u670D\u5668\u61C9\u7528\u7A0B\u5F0F\n\t---------\t-----------------\t\t------------------\n -servertool.listactive=\n\tlistactive -servertool.listactive1=\u5217\u51FA\u76EE\u524D\u4F7F\u7528\u4E2D\u7684\u4F3A\u670D\u5668 -servertool.listappnames=\tlistappnames\n -servertool.listappnames1=\u5217\u51FA\u76EE\u524D\u5B9A\u7FA9\u7684 applicationNames -servertool.listappnames2=\u76EE\u524D\u5B9A\u7FA9\u7684\u4F3A\u670D\u5668 applicationNames: - -servertool.shutdown=\n\tshutdown [ -serverid | -applicationName ]\n -servertool.shutdown1=\u95DC\u9589\u4E00\u500B\u8A3B\u518A\u904E\u7684\u4F3A\u670D\u5668 -servertool.shutdown2=\t\u4F3A\u670D\u5668\u95DC\u9589\u6210\u529F\u3002 -servertool.startserver=\n\tstartup [ -serverid | -applicationName ]\n -servertool.startserver1=\u555F\u52D5\u4E00\u500B\u8A3B\u518A\u904E\u7684\u4F3A\u670D\u5668 -servertool.startserver2=\t\u4F3A\u670D\u5668\u555F\u52D5\u6210\u529F\u3002 - -servertool.quit=\n\tquit\n -servertool.quit1=\u96E2\u958B\u9019\u500B\u5DE5\u5177 - -servertool.help=\thelp\n\t\u6216\n\thelp \n -servertool.help1=\u53D6\u5F97\u8AAA\u660E - -servertool.orbidmap=\t\u7528\u6CD5: orblist [ -serverid | -applicationName ]\n -servertool.orbidmap1=orb \u540D\u7A31\u53CA\u5176\u5C0D\u6620\u6E05\u55AE -servertool.orbidmap2=\n\tORB Id\t\tORB \u540D\u7A31\n\t------\t\t--------\n -pnameserv.success=\u6C38\u4E45\u6027 NameServer \u555F\u52D5\u6210\u529F - - -bootstrap.usage=\u7528\u6CD5: {0} \n\n\u5176\u4E2D \u5305\u62EC: \n -ORBInitialPort \u8D77\u59CB\u9023\u63A5\u57E0 (\u5FC5\u8981)\n -InitialServicesFile \u542B\u6709\u8D77\u59CB\u670D\u52D9\u6E05\u55AE\u7684\u6A94\u6848 (\u5FC5\u8981)\n -bootstrap.success=\u8A2D\u5B9A\u9023\u63A5\u57E0\u81F3 {0} \u4E26\u5F9E {1} \u8B80\u53D6\u670D\u52D9 -bootstrap.filenotreadable=\u6A94\u6848 {0} \u7121\u6CD5\u8B80\u53D6 -bootstrap.filenotfound=\u627E\u4E0D\u5230\u6A94\u6848 {0} -bootstrap.exception=\u5C07\u5C6C\u6027\u5132\u5B58\u81F3\u6A94\u6848 {0} \u6642\u767C\u751F\u7570\u5E38\u72C0\u6CC1: \u7570\u5E38\u72C0\u6CC1 {1} - -tnameserv.exception=\u958B\u555F {0} \u9023\u63A5\u57E0\u4E0A\u7684\u555F\u52D5\u5B89\u88DD\u670D\u52D9\u6642\uFF0C\u767C\u751F\u7570\u5E38\u72C0\u6CC1 -tnameserv.usage=\u5617\u8A66\u4EE5\u547D\u4EE4\u884C\u5F15\u6578\u4F86\u4F7F\u7528\u4E0D\u540C\u9023\u63A5\u57E0 -ORBInitialPort -tnameserv.invalidhostoption=ORBInitialHost \u4E0D\u662F NameService \u7684\u6709\u6548\u9078\u9805 -tnameserv.orbinitialport0=ORBInitialPort 0 \u4E0D\u662F NameService \u7684\u6709\u6548\u9078\u9805 -tnameserv.hs1=\u8D77\u59CB\u547D\u540D\u76F8\u95DC\u8CC7\u8A0A\u74B0\u5883: \n{0} -tnameserv.hs2=TransientNameServer: \u91DD\u5C0D\u8D77\u59CB\u7269\u4EF6\u53C3\u7167\uFF0C\u8A2D\u5B9A\u9023\u63A5\u57E0\u81F3: {0} -tnameserv.hs3=\u5C31\u7DD2\u3002 - -orbd.commfailure=\n\u56E0\u70BA ORBinitialPort \u5728\u4F7F\u7528\u4E2D\uFF0C\u6240\u4EE5\u7121\u6CD5\u555F\u52D5 ORBD\u3002 -orbd.internalexception=\n\u56E0\u70BA\u5167\u90E8\u767C\u751F\u7570\u5E38\uFF0C\u6240\u4EE5\u7121\u6CD5\u555F\u52D5 ORBD\u3002\n\u53EF\u80FD\u7684\u539F\u56E0: \n1. \u6307\u5B9A\u7684 ORBInitialPort \u6216 ORBActivationPort \u5728\u4F7F\u7528\u4E2D\u3002\n2. \u6C92\u6709\u5BEB\u5165 orb.db \u7684\u6B0A\u9650\u3002 - diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/threadpool/ThreadPoolImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/threadpool/ThreadPoolImpl.java deleted file mode 100644 index 7f3ad89869c..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/threadpool/ThreadPoolImpl.java +++ /dev/null @@ -1,547 +0,0 @@ -/* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil.threadpool; - -import java.io.IOException; -import java.io.Closeable; - -import java.security.AccessController; -import java.security.PrivilegedAction; - -import java.util.List; -import java.util.ArrayList; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.sun.corba.se.spi.orbutil.threadpool.NoSuchWorkQueueException; -import com.sun.corba.se.spi.orbutil.threadpool.ThreadPool; -import com.sun.corba.se.spi.orbutil.threadpool.Work; -import com.sun.corba.se.spi.orbutil.threadpool.WorkQueue; - -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.impl.orbutil.threadpool.WorkQueueImpl; - -import com.sun.corba.se.spi.monitoring.MonitoringConstants; -import com.sun.corba.se.spi.monitoring.MonitoredObject; -import com.sun.corba.se.spi.monitoring.MonitoringFactories; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.monitoring.LongMonitoredAttributeBase; - -import com.sun.corba.se.impl.logging.ORBUtilSystemException; -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.spi.logging.CORBALogDomains; - -public class ThreadPoolImpl implements ThreadPool -{ - // serial counter useful for debugging - private static AtomicInteger threadCounter = new AtomicInteger(0); - private static final ORBUtilSystemException wrapper = - ORBUtilSystemException.get(CORBALogDomains.RPC_TRANSPORT); - - - // Any time currentThreadCount and/or availableWorkerThreads is updated - // or accessed this ThreadPool's WorkQueue must be locked. And, it is - // expected that this ThreadPool's WorkQueue is the only object that - // updates and accesses these values directly and indirectly though a - // call to a method in this ThreadPool. If any call to update or access - // those values must synchronized on this ThreadPool's WorkQueue. - private WorkQueue workQueue; - - // Stores the number of available worker threads - private int availableWorkerThreads = 0; - - // Stores the number of threads in the threadpool currently - private int currentThreadCount = 0; - - // Minimum number of worker threads created at instantiation of the threadpool - private int minWorkerThreads = 0; - - // Maximum number of worker threads in the threadpool - private int maxWorkerThreads = 0; - - // Inactivity timeout value for worker threads to exit and stop running - private long inactivityTimeout; - - // Indicates if the threadpool is bounded or unbounded - private boolean boundedThreadPool = false; - - // Running count of the work items processed - // Set the value to 1 so that divide by zero is avoided in - // averageWorkCompletionTime() - private AtomicLong processedCount = new AtomicLong(1); - - // Running aggregate of the time taken in millis to execute work items - // processed by the threads in the threadpool - private AtomicLong totalTimeTaken = new AtomicLong(0); - - // Name of the ThreadPool - private String name; - - // MonitoredObject for ThreadPool - private MonitoredObject threadpoolMonitoredObject; - - // ThreadGroup in which threads should be created - private ThreadGroup threadGroup; - - Object workersLock = new Object(); - List workers = new ArrayList<>(); - - /** - * This constructor is used to create an unbounded threadpool - */ - public ThreadPoolImpl(ThreadGroup tg, String threadpoolName) { - inactivityTimeout = ORBConstants.DEFAULT_INACTIVITY_TIMEOUT; - maxWorkerThreads = Integer.MAX_VALUE; - workQueue = new WorkQueueImpl(this); - threadGroup = tg; - name = threadpoolName; - initializeMonitoring(); - } - - /** - * This constructor is used to create an unbounded threadpool - * in the ThreadGroup of the current thread - */ - public ThreadPoolImpl(String threadpoolName) { - this( Thread.currentThread().getThreadGroup(), threadpoolName ) ; - } - - /** - * This constructor is used to create bounded threadpool - */ - public ThreadPoolImpl(int minSize, int maxSize, long timeout, - String threadpoolName) - { - minWorkerThreads = minSize; - maxWorkerThreads = maxSize; - inactivityTimeout = timeout; - boundedThreadPool = true; - workQueue = new WorkQueueImpl(this); - name = threadpoolName; - for (int i = 0; i < minWorkerThreads; i++) { - createWorkerThread(); - } - initializeMonitoring(); - } - - // Note that this method should not return until AFTER all threads have died. - public void close() throws IOException { - - // Copy to avoid concurrent modification problems. - List copy = null; - synchronized (workersLock) { - copy = new ArrayList<>(workers); - } - - for (WorkerThread wt : copy) { - wt.close(); - while (wt.getState() != Thread.State.TERMINATED) { - try { - wt.join(); - } catch (InterruptedException exc) { - wrapper.interruptedJoinCallWhileClosingThreadPool(exc, wt, this); - } - } - } - - threadGroup = null; - } - - - // Setup monitoring for this threadpool - private void initializeMonitoring() { - // Get root monitored object - MonitoredObject root = MonitoringFactories.getMonitoringManagerFactory(). - createMonitoringManager(MonitoringConstants.DEFAULT_MONITORING_ROOT, null). - getRootMonitoredObject(); - - // Create the threadpool monitoring root - MonitoredObject threadPoolMonitoringObjectRoot = root.getChild( - MonitoringConstants.THREADPOOL_MONITORING_ROOT); - if (threadPoolMonitoringObjectRoot == null) { - threadPoolMonitoringObjectRoot = MonitoringFactories. - getMonitoredObjectFactory().createMonitoredObject( - MonitoringConstants.THREADPOOL_MONITORING_ROOT, - MonitoringConstants.THREADPOOL_MONITORING_ROOT_DESCRIPTION); - root.addChild(threadPoolMonitoringObjectRoot); - } - threadpoolMonitoredObject = MonitoringFactories. - getMonitoredObjectFactory(). - createMonitoredObject(name, - MonitoringConstants.THREADPOOL_MONITORING_DESCRIPTION); - - threadPoolMonitoringObjectRoot.addChild(threadpoolMonitoredObject); - - LongMonitoredAttributeBase b1 = new - LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_CURRENT_NUMBER_OF_THREADS, - MonitoringConstants.THREADPOOL_CURRENT_NUMBER_OF_THREADS_DESCRIPTION) { - public Object getValue() { - return new Long(ThreadPoolImpl.this.currentNumberOfThreads()); - } - }; - threadpoolMonitoredObject.addAttribute(b1); - LongMonitoredAttributeBase b2 = new - LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_NUMBER_OF_AVAILABLE_THREADS, - MonitoringConstants.THREADPOOL_CURRENT_NUMBER_OF_THREADS_DESCRIPTION) { - public Object getValue() { - return new Long(ThreadPoolImpl.this.numberOfAvailableThreads()); - } - }; - threadpoolMonitoredObject.addAttribute(b2); - LongMonitoredAttributeBase b3 = new - LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_NUMBER_OF_BUSY_THREADS, - MonitoringConstants.THREADPOOL_NUMBER_OF_BUSY_THREADS_DESCRIPTION) { - public Object getValue() { - return new Long(ThreadPoolImpl.this.numberOfBusyThreads()); - } - }; - threadpoolMonitoredObject.addAttribute(b3); - LongMonitoredAttributeBase b4 = new - LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_AVERAGE_WORK_COMPLETION_TIME, - MonitoringConstants.THREADPOOL_AVERAGE_WORK_COMPLETION_TIME_DESCRIPTION) { - public Object getValue() { - return new Long(ThreadPoolImpl.this.averageWorkCompletionTime()); - } - }; - threadpoolMonitoredObject.addAttribute(b4); - LongMonitoredAttributeBase b5 = new - LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_CURRENT_PROCESSED_COUNT, - MonitoringConstants.THREADPOOL_CURRENT_PROCESSED_COUNT_DESCRIPTION) { - public Object getValue() { - return new Long(ThreadPoolImpl.this.currentProcessedCount()); - } - }; - threadpoolMonitoredObject.addAttribute(b5); - - // Add the monitored object for the WorkQueue - - threadpoolMonitoredObject.addChild( - ((WorkQueueImpl)workQueue).getMonitoredObject()); - } - - // Package private method to get the monitored object for this - // class - MonitoredObject getMonitoredObject() { - return threadpoolMonitoredObject; - } - - public WorkQueue getAnyWorkQueue() - { - return workQueue; - } - - public WorkQueue getWorkQueue(int queueId) - throws NoSuchWorkQueueException - { - if (queueId != 0) - throw new NoSuchWorkQueueException(); - return workQueue; - } - - /** - * To be called from the workqueue when work is added to the - * workQueue. This method would create new threads if required - * or notify waiting threads on the queue for available work - */ - void notifyForAvailableWork(WorkQueue aWorkQueue) { - synchronized (aWorkQueue) { - if (availableWorkerThreads < aWorkQueue.workItemsInQueue()) { - createWorkerThread(); - } else { - aWorkQueue.notify(); - } - } - } - - - private Thread createWorkerThreadHelper( String name ) { - // Thread creation needs to be in a doPrivileged block - // if there is a non-null security manager for two reasons: - // 1. The creation of a thread in a specific ThreadGroup - // is a privileged operation. Lack of a doPrivileged - // block here causes an AccessControlException - // (see bug 6268145). - // 2. We want to make sure that the permissions associated - // with this thread do NOT include the permissions of - // the current thread that is calling this method. - // This leads to problems in the app server where - // some threads in the ThreadPool randomly get - // bad permissions, leading to unpredictable - // permission errors (see bug 6021011). - // - // A Java thread contains a stack of call frames, - // one for each method called that has not yet returned. - // Each method comes from a particular class. The class - // was loaded by a ClassLoader which has an associated - // CodeSource, and this determines the Permissions - // for all methods in that class. The current - // Permissions for the thread are the intersection of - // all Permissions for the methods on the stack. - // This is part of the Security Context of the thread. - // - // When a thread creates a new thread, the new thread - // inherits the security context of the old thread. - // This is bad in a ThreadPool, because different - // creators of threads may have different security contexts. - // This leads to occasional unpredictable errors when - // a thread is re-used in a different security context. - // - // Avoiding this problem is simple: just do the thread - // creation in a doPrivileged block. This sets the - // inherited security context to that of the code source - // for the ORB code itself, which contains all permissions - // in either Java SE or Java EE. - WorkerThread thread = new WorkerThread(threadGroup, name); - synchronized (workersLock) { - workers.add(thread); - } - - // The thread must be set to a daemon thread so the - // VM can exit if the only threads left are PooledThreads - // or other daemons. We don't want to rely on the - // calling thread always being a daemon. - // Note that no exception is possible here since we - // are inside the doPrivileged block. - thread.setDaemon(true); - - wrapper.workerThreadCreated(thread, thread.getContextClassLoader()); - - thread.start(); - return null; - } - - - /** - * To be called from the workqueue to create worker threads when none - * available. - */ - void createWorkerThread() { - final String name = getName(); - synchronized (workQueue) { - try { - if (System.getSecurityManager() == null) { - createWorkerThreadHelper(name); - } else { - // If we get here, we need to create a thread. - AccessController.doPrivileged( - new PrivilegedAction() { - public Object run() { - return createWorkerThreadHelper(name); - } - } - ); - } - } catch (Throwable t) { - // Decrementing the count of current worker threads. - // But, it will be increased in the finally block. - decrementCurrentNumberOfThreads(); - wrapper.workerThreadCreationFailure(t); - } finally { - incrementCurrentNumberOfThreads(); - } - } - } - - public int minimumNumberOfThreads() { - return minWorkerThreads; - } - - public int maximumNumberOfThreads() { - return maxWorkerThreads; - } - - public long idleTimeoutForThreads() { - return inactivityTimeout; - } - - public int currentNumberOfThreads() { - synchronized (workQueue) { - return currentThreadCount; - } - } - - void decrementCurrentNumberOfThreads() { - synchronized (workQueue) { - currentThreadCount--; - } - } - - void incrementCurrentNumberOfThreads() { - synchronized (workQueue) { - currentThreadCount++; - } - } - - public int numberOfAvailableThreads() { - synchronized (workQueue) { - return availableWorkerThreads; - } - } - - public int numberOfBusyThreads() { - synchronized (workQueue) { - return (currentThreadCount - availableWorkerThreads); - } - } - - public long averageWorkCompletionTime() { - synchronized (workQueue) { - return (totalTimeTaken.get() / processedCount.get()); - } - } - - public long currentProcessedCount() { - synchronized (workQueue) { - return processedCount.get(); - } - } - - public String getName() { - return name; - } - - /** - * This method will return the number of WorkQueues serviced by the threadpool. - */ - public int numberOfWorkQueues() { - return 1; - } - - - private static synchronized int getUniqueThreadId() { - return ThreadPoolImpl.threadCounter.incrementAndGet(); - } - - /** - * This method will decrement the number of available threads - * in the threadpool which are waiting for work. Called from - * WorkQueueImpl.requestWork() - */ - void decrementNumberOfAvailableThreads() { - synchronized (workQueue) { - availableWorkerThreads--; - } - } - - /** - * This method will increment the number of available threads - * in the threadpool which are waiting for work. Called from - * WorkQueueImpl.requestWork() - */ - void incrementNumberOfAvailableThreads() { - synchronized (workQueue) { - availableWorkerThreads++; - } - } - - - private class WorkerThread extends Thread implements Closeable - { - private Work currentWork; - private int threadId = 0; // unique id for the thread - private volatile boolean closeCalled = false; - private String threadPoolName; - // name seen by Thread.getName() - private StringBuffer workerThreadName = new StringBuffer(); - - WorkerThread(ThreadGroup tg, String threadPoolName) { - super(tg, null, "Idle", 0, false); - this.threadId = ThreadPoolImpl.getUniqueThreadId(); - this.threadPoolName = threadPoolName; - setName(composeWorkerThreadName(threadPoolName, "Idle")); - } - - public synchronized void close() { - closeCalled = true; - interrupt(); - } - - private void resetClassLoader() { - - } - - private void performWork() { - long start = System.currentTimeMillis(); - try { - currentWork.doWork(); - } catch (Throwable t) { - wrapper.workerThreadDoWorkThrowable(this, t); - } - long elapsedTime = System.currentTimeMillis() - start; - totalTimeTaken.addAndGet(elapsedTime); - processedCount.incrementAndGet(); - } - - public void run() { - try { - while (!closeCalled) { - try { - currentWork = ((WorkQueueImpl)workQueue).requestWork( - inactivityTimeout); - if (currentWork == null) - continue; - } catch (InterruptedException exc) { - wrapper.workQueueThreadInterrupted( exc, getName(), - Boolean.valueOf(closeCalled)); - - continue ; - } catch (Throwable t) { - wrapper.workerThreadThrowableFromRequestWork(this, t, - workQueue.getName()); - - continue; - } - - performWork(); - - // set currentWork to null so that the work item can be - // garbage collected without waiting for the next work item. - currentWork = null; - - resetClassLoader(); - } - } catch (Throwable e) { - // This should not be possible - wrapper.workerThreadCaughtUnexpectedThrowable(this,e); - } finally { - synchronized (workersLock) { - workers.remove(this); - } - } - } - - private String composeWorkerThreadName(String poolName, String workerName) { - workerThreadName.setLength(0); - workerThreadName.append("p: ").append(poolName); - workerThreadName.append("; w: ").append(workerName); - return workerThreadName.toString(); - } - } // End of WorkerThread class - -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/threadpool/ThreadPoolManagerImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/threadpool/ThreadPoolManagerImpl.java deleted file mode 100644 index 40214e816d6..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/threadpool/ThreadPoolManagerImpl.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil.threadpool; - -import java.io.IOException; - -import java.security.PrivilegedAction; -import java.security.AccessController; - -import java.util.concurrent.atomic.AtomicInteger; - -import com.sun.corba.se.spi.orb.ORB; - -import com.sun.corba.se.spi.orbutil.threadpool.NoSuchThreadPoolException; -import com.sun.corba.se.spi.orbutil.threadpool.ThreadPool; -import com.sun.corba.se.spi.orbutil.threadpool.ThreadPoolManager; -import com.sun.corba.se.spi.orbutil.threadpool.ThreadPoolChooser; - -import com.sun.corba.se.impl.orbutil.threadpool.ThreadPoolImpl; -import com.sun.corba.se.impl.orbutil.ORBConstants; - -import com.sun.corba.se.impl.logging.ORBUtilSystemException; -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.spi.logging.CORBALogDomains; - - -public class ThreadPoolManagerImpl implements ThreadPoolManager -{ - private ThreadPool threadPool; - private ThreadGroup threadGroup; - - private static final ORBUtilSystemException wrapper = - ORBUtilSystemException.get(CORBALogDomains.RPC_TRANSPORT); - - public ThreadPoolManagerImpl() { - threadGroup = getThreadGroup(); - threadPool = new ThreadPoolImpl(threadGroup, - ORBConstants.THREADPOOL_DEFAULT_NAME); - } - - private static AtomicInteger tgCount = new AtomicInteger(); - - - private ThreadGroup getThreadGroup() { - ThreadGroup tg; - - // See bugs 4916766 and 4936203 - // We intend to create new threads in a reliable thread group. - // This avoids problems if the application/applet - // creates a thread group, makes JavaIDL calls which create a new - // connection and ReaderThread, and then destroys the thread - // group. If our ReaderThreads were to be part of such destroyed thread - // group then it might get killed and cause other invoking threads - // sharing the same connection to get a non-restartable - // CommunicationFailure. We'd like to avoid that. - // - // Our solution is to create all of our threads in the highest thread - // group that we have access to, given our own security clearance. - // - try { - // try to get a thread group that's as high in the threadgroup - // parent-child hierarchy, as we can get to. - // this will prevent an ORB thread created during applet-init from - // being killed when an applet dies. - tg = AccessController.doPrivileged( - new PrivilegedAction() { - public ThreadGroup run() { - ThreadGroup tg = Thread.currentThread().getThreadGroup(); - ThreadGroup ptg = tg; - try { - while (ptg != null) { - tg = ptg; - ptg = tg.getParent(); - } - } catch (SecurityException se) { - // Discontinue going higher on a security exception. - } - return new ThreadGroup(tg, "ORB ThreadGroup " + tgCount.getAndIncrement()); - } - } - ); - } catch (SecurityException e) { - // something wrong, we go back to the original code - tg = Thread.currentThread().getThreadGroup(); - } - - return tg; - } - - public void close() { - try { - threadPool.close(); - } catch (IOException exc) { - wrapper.threadPoolCloseError(); - } - - try { - boolean isDestroyed = threadGroup.isDestroyed(); - int numThreads = threadGroup.activeCount(); - int numGroups = threadGroup.activeGroupCount(); - - if (isDestroyed) { - wrapper.threadGroupIsDestroyed(threadGroup); - } else { - if (numThreads > 0) - wrapper.threadGroupHasActiveThreadsInClose(threadGroup, numThreads); - - if (numGroups > 0) - wrapper.threadGroupHasSubGroupsInClose(threadGroup, numGroups); - - threadGroup.destroy(); - } - } catch (IllegalThreadStateException exc) { - wrapper.threadGroupDestroyFailed(exc, threadGroup); - } - - threadGroup = null; - } - - /** - * This method will return an instance of the threadpool given a threadpoolId, - * that can be used by any component in the app. server. - * - * @throws NoSuchThreadPoolException thrown when invalid threadpoolId is passed - * as a parameter - */ - public ThreadPool getThreadPool(String threadpoolId) - throws NoSuchThreadPoolException { - - return threadPool; - } - - /** - * This method will return an instance of the threadpool given a numeric threadpoolId. - * This method will be used by the ORB to support the functionality of - * dedicated threadpool for EJB beans - * - * @throws NoSuchThreadPoolException thrown when invalidnumericIdForThreadpool is passed - * as a parameter - */ - public ThreadPool getThreadPool(int numericIdForThreadpool) - throws NoSuchThreadPoolException { - - return threadPool; - } - - /** - * This method is used to return the numeric id of the threadpool, given a String - * threadpoolId. This is used by the POA interceptors to add the numeric threadpool - * Id, as a tagged component in the IOR. This is used to provide the functionality of - * dedicated threadpool for EJB beans - */ - public int getThreadPoolNumericId(String threadpoolId) { - return 0; - } - - /** - * Return a String Id for a numericId of a threadpool managed by the threadpool - * manager - */ - public String getThreadPoolStringId(int numericIdForThreadpool) { - return ""; - } - - /** - * Returns the first instance of ThreadPool in the ThreadPoolManager - */ - public ThreadPool getDefaultThreadPool() { - return threadPool; - } - - /** - * Return an instance of ThreadPoolChooser based on the componentId that was - * passed as argument - */ - public ThreadPoolChooser getThreadPoolChooser(String componentId) { - //FIXME: This method is not used, but should be fixed once - //nio select starts working and we start using ThreadPoolChooser - return null; - } - /** - * Return an instance of ThreadPoolChooser based on the componentIndex that was - * passed as argument. This is added for improved performance so that the caller - * does not have to pay the cost of computing hashcode for the componentId - */ - public ThreadPoolChooser getThreadPoolChooser(int componentIndex) { - //FIXME: This method is not used, but should be fixed once - //nio select starts working and we start using ThreadPoolChooser - return null; - } - - /** - * Sets a ThreadPoolChooser for a particular componentId in the ThreadPoolManager. This - * would enable any component to add a ThreadPoolChooser for their specific use - */ - public void setThreadPoolChooser(String componentId, ThreadPoolChooser aThreadPoolChooser) { - //FIXME: This method is not used, but should be fixed once - //nio select starts working and we start using ThreadPoolChooser - } - - /** - * Gets the numeric index associated with the componentId specified for a - * ThreadPoolChooser. This method would help the component call the more - * efficient implementation i.e. getThreadPoolChooser(int componentIndex) - */ - public int getThreadPoolChooserNumericId(String componentId) { - //FIXME: This method is not used, but should be fixed once - //nio select starts working and we start using ThreadPoolChooser - return 0; - } - -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/threadpool/TimeoutException.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/threadpool/TimeoutException.java deleted file mode 100644 index 2c6476eff0a..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/threadpool/TimeoutException.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil.threadpool; - -public class TimeoutException extends Exception -{ -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/threadpool/WorkQueueImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/threadpool/WorkQueueImpl.java deleted file mode 100644 index 6e2320eeade..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/threadpool/WorkQueueImpl.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.orbutil.threadpool; - -import java.util.LinkedList; - -import com.sun.corba.se.spi.orbutil.threadpool.ThreadPool; -import com.sun.corba.se.spi.orbutil.threadpool.Work; -import com.sun.corba.se.spi.orbutil.threadpool.WorkQueue; - -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.impl.orbutil.threadpool.ThreadPoolImpl; - -import com.sun.corba.se.spi.monitoring.MonitoringConstants; -import com.sun.corba.se.spi.monitoring.MonitoringFactories; -import com.sun.corba.se.spi.monitoring.MonitoredObject; -import com.sun.corba.se.spi.monitoring.LongMonitoredAttributeBase; - -public class WorkQueueImpl implements WorkQueue -{ - private ThreadPool workerThreadPool; - private LinkedList theWorkQueue = new LinkedList(); - private long workItemsAdded = 0; - - // Initialized to 1 to avoid divide by zero in averageTimeInQueue() - private long workItemsDequeued = 1; - - private long totalTimeInQueue = 0; - - // Name of the work queue - private String name; - - // MonitoredObject for work queue - private MonitoredObject workqueueMonitoredObject; - - public WorkQueueImpl() { - name=ORBConstants.WORKQUEUE_DEFAULT_NAME; - initializeMonitoring(); - } - - public WorkQueueImpl(ThreadPool workerThreadPool) { - this(workerThreadPool, ORBConstants.WORKQUEUE_DEFAULT_NAME); - } - - public WorkQueueImpl(ThreadPool workerThreadPool, String name) { - this.workerThreadPool = workerThreadPool; - this.name = name; - initializeMonitoring(); - } - - // Setup monitoring for this workqueue - private void initializeMonitoring() { - workqueueMonitoredObject = MonitoringFactories. - getMonitoredObjectFactory(). - createMonitoredObject(name, - MonitoringConstants.WORKQUEUE_MONITORING_DESCRIPTION); - - LongMonitoredAttributeBase b1 = new - LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_TOTAL_WORK_ITEMS_ADDED, - MonitoringConstants.WORKQUEUE_TOTAL_WORK_ITEMS_ADDED_DESCRIPTION) { - public Object getValue() { - return new Long(WorkQueueImpl.this.totalWorkItemsAdded()); - } - }; - workqueueMonitoredObject.addAttribute(b1); - LongMonitoredAttributeBase b2 = new - LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_WORK_ITEMS_IN_QUEUE, - MonitoringConstants.WORKQUEUE_WORK_ITEMS_IN_QUEUE_DESCRIPTION) { - public Object getValue() { - return new Long(WorkQueueImpl.this.workItemsInQueue()); - } - }; - workqueueMonitoredObject.addAttribute(b2); - LongMonitoredAttributeBase b3 = new - LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_AVERAGE_TIME_IN_QUEUE, - MonitoringConstants.WORKQUEUE_AVERAGE_TIME_IN_QUEUE_DESCRIPTION) { - public Object getValue() { - return new Long(WorkQueueImpl.this.averageTimeInQueue()); - } - }; - workqueueMonitoredObject.addAttribute(b3); - } - - - // Package private method to get the monitored object for this - // class - MonitoredObject getMonitoredObject() { - return workqueueMonitoredObject; - } - - public synchronized void addWork(Work work) { - workItemsAdded++; - work.setEnqueueTime(System.currentTimeMillis()); - theWorkQueue.addLast(work); - ((ThreadPoolImpl)workerThreadPool).notifyForAvailableWork(this); - } - - synchronized Work requestWork(long waitTime) throws TimeoutException, InterruptedException - { - Work workItem; - ((ThreadPoolImpl)workerThreadPool).incrementNumberOfAvailableThreads(); - - if (theWorkQueue.size() != 0) { - workItem = (Work)theWorkQueue.removeFirst(); - totalTimeInQueue += System.currentTimeMillis() - workItem.getEnqueueTime(); - workItemsDequeued++; - ((ThreadPoolImpl)workerThreadPool).decrementNumberOfAvailableThreads(); - return workItem; - } - - try { - - long remainingWaitTime = waitTime; - long finishTime = System.currentTimeMillis() + waitTime; - - do { - - this.wait(remainingWaitTime); - - if (theWorkQueue.size() != 0) { - workItem = (Work)theWorkQueue.removeFirst(); - totalTimeInQueue += System.currentTimeMillis() - workItem.getEnqueueTime(); - workItemsDequeued++; - ((ThreadPoolImpl)workerThreadPool).decrementNumberOfAvailableThreads(); - return workItem; - } - - remainingWaitTime = finishTime - System.currentTimeMillis(); - - } while (remainingWaitTime > 0); - - ((ThreadPoolImpl)workerThreadPool).decrementNumberOfAvailableThreads(); - throw new TimeoutException(); - - } catch (InterruptedException ie) { - ((ThreadPoolImpl)workerThreadPool).decrementNumberOfAvailableThreads(); - throw ie; - } - } - - public void setThreadPool(ThreadPool workerThreadPool) { - this.workerThreadPool = workerThreadPool; - } - - public ThreadPool getThreadPool() { - return workerThreadPool; - } - - /** - * Returns the total number of Work items added to the Queue. - * This method is unsynchronized and only gives a snapshot of the - * state when it is called - */ - public long totalWorkItemsAdded() { - return workItemsAdded; - } - - /** - * Returns the total number of Work items in the Queue to be processed - * This method is unsynchronized and only gives a snapshot of the - * state when it is called - */ - public int workItemsInQueue() { - return theWorkQueue.size(); - } - - public synchronized long averageTimeInQueue() { - return (totalTimeInQueue/workItemsDequeued); - } - - public String getName() { - return name; - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/DynamicAccessPermission.java b/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/DynamicAccessPermission.java deleted file mode 100644 index 2879ebf481e..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/DynamicAccessPermission.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.presentation.rmi; - -import java.security.*; - -/** - * This class controls the use of dynamic proxies. - * A DynamicAccessPermission contains a name (also referred to as a "target name") but - * no actions list; you either have the named permission - * or you don't. - * - */ - -public final class DynamicAccessPermission extends BasicPermission { - //private static final long serialVersionUID = -8343910153355041693L; - - /** - * Creates a new DynamicAccessPermission with the specified name. - * @param name the name of the DynamicAccessPermission. - */ - public DynamicAccessPermission(String name) - { - super(name); - } - - /** - * Creates a new DynamicAccessPermission object with the specified name. - * The name is the symbolic name of the DynamicAccessPermission, and the - * actions String is currently unused and should be null. - * - * @param name the name of the DynamicAccessPermission. - * @param actions should be null. - */ - public DynamicAccessPermission(String name, String actions) - { - super(name, actions); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/DynamicMethodMarshallerImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/DynamicMethodMarshallerImpl.java deleted file mode 100644 index c4ef2874f29..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/DynamicMethodMarshallerImpl.java +++ /dev/null @@ -1,465 +0,0 @@ -/* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.presentation.rmi ; - -import java.io.Serializable ; -import java.io.Externalizable ; - -import javax.rmi.PortableRemoteObject ; -import javax.rmi.CORBA.Util ; - -import org.omg.CORBA.portable.IDLEntity ; - -import org.omg.CORBA_2_3.portable.InputStream ; -import org.omg.CORBA_2_3.portable.OutputStream ; -import org.omg.CORBA.portable.ApplicationException ; - -import java.lang.reflect.Method ; - -import java.rmi.RemoteException ; - -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.spi.presentation.rmi.DynamicMethodMarshaller ; - -public class DynamicMethodMarshallerImpl implements DynamicMethodMarshaller -{ - Method method ; - ExceptionHandler ehandler ; - boolean hasArguments = true ; - boolean hasVoidResult = true ; - boolean needsArgumentCopy ; // true if copyObjects call needs for args - boolean needsResultCopy ; // true if copyObject call needs for result - ReaderWriter[] argRWs = null ; - ReaderWriter resultRW = null ; - - private static boolean isAnyClass( Class cls ) - { - return cls.equals( Object.class ) || cls.equals( Serializable.class ) || - cls.equals( Externalizable.class ) ; - } - - // Assume that cls is not Remote, !isAnyClass(cls), and - // !org.omg.CORBA.Object.class.isAssignableFrom( cls ). - // Then return whether cls is an RMI-IIOP abstract interface. - private static boolean isAbstractInterface( Class cls ) - { - // Either cls is an interface that extends IDLEntity, or else - // cls does not extend java.rmi.Remote and all of its methods - // throw RemoteException. - if (IDLEntity.class.isAssignableFrom( cls )) - return cls.isInterface() ; - else - return cls.isInterface() && allMethodsThrowRemoteException( cls ) ; - } - - private static boolean allMethodsThrowRemoteException( Class cls ) - { - Method[] methods = cls.getMethods() ; - - // Check that all methods (other than those declared in java.lang.Object) - // throw an exception that is a subclass of RemoteException. - for (int ctr=0; ctr 0 ; - if (hasArguments) { - argRWs = new ReaderWriter[ argTypes.length ] ; - for (int ctr=0; ctr 0) { - ExceptionRW duprw = rws[duplicateIndex] ; - String firstClassName = - erw.getExceptionClass().getName() ; - String secondClassName = - duprw.getExceptionClass().getName() ; - throw wrapper.duplicateExceptionRepositoryId( - firstClassName, secondClassName, repositoryId ) ; - } - - */ - - rws[index++] = erw ; - } - } - } - - private int findDeclaredException( Class cls ) - { - for (int ctr = 0; ctr < rws.length; ctr++) { - Class next = rws[ctr].getExceptionClass() ; - if (next.isAssignableFrom(cls)) - return ctr ; - } - - return -1 ; - } - - private int findDeclaredException( String repositoryId ) - { - for (int ctr=0; ctr= 0 ; - } - - public void writeException( OutputStream os, Exception ex ) - { - int index = findDeclaredException( ex.getClass() ) ; - if (index < 0) - throw wrapper.writeUndeclaredException( ex, - ex.getClass().getName() ) ; - - rws[index].write( os, ex ) ; - } - - public Exception readException( ApplicationException ae ) - { - // Note that the exception ID is present in both ae - // and in the input stream from ae. The exception - // reader must actually read the exception ID from - // the stream. - InputStream is = (InputStream)ae.getInputStream() ; - String excName = ae.getId() ; - int index = findDeclaredException( excName ) ; - if (index < 0) { - excName = is.read_string() ; - Exception res = new UnexpectedException( excName ) ; - res.initCause( ae ) ; - return res ; - } - - return rws[index].read( is ) ; - } - - // This is here just for the dynamicrmiiiop test - public ExceptionRW getRMIExceptionRW( Class cls ) - { - return new ExceptionRWRMIImpl( cls ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLNameTranslatorImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLNameTranslatorImpl.java deleted file mode 100644 index a9f1dd2d836..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLNameTranslatorImpl.java +++ /dev/null @@ -1,908 +0,0 @@ -/* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.presentation.rmi ; - -import java.security.AccessController; -import java.security.PrivilegedAction; - -import java.lang.reflect.Method; - -import java.math.BigInteger; - -import java.util.Map; -import java.util.Set; -import java.util.HashSet; -import java.util.Iterator; -import java.util.HashMap; -import java.util.StringTokenizer; - -import com.sun.corba.se.spi.presentation.rmi.IDLNameTranslator ; - -import com.sun.corba.se.impl.presentation.rmi.IDLType ; -import com.sun.corba.se.impl.presentation.rmi.IDLTypeException ; -import com.sun.corba.se.impl.presentation.rmi.IDLTypesUtil ; -import com.sun.corba.se.impl.orbutil.ObjectUtility ; - -/** - * Bidirectional translator between RMI-IIOP interface methods and - * and IDL Names. - */ -public class IDLNameTranslatorImpl implements IDLNameTranslator { - - // From CORBA Spec, Table 6 Keywords. - // Note that since all IDL identifiers are case - // insensitive, java identifier comparisons to these - // will be case insensitive also. - private static String[] IDL_KEYWORDS = { - - "abstract", "any", "attribute", "boolean", "case", "char", - "const", "context", "custom", "default", "double", "enum", - "exception", "factory", "FALSE", "fixed", "float", "in", "inout", - "interface", "long", "module", "native", "Object", "octet", - "oneway", "out", "private", "public", "raises", "readonly", "sequence", - "short", "string", "struct", "supports", "switch", "TRUE", "truncatable", - "typedef", "unsigned", "union", "ValueBase", "valuetype", "void", - "wchar", "wstring" - - }; - - private static char[] HEX_DIGITS = { - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - 'A', 'B', 'C', 'D', 'E', 'F' - }; - - private static final String UNDERSCORE = "_"; - - // used to mangle java inner class names - private static final String INNER_CLASS_SEPARATOR = - UNDERSCORE + UNDERSCORE; - - // used to form IDL array type names - private static final String[] BASE_IDL_ARRAY_MODULE_TYPE= - new String[] { "org", "omg", "boxedRMI" } ; - - private static final String BASE_IDL_ARRAY_ELEMENT_TYPE = "seq"; - - // used to mangling java identifiers that have a leading underscore - private static final String LEADING_UNDERSCORE_CHAR = "J"; - private static final String ID_CONTAINER_CLASH_CHAR = UNDERSCORE; - - // separator used between types in a mangled overloaded method name - private static final String OVERLOADED_TYPE_SEPARATOR = - UNDERSCORE + UNDERSCORE; - - // string appended to attribute if it clashes with a method name - private static final String ATTRIBUTE_METHOD_CLASH_MANGLE_CHARS = - UNDERSCORE + UNDERSCORE; - - // strings prepended to the attribute names in order to form their - // IDL names. - private static final String GET_ATTRIBUTE_PREFIX = "_get_"; - private static final String SET_ATTRIBUTE_PREFIX = "_set_"; - private static final String IS_ATTRIBUTE_PREFIX = "_get_"; - - private static Set idlKeywords_; - - static { - - idlKeywords_ = new HashSet(); - for(int i = 0; i < IDL_KEYWORDS.length; i++) { - String next = (String) IDL_KEYWORDS[i]; - // Convert keyword to all caps to ease equality - // check. - String keywordAllCaps = next.toUpperCase(); - idlKeywords_.add(keywordAllCaps); - } - - } - - // - // Instance state - // - - // Remote interface for name translation. - private Class[] interf_; - - // Maps used to hold name translations. These do not need to be - // synchronized since the translation is never modified after - // initialization. - private Map methodToIDLNameMap_; - private Map IDLNameToMethodMap_; - private Method[] methods_; - - /** - * Return an IDLNameTranslator for the given interface. - * - * @throws IllegalStateException if given class is not a valid - * RMI/IIOP Remote Interface - */ - public static IDLNameTranslator get( Class interf ) - { - - return new IDLNameTranslatorImpl(new Class[] { interf } ); - - } - - /** - * Return an IDLNameTranslator for the given interfacex. - * - * @throws IllegalStateException if given classes are not valid - * RMI/IIOP Remote Interfaces - */ - public static IDLNameTranslator get( Class[] interfaces ) - { - - return new IDLNameTranslatorImpl(interfaces ); - - } - - public static String getExceptionId( Class cls ) - { - // Requirements for this method: - // 1. cls must be an exception but not a RemoteException. - // 2. If cls has an IDL keyword name, an underscore is prepended (1.3.2.2). - // 3. If cls jas a leading underscore, J is prepended (1.3.2.3). - // 4. If cls has an illegal IDL ident char, it is mapped to UXXXX where - // XXXX is the unicode value in hex of the char (1.3.2.4). - // 5. double underscore for inner class (1.3.2.5). - // 6. The ID is "IDL:" + name with / separators + ":1.0". - IDLType itype = classToIDLType( cls ) ; - return itype.getExceptionName() ; - } - - public Class[] getInterfaces() - { - return interf_; - } - - public Method[] getMethods() - { - return methods_ ; - } - - public Method getMethod( String idlName ) - { - return (Method) IDLNameToMethodMap_.get(idlName); - } - - public String getIDLName( Method method ) - { - return (String) methodToIDLNameMap_.get(method); - } - - /** - * Initialize an IDLNameTranslator for the given interface. - * - * @throws IllegalStateException if given class is not a valid - * RMI/IIOP Remote Interface - */ - private IDLNameTranslatorImpl(Class[] interfaces) - { - - SecurityManager s = System.getSecurityManager(); - if (s != null) { - s.checkPermission(new DynamicAccessPermission("access")); - } - try { - IDLTypesUtil idlTypesUtil = new IDLTypesUtil(); - for (int ctr=0; ctr 0 ) { - int div = value / 16; - int mod = value % 16; - hexString.insert(0, HEX_DIGITS[mod]); - value = div; - } - - int numZerosToAdd = 4 - hexString.length(); - for(int i = 0; i < numZerosToAdd; i++) { - hexString.insert(0, "0"); - } - - hexString.insert(0, "U"); - return hexString.toString(); - } - - private static boolean isIDLIdentifier(String identifier) { - - boolean isIdentifier = true; - - for(int i = 0; i < identifier.length(); i++) { - char nextChar = identifier.charAt(i); - // 1st char must be alphbetic. - isIdentifier = (i == 0) ? - isIDLAlphabeticChar(nextChar) : - isIDLIdentifierChar(nextChar); - if( !isIdentifier ) { - break; - } - } - - return isIdentifier; - - } - - private static boolean isIDLIdentifierChar(char c) { - return (isIDLAlphabeticChar(c) || - isIDLDecimalDigit(c) || - isUnderscore(c)); - } - - /** - * True if character is one of 114 Alphabetic characters as - * specified in Table 2 of Chapter 3 in CORBA spec. - */ - private static boolean isIDLAlphabeticChar(char c) { - - // NOTE that we can't use the java.lang.Character - // isUpperCase, isLowerCase, etc. methods since they - // include many characters other than the Alphabetic list in - // the CORBA spec. Instead, we test for inclusion in the - // Unicode value ranges for the corresponding legal characters. - - boolean alphaChar = - ( - // A - Z - ((c >= 0x0041) && (c <= 0x005A)) - - || - - // a - z - ((c >= 0x0061) && (c <= 0x007A)) - - || - - // other letter uppercase, other letter lowercase, which is - // the entire upper half of C1 Controls except X and / - ((c >= 0x00C0) && (c <= 0x00FF) - && (c != 0x00D7) && (c != 0x00F7))); - - return alphaChar; - } - - /** - * True if character is one of 10 Decimal Digits - * specified in Table 3 of Chapter 3 in CORBA spec. - */ - private static boolean isIDLDecimalDigit(char c) { - return ( (c >= 0x0030) && (c <= 0x0039) ); - } - - private static boolean isUnderscore(char c) { - return ( c == 0x005F ); - } - - /** - * Mangle an overloaded method name as defined in Section 1.3.2.6 of - * Java2IDL spec. Current value of method name is passed in as argument. - * We can't start from original method name since the name might have - * been partially mangled as a result of the other rules. - */ - private static String mangleOverloadedMethod(String mangledName, Method m) { - - IDLTypesUtil idlTypesUtil = new IDLTypesUtil(); - - // Start by appending the separator string - String newMangledName = mangledName + OVERLOADED_TYPE_SEPARATOR; - - Class[] parameterTypes = m.getParameterTypes(); - - for(int i = 0; i < parameterTypes.length; i++) { - Class nextParamType = parameterTypes[i]; - - if( i > 0 ) { - newMangledName = newMangledName + OVERLOADED_TYPE_SEPARATOR; - } - IDLType idlType = classToIDLType(nextParamType); - - String moduleName = idlType.getModuleName(); - String memberName = idlType.getMemberName(); - - String typeName = (moduleName.length() > 0) ? - moduleName + UNDERSCORE + memberName : memberName; - - if( !idlTypesUtil.isPrimitive(nextParamType) && - (idlTypesUtil.getSpecialCaseIDLTypeMapping(nextParamType) - == null) && - isIDLKeyword(typeName) ) { - typeName = mangleIDLKeywordClash(typeName); - } - - typeName = mangleUnicodeChars(typeName); - - newMangledName = newMangledName + typeName; - } - - return newMangledName; - } - - - private static IDLType classToIDLType(Class c) { - - IDLType idlType = null; - IDLTypesUtil idlTypesUtil = new IDLTypesUtil(); - - if( idlTypesUtil.isPrimitive(c) ) { - - idlType = idlTypesUtil.getPrimitiveIDLTypeMapping(c); - - } else if( c.isArray() ) { - - // Calculate array depth, as well as base element type. - Class componentType = c.getComponentType(); - int numArrayDimensions = 1; - while(componentType.isArray()) { - componentType = componentType.getComponentType(); - numArrayDimensions++; - } - IDLType componentIdlType = classToIDLType(componentType); - - String[] modules = BASE_IDL_ARRAY_MODULE_TYPE; - if( componentIdlType.hasModule() ) { - modules = (String[])ObjectUtility.concatenateArrays( modules, - componentIdlType.getModules() ) ; - } - - String memberName = BASE_IDL_ARRAY_ELEMENT_TYPE + - numArrayDimensions + UNDERSCORE + - componentIdlType.getMemberName(); - - idlType = new IDLType(c, modules, memberName); - - } else { - idlType = idlTypesUtil.getSpecialCaseIDLTypeMapping(c); - - if (idlType == null) { - // Section 1.3.2.5 of Java2IDL spec defines mangling rules for - // inner classes. - String memberName = getUnmappedContainerName(c); - - // replace inner class separator with double underscore - memberName = memberName.replaceAll("\\$", - INNER_CLASS_SEPARATOR); - - if( hasLeadingUnderscore(memberName) ) { - memberName = mangleLeadingUnderscore(memberName); - } - - // Get raw package name. If there is a package, it - // will still have the "." separators and none of the - // mangling rules will have been applied. - String packageName = getPackageName(c); - - if (packageName == null) { - idlType = new IDLType( c, memberName ) ; - } else { - // If this is a generated IDL Entity Type we need to - // prepend org_omg_boxedIDL per sections 1.3.5 and 1.3.9 - if (idlTypesUtil.isEntity(c)) { - packageName = "org.omg.boxedIDL." + packageName ; - } - - // Section 1.3.2.1 and 1.3.2.6 of Java2IDL spec defines - // rules for mapping java packages to IDL modules and for - // mangling module name portion of type name. NOTE that - // of the individual identifier mangling rules, - // only the leading underscore test is done here. - // The other two(IDL Keyword, Illegal Unicode chars) are - // done in mangleOverloadedMethodName. - StringTokenizer tokenizer = - new StringTokenizer(packageName, "."); - - String[] modules = new String[ tokenizer.countTokens() ] ; - int index = 0 ; - while (tokenizer.hasMoreElements()) { - String next = tokenizer.nextToken(); - String moreMangled = hasLeadingUnderscore( next ) ? - mangleLeadingUnderscore( next ) : next; - - modules[index++] = moreMangled ; - } - - idlType = new IDLType(c, modules, memberName); - } - } - } - - return idlType; - } - - /** - * Return Class' package name or null if there is no package. - */ - private static String getPackageName(Class c) { - Package thePackage = c.getPackage(); - String packageName = null; - - // Try to get package name by introspection. Some classloaders might - // not provide this information, so check for null. - if( thePackage != null ) { - packageName = thePackage.getName(); - } else { - // brute force method - String fullyQualifiedClassName = c.getName(); - int lastDot = fullyQualifiedClassName.indexOf('.'); - packageName = (lastDot == -1) ? null : - fullyQualifiedClassName.substring(0, lastDot); - } - return packageName; - } - - private static String getMappedContainerName(Class c) { - String unmappedName = getUnmappedContainerName(c); - - return mangleIdentifier(unmappedName); - } - - /** - * Return portion of class name excluding package name. - */ - private static String getUnmappedContainerName(Class c) { - - String memberName = null; - String packageName = getPackageName(c); - - String fullyQualifiedClassName = c.getName(); - - if( packageName != null ) { - int packageLength = packageName.length(); - memberName = fullyQualifiedClassName.substring(packageLength + 1); - } else { - memberName = fullyQualifiedClassName; - - } - - return memberName; - } - - /** - * Internal helper class for tracking information related to each - * interface method while we're building the name translation table. - */ - private static class IDLMethodInfo - { - public Method method; - public boolean isProperty; - - // If this is a property, originalName holds the original - // attribute name. Otherwise, it holds the original method name. - public String originalName; - - // If this is a property, mangledName holds the mangled attribute - // name. Otherwise, it holds the mangled method name. - public String mangledName; - - } - - public String toString() { - - StringBuffer contents = new StringBuffer(); - contents.append("IDLNameTranslator[" ); - for( int ctr=0; ctr0) - sbuff.append( separator ) ; - - if (fixIDLKeywords && IDLNameTranslatorImpl.isIDLKeyword(mod)) - mod = IDLNameTranslatorImpl.mangleIDLKeywordClash( mod ) ; - - sbuff.append( mod ) ; - } - - return sbuff.toString() ; - } - - public String getModuleName() { - // Note that this should probably be makeConcatenatedName( '/', true ) - // for spec compliance, - // but rmic does it this way, so we'll leave this. - // The effect is that an overloaded method like - // void foo( bar.typedef.Baz ) - // will get an IDL name of foo__bar_typedef_Baz instead of - // foo__bar__typedef_Baz (note the extra _ before typedef). - return makeConcatenatedName( '_', false ) ; - } - - public String getExceptionName() { - // Here we will check for IDL keyword collisions (see bug 5010332). - // This means that the repository ID for - // foo.exception.SomeException is - // "IDL:foo/_exception/SomeEx:1.0" (note the underscore in front - // of the exception module name). - String modName = makeConcatenatedName( '/', true ) ; - - String suffix = "Exception" ; - String excName = memberName_ ; - if (excName.endsWith( suffix )) { - int last = excName.length() - suffix.length() ; - excName = excName.substring( 0, last ) ; - } - - // See bug 4989312: we must always add the Ex. - excName += "Ex" ; - - if (modName.length() == 0) - return "IDL:" + excName + ":1.0" ; - else - return "IDL:" + modName + '/' + excName + ":1.0" ; - } - - public String getMemberName() { - return memberName_; - } - - /** - * True if this type doesn't have a containing module. This - * would be true of a java type defined in the default package - * or a primitive. - */ - public boolean hasModule() { - return (modules_.length > 0) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLTypeException.java b/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLTypeException.java deleted file mode 100644 index b741d963406..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLTypeException.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.presentation.rmi ; - -/** - * Checked exception containing information about an - * an IDL type validation. - */ -public class IDLTypeException extends Exception { - - public IDLTypeException() {} - - public IDLTypeException(String message) { - super(message); - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLTypesUtil.java b/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLTypesUtil.java deleted file mode 100644 index f72e4fbe4cf..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLTypesUtil.java +++ /dev/null @@ -1,598 +0,0 @@ -/* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package com.sun.corba.se.impl.presentation.rmi ; - -import java.lang.reflect.Method; -import java.lang.reflect.Field; -import java.util.Set; -import java.util.HashSet; -import java.util.Iterator; - -/** - * Utility class for testing RMI/IDL Types as defined in - * Section 1.2 of The Java Language to IDL Mapping. Note that - * these are static checks only. Runtime checks, such as those - * described in Section 1.2.3, #3, are not covered. - */ -public final class IDLTypesUtil { - - private static final String GET_PROPERTY_PREFIX = "get"; - private static final String SET_PROPERTY_PREFIX = "set"; - private static final String IS_PROPERTY_PREFIX = "is"; - - public static final int VALID_TYPE = 0; - public static final int INVALID_TYPE = 1; - - /* rmic -iiop does not correctly implement the clause in 1.3.4.3 - * about is/get conflicts. The spec says that - * is is the property and get is left alone, - * but rmic does the opposite. We will follow rmic in this, - * but it's easy to change. - */ - public static final boolean FOLLOW_RMIC = true ; - - /** - * Validate a class to ensure it conforms to the rules for a - * Java RMI/IIOP interface. - * - * @throws IDLTypeException if not a valid RMI/IIOP interface. - */ - public void validateRemoteInterface(Class c) throws IDLTypeException - { - if( c == null ) { - throw new IllegalArgumentException(); - } - - if( !c.isInterface() ) { - String msg = "Class " + c + " must be a java interface."; - throw new IDLTypeException(msg); - } - - if( !java.rmi.Remote.class.isAssignableFrom(c) ) { - String msg = "Class " + c + " must extend java.rmi.Remote, " + - "either directly or indirectly."; - throw new IDLTypeException(msg); - } - - // Get all methods, including super-interface methods. - Method[] methods = c.getMethods(); - - for(int i = 0; i < methods.length; i++) { - Method next = methods[i]; - validateExceptions(next); - } - - // Removed because of bug 4989053 - // validateDirectInterfaces(c); - validateConstants(c); - - return; - } - - public boolean isRemoteInterface(Class c) - { - boolean remoteInterface = true; - try { - validateRemoteInterface(c); - } catch(IDLTypeException ite) { - remoteInterface = false; - } - - return remoteInterface; - } - - /** - * Section 1.2.2 Primitive Types - */ - public boolean isPrimitive(Class c) - { - if( c == null ) { - throw new IllegalArgumentException(); - } - - return c.isPrimitive(); - } - - /** - * Section 1.2.4 - */ - public boolean isValue(Class c) - { - if( c == null ) { - throw new IllegalArgumentException(); - } - - return - (!c.isInterface() && - java.io.Serializable.class.isAssignableFrom(c) && - !java.rmi.Remote.class.isAssignableFrom(c)); - } - - /** - * Section 1.2.5 - */ - public boolean isArray(Class c) - { - boolean arrayType = false; - - if( c == null ) { - throw new IllegalArgumentException(); - } - - if( c.isArray() ) { - Class componentType = c.getComponentType(); - arrayType = - (isPrimitive(componentType) || isRemoteInterface(componentType) || - isEntity(componentType) || isException(componentType) || - isValue(componentType) || isObjectReference(componentType) ); - } - - return arrayType; - } - - /** - * Section 1.2.6 - */ - public boolean isException(Class c) - { - if( c == null ) { - throw new IllegalArgumentException(); - } - - // Must be a checked exception, not including RemoteException or - // its subclasses. - return isCheckedException(c) && !isRemoteException(c) && isValue(c); - } - - public boolean isRemoteException(Class c) - { - if( c == null ) { - throw new IllegalArgumentException(); - } - - return java.rmi.RemoteException.class.isAssignableFrom(c) ; - } - - public boolean isCheckedException(Class c) - { - if( c == null ) { - throw new IllegalArgumentException(); - } - - return Throwable.class.isAssignableFrom(c) && - !RuntimeException.class.isAssignableFrom(c) && - !Error.class.isAssignableFrom(c) ; - } - - /** - * Section 1.2.7 - */ - public boolean isObjectReference(Class c) - { - if( c == null ) { - throw new IllegalArgumentException(); - } - - return (c.isInterface() && - org.omg.CORBA.Object.class.isAssignableFrom(c)); - } - - /** - * Section 1.2.8 - */ - public boolean isEntity(Class c) - { - if( c == null ) { - throw new IllegalArgumentException(); - } - - Class superClass = c.getSuperclass(); - return (!c.isInterface() && - (superClass != null) && - (org.omg.CORBA.portable.IDLEntity.class.isAssignableFrom(c))); - } - - /** - * Return true if given method is legal property accessor as defined in - * Section 1.3.4.3 of Java2IDL spec. - */ - public boolean isPropertyAccessorMethod(Method m, Class c) { - - String methodName = m.getName(); - Class returnType = m.getReturnType(); - Class[] parameters = m.getParameterTypes(); - Class[] exceptionTypes = m.getExceptionTypes(); - String propertyType = null; - - if( methodName.startsWith(GET_PROPERTY_PREFIX) ) { - - if((parameters.length == 0) && (returnType != Void.TYPE) && - !readHasCorrespondingIsProperty(m, c)) { - propertyType = GET_PROPERTY_PREFIX; - } - - } else if( methodName.startsWith(SET_PROPERTY_PREFIX) ) { - - if((returnType == Void.TYPE) && (parameters.length == 1)) { - if (hasCorrespondingReadProperty(m, c, GET_PROPERTY_PREFIX) || - hasCorrespondingReadProperty(m, c, IS_PROPERTY_PREFIX)) { - propertyType = SET_PROPERTY_PREFIX; - } - } - - } else if( methodName.startsWith(IS_PROPERTY_PREFIX) ) { - if((parameters.length == 0) && (returnType == Boolean.TYPE) && - !isHasCorrespondingReadProperty(m, c)) { - propertyType = IS_PROPERTY_PREFIX; - } - } - - // Some final checks that apply to all properties. - if( propertyType != null ) { - if(!validPropertyExceptions(m) || - (methodName.length() <= propertyType.length())) { - propertyType = null; - } - } - - return (propertyType != null); - } - - private boolean hasCorrespondingReadProperty - (Method writeProperty, Class c, String readPropertyPrefix) - { - String writePropertyMethodName = writeProperty.getName(); - Class[] writePropertyParameters = writeProperty.getParameterTypes(); - boolean foundReadProperty = false; - - try { - // Look for a valid corresponding Read property - String readPropertyMethodName = - writePropertyMethodName.replaceFirst - (SET_PROPERTY_PREFIX, readPropertyPrefix); - Method readPropertyMethod = c.getMethod(readPropertyMethodName, - new Class[] {}); - foundReadProperty = - ( isPropertyAccessorMethod(readPropertyMethod, c) && - (readPropertyMethod.getReturnType() == - writePropertyParameters[0]) ); - } catch(Exception e) { - // ignore. this means we didn't find a corresponding get property. - } - - return foundReadProperty; - } - - private boolean readHasCorrespondingIsProperty(Method readProperty, - Class c) - { - if (FOLLOW_RMIC) - return false ; - - String readPropertyMethodName = readProperty.getName(); - boolean foundIsProperty = false; - - try { - // Look for a valid corresponding Is property - String isPropertyMethodName = - readPropertyMethodName.replaceFirst(GET_PROPERTY_PREFIX, - IS_PROPERTY_PREFIX); - Method isPropertyMethod = c.getMethod( isPropertyMethodName, - new Class[] {}); - foundIsProperty = isPropertyAccessorMethod(isPropertyMethod, - c) ; - } catch(Exception e) { - // ignore. this means we didn't find a corresponding Is property. - } - - return foundIsProperty; - } - - private boolean isHasCorrespondingReadProperty(Method readProperty, - Class c) - { - if (!FOLLOW_RMIC) - return false ; - - String readPropertyMethodName = readProperty.getName(); - boolean foundIsProperty = false; - - try { - // Look for a valid corresponding Read property - String isPropertyMethodName = - readPropertyMethodName.replaceFirst(IS_PROPERTY_PREFIX, - GET_PROPERTY_PREFIX); - Method isPropertyMethod = c.getMethod( isPropertyMethodName, - new Class[] {}); - foundIsProperty = isPropertyAccessorMethod(isPropertyMethod, - c) ; - } catch(Exception e) { - // ignore. this means we didn't find a corresponding read property. - } - - return foundIsProperty; - } - - public String getAttributeNameForProperty(String propertyName) { - String attributeName = null; - String prefix = null; - - if( propertyName.startsWith(GET_PROPERTY_PREFIX) ) { - prefix = GET_PROPERTY_PREFIX; - } else if( propertyName.startsWith(SET_PROPERTY_PREFIX) ) { - prefix = SET_PROPERTY_PREFIX; - } else if( propertyName.startsWith(IS_PROPERTY_PREFIX) ) { - prefix = IS_PROPERTY_PREFIX; - } - - if( (prefix != null) && (prefix.length() < propertyName.length()) ) { - String remainder = propertyName.substring(prefix.length()); - if( (remainder.length() >= 2) && - Character.isUpperCase(remainder.charAt(0)) && - Character.isUpperCase(remainder.charAt(1)) ) { - // don't set the first letter to lower-case if the - // first two are upper-case - attributeName = remainder; - } else { - attributeName = Character.toLowerCase(remainder.charAt(0)) + - remainder.substring(1); - } - } - - return attributeName; - } - - /** - * Return IDL Type name for primitive types as defined in - * Section 1.3.3 of Java2IDL spec or null if not a primitive type. - */ - public IDLType getPrimitiveIDLTypeMapping(Class c) { - - if( c == null ) { - throw new IllegalArgumentException(); - } - - if( c.isPrimitive() ) { - if( c == Void.TYPE ) { - return new IDLType( c, "void" ) ; - } else if( c == Boolean.TYPE ) { - return new IDLType( c, "boolean" ) ; - } else if( c == Character.TYPE ) { - return new IDLType( c, "wchar" ) ; - } else if( c == Byte.TYPE ) { - return new IDLType( c, "octet" ) ; - } else if( c == Short.TYPE ) { - return new IDLType( c, "short" ) ; - } else if( c == Integer.TYPE ) { - return new IDLType( c, "long" ) ; - } else if( c == Long.TYPE ) { - return new IDLType( c, "long_long" ) ; - } else if( c == Float.TYPE ) { - return new IDLType( c, "float" ) ; - } else if( c == Double.TYPE ) { - return new IDLType( c, "double" ) ; - } - } - - return null; - } - - /** - * Return IDL Type name for special case type mappings as defined in - * Table 1-1 of Java2IDL spec or null if given class is not a special - * type. - */ - public IDLType getSpecialCaseIDLTypeMapping(Class c) { - - if( c == null ) { - throw new IllegalArgumentException(); - } - - if( c == java.lang.Object.class ) { - return new IDLType( c, new String[] { "java", "lang" }, - "Object" ) ; - } else if( c == java.lang.String.class ) { - return new IDLType( c, new String[] { "CORBA" }, - "WStringValue" ) ; - } else if( c == java.lang.Class.class ) { - return new IDLType( c, new String[] { "javax", "rmi", "CORBA" }, - "ClassDesc" ) ; - } else if( c == java.io.Serializable.class ) { - return new IDLType( c, new String[] { "java", "io" }, - "Serializable" ) ; - } else if( c == java.io.Externalizable.class ) { - return new IDLType( c, new String[] { "java", "io" }, - "Externalizable" ) ; - } else if( c == java.rmi.Remote.class ) { - return new IDLType( c, new String[] { "java", "rmi" }, - "Remote" ) ; - } else if( c == org.omg.CORBA.Object.class ) { - return new IDLType( c, "Object" ) ; - } else { - return null; - } - } - - /** - * Implements 1.2.3 #2 and #4 - */ - private void validateExceptions(Method method) throws IDLTypeException { - - Class[] exceptions = method.getExceptionTypes(); - - boolean declaresRemoteExceptionOrSuperClass = false; - - // Section 1.2.3, #2 - for(int eIndex = 0; eIndex < exceptions.length; eIndex++) { - Class exception = exceptions[eIndex]; - if( isRemoteExceptionOrSuperClass(exception) ) { - declaresRemoteExceptionOrSuperClass = true; - break; - } - } - - if( !declaresRemoteExceptionOrSuperClass ) { - String msg = "Method '" + method + "' must throw at least one " + - "exception of type java.rmi.RemoteException or one of its " + - "super-classes"; - throw new IDLTypeException(msg); - } - - // Section 1.2.3, #4 - // See also bug 4972402 - // For all exceptions E in exceptions, - // (isCheckedException(E) => (isValue(E) || RemoteException.isAssignableFrom( E ) ) - for(int eIndex = 0; eIndex < exceptions.length; eIndex++) { - Class exception = exceptions[eIndex]; - - if (isCheckedException(exception) && !isValue(exception) && - !isRemoteException(exception)) - { - String msg = "Exception '" + exception + "' on method '" + - method + "' is not a allowed RMI/IIOP exception type"; - throw new IDLTypeException(msg); - } - } - - return; - } - - /** - * Returns true if the method's throw clause conforms to the exception - * restrictions for properties as defined in Section 1.3.4.3 of - * Java2IDL spec. This means that for all exceptions E declared on the - * method, E isChecked => RemoteException.isAssignableFrom( E ). - */ - private boolean validPropertyExceptions(Method method) - { - Class[] exceptions = method.getExceptionTypes(); - - for(int eIndex = 0; eIndex < exceptions.length; eIndex++) { - Class exception = exceptions[eIndex]; - - if (isCheckedException(exception) && !isRemoteException(exception)) - return false ; - } - - return true; - } - - /** - * Implements Section 1.2.3, #2. - */ - private boolean isRemoteExceptionOrSuperClass(Class c) { - return - ((c == java.rmi.RemoteException.class) || - (c == java.io.IOException.class) || - (c == java.lang.Exception.class) || - (c == java.lang.Throwable.class)); - } - - /** - * Implements Section 1.2.3, #5. - */ - private void validateDirectInterfaces(Class c) throws IDLTypeException { - - Class[] directInterfaces = c.getInterfaces(); - - if( directInterfaces.length < 2 ) { - return; - } - - Set allMethodNames = new HashSet(); - Set currentMethodNames = new HashSet(); - - for(int i = 0; i < directInterfaces.length; i++) { - Class next = directInterfaces[i]; - Method[] methods = next.getMethods(); - - // Comparison is based on method names only. First collect - // all methods from current interface, eliminating duplicate - // names. - currentMethodNames.clear(); - for(int m = 0; m < methods.length; m++) { - currentMethodNames.add(methods[m].getName()); - } - - // Now check each method against list of all unique method - // names processed so far. - for(Iterator iter=currentMethodNames.iterator(); iter.hasNext();) { - String methodName = (String) iter.next(); - if( allMethodNames.contains(methodName) ) { - String msg = "Class " + c + " inherits method " + - methodName + " from multiple direct interfaces."; - throw new IDLTypeException(msg); - } else { - allMethodNames.add(methodName); - } - } - } - - return; - } - - /** - * Implements 1.2.3 #6 - */ - private void validateConstants(final Class c) - throws IDLTypeException { - - Field[] fields = null; - - try { - fields = (Field[]) - java.security.AccessController.doPrivileged - (new java.security.PrivilegedExceptionAction() { - public java.lang.Object run() throws Exception { - return c.getFields(); - } - }); - } catch(java.security.PrivilegedActionException pae) { - IDLTypeException ite = new IDLTypeException(); - ite.initCause(pae); - throw ite; - } - - for(int i = 0; i < fields.length; i++) { - Field next = fields[i]; - Class fieldType = next.getType(); - if( (fieldType != java.lang.String.class) && - !isPrimitive(fieldType) ) { - String msg = "Constant field '" + next.getName() + - "' in class '" + next.getDeclaringClass().getName() + - "' has invalid type' " + next.getType() + "'. Constants" + - " in RMI/IIOP interfaces can only have primitive" + - " types and java.lang.String types."; - throw new IDLTypeException(msg); - } - } - - - return; - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/InvocationHandlerFactoryImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/InvocationHandlerFactoryImpl.java deleted file mode 100644 index f0e25d3ab34..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/InvocationHandlerFactoryImpl.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.presentation.rmi ; - -import java.lang.reflect.InvocationHandler ; -import java.lang.reflect.Proxy ; -import java.lang.reflect.Method ; - -import org.omg.CORBA.portable.ObjectImpl ; - -import java.io.ObjectStreamException ; -import java.io.Serializable ; - -import com.sun.corba.se.spi.presentation.rmi.IDLNameTranslator ; -import com.sun.corba.se.spi.presentation.rmi.PresentationManager ; -import com.sun.corba.se.spi.presentation.rmi.DynamicStub ; - -import com.sun.corba.se.spi.orbutil.proxy.LinkedInvocationHandler ; -import com.sun.corba.se.spi.orbutil.proxy.InvocationHandlerFactory ; -import com.sun.corba.se.spi.orbutil.proxy.DelegateInvocationHandlerImpl ; -import com.sun.corba.se.spi.orbutil.proxy.CompositeInvocationHandler ; -import com.sun.corba.se.spi.orbutil.proxy.CompositeInvocationHandlerImpl ; -import java.security.AccessController; -import java.security.PrivilegedAction; - -public class InvocationHandlerFactoryImpl implements InvocationHandlerFactory -{ - private final PresentationManager.ClassData classData ; - private final PresentationManager pm ; - private Class[] proxyInterfaces ; - - public InvocationHandlerFactoryImpl( PresentationManager pm, - PresentationManager.ClassData classData ) - { - this.classData = classData ; - this.pm = pm ; - - Class[] remoteInterfaces = - classData.getIDLNameTranslator().getInterfaces() ; - proxyInterfaces = new Class[ remoteInterfaces.length + 1 ] ; - for (int ctr=0; ctr() { - @Override - public Void run() { - handler.addInvocationHandler( DynamicStub.class, - dynamicStubHandler ) ; - handler.addInvocationHandler( org.omg.CORBA.Object.class, - dynamicStubHandler ) ; - handler.addInvocationHandler( Object.class, - dynamicStubHandler ) ; - return null; - } - }); - - - // If the method passed to invoke is not from DynamicStub or its superclasses, - // it must be from an implemented interface, so we just handle - // all of these with the stubMethodHandler. This used to be - // done be adding explicit entries for stubMethodHandler for - // each remote interface, but that does not work correctly - // for abstract interfaces, since the graph analysis ignores - // abstract interfaces in order to compute the type ids - // correctly (see PresentationManagerImpl.NodeImpl.getChildren). - // Rather than produce more graph traversal code to handle this - // problem, we simply use a default. - // This also points to a possible optimization: just use explict - // checks for the three special classes, rather than a general - // table lookup that usually fails. - handler.setDefaultHandler( stubMethodHandler ) ; - - return handler ; - } - - public Class[] getProxyInterfaces() - { - return proxyInterfaces ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/JNDIStateFactoryImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/JNDIStateFactoryImpl.java deleted file mode 100644 index 51816274a60..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/JNDIStateFactoryImpl.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.presentation.rmi ; - -import java.lang.reflect.Field ; - -import java.util.Hashtable; - -import javax.naming.*; -import javax.naming.spi.StateFactory; - -import java.security.AccessController ; -import java.security.PrivilegedAction ; - -import javax.rmi.PortableRemoteObject ; - -import com.sun.corba.se.spi.orb.ORB; - -import java.rmi.Remote; -import java.rmi.server.ExportException; - -// XXX This creates a dependendcy on the implementation -// of the CosNaming service provider. -import com.sun.jndi.cosnaming.CNCtx ; - -import com.sun.corba.se.spi.presentation.rmi.StubAdapter ; - -/** - * StateFactory that turns java.rmi.Remote objects to org.omg.CORBA.Object. - * This version works either with standard RMI-IIOP or Dynamic RMI-IIOP. - * Based on the original com.sun.jndi.cosnaming.RemoteToCorba and - * com.sun.jndi.toolkit.corba.CorbaUtils. - * - * @author Ken Cavanaugh - */ - -public class JNDIStateFactoryImpl implements StateFactory -{ - private static final Field orbField ; - - static { - orbField = (Field) AccessController.doPrivileged( - new PrivilegedAction() { - public Object run() { - Field fld = null ; - try { - Class cls = CNCtx.class ; - fld = cls.getDeclaredField( "_orb" ) ; - fld.setAccessible( true ) ; - } catch (Exception exc) { - // XXX log exception at FINE - } - return fld ; - } - } - ) ; - } - - public JNDIStateFactoryImpl() - { - } - - /** - * Returns the CORBA object for a Remote object. - * If input is not a Remote object, or if Remote object uses JRMP, return null. - * If the RMI-IIOP library is not available, throw ConfigurationException. - * - * @param orig The object to turn into a CORBA object. If not Remote, - * or if is a JRMP stub or impl, return null. - * @param name Ignored - * @param ctx The non-null CNCtx whose ORB to use. - * @param env Ignored - * @return The CORBA object for {@code orig} or null. - * @exception ConfigurationException If the CORBA object cannot be obtained - * due to configuration problems - * @exception NamingException If some other problem prevented a CORBA - * object from being obtained from the Remote object. - */ - public Object getStateToBind(Object orig, Name name, Context ctx, - Hashtable env) throws NamingException - { - if (orig instanceof org.omg.CORBA.Object) - return orig ; - - if (!(orig instanceof Remote)) - // Not for this StateFactory - return null ; - - ORB orb = getORB( ctx ) ; - if (orb == null) - // Wrong kind of context, so just give up and let another StateFactory - // try to satisfy getStateToBind. - return null ; - - Remote stub = null; - - try { - stub = PortableRemoteObject.toStub( (Remote)orig ) ; - } catch (Exception exc) { - // XXX log at FINE level? - // Wrong sort of object: just return null to allow another StateFactory - // to handle this. This can happen easily because this StateFactory - // is specified for the application, not the service context provider. - return null ; - } - - if (StubAdapter.isStub( stub )) { - try { - StubAdapter.connect( stub, orb ) ; - } catch (Exception exc) { - if (!(exc instanceof java.rmi.RemoteException)) { - // XXX log at FINE level? - // Wrong sort of object: just return null to allow another StateFactory - // to handle this call. - return null ; - } - - // ignore RemoteException because stub might have already - // been connected - } - } - - return stub ; - } - - // This is necessary because the _orb field is package private in - // com.sun.jndi.cosnaming.CNCtx. This is not an ideal solution. - // The best solution for our ORB is to change the CosNaming provider - // to use the StubAdapter. But this has problems as well, because - // other vendors may use the CosNaming provider with a different ORB - // entirely. - private ORB getORB( Context ctx ) - { - ORB orb = null ; - - try { - orb = (ORB)orbField.get( ctx ) ; - } catch (Exception exc) { - // XXX log this exception at FINE level - // ignore the exception and return null. - // Note that the exception may be because ctx - // is not a CosNaming context. - } - - return orb ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/PresentationManagerImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/PresentationManagerImpl.java deleted file mode 100644 index 64239363540..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/PresentationManagerImpl.java +++ /dev/null @@ -1,325 +0,0 @@ -/* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.presentation.rmi ; - -import java.util.Map ; -import java.util.HashMap ; -import java.util.Set ; -import java.util.HashSet ; -import java.util.List ; -import java.util.ArrayList ; -import java.util.Iterator ; - -import java.lang.reflect.Method ; - -import java.rmi.Remote ; - -import javax.rmi.CORBA.Tie ; - -import com.sun.corba.se.spi.orbutil.proxy.InvocationHandlerFactory ; - -import com.sun.corba.se.spi.presentation.rmi.IDLNameTranslator ; -import com.sun.corba.se.spi.presentation.rmi.DynamicMethodMarshaller ; -import com.sun.corba.se.spi.presentation.rmi.PresentationManager ; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; - -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -import com.sun.corba.se.impl.presentation.rmi.IDLNameTranslatorImpl ; -import com.sun.corba.se.impl.presentation.rmi.StubFactoryProxyImpl ; - -import com.sun.corba.se.impl.orbutil.graph.Node ; -import com.sun.corba.se.impl.orbutil.graph.Graph ; -import com.sun.corba.se.impl.orbutil.graph.GraphImpl ; - -public final class PresentationManagerImpl implements PresentationManager -{ - private Map classToClassData ; - private Map methodToDMM ; - private PresentationManager.StubFactoryFactory staticStubFactoryFactory ; - private PresentationManager.StubFactoryFactory dynamicStubFactoryFactory ; - private ORBUtilSystemException wrapper = null ; - private boolean useDynamicStubs ; - - public PresentationManagerImpl( boolean useDynamicStubs ) - { - this.useDynamicStubs = useDynamicStubs ; - wrapper = ORBUtilSystemException.get( - CORBALogDomains.RPC_PRESENTATION ) ; - - // XXX these should probably be WeakHashMaps. - classToClassData = new HashMap() ; - methodToDMM = new HashMap() ; - } - -//////////////////////////////////////////////////////////////////////////////// -// PresentationManager interface -//////////////////////////////////////////////////////////////////////////////// - - public synchronized DynamicMethodMarshaller getDynamicMethodMarshaller( - Method method ) - { - if (method == null) - return null ; - - DynamicMethodMarshaller result = - (DynamicMethodMarshaller)methodToDMM.get( method ) ; - if (result == null) { - result = new DynamicMethodMarshallerImpl( method ) ; - methodToDMM.put( method, result ) ; - } - - return result ; - } - - public synchronized ClassData getClassData( Class cls ) - { - ClassData result = (ClassData)classToClassData.get( cls ) ; - if (result == null) { - result = new ClassDataImpl( cls ) ; - classToClassData.put( cls, result ) ; - } - - return result ; - } - - private class ClassDataImpl implements PresentationManager.ClassData - { - private Class cls ; - private IDLNameTranslator nameTranslator ; - private String[] typeIds ; - private PresentationManager.StubFactory sfactory ; - private InvocationHandlerFactory ihfactory ; - private Map dictionary ; - - public ClassDataImpl( Class cls ) - { - this.cls = cls ; - Graph gr = new GraphImpl() ; - NodeImpl root = new NodeImpl( cls ) ; - Set rootSet = getRootSet( cls, root, gr ) ; - - // At this point, rootSet contains those remote interfaces - // that are not related by inheritance, and gr contains - // all reachable remote interfaces. - - Class[] interfaces = getInterfaces( rootSet ) ; - nameTranslator = IDLNameTranslatorImpl.get( interfaces ) ; - typeIds = makeTypeIds( root, gr, rootSet ) ; - ihfactory = new InvocationHandlerFactoryImpl( - PresentationManagerImpl.this, this ) ; - dictionary = new HashMap() ; - } - - public Class getMyClass() - { - return cls ; - } - - public IDLNameTranslator getIDLNameTranslator() - { - return nameTranslator ; - } - - public String[] getTypeIds() - { - return typeIds ; - } - - public InvocationHandlerFactory getInvocationHandlerFactory() - { - return ihfactory ; - } - - public Map getDictionary() - { - return dictionary ; - } - } - - public PresentationManager.StubFactoryFactory getStubFactoryFactory( - boolean isDynamic ) - { - if (isDynamic) - return dynamicStubFactoryFactory ; - else - return staticStubFactoryFactory ; - } - - public void setStubFactoryFactory( boolean isDynamic, - PresentationManager.StubFactoryFactory sff ) - { - if (isDynamic) - dynamicStubFactoryFactory = sff ; - else - staticStubFactoryFactory = sff ; - } - - public Tie getTie() - { - return dynamicStubFactoryFactory.getTie( null ) ; - } - - public boolean useDynamicStubs() - { - return useDynamicStubs ; - } - -//////////////////////////////////////////////////////////////////////////////// -// Graph computations -//////////////////////////////////////////////////////////////////////////////// - - private Set getRootSet( Class target, NodeImpl root, Graph gr ) - { - Set rootSet = null ; - - if (target.isInterface()) { - gr.add( root ) ; - rootSet = gr.getRoots() ; // rootSet just contains root here - } else { - // Use this class and its superclasses (not Object) as initial roots - Class superclass = target ; - Set initialRootSet = new HashSet() ; - while ((superclass != null) && !superclass.equals( Object.class )) { - Node node = new NodeImpl( superclass ) ; - gr.add( node ) ; - initialRootSet.add( node ) ; - superclass = superclass.getSuperclass() ; - } - - // Expand all nodes into the graph - gr.getRoots() ; - - // remove the roots and find roots again - gr.removeAll( initialRootSet ) ; - rootSet = gr.getRoots() ; - } - - return rootSet ; - } - - private Class[] getInterfaces( Set roots ) - { - Class[] classes = new Class[ roots.size() ] ; - Iterator iter = roots.iterator() ; - int ctr = 0 ; - while (iter.hasNext()) { - NodeImpl node = (NodeImpl)iter.next() ; - classes[ctr++] = node.getInterface() ; - } - - return classes ; - } - - private String[] makeTypeIds( NodeImpl root, Graph gr, Set rootSet ) - { - Set nonRootSet = new HashSet( gr ) ; - nonRootSet.removeAll( rootSet ) ; - - // List for the typeids - List result = new ArrayList() ; - - if (rootSet.size() > 1) { - // If the rootSet has more than one element, we must - // put the type id of the implementation class first. - // Root represents the implementation class here. - result.add( root.getTypeId() ) ; - } - - addNodes( result, rootSet ) ; - addNodes( result, nonRootSet ) ; - - return (String[])result.toArray( new String[result.size()] ) ; - } - - private void addNodes( List resultList, Set nodeSet ) - { - Iterator iter = nodeSet.iterator() ; - while (iter.hasNext()) { - NodeImpl node = (NodeImpl)iter.next() ; - String typeId = node.getTypeId() ; - resultList.add( typeId ) ; - } - } - - private static class NodeImpl implements Node - { - private Class interf ; - - public Class getInterface() - { - return interf ; - } - - public NodeImpl( Class interf ) - { - this.interf = interf ; - } - - public String getTypeId() - { - return "RMI:" + interf.getName() + ":0000000000000000" ; - } - - public Set getChildren() - { - Set result = new HashSet() ; - Class[] interfaces = interf.getInterfaces() ; - for (int ctr=0; ctr() { - @Override - public StubFactoryProxyImpl run() { - return new StubFactoryProxyImpl(classData, classLoader); - } - }); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/StubFactoryFactoryStaticImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/StubFactoryFactoryStaticImpl.java deleted file mode 100644 index 476f47b1b5b..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/StubFactoryFactoryStaticImpl.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.presentation.rmi; - -import javax.rmi.CORBA.Util; -import javax.rmi.CORBA.Tie ; - -import org.omg.CORBA.CompletionStatus; - -import com.sun.corba.se.spi.presentation.rmi.PresentationManager; - -import com.sun.corba.se.impl.util.PackagePrefixChecker; -import com.sun.corba.se.impl.util.Utility; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; - -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -public class StubFactoryFactoryStaticImpl extends - StubFactoryFactoryBase -{ - private ORBUtilSystemException wrapper = ORBUtilSystemException.get( - CORBALogDomains.RPC_PRESENTATION ) ; - - public PresentationManager.StubFactory createStubFactory( - String className, boolean isIDLStub, String remoteCodeBase, Class - expectedClass, ClassLoader classLoader) - { - String stubName = null ; - - if (isIDLStub) - stubName = Utility.idlStubName( className ) ; - else - stubName = Utility.stubNameForCompiler( className ) ; - - ClassLoader expectedTypeClassLoader = - (expectedClass == null ? classLoader : - expectedClass.getClassLoader()); - - // The old code was optimized to try to guess which way to load classes - // first. The real stub class name could either be className or - // "org.omg.stub." + className. We will compute this as follows: - // If stubName starts with a "forbidden" package, try the prefixed - // version first, otherwise try the non-prefixed version first. - // In any case, try both forms if necessary. - - String firstStubName = stubName ; - String secondStubName = stubName ; - - if (PackagePrefixChecker.hasOffendingPrefix(stubName)) - firstStubName = PackagePrefixChecker.packagePrefix() + stubName ; - else - secondStubName = PackagePrefixChecker.packagePrefix() + stubName ; - - Class clz = null; - - try { - clz = Util.loadClass( firstStubName, remoteCodeBase, - expectedTypeClassLoader ) ; - } catch (ClassNotFoundException e1) { - // log only at FINE level - wrapper.classNotFound1( CompletionStatus.COMPLETED_MAYBE, - e1, firstStubName ) ; - try { - clz = Util.loadClass( secondStubName, remoteCodeBase, - expectedTypeClassLoader ) ; - } catch (ClassNotFoundException e2) { - throw wrapper.classNotFound2( - CompletionStatus.COMPLETED_MAYBE, e2, secondStubName ) ; - } - } - - // XXX Is this step necessary, or should the Util.loadClass - // algorithm always produce a valid class if the setup is correct? - // Does the OMG standard algorithm need to be changed to include - // this step? - if ((clz == null) || - ((expectedClass != null) && !expectedClass.isAssignableFrom(clz))) { - try { - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - if (cl == null) - cl = ClassLoader.getSystemClassLoader(); - - clz = cl.loadClass(className); - } catch (Exception exc) { - // XXX make this a system exception - IllegalStateException ise = new IllegalStateException( - "Could not load class " + stubName ) ; - ise.initCause( exc ) ; - throw ise ; - } - } - - return new StubFactoryStaticImpl( clz ) ; - } - - public Tie getTie( Class cls ) - { - Class tieClass = null ; - String className = Utility.tieName(cls.getName()); - - // XXX log exceptions at FINE level - try { - try { - //_REVISIT_ The spec does not specify a loadingContext parameter for - //the following call. Would it be useful to pass one? - tieClass = Utility.loadClassForClass(className, Util.getCodebase(cls), - null, cls, cls.getClassLoader()); - return (Tie) tieClass.newInstance(); - } catch (Exception err) { - tieClass = Utility.loadClassForClass( - PackagePrefixChecker.packagePrefix() + className, - Util.getCodebase(cls), null, cls, cls.getClassLoader()); - return (Tie) tieClass.newInstance(); - } - } catch (Exception err) { - return null; - } - - } - - public boolean createsDynamicStubs() - { - return false ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/StubFactoryProxyImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/StubFactoryProxyImpl.java deleted file mode 100644 index 02e7c92bc8e..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/StubFactoryProxyImpl.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.presentation.rmi ; - -import java.lang.reflect.Proxy ; - -import com.sun.corba.se.spi.presentation.rmi.PresentationManager ; -import com.sun.corba.se.spi.presentation.rmi.DynamicStub ; - -import com.sun.corba.se.spi.orbutil.proxy.InvocationHandlerFactory ; -import com.sun.corba.se.spi.orbutil.proxy.LinkedInvocationHandler ; - -public class StubFactoryProxyImpl extends StubFactoryDynamicBase -{ - public StubFactoryProxyImpl( PresentationManager.ClassData classData, - ClassLoader loader ) - { - super( classData, loader ) ; - } - - public org.omg.CORBA.Object makeStub() - { - // Construct the dynamic proxy that implements this stub - // using the composite handler - InvocationHandlerFactory factory = classData.getInvocationHandlerFactory() ; - LinkedInvocationHandler handler = - (LinkedInvocationHandler)factory.getInvocationHandler() ; - Class[] interfaces = factory.getProxyInterfaces() ; - DynamicStub stub = (DynamicStub)Proxy.newProxyInstance( loader, interfaces, - handler ) ; - handler.setProxy( (Proxy)stub ) ; - return stub ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/StubFactoryStaticImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/StubFactoryStaticImpl.java deleted file mode 100644 index e9fbd3ad329..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/StubFactoryStaticImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.presentation.rmi; - -import java.lang.reflect.InvocationHandler ; - -import com.sun.corba.se.spi.presentation.rmi.PresentationManager; - -public class StubFactoryStaticImpl extends StubFactoryBase -{ - private Class stubClass ; - - public StubFactoryStaticImpl(Class cls) - { - super( null ) ; - this.stubClass = cls; - } - - public org.omg.CORBA.Object makeStub() - { - org.omg.CORBA.Object stub = null; - try { - stub = (org.omg.CORBA.Object) stubClass.newInstance(); - } catch (InstantiationException e) { - throw new RuntimeException(e); - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } - return stub ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/StubInvocationHandlerImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/StubInvocationHandlerImpl.java deleted file mode 100644 index 028580ba24a..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/StubInvocationHandlerImpl.java +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.presentation.rmi ; - -import java.security.AccessController; -import java.security.PrivilegedAction; - -import java.lang.reflect.Method ; -import java.lang.reflect.InvocationHandler ; -import java.lang.reflect.Proxy ; -import java.lang.reflect.InvocationTargetException ; - -import java.io.ObjectInputStream ; -import java.io.ObjectOutputStream ; -import java.io.IOException ; - -import java.rmi.Remote ; - -import javax.rmi.CORBA.Util ; - -import org.omg.CORBA.portable.ObjectImpl ; -import org.omg.CORBA.portable.Delegate ; -import org.omg.CORBA.portable.ServantObject ; -import org.omg.CORBA.portable.ApplicationException ; -import org.omg.CORBA.portable.RemarshalException ; - -import org.omg.CORBA.SystemException ; - -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.pept.transport.ContactInfoList ; - -import com.sun.corba.se.spi.transport.CorbaContactInfoList ; - -import com.sun.corba.se.spi.protocol.CorbaClientDelegate ; -import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcher ; - -import com.sun.corba.se.spi.presentation.rmi.IDLNameTranslator ; -import com.sun.corba.se.spi.presentation.rmi.DynamicMethodMarshaller ; -import com.sun.corba.se.spi.presentation.rmi.PresentationManager ; -import com.sun.corba.se.spi.presentation.rmi.StubAdapter ; - -import com.sun.corba.se.spi.orbutil.proxy.InvocationHandlerFactory ; -import com.sun.corba.se.spi.orbutil.proxy.LinkedInvocationHandler ; - -import com.sun.corba.se.impl.corba.CORBAObjectImpl ; - -public final class StubInvocationHandlerImpl implements LinkedInvocationHandler -{ - private transient PresentationManager.ClassData classData ; - private transient PresentationManager pm ; - private transient org.omg.CORBA.Object stub ; - private transient Proxy self ; - - public void setProxy( Proxy self ) - { - this.self = self ; - } - - public Proxy getProxy() - { - return self ; - } - - public StubInvocationHandlerImpl( PresentationManager pm, - PresentationManager.ClassData classData, org.omg.CORBA.Object stub ) - { - SecurityManager s = System.getSecurityManager(); - if (s != null) { - s.checkPermission(new DynamicAccessPermission("access")); - } - this.classData = classData ; - this.pm = pm ; - this.stub = stub ; - } - - private boolean isLocal() - { - boolean result = false ; - Delegate delegate = StubAdapter.getDelegate( stub ) ; - - if (delegate instanceof CorbaClientDelegate) { - CorbaClientDelegate cdel = (CorbaClientDelegate)delegate ; - ContactInfoList cil = cdel.getContactInfoList() ; - if (cil instanceof CorbaContactInfoList) { - CorbaContactInfoList ccil = (CorbaContactInfoList)cil ; - LocalClientRequestDispatcher lcrd = - ccil.getLocalClientRequestDispatcher() ; - result = lcrd.useLocalInvocation( null ) ; - } - } - - return result ; - } - - /** Invoke the given method with the args and return the result. - * This may result in a remote invocation. - * @param proxy The proxy used for this class (null if not using java.lang.reflect.Proxy) - */ - public Object invoke( Object proxy, final Method method, - Object[] args ) throws Throwable - { - String giopMethodName = classData.getIDLNameTranslator(). - getIDLName( method ) ; - DynamicMethodMarshaller dmm = - pm.getDynamicMethodMarshaller( method ) ; - - Delegate delegate = null ; - try { - delegate = StubAdapter.getDelegate( stub ) ; - } catch (SystemException ex) { - throw Util.mapSystemException(ex) ; - } - - if (!isLocal()) { - try { - org.omg.CORBA_2_3.portable.InputStream in = null ; - try { - // create request - org.omg.CORBA_2_3.portable.OutputStream out = - (org.omg.CORBA_2_3.portable.OutputStream) - delegate.request( stub, giopMethodName, true); - - // marshal arguments - dmm.writeArguments( out, args ) ; - - // finish invocation - in = (org.omg.CORBA_2_3.portable.InputStream) - delegate.invoke( stub, out); - - // unmarshal result - return dmm.readResult( in ) ; - } catch (ApplicationException ex) { - throw dmm.readException( ex ) ; - } catch (RemarshalException ex) { - return invoke( proxy, method, args ) ; - } finally { - delegate.releaseReply( stub, in ); - } - } catch (SystemException ex) { - throw Util.mapSystemException(ex) ; - } - } else { - // local branch - ORB orb = (ORB)delegate.orb( stub ) ; - ServantObject so = delegate.servant_preinvoke( stub, giopMethodName, - method.getDeclaringClass() ); - if (so == null) { - return invoke( stub, method, args ) ; - } - try { - Object[] copies = dmm.copyArguments( args, orb ) ; - - if (!method.isAccessible()) { - // Make sure that we can invoke a method from a normally - // inaccessible package, as this reflective class must always - // be able to invoke a non-public method. - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - method.setAccessible( true ) ; - return null ; - } - } ) ; - } - - Object result = method.invoke( so.servant, copies ) ; - - return dmm.copyResult( result, orb ) ; - } catch (InvocationTargetException ex) { - Throwable mex = ex.getCause() ; - // mex should never be null, as null cannot be thrown - Throwable exCopy = (Throwable)Util.copyObject(mex,orb); - if (dmm.isDeclaredException( exCopy )) - throw exCopy ; - else - throw Util.wrapException(exCopy); - } catch (Throwable thr) { - if (thr instanceof ThreadDeath) - throw (ThreadDeath)thr ; - - // This is not a user thrown exception from the - // method call, so don't copy it. This is either - // an error or a reflective invoke exception. - throw Util.wrapException( thr ) ; - } finally { - delegate.servant_postinvoke( stub, so); - } - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/jndi.properties b/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/jndi.properties deleted file mode 100644 index 00cabf72516..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/presentation/rmi/jndi.properties +++ /dev/null @@ -1,3 +0,0 @@ -# Required to add a javax.naming.spi.StateFactory for CosNaming that -# supports dynamic RMI-IIOP. -java.naming.factory.state=com.sun.corba.se.impl.presentation.rmi.JNDIStateFactoryImpl diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/AddressingDispositionException.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/AddressingDispositionException.java deleted file mode 100644 index 111fb7c90d6..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/AddressingDispositionException.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol; - -import com.sun.corba.se.impl.protocol.giopmsgheaders.KeyAddr; - -/** - * This exception is thrown while reading GIOP 1.2 Request, LocateRequest - * to indicate that a TargetAddress disposition is unacceptable. - * If this exception is caught explicitly, this need to be rethrown. This - * is eventually handled within RequestPRocessor and an appropriate reply - * is sent back to the client. - * - * GIOP 1.2 allows three dispositions : KeyAddr (ObjectKey), ProfileAddr (ior - * profile), IORAddressingInfo (IOR). If the ORB does not support the - * disposition contained in the GIOP Request / LocateRequest 1.2 message, - * then it sends a Reply / LocateReply indicating the correct disposition, - * which the client ORB shall use to transparently retry the request - * with the correct disposition. - * - */ -public class AddressingDispositionException extends RuntimeException { - - private short expectedAddrDisp = KeyAddr.value; - - public AddressingDispositionException(short expectedAddrDisp) { - this.expectedAddrDisp = expectedAddrDisp; - } - - public short expectedAddrDisp() { - return this.expectedAddrDisp; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/BootstrapServerRequestDispatcher.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/BootstrapServerRequestDispatcher.java deleted file mode 100644 index 2f417bd3077..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/BootstrapServerRequestDispatcher.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol ; - -import java.util.Iterator ; - -import org.omg.CORBA.SystemException ; - -import com.sun.corba.se.pept.protocol.MessageMediator; - -import com.sun.corba.se.spi.ior.IOR ; -import com.sun.corba.se.spi.ior.ObjectKey ; -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher ; -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; - -import com.sun.corba.se.impl.encoding.MarshalInputStream ; -import com.sun.corba.se.impl.encoding.MarshalOutputStream ; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; - -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -/** - * Class BootstrapServerRequestDispatcher handles the requests coming to the - * BootstrapServer. It implements Server so that it can be registered - * as a subcontract. It is passed a BootstrapServiceProperties object - * which contains - * the supported ids and their values for the bootstrap service. This - * Properties object is only read from, never written to, and is shared - * among all threads. - *

            - * The BootstrapServerRequestDispatcher responds primarily to GIOP requests, - * but LocateRequests are also handled for graceful interoperability. - * The BootstrapServerRequestDispatcher handles one request at a time. - */ -public class BootstrapServerRequestDispatcher - implements CorbaServerRequestDispatcher -{ - private ORB orb; - - ORBUtilSystemException wrapper ; - - private static final boolean debug = false; - - public BootstrapServerRequestDispatcher(ORB orb ) - { - this.orb = orb; - this.wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - } - - /** - * Dispatch is called by the ORB and will serve get(key) and list() - * invocations on the initial object key. - */ - public void dispatch(MessageMediator messageMediator) - { - CorbaMessageMediator request = (CorbaMessageMediator) messageMediator; - CorbaMessageMediator response = null; - - try { - MarshalInputStream is = (MarshalInputStream) - request.getInputObject(); - String method = request.getOperationName(); - response = request.getProtocolHandler().createResponse(request, null); - MarshalOutputStream os = (MarshalOutputStream) - response.getOutputObject(); - - if (method.equals("get")) { - // Get the name of the requested service - String serviceKey = is.read_string(); - - // Look it up - org.omg.CORBA.Object serviceObject = - orb.getLocalResolver().resolve( serviceKey ) ; - - // Write reply value - os.write_Object(serviceObject); - } else if (method.equals("list")) { - java.util.Set keys = orb.getLocalResolver().list() ; - os.write_long( keys.size() ) ; - Iterator iter = keys.iterator() ; - while (iter.hasNext()) { - String obj = (String)iter.next() ; - os.write_string( obj ) ; - } - } else { - throw wrapper.illegalBootstrapOperation( method ) ; - } - - } catch (org.omg.CORBA.SystemException ex) { - // Marshal the exception thrown - response = request.getProtocolHandler().createSystemExceptionResponse( - request, ex, null); - } catch (java.lang.RuntimeException ex) { - // Unknown exception - SystemException sysex = wrapper.bootstrapRuntimeException( ex ) ; - response = request.getProtocolHandler().createSystemExceptionResponse( - request, sysex, null ) ; - } catch (java.lang.Exception ex) { - // Unknown exception - SystemException sysex = wrapper.bootstrapException( ex ) ; - response = request.getProtocolHandler().createSystemExceptionResponse( - request, sysex, null ) ; - } - - return; - } - - /** - * Locates the object mentioned in the locate requests, and returns - * object here iff the object is the initial object key. A SystemException - * thrown if the object key is not the initial object key. - */ - public IOR locate( ObjectKey objectKey) { - return null; - } - - /** - * Not implemented - */ - public int getId() { - throw wrapper.genericNoImpl() ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/CorbaClientDelegateImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/CorbaClientDelegateImpl.java deleted file mode 100644 index c6f9e94d007..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/CorbaClientDelegateImpl.java +++ /dev/null @@ -1,443 +0,0 @@ -/* - * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol; - -import java.util.Iterator; -import java.util.HashMap; - -import javax.rmi.CORBA.Tie; - -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.Context; -import org.omg.CORBA.ContextList; -import org.omg.CORBA.ExceptionList; -import org.omg.CORBA.NamedValue; -import org.omg.CORBA.NVList; -import org.omg.CORBA.Request; -import org.omg.CORBA.TypeCode; - -import org.omg.CORBA.portable.ApplicationException; -import org.omg.CORBA.portable.Delegate; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; -import org.omg.CORBA.portable.RemarshalException; -import org.omg.CORBA.portable.ServantObject; - -import com.sun.corba.se.pept.broker.Broker; -import com.sun.corba.se.pept.encoding.InputObject; -import com.sun.corba.se.pept.encoding.OutputObject; -import com.sun.corba.se.pept.protocol.ClientInvocationInfo; -import com.sun.corba.se.pept.protocol.ClientRequestDispatcher; -import com.sun.corba.se.pept.transport.ContactInfo; -import com.sun.corba.se.pept.transport.ContactInfoList; -import com.sun.corba.se.pept.transport.ContactInfoListIterator; - -import com.sun.corba.se.spi.presentation.rmi.StubAdapter; -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.protocol.CorbaClientDelegate ; -import com.sun.corba.se.spi.transport.CorbaContactInfo; -import com.sun.corba.se.spi.transport.CorbaContactInfoList; -import com.sun.corba.se.spi.transport.CorbaContactInfoListIterator; - -import com.sun.corba.se.impl.corba.RequestImpl; -import com.sun.corba.se.impl.protocol.CorbaInvocationInfo; -import com.sun.corba.se.impl.transport.CorbaContactInfoListImpl; -import com.sun.corba.se.impl.util.JDKBridge; -import com.sun.corba.se.impl.logging.ORBUtilSystemException; - -// implements com.sun.corba.se.impl.core.ClientRequestDispatcher -// so RMI-IIOP Util.isLocal can call ClientRequestDispatcher.useLocalInvocation. - -/** - * @author Harold Carr - */ -public class CorbaClientDelegateImpl extends CorbaClientDelegate -{ - private ORB orb; - private ORBUtilSystemException wrapper ; - - private CorbaContactInfoList contactInfoList; - - public CorbaClientDelegateImpl(ORB orb, - CorbaContactInfoList contactInfoList) - { - this.orb = orb; - this.wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - this.contactInfoList = contactInfoList; - } - - // - // framework.subcontract.Delegate - // - - public Broker getBroker() - { - return orb; - } - - public ContactInfoList getContactInfoList() - { - return contactInfoList; - } - - // - // CORBA_2_3.portable.Delegate - // - - public OutputStream request(org.omg.CORBA.Object self, - String operation, - boolean responseExpected) - { - ClientInvocationInfo invocationInfo = - orb.createOrIncrementInvocationInfo(); - Iterator contactInfoListIterator = - invocationInfo.getContactInfoListIterator(); - if (contactInfoListIterator == null) { - contactInfoListIterator = contactInfoList.iterator(); - invocationInfo.setContactInfoListIterator(contactInfoListIterator); - } - if (! contactInfoListIterator.hasNext()) { - throw ((CorbaContactInfoListIterator)contactInfoListIterator) - .getFailureException(); - } - CorbaContactInfo contactInfo = (CorbaContactInfo) contactInfoListIterator.next(); - ClientRequestDispatcher subcontract = contactInfo.getClientRequestDispatcher(); - // Remember chosen subcontract for invoke and releaseReply. - // NOTE: This is necessary since a stream is not available in - // releaseReply if there is a client marshaling error or an - // error in _invoke. - invocationInfo.setClientRequestDispatcher(subcontract); - return (OutputStream) - subcontract.beginRequest(self, operation, - !responseExpected, contactInfo); - } - - public InputStream invoke(org.omg.CORBA.Object self, OutputStream output) - throws - ApplicationException, - RemarshalException - { - ClientRequestDispatcher subcontract = getClientRequestDispatcher(); - return (InputStream) - subcontract.marshalingComplete((Object)self, (OutputObject)output); - } - - public void releaseReply(org.omg.CORBA.Object self, InputStream input) - { - // NOTE: InputStream may be null (e.g., exception request from PI). - ClientRequestDispatcher subcontract = getClientRequestDispatcher(); - subcontract.endRequest(orb, self, (InputObject)input); - orb.releaseOrDecrementInvocationInfo(); - } - - private ClientRequestDispatcher getClientRequestDispatcher() - { - return (ClientRequestDispatcher) - ((CorbaInvocationInfo)orb.getInvocationInfo()) - .getClientRequestDispatcher(); - } - - public org.omg.CORBA.Object get_interface_def(org.omg.CORBA.Object obj) - { - InputStream is = null; - // instantiate the stub - org.omg.CORBA.Object stub = null ; - - try { - OutputStream os = request(null, "_interface", true); - is = (InputStream) invoke((org.omg.CORBA.Object)null, os); - - org.omg.CORBA.Object objimpl = - (org.omg.CORBA.Object) is.read_Object(); - - // check if returned object is of correct type - if ( !objimpl._is_a("IDL:omg.org/CORBA/InterfaceDef:1.0") ) - throw wrapper.wrongInterfaceDef(CompletionStatus.COMPLETED_MAYBE); - - try { - stub = (org.omg.CORBA.Object) - JDKBridge.loadClass("org.omg.CORBA._InterfaceDefStub"). - newInstance(); - } catch (Exception ex) { - throw wrapper.noInterfaceDefStub( ex ) ; - } - - org.omg.CORBA.portable.Delegate del = - StubAdapter.getDelegate( objimpl ) ; - StubAdapter.setDelegate( stub, del ) ; - } catch (ApplicationException e) { - // This cannot happen. - throw wrapper.applicationExceptionInSpecialMethod( e ) ; - } catch (RemarshalException e) { - return get_interface_def(obj); - } finally { - releaseReply((org.omg.CORBA.Object)null, (InputStream)is); - } - - return stub; - } - - public boolean is_a(org.omg.CORBA.Object obj, String dest) - { - // dest is the typeId of the interface to compare against. - // repositoryIds is the list of typeIds that the stub knows about. - - // First we look for an answer using local information. - - String [] repositoryIds = StubAdapter.getTypeIds( obj ) ; - String myid = contactInfoList.getTargetIOR().getTypeId(); - if ( dest.equals(myid) ) { - return true; - } - for ( int i=0; i maximum ) - return 0; - return h; - } - - public Request request(org.omg.CORBA.Object obj, String operation) - { - return new RequestImpl(orb, obj, null, operation, null, null, null, - null); - } - - public Request create_request(org.omg.CORBA.Object obj, - Context ctx, - String operation, - NVList arg_list, - NamedValue result) - { - return new RequestImpl(orb, obj, ctx, operation, arg_list, - result, null, null); - } - - public Request create_request(org.omg.CORBA.Object obj, - Context ctx, - String operation, - NVList arg_list, - NamedValue result, - ExceptionList exclist, - ContextList ctxlist) - { - return new RequestImpl(orb, obj, ctx, operation, arg_list, result, - exclist, ctxlist); - } - - public org.omg.CORBA.ORB orb(org.omg.CORBA.Object obj) - { - return this.orb; - } - - /** - * Returns true if this object is implemented by a local servant. - * - * REVISIT: locatedIOR should be replaced with a method call that - * returns the current IOR for this request (e.g. ContactInfoChooser). - * - * @param self The object reference which delegated to this delegate. - * @return true only if the servant incarnating this object is located in - * this ORB. - */ - public boolean is_local(org.omg.CORBA.Object self) - { - // XXX this need to check isNextCallValid - return contactInfoList.getEffectiveTargetIOR().getProfile(). - isLocal(); - } - - public ServantObject servant_preinvoke(org.omg.CORBA.Object self, - String operation, - Class expectedType) - { - return - contactInfoList.getLocalClientRequestDispatcher() - .servant_preinvoke(self, operation, expectedType); - } - - public void servant_postinvoke(org.omg.CORBA.Object self, - ServantObject servant) - { - contactInfoList.getLocalClientRequestDispatcher() - .servant_postinvoke(self, servant); - } - - // XXX Should this be public? - /* Returns the codebase for object reference provided. - * @param self the object reference whose codebase needs to be returned. - * @return the codebase as a space delimited list of url strings or - * null if none. - */ - public String get_codebase(org.omg.CORBA.Object self) - { - if (contactInfoList.getTargetIOR() != null) { - return contactInfoList.getTargetIOR().getProfile().getCodebase(); - } - return null; - } - - public String toString(org.omg.CORBA.Object self) - { - return contactInfoList.getTargetIOR().stringify(); - } - - //////////////////////////////////////////////////// - // - // java.lang.Object - // - - public int hashCode() - { - return this.contactInfoList.hashCode(); - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java deleted file mode 100644 index 5c669dda9f9..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java +++ /dev/null @@ -1,1053 +0,0 @@ -/* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.protocol; - -import java.io.IOException; -import java.util.Iterator; -import java.rmi.RemoteException; - -import javax.rmi.CORBA.Util; -import javax.rmi.CORBA.Tie; - -import org.omg.CORBA.COMM_FAILURE; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.SystemException; -import org.omg.CORBA.Request; -import org.omg.CORBA.NamedValue; -import org.omg.CORBA.NVList; -import org.omg.CORBA.Context; -import org.omg.CORBA.ContextList; -import org.omg.CORBA.ExceptionList; -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.portable.RemarshalException; -import org.omg.CORBA_2_3.portable.InputStream; -import org.omg.CORBA_2_3.portable.OutputStream; -import org.omg.CORBA.portable.Delegate; -import org.omg.CORBA.portable.ServantObject; -import org.omg.CORBA.portable.ApplicationException; -import org.omg.CORBA.portable.UnknownException; -import org.omg.IOP.ExceptionDetailMessage; -import org.omg.IOP.TAG_CODE_SETS; - -import com.sun.org.omg.SendingContext.CodeBase; - -import com.sun.corba.se.pept.broker.Broker; -import com.sun.corba.se.pept.encoding.InputObject; -import com.sun.corba.se.pept.encoding.OutputObject; -import com.sun.corba.se.pept.protocol.ClientRequestDispatcher; -import com.sun.corba.se.pept.protocol.MessageMediator; -import com.sun.corba.se.pept.transport.Connection; -import com.sun.corba.se.pept.transport.OutboundConnectionCache; -import com.sun.corba.se.pept.transport.ContactInfo; - -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate; -import com.sun.corba.se.spi.ior.iiop.CodeSetsComponent; -import com.sun.corba.se.spi.oa.OAInvocationInfo; -import com.sun.corba.se.spi.oa.ObjectAdapterFactory; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.orb.ORBVersion; -import com.sun.corba.se.spi.orb.ORBVersionFactory; -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; -import com.sun.corba.se.spi.protocol.RequestDispatcherRegistry; -import com.sun.corba.se.spi.transport.CorbaContactInfo ; -import com.sun.corba.se.spi.transport.CorbaContactInfoList ; -import com.sun.corba.se.spi.transport.CorbaContactInfoListIterator ; -import com.sun.corba.se.spi.transport.CorbaConnection; -import com.sun.corba.se.spi.logging.CORBALogDomains; - -import com.sun.corba.se.spi.servicecontext.MaxStreamFormatVersionServiceContext; -import com.sun.corba.se.spi.servicecontext.ServiceContext; -import com.sun.corba.se.spi.servicecontext.ServiceContexts; -import com.sun.corba.se.spi.servicecontext.UEInfoServiceContext; -import com.sun.corba.se.spi.servicecontext.CodeSetServiceContext; -import com.sun.corba.se.spi.servicecontext.SendingContextServiceContext; -import com.sun.corba.se.spi.servicecontext.ORBVersionServiceContext; -import com.sun.corba.se.spi.servicecontext.MaxStreamFormatVersionServiceContext; -import com.sun.corba.se.spi.servicecontext.UnknownServiceContext; - -import com.sun.corba.se.impl.encoding.CDRInputObject; -import com.sun.corba.se.impl.encoding.CodeSetComponentInfo; -import com.sun.corba.se.impl.encoding.CodeSetConversion; -import com.sun.corba.se.impl.encoding.EncapsInputStream; -import com.sun.corba.se.impl.encoding.MarshalOutputStream; -import com.sun.corba.se.impl.encoding.MarshalInputStream; -import com.sun.corba.se.impl.logging.ORBUtilSystemException; -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage; -import com.sun.corba.se.impl.protocol.giopmsgheaders.KeyAddr; -import com.sun.corba.se.impl.protocol.giopmsgheaders.ProfileAddr; -import com.sun.corba.se.impl.protocol.giopmsgheaders.ReferenceAddr; -import com.sun.corba.se.impl.transport.CorbaContactInfoListIteratorImpl; -import com.sun.corba.se.impl.util.JDKBridge; - -import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.ConcurrentHashMap; -import sun.corba.EncapsInputStreamFactory; - -/** - * ClientDelegate is the RMI client-side subcontract or representation - * It implements RMI delegate as well as our internal ClientRequestDispatcher - * interface. - */ -public class CorbaClientRequestDispatcherImpl - implements - ClientRequestDispatcher -{ - private ConcurrentMap locks = - new ConcurrentHashMap(); - - public OutputObject beginRequest(Object self, String opName, - boolean isOneWay, ContactInfo contactInfo) - { - ORB orb = null; - try { - CorbaContactInfo corbaContactInfo = (CorbaContactInfo) contactInfo; - orb = (ORB)contactInfo.getBroker(); - - if (orb.subcontractDebugFlag) { - dprint(".beginRequest->: op/" + opName); - } - - // - // Portable Interceptor initialization. - // - - orb.getPIHandler().initiateClientPIRequest( false ); - - // - // Connection. - // - - CorbaConnection connection = null; - - // This locking is done so that multiple connections are not created - // for the same endpoint - // 7046238 - Synchronization on a single monitor for contactInfo parameters - // with identical hashCode(), so we lock on same monitor for equal parameters - // (which can refer to equal (in terms of equals()) but not the same objects) - - Object lock = locks.get(contactInfo); - - if (lock == null) { - Object newLock = new Object(); - lock = locks.putIfAbsent(contactInfo, newLock); - if (lock == null) { - lock = newLock; - } - } - - synchronized (lock) { - if (contactInfo.isConnectionBased()) { - if (contactInfo.shouldCacheConnection()) { - connection = (CorbaConnection) - orb.getTransportManager() - .getOutboundConnectionCache(contactInfo).get(contactInfo); - } - if (connection != null) { - if (orb.subcontractDebugFlag) { - dprint(".beginRequest: op/" + opName - + ": Using cached connection: " + connection); - } - } else { - try { - connection = (CorbaConnection) - contactInfo.createConnection(); - if (orb.subcontractDebugFlag) { - dprint(".beginRequest: op/" + opName - + ": Using created connection: " + connection); - } - } catch (RuntimeException e) { - if (orb.subcontractDebugFlag) { - dprint(".beginRequest: op/" + opName - + ": failed to create connection: " + e); - } - // REVISIT: this part similar to marshalingComplete below. - boolean retry = getContactInfoListIterator(orb) - .reportException(contactInfo, e); - // REVISIT: - // this part similar to Remarshal in this method below - if (retry) { - if(getContactInfoListIterator(orb).hasNext()) { - contactInfo = (ContactInfo) - getContactInfoListIterator(orb).next(); - unregisterWaiter(orb); - return beginRequest(self, opName, - isOneWay, contactInfo); - } else { - throw e; - } - } else { - throw e; - } - } - if (connection.shouldRegisterReadEvent()) { - // REVISIT: cast - orb.getTransportManager().getSelector(0) - .registerForEvent(connection.getEventHandler()); - connection.setState("ESTABLISHED"); - } - // Do not do connection reclaim here since the connections - // are marked in use by registerWaiter() call and since this - // call happens later do it after that. - if (contactInfo.shouldCacheConnection()) { - OutboundConnectionCache connectionCache = - orb.getTransportManager() - .getOutboundConnectionCache(contactInfo); - connectionCache.stampTime(connection); - connectionCache.put(contactInfo, connection); - // connectionCache.reclaim(); - } - } - } - } - - CorbaMessageMediator messageMediator = (CorbaMessageMediator) - contactInfo.createMessageMediator( - orb, contactInfo, connection, opName, isOneWay); - if (orb.subcontractDebugFlag) { - dprint(".beginRequest: " + opAndId(messageMediator) - + ": created message mediator: " + messageMediator); - } - - // NOTE: Thread data so we can get the mediator in release reply - // in order to remove the waiter in CorbaConnection. - // We cannot depend on obtaining information in releaseReply - // via its InputStream argument since, on certain errors - // (e.g., client marshaling errors), the stream may be null. - // Likewise for releaseReply "self". - // NOTE: This must be done before initializing the message since - // that may start sending fragments which may end up in "early" - // replies or client marshaling exceptions. - - orb.getInvocationInfo().setMessageMediator(messageMediator); - - if (connection != null && connection.getCodeSetContext() == null) { - performCodeSetNegotiation(messageMediator); - } - - addServiceContexts(messageMediator); - - OutputObject outputObject = - contactInfo.createOutputObject(messageMediator); - if (orb.subcontractDebugFlag) { - dprint(".beginRequest: " + opAndId(messageMediator) - + ": created output object: " + outputObject); - } - - - // NOTE: Not necessary for oneways, but useful for debugging. - // This must be done BEFORE message initialization since fragments - // may be sent at that time. - registerWaiter(messageMediator); - - // Do connection reclaim now - synchronized (lock) { - if (contactInfo.isConnectionBased()) { - if (contactInfo.shouldCacheConnection()) { - OutboundConnectionCache connectionCache = - orb.getTransportManager() - .getOutboundConnectionCache(contactInfo); - connectionCache.reclaim(); - } - } - } - - orb.getPIHandler().setClientPIInfo(messageMediator); - try { - // This MUST come before message is initialized so - // service contexts may be added by PI because - // initial fragments may be sent during message initialization. - orb.getPIHandler().invokeClientPIStartingPoint(); - } catch( RemarshalException e ) { - if (orb.subcontractDebugFlag) { - dprint(".beginRequest: " + opAndId(messageMediator) - + ": Remarshal"); - } - - // NOTE: We get here because an interceptor raised ForwardRequest - // and updated the IOR/Iterator. Since we have a fresh iterator - // hasNext should succeed. - - // REVISIT: We should feed ALL interceptor exceptions to - // iterator.reportException so it can determine if it wants - // to retry. Right now, SystemExceptions will flow to the - // client code. - - // REVISIT: - // This assumes that interceptors update - // ContactInfoList outside of subcontract. - // Want to move that update to here. - if (getContactInfoListIterator(orb).hasNext()) { - contactInfo = (ContactInfo)getContactInfoListIterator(orb).next(); - if (orb.subcontractDebugFlag) { - dprint( "RemarshalException: hasNext true\ncontact info " + contactInfo ); - } - - // Fix for 6763340: Complete the first attempt before starting another. - orb.getPIHandler().makeCompletedClientRequest( - ReplyMessage.LOCATION_FORWARD, null ) ; - unregisterWaiter(orb); - orb.getPIHandler().cleanupClientPIRequest() ; - - return beginRequest(self, opName, isOneWay, contactInfo); - } else { - if (orb.subcontractDebugFlag) { - dprint( "RemarshalException: hasNext false" ); - } - ORBUtilSystemException wrapper = - ORBUtilSystemException.get(orb, - CORBALogDomains.RPC_PROTOCOL); - throw wrapper.remarshalWithNowhereToGo(); - } - } - - messageMediator.initializeMessage(); - if (orb.subcontractDebugFlag) { - dprint(".beginRequest: " + opAndId(messageMediator) - + ": initialized message"); - } - - return outputObject; - - } finally { - if (orb.subcontractDebugFlag) { - dprint(".beginRequest<-: op/" + opName); - } - } - } - - public InputObject marshalingComplete(java.lang.Object self, - OutputObject outputObject) - throws - ApplicationException, - org.omg.CORBA.portable.RemarshalException - { - ORB orb = null; - CorbaMessageMediator messageMediator = null; - try { - messageMediator = (CorbaMessageMediator) - outputObject.getMessageMediator(); - - orb = (ORB) messageMediator.getBroker(); - - if (orb.subcontractDebugFlag) { - dprint(".marshalingComplete->: " + opAndId(messageMediator)); - } - - InputObject inputObject = - marshalingComplete1(orb, messageMediator); - - return processResponse(orb, messageMediator, inputObject); - - } finally { - if (orb.subcontractDebugFlag) { - dprint(".marshalingComplete<-: " + opAndId(messageMediator)); - } - } - } - - public InputObject marshalingComplete1( - ORB orb, CorbaMessageMediator messageMediator) - throws - ApplicationException, - org.omg.CORBA.portable.RemarshalException - { - try { - messageMediator.finishSendingRequest(); - - if (orb.subcontractDebugFlag) { - dprint(".marshalingComplete: " + opAndId(messageMediator) - + ": finished sending request"); - } - - return messageMediator.waitForResponse(); - - } catch (RuntimeException e) { - - if (orb.subcontractDebugFlag) { - dprint(".marshalingComplete: " + opAndId(messageMediator) - + ": exception: " + e.toString()); - } - - boolean retry = - getContactInfoListIterator(orb) - .reportException(messageMediator.getContactInfo(), e); - - //Bug 6382377: must not lose exception in PI - - // Must run interceptor end point before retrying. - Exception newException = - orb.getPIHandler().invokeClientPIEndingPoint( - ReplyMessage.SYSTEM_EXCEPTION, e); - - if (retry) { - if (newException == e) { - continueOrThrowSystemOrRemarshal(messageMediator, - new RemarshalException()); - } else { - continueOrThrowSystemOrRemarshal(messageMediator, - newException); - } - } else { - if (newException instanceof RuntimeException){ - throw (RuntimeException)newException; - } - else if (newException instanceof RemarshalException) - { - throw (RemarshalException)newException; - } - - // NOTE: Interceptor ending point will run in releaseReply. - throw e; - } - return null; // for compiler - } - } - - protected InputObject processResponse(ORB orb, - CorbaMessageMediator messageMediator, - InputObject inputObject) - throws - ApplicationException, - org.omg.CORBA.portable.RemarshalException - { - ORBUtilSystemException wrapper = - ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - - if (orb.subcontractDebugFlag) { - dprint(".processResponse: " + opAndId(messageMediator) - + ": response received"); - } - - // We know for sure now that we've sent a message. - // So OK to not send initial again. - if (messageMediator.getConnection() != null) { - ((CorbaConnection)messageMediator.getConnection()) - .setPostInitialContexts(); - } - - // NOTE: not necessary to set MessageMediator for PI. - // It already has it. - - // Process the response. - - Exception exception = null; - - if (messageMediator.isOneWay()) { - getContactInfoListIterator(orb) - .reportSuccess(messageMediator.getContactInfo()); - // Invoke Portable Interceptors with receive_other - exception = orb.getPIHandler().invokeClientPIEndingPoint( - ReplyMessage.NO_EXCEPTION, exception ); - continueOrThrowSystemOrRemarshal(messageMediator, exception); - return null; - } - - consumeServiceContexts(orb, messageMediator); - - // Now that we have the service contexts processed and the - // correct ORBVersion set, we must finish initializing the stream. - // REVISIT - need interface for this operation. - ((CDRInputObject)inputObject).performORBVersionSpecificInit(); - - if (messageMediator.isSystemExceptionReply()) { - - SystemException se = messageMediator.getSystemExceptionReply(); - - if (orb.subcontractDebugFlag) { - dprint(".processResponse: " + opAndId(messageMediator) - + ": received system exception: " + se); - } - - boolean doRemarshal = - getContactInfoListIterator(orb) - .reportException(messageMediator.getContactInfo(), se); - - if (doRemarshal) { - - // Invoke Portable Interceptors with receive_exception: - exception = orb.getPIHandler().invokeClientPIEndingPoint( - ReplyMessage.SYSTEM_EXCEPTION, se ); - - // If PI did not change the exception, throw a - // Remarshal. - if( se == exception ) { - // exception = null is to maintain symmetry with - // GenericPOAClientSC. - exception = null; - continueOrThrowSystemOrRemarshal(messageMediator, - new RemarshalException()); - throw wrapper.statementNotReachable1() ; - } else { - // Otherwise, throw the exception PI wants thrown. - continueOrThrowSystemOrRemarshal(messageMediator, - exception); - throw wrapper.statementNotReachable2() ; - } - } - - // No retry, so see if was unknown. - - ServiceContexts contexts = - messageMediator.getReplyServiceContexts(); - if (contexts != null) { - UEInfoServiceContext usc = - (UEInfoServiceContext) - contexts.get(UEInfoServiceContext.SERVICE_CONTEXT_ID); - - if (usc != null) { - Throwable unknown = usc.getUE() ; - UnknownException ue = new UnknownException(unknown); - - // Invoke Portable Interceptors with receive_exception: - exception = orb.getPIHandler().invokeClientPIEndingPoint( - ReplyMessage.SYSTEM_EXCEPTION, ue ); - - continueOrThrowSystemOrRemarshal(messageMediator, exception); - throw wrapper.statementNotReachable3() ; - } - } - - // It was not a comm failure nor unknown. - // This is the general case. - - // Invoke Portable Interceptors with receive_exception: - exception = orb.getPIHandler().invokeClientPIEndingPoint( - ReplyMessage.SYSTEM_EXCEPTION, se ); - - continueOrThrowSystemOrRemarshal(messageMediator, exception); - - // Note: We should never need to execute this line, but - // we should assert in case exception is null somehow. - throw wrapper.statementNotReachable4() ; - } else if (messageMediator.isUserExceptionReply()) { - - if (orb.subcontractDebugFlag) { - dprint(".processResponse: " + opAndId(messageMediator) - + ": received user exception"); - } - - getContactInfoListIterator(orb) - .reportSuccess(messageMediator.getContactInfo()); - - String exceptionRepoId = peekUserExceptionId(inputObject); - Exception newException = null; - - if (messageMediator.isDIIRequest()) { - exception = messageMediator.unmarshalDIIUserException( - exceptionRepoId, (InputStream)inputObject); - newException = orb.getPIHandler().invokeClientPIEndingPoint( - ReplyMessage.USER_EXCEPTION, exception ); - messageMediator.setDIIException(newException); - - } else { - ApplicationException appException = - new ApplicationException( - exceptionRepoId, - (org.omg.CORBA.portable.InputStream)inputObject); - exception = appException; - newException = orb.getPIHandler().invokeClientPIEndingPoint( - ReplyMessage.USER_EXCEPTION, appException ); - } - - if (newException != exception) { - continueOrThrowSystemOrRemarshal(messageMediator,newException); - } - - if (newException instanceof ApplicationException) { - throw (ApplicationException)newException; - } - // For DII: - // This return will be ignored - already unmarshaled above. - return inputObject; - - } else if (messageMediator.isLocationForwardReply()) { - - if (orb.subcontractDebugFlag) { - dprint(".processResponse: " + opAndId(messageMediator) - + ": received location forward"); - } - - // NOTE: Expects iterator to update target IOR - getContactInfoListIterator(orb).reportRedirect( - (CorbaContactInfo)messageMediator.getContactInfo(), - messageMediator.getForwardedIOR()); - - // Invoke Portable Interceptors with receive_other: - Exception newException = orb.getPIHandler().invokeClientPIEndingPoint( - ReplyMessage.LOCATION_FORWARD, null ); - - if( !(newException instanceof RemarshalException) ) { - exception = newException; - } - - // If PI did not change exception, throw Remarshal, else - // throw the exception PI wants thrown. - // KMC: GenericPOAClientSC did not check exception != null - if( exception != null ) { - continueOrThrowSystemOrRemarshal(messageMediator, exception); - } - continueOrThrowSystemOrRemarshal(messageMediator, - new RemarshalException()); - throw wrapper.statementNotReachable5() ; - - } else if (messageMediator.isDifferentAddrDispositionRequestedReply()){ - - if (orb.subcontractDebugFlag) { - dprint(".processResponse: " + opAndId(messageMediator) - + ": received different addressing dispostion request"); - } - - // Set the desired target addressing disposition. - getContactInfoListIterator(orb).reportAddrDispositionRetry( - (CorbaContactInfo)messageMediator.getContactInfo(), - messageMediator.getAddrDispositionReply()); - - // Invoke Portable Interceptors with receive_other: - Exception newException = orb.getPIHandler().invokeClientPIEndingPoint( - ReplyMessage.NEEDS_ADDRESSING_MODE, null); - - // For consistency with corresponding code in GenericPOAClientSC: - if( !(newException instanceof RemarshalException) ) { - exception = newException; - } - - // If PI did not change exception, throw Remarshal, else - // throw the exception PI wants thrown. - // KMC: GenericPOAClientSC did not include exception != null check - if( exception != null ) { - continueOrThrowSystemOrRemarshal(messageMediator, exception); - } - continueOrThrowSystemOrRemarshal(messageMediator, - new RemarshalException()); - throw wrapper.statementNotReachable6() ; - } else /* normal response */ { - - if (orb.subcontractDebugFlag) { - dprint(".processResponse: " + opAndId(messageMediator) - + ": received normal response"); - } - - getContactInfoListIterator(orb) - .reportSuccess(messageMediator.getContactInfo()); - - messageMediator.handleDIIReply((InputStream)inputObject); - - // Invoke Portable Interceptors with receive_reply: - exception = orb.getPIHandler().invokeClientPIEndingPoint( - ReplyMessage.NO_EXCEPTION, null ); - - // Remember: not thrown if exception is null. - continueOrThrowSystemOrRemarshal(messageMediator, exception); - - return inputObject; - } - } - - // Filters the given exception into a SystemException or a - // RemarshalException and throws it. Assumes the given exception is - // of one of these two types. This is a utility method for - // the above invoke code which must do this numerous times. - // If the exception is null, no exception is thrown. - // - // Note that this code is duplicated in GenericPOAClientSC.java - protected void continueOrThrowSystemOrRemarshal( - CorbaMessageMediator messageMediator, Exception exception) - throws - SystemException, RemarshalException - { - - ORB orb = (ORB) messageMediator.getBroker(); - - if( exception == null ) { - - // do nothing. - - } else if( exception instanceof RemarshalException ) { - - // REVISIT - unify with PI handling - orb.getInvocationInfo().setIsRetryInvocation(true); - - // NOTE - We must unregister the waiter NOW for this request - // since the retry will result in a new request id. Therefore - // the old request id would be lost and we would have a memory - // leak in the responseWaitingRoom. - unregisterWaiter(orb); - - if (orb.subcontractDebugFlag) { - dprint(".continueOrThrowSystemOrRemarshal: " - + opAndId(messageMediator) - + ": throwing Remarshal"); - } - - throw (RemarshalException)exception; - - } else { - - if (orb.subcontractDebugFlag) { - dprint(".continueOrThrowSystemOrRemarshal: " - + opAndId(messageMediator) - + ": throwing sex:" - + exception); - } - - throw (SystemException)exception; - } - } - - protected CorbaContactInfoListIterator getContactInfoListIterator(ORB orb) - { - return (CorbaContactInfoListIterator) - ((CorbaInvocationInfo)orb.getInvocationInfo()) - .getContactInfoListIterator(); - } - - protected void registerWaiter(CorbaMessageMediator messageMediator) - { - if (messageMediator.getConnection() != null) { - messageMediator.getConnection().registerWaiter(messageMediator); - } - } - - protected void unregisterWaiter(ORB orb) - { - MessageMediator messageMediator = - orb.getInvocationInfo().getMessageMediator(); - if (messageMediator!=null && messageMediator.getConnection() != null) { - // REVISIT: - // The messageMediator may be null if COMM_FAILURE before - // it is created. - messageMediator.getConnection().unregisterWaiter(messageMediator); - } - } - - protected void addServiceContexts(CorbaMessageMediator messageMediator) - { - ORB orb = (ORB)messageMediator.getBroker(); - CorbaConnection c = (CorbaConnection) messageMediator.getConnection(); - GIOPVersion giopVersion = messageMediator.getGIOPVersion(); - - ServiceContexts contexts = messageMediator.getRequestServiceContexts(); - - addCodeSetServiceContext(c, contexts, giopVersion); - - // Add the RMI-IIOP max stream format version - // service context to every request. Once we have GIOP 1.3, - // we could skip it since we now support version 2, but - // probably safer to always send it. - contexts.put(MaxStreamFormatVersionServiceContext.singleton); - - // ORBVersion servicecontext needs to be sent - ORBVersionServiceContext ovsc = new ORBVersionServiceContext( - ORBVersionFactory.getORBVersion() ) ; - contexts.put( ovsc ) ; - - // NOTE : We only want to send the runtime context the first time - if ((c != null) && !c.isPostInitialContexts()) { - // Do not do c.setPostInitialContexts() here. - // If a client interceptor send_request does a ForwardRequest - // which ends up using the same connection then the service - // context would not be sent. - SendingContextServiceContext scsc = - new SendingContextServiceContext( orb.getFVDCodeBaseIOR() ) ; //d11638 - contexts.put( scsc ) ; - } - } - - protected void consumeServiceContexts(ORB orb, - CorbaMessageMediator messageMediator) - { - ServiceContexts ctxts = messageMediator.getReplyServiceContexts(); - ServiceContext sc ; - ORBUtilSystemException wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - - if (ctxts == null) { - return; // no service context available, return gracefully. - } - - sc = ctxts.get( SendingContextServiceContext.SERVICE_CONTEXT_ID ) ; - - if (sc != null) { - SendingContextServiceContext scsc = - (SendingContextServiceContext)sc ; - IOR ior = scsc.getIOR() ; - - try { - // set the codebase returned by the server - if (messageMediator.getConnection() != null) { - ((CorbaConnection)messageMediator.getConnection()).setCodeBaseIOR(ior); - } - } catch (ThreadDeath td) { - throw td ; - } catch (Throwable t) { - throw wrapper.badStringifiedIor( t ) ; - } - } - - // see if the version subcontract is present, if yes, then set - // the ORBversion - sc = ctxts.get( ORBVersionServiceContext.SERVICE_CONTEXT_ID ) ; - - if (sc != null) { - ORBVersionServiceContext ovsc = - (ORBVersionServiceContext) sc; - - ORBVersion version = ovsc.getVersion(); - orb.setORBVersion( version ) ; - } - - getExceptionDetailMessage(messageMediator, wrapper); - } - - protected void getExceptionDetailMessage( - CorbaMessageMediator messageMediator, - ORBUtilSystemException wrapper) - { - ServiceContext sc = messageMediator.getReplyServiceContexts() - .get(ExceptionDetailMessage.value); - if (sc == null) - return ; - - if (! (sc instanceof UnknownServiceContext)) { - throw wrapper.badExceptionDetailMessageServiceContextType(); - } - byte[] data = ((UnknownServiceContext)sc).getData(); - EncapsInputStream in = - EncapsInputStreamFactory.newEncapsInputStream((ORB)messageMediator.getBroker(), - data, data.length); - in.consumeEndian(); - - String msg = - "----------BEGIN server-side stack trace----------\n" - + in.read_wstring() + "\n" - + "----------END server-side stack trace----------"; - - messageMediator.setReplyExceptionDetailMessage(msg); - } - - public void endRequest(Broker broker, Object self, InputObject inputObject) - { - ORB orb = (ORB)broker ; - - try { - if (orb.subcontractDebugFlag) { - dprint(".endRequest->"); - } - - // Note: the inputObject may be null if an error occurs - // in request or before _invoke returns. - // Note: self may be null also (e.g., compiler generates null in stub). - - MessageMediator messageMediator = - orb.getInvocationInfo().getMessageMediator(); - if (messageMediator != null) - { - if (messageMediator.getConnection() != null) - { - ((CorbaMessageMediator)messageMediator) - .sendCancelRequestIfFinalFragmentNotSent(); - } - - // Release any outstanding NIO ByteBuffers to the ByteBufferPool - - InputObject inputObj = messageMediator.getInputObject(); - if (inputObj != null) { - inputObj.close(); - } - - OutputObject outputObj = messageMediator.getOutputObject(); - if (outputObj != null) { - outputObj.close(); - } - - } - - // XREVISIT NOTE - Assumes unregistering the waiter for - // location forwards has already happened somewhere else. - // The code below is only going to unregister the final successful - // request. - - // NOTE: In the case of a recursive stack of endRequests in a - // finally block (because of Remarshal) only the first call to - // unregisterWaiter will remove the waiter. The rest will be - // noops. - unregisterWaiter(orb); - - // Invoke Portable Interceptors cleanup. This is done to handle - // exceptions during stream marshaling. More generally, exceptions - // that occur in the ORB after send_request (which includes - // after returning from _request) before _invoke: - orb.getPIHandler().cleanupClientPIRequest(); - - // REVISIT: Early replies? - } catch (IOException ex) { - // See CDRInput/OutputObject.close() for more info. - // This won't result in a Corba error if an IOException happens. - if (orb.subcontractDebugFlag) - { - dprint(".endRequest: ignoring IOException - " + ex.toString()); - } - } finally { - if (orb.subcontractDebugFlag) { - dprint(".endRequest<-"); - } - } - } - - - protected void performCodeSetNegotiation(CorbaMessageMediator messageMediator) - { - CorbaConnection conn = - (CorbaConnection) messageMediator.getConnection(); - IOR ior = - ((CorbaContactInfo)messageMediator.getContactInfo()) - .getEffectiveTargetIOR(); - GIOPVersion giopVersion = messageMediator.getGIOPVersion(); - - // XXX This seems to be a broken double checked locking idiom: FIX IT! - - // conn.getCodeSetContext() is null when no other requests have - // been made on this connection to trigger code set negotation. - if (conn != null && - conn.getCodeSetContext() == null && - !giopVersion.equals(GIOPVersion.V1_0)) { - - synchronized(conn) { - // Double checking. Don't let any other - // threads use this connection until the - // code sets are straight. - if (conn.getCodeSetContext() != null) - return; - - // This only looks at the first code set component. If - // there can be multiple locations with multiple code sets, - // this requires more work. - IIOPProfileTemplate temp = - (IIOPProfileTemplate)ior.getProfile(). - getTaggedProfileTemplate(); - Iterator iter = temp.iteratorById(TAG_CODE_SETS.value); - if (!iter.hasNext()) { - // Didn't have a code set component. The default will - // be to use ISO8859-1 for char data and throw an - // exception if wchar data is used. - return; - } - - // Get the native and conversion code sets the - // server specified in its IOR - CodeSetComponentInfo serverCodeSets - = ((CodeSetsComponent)iter.next()).getCodeSetComponentInfo(); - - // Perform the negotiation between this ORB's code sets and - // the ones from the IOR - CodeSetComponentInfo.CodeSetContext result - = CodeSetConversion.impl().negotiate( - conn.getBroker().getORBData().getCodeSetComponentInfo(), - serverCodeSets); - - conn.setCodeSetContext(result); - } - } - } - - protected void addCodeSetServiceContext(CorbaConnection conn, - ServiceContexts ctxs, - GIOPVersion giopVersion) { - - // REVISIT. OMG issue 3318 concerning sending the code set - // service context more than once was deemed too much for the - // RTF. Here's our strategy for the moment: - // - // Send it on every request (necessary in cases of fragmentation - // with multithreaded clients or when the first thing on a - // connection is a LocateRequest). Provide an ORB property - // to disable multiple sends. - // - // Note that the connection is null in the local case and no - // service context is included. We use the ORB provided - // encapsulation streams. - // - // Also, there will be no negotiation or service context - // in GIOP 1.0. ISO8859-1 is used for char/string, and - // wchar/wstring are illegal. - // - if (giopVersion.equals(GIOPVersion.V1_0) || conn == null) - return; - - CodeSetComponentInfo.CodeSetContext codeSetCtx = null; - - if (conn.getBroker().getORBData().alwaysSendCodeSetServiceContext() || - !conn.isPostInitialContexts()) { - - // Get the negotiated code sets (if any) out of the connection - codeSetCtx = conn.getCodeSetContext(); - } - - // Either we shouldn't send the code set service context, or - // for some reason, the connection doesn't have its code sets. - // Perhaps the server didn't include them in the IOR. Uses - // ISO8859-1 for char and makes wchar/wstring illegal. - if (codeSetCtx == null) - return; - - CodeSetServiceContext cssc = new CodeSetServiceContext(codeSetCtx); - ctxs.put(cssc); - } - - protected String peekUserExceptionId(InputObject inputObject) - { - CDRInputObject cdrInputObject = (CDRInputObject) inputObject; - // REVISIT - need interface for mark/reset - cdrInputObject.mark(Integer.MAX_VALUE); - String result = cdrInputObject.read_string(); - cdrInputObject.reset(); - return result; - } - - protected void dprint(String msg) - { - ORBUtility.dprint("CorbaClientRequestDispatcherImpl", msg); - } - - protected String opAndId(CorbaMessageMediator mediator) - { - return ORBUtility.operationNameAndRequestId(mediator); - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/CorbaInvocationInfo.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/CorbaInvocationInfo.java deleted file mode 100644 index 73047066e0a..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/CorbaInvocationInfo.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol; - -import java.util.Iterator; - -import com.sun.corba.se.spi.orb.ORB; - -import com.sun.corba.se.pept.protocol.ClientInvocationInfo; -import com.sun.corba.se.pept.protocol.MessageMediator; - -import com.sun.corba.se.pept.protocol.ClientRequestDispatcher; - -/** - * @author Harold Carr - */ -public class CorbaInvocationInfo implements ClientInvocationInfo -{ - // REVISIT - these needs to be an interface-based impl. - - private boolean isRetryInvocation; - private int entryCount; - private ORB orb; - private Iterator contactInfoListIterator; - private ClientRequestDispatcher clientRequestDispatcher; - private MessageMediator messageMediator; - - private CorbaInvocationInfo() - { - } - - public CorbaInvocationInfo(ORB orb) - { - this.orb = orb; - isRetryInvocation = false; - entryCount = 0; - } - - public Iterator getContactInfoListIterator() - { - return contactInfoListIterator; - } - - public void setContactInfoListIterator(Iterator contactInfoListIterator) - { - this.contactInfoListIterator = contactInfoListIterator; - } - - public boolean isRetryInvocation() - { - return isRetryInvocation; - } - - public void setIsRetryInvocation(boolean isRetryInvocation) - { - this.isRetryInvocation = isRetryInvocation; - } - - public int getEntryCount() - { - return entryCount; - } - - public void incrementEntryCount() - { - entryCount++; - } - - public void decrementEntryCount() - { - entryCount--; - } - - public void setClientRequestDispatcher(ClientRequestDispatcher clientRequestDispatcher) - { - this.clientRequestDispatcher = clientRequestDispatcher; - } - - public ClientRequestDispatcher getClientRequestDispatcher() - { - return clientRequestDispatcher; - } - - public void setMessageMediator(MessageMediator messageMediator) - { - this.messageMediator = messageMediator; - } - - public MessageMediator getMessageMediator() - { - return messageMediator; - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/CorbaMessageMediatorImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/CorbaMessageMediatorImpl.java deleted file mode 100644 index 9badc182efd..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/CorbaMessageMediatorImpl.java +++ /dev/null @@ -1,2370 +0,0 @@ -/* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.PrintWriter; -import java.nio.ByteBuffer; -import java.nio.channels.SelectionKey; -import java.util.EmptyStackException; -import java.util.Iterator; - -import org.omg.CORBA.Any; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.ExceptionList; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.Principal; -import org.omg.CORBA.SystemException; -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.UnknownUserException; -import org.omg.CORBA.UNKNOWN; -import org.omg.CORBA.portable.ResponseHandler; -import org.omg.CORBA.portable.UnknownException; -import org.omg.CORBA_2_3.portable.InputStream; -import org.omg.CORBA_2_3.portable.OutputStream; -import org.omg.IOP.ExceptionDetailMessage; -import org.omg.IOP.TAG_RMI_CUSTOM_MAX_STREAM_FORMAT; - -import com.sun.corba.se.pept.broker.Broker; -import com.sun.corba.se.pept.encoding.InputObject; -import com.sun.corba.se.pept.encoding.OutputObject; -import com.sun.corba.se.pept.protocol.MessageMediator; -import com.sun.corba.se.pept.protocol.ProtocolHandler; -import com.sun.corba.se.pept.transport.ByteBufferPool; -import com.sun.corba.se.pept.transport.Connection; -import com.sun.corba.se.pept.transport.ContactInfo; -import com.sun.corba.se.pept.transport.EventHandler; - -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.ObjectKey; -import com.sun.corba.se.spi.ior.ObjectKeyTemplate; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate; -import com.sun.corba.se.spi.ior.iiop.IIOPProfile; -import com.sun.corba.se.spi.ior.iiop.MaxStreamFormatVersionComponent; -import com.sun.corba.se.spi.oa.OAInvocationInfo; -import com.sun.corba.se.spi.oa.ObjectAdapter; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.orb.ORBVersionFactory; -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; -import com.sun.corba.se.spi.protocol.CorbaProtocolHandler; -import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher; -import com.sun.corba.se.spi.protocol.ForwardException; -import com.sun.corba.se.spi.transport.CorbaConnection; -import com.sun.corba.se.spi.transport.CorbaContactInfo; -import com.sun.corba.se.spi.transport.CorbaResponseWaitingRoom; -import com.sun.corba.se.spi.logging.CORBALogDomains; - -import com.sun.corba.se.spi.servicecontext.ORBVersionServiceContext; -import com.sun.corba.se.spi.servicecontext.ServiceContexts; -import com.sun.corba.se.spi.servicecontext.UEInfoServiceContext; -import com.sun.corba.se.spi.servicecontext.MaxStreamFormatVersionServiceContext; -import com.sun.corba.se.spi.servicecontext.SendingContextServiceContext; -import com.sun.corba.se.spi.servicecontext.UnknownServiceContext; - -import com.sun.corba.se.impl.corba.RequestImpl; -import com.sun.corba.se.impl.encoding.BufferManagerFactory; -import com.sun.corba.se.impl.encoding.BufferManagerReadStream; -import com.sun.corba.se.impl.encoding.CDRInputObject; -import com.sun.corba.se.impl.encoding.CDROutputObject; -import com.sun.corba.se.impl.encoding.EncapsOutputStream; -import com.sun.corba.se.impl.logging.ORBUtilSystemException; -import com.sun.corba.se.impl.logging.InterceptorsSystemException; -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.ior.iiop.JavaSerializationComponent; -import com.sun.corba.se.impl.protocol.AddressingDispositionException; -import com.sun.corba.se.impl.protocol.RequestCanceledException; -import com.sun.corba.se.impl.protocol.giopmsgheaders.AddressingDispositionHelper; -import com.sun.corba.se.impl.protocol.giopmsgheaders.CancelRequestMessage; -import com.sun.corba.se.impl.protocol.giopmsgheaders.FragmentMessage_1_1; -import com.sun.corba.se.impl.protocol.giopmsgheaders.FragmentMessage_1_2; -import com.sun.corba.se.impl.protocol.giopmsgheaders.LocateRequestMessage; -import com.sun.corba.se.impl.protocol.giopmsgheaders.LocateRequestMessage_1_0; -import com.sun.corba.se.impl.protocol.giopmsgheaders.LocateRequestMessage_1_1; -import com.sun.corba.se.impl.protocol.giopmsgheaders.LocateRequestMessage_1_2; -import com.sun.corba.se.impl.protocol.giopmsgheaders.LocateReplyOrReplyMessage; -import com.sun.corba.se.impl.protocol.giopmsgheaders.LocateReplyMessage; -import com.sun.corba.se.impl.protocol.giopmsgheaders.LocateReplyMessage_1_0; -import com.sun.corba.se.impl.protocol.giopmsgheaders.LocateReplyMessage_1_1; -import com.sun.corba.se.impl.protocol.giopmsgheaders.LocateReplyMessage_1_2; -import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; -import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase; -import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageHandler; -import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage; -import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage_1_0; -import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage_1_1; -import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage_1_2; -import com.sun.corba.se.impl.protocol.giopmsgheaders.RequestMessage; -import com.sun.corba.se.impl.protocol.giopmsgheaders.RequestMessage_1_0 ; -import com.sun.corba.se.impl.protocol.giopmsgheaders.RequestMessage_1_1 ; -import com.sun.corba.se.impl.protocol.giopmsgheaders.RequestMessage_1_2 ; - -// REVISIT: make sure no memory leaks in client/server request/reply maps. -// REVISIT: normalize requestHeader, replyHeader, messageHeader. - -/** - * @author Harold Carr - */ -public class CorbaMessageMediatorImpl - implements - CorbaMessageMediator, - CorbaProtocolHandler, - MessageHandler -{ - protected ORB orb; - protected ORBUtilSystemException wrapper ; - protected InterceptorsSystemException interceptorWrapper ; - protected CorbaContactInfo contactInfo; - protected CorbaConnection connection; - protected short addrDisposition; - protected CDROutputObject outputObject; - protected CDRInputObject inputObject; - protected Message messageHeader; - protected RequestMessage requestHeader; - protected LocateReplyOrReplyMessage replyHeader; - protected String replyExceptionDetailMessage; - protected IOR replyIOR; - protected Integer requestIdInteger; - protected Message dispatchHeader; - protected ByteBuffer dispatchByteBuffer; - protected byte streamFormatVersion; - protected boolean streamFormatVersionSet = false; - - protected org.omg.CORBA.Request diiRequest; - - protected boolean cancelRequestAlreadySent = false; - - protected ProtocolHandler protocolHandler; - protected boolean _executeReturnServantInResponseConstructor = false; - protected boolean _executeRemoveThreadInfoInResponseConstructor = false; - protected boolean _executePIInResponseConstructor = false; - - // - // Client-side constructor. - // - - public CorbaMessageMediatorImpl(ORB orb, - ContactInfo contactInfo, - Connection connection, - GIOPVersion giopVersion, - IOR ior, - int requestId, - short addrDisposition, - String operationName, - boolean isOneWay) - { - this( orb, connection ) ; - - this.contactInfo = (CorbaContactInfo) contactInfo; - this.addrDisposition = addrDisposition; - - streamFormatVersion = - getStreamFormatVersionForThisRequest( - ((CorbaContactInfo)this.contactInfo).getEffectiveTargetIOR(), - giopVersion); - streamFormatVersionSet = true; - - requestHeader = (RequestMessage) MessageBase.createRequest( - this.orb, - giopVersion, - ORBUtility.getEncodingVersion(orb, ior), - requestId, - !isOneWay, - ((CorbaContactInfo)this.contactInfo).getEffectiveTargetIOR(), - this.addrDisposition, - operationName, - new ServiceContexts(orb), - null); - } - - // - // Acceptor constructor. - // - - public CorbaMessageMediatorImpl(ORB orb, - Connection connection) - { - this.orb = orb; - this.connection = (CorbaConnection)connection; - this.wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - this.interceptorWrapper = InterceptorsSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - } - - // - // Dispatcher constructor. - // - - // Note: in some cases (e.g., a reply message) this message - // mediator will only be used for dispatch. Then the original - // request side mediator will take over. - public CorbaMessageMediatorImpl(ORB orb, - CorbaConnection connection, - Message dispatchHeader, - ByteBuffer byteBuffer) - { - this( orb, connection ) ; - this.dispatchHeader = dispatchHeader; - this.dispatchByteBuffer = byteBuffer; - } - - //////////////////////////////////////////////////// - // - // MessageMediator - // - - public Broker getBroker() - { - return orb; - } - - public ContactInfo getContactInfo() - { - return contactInfo; - } - - public Connection getConnection() - { - return connection; - } - - public void initializeMessage() - { - getRequestHeader().write(outputObject); - } - - public void finishSendingRequest() - { - // REVISIT: probably move logic in outputObject to here. - outputObject.finishSendingMessage(); - } - - public InputObject waitForResponse() - { - if (getRequestHeader().isResponseExpected()) { - return connection.waitForResponse(this); - } - return null; - } - - public void setOutputObject(OutputObject outputObject) - { - this.outputObject = (CDROutputObject) outputObject; - } - - public OutputObject getOutputObject() - { - return outputObject; - } - - public void setInputObject(InputObject inputObject) - { - this.inputObject = (CDRInputObject) inputObject; - } - - public InputObject getInputObject() - { - return inputObject; - } - - //////////////////////////////////////////////////// - // - // CorbaMessageMediator - // - - public void setReplyHeader(LocateReplyOrReplyMessage header) - { - this.replyHeader = header; - this.replyIOR = header.getIOR(); // REVISIT - need separate field? - } - - public LocateReplyMessage getLocateReplyHeader() - { - return (LocateReplyMessage) replyHeader; - } - - public ReplyMessage getReplyHeader() - { - return (ReplyMessage) replyHeader; - } - - public void setReplyExceptionDetailMessage(String message) - { - replyExceptionDetailMessage = message; - } - - public RequestMessage getRequestHeader() - { - return requestHeader; - } - - public GIOPVersion getGIOPVersion() - { - if (messageHeader != null) { - return messageHeader.getGIOPVersion(); - } - return getRequestHeader().getGIOPVersion(); - } - - public byte getEncodingVersion() { - if (messageHeader != null) { - return messageHeader.getEncodingVersion(); - } - return getRequestHeader().getEncodingVersion(); - } - - public int getRequestId() - { - return getRequestHeader().getRequestId(); - } - - public Integer getRequestIdInteger() - { - if (requestIdInteger == null) { - requestIdInteger = new Integer(getRequestHeader().getRequestId()); - } - return requestIdInteger; - } - - public boolean isOneWay() - { - return ! getRequestHeader().isResponseExpected(); - } - - public short getAddrDisposition() - { - return addrDisposition; - } - - public String getOperationName() - { - return getRequestHeader().getOperation(); - } - - public ServiceContexts getRequestServiceContexts() - { - return getRequestHeader().getServiceContexts(); - } - - public ServiceContexts getReplyServiceContexts() - { - return getReplyHeader().getServiceContexts(); - } - - public void sendCancelRequestIfFinalFragmentNotSent() - { - if ((!sentFullMessage()) && sentFragment() && - (!cancelRequestAlreadySent)) - { - try { - if (orb.subcontractDebugFlag) { - dprint(".sendCancelRequestIfFinalFragmentNotSent->: " - + opAndId(this)); - } - connection.sendCancelRequestWithLock(getGIOPVersion(), - getRequestId()); - // Case: first a location forward, then a marshaling - // exception (e.g., non-serializable object). Only - // send cancel once. - cancelRequestAlreadySent = true; - } catch (IOException e) { - if (orb.subcontractDebugFlag) { - dprint(".sendCancelRequestIfFinalFragmentNotSent: !ERROR : " + opAndId(this), - e); - } - - // REVISIT: we could attempt to send a final incomplete - // fragment in this case. - throw interceptorWrapper.ioexceptionDuringCancelRequest( - CompletionStatus.COMPLETED_MAYBE, e ); - } finally { - if (orb.subcontractDebugFlag) { - dprint(".sendCancelRequestIfFinalFragmentNotSent<-: " - + opAndId(this)); - } - } - } - } - - public boolean sentFullMessage() - { - return outputObject.getBufferManager().sentFullMessage(); - } - - public boolean sentFragment() - { - return outputObject.getBufferManager().sentFragment(); - } - - public void setDIIInfo(org.omg.CORBA.Request diiRequest) - { - this.diiRequest = diiRequest; - } - - public boolean isDIIRequest() - { - return diiRequest != null; - } - - public Exception unmarshalDIIUserException(String repoId, InputStream is) - { - if (! isDIIRequest()) { - return null; - } - - ExceptionList _exceptions = diiRequest.exceptions(); - - try { - // Find the typecode for the exception - for (int i=0; i<_exceptions.count() ; i++) { - TypeCode tc = _exceptions.item(i); - if ( tc.id().equals(repoId) ) { - // Since we dont have the actual user exception - // class, the spec says we have to create an - // UnknownUserException and put it in the - // environment. - Any eany = orb.create_any(); - eany.read_value(is, (TypeCode)tc); - - return new UnknownUserException(eany); - } - } - } catch (Exception b) { - throw wrapper.unexpectedDiiException(b); - } - - // must be a truly unknown exception - return wrapper.unknownCorbaExc( CompletionStatus.COMPLETED_MAYBE); - } - - public void setDIIException(Exception exception) - { - diiRequest.env().exception(exception); - } - - public void handleDIIReply(InputStream inputStream) - { - if (! isDIIRequest()) { - return; - } - ((RequestImpl)diiRequest).unmarshalReply(inputStream); - } - - public Message getDispatchHeader() - { - return dispatchHeader; - } - - public void setDispatchHeader(Message msg) - { - dispatchHeader = msg; - } - - public ByteBuffer getDispatchBuffer() - { - return dispatchByteBuffer; - } - - public void setDispatchBuffer(ByteBuffer byteBuffer) - { - dispatchByteBuffer = byteBuffer; - } - - public int getThreadPoolToUse() { - int poolToUse = 0; - Message msg = getDispatchHeader(); - // A null msg should never happen. But, we'll be - // defensive just in case. - if (msg != null) { - poolToUse = msg.getThreadPoolToUse(); - } - return poolToUse; - } - - public byte getStreamFormatVersion() - { - // REVISIT: ContactInfo/Acceptor output object factories - // just use this. Maybe need to distinguish: - // createOutputObjectForRequest - // createOutputObjectForReply - // then do getStreamFormatVersionForRequest/ForReply here. - if (streamFormatVersionSet) { - return streamFormatVersion; - } - return getStreamFormatVersionForReply(); - } - - /** - * If the RMI-IIOP maximum stream format version service context - * is present, it indicates the maximum stream format version we - * could use for the reply. If it isn't present, the default is - * 2 for GIOP 1.3 or greater, 1 for lower. - * - * This is only sent on requests. Clients can find out the - * server's maximum by looking for a tagged component in the IOR. - */ - public byte getStreamFormatVersionForReply() { - - // NOTE: The request service contexts may indicate the max. - ServiceContexts svc = getRequestServiceContexts(); - - MaxStreamFormatVersionServiceContext msfvsc - = (MaxStreamFormatVersionServiceContext)svc.get( - MaxStreamFormatVersionServiceContext.SERVICE_CONTEXT_ID); - - if (msfvsc != null) { - byte localMaxVersion = ORBUtility.getMaxStreamFormatVersion(); - byte remoteMaxVersion = msfvsc.getMaximumStreamFormatVersion(); - - return (byte)Math.min(localMaxVersion, remoteMaxVersion); - } else { - // Defaults to 1 for GIOP 1.2 or less, 2 for - // GIOP 1.3 or higher. - if (getGIOPVersion().lessThan(GIOPVersion.V1_3)) - return ORBConstants.STREAM_FORMAT_VERSION_1; - else - return ORBConstants.STREAM_FORMAT_VERSION_2; - } - } - - public boolean isSystemExceptionReply() - { - return replyHeader.getReplyStatus() == ReplyMessage.SYSTEM_EXCEPTION; - } - - public boolean isUserExceptionReply() - { - return replyHeader.getReplyStatus() == ReplyMessage.USER_EXCEPTION; - } - - public boolean isLocationForwardReply() - { - return ( (replyHeader.getReplyStatus() == ReplyMessage.LOCATION_FORWARD) || - (replyHeader.getReplyStatus() == ReplyMessage.LOCATION_FORWARD_PERM) ); - //return replyHeader.getReplyStatus() == ReplyMessage.LOCATION_FORWARD; - } - - public boolean isDifferentAddrDispositionRequestedReply() - { - return replyHeader.getReplyStatus() == ReplyMessage.NEEDS_ADDRESSING_MODE; - } - - public short getAddrDispositionReply() - { - return replyHeader.getAddrDisposition(); - } - - public IOR getForwardedIOR() - { - return replyHeader.getIOR(); - } - - public SystemException getSystemExceptionReply() - { - return replyHeader.getSystemException(replyExceptionDetailMessage); - } - - //////////////////////////////////////////////////// - // - // Used by server side. - // - - public ObjectKey getObjectKey() - { - return getRequestHeader().getObjectKey(); - } - - public void setProtocolHandler(CorbaProtocolHandler protocolHandler) - { - throw wrapper.methodShouldNotBeCalled() ; - } - - public CorbaProtocolHandler getProtocolHandler() - { - // REVISIT: should look up in orb registry. - return this; - } - - //////////////////////////////////////////////////// - // - // ResponseHandler - // - - public org.omg.CORBA.portable.OutputStream createReply() - { - // Note: relies on side-effect of setting mediator output field. - // REVISIT - cast - need interface - getProtocolHandler().createResponse(this, (ServiceContexts) null); - return (OutputStream) getOutputObject(); - } - - public org.omg.CORBA.portable.OutputStream createExceptionReply() - { - // Note: relies on side-effect of setting mediator output field. - // REVISIT - cast - need interface - getProtocolHandler().createUserExceptionResponse(this, (ServiceContexts) null); - return (OutputStream) getOutputObject(); - } - - public boolean executeReturnServantInResponseConstructor() - { - return _executeReturnServantInResponseConstructor; - - } - - public void setExecuteReturnServantInResponseConstructor(boolean b) - { - _executeReturnServantInResponseConstructor = b; - } - - public boolean executeRemoveThreadInfoInResponseConstructor() - { - return _executeRemoveThreadInfoInResponseConstructor; - } - - public void setExecuteRemoveThreadInfoInResponseConstructor(boolean b) - { - _executeRemoveThreadInfoInResponseConstructor = b; - } - - public boolean executePIInResponseConstructor() - { - return _executePIInResponseConstructor; - } - - public void setExecutePIInResponseConstructor( boolean b ) - { - _executePIInResponseConstructor = b; - } - - private byte getStreamFormatVersionForThisRequest(IOR ior, - GIOPVersion giopVersion) - { - - byte localMaxVersion - = ORBUtility.getMaxStreamFormatVersion(); - - IOR effectiveTargetIOR = - ((CorbaContactInfo)this.contactInfo).getEffectiveTargetIOR(); - IIOPProfileTemplate temp = - (IIOPProfileTemplate)effectiveTargetIOR.getProfile().getTaggedProfileTemplate(); - Iterator iter = temp.iteratorById(TAG_RMI_CUSTOM_MAX_STREAM_FORMAT.value); - if (!iter.hasNext()) { - // Didn't have the max stream format version tagged - // component. - if (giopVersion.lessThan(GIOPVersion.V1_3)) - return ORBConstants.STREAM_FORMAT_VERSION_1; - else - return ORBConstants.STREAM_FORMAT_VERSION_2; - } - - byte remoteMaxVersion - = ((MaxStreamFormatVersionComponent)iter.next()).getMaxStreamFormatVersion(); - - return (byte)Math.min(localMaxVersion, remoteMaxVersion); - } - - //////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////// - - // REVISIT - This could be a separate implementation object looked - // up in a registry. However it needs some state in the message - // mediator so combine for now. - - - protected boolean isThreadDone = false; - - //////////////////////////////////////////////////// - // - // pept.protocol.ProtocolHandler - // - - public boolean handleRequest(MessageMediator messageMediator) - { - try { - dispatchHeader.callback(this); - } catch (IOException e) { - // REVISIT - this should be handled internally. - ; - } - return isThreadDone; - } - - //////////////////////////////////////////////////// - // - // iiop.messages.MessageHandler - // - - private void setWorkThenPoolOrResumeSelect(Message header) - { - if (getConnection().getEventHandler().shouldUseSelectThreadToWait()) { - resumeSelect(header); - } else { - // Leader/Follower when using reader thread. - // When this thread is done working it will go back in pool. - - isThreadDone = true; - - // First unregister current registration. - orb.getTransportManager().getSelector(0) - .unregisterForEvent(getConnection().getEventHandler()); - // Have another thread become the reader. - orb.getTransportManager().getSelector(0) - .registerForEvent(getConnection().getEventHandler()); - } - } - - private void setWorkThenReadOrResumeSelect(Message header) - { - if (getConnection().getEventHandler().shouldUseSelectThreadToWait()) { - resumeSelect(header); - } else { - // When using reader thread then wen this thread is - // done working it will continue reading. - isThreadDone = false; - } - } - - private void resumeSelect(Message header) - { - // NOTE: VERY IMPORTANT: - // Only participate in select after getting to the point - // that proper serialization of fragments is ensured. - - if (transportDebug()) { - dprint(".resumeSelect:->"); - // REVISIT: not-OO: - String requestId = "?"; - if (header instanceof RequestMessage) { - requestId = - new Integer(((RequestMessage)header) - .getRequestId()).toString(); - } else if (header instanceof ReplyMessage) { - requestId = - new Integer(((ReplyMessage)header) - .getRequestId()).toString(); - } else if (header instanceof FragmentMessage_1_2) { - requestId = - new Integer(((FragmentMessage_1_2)header) - .getRequestId()).toString(); - } - dprint(".resumeSelect: id/" - + requestId - + " " + getConnection() - ); - - } - - // IMPORTANT: To avoid bug (4953599), we force the Thread that does the NIO select - // to also do the enable/disable of Ops using SelectionKey.interestOps(Ops of Interest). - // Otherwise, the SelectionKey.interestOps(Ops of Interest) may block indefinitely in - // this thread. - EventHandler eventHandler = getConnection().getEventHandler(); - orb.getTransportManager().getSelector(0).registerInterestOps(eventHandler); - - if (transportDebug()) { - dprint(".resumeSelect:<-"); - } - } - - private void setInputObject() - { - // REVISIT: refactor createInputObject (and createMessageMediator) - // into base PlugInFactory. Get via connection (either ContactInfo - // or Acceptor). - if (getConnection().getContactInfo() != null) { - inputObject = (CDRInputObject) - getConnection().getContactInfo() - .createInputObject(orb, this); - } else if (getConnection().getAcceptor() != null) { - inputObject = (CDRInputObject) - getConnection().getAcceptor() - .createInputObject(orb, this); - } else { - throw new RuntimeException("CorbaMessageMediatorImpl.setInputObject"); - } - inputObject.setMessageMediator(this); - setInputObject(inputObject); - } - - private void signalResponseReceived() - { - // This will end up using the MessageMediator associated with - // the original request instead of the current mediator (which - // need to be constructed to hold the dispatchBuffer and connection). - connection.getResponseWaitingRoom() - .responseReceived((InputObject)inputObject); - } - - // This handles message types for which we don't create classes. - public void handleInput(Message header) throws IOException - { - try { - messageHeader = header; - - if (transportDebug()) - dprint(".handleInput->: " - + MessageBase.typeToString(header.getType())); - - setWorkThenReadOrResumeSelect(header); - - switch(header.getType()) - { - case Message.GIOPCloseConnection: - if (transportDebug()) { - dprint(".handleInput: CloseConnection: purging"); - } - connection.purgeCalls(wrapper.connectionRebind(), true, false); - break; - case Message.GIOPMessageError: - if (transportDebug()) { - dprint(".handleInput: MessageError: purging"); - } - connection.purgeCalls(wrapper.recvMsgError(), true, false); - break; - default: - if (transportDebug()) { - dprint(".handleInput: ERROR: " - + MessageBase.typeToString(header.getType())); - } - throw wrapper.badGiopRequestType() ; - } - releaseByteBufferToPool(); - } finally { - if (transportDebug()) { - dprint(".handleInput<-: " - + MessageBase.typeToString(header.getType())); - } - } - } - - public void handleInput(RequestMessage_1_0 header) throws IOException - { - try { - if (transportDebug()) dprint(".REQUEST 1.0->: " + header); - try { - messageHeader = requestHeader = (RequestMessage) header; - setInputObject(); - } finally { - setWorkThenPoolOrResumeSelect(header); - } - getProtocolHandler().handleRequest(header, this); - } catch (Throwable t) { - if (transportDebug()) - dprint(".REQUEST 1.0: !!ERROR!!: " + header, t); - // Mask the exception from thread.; - } finally { - if (transportDebug()) dprint(".REQUEST 1.0<-: " + header); - } - } - - public void handleInput(RequestMessage_1_1 header) throws IOException - { - try { - if (transportDebug()) dprint(".REQUEST 1.1->: " + header); - try { - messageHeader = requestHeader = (RequestMessage) header; - setInputObject(); - connection.serverRequest_1_1_Put(this); - } finally { - setWorkThenPoolOrResumeSelect(header); - } - getProtocolHandler().handleRequest(header, this); - } catch (Throwable t) { - if (transportDebug()) - dprint(".REQUEST 1.1: !!ERROR!!: " + header, t); - // Mask the exception from thread.; - } finally { - if (transportDebug()) dprint(".REQUEST 1.1<-: " + header); - } - } - - // REVISIT: this is identical to 1_0 except for fragment part. - public void handleInput(RequestMessage_1_2 header) throws IOException - { - try { - try { - - messageHeader = requestHeader = (RequestMessage) header; - - header.unmarshalRequestID(dispatchByteBuffer); - setInputObject(); - - if (transportDebug()) dprint(".REQUEST 1.2->: id/" - + header.getRequestId() - + ": " - + header); - - // NOTE: in the old code this used to be done conditionally: - // if (header.moreFragmentsToFollow()). - // Now we always put it in. We take it out when - // the response is done. - // This must happen now so if a header is fragmented the stream - // may be found. - connection.serverRequestMapPut(header.getRequestId(), this); - } finally { - // Leader/Follower. - // Note: This *MUST* come after putting stream in above map - // since the header may be fragmented and you do not want to - // start reading again until the map above is set. - setWorkThenPoolOrResumeSelect(header); - } - //inputObject.unmarshalHeader(); // done in subcontract. - getProtocolHandler().handleRequest(header, this); - } catch (Throwable t) { - if (transportDebug()) dprint(".REQUEST 1.2: id/" - + header.getRequestId() - + ": !!ERROR!!: " - + header, - t); - // Mask the exception from thread.; - } finally { - connection.serverRequestMapRemove(header.getRequestId()); - - if (transportDebug()) dprint(".REQUEST 1.2<-: id/" - + header.getRequestId() - + ": " - + header); - } - } - - public void handleInput(ReplyMessage_1_0 header) throws IOException - { - try { - try { - if (transportDebug()) dprint(".REPLY 1.0->: " + header); - messageHeader = replyHeader = (ReplyMessage) header; - setInputObject(); - - // REVISIT: this should be done by waiting thread. - inputObject.unmarshalHeader(); - - signalResponseReceived(); - } finally{ - setWorkThenReadOrResumeSelect(header); - } - } catch (Throwable t) { - if (transportDebug())dprint(".REPLY 1.0: !!ERROR!!: " + header, t); - // Mask the exception from thread.; - } finally { - if (transportDebug()) dprint(".REPLY 1.0<-: " + header); - } - } - - public void handleInput(ReplyMessage_1_1 header) throws IOException - { - try { - if (transportDebug()) dprint(".REPLY 1.1->: " + header); - messageHeader = replyHeader = (ReplyMessage) header; - setInputObject(); - - if (header.moreFragmentsToFollow()) { - - // More fragments are coming to complete this reply, so keep - // a reference to the InputStream so we can add the fragments - connection.clientReply_1_1_Put(this); - - // In 1.1, we can't assume that we have the request ID in the - // first fragment. Thus, another thread is used - // to be the reader while this thread unmarshals - // the extended header and wakes up the client thread. - setWorkThenPoolOrResumeSelect(header); - - // REVISIT - error handling. - // This must be done now. - inputObject.unmarshalHeader(); - - signalResponseReceived(); - - } else { - - // Not fragmented, therefore we know the request - // ID is here. Thus, we can unmarshal the extended header - // and wake up the client thread without using a third - // thread as above. - - // REVISIT - error handling during unmarshal. - // This must be done now to get the request id. - inputObject.unmarshalHeader(); - - signalResponseReceived(); - - setWorkThenReadOrResumeSelect(header); - } - } catch (Throwable t) { - if (transportDebug()) dprint(".REPLY 1.1: !!ERROR!!: " + header); - // Mask the exception from thread.; - } finally { - if (transportDebug()) dprint(".REPLY 1.1<-: " + header); - } - } - - public void handleInput(ReplyMessage_1_2 header) throws IOException - { - try { - try { - messageHeader = replyHeader = (ReplyMessage) header; - - // We know that the request ID is in the first fragment - header.unmarshalRequestID(dispatchByteBuffer); - - if (transportDebug()) { - dprint(".REPLY 1.2->: id/" - + + header.getRequestId() - + ": more?: " + header.moreFragmentsToFollow() - + ": " + header); - } - - setInputObject(); - - signalResponseReceived(); - } finally { - setWorkThenReadOrResumeSelect(header); - } - } catch (Throwable t) { - if (transportDebug()) dprint(".REPLY 1.2: id/" - + header.getRequestId() - + ": !!ERROR!!: " - + header, t); - // Mask the exception from thread.; - } finally { - if (transportDebug()) dprint(".REPLY 1.2<-: id/" - + header.getRequestId() - + ": " - + header); - } - } - - public void handleInput(LocateRequestMessage_1_0 header) throws IOException - { - try { - if (transportDebug()) - dprint(".LOCATE_REQUEST 1.0->: " + header); - try { - messageHeader = header; - setInputObject(); - } finally { - setWorkThenPoolOrResumeSelect(header); - } - getProtocolHandler().handleRequest(header, this); - } catch (Throwable t) { - if (transportDebug()) - dprint(".LOCATE_REQUEST 1.0: !!ERROR!!: " + header, t); - // Mask the exception from thread.; - } finally { - if (transportDebug()) - dprint(".LOCATE_REQUEST 1.0<-: " + header); - } - - } - - public void handleInput(LocateRequestMessage_1_1 header) throws IOException - { - try { - if (transportDebug()) - dprint(".LOCATE_REQUEST 1.1->: " + header); - try { - messageHeader = header; - setInputObject(); - } finally { - setWorkThenPoolOrResumeSelect(header); - } - getProtocolHandler().handleRequest(header, this); - } catch (Throwable t) { - if (transportDebug()) - dprint(".LOCATE_REQUEST 1.1: !!ERROR!!: " + header, t); - // Mask the exception from thread.; - } finally { - if (transportDebug()) - dprint(".LOCATE_REQUEST 1.1<-:" + header); - } - } - - public void handleInput(LocateRequestMessage_1_2 header) throws IOException - { - try { - try { - messageHeader = header; - - header.unmarshalRequestID(dispatchByteBuffer); - setInputObject(); - - if (transportDebug()) - dprint(".LOCATE_REQUEST 1.2->: id/" - + header.getRequestId() - + ": " - + header); - - if (header.moreFragmentsToFollow()) { - connection.serverRequestMapPut(header.getRequestId(),this); - } - } finally { - setWorkThenPoolOrResumeSelect(header); - } - getProtocolHandler().handleRequest(header, this); - } catch (Throwable t) { - if (transportDebug()) - dprint(".LOCATE_REQUEST 1.2: id/" - + header.getRequestId() - + ": !!ERROR!!: " - + header, t); - // Mask the exception from thread.; - } finally { - if (transportDebug()) - dprint(".LOCATE_REQUEST 1.2<-: id/" - + header.getRequestId() - + ": " - + header); - } - } - - public void handleInput(LocateReplyMessage_1_0 header) throws IOException - { - try { - if (transportDebug()) - dprint(".LOCATE_REPLY 1.0->:" + header); - try { - messageHeader = header; - setInputObject(); - inputObject.unmarshalHeader(); // REVISIT Put in subcontract. - signalResponseReceived(); - } finally { - setWorkThenReadOrResumeSelect(header); - } - } catch (Throwable t) { - if (transportDebug()) - dprint(".LOCATE_REPLY 1.0: !!ERROR!!: " + header, t); - // Mask the exception from thread.; - } finally { - if (transportDebug()) - dprint(".LOCATE_REPLY 1.0<-: " + header); - } - } - - public void handleInput(LocateReplyMessage_1_1 header) throws IOException - { - try { - if (transportDebug()) dprint(".LOCATE_REPLY 1.1->: " + header); - try { - messageHeader = header; - setInputObject(); - // Fragmented LocateReplies are not allowed in 1.1. - inputObject.unmarshalHeader(); - signalResponseReceived(); - } finally { - setWorkThenReadOrResumeSelect(header); - } - } catch (Throwable t) { - if (transportDebug()) - dprint(".LOCATE_REPLY 1.1: !!ERROR!!: " + header, t); - // Mask the exception from thread.; - } finally { - if (transportDebug()) dprint(".LOCATE_REPLY 1.1<-: " + header); - } - } - - public void handleInput(LocateReplyMessage_1_2 header) throws IOException - { - try { - try { - messageHeader = header; - - // No need to put in client reply map - already there. - header.unmarshalRequestID(dispatchByteBuffer); - - setInputObject(); - - if (transportDebug()) dprint(".LOCATE_REPLY 1.2->: id/" - + header.getRequestId() - + ": " - + header); - - signalResponseReceived(); - } finally { - setWorkThenPoolOrResumeSelect(header); // REVISIT - } - } catch (Throwable t) { - if (transportDebug()) - dprint(".LOCATE_REPLY 1.2: id/" - + header.getRequestId() - + ": !!ERROR!!: " - + header, t); - // Mask the exception from thread.; - } finally { - if (transportDebug()) dprint(".LOCATE_REPLY 1.2<-: id/" - + header.getRequestId() - + ": " - + header); - } - } - - public void handleInput(FragmentMessage_1_1 header) throws IOException - { - try { - if (transportDebug()) { - dprint(".FRAGMENT 1.1->: " - + "more?: " + header.moreFragmentsToFollow() - + ": " + header); - } - try { - messageHeader = header; - MessageMediator mediator = null; - CDRInputObject inputObject = null; - - if (connection.isServer()) { - mediator = connection.serverRequest_1_1_Get(); - } else { - mediator = connection.clientReply_1_1_Get(); - } - if (mediator != null) { - inputObject = (CDRInputObject) mediator.getInputObject(); - } - - // If no input stream available, then discard the fragment. - // This can happen: - // 1. if a fragment message is received prior to receiving - // the original request/reply message. Very unlikely. - // 2. if a fragment message is received after the - // reply has been sent (early replies) - // Note: In the case of early replies, the fragments received - // during the request processing (which are never unmarshaled), - // will eventually be discarded by the GC. - if (inputObject == null) { - if (transportDebug()) - dprint(".FRAGMENT 1.1: ++++DISCARDING++++: " + header); - // need to release dispatchByteBuffer to pool if - // we are discarding - releaseByteBufferToPool(); - return; - } - - inputObject.getBufferManager() - .processFragment(dispatchByteBuffer, header); - - if (! header.moreFragmentsToFollow()) { - if (connection.isServer()) { - connection.serverRequest_1_1_Remove(); - } else { - connection.clientReply_1_1_Remove(); - } - } - } finally { - // NOTE: This *must* come after queing the fragment - // when using the selector to ensure fragments stay in order. - setWorkThenReadOrResumeSelect(header); - } - } catch (Throwable t) { - if (transportDebug()) - dprint(".FRAGMENT 1.1: !!ERROR!!: " + header, t); - // Mask the exception from thread.; - } finally { - if (transportDebug()) dprint(".FRAGMENT 1.1<-: " + header); - } - } - - public void handleInput(FragmentMessage_1_2 header) throws IOException - { - try { - try { - messageHeader = header; - - // Note: We know it's a 1.2 fragment, we have the data, but - // we need the IIOPInputStream instance to unmarshal the - // request ID... but we need the request ID to get the - // IIOPInputStream instance. So we peek at the raw bytes. - - header.unmarshalRequestID(dispatchByteBuffer); - - if (transportDebug()) { - dprint(".FRAGMENT 1.2->: id/" - + header.getRequestId() - + ": more?: " + header.moreFragmentsToFollow() - + ": " + header); - } - - MessageMediator mediator = null; - InputObject inputObject = null; - - if (connection.isServer()) { - mediator = - connection.serverRequestMapGet(header.getRequestId()); - } else { - mediator = - connection.clientRequestMapGet(header.getRequestId()); - } - if (mediator != null) { - inputObject = mediator.getInputObject(); - } - // See 1.1 comments. - if (inputObject == null) { - if (transportDebug()) { - dprint(".FRAGMENT 1.2: id/" - + header.getRequestId() - + ": ++++DISCARDING++++: " - + header); - } - // need to release dispatchByteBuffer to pool if - // we are discarding - releaseByteBufferToPool(); - return; - } - ((CDRInputObject)inputObject) - .getBufferManager().processFragment( - dispatchByteBuffer, header); - - // REVISIT: but if it is a server don't you have to remove the - // stream from the map? - if (! connection.isServer()) { - /* REVISIT - * No need to do anything. - * Should we mark that last was received? - if (! header.moreFragmentsToFollow()) { - // Last fragment. - } - */ - } - } finally { - // NOTE: This *must* come after queing the fragment - // when using the selector to ensure fragments stay in order. - setWorkThenReadOrResumeSelect(header); - } - } catch (Throwable t) { - if (transportDebug()) - dprint(".FRAGMENT 1.2: id/" - + header.getRequestId() - + ": !!ERROR!!: " - + header, t); - // Mask the exception from thread.; - } finally { - if (transportDebug()) dprint(".FRAGMENT 1.2<-: id/" - + header.getRequestId() - + ": " - + header); - } - } - - public void handleInput(CancelRequestMessage header) throws IOException - { - try { - try { - messageHeader = header; - setInputObject(); - - // REVISIT: Move these two to subcontract. - inputObject.unmarshalHeader(); - - if (transportDebug()) dprint(".CANCEL->: id/" - + header.getRequestId() + ": " - + header.getGIOPVersion() + ": " - + header); - - processCancelRequest(header.getRequestId()); - releaseByteBufferToPool(); - } finally { - setWorkThenReadOrResumeSelect(header); - } - } catch (Throwable t) { - if (transportDebug()) dprint(".CANCEL: id/" - + header.getRequestId() - + ": !!ERROR!!: " - + header, t); - // Mask the exception from thread.; - } finally { - if (transportDebug()) dprint(".CANCEL<-: id/" - + header.getRequestId() + ": " - + header.getGIOPVersion() + ": " - + header); - } - } - - private void throwNotImplemented() - { - isThreadDone = false; - throwNotImplemented(""); - } - - private void throwNotImplemented(String msg) - { - throw new RuntimeException("CorbaMessageMediatorImpl: not implemented " + msg); - } - - private void dprint(String msg, Throwable t) - { - dprint(msg); - t.printStackTrace(System.out); - } - - private void dprint(String msg) - { - ORBUtility.dprint("CorbaMessageMediatorImpl", msg); - } - - protected String opAndId(CorbaMessageMediator mediator) - { - return ORBUtility.operationNameAndRequestId(mediator); - } - - private boolean transportDebug() - { - return orb.transportDebugFlag; - } - - // REVISIT: move this to subcontract (but both client and server need it). - private final void processCancelRequest(int cancelReqId) { - - // The GIOP version of CancelRequest does not matter, since - // CancelRequest_1_0 could be sent to cancel a request which - // has a different GIOP version. - - /* - * CancelRequest processing logic : - * - * - find the request with matching requestId - * - * - call cancelProcessing() in BufferManagerRead [BMR] - * - * - the hope is that worker thread would call BMR.underflow() - * to wait for more fragments to come in. When BMR.underflow() is - * called, if a CancelRequest had already arrived, - * the worker thread would throw ThreadDeath, - * else the thread would wait to be notified of the - * arrival of a new fragment or CancelRequest. Upon notification, - * the woken up thread would check to see if a CancelRequest had - * arrived and if so throw a ThreadDeath or it will continue to - * process the received fragment. - * - * - if all the fragments had been received prior to CancelRequest - * then the worker thread would never block in BMR.underflow(). - * So, setting the abort flag in BMR has no effect. The request - * processing will complete normally. - * - * - in the case where the server has received enough fragments to - * start processing the request and the server sends out - * an early reply. In such a case if the CancelRequest arrives - * after the reply has been sent, it has no effect. - */ - - if (!connection.isServer()) { - return; // we do not support bi-directional giop yet, ignore. - } - - // Try to get hold of the InputStream buffer. - // In the case of 1.0 requests there is no way to get hold of - // InputStream. Try out the 1.1 and 1.2 cases. - - // was the request 1.2 ? - MessageMediator mediator = connection.serverRequestMapGet(cancelReqId); - int requestId ; - if (mediator == null) { - // was the request 1.1 ? - mediator = connection.serverRequest_1_1_Get(); - if (mediator == null) { - // XXX log this! - // either the request was 1.0 - // or an early reply has already been sent - // or request processing is over - // or its a spurious CancelRequest - return; // do nothing. - } - - requestId = ((CorbaMessageMediator) mediator).getRequestId(); - - if (requestId != cancelReqId) { - // A spurious 1.1 CancelRequest has been received. - // XXX log this! - return; // do nothing - } - - if (requestId == 0) { // special case - // XXX log this - // this means that - // 1. the 1.1 requests' requestId has not been received - // i.e., a CancelRequest was received even before the - // 1.1 request was received. The spec disallows this. - // 2. or the 1.1 request has a requestId 0. - // - // It is a little tricky to distinguish these two. So, be - // conservative and do not cancel the request. Downside is that - // 1.1 requests with requestId of 0 will never be cancelled. - return; // do nothing - } - } else { - requestId = ((CorbaMessageMediator) mediator).getRequestId(); - } - - Message msg = ((CorbaMessageMediator)mediator).getRequestHeader(); - if (msg.getType() != Message.GIOPRequest) { - // Any mediator obtained here should only ever be for a GIOP - // request. - wrapper.badMessageTypeForCancel() ; - } - - // At this point we have a valid message mediator that contains - // a valid requestId. - - // at this point we have chosen a request to be cancelled. But we - // do not know if the target object's method has been invoked or not. - // Request input stream being available simply means that the request - // processing is not over yet. simply set the abort flag in the - // BMRS and hope that the worker thread would notice it (this can - // happen only if the request stream is being unmarshalled and the - // target's method has not been invoked yet). This guarantees - // that the requests which have been dispatched to the - // target's method will never be cancelled. - - BufferManagerReadStream bufferManager = (BufferManagerReadStream) - ((CDRInputObject)mediator.getInputObject()).getBufferManager(); - bufferManager.cancelProcessing(cancelReqId); - } - - //////////////////////////////////////////////////// - // - // spi.protocol.CorbaProtocolHandler - // - - public void handleRequest(RequestMessage msg, - CorbaMessageMediator messageMediator) - { - try { - beginRequest(messageMediator); - try { - handleRequestRequest(messageMediator); - if (messageMediator.isOneWay()) { - return; - } - } catch (Throwable t) { - if (messageMediator.isOneWay()) { - return; - } - handleThrowableDuringServerDispatch( - messageMediator, t, CompletionStatus.COMPLETED_MAYBE); - } - sendResponse(messageMediator); - } catch (Throwable t) { - dispatchError(messageMediator, "RequestMessage", t); - } finally { - endRequest(messageMediator); - } - } - - public void handleRequest(LocateRequestMessage msg, - CorbaMessageMediator messageMediator) - { - try { - beginRequest(messageMediator); - try { - handleLocateRequest(messageMediator); - } catch (Throwable t) { - handleThrowableDuringServerDispatch( - messageMediator, t, CompletionStatus.COMPLETED_MAYBE); - } - sendResponse(messageMediator); - } catch (Throwable t) { - dispatchError(messageMediator, "LocateRequestMessage", t); - } finally { - endRequest(messageMediator); - } - } - - private void beginRequest(CorbaMessageMediator messageMediator) - { - ORB orb = (ORB) messageMediator.getBroker(); - if (orb.subcontractDebugFlag) { - dprint(".handleRequest->:"); - } - connection.serverRequestProcessingBegins(); - } - - private void dispatchError(CorbaMessageMediator messageMediator, - String msg, Throwable t) - { - if (orb.subcontractDebugFlag) { - dprint(".handleRequest: " + opAndId(messageMediator) - + ": !!ERROR!!: " - + msg, - t); - } - // REVISIT - this makes hcks sendTwoObjects fail - // messageMediator.getConnection().close(); - } - - private void sendResponse(CorbaMessageMediator messageMediator) - { - if (orb.subcontractDebugFlag) { - dprint(".handleRequest: " + opAndId(messageMediator) - + ": sending response"); - } - // REVISIT - type and location - CDROutputObject outputObject = (CDROutputObject) - messageMediator.getOutputObject(); - if (outputObject != null) { - // REVISIT - can be null for TRANSIENT below. - outputObject.finishSendingMessage(); - } - } - - private void endRequest(CorbaMessageMediator messageMediator) - { - ORB orb = (ORB) messageMediator.getBroker(); - if (orb.subcontractDebugFlag) { - dprint(".handleRequest<-: " + opAndId(messageMediator)); - } - - // release NIO ByteBuffers to ByteBufferPool - - try { - OutputObject outputObj = messageMediator.getOutputObject(); - if (outputObj != null) { - outputObj.close(); - } - InputObject inputObj = messageMediator.getInputObject(); - if (inputObj != null) { - inputObj.close(); - } - } catch (IOException ex) { - // Given what close() does, this catch shouldn't ever happen. - // See CDRInput/OutputObject.close() for more info. - // It also won't result in a Corba error if an IOException happens. - if (orb.subcontractDebugFlag) { - dprint(".endRequest: IOException:" + ex.getMessage(), ex); - } - } finally { - ((CorbaConnection)messageMediator.getConnection()).serverRequestProcessingEnds(); - } - } - - protected void handleRequestRequest(CorbaMessageMediator messageMediator) - { - // Does nothing if already unmarshaled. - ((CDRInputObject)messageMediator.getInputObject()).unmarshalHeader(); - - ORB orb = (ORB)messageMediator.getBroker(); - synchronized (orb) { - orb.checkShutdownState(); - } - - ObjectKey okey = messageMediator.getObjectKey(); - if (orb.subcontractDebugFlag) { - ObjectKeyTemplate oktemp = okey.getTemplate() ; - dprint( ".handleRequest: " + opAndId(messageMediator) - + ": dispatching to scid: " + oktemp.getSubcontractId()); - } - - CorbaServerRequestDispatcher sc = okey.getServerRequestDispatcher(orb); - - if (orb.subcontractDebugFlag) { - dprint(".handleRequest: " + opAndId(messageMediator) - + ": dispatching to sc: " + sc); - } - - if (sc == null) { - throw wrapper.noServerScInDispatch() ; - } - - // NOTE: - // This is necessary so mediator can act as ResponseHandler - // and pass necessary info to response constructors located - // in the subcontract. - // REVISIT - same class right now. - //messageMediator.setProtocolHandler(this); - - try { - orb.startingDispatch(); - sc.dispatch(messageMediator); - } finally { - orb.finishedDispatch(); - } - } - - protected void handleLocateRequest(CorbaMessageMediator messageMediator) - { - ORB orb = (ORB)messageMediator.getBroker(); - LocateRequestMessage msg = (LocateRequestMessage) - messageMediator.getDispatchHeader(); - IOR ior = null; - LocateReplyMessage reply = null; - short addrDisp = -1; - - try { - ((CDRInputObject)messageMediator.getInputObject()).unmarshalHeader(); - CorbaServerRequestDispatcher sc = - msg.getObjectKey().getServerRequestDispatcher( orb ) ; - if (sc == null) { - return; - } - - ior = sc.locate(msg.getObjectKey()); - - if ( ior == null ) { - reply = MessageBase.createLocateReply( - orb, msg.getGIOPVersion(), - msg.getEncodingVersion(), - msg.getRequestId(), - LocateReplyMessage.OBJECT_HERE, null); - - } else { - reply = MessageBase.createLocateReply( - orb, msg.getGIOPVersion(), - msg.getEncodingVersion(), - msg.getRequestId(), - LocateReplyMessage.OBJECT_FORWARD, ior); - } - // REVISIT: Should we catch SystemExceptions? - - } catch (AddressingDispositionException ex) { - - // create a response containing the expected target - // addressing disposition. - - reply = MessageBase.createLocateReply( - orb, msg.getGIOPVersion(), - msg.getEncodingVersion(), - msg.getRequestId(), - LocateReplyMessage.LOC_NEEDS_ADDRESSING_MODE, null); - - addrDisp = ex.expectedAddrDisp(); - - } catch (RequestCanceledException ex) { - - return; // no need to send reply - - } catch ( Exception ex ) { - - // REVISIT If exception is not OBJECT_NOT_EXIST, it should - // have a different reply - - // This handles OBJECT_NOT_EXIST exceptions thrown in - // the subcontract or obj manager. Send back UNKNOWN_OBJECT. - - reply = MessageBase.createLocateReply( - orb, msg.getGIOPVersion(), - msg.getEncodingVersion(), - msg.getRequestId(), - LocateReplyMessage.UNKNOWN_OBJECT, null); - } - - CDROutputObject outputObject = - createAppropriateOutputObject(messageMediator, - msg, reply); - messageMediator.setOutputObject(outputObject); - outputObject.setMessageMediator(messageMediator); - - reply.write(outputObject); - // outputObject.setMessage(reply); // REVISIT - not necessary - if (ior != null) { - ior.write(outputObject); - } - if (addrDisp != -1) { - AddressingDispositionHelper.write(outputObject, addrDisp); - } - } - - private CDROutputObject createAppropriateOutputObject( - CorbaMessageMediator messageMediator, - Message msg, LocateReplyMessage reply) - { - CDROutputObject outputObject; - - if (msg.getGIOPVersion().lessThan(GIOPVersion.V1_2)) { - // locate msgs 1.0 & 1.1 :=> grow, - outputObject = sun.corba.OutputStreamFactory.newCDROutputObject( - (ORB) messageMediator.getBroker(), - this, - GIOPVersion.V1_0, - (CorbaConnection) messageMediator.getConnection(), - reply, - ORBConstants.STREAM_FORMAT_VERSION_1); - } else { - // 1.2 :=> stream - outputObject = sun.corba.OutputStreamFactory.newCDROutputObject( - (ORB) messageMediator.getBroker(), - messageMediator, - reply, - ORBConstants.STREAM_FORMAT_VERSION_1); - } - return outputObject; - } - - public void handleThrowableDuringServerDispatch( - CorbaMessageMediator messageMediator, - Throwable throwable, - CompletionStatus completionStatus) - { - if (((ORB)messageMediator.getBroker()).subcontractDebugFlag) { - dprint(".handleThrowableDuringServerDispatch: " - + opAndId(messageMediator) + ": " - + throwable); - } - - // If we haven't unmarshaled the header, we probably don't - // have enough information to even send back a reply. - - // REVISIT - // Cannot do this check. When target addressing disposition does - // not match (during header unmarshaling) it throws an exception - // to be handled here. - /* - if (! ((CDRInputObject)messageMediator.getInputObject()) - .unmarshaledHeader()) { - return; - } - */ - handleThrowableDuringServerDispatch(messageMediator, - throwable, - completionStatus, - 1); - } - - - // REVISIT - catch and ignore RequestCanceledException. - - protected void handleThrowableDuringServerDispatch( - CorbaMessageMediator messageMediator, - Throwable throwable, - CompletionStatus completionStatus, - int iteration) - { - if (iteration > 10) { - if (((ORB)messageMediator.getBroker()).subcontractDebugFlag) { - dprint(".handleThrowableDuringServerDispatch: " - + opAndId(messageMediator) - + ": cannot handle: " - + throwable); - } - - // REVISIT - should we close connection? - RuntimeException rte = - new RuntimeException("handleThrowableDuringServerDispatch: " + - "cannot create response."); - rte.initCause(throwable); - throw rte; - } - - try { - if (throwable instanceof ForwardException) { - ForwardException fex = (ForwardException)throwable ; - createLocationForward( messageMediator, fex.getIOR(), null ) ; - return; - } - - if (throwable instanceof AddressingDispositionException) { - handleAddressingDisposition( - messageMediator, - (AddressingDispositionException)throwable); - return; - } - - // Else. - - SystemException sex = - convertThrowableToSystemException(throwable, completionStatus); - - createSystemExceptionResponse(messageMediator, sex, null); - return; - - } catch (Throwable throwable2) { - - // User code (e.g., postinvoke, interceptors) may change - // the exception, so we end up back here. - // Report the changed exception. - - handleThrowableDuringServerDispatch(messageMediator, - throwable2, - completionStatus, - iteration + 1); - return; - } - } - - protected SystemException convertThrowableToSystemException( - Throwable throwable, - CompletionStatus completionStatus) - { - if (throwable instanceof SystemException) { - return (SystemException)throwable; - } - - if (throwable instanceof RequestCanceledException) { - // Reporting an exception response causes the - // poa current stack, the interceptor stacks, etc. - // to be balanced. It also notifies interceptors - // that the request was cancelled. - - return wrapper.requestCanceled( throwable ) ; - } - - // NOTE: We do not trap ThreadDeath above Throwable. - // There is no reason to stop the thread. It is - // just a worker thread. The ORB never throws - // ThreadDeath. Client code may (e.g., in ServantManagers, - // interceptors, or servants) but that should not - // effect the ORB threads. So it is just handled - // generically. - - // - // Last resort. - // If user code throws a non-SystemException report it generically. - // - - return wrapper.runtimeexception( CompletionStatus.COMPLETED_MAYBE, throwable ) ; - } - - protected void handleAddressingDisposition( - CorbaMessageMediator messageMediator, - AddressingDispositionException ex) - { - - short addrDisp = -1; - - // from iiop.RequestProcessor. - - // Respond with expected target addressing disposition. - - switch (messageMediator.getRequestHeader().getType()) { - case Message.GIOPRequest : - ReplyMessage replyHeader = MessageBase.createReply( - (ORB)messageMediator.getBroker(), - messageMediator.getGIOPVersion(), - messageMediator.getEncodingVersion(), - messageMediator.getRequestId(), - ReplyMessage.NEEDS_ADDRESSING_MODE, - null, null); - // REVISIT: via acceptor factory. - CDROutputObject outputObject = - sun.corba.OutputStreamFactory.newCDROutputObject( - (ORB)messageMediator.getBroker(), - this, - messageMediator.getGIOPVersion(), - (CorbaConnection)messageMediator.getConnection(), - replyHeader, - ORBConstants.STREAM_FORMAT_VERSION_1); - messageMediator.setOutputObject(outputObject); - outputObject.setMessageMediator(messageMediator); - replyHeader.write(outputObject); - AddressingDispositionHelper.write(outputObject, - ex.expectedAddrDisp()); - return; - - case Message.GIOPLocateRequest : - LocateReplyMessage locateReplyHeader = MessageBase.createLocateReply( - (ORB)messageMediator.getBroker(), - messageMediator.getGIOPVersion(), - messageMediator.getEncodingVersion(), - messageMediator.getRequestId(), - LocateReplyMessage.LOC_NEEDS_ADDRESSING_MODE, - null); - - addrDisp = ex.expectedAddrDisp(); - - // REVISIT: via acceptor factory. - outputObject = - createAppropriateOutputObject(messageMediator, - messageMediator.getRequestHeader(), - locateReplyHeader); - messageMediator.setOutputObject(outputObject); - outputObject.setMessageMediator(messageMediator); - locateReplyHeader.write(outputObject); - IOR ior = null; - if (ior != null) { - ior.write(outputObject); - } - if (addrDisp != -1) { - AddressingDispositionHelper.write(outputObject, addrDisp); - } - return; - } - } - - public CorbaMessageMediator createResponse( - CorbaMessageMediator messageMediator, - ServiceContexts svc) - { - // REVISIT: ignore service contexts during framework transition. - // They are set in SubcontractResponseHandler to the wrong connection. - // Then they would be set again here and a duplicate contexts - // exception occurs. - return createResponseHelper( - messageMediator, - getServiceContextsForReply(messageMediator, null)); - } - - public CorbaMessageMediator createUserExceptionResponse( - CorbaMessageMediator messageMediator, ServiceContexts svc) - { - // REVISIT - same as above - return createResponseHelper( - messageMediator, - getServiceContextsForReply(messageMediator, null), - true); - } - - public CorbaMessageMediator createUnknownExceptionResponse( - CorbaMessageMediator messageMediator, UnknownException ex) - { - // NOTE: This service context container gets augmented in - // tail call. - ServiceContexts contexts = null; - SystemException sys = new UNKNOWN( 0, - CompletionStatus.COMPLETED_MAYBE); - contexts = new ServiceContexts( (ORB)messageMediator.getBroker() ); - UEInfoServiceContext uei = new UEInfoServiceContext(sys); - contexts.put( uei ) ; - return createSystemExceptionResponse(messageMediator, sys, contexts); - } - - public CorbaMessageMediator createSystemExceptionResponse( - CorbaMessageMediator messageMediator, - SystemException ex, - ServiceContexts svc) - { - if (messageMediator.getConnection() != null) { - // It is possible that fragments of response have already been - // sent. Then an error may occur (e.g. marshaling error like - // non serializable object). In that case it is too late - // to send the exception. We just return the existing fragmented - // stream here. This will cause an incomplete last fragment - // to be sent. Then the other side will get a marshaling error - // when attempting to unmarshal. - - // REVISIT: Impl - make interface method to do the following. - CorbaMessageMediatorImpl mediator = (CorbaMessageMediatorImpl) - ((CorbaConnection)messageMediator.getConnection()) - .serverRequestMapGet(messageMediator.getRequestId()); - - OutputObject existingOutputObject = null; - if (mediator != null) { - existingOutputObject = mediator.getOutputObject(); - } - - // REVISIT: need to think about messageMediator containing correct - // pointer to output object. - if (existingOutputObject != null && - mediator.sentFragment() && - ! mediator.sentFullMessage()) - { - return mediator; - } - } - - // Only do this if interceptors have been initialized on this request - // and have not completed their lifecycle (otherwise the info stack - // may be empty or have a different request's entry on top). - if (messageMediator.executePIInResponseConstructor()) { - // REVISIT: not necessary in framework now? - // Inform Portable Interceptors of the SystemException. This is - // required to be done here because the ending interception point - // is called in the when creating the response below - // but we do not currently write the SystemException into the - // response until after the ending point is called. - ((ORB)messageMediator.getBroker()).getPIHandler().setServerPIInfo( ex ); - } - - if (((ORB)messageMediator.getBroker()).subcontractDebugFlag && - ex != null) - { - dprint(".createSystemExceptionResponse: " - + opAndId(messageMediator), - ex); - } - - ServiceContexts serviceContexts = - getServiceContextsForReply(messageMediator, svc); - - // NOTE: We MUST add the service context before creating - // the response since service contexts are written to the - // stream when the response object is created. - - addExceptionDetailMessage(messageMediator, ex, serviceContexts); - - CorbaMessageMediator response = - createResponseHelper(messageMediator, serviceContexts, false); - - // NOTE: From here on, it is too late to add more service contexts. - // They have already been serialized to the stream (and maybe fragments - // sent). - - ORBUtility.writeSystemException( - ex, (OutputStream)response.getOutputObject()); - - return response; - } - - private void addExceptionDetailMessage(CorbaMessageMediator mediator, - SystemException ex, - ServiceContexts serviceContexts) - { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - PrintWriter pw = new PrintWriter(baos); - ex.printStackTrace(pw); - pw.flush(); // NOTE: you must flush or baos will be empty. - EncapsOutputStream encapsOutputStream = - sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)mediator.getBroker()); - encapsOutputStream.putEndian(); - encapsOutputStream.write_wstring(baos.toString()); - UnknownServiceContext serviceContext = - new UnknownServiceContext(ExceptionDetailMessage.value, - encapsOutputStream.toByteArray()); - serviceContexts.put(serviceContext); - } - - public CorbaMessageMediator createLocationForward( - CorbaMessageMediator messageMediator, IOR ior, ServiceContexts svc) - { - ReplyMessage reply - = MessageBase.createReply( - (ORB)messageMediator.getBroker(), - messageMediator.getGIOPVersion(), - messageMediator.getEncodingVersion(), - messageMediator.getRequestId(), - ReplyMessage.LOCATION_FORWARD, - getServiceContextsForReply(messageMediator, svc), - ior); - - return createResponseHelper(messageMediator, reply, ior); - } - - protected CorbaMessageMediator createResponseHelper( - CorbaMessageMediator messageMediator, ServiceContexts svc) - { - ReplyMessage message = - MessageBase.createReply( - (ORB)messageMediator.getBroker(), - messageMediator.getGIOPVersion(), - messageMediator.getEncodingVersion(), - messageMediator.getRequestId(), - ReplyMessage.NO_EXCEPTION, - svc, - null); - return createResponseHelper(messageMediator, message, null); - } - - protected CorbaMessageMediator createResponseHelper( - CorbaMessageMediator messageMediator, ServiceContexts svc,boolean user) - { - ReplyMessage message = - MessageBase.createReply( - (ORB)messageMediator.getBroker(), - messageMediator.getGIOPVersion(), - messageMediator.getEncodingVersion(), - messageMediator.getRequestId(), - user ? ReplyMessage.USER_EXCEPTION : - ReplyMessage.SYSTEM_EXCEPTION, - svc, - null); - return createResponseHelper(messageMediator, message, null); - } - - // REVISIT - IOR arg is ignored. - protected CorbaMessageMediator createResponseHelper( - CorbaMessageMediator messageMediator, ReplyMessage reply, IOR ior) - { - // REVISIT - these should be invoked from subcontract. - runServantPostInvoke(messageMediator); - runInterceptors(messageMediator, reply); - runRemoveThreadInfo(messageMediator); - - if (((ORB)messageMediator.getBroker()).subcontractDebugFlag) { - dprint(".createResponseHelper: " - + opAndId(messageMediator) + ": " - + reply); - } - - messageMediator.setReplyHeader(reply); - - OutputObject replyOutputObject; - // REVISIT = do not use null. - // - if (messageMediator.getConnection() == null) { - replyOutputObject = - sun.corba.OutputStreamFactory.newCDROutputObject(orb, - messageMediator, messageMediator.getReplyHeader(), - messageMediator.getStreamFormatVersion(), - BufferManagerFactory.GROW); - } else { - replyOutputObject = messageMediator.getConnection().getAcceptor() - .createOutputObject(messageMediator.getBroker(), messageMediator); - } - messageMediator.setOutputObject(replyOutputObject); - messageMediator.getOutputObject().setMessageMediator(messageMediator); - - reply.write((OutputStream) messageMediator.getOutputObject()); - if (reply.getIOR() != null) { - reply.getIOR().write((OutputStream) messageMediator.getOutputObject()); - } - // REVISIT - not necessary? - //messageMediator.this.replyIOR = reply.getIOR(); - - // NOTE: The mediator holds onto output object so return value - // not really necessary. - return messageMediator; - } - - protected void runServantPostInvoke(CorbaMessageMediator messageMediator) - { - // Run ServantLocator::postinvoke. This may cause a SystemException - // which will throw out of the constructor and return later - // to construct a reply for that exception. The internal logic - // of returnServant makes sure that postinvoke is only called once. - // REVISIT: instead of instanceof, put method on all orbs. - ORB orb = null; - // This flag is to deal with BootstrapServer use of reply streams, - // with ServerRequestDispatcher's use of reply streams, etc. - if (messageMediator.executeReturnServantInResponseConstructor()) { - // It is possible to get marshaling errors in the skeleton after - // postinvoke has completed. We must set this to false so that - // when the error exception reply is constructed we don't try - // to incorrectly access poa current (which will be the wrong - // one or an empty stack. - messageMediator.setExecuteReturnServantInResponseConstructor(false); - messageMediator.setExecuteRemoveThreadInfoInResponseConstructor(true); - - try { - orb = (ORB)messageMediator.getBroker(); - OAInvocationInfo info = orb.peekInvocationInfo() ; - ObjectAdapter oa = info.oa(); - try { - oa.returnServant() ; - } catch (Throwable thr) { - wrapper.unexpectedException( thr ) ; - - if (thr instanceof Error) - throw (Error)thr ; - else if (thr instanceof RuntimeException) - throw (RuntimeException)thr ; - } finally { - oa.exit(); - } - } catch (EmptyStackException ese) { - throw wrapper.emptyStackRunServantPostInvoke( ese ) ; - } - } - } - - protected void runInterceptors(CorbaMessageMediator messageMediator, - ReplyMessage reply) - { - if( messageMediator.executePIInResponseConstructor() ) { - // Invoke server request ending interception points (send_*): - // Note: this may end up with a SystemException or an internal - // Runtime ForwardRequest - ((ORB)messageMediator.getBroker()).getPIHandler(). - invokeServerPIEndingPoint( reply ); - - // Note this will be executed even if a ForwardRequest or - // SystemException is thrown by a Portable Interceptors ending - // point since we end up in this constructor again anyway. - ((ORB)messageMediator.getBroker()).getPIHandler(). - cleanupServerPIRequest(); - - // See createSystemExceptionResponse for why this is necesary. - messageMediator.setExecutePIInResponseConstructor(false); - } - } - - protected void runRemoveThreadInfo(CorbaMessageMediator messageMediator) - { - // Once you get here then the final reply is available (i.e., - // postinvoke and interceptors have completed. - if (messageMediator.executeRemoveThreadInfoInResponseConstructor()) { - messageMediator.setExecuteRemoveThreadInfoInResponseConstructor(false); - ((ORB)messageMediator.getBroker()).popInvocationInfo() ; - } - } - - protected ServiceContexts getServiceContextsForReply( - CorbaMessageMediator messageMediator, ServiceContexts contexts) - { - CorbaConnection c = (CorbaConnection) messageMediator.getConnection(); - - if (((ORB)messageMediator.getBroker()).subcontractDebugFlag) { - dprint(".getServiceContextsForReply: " - + opAndId(messageMediator) - + ": " + c); - } - - if (contexts == null) { - contexts = new ServiceContexts(((ORB)messageMediator.getBroker())); - } - - // NOTE : We only want to send the runtime context the first time - - if (c != null && !c.isPostInitialContexts()) { - c.setPostInitialContexts(); - SendingContextServiceContext scsc = - new SendingContextServiceContext( - ((ORB)messageMediator.getBroker()).getFVDCodeBaseIOR()) ; - - if (contexts.get( scsc.getId() ) != null) - throw wrapper.duplicateSendingContextServiceContext() ; - - contexts.put( scsc ) ; - - if ( ((ORB)messageMediator.getBroker()).subcontractDebugFlag) - dprint(".getServiceContextsForReply: " - + opAndId(messageMediator) - + ": added SendingContextServiceContext" ) ; - } - - // send ORBVersion servicecontext as part of the Reply - - ORBVersionServiceContext ovsc - = new ORBVersionServiceContext(ORBVersionFactory.getORBVersion()); - - if (contexts.get( ovsc.getId() ) != null) - throw wrapper.duplicateOrbVersionServiceContext() ; - - contexts.put( ovsc ) ; - - if ( ((ORB)messageMediator.getBroker()).subcontractDebugFlag) - dprint(".getServiceContextsForReply: " - + opAndId(messageMediator) - + ": added ORB version service context"); - - return contexts; - } - - // REVISIT - this method should be migrated to orbutil.ORBUtility - // since all locations that release ByteBuffers use - // very similar logic and debug information. - private void releaseByteBufferToPool() { - if (dispatchByteBuffer != null) { - orb.getByteBufferPool().releaseByteBuffer(dispatchByteBuffer); - if (transportDebug()) { - int bbId = System.identityHashCode(dispatchByteBuffer); - StringBuffer sb = new StringBuffer(); - sb.append(".handleInput: releasing ByteBuffer (" + bbId + - ") to ByteBufferPool"); - dprint(sb.toString()); - } - } - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/CorbaServerRequestDispatcherImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/CorbaServerRequestDispatcherImpl.java deleted file mode 100644 index b3bea051dbd..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/CorbaServerRequestDispatcherImpl.java +++ /dev/null @@ -1,885 +0,0 @@ -/* - * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - - -package com.sun.corba.se.impl.protocol; - -import org.omg.PortableServer.Servant ; - -import org.omg.CORBA.SystemException; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.UNKNOWN; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.Any; - -import org.omg.CORBA.portable.InvokeHandler; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; -import org.omg.CORBA.portable.UnknownException; -import org.omg.CORBA.portable.ResponseHandler; - -import com.sun.org.omg.SendingContext.CodeBase; - -import com.sun.corba.se.pept.encoding.OutputObject; -import com.sun.corba.se.pept.protocol.MessageMediator; - -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.orb.ORBVersion; -import com.sun.corba.se.spi.orb.ORBVersionFactory; -import com.sun.corba.se.spi.ior.IOR ; -import com.sun.corba.se.spi.ior.ObjectKey; -import com.sun.corba.se.spi.ior.ObjectKeyTemplate; -import com.sun.corba.se.spi.ior.ObjectAdapterId; -import com.sun.corba.se.spi.oa.ObjectAdapterFactory; -import com.sun.corba.se.spi.oa.ObjectAdapter; -import com.sun.corba.se.spi.oa.OAInvocationInfo; -import com.sun.corba.se.spi.oa.OADestroyed; -import com.sun.corba.se.spi.oa.NullServant; -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; -import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher; -import com.sun.corba.se.spi.protocol.ForwardException ; -import com.sun.corba.se.spi.protocol.RequestDispatcherRegistry; -import com.sun.corba.se.spi.transport.CorbaConnection; -import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; - -import com.sun.corba.se.impl.protocol.SpecialMethod ; -import com.sun.corba.se.spi.servicecontext.ServiceContext; -import com.sun.corba.se.spi.servicecontext.ServiceContexts; -import com.sun.corba.se.spi.servicecontext.UEInfoServiceContext; -import com.sun.corba.se.spi.servicecontext.CodeSetServiceContext; -import com.sun.corba.se.spi.servicecontext.SendingContextServiceContext; -import com.sun.corba.se.spi.servicecontext.ORBVersionServiceContext; - -import com.sun.corba.se.impl.corba.ServerRequestImpl ; -import com.sun.corba.se.impl.encoding.MarshalInputStream; -import com.sun.corba.se.impl.encoding.MarshalOutputStream; -import com.sun.corba.se.impl.encoding.CodeSetComponentInfo; -import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry; -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.protocol.RequestCanceledException; -import com.sun.corba.se.impl.logging.ORBUtilSystemException; -import com.sun.corba.se.impl.logging.POASystemException; - -public class CorbaServerRequestDispatcherImpl - implements CorbaServerRequestDispatcher -{ - protected ORB orb; // my ORB instance - private ORBUtilSystemException wrapper ; - private POASystemException poaWrapper ; - - // Added from last version because it broke the build - RTW - // XXX remove me and rebuild: probably no longer needed - // public static final int UNKNOWN_EXCEPTION_INFO_ID = 9; - - public CorbaServerRequestDispatcherImpl(ORB orb) - { - this.orb = orb; - wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - poaWrapper = POASystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - } - - /** XXX/REVISIT: - * We do not want to look for a servant in the POA/ServantManager case, - * but we could in most other cases. The OA could have a method that - * returns true if the servant MAY exist, and false only if the servant - * definitely DOES NOT exist. - * - * XXX/REVISIT: - * We may wish to indicate OBJECT_HERE by some mechanism other than - * returning a null result. - * - * Called from ORB.locate when a LocateRequest arrives. - * Result is not always absolutely correct: may indicate OBJECT_HERE - * for non-existent objects, which is resolved on invocation. This - * "bug" is unavoidable, since in general the object may be destroyed - * between a locate and a request. Note that this only checks that - * the appropriate ObjectAdapter is available, not that the servant - * actually exists. - * Need to signal one of OBJECT_HERE, OBJECT_FORWARD, OBJECT_NOT_EXIST. - * @return Result is null if object is (possibly) implemented here, otherwise - * an IOR indicating objref to forward the request to. - * @exception OBJECT_NOT_EXIST is thrown if we know the object does not - * exist here, and we are not forwarding. - */ - public IOR locate(ObjectKey okey) - { - try { - if (orb.subcontractDebugFlag) - dprint(".locate->"); - - ObjectKeyTemplate oktemp = okey.getTemplate() ; - - try { - checkServerId(okey); - } catch (ForwardException fex) { - return fex.getIOR() ; - } - - // Called only for its side-effect of throwing appropriate exceptions - findObjectAdapter(oktemp); - - return null ; - } finally { - if (orb.subcontractDebugFlag) - dprint(".locate<-"); - } - } - - public void dispatch(MessageMediator messageMediator) - { - CorbaMessageMediator request = (CorbaMessageMediator) messageMediator; - try { - if (orb.subcontractDebugFlag) { - dprint(".dispatch->: " + opAndId(request)); - } - - // to set the codebase information, if any transmitted; and also - // appropriate ORB Version. - consumeServiceContexts(request); - - // Now that we have the service contexts processed and the - // correct ORBVersion set, we must finish initializing the - // stream. - ((MarshalInputStream)request.getInputObject()) - .performORBVersionSpecificInit(); - - ObjectKey okey = request.getObjectKey(); - - // Check that this server is the right server - try { - checkServerId(okey); - } catch (ForwardException fex) { - if (orb.subcontractDebugFlag) { - dprint(".dispatch: " + opAndId(request) - + ": bad server id"); - } - - request.getProtocolHandler() - .createLocationForward(request, fex.getIOR(), null); - return; - } - - String operation = request.getOperationName(); - ObjectAdapter objectAdapter = null ; - - try { - byte[] objectId = okey.getId().getId() ; - ObjectKeyTemplate oktemp = okey.getTemplate() ; - objectAdapter = findObjectAdapter(oktemp); - - java.lang.Object servant = getServantWithPI(request, objectAdapter, - objectId, oktemp, operation); - - dispatchToServant(servant, request, objectId, objectAdapter); - } catch (ForwardException ex) { - if (orb.subcontractDebugFlag) { - dprint(".dispatch: " + opAndId(request) - + ": ForwardException caught"); - } - - // Thrown by Portable Interceptors from InterceptorInvoker, - // through Response constructor. - request.getProtocolHandler() - .createLocationForward(request, ex.getIOR(), null); - } catch (OADestroyed ex) { - if (orb.subcontractDebugFlag) { - dprint(".dispatch: " + opAndId(request) - + ": OADestroyed exception caught"); - } - - // DO NOT CALL THIS HERE: - // releaseServant(objectAdapter); - // The problem is that OADestroyed is only thrown by oa.enter, in - // which case oa.exit should NOT be called, and neither should - // the invocationInfo stack be popped. - - // Destroyed POAs can be recreated by normal adapter activation. - // So just restart the dispatch. - dispatch(request); - } catch (RequestCanceledException ex) { - if (orb.subcontractDebugFlag) { - dprint(".dispatch: " + opAndId(request) - + ": RequestCanceledException caught"); - } - - // IDLJ generated non-tie based skeletons do not catch the - // RequestCanceledException. Rethrow the exception, which will - // cause the worker thread to unwind the dispatch and wait for - // other requests. - throw ex; - } catch (UnknownException ex) { - if (orb.subcontractDebugFlag) { - dprint(".dispatch: " + opAndId(request) - + ": UnknownException caught " + ex); - } - - // RMIC generated tie skeletons convert all Throwable exception - // types (including RequestCanceledException, ThreadDeath) - // thrown during reading fragments into UnknownException. - // If RequestCanceledException was indeed raised, - // then rethrow it, which will eventually cause the worker - // thread to unstack the dispatch and wait for other requests. - if (ex.originalEx instanceof RequestCanceledException) { - throw (RequestCanceledException) ex.originalEx; - } - - ServiceContexts contexts = new ServiceContexts(orb); - UEInfoServiceContext usc = new UEInfoServiceContext( - ex.originalEx); - - contexts.put( usc ) ; - - SystemException sysex = wrapper.unknownExceptionInDispatch( - CompletionStatus.COMPLETED_MAYBE, ex ) ; - request.getProtocolHandler() - .createSystemExceptionResponse(request, sysex, - contexts); - } catch (Throwable ex) { - if (orb.subcontractDebugFlag) { - dprint(".dispatch: " + opAndId(request) - + ": other exception " + ex); - } - request.getProtocolHandler() - .handleThrowableDuringServerDispatch( - request, ex, CompletionStatus.COMPLETED_MAYBE); - } - return; - } finally { - if (orb.subcontractDebugFlag) { - dprint(".dispatch<-: " + opAndId(request)); - } - } - } - - private void releaseServant(ObjectAdapter objectAdapter) - { - try { - if (orb.subcontractDebugFlag) { - dprint(".releaseServant->"); - } - - if (objectAdapter == null) { - if (orb.subcontractDebugFlag) { - dprint(".releaseServant: null object adapter"); - } - return ; - } - - try { - objectAdapter.returnServant(); - } finally { - objectAdapter.exit(); - orb.popInvocationInfo() ; - } - } finally { - if (orb.subcontractDebugFlag) { - dprint(".releaseServant<-"); - } - } - } - - // Note that objectAdapter.enter() must be called before getServant. - private java.lang.Object getServant(ObjectAdapter objectAdapter, byte[] objectId, - String operation) - throws OADestroyed - { - try { - if (orb.subcontractDebugFlag) { - dprint(".getServant->"); - } - - OAInvocationInfo info = objectAdapter.makeInvocationInfo(objectId); - info.setOperation(operation); - orb.pushInvocationInfo(info); - objectAdapter.getInvocationServant(info); - return info.getServantContainer() ; - } finally { - if (orb.subcontractDebugFlag) { - dprint(".getServant<-"); - } - } - } - - protected java.lang.Object getServantWithPI(CorbaMessageMediator request, - ObjectAdapter objectAdapter, - byte[] objectId, ObjectKeyTemplate oktemp, String operation) - throws OADestroyed - { - try { - if (orb.subcontractDebugFlag) { - dprint(".getServantWithPI->"); - } - - // Prepare Portable Interceptors for a new server request - // and invoke receive_request_service_contexts. The starting - // point may throw a SystemException or ForwardException. - orb.getPIHandler().initializeServerPIInfo(request, objectAdapter, - objectId, oktemp); - orb.getPIHandler().invokeServerPIStartingPoint(); - - objectAdapter.enter() ; - - // This must be set just after the enter so that exceptions thrown by - // enter do not cause - // the exception reply to pop the thread stack and do an extra oa.exit. - if (request != null) - request.setExecuteReturnServantInResponseConstructor(true); - - java.lang.Object servant = getServant(objectAdapter, objectId, - operation); - - // Note: we do not know the MDI on a null servant. - // We only end up in that situation if _non_existent called, - // so that the following handleNullServant call does not throw an - // exception. - String mdi = "unknown" ; - - if (servant instanceof NullServant) - handleNullServant(operation, (NullServant)servant); - else - mdi = objectAdapter.getInterfaces(servant, objectId)[0] ; - - orb.getPIHandler().setServerPIInfo(servant, mdi); - - if (((servant != null) && - !(servant instanceof org.omg.CORBA.DynamicImplementation) && - !(servant instanceof org.omg.PortableServer.DynamicImplementation)) || - (SpecialMethod.getSpecialMethod(operation) != null)) { - orb.getPIHandler().invokeServerPIIntermediatePoint(); - } - - return servant ; - } finally { - if (orb.subcontractDebugFlag) { - dprint(".getServantWithPI<-"); - } - } - } - - protected void checkServerId(ObjectKey okey) - { - try { - if (orb.subcontractDebugFlag) { - dprint(".checkServerId->"); - } - - ObjectKeyTemplate oktemp = okey.getTemplate() ; - int sId = oktemp.getServerId() ; - int scid = oktemp.getSubcontractId() ; - - if (!orb.isLocalServerId(scid, sId)) { - if (orb.subcontractDebugFlag) { - dprint(".checkServerId: bad server id"); - } - - orb.handleBadServerId(okey); - } - } finally { - if (orb.subcontractDebugFlag) { - dprint(".checkServerId<-"); - } - } - } - - private ObjectAdapter findObjectAdapter(ObjectKeyTemplate oktemp) - { - try { - if (orb.subcontractDebugFlag) { - dprint(".findObjectAdapter->"); - } - - RequestDispatcherRegistry scr = orb.getRequestDispatcherRegistry() ; - int scid = oktemp.getSubcontractId() ; - ObjectAdapterFactory oaf = scr.getObjectAdapterFactory(scid); - if (oaf == null) { - if (orb.subcontractDebugFlag) { - dprint(".findObjectAdapter: failed to find ObjectAdapterFactory"); - } - - throw wrapper.noObjectAdapterFactory() ; - } - - ObjectAdapterId oaid = oktemp.getObjectAdapterId() ; - ObjectAdapter oa = oaf.find(oaid); - - if (oa == null) { - if (orb.subcontractDebugFlag) { - dprint(".findObjectAdapter: failed to find ObjectAdaptor"); - } - - throw wrapper.badAdapterId() ; - } - - return oa ; - } finally { - if (orb.subcontractDebugFlag) { - dprint(".findObjectAdapter<-"); - } - } - } - - /** Always throws OBJECT_NOT_EXIST if operation is not a special method. - * If operation is _non_existent or _not_existent, this will just - * return without performing any action, so that _non_existent can return - * false. Always throws OBJECT_NOT_EXIST for any other special method. - * Update for issue 4385. - */ - protected void handleNullServant(String operation, NullServant nserv ) - { - try { - if (orb.subcontractDebugFlag) { - dprint(".handleNullServant->: " + operation); - } - - SpecialMethod specialMethod = - SpecialMethod.getSpecialMethod(operation); - - if ((specialMethod == null) || - !specialMethod.isNonExistentMethod()) { - if (orb.subcontractDebugFlag) { - dprint(".handleNullServant: " + operation - + ": throwing OBJECT_NOT_EXIST"); - } - - throw nserv.getException() ; - } - } finally { - if (orb.subcontractDebugFlag) { - dprint(".handleNullServant<-: " + operation); - } - } - } - - protected void consumeServiceContexts(CorbaMessageMediator request) - { - try { - if (orb.subcontractDebugFlag) { - dprint(".consumeServiceContexts->: " - + opAndId(request)); - } - - ServiceContexts ctxts = request.getRequestServiceContexts(); - ServiceContext sc ; - - GIOPVersion giopVersion = request.getGIOPVersion(); - - // we cannot depend on this since for our local case, we do not send - // in this service context. Can we rely on just the CodeSetServiceContext? - // boolean rtSC = false; // Runtime ServiceContext - - boolean hasCodeSetContext = processCodeSetContext(request, ctxts); - - if (orb.subcontractDebugFlag) { - dprint(".consumeServiceContexts: " + opAndId(request) - + ": GIOP version: " + giopVersion); - dprint(".consumeServiceContexts: " + opAndId(request) - + ": as code set context? " + hasCodeSetContext); - } - - sc = ctxts.get( - SendingContextServiceContext.SERVICE_CONTEXT_ID ) ; - - if (sc != null) { - SendingContextServiceContext scsc = - (SendingContextServiceContext)sc ; - IOR ior = scsc.getIOR() ; - - try { - ((CorbaConnection)request.getConnection()) - .setCodeBaseIOR(ior); - } catch (ThreadDeath td) { - throw td ; - } catch (Throwable t) { - throw wrapper.badStringifiedIor( t ) ; - } - } - - // the RTSC is sent only once during session establishment. We - // need to find out if the CodeBaseRef is already set. If yes, - // then also the rtSC flag needs to be set to true - // this is not possible for the LocalCase since there is no - // IIOPConnection for the LocalCase - - // used for a case where we have JDK 1.3 supporting 1.0 protocol, - // but sending 2 service contexts, that is not normal as per - // GIOP rules, based on above information, we figure out that we - // are talking to the legacy ORB and set the ORB Version Accordingly. - - // this special case tell us that it is legacy SUN orb - // and not a foreign one - // rtSC is not available for localcase due to which this generic - // path would fail if relying on rtSC - //if (giopVersion.equals(GIOPVersion.V1_0) && hasCodeSetContext && rtSC) - boolean isForeignORB = false; - - if (giopVersion.equals(GIOPVersion.V1_0) && hasCodeSetContext) { - if (orb.subcontractDebugFlag) { - dprint(".consumeServiceCOntexts: " + opAndId(request) - + ": Determined to be an old Sun ORB"); - } - - orb.setORBVersion(ORBVersionFactory.getOLD()) ; - // System.out.println("setting legacy ORB version"); - } else { - // If it didn't include our ORB version service context (below), - // then it must be a foreign ORB. - isForeignORB = true; - } - - // try to get the ORBVersion sent as part of the ServiceContext - // if any - sc = ctxts.get( ORBVersionServiceContext.SERVICE_CONTEXT_ID ) ; - if (sc != null) { - ORBVersionServiceContext ovsc = - (ORBVersionServiceContext) sc; - - ORBVersion version = ovsc.getVersion(); - orb.setORBVersion(version); - - isForeignORB = false; - } - - if (isForeignORB) { - if (orb.subcontractDebugFlag) { - dprint(".consumeServiceContexts: " + opAndId(request) - + ": Determined to be a foreign ORB"); - } - - orb.setORBVersion(ORBVersionFactory.getFOREIGN()); - } - } finally { - if (orb.subcontractDebugFlag) { - dprint(".consumeServiceContexts<-: " + opAndId(request)); - } - } - } - - protected CorbaMessageMediator dispatchToServant( - java.lang.Object servant, - CorbaMessageMediator req, - byte[] objectId, ObjectAdapter objectAdapter) - { - try { - if (orb.subcontractDebugFlag) { - dprint(".dispatchToServant->: " + opAndId(req)); - } - - CorbaMessageMediator response = null ; - - String operation = req.getOperationName() ; - - SpecialMethod method = SpecialMethod.getSpecialMethod(operation) ; - if (method != null) { - if (orb.subcontractDebugFlag) { - dprint(".dispatchToServant: " + opAndId(req) - + ": Handling special method"); - } - - response = method.invoke(servant, req, objectId, objectAdapter); - return response ; - } - - // Invoke on the servant using the portable DSI skeleton - if (servant instanceof org.omg.CORBA.DynamicImplementation) { - if (orb.subcontractDebugFlag) { - dprint(".dispatchToServant: " + opAndId(req) - + ": Handling old style DSI type servant"); - } - - org.omg.CORBA.DynamicImplementation dynimpl = - (org.omg.CORBA.DynamicImplementation)servant; - ServerRequestImpl sreq = new ServerRequestImpl(req, orb); - - // Note: When/if dynimpl.invoke calls arguments() or - // set_exception() then intermediate points are run. - dynimpl.invoke(sreq); - - response = handleDynamicResult(sreq, req); - } else if (servant instanceof org.omg.PortableServer.DynamicImplementation) { - if (orb.subcontractDebugFlag) { - dprint(".dispatchToServant: " + opAndId(req) - + ": Handling POA DSI type servant"); - } - - org.omg.PortableServer.DynamicImplementation dynimpl = - (org.omg.PortableServer.DynamicImplementation)servant; - ServerRequestImpl sreq = new ServerRequestImpl(req, orb); - - // Note: When/if dynimpl.invoke calls arguments() or - // set_exception() then intermediate points are run. - dynimpl.invoke(sreq); - - response = handleDynamicResult(sreq, req); - } else { - if (orb.subcontractDebugFlag) { - dprint(".dispatchToServant: " + opAndId(req) - + ": Handling invoke handler type servant"); - } - - InvokeHandler invhandle = (InvokeHandler)servant ; - - OutputStream stream = - (OutputStream)invhandle._invoke( - operation, - (org.omg.CORBA.portable.InputStream)req.getInputObject(), - req); - response = (CorbaMessageMediator) - ((OutputObject)stream).getMessageMediator(); - } - - return response ; - } finally { - if (orb.subcontractDebugFlag) { - dprint(".dispatchToServant<-: " + opAndId(req)); - } - } - } - - protected CorbaMessageMediator handleDynamicResult( - ServerRequestImpl sreq, - CorbaMessageMediator req) - { - try { - if (orb.subcontractDebugFlag) { - dprint(".handleDynamicResult->: " + opAndId(req)); - } - - CorbaMessageMediator response = null ; - - // Check if ServerRequestImpl.result() has been called - Any excany = sreq.checkResultCalled(); - - if (excany == null) { // normal return - if (orb.subcontractDebugFlag) { - dprint(".handleDynamicResult: " + opAndId(req) - + ": handling normal result"); - } - - // Marshal out/inout/return parameters into the ReplyMessage - response = sendingReply(req); - OutputStream os = (OutputStream) response.getOutputObject(); - sreq.marshalReplyParams(os); - } else { - if (orb.subcontractDebugFlag) { - dprint(".handleDynamicResult: " + opAndId(req) - + ": handling error"); - } - - response = sendingReply(req, excany); - } - - return response ; - } finally { - if (orb.subcontractDebugFlag) { - dprint(".handleDynamicResult<-: " + opAndId(req)); - } - } - } - - protected CorbaMessageMediator sendingReply(CorbaMessageMediator req) - { - try { - if (orb.subcontractDebugFlag) { - dprint(".sendingReply->: " + opAndId(req)); - } - - ServiceContexts scs = new ServiceContexts(orb); - return req.getProtocolHandler().createResponse(req, scs); - } finally { - if (orb.subcontractDebugFlag) { - dprint(".sendingReply<-: " + opAndId(req)); - } - } - } - - /** Must always be called, just after the servant's method returns. - * Creates the ReplyMessage header and puts in the transaction context - * if necessary. - */ - protected CorbaMessageMediator sendingReply(CorbaMessageMediator req, Any excany) - { - try { - if (orb.subcontractDebugFlag) { - dprint(".sendingReply/Any->: " + opAndId(req)); - } - - ServiceContexts scs = new ServiceContexts(orb); - - // Check if the servant set a SystemException or - // UserException - CorbaMessageMediator resp; - String repId=null; - try { - repId = excany.type().id(); - } catch (org.omg.CORBA.TypeCodePackage.BadKind e) { - throw wrapper.problemWithExceptionTypecode( e ) ; - } - - if (ORBUtility.isSystemException(repId)) { - if (orb.subcontractDebugFlag) { - dprint(".sendingReply/Any: " + opAndId(req) - + ": handling system exception"); - } - - // Get the exception object from the Any - InputStream in = excany.create_input_stream(); - SystemException ex = ORBUtility.readSystemException(in); - // Marshal the exception back - resp = req.getProtocolHandler() - .createSystemExceptionResponse(req, ex, scs); - } else { - if (orb.subcontractDebugFlag) { - dprint(".sendingReply/Any: " + opAndId(req) - + ": handling user exception"); - } - - resp = req.getProtocolHandler() - .createUserExceptionResponse(req, scs); - OutputStream os = (OutputStream)resp.getOutputObject(); - excany.write_value(os); - } - - return resp; - } finally { - if (orb.subcontractDebugFlag) { - dprint(".sendingReply/Any<-: " + opAndId(req)); - } - } - } - - /** - * Handles setting the connection's code sets if required. - * Returns true if the CodeSetContext was in the request, false - * otherwise. - */ - protected boolean processCodeSetContext( - CorbaMessageMediator request, ServiceContexts contexts) - { - try { - if (orb.subcontractDebugFlag) { - dprint(".processCodeSetContext->: " + opAndId(request)); - } - - ServiceContext sc = contexts.get( - CodeSetServiceContext.SERVICE_CONTEXT_ID); - if (sc != null) { - // Somehow a code set service context showed up in the local case. - if (request.getConnection() == null) { - return true; - } - - // If it's GIOP 1.0, it shouldn't have this context at all. Our legacy - // ORBs sent it and we need to know if it's here to make ORB versioning - // decisions, but we don't use the contents. - if (request.getGIOPVersion().equals(GIOPVersion.V1_0)) { - return true; - } - - CodeSetServiceContext cssc = (CodeSetServiceContext)sc ; - CodeSetComponentInfo.CodeSetContext csctx = cssc.getCodeSetContext(); - - // Note on threading: - // - // getCodeSetContext and setCodeSetContext are synchronized - // on the Connection. At worst, this will result in - // multiple threads entering this block and calling - // setCodeSetContext but not actually changing the - // values on the Connection. - // - // Alternative would be to lock the connection for the - // whole block, but it's fine either way. - - // The connection's codeSetContext is null until we've received a - // request with a code set context with the negotiated code sets. - if (((CorbaConnection)request.getConnection()) - .getCodeSetContext() == null) - { - - // Use these code sets on this connection - if (orb.subcontractDebugFlag) { - dprint(".processCodeSetContext: " + opAndId(request) - + ": Setting code sets to: " + csctx); - } - - ((CorbaConnection)request.getConnection()) - .setCodeSetContext(csctx); - - // We had to read the method name using ISO 8859-1 - // (which is the default in the CDRInputStream for - // char data), but now we may have a new char - // code set. If it isn't ISO8859-1, we must tell - // the CDR stream to null any converter references - // it has created so that it will reacquire - // the code sets again using the new info. - // - // This should probably compare with the stream's - // char code set rather than assuming it's ISO8859-1. - // (However, the operation name is almost certainly - // ISO8859-1 or ASCII.) - if (csctx.getCharCodeSet() != - OSFCodeSetRegistry.ISO_8859_1.getNumber()) { - ((MarshalInputStream)request.getInputObject()) - .resetCodeSetConverters(); - } - } - } - - // If no code set information is ever sent from the client, - // the server will use ISO8859-1 for char and throw an - // exception for any wchar transmissions. - // - // In the local case, we use ORB provided streams for - // marshaling and unmarshaling. Currently, they use - // ISO8859-1 for char/string and UTF16 for wchar/wstring. - return sc != null ; - } finally { - if (orb.subcontractDebugFlag) { - dprint(".processCodeSetContext<-: " + opAndId(request)); - } - } - } - - protected void dprint(String msg) - { - ORBUtility.dprint("CorbaServerRequestDispatcherImpl", msg); - } - - protected String opAndId(CorbaMessageMediator mediator) - { - return ORBUtility.operationNameAndRequestId(mediator); - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/FullServantCacheLocalCRDImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/FullServantCacheLocalCRDImpl.java deleted file mode 100644 index 0b5e876f06c..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/FullServantCacheLocalCRDImpl.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package com.sun.corba.se.impl.protocol; - -import org.omg.CORBA.portable.ServantObject ; - -import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcherFactory ; -import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcher ; - -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.spi.oa.OAInvocationInfo ; -import com.sun.corba.se.spi.oa.OADestroyed ; - -import com.sun.corba.se.spi.ior.IOR; - -import com.sun.corba.se.spi.logging.CORBALogDomains; - -import com.sun.corba.se.impl.logging.POASystemException ; - -public class FullServantCacheLocalCRDImpl extends ServantCacheLocalCRDBase -{ - public FullServantCacheLocalCRDImpl( ORB orb, int scid, IOR ior ) - { - super( (com.sun.corba.se.spi.orb.ORB)orb, scid, ior ) ; - } - - public ServantObject servant_preinvoke( org.omg.CORBA.Object self, - String operation, Class expectedType ) - { - OAInvocationInfo cachedInfo = getCachedInfo() ; - if (!checkForCompatibleServant( cachedInfo, expectedType )) - return null ; - - // Note that info is shared across multiple threads - // using the same subcontract, each of which may - // have its own operation. Therefore we need to clone it. - OAInvocationInfo info = new OAInvocationInfo( cachedInfo, operation ) ; - orb.pushInvocationInfo( info ) ; - - try { - info.oa().enter() ; - } catch (OADestroyed pdes) { - throw wrapper.preinvokePoaDestroyed( pdes ) ; - } - - return info ; - } - - public void servant_postinvoke(org.omg.CORBA.Object self, - ServantObject servantobj) - { - OAInvocationInfo cachedInfo = getCachedInfo() ; - cachedInfo.oa().exit() ; - orb.popInvocationInfo() ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/INSServerRequestDispatcher.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/INSServerRequestDispatcher.java deleted file mode 100644 index 9e66f6b8be7..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/INSServerRequestDispatcher.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.protocol; - -import com.sun.corba.se.pept.protocol.MessageMediator; - -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.ObjectKey; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher; -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; - -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.logging.ORBUtilSystemException; - -/** - * INSServerRequestDispatcher handles all INS related discovery request. The INS Service - * can be registered using ORB.register_initial_reference(). - * This Singleton subcontract just - * finds the target IOR and does location forward. - * XXX PI points are not invoked in either dispatch() or locate() method this - * should be fixed in Tiger. - */ -public class INSServerRequestDispatcher - implements CorbaServerRequestDispatcher -{ - - private ORB orb = null; - private ORBUtilSystemException wrapper ; - - public INSServerRequestDispatcher( ORB orb ) { - this.orb = orb; - this.wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - } - - // Need to signal one of OBJECT_HERE, OBJECT_FORWARD, OBJECT_NOT_EXIST. - public IOR locate(ObjectKey okey) { - // send a locate forward with the right IOR. If the insKey is not - // registered then it will throw OBJECT_NOT_EXIST Exception - String insKey = new String( okey.getBytes(orb) ); - return getINSReference( insKey ); - } - - public void dispatch(MessageMediator mediator) - { - CorbaMessageMediator request = (CorbaMessageMediator) mediator; - // send a locate forward with the right IOR. If the insKey is not - // registered then it will throw OBJECT_NOT_EXIST Exception - String insKey = new String( request.getObjectKey().getBytes(orb) ); - request.getProtocolHandler() - .createLocationForward(request, getINSReference( insKey ), null); - return; - } - - /** - * getINSReference if it is registered in INSObjectKeyMap. - */ - private IOR getINSReference( String insKey ) { - IOR entry = ORBUtility.getIOR( orb.getLocalResolver().resolve( insKey ) ) ; - if( entry != null ) { - // If entry is not null then the locate is with an INS Object key, - // so send a location forward with the right IOR. - return entry; - } - - throw wrapper.servantNotFound() ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/InfoOnlyServantCacheLocalCRDImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/InfoOnlyServantCacheLocalCRDImpl.java deleted file mode 100644 index d82ac0c3942..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/InfoOnlyServantCacheLocalCRDImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package com.sun.corba.se.impl.protocol; - -import org.omg.CORBA.portable.ServantObject ; - -import com.sun.corba.se.spi.oa.OAInvocationInfo ; - -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcherFactory ; -import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcher ; - -import com.sun.corba.se.spi.ior.IOR; - -public class InfoOnlyServantCacheLocalCRDImpl extends ServantCacheLocalCRDBase -{ - public InfoOnlyServantCacheLocalCRDImpl( ORB orb, int scid, IOR ior ) - { - super( (com.sun.corba.se.spi.orb.ORB)orb, scid, ior ) ; - } - - public ServantObject servant_preinvoke( org.omg.CORBA.Object self, - String operation, Class expectedType ) - { - OAInvocationInfo cachedInfo = getCachedInfo() ; - if (!checkForCompatibleServant( cachedInfo, expectedType )) - return null ; - - // Note that info is shared across multiple threads - // using the same subcontract, each of which may - // have its own operation. Therefore we need to copy it. - OAInvocationInfo info = new OAInvocationInfo(cachedInfo, operation) ; - orb.pushInvocationInfo( info ) ; - - return info ; - } - - public void servant_postinvoke(org.omg.CORBA.Object self, - ServantObject servantobj) - { - orb.popInvocationInfo() ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/JIDLLocalCRDImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/JIDLLocalCRDImpl.java deleted file mode 100644 index 7109b4eb5dc..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/JIDLLocalCRDImpl.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol; - -import javax.rmi.CORBA.Tie; - -import org.omg.CORBA.portable.ServantObject; - -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcherFactory ; -import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcher ; - -import com.sun.corba.se.spi.ior.IOR ; - -import com.sun.corba.se.impl.protocol.LocalClientRequestDispatcherBase ; - -import com.sun.corba.se.pept.broker.Broker; - -public class JIDLLocalCRDImpl extends LocalClientRequestDispatcherBase -{ - public JIDLLocalCRDImpl( ORB orb, int scid, IOR ior ) - { - super( (com.sun.corba.se.spi.orb.ORB)orb, scid, ior ) ; - } - - protected ServantObject servant; - - public ServantObject servant_preinvoke(org.omg.CORBA.Object self, - String operation, - Class expectedType) - { - if (!checkForCompatibleServant( servant, expectedType )) - return null ; - - return servant; - } - - public void servant_postinvoke( org.omg.CORBA.Object self, - ServantObject servant ) - { - // NO-OP - } - - // REVISIT - This is called from TOAImpl. - public void setServant( java.lang.Object servant ) - { - if (servant != null && servant instanceof Tie) { - this.servant = new ServantObject(); - this.servant.servant = ((Tie)servant).getTarget(); - } else { - this.servant = null; - } - } - - public void unexport() { - // DO NOT set the IOR to null. (Un)exporting is only concerns - // the servant not the IOR. If the ior is set to null then - // null pointer exceptions happen during an colocated invocation. - // It is better to let the invocation proceed and get OBJECT_NOT_EXIST - // from the server side. - //ior = null; - servant = null; - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/LocalClientRequestDispatcherBase.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/LocalClientRequestDispatcherBase.java deleted file mode 100644 index 627ca7abd89..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/LocalClientRequestDispatcherBase.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol; - -import org.omg.CORBA.portable.ServantObject; - -import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcher; -import com.sun.corba.se.spi.protocol.RequestDispatcherRegistry; - -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.ior.IOR ; -import com.sun.corba.se.spi.oa.ObjectAdapterFactory; - -import com.sun.corba.se.spi.ior.ObjectAdapterId; -import com.sun.corba.se.spi.ior.TaggedProfile; -import com.sun.corba.se.spi.ior.ObjectKeyTemplate; -import com.sun.corba.se.spi.ior.ObjectId; - -public abstract class LocalClientRequestDispatcherBase implements LocalClientRequestDispatcher -{ - protected ORB orb; - int scid; - - // Cached information needed for local dispatch - protected boolean servantIsLocal ; - protected ObjectAdapterFactory oaf ; - protected ObjectAdapterId oaid ; - protected byte[] objectId ; - - // If isNextIsLocalValid.get() == Boolean.TRUE, - // the next call to isLocal should be valid - private static final ThreadLocal isNextCallValid = new ThreadLocal() { - protected synchronized Object initialValue() { - return Boolean.TRUE; - } - }; - - protected LocalClientRequestDispatcherBase(ORB orb, int scid, IOR ior) - { - this.orb = orb ; - - TaggedProfile prof = ior.getProfile() ; - servantIsLocal = orb.getORBData().isLocalOptimizationAllowed() && - prof.isLocal(); - - ObjectKeyTemplate oktemp = prof.getObjectKeyTemplate() ; - this.scid = oktemp.getSubcontractId() ; - RequestDispatcherRegistry sreg = orb.getRequestDispatcherRegistry() ; - oaf = sreg.getObjectAdapterFactory( scid ) ; - oaid = oktemp.getObjectAdapterId() ; - ObjectId oid = prof.getObjectId() ; - objectId = oid.getId() ; - } - - public byte[] getObjectId() - { - return objectId ; - } - - public boolean is_local(org.omg.CORBA.Object self) - { - return false; - } - - /* - * Possible paths through - * useLocalInvocation/servant_preinvoke/servant_postinvoke: - * - * A: call useLocalInvocation - * If useLocalInvocation returns false, servant_preinvoke is not called. - * If useLocalInvocation returns true, - * call servant_preinvoke - * If servant_preinvoke returns null, - * goto A - * else - * (local invocation proceeds normally) - * servant_postinvoke is called - * - */ - public boolean useLocalInvocation( org.omg.CORBA.Object self ) - { - if (isNextCallValid.get() == Boolean.TRUE) - return servantIsLocal ; - else - isNextCallValid.set( Boolean.TRUE ) ; - - return false ; - } - - /** Check that the servant in info (which must not be null) is - * an instance of the expectedType. If not, set the thread local flag - * and return false. - */ - protected boolean checkForCompatibleServant( ServantObject so, - Class expectedType ) - { - if (so == null) - return false ; - - // Normally, this test will never fail. However, if the servant - // and the stub were loaded in different class loaders, this test - // will fail. - if (!expectedType.isInstance( so.servant )) { - isNextCallValid.set( Boolean.FALSE ) ; - - // When servant_preinvoke returns null, the stub will - // recursively re-invoke itself. Thus, the next call made from - // the stub is another useLocalInvocation call. - return false ; - } - - return true ; - } - -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/MinimalServantCacheLocalCRDImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/MinimalServantCacheLocalCRDImpl.java deleted file mode 100644 index 2a28e0962fb..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/MinimalServantCacheLocalCRDImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package com.sun.corba.se.impl.protocol ; - -import org.omg.CORBA.portable.ServantObject ; - -import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcherFactory ; -import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcher ; - -import com.sun.corba.se.spi.ior.IOR ; - -import com.sun.corba.se.spi.oa.OAInvocationInfo ; - -import com.sun.corba.se.spi.orb.ORB ; - -public class MinimalServantCacheLocalCRDImpl extends ServantCacheLocalCRDBase -{ - public MinimalServantCacheLocalCRDImpl( ORB orb, int scid, IOR ior ) - { - super( (com.sun.corba.se.spi.orb.ORB)orb, scid, ior ) ; - } - - public ServantObject servant_preinvoke( org.omg.CORBA.Object self, - String operation, Class expectedType ) - { - OAInvocationInfo cachedInfo = getCachedInfo() ; - if (checkForCompatibleServant( cachedInfo, expectedType )) - return cachedInfo ; - else - return null ; - } - - public void servant_postinvoke(org.omg.CORBA.Object self, - ServantObject servantobj) - { - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/NotLocalLocalCRDImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/NotLocalLocalCRDImpl.java deleted file mode 100644 index 135121f65d2..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/NotLocalLocalCRDImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol; - -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.portable.ServantObject; - -import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcher ; - -/** - * @author Harold Carr - */ - -public class NotLocalLocalCRDImpl implements LocalClientRequestDispatcher -{ - public boolean useLocalInvocation(org.omg.CORBA.Object self) - { - return false; - } - - public boolean is_local(org.omg.CORBA.Object self) - { - return false; - } - - public ServantObject servant_preinvoke(org.omg.CORBA.Object self, - String operation, - Class expectedType) - { - // REVISIT: Rewrite rmic.HelloTest and rmic.LocalStubTest - // (which directly call servant_preinvoke) - // then revert to exception again. - return null; - //throw new INTERNAL(); - } - - public void servant_postinvoke(org.omg.CORBA.Object self, - ServantObject servant) - { - //throw new INTERNAL(); - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/POALocalCRDImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/POALocalCRDImpl.java deleted file mode 100644 index 18bb663f2b3..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/POALocalCRDImpl.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol; - -import org.omg.CORBA.SystemException; -import org.omg.CORBA.OBJ_ADAPTER ; -import org.omg.CORBA.UNKNOWN ; -import org.omg.CORBA.CompletionStatus ; - -import org.omg.CORBA.portable.ServantObject; - -import com.sun.corba.se.pept.protocol.ClientRequestDispatcher; - -import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcher; -import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcherFactory; -import com.sun.corba.se.spi.protocol.ForwardException ; - -import com.sun.corba.se.spi.oa.ObjectAdapter; -import com.sun.corba.se.spi.oa.OAInvocationInfo ; -import com.sun.corba.se.spi.oa.OADestroyed; - -import com.sun.corba.se.spi.orb.ORB; - -import com.sun.corba.se.spi.ior.IOR ; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; - -import com.sun.corba.se.impl.logging.POASystemException ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -public class POALocalCRDImpl extends LocalClientRequestDispatcherBase -{ - private ORBUtilSystemException wrapper ; - private POASystemException poaWrapper ; - - public POALocalCRDImpl( ORB orb, int scid, IOR ior) - { - super( (com.sun.corba.se.spi.orb.ORB)orb, scid, ior ); - wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - poaWrapper = POASystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - } - - private OAInvocationInfo servantEnter( ObjectAdapter oa ) throws OADestroyed - { - oa.enter() ; - - OAInvocationInfo info = oa.makeInvocationInfo( objectId ) ; - orb.pushInvocationInfo( info ) ; - - return info ; - } - - private void servantExit( ObjectAdapter oa ) - { - try { - oa.returnServant(); - } finally { - oa.exit() ; - orb.popInvocationInfo() ; - } - } - - // Look up the servant for this request and return it in a - // ServantObject. Note that servant_postinvoke is always called - // by the stub UNLESS this method returns null. However, in all - // cases we must be sure that ObjectAdapter.getServant and - // ObjectAdapter.returnServant calls are paired, as required for - // Portable Interceptors and Servant Locators in the POA. - // Thus, this method must call returnServant if it returns null. - public ServantObject servant_preinvoke(org.omg.CORBA.Object self, - String operation, - Class expectedType) - { - ObjectAdapter oa = oaf.find( oaid ) ; - OAInvocationInfo info = null ; - - try { - info = servantEnter( oa ) ; - info.setOperation( operation ) ; - } catch ( OADestroyed ex ) { - // Destroyed POAs can be recreated by normal adapter activation. - // So just reinvoke this method. - return servant_preinvoke(self, operation, expectedType); - } - - try { - try { - oa.getInvocationServant( info ); - if (!checkForCompatibleServant( info, expectedType )) - return null ; - } catch (Throwable thr) { - // Cleanup after this call, then throw to allow - // outer try to handle the exception appropriately. - servantExit( oa ) ; - throw thr ; - } - } catch ( ForwardException ex ) { - /* REVISIT - ClientRequestDispatcher csub = (ClientRequestDispatcher) - StubAdapter.getDelegate( ex.forward_reference ) ; - IOR ior = csub.getIOR() ; - setLocatedIOR( ior ) ; - */ - RuntimeException runexc = new RuntimeException("deal with this."); - runexc.initCause( ex ) ; - throw runexc ; - } catch ( ThreadDeath ex ) { - // ThreadDeath on the server side should not cause a client - // side thread death in the local case. We want to preserve - // this behavior for location transparency, so that a ThreadDeath - // has the same affect in either the local or remote case. - // The non-colocated case is handled in iiop.ORB.process, which - // throws the same exception. - throw wrapper.runtimeexception( ex ) ; - } catch ( Throwable t ) { - if (t instanceof SystemException) - throw (SystemException)t ; - - throw poaWrapper.localServantLookup( t ) ; - } - - if (!checkForCompatibleServant( info, expectedType )) { - servantExit( oa ) ; - return null ; - } - - return info; - } - - public void servant_postinvoke(org.omg.CORBA.Object self, - ServantObject servantobj) - { - ObjectAdapter oa = orb.peekInvocationInfo().oa() ; - servantExit( oa ) ; - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/RequestCanceledException.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/RequestCanceledException.java deleted file mode 100644 index f5920b19f94..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/RequestCanceledException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol; - -/** - * If this exception is caught explicitly, this need to be rethrown. - */ -public class RequestCanceledException extends RuntimeException { - - private int requestId = 0; - - public RequestCanceledException(int requestId) { - this.requestId = requestId; - } - - public int getRequestId() { - return this.requestId; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/RequestDispatcherRegistryImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/RequestDispatcherRegistryImpl.java deleted file mode 100644 index d264f21a10b..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/RequestDispatcherRegistryImpl.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol; - -import java.util.Set; -import java.util.HashSet; -import java.util.Map; -import java.util.HashMap; -import java.util.Collections; - -import com.sun.corba.se.pept.protocol.ClientRequestDispatcher ; - -import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcher ; -import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcherFactory ; -import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher ; -import com.sun.corba.se.spi.protocol.RequestDispatcherRegistry ; - -import com.sun.corba.se.spi.oa.ObjectAdapterFactory ; - -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.impl.orbutil.ORBConstants ; -import com.sun.corba.se.impl.orbutil.DenseIntMapImpl ; - -/** - * This is a registry of all subcontract ID dependent objects. This includes: - * LocalClientRequestDispatcherFactory, ClientRequestDispatcher, ServerSubcontract, and - * ObjectAdapterFactory. - */ -public class RequestDispatcherRegistryImpl implements RequestDispatcherRegistry { - private ORB orb; - - protected int defaultId; // The default subcontract ID to use if - // there is no more specific ID available. - // This happens when invoking a foreign IOR. - private DenseIntMapImpl SDRegistry ; // ServerRequestDispatcher registry - private DenseIntMapImpl CSRegistry ; // ClientRequestDispatcher registry - private DenseIntMapImpl OAFRegistry ; // ObjectAdapterFactory registry - private DenseIntMapImpl LCSFRegistry ; // LocalClientRequestDispatcherFactory registry - private Set objectAdapterFactories ; // Set of all ObjectAdapterFactory instances - private Set objectAdapterFactoriesView ; // Read-only view of oaf instances - private Map stringToServerSubcontract ; // Map from obect key string to - // ServerSubcontract - // for special bootstrap IORs - - public RequestDispatcherRegistryImpl(ORB orb, int defaultId ) - { - this.orb = orb; - this.defaultId = defaultId; - SDRegistry = new DenseIntMapImpl() ; - CSRegistry = new DenseIntMapImpl() ; - OAFRegistry = new DenseIntMapImpl() ; - LCSFRegistry = new DenseIntMapImpl() ; - objectAdapterFactories = new HashSet() ; - objectAdapterFactoriesView = Collections.unmodifiableSet( objectAdapterFactories ) ; - stringToServerSubcontract = new HashMap() ; - } - - public synchronized void registerClientRequestDispatcher( - ClientRequestDispatcher csc, int scid) - { - CSRegistry.set( scid, csc ) ; - } - - public synchronized void registerLocalClientRequestDispatcherFactory( - LocalClientRequestDispatcherFactory csc, int scid) - { - LCSFRegistry.set( scid, csc ) ; - } - - public synchronized void registerServerRequestDispatcher( - CorbaServerRequestDispatcher ssc, int scid) - { - SDRegistry.set( scid, ssc ) ; - } - - public synchronized void registerServerRequestDispatcher( - CorbaServerRequestDispatcher scc, String name ) - { - stringToServerSubcontract.put( name, scc ) ; - } - - public synchronized void registerObjectAdapterFactory( - ObjectAdapterFactory oaf, int scid) - { - objectAdapterFactories.add( oaf ) ; - OAFRegistry.set( scid, oaf ) ; - } - - // ************************************************** - // Methods to find the subcontract side subcontract - // ************************************************** - - // Note that both forms of getServerRequestDispatcher need to return - // the default server delegate if no other match is found. - // This is essential to proper handling of errors for - // malformed requests. In particular, a bad MAGIC will - // result in a lookup in the named key table (stringToServerSubcontract), - // which must return a valid ServerRequestDispatcher. A bad subcontract ID - // will similarly need to return the default ServerRequestDispatcher. - - public CorbaServerRequestDispatcher getServerRequestDispatcher(int scid) - { - CorbaServerRequestDispatcher sdel = - (CorbaServerRequestDispatcher)(SDRegistry.get(scid)) ; - if ( sdel == null ) - sdel = (CorbaServerRequestDispatcher)(SDRegistry.get(defaultId)) ; - - return sdel; - } - - public CorbaServerRequestDispatcher getServerRequestDispatcher( String name ) - { - CorbaServerRequestDispatcher sdel = - (CorbaServerRequestDispatcher)stringToServerSubcontract.get( name ) ; - - if ( sdel == null ) - sdel = (CorbaServerRequestDispatcher)(SDRegistry.get(defaultId)) ; - - return sdel; - } - - public LocalClientRequestDispatcherFactory getLocalClientRequestDispatcherFactory( - int scid ) - { - LocalClientRequestDispatcherFactory factory = - (LocalClientRequestDispatcherFactory)(LCSFRegistry.get(scid)) ; - if (factory == null) { - factory = (LocalClientRequestDispatcherFactory)(LCSFRegistry.get(defaultId)) ; - } - - return factory ; - } - - public ClientRequestDispatcher getClientRequestDispatcher( int scid ) - { - ClientRequestDispatcher subcontract = - (ClientRequestDispatcher)(CSRegistry.get(scid)) ; - if (subcontract == null) { - subcontract = (ClientRequestDispatcher)(CSRegistry.get(defaultId)) ; - } - - return subcontract ; - } - - public ObjectAdapterFactory getObjectAdapterFactory( int scid ) - { - ObjectAdapterFactory oaf = - (ObjectAdapterFactory)(OAFRegistry.get(scid)) ; - if ( oaf == null ) - oaf = (ObjectAdapterFactory)(OAFRegistry.get(defaultId)) ; - - return oaf; - } - - public Set getObjectAdapterFactories() - { - return objectAdapterFactoriesView ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/ServantCacheLocalCRDBase.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/ServantCacheLocalCRDBase.java deleted file mode 100644 index 76b935f7dd1..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/ServantCacheLocalCRDBase.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol; - -import org.omg.CORBA.BAD_OPERATION ; -import org.omg.CORBA.INTERNAL ; -import org.omg.CORBA.SystemException ; -import org.omg.CORBA.CompletionStatus ; - -import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcher; -import com.sun.corba.se.spi.protocol.ForwardException; - -// XXX This should be in the SPI -import com.sun.corba.se.impl.protocol.LocalClientRequestDispatcherBase; - -import com.sun.corba.se.spi.oa.OAInvocationInfo; -import com.sun.corba.se.spi.oa.ObjectAdapter; -import com.sun.corba.se.spi.oa.OADestroyed; - -import com.sun.corba.se.spi.orb.ORB; - -import com.sun.corba.se.spi.ior.IOR ; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; - -import com.sun.corba.se.impl.logging.POASystemException; - -public abstract class ServantCacheLocalCRDBase extends LocalClientRequestDispatcherBase -{ - - private OAInvocationInfo cachedInfo ; - protected POASystemException wrapper ; - - protected ServantCacheLocalCRDBase( ORB orb, int scid, IOR ior ) - { - super( orb, scid, ior ) ; - wrapper = POASystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - } - - protected synchronized OAInvocationInfo getCachedInfo() - { - if (!servantIsLocal) - throw wrapper.servantMustBeLocal() ; - - if (cachedInfo == null) { - ObjectAdapter oa = oaf.find( oaid ) ; - cachedInfo = oa.makeInvocationInfo( objectId ) ; - - // InvocationInfo must be pushed before calling getInvocationServant - orb.pushInvocationInfo( cachedInfo ) ; - - try { - oa.enter( ); - oa.getInvocationServant( cachedInfo ) ; - } catch (ForwardException freq) { - throw wrapper.illegalForwardRequest( freq ) ; - } catch( OADestroyed oades ) { - // This is an error since no user of this implementation - // should ever throw this exception - throw wrapper.adapterDestroyed( oades ) ; - } finally { - oa.returnServant( ); - oa.exit( ); - orb.popInvocationInfo() ; - } - } - - return cachedInfo ; - } -} - -// End of File diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/SharedCDRClientRequestDispatcherImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/SharedCDRClientRequestDispatcherImpl.java deleted file mode 100644 index 9f9a5f65e27..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/SharedCDRClientRequestDispatcherImpl.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.protocol; - -import java.io.IOException; -import java.util.Iterator; -import java.rmi.RemoteException; -import java.nio.ByteBuffer; -import java.security.AccessController; -import java.security.PrivilegedAction; -import javax.rmi.CORBA.Util; -import javax.rmi.CORBA.Tie; - -import org.omg.CORBA.COMM_FAILURE; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.SystemException; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.WrongTransaction; -import org.omg.CORBA.Request; -import org.omg.CORBA.NamedValue; -import org.omg.CORBA.NVList; -import org.omg.CORBA.Context; -import org.omg.CORBA.ContextList; -import org.omg.CORBA.ExceptionList; -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.DATA_CONVERSION; -import org.omg.CORBA.UNKNOWN; -import org.omg.CORBA.portable.RemarshalException; -import org.omg.CORBA_2_3.portable.InputStream; -import org.omg.CORBA_2_3.portable.OutputStream; -import org.omg.CORBA.portable.Delegate; -import org.omg.CORBA.portable.ServantObject; -import org.omg.CORBA.portable.ApplicationException; -import org.omg.CORBA.portable.UnknownException; -import org.omg.IOP.TAG_CODE_SETS; - -import com.sun.org.omg.SendingContext.CodeBase; - -import com.sun.corba.se.pept.broker.Broker; -import com.sun.corba.se.pept.encoding.InputObject; -import com.sun.corba.se.pept.encoding.OutputObject; -import com.sun.corba.se.pept.protocol.ClientRequestDispatcher; -import com.sun.corba.se.pept.protocol.MessageMediator; -import com.sun.corba.se.pept.transport.Connection; -import com.sun.corba.se.pept.transport.ConnectionCache; -import com.sun.corba.se.pept.transport.ContactInfo; - -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate; -import com.sun.corba.se.spi.ior.iiop.CodeSetsComponent; -import com.sun.corba.se.spi.oa.OAInvocationInfo; -import com.sun.corba.se.spi.oa.ObjectAdapterFactory; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.orb.ORBVersion; -import com.sun.corba.se.spi.orb.ORBVersionFactory; -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; -import com.sun.corba.se.spi.protocol.RequestDispatcherRegistry; -import com.sun.corba.se.spi.transport.CorbaContactInfo ; -import com.sun.corba.se.spi.transport.CorbaContactInfoList ; -import com.sun.corba.se.spi.transport.CorbaContactInfoListIterator ; -import com.sun.corba.se.spi.transport.CorbaConnection; - -import com.sun.corba.se.spi.servicecontext.ServiceContext; -import com.sun.corba.se.spi.servicecontext.ServiceContexts; -import com.sun.corba.se.spi.servicecontext.UEInfoServiceContext; -import com.sun.corba.se.spi.servicecontext.CodeSetServiceContext; -import com.sun.corba.se.spi.servicecontext.MaxStreamFormatVersionServiceContext; -import com.sun.corba.se.spi.servicecontext.SendingContextServiceContext; -import com.sun.corba.se.impl.encoding.ByteBufferWithInfo; -import com.sun.corba.se.impl.encoding.CDRInputObject; -import com.sun.corba.se.impl.encoding.CDROutputObject; -import com.sun.corba.se.impl.encoding.CDROutputStream; -import com.sun.corba.se.impl.encoding.CodeSetComponentInfo; -import com.sun.corba.se.impl.encoding.CodeSetConversion; -import com.sun.corba.se.impl.encoding.MarshalOutputStream; -import com.sun.corba.se.impl.encoding.MarshalInputStream; -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage; -import com.sun.corba.se.impl.protocol.giopmsgheaders.KeyAddr; -import com.sun.corba.se.impl.protocol.giopmsgheaders.ProfileAddr; -import com.sun.corba.se.impl.protocol.giopmsgheaders.ReferenceAddr; -import com.sun.corba.se.impl.transport.CorbaContactInfoListIteratorImpl; -import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; -import com.sun.corba.se.impl.util.JDKBridge; - -/** - * ClientDelegate is the RMI client-side subcontract or representation - * It implements RMI delegate as well as our internal ClientRequestDispatcher - * interface. - */ -public class SharedCDRClientRequestDispatcherImpl - extends - CorbaClientRequestDispatcherImpl -{ - // REVISIT: - // Rather than have separate CDR subcontract, - // use same CorbaClientRequestDispatcherImpl but have - // different MessageMediator finishSendingRequest and waitForResponse - // handle what is done below. - // Benefit: then in ContactInfo no need to do a direct new - // of subcontract - does not complicate subcontract registry. - - public InputObject marshalingComplete(java.lang.Object self, - OutputObject outputObject) - throws - ApplicationException, - org.omg.CORBA.portable.RemarshalException - { - ORB orb = null; - CorbaMessageMediator messageMediator = null; - try { - messageMediator = (CorbaMessageMediator) - outputObject.getMessageMediator(); - - orb = (ORB) messageMediator.getBroker(); - - if (orb.subcontractDebugFlag) { - dprint(".marshalingComplete->: " + opAndId(messageMediator)); - } - - CDROutputObject cdrOutputObject = (CDROutputObject) outputObject; - - // - // Create server-side input object. - // - - ByteBufferWithInfo bbwi = cdrOutputObject.getByteBufferWithInfo(); - cdrOutputObject.getMessageHeader().setSize(bbwi.byteBuffer, bbwi.getSize()); - final ORB inOrb = orb; - final ByteBuffer inBuffer = bbwi.byteBuffer; - final Message inMsg = cdrOutputObject.getMessageHeader(); - CDRInputObject cdrInputObject = AccessController - .doPrivileged(new PrivilegedAction() { - @Override - public CDRInputObject run() { - return new CDRInputObject(inOrb, null, inBuffer, - inMsg); - } - }); - messageMediator.setInputObject(cdrInputObject); - cdrInputObject.setMessageMediator(messageMediator); - - // - // Dispatch - // - - // REVISIT: Impl cast. - ((CorbaMessageMediatorImpl)messageMediator).handleRequestRequest( - messageMediator); - - // InputStream must be closed on the InputObject so that its - // ByteBuffer can be released to the ByteBufferPool. We must do - // this before we re-assign the cdrInputObject reference below. - try { cdrInputObject.close(); } - catch (IOException ex) { - // No need to do anything since we're done with the input stream - // and cdrInputObject will be re-assigned a new client-side input - // object, (i.e. won't result in a corba error). - - if (orb.transportDebugFlag) { - dprint(".marshalingComplete: ignoring IOException - " + ex.toString()); - } - } - - // - // Create client-side input object - // - - cdrOutputObject = (CDROutputObject) messageMediator.getOutputObject(); - bbwi = cdrOutputObject.getByteBufferWithInfo(); - cdrOutputObject.getMessageHeader().setSize(bbwi.byteBuffer, bbwi.getSize()); - final ORB inOrb2 = orb; - final ByteBuffer inBuffer2 = bbwi.byteBuffer; - final Message inMsg2 = cdrOutputObject.getMessageHeader(); - cdrInputObject = AccessController - .doPrivileged(new PrivilegedAction() { - @Override - public CDRInputObject run() { - return new CDRInputObject(inOrb2, null, inBuffer2, - inMsg2); - } - }); - messageMediator.setInputObject(cdrInputObject); - cdrInputObject.setMessageMediator(messageMediator); - - cdrInputObject.unmarshalHeader(); - - InputObject inputObject = cdrInputObject; - - return processResponse(orb, messageMediator, inputObject); - - } finally { - if (orb.subcontractDebugFlag) { - dprint(".marshalingComplete<-: " + opAndId(messageMediator)); - } - } - } - - protected void dprint(String msg) - { - ORBUtility.dprint("SharedCDRClientRequestDispatcherImpl", msg); - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/SpecialMethod.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/SpecialMethod.java deleted file mode 100644 index 262c6e07975..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/SpecialMethod.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol ; - -import javax.rmi.CORBA.Tie; - -import org.omg.CORBA.SystemException ; -import org.omg.CORBA.NO_IMPLEMENT ; -import org.omg.CORBA.OBJECT_NOT_EXIST ; -import org.omg.CORBA.CompletionStatus ; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; - -import com.sun.corba.se.spi.oa.ObjectAdapter; -import com.sun.corba.se.spi.orb.ORB; - -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; - -import com.sun.corba.se.spi.logging.CORBALogDomains; - -import com.sun.corba.se.impl.logging.ORBUtilSystemException; - -import com.sun.corba.se.spi.oa.NullServant ; - -public abstract class SpecialMethod { - public abstract boolean isNonExistentMethod() ; - public abstract String getName(); - public abstract CorbaMessageMediator invoke(java.lang.Object servant, - CorbaMessageMediator request, - byte[] objectId, - ObjectAdapter objectAdapter); - - public static final SpecialMethod getSpecialMethod(String operation) { - for(int i = 0; i < methods.length; i++) - if (methods[i].getName().equals(operation)) - return methods[i]; - return null; - } - - static SpecialMethod[] methods = { - new IsA(), - new GetInterface(), - new NonExistent(), - new NotExistent() - }; -} - -class NonExistent extends SpecialMethod { - public boolean isNonExistentMethod() - { - return true ; - } - - public String getName() { // _non_existent - return "_non_existent"; - } - - public CorbaMessageMediator invoke(java.lang.Object servant, - CorbaMessageMediator request, - byte[] objectId, - ObjectAdapter objectAdapter) - { - boolean result = (servant == null) || (servant instanceof NullServant) ; - CorbaMessageMediator response = - request.getProtocolHandler().createResponse(request, null); - ((OutputStream)response.getOutputObject()).write_boolean(result); - return response; - } -} - -class NotExistent extends NonExistent { - public String getName() { // _not_existent - return "_not_existent"; - } -} - -class IsA extends SpecialMethod { // _is_a - public boolean isNonExistentMethod() - { - return false ; - } - - public String getName() { - return "_is_a"; - } - public CorbaMessageMediator invoke(java.lang.Object servant, - CorbaMessageMediator request, - byte[] objectId, - ObjectAdapter objectAdapter) - { - if ((servant == null) || (servant instanceof NullServant)) { - ORB orb = (ORB)request.getBroker() ; - ORBUtilSystemException wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.OA_INVOCATION ) ; - - return request.getProtocolHandler().createSystemExceptionResponse( - request, wrapper.badSkeleton(), null); - } - - String[] ids = objectAdapter.getInterfaces( servant, objectId ); - String clientId = - ((InputStream)request.getInputObject()).read_string(); - boolean answer = false; - for(int i = 0; i < ids.length; i++) - if (ids[i].equals(clientId)) { - answer = true; - break; - } - - CorbaMessageMediator response = - request.getProtocolHandler().createResponse(request, null); - ((OutputStream)response.getOutputObject()).write_boolean(answer); - return response; - } -} - -class GetInterface extends SpecialMethod { // _get_interface - public boolean isNonExistentMethod() - { - return false ; - } - - public String getName() { - return "_interface"; - } - public CorbaMessageMediator invoke(java.lang.Object servant, - CorbaMessageMediator request, - byte[] objectId, - ObjectAdapter objectAdapter) - { - ORB orb = (ORB)request.getBroker() ; - ORBUtilSystemException wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.OA_INVOCATION ) ; - - if ((servant == null) || (servant instanceof NullServant)) { - return request.getProtocolHandler().createSystemExceptionResponse( - request, wrapper.badSkeleton(), null); - } else { - return request.getProtocolHandler().createSystemExceptionResponse( - request, wrapper.getinterfaceNotImplemented(), null); - } - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/AddressingDispositionHelper.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/AddressingDispositionHelper.java deleted file mode 100644 index 9d446fe79c5..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/AddressingDispositionHelper.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - - -/** -* com/sun/corba/se/impl/protocol/giopmsgheaders/AddressingDispositionHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ../../../../../../../src/share/classes/com/sun/corba/se/GiopIDL/g.idl -* Sunday, June 4, 2000 5:18:54 PM PDT -*/ - -abstract public class AddressingDispositionHelper -{ - private static String _id = "IDL:messages/AddressingDisposition:1.0"; - - public static void insert (org.omg.CORBA.Any a, short that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static short extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_short); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.corba.se.impl.protocol.giopmsgheaders.AddressingDispositionHelper.id (), "AddressingDisposition", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static short read (org.omg.CORBA.portable.InputStream istream) - { - short value = (short)0; - value = istream.read_short (); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, short value) - { - ostream.write_short (value); - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/CancelRequestMessage.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/CancelRequestMessage.java deleted file mode 100644 index b32b655af39..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/CancelRequestMessage.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -/** - * This interface captures the CancelRequestMessage contract. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public interface CancelRequestMessage extends Message { - int CANCEL_REQ_MSG_SIZE = 4; - int getRequestId(); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/CancelRequestMessage_1_0.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/CancelRequestMessage_1_0.java deleted file mode 100644 index 157281b7890..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/CancelRequestMessage_1_0.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; - -/** - * This implements the GIOP 1.0 CancelRequest header. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public final class CancelRequestMessage_1_0 extends Message_1_0 - implements CancelRequestMessage { - - // Instance variables - - private int request_id = (int) 0; - - // Constructors - - CancelRequestMessage_1_0() {} - - CancelRequestMessage_1_0(int _request_id) { - super(Message.GIOPBigMagic, false, Message.GIOPCancelRequest, - CANCEL_REQ_MSG_SIZE); - request_id = _request_id; - } - - // Accessor methods - - public int getRequestId() { - return this.request_id; - } - - // IO methods - - public void read(org.omg.CORBA.portable.InputStream istream) { - super.read(istream); - this.request_id = istream.read_ulong(); - } - - public void write(org.omg.CORBA.portable.OutputStream ostream) { - super.write(ostream); - ostream.write_ulong(this.request_id); - } - - public void callback(MessageHandler handler) - throws java.io.IOException - { - handler.handleInput(this); - } -} // class CancelRequestMessage_1_0 diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/CancelRequestMessage_1_1.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/CancelRequestMessage_1_1.java deleted file mode 100644 index d6e304bf560..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/CancelRequestMessage_1_1.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; - -/** - * This implements the GIOP 1.1 CancelRequest header. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public final class CancelRequestMessage_1_1 extends Message_1_1 - implements CancelRequestMessage { - - // Instance variables - - private int request_id = (int) 0; - - // Constructors - - CancelRequestMessage_1_1() {} - - CancelRequestMessage_1_1(int _request_id) { - super(Message.GIOPBigMagic, GIOPVersion.V1_1, FLAG_NO_FRAG_BIG_ENDIAN, - Message.GIOPCancelRequest, CANCEL_REQ_MSG_SIZE); - request_id = _request_id; - } - - // Accessor methods - - public int getRequestId() { - return this.request_id; - } - - // IO methods - - public void read(org.omg.CORBA.portable.InputStream istream) { - super.read(istream); - this.request_id = istream.read_ulong(); - } - - public void write(org.omg.CORBA.portable.OutputStream ostream) { - super.write(ostream); - ostream.write_ulong(this.request_id); - } - - public void callback(MessageHandler handler) - throws java.io.IOException - { - handler.handleInput(this); - } -} // class CancelRequestMessage_1_1 diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/CancelRequestMessage_1_2.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/CancelRequestMessage_1_2.java deleted file mode 100644 index 21da05aef91..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/CancelRequestMessage_1_2.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; - -/** - * This implements the GIOP 1.2 CancelRequest header. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public final class CancelRequestMessage_1_2 extends Message_1_1 - implements CancelRequestMessage { - - // Instance variables - - private int request_id = (int) 0; - - // Constructors - - CancelRequestMessage_1_2() {} - - CancelRequestMessage_1_2(int _request_id) { - super(Message.GIOPBigMagic, GIOPVersion.V1_2, FLAG_NO_FRAG_BIG_ENDIAN, - Message.GIOPCancelRequest, CANCEL_REQ_MSG_SIZE); - request_id = _request_id; - } - - // Accessor methods - - public int getRequestId() { - return this.request_id; - } - - // IO methods - - public void read(org.omg.CORBA.portable.InputStream istream) { - super.read(istream); - this.request_id = istream.read_ulong(); - } - - public void write(org.omg.CORBA.portable.OutputStream ostream) { - super.write(ostream); - ostream.write_ulong(this.request_id); - } - - public void callback(MessageHandler handler) - throws java.io.IOException - { - handler.handleInput(this); - } -} // class CancelRequestMessage_1_2 diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/FragmentMessage.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/FragmentMessage.java deleted file mode 100644 index 25fd38c351a..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/FragmentMessage.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -/** - * This interface captures the FragmentMessage contract. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public interface FragmentMessage extends Message { - int getRequestId(); - int getHeaderLength(); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/FragmentMessage_1_1.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/FragmentMessage_1_1.java deleted file mode 100644 index 652b6fd0d0f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/FragmentMessage_1_1.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -/** - * This implements the GIOP 1.1 Fragment header. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public final class FragmentMessage_1_1 extends Message_1_1 - implements FragmentMessage { - - // Constructors - - FragmentMessage_1_1() {} - - FragmentMessage_1_1(Message_1_1 msg11) { - this.magic = msg11.magic; - this.GIOP_version = msg11.GIOP_version; - this.flags = msg11.flags; - this.message_type = GIOPFragment; - this.message_size = 0; - } - - // Accessor methods - - public int getRequestId() { - return -1; // 1.1 has no fragment header and so no request_id - } - - public int getHeaderLength() { - return GIOPMessageHeaderLength; - } - - // IO methods - - /* This will never be called, since we do not currently read the - * request_id from an CDRInputStream. Instead we use the - * readGIOP_1_1_requestId to read the requestId from a byte buffer. - */ - public void read(org.omg.CORBA.portable.InputStream istream) { - super.read(istream); - } - - /* 1.1 has no request_id; so nothing to write */ - public void write(org.omg.CORBA.portable.OutputStream ostream) { - super.write(ostream); - } - - public void callback(MessageHandler handler) - throws java.io.IOException - { - handler.handleInput(this); - } -} // class FragmentMessage_1_1 diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/FragmentMessage_1_2.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/FragmentMessage_1_2.java deleted file mode 100644 index 63b7e7b7340..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/FragmentMessage_1_2.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; - -/** - * This implements the GIOP 1.2 Fragment header. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public final class FragmentMessage_1_2 extends Message_1_2 - implements FragmentMessage { - - // Constructors - - FragmentMessage_1_2() {} - - // This is currently never called. - FragmentMessage_1_2(int _request_id) { - super(Message.GIOPBigMagic, GIOPVersion.V1_2, FLAG_NO_FRAG_BIG_ENDIAN, - Message.GIOPFragment, 0); - this.message_type = GIOPFragment; - request_id = _request_id; - } - - FragmentMessage_1_2(Message_1_1 msg12) { - this.magic = msg12.magic; - this.GIOP_version = msg12.GIOP_version; - this.flags = msg12.flags; - this.message_type = GIOPFragment; - this.message_size = 0; - - switch (msg12.message_type) { - case GIOPRequest : - this.request_id = ((RequestMessage) msg12).getRequestId(); - break; - case GIOPReply : - this.request_id = ((ReplyMessage) msg12).getRequestId(); - break; - case GIOPLocateRequest : - this.request_id = ((LocateRequestMessage) msg12).getRequestId(); - break; - case GIOPLocateReply : - this.request_id = ((LocateReplyMessage) msg12).getRequestId(); - break; - case GIOPFragment : - this.request_id = ((FragmentMessage) msg12).getRequestId(); - break; - } - } - - // Accessor methods - - public int getRequestId() { - return this.request_id; - } - - public int getHeaderLength() { - return GIOPMessageHeaderLength + 4; - } - - // IO methods - - /* This will never be called, since we do not currently read the - * request_id from an CDRInputStream. Instead we use the - * readGIOP_1_2_requestId to read the requestId from a byte buffer. - */ - public void read(org.omg.CORBA.portable.InputStream istream) { - super.read(istream); - this.request_id = istream.read_ulong(); - } - - public void write(org.omg.CORBA.portable.OutputStream ostream) { - super.write(ostream); - ostream.write_ulong(this.request_id); - } - - public void callback(MessageHandler handler) - throws java.io.IOException - { - handler.handleInput(this); - } -} // class FragmentMessage_1_2 diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/IORAddressingInfo.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/IORAddressingInfo.java deleted file mode 100644 index 89805d82140..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/IORAddressingInfo.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - - -/** -* com/sun/corba/se/impl/protocol/giopmsgheaders/IORAddressingInfo.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ../../../../../../../src/share/classes/com/sun/corba/se/GiopIDL/g.idl -* Sunday, June 4, 2000 5:18:54 PM PDT -*/ - -public final class IORAddressingInfo implements org.omg.CORBA.portable.IDLEntity -{ - public int selected_profile_index = (int)0; - public org.omg.IOP.IOR ior = null; - - public IORAddressingInfo () - { - } // ctor - - public IORAddressingInfo (int _selected_profile_index, org.omg.IOP.IOR _ior) - { - selected_profile_index = _selected_profile_index; - ior = _ior; - } // ctor - -} // class IORAddressingInfo diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/IORAddressingInfoHelper.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/IORAddressingInfoHelper.java deleted file mode 100644 index 6499b433e88..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/IORAddressingInfoHelper.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - - -/** -* com/sun/corba/se/impl/protocol/giopmsgheaders/IORAddressingInfoHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ../../../../../../../src/share/classes/com/sun/corba/se/GiopIDL/g.idl -* Sunday, June 4, 2000 5:18:54 PM PDT -*/ - -abstract public class IORAddressingInfoHelper -{ - private static String _id = "IDL:messages/IORAddressingInfo:1.0"; - - public static void insert (org.omg.CORBA.Any a, com.sun.corba.se.impl.protocol.giopmsgheaders.IORAddressingInfo that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static com.sun.corba.se.impl.protocol.giopmsgheaders.IORAddressingInfo extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - private static boolean __active = false; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - synchronized (org.omg.CORBA.TypeCode.class) - { - if (__typeCode == null) - { - if (__active) - { - return org.omg.CORBA.ORB.init().create_recursive_tc ( _id ); - } - __active = true; - org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [2]; - org.omg.CORBA.TypeCode _tcOf_members0 = null; - _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ulong); - _members0[0] = new org.omg.CORBA.StructMember ( - "selected_profile_index", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.IOP.IORHelper.type (); - _members0[1] = new org.omg.CORBA.StructMember ( - "ior", - _tcOf_members0, - null); - __typeCode = org.omg.CORBA.ORB.init ().create_struct_tc (com.sun.corba.se.impl.protocol.giopmsgheaders.IORAddressingInfoHelper.id (), "IORAddressingInfo", _members0); - __active = false; - } - } - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static com.sun.corba.se.impl.protocol.giopmsgheaders.IORAddressingInfo read (org.omg.CORBA.portable.InputStream istream) - { - com.sun.corba.se.impl.protocol.giopmsgheaders.IORAddressingInfo value = new com.sun.corba.se.impl.protocol.giopmsgheaders.IORAddressingInfo (); - value.selected_profile_index = istream.read_ulong (); - value.ior = org.omg.IOP.IORHelper.read (istream); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.corba.se.impl.protocol.giopmsgheaders.IORAddressingInfo value) - { - ostream.write_ulong (value.selected_profile_index); - org.omg.IOP.IORHelper.write (ostream, value.ior); - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/KeyAddr.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/KeyAddr.java deleted file mode 100644 index c06a0aefac6..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/KeyAddr.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - - -/** -* com/sun/corba/se/impl/protocol/giopmsgheaders/KeyAddr.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ../../../../../../../src/share/classes/com/sun/corba/se/GiopIDL/g.idl -* Sunday, June 4, 2000 5:18:54 PM PDT -*/ - -public interface KeyAddr -{ - public static final short value = (short)(0); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateReplyMessage.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateReplyMessage.java deleted file mode 100644 index f87710c3504..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateReplyMessage.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import org.omg.CORBA.SystemException; -import com.sun.corba.se.spi.ior.IOR; - -/** - * This interface captures the LocateReplyMessage contract. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public interface LocateReplyMessage extends Message, LocateReplyOrReplyMessage { - - int UNKNOWN_OBJECT = 0; - int OBJECT_HERE = 1; - int OBJECT_FORWARD = 2; - int OBJECT_FORWARD_PERM = 3; // 1.2 - int LOC_SYSTEM_EXCEPTION = 4; // 1.2 - int LOC_NEEDS_ADDRESSING_MODE = 5; // 1.2 -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateReplyMessage_1_0.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateReplyMessage_1_0.java deleted file mode 100644 index 2427c79e3bb..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateReplyMessage_1_0.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.SystemException; - -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.IORFactories; - -import com.sun.corba.se.spi.orb.ORB; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; - -import com.sun.corba.se.impl.encoding.CDRInputStream; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -/** - * This implements the GIOP 1.0 LocateReply header. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public final class LocateReplyMessage_1_0 extends Message_1_0 - implements LocateReplyMessage { - - // Instance variables - - private ORB orb = null; - private int request_id = (int) 0; - private int locate_status = (int) 0; - private IOR ior = null; - - // Constructors - - LocateReplyMessage_1_0(ORB orb) { - this.orb = orb; - } - - LocateReplyMessage_1_0(ORB orb, int _request_id, - int _locate_status, IOR _ior) { - super(Message.GIOPBigMagic, false, Message.GIOPLocateReply, 0); - this.orb = orb; - request_id = _request_id; - locate_status = _locate_status; - ior = _ior; - } - - // Accessor methods - - public int getRequestId() { - return this.request_id; - } - - public int getReplyStatus() { - return this.locate_status; - } - - public short getAddrDisposition() { - return KeyAddr.value; - } - - public SystemException getSystemException(String message) { - return null; // 1.0 LocateReply body does not contain SystemException - } - - public IOR getIOR() { - return this.ior; - } - - // IO methods - - public void read(org.omg.CORBA.portable.InputStream istream) { - super.read(istream); - this.request_id = istream.read_ulong(); - this.locate_status = istream.read_long(); - isValidReplyStatus(this.locate_status); // raises exception on error - - // The code below reads the reply body if status is OBJECT_FORWARD - if (this.locate_status == OBJECT_FORWARD) { - CDRInputStream cdr = (CDRInputStream) istream; - this.ior = IORFactories.makeIOR( cdr ) ; - } - } - - // Note, this writes only the header information. - // IOR may be written afterwards into the reply mesg body. - public void write(org.omg.CORBA.portable.OutputStream ostream) { - super.write(ostream); - ostream.write_ulong(this.request_id); - ostream.write_long(this.locate_status); - } - - // Static methods - - public static void isValidReplyStatus(int replyStatus) { - switch (replyStatus) { - case UNKNOWN_OBJECT : - case OBJECT_HERE : - case OBJECT_FORWARD : - break; - default : - ORBUtilSystemException localWrapper = ORBUtilSystemException.get( - CORBALogDomains.RPC_PROTOCOL ) ; - throw localWrapper.illegalReplyStatus( CompletionStatus.COMPLETED_MAYBE); - } - } - - public void callback(MessageHandler handler) - throws java.io.IOException - { - handler.handleInput(this); - } -} // class LocateReplyMessage_1_0 diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateReplyMessage_1_1.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateReplyMessage_1_1.java deleted file mode 100644 index 08e6e05fadb..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateReplyMessage_1_1.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.SystemException; - -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.IORFactories; - -import com.sun.corba.se.spi.orb.ORB; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.impl.encoding.CDRInputStream; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -/** - * This implements the GIOP 1.1 LocateReply header. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public final class LocateReplyMessage_1_1 extends Message_1_1 - implements LocateReplyMessage { - - // Instance variables - - private ORB orb = null; - private int request_id = (int) 0; - private int reply_status = (int) 0; - private IOR ior = null; - - // Constructors - - LocateReplyMessage_1_1(ORB orb) { - this.orb = orb; - } - - LocateReplyMessage_1_1(ORB orb, int _request_id, - int _reply_status, IOR _ior) { - super(Message.GIOPBigMagic, GIOPVersion.V1_1, FLAG_NO_FRAG_BIG_ENDIAN, - Message.GIOPLocateReply, 0); - this.orb = orb; - request_id = _request_id; - reply_status = _reply_status; - ior = _ior; - } - - // Accessor methods - - public int getRequestId() { - return this.request_id; - } - - public int getReplyStatus() { - return this.reply_status; - } - - public short getAddrDisposition() { - return KeyAddr.value; - } - - public SystemException getSystemException(String message) { - return null; // 1.0 LocateReply body does not contain SystemException - } - - public IOR getIOR() { - return this.ior; - } - - // IO methods - - public void read(org.omg.CORBA.portable.InputStream istream) { - super.read(istream); - this.request_id = istream.read_ulong(); - this.reply_status = istream.read_long(); - isValidReplyStatus(this.reply_status); // raises exception on error - - // The code below reads the reply body if status is OBJECT_FORWARD - if (this.reply_status == OBJECT_FORWARD) { - CDRInputStream cdr = (CDRInputStream) istream; - this.ior = IORFactories.makeIOR( cdr ) ; - } - } - - // Note, this writes only the header information. SystemException or - // IOR may be written afterwards into the reply mesg body. - public void write(org.omg.CORBA.portable.OutputStream ostream) { - super.write(ostream); - ostream.write_ulong(this.request_id); - ostream.write_long(this.reply_status); - } - - // Static methods - - public static void isValidReplyStatus(int replyStatus) { - switch (replyStatus) { - case UNKNOWN_OBJECT : - case OBJECT_HERE : - case OBJECT_FORWARD : - break; - default : - ORBUtilSystemException localWrapper = ORBUtilSystemException.get( - CORBALogDomains.RPC_PROTOCOL ) ; - throw localWrapper.illegalReplyStatus( CompletionStatus.COMPLETED_MAYBE); - } - } - - public void callback(MessageHandler handler) - throws java.io.IOException - { - handler.handleInput(this); - } -} // class LocateReplyMessage_1_1 diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateReplyMessage_1_2.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateReplyMessage_1_2.java deleted file mode 100644 index 8274de69f84..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateReplyMessage_1_2.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.SystemException; -import org.omg.CORBA.CompletionStatus; - -import com.sun.corba.se.spi.orb.ORB; - -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.IORFactories; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; - -import com.sun.corba.se.impl.encoding.CDRInputStream; -import com.sun.corba.se.impl.encoding.CDROutputStream; - -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.orbutil.ORBConstants; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -/** - * This implements the GIOP 1.2 LocateReply header. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public final class LocateReplyMessage_1_2 extends Message_1_2 - implements LocateReplyMessage { - - // Instance variables - - private ORB orb = null; - private ORBUtilSystemException wrapper = null ; - private int reply_status = (int) 0; - private IOR ior = null; - private String exClassName = null; - private int minorCode = (int) 0; - private CompletionStatus completionStatus = null; - private short addrDisposition = KeyAddr.value; // default; - - // Constructors - - LocateReplyMessage_1_2(ORB orb) { - this.orb = orb; - this.wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - } - - LocateReplyMessage_1_2(ORB orb, int _request_id, - int _reply_status, IOR _ior) { - super(Message.GIOPBigMagic, GIOPVersion.V1_2, FLAG_NO_FRAG_BIG_ENDIAN, - Message.GIOPLocateReply, 0); - this.orb = orb; - this.wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - request_id = _request_id; - reply_status = _reply_status; - ior = _ior; - } - - // Accessor methods - - public int getRequestId() { - return this.request_id; - } - - public int getReplyStatus() { - return this.reply_status; - } - - public short getAddrDisposition() { - return this.addrDisposition; - } - - public SystemException getSystemException(String message) { - return MessageBase.getSystemException( - exClassName, minorCode, completionStatus, message, wrapper); - } - - public IOR getIOR() { - return this.ior; - } - - // IO methods - - public void read(org.omg.CORBA.portable.InputStream istream) { - super.read(istream); - this.request_id = istream.read_ulong(); - this.reply_status = istream.read_long(); - isValidReplyStatus(this.reply_status); // raises exception on error - - // GIOP 1.2 LocateReply message bodies are not aligned on - // 8 byte boundaries. - - // The code below reads the reply body in some cases - // LOC_SYSTEM_EXCEPTION & OBJECT_FORWARD & OBJECT_FORWARD_PERM & - // LOC_NEEDS_ADDRESSING_MODE - if (this.reply_status == LOC_SYSTEM_EXCEPTION) { - - String reposId = istream.read_string(); - this.exClassName = ORBUtility.classNameOf(reposId); - this.minorCode = istream.read_long(); - int status = istream.read_long(); - - switch (status) { - case CompletionStatus._COMPLETED_YES: - this.completionStatus = CompletionStatus.COMPLETED_YES; - break; - case CompletionStatus._COMPLETED_NO: - this.completionStatus = CompletionStatus.COMPLETED_NO; - break; - case CompletionStatus._COMPLETED_MAYBE: - this.completionStatus = CompletionStatus.COMPLETED_MAYBE; - break; - default: - throw wrapper.badCompletionStatusInLocateReply( - CompletionStatus.COMPLETED_MAYBE, new Integer(status) ); - } - } else if ( (this.reply_status == OBJECT_FORWARD) || - (this.reply_status == OBJECT_FORWARD_PERM) ){ - CDRInputStream cdr = (CDRInputStream) istream; - this.ior = IORFactories.makeIOR( cdr ) ; - } else if (this.reply_status == LOC_NEEDS_ADDRESSING_MODE) { - // read GIOP::AddressingDisposition from body and resend the - // original request using the requested addressing mode. The - // resending is transparent to the caller. - this.addrDisposition = AddressingDispositionHelper.read(istream); - } - } - - // Note, this writes only the header information. SystemException or - // IOR or GIOP::AddressingDisposition may be written afterwards into the - // reply mesg body. - public void write(org.omg.CORBA.portable.OutputStream ostream) { - super.write(ostream); - ostream.write_ulong(this.request_id); - ostream.write_long(this.reply_status); - - - // GIOP 1.2 LocateReply message bodies are not aligned on - // 8 byte boundaries. - } - - // Static methods - - public static void isValidReplyStatus(int replyStatus) { - switch (replyStatus) { - case UNKNOWN_OBJECT : - case OBJECT_HERE : - case OBJECT_FORWARD : - case OBJECT_FORWARD_PERM : - case LOC_SYSTEM_EXCEPTION : - case LOC_NEEDS_ADDRESSING_MODE : - break; - default : - ORBUtilSystemException localWrapper = ORBUtilSystemException.get( - CORBALogDomains.RPC_PROTOCOL ) ; - throw localWrapper.illegalReplyStatus( CompletionStatus.COMPLETED_MAYBE); - } - } - - public void callback(MessageHandler handler) - throws java.io.IOException - { - handler.handleInput(this); - } -} // class LocateReplyMessage_1_2 diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateReplyOrReplyMessage.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateReplyOrReplyMessage.java deleted file mode 100644 index 8a66b5954e7..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateReplyOrReplyMessage.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import org.omg.CORBA.SystemException; -import com.sun.corba.se.spi.ior.IOR; - -public interface LocateReplyOrReplyMessage extends Message { - - int getRequestId(); - int getReplyStatus(); - SystemException getSystemException(String message); - IOR getIOR(); - short getAddrDisposition(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateRequestMessage.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateRequestMessage.java deleted file mode 100644 index 585cdda8b62..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateRequestMessage.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import com.sun.corba.se.spi.ior.ObjectKey; - -/** - * This interface captures the LocateRequestMessage contract. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public interface LocateRequestMessage extends Message { - int getRequestId(); - ObjectKey getObjectKey(); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateRequestMessage_1_0.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateRequestMessage_1_0.java deleted file mode 100644 index 39cd1d85690..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateRequestMessage_1_0.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.orb.ORB; - -import com.sun.corba.se.spi.ior.ObjectKey; - -/** - * This implements the GIOP 1.0 LocateRequest header. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public final class LocateRequestMessage_1_0 extends Message_1_0 - implements LocateRequestMessage { - - // Instance variables - - private ORB orb = null; - private int request_id = (int) 0; - private byte[] object_key = null; - private ObjectKey objectKey = null; - - // Constructor - - LocateRequestMessage_1_0(ORB orb) { - this.orb = orb; - } - - LocateRequestMessage_1_0(ORB orb, int _request_id, byte[] _object_key) { - super(Message.GIOPBigMagic, false, Message.GIOPLocateRequest, 0); - this.orb = orb; - request_id = _request_id; - object_key = _object_key; - } - - // Accessor methods (LocateRequestMessage interface) - - public int getRequestId() { - return this.request_id; - } - - public ObjectKey getObjectKey() { - if (this.objectKey == null) { - // this will raise a MARSHAL exception upon errors. - this.objectKey = MessageBase.extractObjectKey(object_key, orb); - } - - return this.objectKey; - } - - // IO methods - - public void read(org.omg.CORBA.portable.InputStream istream) { - super.read(istream);; - this.request_id = istream.read_ulong(); - int _len0 = istream.read_long(); - this.object_key = new byte[_len0]; - istream.read_octet_array (this.object_key, 0, _len0); - } - - public void write(org.omg.CORBA.portable.OutputStream ostream) { - super.write(ostream); - ostream.write_ulong(this.request_id); - nullCheck(this.object_key); - ostream.write_long(this.object_key.length); - ostream.write_octet_array(this.object_key, 0, this.object_key.length); - } - - public void callback(MessageHandler handler) - throws java.io.IOException - { - handler.handleInput(this); - } -} // class LocateRequestMessage_1_0 diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateRequestMessage_1_1.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateRequestMessage_1_1.java deleted file mode 100644 index 0a9b20a0b3c..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateRequestMessage_1_1.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; - -import com.sun.corba.se.spi.orb.ORB; - -import com.sun.corba.se.spi.ior.ObjectKey; - -/** - * This implements the GIOP 1.1 LocateRequest header. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public final class LocateRequestMessage_1_1 extends Message_1_1 - implements LocateRequestMessage { - - // Instance variables - - private ORB orb = null; - private int request_id = (int) 0; - private byte[] object_key = null; - private ObjectKey objectKey = null; - - // Constructors - - LocateRequestMessage_1_1(ORB orb) { - this.orb = orb; - } - - LocateRequestMessage_1_1(ORB orb, int _request_id, byte[] _object_key) { - super(Message.GIOPBigMagic, GIOPVersion.V1_1, FLAG_NO_FRAG_BIG_ENDIAN, - Message.GIOPLocateRequest, 0); - this.orb = orb; - request_id = _request_id; - object_key = _object_key; - } - - // Accessor methods (LocateRequestMessage interface) - - public int getRequestId() { - return this.request_id; - } - - public ObjectKey getObjectKey() { - if (this.objectKey == null) { - // this will raise a MARSHAL exception upon errors. - this.objectKey = MessageBase.extractObjectKey(object_key, orb); - } - - return this.objectKey; - } - - // IO methods - - public void read(org.omg.CORBA.portable.InputStream istream) { - super.read(istream); - this.request_id = istream.read_ulong(); - int _len1 = istream.read_long(); - this.object_key = new byte[_len1]; - istream.read_octet_array(this.object_key, 0, _len1); - } - - public void write(org.omg.CORBA.portable.OutputStream ostream) { - super.write(ostream); - ostream.write_ulong(this.request_id); - nullCheck(this.object_key); - ostream.write_long(this.object_key.length); - ostream.write_octet_array(this.object_key, 0, this.object_key.length); - } - - public void callback(MessageHandler handler) - throws java.io.IOException - { - handler.handleInput(this); - } -} // class LocateRequestMessage_1_1 diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateRequestMessage_1_2.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateRequestMessage_1_2.java deleted file mode 100644 index 2020994b4a8..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateRequestMessage_1_2.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import com.sun.corba.se.spi.ior.ObjectKey; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.orb.ORB; - -/** - * This implements the GIOP 1.2 LocateRequest header. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public final class LocateRequestMessage_1_2 extends Message_1_2 - implements LocateRequestMessage { - - // Instance variables - - private ORB orb = null; - private ObjectKey objectKey = null; - private TargetAddress target = null; - - // Constructors - - LocateRequestMessage_1_2(ORB orb) { - this.orb = orb; - } - - LocateRequestMessage_1_2(ORB orb, int _request_id, TargetAddress _target) { - super(Message.GIOPBigMagic, GIOPVersion.V1_2, FLAG_NO_FRAG_BIG_ENDIAN, - Message.GIOPLocateRequest, 0); - this.orb = orb; - request_id = _request_id; - target = _target; - } - - // Accessor methods (LocateRequestMessage interface) - - public int getRequestId() { - return this.request_id; - } - - public ObjectKey getObjectKey() { - if (this.objectKey == null) { - // this will raise a MARSHAL exception upon errors. - this.objectKey = MessageBase.extractObjectKey(target, orb); - } - - return this.objectKey; - } - - // IO methods - - public void read(org.omg.CORBA.portable.InputStream istream) { - super.read(istream); - this.request_id = istream.read_ulong(); - this.target = TargetAddressHelper.read(istream); - getObjectKey(); // this does AddressingDisposition check - } - - public void write(org.omg.CORBA.portable.OutputStream ostream) { - super.write(ostream); - ostream.write_ulong (this.request_id); - nullCheck(this.target); - TargetAddressHelper.write(ostream, this.target); - } - - public void callback(MessageHandler handler) - throws java.io.IOException - { - handler.handleInput(this); - } -} // class LocateRequestMessage_1_2 diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/Message.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/Message.java deleted file mode 100644 index fae4a24512f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/Message.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import java.io.IOException; -import java.nio.ByteBuffer; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; - -/** - * This is the base interface for different message type interfaces. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public interface Message { - - // Generic constants - - int defaultBufferSize = 1024; - int GIOPBigEndian = 0; - int GIOPLittleEndian = 1; - int GIOPBigMagic = 0x47494F50; - int GIOPLittleMagic = 0x504F4947; - int GIOPMessageHeaderLength = 12; - - // Other useful constants - - byte LITTLE_ENDIAN_BIT = 0x01; - byte MORE_FRAGMENTS_BIT = 0x02; - byte FLAG_NO_FRAG_BIG_ENDIAN = 0x00; - static final byte TRAILING_TWO_BIT_BYTE_MASK = 0x3; - static final byte THREAD_POOL_TO_USE_MASK = 0x3F; - - // Encoding related constants - - byte CDR_ENC_VERSION = 0x00; - byte JAVA_ENC_VERSION = 0x01; - - // Message types - - byte GIOPRequest = 0; - byte GIOPReply = 1; - byte GIOPCancelRequest = 2; - byte GIOPLocateRequest = 3; - byte GIOPLocateReply = 4; - byte GIOPCloseConnection = 5; - byte GIOPMessageError = 6; - byte GIOPFragment = 7; // 1.1 & 1.2: - - // Accessor methods - - GIOPVersion getGIOPVersion(); - byte getEncodingVersion(); - boolean isLittleEndian(); - boolean moreFragmentsToFollow(); - int getType(); - int getSize(); - ByteBuffer getByteBuffer(); - int getThreadPoolToUse(); - - // Mutator methods - - void read(org.omg.CORBA.portable.InputStream istream); - void write(org.omg.CORBA.portable.OutputStream ostream); - - void setSize(ByteBuffer byteBuffer, int size); - - FragmentMessage createFragmentMessage(); - - void callback(MessageHandler handler) throws IOException; - - void setByteBuffer(ByteBuffer byteBuffer); - void setEncodingVersion(byte version); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/MessageBase.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/MessageBase.java deleted file mode 100644 index 6559be7fca4..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/MessageBase.java +++ /dev/null @@ -1,967 +0,0 @@ -/* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import java.io.IOException; -import java.lang.Class; -import java.lang.reflect.Constructor; -import java.nio.ByteBuffer; -import java.util.Iterator; - -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.MARSHAL; -import org.omg.CORBA.Principal; -import org.omg.CORBA.SystemException; -import org.omg.IOP.TaggedProfile; - -import com.sun.corba.se.pept.transport.ByteBufferPool; - -import com.sun.corba.se.spi.ior.ObjectKey; -import com.sun.corba.se.spi.ior.ObjectId; -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.ObjectKeyFactory; -import com.sun.corba.se.spi.ior.iiop.IIOPProfile; -import com.sun.corba.se.spi.ior.iiop.IIOPFactories; -import com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate ; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.ior.iiop.RequestPartitioningComponent; -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.transport.CorbaConnection; -import com.sun.corba.se.spi.transport.ReadTimeouts; - -import com.sun.corba.se.spi.servicecontext.ServiceContexts; -import com.sun.corba.se.impl.encoding.ByteBufferWithInfo; -import com.sun.corba.se.impl.encoding.CDRInputStream_1_0; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.impl.protocol.AddressingDispositionException; - -import sun.corba.SharedSecrets; - -/** - * This class acts as the base class for the various GIOP message types. This - * also serves as a factory to create various message types. We currently - * support GIOP 1.0, 1.1 and 1.2 message types. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public abstract class MessageBase implements Message{ - - // This is only used when the giopDebug flag is - // turned on. - public byte[] giopHeader; - private ByteBuffer byteBuffer; - private int threadPoolToUse; - - // (encodingVersion == 0x00) implies CDR encoding, - // (encodingVersion > 0x00) implies Java serialization version. - byte encodingVersion = (byte) Message.CDR_ENC_VERSION; - - private static ORBUtilSystemException wrapper = - ORBUtilSystemException.get( CORBALogDomains.RPC_PROTOCOL ) ; - - // Static methods - - public static String typeToString(int type) - { - return typeToString((byte)type); - } - - public static String typeToString(byte type) - { - String result = type + "/"; - switch (type) { - case GIOPRequest : result += "GIOPRequest"; break; - case GIOPReply : result += "GIOPReply"; break; - case GIOPCancelRequest : result += "GIOPCancelRequest"; break; - case GIOPLocateRequest : result += "GIOPLocateRequest"; break; - case GIOPLocateReply : result += "GIOPLocateReply"; break; - case GIOPCloseConnection : result += "GIOPCloseConnection"; break; - case GIOPMessageError : result += "GIOPMessageError"; break; - case GIOPFragment : result += "GIOPFragment"; break; - default : result += "Unknown"; break; - } - return result; - } - - public static MessageBase readGIOPMessage(ORB orb, CorbaConnection connection) - { - MessageBase msg = readGIOPHeader(orb, connection); - msg = (MessageBase)readGIOPBody(orb, connection, (Message)msg); - return msg; - } - - public static MessageBase readGIOPHeader(ORB orb, CorbaConnection connection) - { - MessageBase msg = null; - ReadTimeouts readTimeouts = - orb.getORBData().getTransportTCPReadTimeouts(); - - ByteBuffer buf = null; - - try { - buf = connection.read(GIOPMessageHeaderLength, - 0, GIOPMessageHeaderLength, - readTimeouts.get_max_giop_header_time_to_wait()); - } catch (IOException e) { - throw wrapper.ioexceptionWhenReadingConnection(e); - } - - if (orb.giopDebugFlag) { - // Since this is executed in debug mode only the overhead of - // using a View Buffer is not an issue. We'll also use a - // read-only View Buffer so we don't disturb the state of - // byteBuffer. - dprint(".readGIOPHeader: " + typeToString(buf.get(7))); - dprint(".readGIOPHeader: GIOP header is: "); - ByteBuffer viewBuffer = buf.asReadOnlyBuffer(); - viewBuffer.position(0).limit(GIOPMessageHeaderLength); - ByteBufferWithInfo bbwi = new ByteBufferWithInfo(orb,viewBuffer); - bbwi.buflen = GIOPMessageHeaderLength; - CDRInputStream_1_0.printBuffer(bbwi); - } - - // Sanity checks - - /* - * check for magic corruption - * check for version incompatibility - * check if fragmentation is allowed based on mesg type. - . 1.0 fragmentation disallowed; FragmentMessage is non-existent. - . 1.1 only {Request, Reply} msgs maybe fragmented. - . 1.2 only {Request, Reply, LocateRequest, LocateReply} msgs - maybe fragmented. - */ - - int b1, b2, b3, b4; - - b1 = (buf.get(0) << 24) & 0xFF000000; - b2 = (buf.get(1) << 16) & 0x00FF0000; - b3 = (buf.get(2) << 8) & 0x0000FF00; - b4 = (buf.get(3) << 0) & 0x000000FF; - int magic = (b1 | b2 | b3 | b4); - - if (magic != GIOPBigMagic) { - // If Magic is incorrect, it is an error. - // ACTION : send MessageError and close the connection. - throw wrapper.giopMagicError( CompletionStatus.COMPLETED_MAYBE); - } - - // Extract the encoding version from the request GIOP Version, - // if it contains an encoding, and set GIOP version appropriately. - // For Java serialization, we use GIOP Version 1.2 message format. - byte requestEncodingVersion = Message.CDR_ENC_VERSION; - if ((buf.get(4) == 0x0D) && - (buf.get(5) <= Message.JAVA_ENC_VERSION) && - (buf.get(5) > Message.CDR_ENC_VERSION) && - orb.getORBData().isJavaSerializationEnabled()) { - // Entering this block means the request is using Java encoding, - // and the encoding version is <= this ORB's Java encoding version. - requestEncodingVersion = buf.get(5); - buf.put(4, (byte) 0x01); - buf.put(5, (byte) 0x02); - } - - GIOPVersion orbVersion = orb.getORBData().getGIOPVersion(); - - if (orb.giopDebugFlag) { - dprint(".readGIOPHeader: Message GIOP version: " - + buf.get(4) + '.' + buf.get(5)); - dprint(".readGIOPHeader: ORB Max GIOP Version: " - + orbVersion); - } - - if ( (buf.get(4) > orbVersion.getMajor()) || - ( (buf.get(4) == orbVersion.getMajor()) && (buf.get(5) > orbVersion.getMinor()) ) - ) { - // For requests, sending ORB should use the version info - // published in the IOR or may choose to use a <= version - // for requests. If the version is greater than published version, - // it is an error. - - // For replies, the ORB should always receive a version it supports - // or less, but never greater (except for MessageError) - - // ACTION : Send back a MessageError() with the the highest version - // the server ORB supports, and close the connection. - if ( buf.get(7) != GIOPMessageError ) { - throw wrapper.giopVersionError( CompletionStatus.COMPLETED_MAYBE); - } - } - - AreFragmentsAllowed(buf.get(4), buf.get(5), buf.get(6), buf.get(7)); - - // create appropriate messages types - - switch (buf.get(7)) { - - case GIOPRequest: - if (orb.giopDebugFlag) { - dprint(".readGIOPHeader: creating RequestMessage"); - } - //msg = new RequestMessage(orb.giopDebugFlag); - if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x00) ) { // 1.0 - msg = new RequestMessage_1_0(orb); - } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x01) ) { // 1.1 - msg = new RequestMessage_1_1(orb); - } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x02) ) { // 1.2 - msg = new RequestMessage_1_2(orb); - } else { - throw wrapper.giopVersionError( - CompletionStatus.COMPLETED_MAYBE); - } - break; - - case GIOPLocateRequest: - if (orb.giopDebugFlag) { - dprint(".readGIOPHeader: creating LocateRequestMessage"); - } - //msg = new LocateRequestMessage(orb.giopDebugFlag); - if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x00) ) { // 1.0 - msg = new LocateRequestMessage_1_0(orb); - } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x01) ) { // 1.1 - msg = new LocateRequestMessage_1_1(orb); - } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x02) ) { // 1.2 - msg = new LocateRequestMessage_1_2(orb); - } else { - throw wrapper.giopVersionError( - CompletionStatus.COMPLETED_MAYBE); - } - break; - - case GIOPCancelRequest: - if (orb.giopDebugFlag) { - dprint(".readGIOPHeader: creating CancelRequestMessage"); - } - //msg = new CancelRequestMessage(orb.giopDebugFlag); - if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x00) ) { // 1.0 - msg = new CancelRequestMessage_1_0(); - } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x01) ) { // 1.1 - msg = new CancelRequestMessage_1_1(); - } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x02) ) { // 1.2 - msg = new CancelRequestMessage_1_2(); - } else { - throw wrapper.giopVersionError( - CompletionStatus.COMPLETED_MAYBE); - } - break; - - case GIOPReply: - if (orb.giopDebugFlag) { - dprint(".readGIOPHeader: creating ReplyMessage"); - } - //msg = new ReplyMessage(orb.giopDebugFlag); - if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x00) ) { // 1.0 - msg = new ReplyMessage_1_0(orb); - } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x01) ) { // 1.1 - msg = new ReplyMessage_1_1(orb); - } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x02) ) { // 1.2 - msg = new ReplyMessage_1_2(orb); - } else { - throw wrapper.giopVersionError( - CompletionStatus.COMPLETED_MAYBE); - } - break; - - case GIOPLocateReply: - if (orb.giopDebugFlag) { - dprint(".readGIOPHeader: creating LocateReplyMessage"); - } - //msg = new LocateReplyMessage(orb.giopDebugFlag); - if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x00) ) { // 1.0 - msg = new LocateReplyMessage_1_0(orb); - } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x01) ) { // 1.1 - msg = new LocateReplyMessage_1_1(orb); - } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x02) ) { // 1.2 - msg = new LocateReplyMessage_1_2(orb); - } else { - throw wrapper.giopVersionError( - CompletionStatus.COMPLETED_MAYBE); - } - break; - - case GIOPCloseConnection: - case GIOPMessageError: - if (orb.giopDebugFlag) { - dprint(".readGIOPHeader: creating Message for CloseConnection or MessageError"); - } - // REVISIT a MessageError may contain the highest version server - // can support. In such a case, a new request may be made with the - // correct version or the connection be simply closed. Note the - // connection may have been closed by the server. - //msg = new Message(orb.giopDebugFlag); - if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x00) ) { // 1.0 - msg = new Message_1_0(); - } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x01) ) { // 1.1 - msg = new Message_1_1(); - } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x02) ) { // 1.2 - msg = new Message_1_1(); - } else { - throw wrapper.giopVersionError( - CompletionStatus.COMPLETED_MAYBE); - } - break; - - case GIOPFragment: - if (orb.giopDebugFlag) { - dprint(".readGIOPHeader: creating FragmentMessage"); - } - //msg = new FragmentMessage(orb.giopDebugFlag); - if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x00) ) { // 1.0 - // not possible (error checking done already) - } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x01) ) { // 1.1 - msg = new FragmentMessage_1_1(); - } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x02) ) { // 1.2 - msg = new FragmentMessage_1_2(); - } else { - throw wrapper.giopVersionError( - CompletionStatus.COMPLETED_MAYBE); - } - break; - - default: - if (orb.giopDebugFlag) - dprint(".readGIOPHeader: UNKNOWN MESSAGE TYPE: " - + buf.get(7)); - // unknown message type ? - // ACTION : send MessageError and close the connection - throw wrapper.giopVersionError( - CompletionStatus.COMPLETED_MAYBE); - } - - // - // Initialize the generic GIOP header instance variables. - // - - if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x00) ) { // 1.0 - Message_1_0 msg10 = (Message_1_0) msg; - msg10.magic = magic; - msg10.GIOP_version = new GIOPVersion(buf.get(4), buf.get(5)); - msg10.byte_order = (buf.get(6) == LITTLE_ENDIAN_BIT); - // 'request partitioning' not supported on GIOP version 1.0 - // so just use the default thread pool, 0. - msg.threadPoolToUse = 0; - msg10.message_type = buf.get(7); - msg10.message_size = readSize(buf.get(8), buf.get(9), buf.get(10), buf.get(11), - msg10.isLittleEndian()) + - GIOPMessageHeaderLength; - } else { // 1.1 & 1.2 - Message_1_1 msg11 = (Message_1_1) msg; - msg11.magic = magic; - msg11.GIOP_version = new GIOPVersion(buf.get(4), buf.get(5)); - msg11.flags = (byte)(buf.get(6) & TRAILING_TWO_BIT_BYTE_MASK); - // IMPORTANT: For 'request partitioning', the thread pool to use - // information is stored in the leading 6 bits of byte 6. - // - // IMPORTANT: Request partitioning is a PROPRIETARY EXTENSION !!! - // - // NOTE: Bitwise operators will promote a byte to an int before - // performing a bitwise operation and bytes, ints, longs, etc - // are signed types in Java. Thus, the need for the - // THREAD_POOL_TO_USE_MASK operation. - msg.threadPoolToUse = (buf.get(6) >>> 2) & THREAD_POOL_TO_USE_MASK; - msg11.message_type = buf.get(7); - msg11.message_size = - readSize(buf.get(8), buf.get(9), buf.get(10), buf.get(11), - msg11.isLittleEndian()) + GIOPMessageHeaderLength; - } - - - if (orb.giopDebugFlag) { - // Since this is executed in debug mode only the overhead of - // using a View Buffer is not an issue. We'll also use a - // read-only View Buffer so we don't disturb the state of - // byteBuffer. - dprint(".readGIOPHeader: header construction complete."); - - // For debugging purposes, save the 12 bytes of the header - ByteBuffer viewBuf = buf.asReadOnlyBuffer(); - byte[] msgBuf = new byte[GIOPMessageHeaderLength]; - viewBuf.position(0).limit(GIOPMessageHeaderLength); - viewBuf.get(msgBuf,0,msgBuf.length); - // REVISIT: is giopHeader still used? - ((MessageBase)msg).giopHeader = msgBuf; - } - - msg.setByteBuffer(buf); - msg.setEncodingVersion(requestEncodingVersion); - - return msg; - } - - public static Message readGIOPBody(ORB orb, - CorbaConnection connection, - Message msg) - { - ReadTimeouts readTimeouts = - orb.getORBData().getTransportTCPReadTimeouts(); - ByteBuffer buf = msg.getByteBuffer(); - - buf.position(MessageBase.GIOPMessageHeaderLength); - int msgSizeMinusHeader = - msg.getSize() - MessageBase.GIOPMessageHeaderLength; - try { - buf = connection.read(buf, - GIOPMessageHeaderLength, msgSizeMinusHeader, - readTimeouts.get_max_time_to_wait()); - } catch (IOException e) { - throw wrapper.ioexceptionWhenReadingConnection(e); - } - - msg.setByteBuffer(buf); - - if (orb.giopDebugFlag) { - dprint(".readGIOPBody: received message:"); - ByteBuffer viewBuffer = buf.asReadOnlyBuffer(); - viewBuffer.position(0).limit(msg.getSize()); - ByteBufferWithInfo bbwi = new ByteBufferWithInfo(orb, viewBuffer); - CDRInputStream_1_0.printBuffer(bbwi); - } - - return msg; - } - - private static RequestMessage createRequest( - ORB orb, GIOPVersion gv, byte encodingVersion, int request_id, - boolean response_expected, byte[] object_key, String operation, - ServiceContexts service_contexts, Principal requesting_principal) { - - if (gv.equals(GIOPVersion.V1_0)) { // 1.0 - return new RequestMessage_1_0(orb, service_contexts, request_id, - response_expected, object_key, - operation, requesting_principal); - } else if (gv.equals(GIOPVersion.V1_1)) { // 1.1 - return new RequestMessage_1_1(orb, service_contexts, request_id, - response_expected, new byte[] { 0x00, 0x00, 0x00 }, - object_key, operation, requesting_principal); - } else if (gv.equals(GIOPVersion.V1_2)) { // 1.2 - // Note: Currently we use response_expected flag to decide if the - // call is oneway or not. Ideally, it is possible to expect a - // response on a oneway call too, but we do not support it now. - byte response_flags = 0x03; - if (response_expected) { - response_flags = 0x03; - } else { - response_flags = 0x00; - } - /* - // REVISIT The following is the correct way to do it. This gives - // more flexibility. - if ((DII::INV_NO_RESPONSE == false) && response_expected) { - response_flags = 0x03; // regular two-way - } else if ((DII::INV_NO_RESPONSE == false) && !response_expected) { - // this condition is not possible - } else if ((DII::INV_NO_RESPONSE == true) && response_expected) { - // oneway, but we need response for LocationForwards or - // SystemExceptions. - response_flags = 0x01; - } else if ((DII::INV_NO_RESPONSE == true) && !response_expected) { - // oneway, no response required - response_flags = 0x00; - } - */ - TargetAddress target = new TargetAddress(); - target.object_key(object_key); - RequestMessage msg = - new RequestMessage_1_2(orb, request_id, response_flags, - new byte[] { 0x00, 0x00, 0x00 }, - target, operation, service_contexts); - msg.setEncodingVersion(encodingVersion); - return msg; - } else { - throw wrapper.giopVersionError( - CompletionStatus.COMPLETED_MAYBE); - } - } - - public static RequestMessage createRequest( - ORB orb, GIOPVersion gv, byte encodingVersion, int request_id, - boolean response_expected, IOR ior, - short addrDisp, String operation, - ServiceContexts service_contexts, Principal requesting_principal) { - - RequestMessage requestMessage = null; - IIOPProfile profile = ior.getProfile(); - - if (addrDisp == KeyAddr.value) { - // object key will be used for target addressing - profile = ior.getProfile(); - ObjectKey objKey = profile.getObjectKey(); - byte[] object_key = objKey.getBytes(orb); - requestMessage = - createRequest(orb, gv, encodingVersion, request_id, - response_expected, object_key, - operation, service_contexts, - requesting_principal); - } else { - - if (!(gv.equals(GIOPVersion.V1_2))) { - // only object_key based target addressing is allowed for - // GIOP 1.0 & 1.1 - throw wrapper.giopVersionError( - CompletionStatus.COMPLETED_MAYBE); - } - - // Note: Currently we use response_expected flag to decide if the - // call is oneway or not. Ideally, it is possible to expect a - // response on a oneway call too, but we do not support it now. - byte response_flags = 0x03; - if (response_expected) { - response_flags = 0x03; - } else { - response_flags = 0x00; - } - - TargetAddress target = new TargetAddress(); - if (addrDisp == ProfileAddr.value) { // iop profile will be used - profile = ior.getProfile(); - target.profile(profile.getIOPProfile()); - } else if (addrDisp == ReferenceAddr.value) { // ior will be used - IORAddressingInfo iorInfo = - new IORAddressingInfo( 0, // profile index - ior.getIOPIOR()); - target.ior(iorInfo); - } else { - // invalid target addressing disposition value - throw wrapper.illegalTargetAddressDisposition( - CompletionStatus.COMPLETED_NO); - } - - requestMessage = - new RequestMessage_1_2(orb, request_id, response_flags, - new byte[] { 0x00, 0x00, 0x00 }, target, - operation, service_contexts); - requestMessage.setEncodingVersion(encodingVersion); - } - - if (gv.supportsIORIIOPProfileComponents()) { - // add request partitioning thread pool to use info - int poolToUse = 0; // default pool - IIOPProfileTemplate temp = - (IIOPProfileTemplate)profile.getTaggedProfileTemplate(); - Iterator iter = - temp.iteratorById(ORBConstants.TAG_REQUEST_PARTITIONING_ID); - if (iter.hasNext()) { - poolToUse = - ((RequestPartitioningComponent)iter.next()).getRequestPartitioningId(); - } - - if (poolToUse < ORBConstants.REQUEST_PARTITIONING_MIN_THREAD_POOL_ID || - poolToUse > ORBConstants.REQUEST_PARTITIONING_MAX_THREAD_POOL_ID) { - throw wrapper.invalidRequestPartitioningId(new Integer(poolToUse), - new Integer(ORBConstants.REQUEST_PARTITIONING_MIN_THREAD_POOL_ID), - new Integer(ORBConstants.REQUEST_PARTITIONING_MAX_THREAD_POOL_ID)); - } - requestMessage.setThreadPoolToUse(poolToUse); - } - - return requestMessage; - } - - public static ReplyMessage createReply( - ORB orb, GIOPVersion gv, byte encodingVersion, int request_id, - int reply_status, ServiceContexts service_contexts, IOR ior) { - - if (gv.equals(GIOPVersion.V1_0)) { // 1.0 - return new ReplyMessage_1_0(orb, service_contexts, request_id, - reply_status, ior); - } else if (gv.equals(GIOPVersion.V1_1)) { // 1.1 - return new ReplyMessage_1_1(orb, service_contexts, request_id, - reply_status, ior); - } else if (gv.equals(GIOPVersion.V1_2)) { // 1.2 - ReplyMessage msg = - new ReplyMessage_1_2(orb, request_id, reply_status, - service_contexts, ior); - msg.setEncodingVersion(encodingVersion); - return msg; - } else { - throw wrapper.giopVersionError( - CompletionStatus.COMPLETED_MAYBE); - } - } - - public static LocateRequestMessage createLocateRequest( - ORB orb, GIOPVersion gv, byte encodingVersion, - int request_id, byte[] object_key) { - - if (gv.equals(GIOPVersion.V1_0)) { // 1.0 - return new LocateRequestMessage_1_0(orb, request_id, object_key); - } else if (gv.equals(GIOPVersion.V1_1)) { // 1.1 - return new LocateRequestMessage_1_1(orb, request_id, object_key); - } else if (gv.equals(GIOPVersion.V1_2)) { // 1.2 - TargetAddress target = new TargetAddress(); - target.object_key(object_key); - LocateRequestMessage msg = - new LocateRequestMessage_1_2(orb, request_id, target); - msg.setEncodingVersion(encodingVersion); - return msg; - } else { - throw wrapper.giopVersionError( - CompletionStatus.COMPLETED_MAYBE); - } - } - - public static LocateReplyMessage createLocateReply( - ORB orb, GIOPVersion gv, byte encodingVersion, - int request_id, int locate_status, IOR ior) { - - if (gv.equals(GIOPVersion.V1_0)) { // 1.0 - return new LocateReplyMessage_1_0(orb, request_id, - locate_status, ior); - } else if (gv.equals(GIOPVersion.V1_1)) { // 1.1 - return new LocateReplyMessage_1_1(orb, request_id, - locate_status, ior); - } else if (gv.equals(GIOPVersion.V1_2)) { // 1.2 - LocateReplyMessage msg = - new LocateReplyMessage_1_2(orb, request_id, - locate_status, ior); - msg.setEncodingVersion(encodingVersion); - return msg; - } else { - throw wrapper.giopVersionError( - CompletionStatus.COMPLETED_MAYBE); - } - } - - public static CancelRequestMessage createCancelRequest( - GIOPVersion gv, int request_id) { - - if (gv.equals(GIOPVersion.V1_0)) { // 1.0 - return new CancelRequestMessage_1_0(request_id); - } else if (gv.equals(GIOPVersion.V1_1)) { // 1.1 - return new CancelRequestMessage_1_1(request_id); - } else if (gv.equals(GIOPVersion.V1_2)) { // 1.2 - return new CancelRequestMessage_1_2(request_id); - } else { - throw wrapper.giopVersionError( - CompletionStatus.COMPLETED_MAYBE); - } - } - - public static Message createCloseConnection(GIOPVersion gv) { - if (gv.equals(GIOPVersion.V1_0)) { // 1.0 - return new Message_1_0(Message.GIOPBigMagic, false, - Message.GIOPCloseConnection, 0); - } else if (gv.equals(GIOPVersion.V1_1)) { // 1.1 - return new Message_1_1(Message.GIOPBigMagic, GIOPVersion.V1_1, - FLAG_NO_FRAG_BIG_ENDIAN, - Message.GIOPCloseConnection, 0); - } else if (gv.equals(GIOPVersion.V1_2)) { // 1.2 - return new Message_1_1(Message.GIOPBigMagic, GIOPVersion.V1_2, - FLAG_NO_FRAG_BIG_ENDIAN, - Message.GIOPCloseConnection, 0); - } else { - throw wrapper.giopVersionError( - CompletionStatus.COMPLETED_MAYBE); - } - } - - public static Message createMessageError(GIOPVersion gv) { - if (gv.equals(GIOPVersion.V1_0)) { // 1.0 - return new Message_1_0(Message.GIOPBigMagic, false, - Message.GIOPMessageError, 0); - } else if (gv.equals(GIOPVersion.V1_1)) { // 1.1 - return new Message_1_1(Message.GIOPBigMagic, GIOPVersion.V1_1, - FLAG_NO_FRAG_BIG_ENDIAN, - Message.GIOPMessageError, 0); - } else if (gv.equals(GIOPVersion.V1_2)) { // 1.2 - return new Message_1_1(Message.GIOPBigMagic, GIOPVersion.V1_2, - FLAG_NO_FRAG_BIG_ENDIAN, - Message.GIOPMessageError, 0); - } else { - throw wrapper.giopVersionError( - CompletionStatus.COMPLETED_MAYBE); - } - } - - public static FragmentMessage createFragmentMessage(GIOPVersion gv) { - // This method is not currently used. - // New fragment messages are always created from existing messages. - // Creating a FragmentMessage from InputStream is done in - // createFromStream(..) - return null; - } - - public static int getRequestId(Message msg) { - switch (msg.getType()) { - case GIOPRequest : - return ((RequestMessage) msg).getRequestId(); - case GIOPReply : - return ((ReplyMessage) msg).getRequestId(); - case GIOPLocateRequest : - return ((LocateRequestMessage) msg).getRequestId(); - case GIOPLocateReply : - return ((LocateReplyMessage) msg).getRequestId(); - case GIOPCancelRequest : - return ((CancelRequestMessage) msg).getRequestId(); - case GIOPFragment : - return ((FragmentMessage) msg).getRequestId(); - } - - throw wrapper.illegalGiopMsgType( - CompletionStatus.COMPLETED_MAYBE); - } - - /** - * Set a flag in the given buffer (fragment bit, byte order bit, etc) - */ - public static void setFlag(ByteBuffer byteBuffer, int flag) { - byte b = byteBuffer.get(6); - b |= flag; - byteBuffer.put(6,b); - } - - /** - * Clears a flag in the given buffer - */ - public static void clearFlag(byte[] buf, int flag) { - buf[6] &= (0xFF ^ flag); - } - - private static void AreFragmentsAllowed(byte major, byte minor, byte flag, - byte msgType) { - - if ( (major == 0x01) && (minor == 0x00) ) { // 1.0 - if (msgType == GIOPFragment) { - throw wrapper.fragmentationDisallowed( - CompletionStatus.COMPLETED_MAYBE); - } - } - - if ( (flag & MORE_FRAGMENTS_BIT) == MORE_FRAGMENTS_BIT ) { - switch (msgType) { - case GIOPCancelRequest : - case GIOPCloseConnection : - case GIOPMessageError : - throw wrapper.fragmentationDisallowed( - CompletionStatus.COMPLETED_MAYBE); - case GIOPLocateRequest : - case GIOPLocateReply : - if ( (major == 0x01) && (minor == 0x01) ) { // 1.1 - throw wrapper.fragmentationDisallowed( - CompletionStatus.COMPLETED_MAYBE); - } - break; - } - } - } - - /** - * Construct an ObjectKey from a byte[]. - * - * @return ObjectKey the object key. - */ - static ObjectKey extractObjectKey(byte[] objKey, ORB orb) { - - try { - if (objKey != null) { - ObjectKey objectKey = - orb.getObjectKeyFactory().create(objKey); - if (objectKey != null) { - return objectKey; - } - } - } catch (Exception e) { - // XXX log this exception - } - - // This exception is thrown if any exceptions are raised while - // extracting the object key or if the object key is empty. - throw wrapper.invalidObjectKey(); - } - - /** - * Extract the object key from TargetAddress. - * - * @return ObjectKey the object key. - */ - static ObjectKey extractObjectKey(TargetAddress target, ORB orb) { - - short orbTargetAddrPref = orb.getORBData().getGIOPTargetAddressPreference(); - short reqAddrDisp = target.discriminator(); - - switch (orbTargetAddrPref) { - case ORBConstants.ADDR_DISP_OBJKEY : - if (reqAddrDisp != KeyAddr.value) { - throw new AddressingDispositionException(KeyAddr.value); - } - break; - case ORBConstants.ADDR_DISP_PROFILE : - if (reqAddrDisp != ProfileAddr.value) { - throw new AddressingDispositionException(ProfileAddr.value); - } - break; - case ORBConstants.ADDR_DISP_IOR : - if (reqAddrDisp != ReferenceAddr.value) { - throw new AddressingDispositionException(ReferenceAddr.value); - } - break; - case ORBConstants.ADDR_DISP_HANDLE_ALL : - break; - default : - throw wrapper.orbTargetAddrPreferenceInExtractObjectkeyInvalid() ; - } - - try { - switch (reqAddrDisp) { - case KeyAddr.value : - byte[] objKey = target.object_key(); - if (objKey != null) { // AddressingDisposition::KeyAddr - ObjectKey objectKey = - orb.getObjectKeyFactory().create(objKey); - if (objectKey != null) { - return objectKey; - } - } - break; - case ProfileAddr.value : - IIOPProfile iiopProfile = null; - TaggedProfile profile = target.profile(); - if (profile != null) { // AddressingDisposition::ProfileAddr - iiopProfile = IIOPFactories.makeIIOPProfile(orb, profile); - ObjectKey objectKey = iiopProfile.getObjectKey(); - if (objectKey != null) { - return objectKey; - } - } - break; - case ReferenceAddr.value : - IORAddressingInfo iorInfo = target.ior(); - if (iorInfo != null) { // AddressingDisposition::IORAddr - profile = iorInfo.ior.profiles[iorInfo.selected_profile_index]; - iiopProfile = IIOPFactories.makeIIOPProfile(orb, profile); - ObjectKey objectKey = iiopProfile.getObjectKey(); - if (objectKey != null) { - return objectKey; - } - } - break; - default : // this cannot happen - // There is no need for a explicit exception, since the - // TargetAddressHelper.read() would have raised a BAD_OPERATION - // exception by now. - break; - } - } catch (Exception e) {} - - // This exception is thrown if any exceptions are raised while - // extracting the object key from the TargetAddress or if all the - // the valid TargetAddress::AddressingDispositions are empty. - throw wrapper.invalidObjectKey() ; - } - - private static int readSize(byte b1, byte b2, byte b3, byte b4, - boolean littleEndian) { - - int a1, a2, a3, a4; - - if (!littleEndian) { - a1 = (b1 << 24) & 0xFF000000; - a2 = (b2 << 16) & 0x00FF0000; - a3 = (b3 << 8) & 0x0000FF00; - a4 = (b4 << 0) & 0x000000FF; - } else { - a1 = (b4 << 24) & 0xFF000000; - a2 = (b3 << 16) & 0x00FF0000; - a3 = (b2 << 8) & 0x0000FF00; - a4 = (b1 << 0) & 0x000000FF; - } - - return (a1 | a2 | a3 | a4); - } - - static void nullCheck(Object obj) { - if (obj == null) { - throw wrapper.nullNotAllowed() ; - } - } - - static SystemException getSystemException( - String exClassName, int minorCode, CompletionStatus completionStatus, - String message, ORBUtilSystemException wrapper) - { - SystemException sysEx = null; - - try { - Class clazz = - SharedSecrets.getJavaCorbaAccess().loadClass(exClassName); - if (message == null) { - sysEx = (SystemException) clazz.newInstance(); - } else { - Class[] types = { String.class }; - Constructor constructor = clazz.getConstructor(types); - Object[] args = { message }; - sysEx = (SystemException)constructor.newInstance(args); - } - } catch (Exception someEx) { - throw wrapper.badSystemExceptionInReply( - CompletionStatus.COMPLETED_MAYBE, someEx ); - } - - sysEx.minor = minorCode; - sysEx.completed = completionStatus; - - return sysEx; - } - - public void callback(MessageHandler handler) - throws java.io.IOException - { - handler.handleInput(this); - } - - public ByteBuffer getByteBuffer() - { - return byteBuffer; - } - - public void setByteBuffer(ByteBuffer byteBuffer) - { - this.byteBuffer = byteBuffer; - } - - public int getThreadPoolToUse() - { - return threadPoolToUse; - } - - public byte getEncodingVersion() { - return this.encodingVersion; - } - - public void setEncodingVersion(byte version) { - this.encodingVersion = version; - } - - private static void dprint(String msg) - { - ORBUtility.dprint("MessageBase", msg); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/MessageHandler.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/MessageHandler.java deleted file mode 100644 index fadb14d4f46..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/MessageHandler.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import java.io.IOException; - -/** - * Interface which allows an implementation to use - * double dispatch when processing the various - * concrete message types found in this package. - */ -public interface MessageHandler -{ - // - // REVISIT - These should not throw IOException. - // Should be handled internally. - - /** - * Used for message types for which we don't have concrete classes, yet, - * such as CloseConnection and MessageError, as well as unknown types. - */ - void handleInput(Message header) throws IOException; - - // Request - void handleInput(RequestMessage_1_0 header) throws IOException; - void handleInput(RequestMessage_1_1 header) throws IOException; - void handleInput(RequestMessage_1_2 header) throws IOException; - - // Reply - void handleInput(ReplyMessage_1_0 header) throws IOException; - void handleInput(ReplyMessage_1_1 header) throws IOException; - void handleInput(ReplyMessage_1_2 header) throws IOException; - - // LocateRequest - void handleInput(LocateRequestMessage_1_0 header) throws IOException; - void handleInput(LocateRequestMessage_1_1 header) throws IOException; - void handleInput(LocateRequestMessage_1_2 header) throws IOException; - - // LocateReply - void handleInput(LocateReplyMessage_1_0 header) throws IOException; - void handleInput(LocateReplyMessage_1_1 header) throws IOException; - void handleInput(LocateReplyMessage_1_2 header) throws IOException; - - // Fragment - void handleInput(FragmentMessage_1_1 header) throws IOException; - void handleInput(FragmentMessage_1_2 header) throws IOException; - - // CancelRequest - void handleInput(CancelRequestMessage header) throws IOException; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/Message_1_0.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/Message_1_0.java deleted file mode 100644 index 42bcd4b1934..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/Message_1_0.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import java.nio.ByteBuffer; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.CompletionStatus; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -/* - * This implements the GIOP 1.0 Message header. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public class Message_1_0 - extends com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase { - - private static ORBUtilSystemException wrapper = - ORBUtilSystemException.get( CORBALogDomains.RPC_PROTOCOL ) ; - - // Instance variables - int magic = (int) 0; - GIOPVersion GIOP_version = null; - boolean byte_order = false; - byte message_type = (byte) 0; - int message_size = (int) 0; - - // Constructor - - Message_1_0() { - } - - Message_1_0(int _magic, boolean _byte_order, byte _message_type, - int _message_size) { - magic = _magic; - GIOP_version = GIOPVersion.V1_0; - byte_order = _byte_order; - message_type = _message_type; - message_size = _message_size; - } - - // Accessor methods - - public GIOPVersion getGIOPVersion() { - return this.GIOP_version; - } - - public int getType() { - return this.message_type; - } - - public int getSize() { - return this.message_size; - } - - public boolean isLittleEndian() { - return this.byte_order; - } - - public boolean moreFragmentsToFollow() { - return false; - } - - // Mutator methods - - public void setSize(ByteBuffer byteBuffer, int size) { - this.message_size = size; - - // - // Patch the size field in the header. - // - int patch = size - GIOPMessageHeaderLength; - if (!isLittleEndian()) { - byteBuffer.put(8, (byte)((patch >>> 24) & 0xFF)); - byteBuffer.put(9, (byte)((patch >>> 16) & 0xFF)); - byteBuffer.put(10, (byte)((patch >>> 8) & 0xFF)); - byteBuffer.put(11, (byte)((patch >>> 0) & 0xFF)); - } else { - byteBuffer.put(8, (byte)((patch >>> 0) & 0xFF)); - byteBuffer.put(9, (byte)((patch >>> 8) & 0xFF)); - byteBuffer.put(10, (byte)((patch >>> 16) & 0xFF)); - byteBuffer.put(11, (byte)((patch >>> 24) & 0xFF)); - } - } - - public FragmentMessage createFragmentMessage() { - throw wrapper.fragmentationDisallowed( - CompletionStatus.COMPLETED_MAYBE); - } - - // IO methods - - // This should do nothing even if it is called. The Message Header already - // is read off java.io.InputStream (not a CDRInputStream) by IIOPConnection - // in order to choose the correct CDR Version, msg_type, and msg_size. - // So, we would never need to read the Message Header off a CDRInputStream. - public void read(org.omg.CORBA.portable.InputStream istream) { - /* - this.magic = istream.read_long(); - this.GIOP_version = (new GIOPVersion()).read(istream); - this.byte_order = istream.read_boolean(); - this.message_type = istream.read_octet(); - this.message_size = istream.read_ulong(); - */ - } - - public void write(org.omg.CORBA.portable.OutputStream ostream) { - ostream.write_long(this.magic); - nullCheck(this.GIOP_version); - this.GIOP_version.write(ostream); - ostream.write_boolean(this.byte_order); - ostream.write_octet(this.message_type); - ostream.write_ulong(this.message_size); - } - -} // class Message_1_0 diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/Message_1_1.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/Message_1_1.java deleted file mode 100644 index f0d26e25e0f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/Message_1_1.java +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import java.nio.ByteBuffer; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.CompletionStatus; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -/* - * This implements the GIOP 1.1 & 1.2 Message header. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public class Message_1_1 - extends com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase { - - // Constants - final static int UPPER_THREE_BYTES_OF_INT_MASK = 0xFF; - - private static ORBUtilSystemException wrapper = - ORBUtilSystemException.get( CORBALogDomains.RPC_PROTOCOL ) ; - - // Instance variables - int magic = (int) 0; - GIOPVersion GIOP_version = null; - byte flags = (byte) 0; - byte message_type = (byte) 0; - int message_size = (int) 0; - - // Constructor - - Message_1_1() { - } - - Message_1_1(int _magic, GIOPVersion _GIOP_version, byte _flags, - byte _message_type, int _message_size) { - magic = _magic; - GIOP_version = _GIOP_version; - flags = _flags; - message_type = _message_type; - message_size = _message_size; - } - - // Accessor methods - - public GIOPVersion getGIOPVersion() { - return this.GIOP_version; - } - - public int getType() { - return this.message_type; - } - - public int getSize() { - return this.message_size; - } - - public boolean isLittleEndian() { - return ((this.flags & LITTLE_ENDIAN_BIT) == LITTLE_ENDIAN_BIT); - } - - public boolean moreFragmentsToFollow() { - return ( (this.flags & MORE_FRAGMENTS_BIT) == MORE_FRAGMENTS_BIT ); - } - - // Mutator methods - - // NOTE: This is a SUN PROPRIETARY EXTENSION - // Add the poolToUse to the upper 6 bits of byte 6 of the GIOP header. - // this.flags represents byte 6 here. - public void setThreadPoolToUse(int poolToUse) { - // IMPORTANT: Bitwise operations will promote - // byte types to int before performing - // bitwise operations. And, Java - // types are signed. - int tmpFlags = poolToUse << 2; - tmpFlags &= UPPER_THREE_BYTES_OF_INT_MASK; - tmpFlags |= flags; - flags = (byte)tmpFlags; - } - - public void setSize(ByteBuffer byteBuffer, int size) { - - this.message_size = size; - - // - // Patch the size field in the header. - // - - int patch = size - GIOPMessageHeaderLength; - if (!isLittleEndian()) { - byteBuffer.put(8, (byte)((patch >>> 24) & 0xFF)); - byteBuffer.put(9, (byte)((patch >>> 16) & 0xFF)); - byteBuffer.put(10, (byte)((patch >>> 8) & 0xFF)); - byteBuffer.put(11, (byte)((patch >>> 0) & 0xFF)); - } else { - byteBuffer.put(8, (byte)((patch >>> 0) & 0xFF)); - byteBuffer.put(9, (byte)((patch >>> 8) & 0xFF)); - byteBuffer.put(10, (byte)((patch >>> 16) & 0xFF)); - byteBuffer.put(11, (byte)((patch >>> 24) & 0xFF)); - } - } - - /** - * Allows us to create a fragment message from any message type. - */ - public FragmentMessage createFragmentMessage() { - - // check for message type validity - - switch (this.message_type) { - case GIOPCancelRequest : - case GIOPCloseConnection : - case GIOPMessageError : - throw wrapper.fragmentationDisallowed( - CompletionStatus.COMPLETED_MAYBE); - case GIOPLocateRequest : - case GIOPLocateReply : - if (this.GIOP_version.equals(GIOPVersion.V1_1)) { - throw wrapper.fragmentationDisallowed( - CompletionStatus.COMPLETED_MAYBE); - } - break; - } - - /* - // A fragmented mesg can be created only if the current mesg' fragment - // bit is set. Otherwise, raise error - // too stringent check - if ( (this.flags & MORE_FRAGMENTS_BIT) != MORE_FRAGMENTS_BIT ) { - throw wrapper.fragmentationDisallowed( CompletionStatus.COMPLETED_MAYBE); - } - */ - if (this.GIOP_version.equals(GIOPVersion.V1_1)) { - return new FragmentMessage_1_1(this); - } else if (this.GIOP_version.equals(GIOPVersion.V1_2)) { - return new FragmentMessage_1_2(this); - } - - throw wrapper.giopVersionError( CompletionStatus.COMPLETED_MAYBE); - } - - // IO methods - - // This should do nothing even if it is called. The Message Header is read - // off a java.io.InputStream (not a CDRInputStream) by IIOPConnection - // in order to choose the correct CDR Version , msg_type, and msg_size. - // So, we would never need to read the Message Header off a CDRInputStream. - public void read(org.omg.CORBA.portable.InputStream istream) { - /* - this.magic = istream.read_long(); - this.GIOP_version = (new GIOPVersion()).read(istream); - this.flags = istream.read_octet(); - this.message_type = istream.read_octet(); - this.message_size = istream.read_ulong(); - */ - } - - public void write(org.omg.CORBA.portable.OutputStream ostream) { - ostream.write_long(this.magic); - nullCheck(this.GIOP_version); - this.GIOP_version.write(ostream); - ostream.write_octet(this.flags); - ostream.write_octet(this.message_type); - ostream.write_ulong(this.message_size); - } -} // class Message_1_1 diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/Message_1_2.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/Message_1_2.java deleted file mode 100644 index 5a352ca0b70..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/Message_1_2.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import java.nio.ByteBuffer; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; - -public class Message_1_2 extends Message_1_1 -{ - protected int request_id = (int) 0; - - Message_1_2() {} - - Message_1_2(int _magic, GIOPVersion _GIOP_version, byte _flags, - byte _message_type, int _message_size) { - - super(_magic, - _GIOP_version, - _flags, - _message_type, - _message_size); - } - - /** - * The byteBuffer is presumed to have contents of the message already - * read in. It must have 12 bytes of space at the beginning for the GIOP header, - * but the header doesn't have to be copied in. - */ - public void unmarshalRequestID(ByteBuffer byteBuffer) { - int b1, b2, b3, b4; - - if (!isLittleEndian()) { - b1 = (byteBuffer.get(GIOPMessageHeaderLength+0) << 24) & 0xFF000000; - b2 = (byteBuffer.get(GIOPMessageHeaderLength+1) << 16) & 0x00FF0000; - b3 = (byteBuffer.get(GIOPMessageHeaderLength+2) << 8) & 0x0000FF00; - b4 = (byteBuffer.get(GIOPMessageHeaderLength+3) << 0) & 0x000000FF; - } else { - b1 = (byteBuffer.get(GIOPMessageHeaderLength+3) << 24) & 0xFF000000; - b2 = (byteBuffer.get(GIOPMessageHeaderLength+2) << 16) & 0x00FF0000; - b3 = (byteBuffer.get(GIOPMessageHeaderLength+1) << 8) & 0x0000FF00; - b4 = (byteBuffer.get(GIOPMessageHeaderLength+0) << 0) & 0x000000FF; - } - - this.request_id = (b1 | b2 | b3 | b4); - } - - public void write(org.omg.CORBA.portable.OutputStream ostream) { - if (this.encodingVersion == Message.CDR_ENC_VERSION) { - super.write(ostream); - return; - } - GIOPVersion gv = this.GIOP_version; // save - this.GIOP_version = GIOPVersion.getInstance((byte)13, - this.encodingVersion); - super.write(ostream); - this.GIOP_version = gv; // restore - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/ProfileAddr.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/ProfileAddr.java deleted file mode 100644 index 00eaad7d8e8..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/ProfileAddr.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - - -/** -* com/sun/corba/se/impl/protocol/giopmsgheaders/ProfileAddr.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ../../../../../../../src/share/classes/com/sun/corba/se/GiopIDL/g.idl -* Sunday, June 4, 2000 5:18:54 PM PDT -*/ - -public interface ProfileAddr -{ - public static final short value = (short)(1); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/ReferenceAddr.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/ReferenceAddr.java deleted file mode 100644 index feb7d0d2403..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/ReferenceAddr.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - - -/** -* com/sun/corba/se/impl/protocol/giopmsgheaders/ReferenceAddr.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ../../../../../../../src/share/classes/com/sun/corba/se/GiopIDL/g.idl -* Sunday, June 4, 2000 5:18:54 PM PDT -*/ - -public interface ReferenceAddr -{ - public static final short value = (short)(2); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/ReplyMessage.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/ReplyMessage.java deleted file mode 100644 index 8eaf9f72162..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/ReplyMessage.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import com.sun.corba.se.spi.servicecontext.ServiceContexts; -import org.omg.CORBA.SystemException; -import com.sun.corba.se.spi.ior.IOR; - -/** - * This interface captures the ReplyMessage contract. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public interface ReplyMessage extends Message, LocateReplyOrReplyMessage { - - // Note: If the value, order, or number of these constants change, - // please update the REPLY_MESSAGE_TO_PI_REPLY_STATUS table in PIHandlerImpl. - int NO_EXCEPTION = 0; - int USER_EXCEPTION = 1; - int SYSTEM_EXCEPTION = 2; - int LOCATION_FORWARD = 3; - int LOCATION_FORWARD_PERM = 4; // 1.2 - int NEEDS_ADDRESSING_MODE = 5; // 1.2 - - ServiceContexts getServiceContexts(); - void setServiceContexts( ServiceContexts sc ); - void setIOR( IOR newIOR ); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/ReplyMessage_1_0.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/ReplyMessage_1_0.java deleted file mode 100644 index 4d77e3aff0b..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/ReplyMessage_1_0.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.SystemException; - -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.IORFactories; - -import com.sun.corba.se.spi.orb.ORB; - -import com.sun.corba.se.spi.servicecontext.ServiceContexts; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.impl.encoding.CDRInputStream; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -/** - * This implements the GIOP 1.0 Reply header. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public final class ReplyMessage_1_0 extends Message_1_0 - implements ReplyMessage { - - // Instance variables - - private ORB orb = null; - private ORBUtilSystemException wrapper = null ; - private ServiceContexts service_contexts = null; - private int request_id = (int) 0; - private int reply_status = (int) 0; - private IOR ior = null; - private String exClassName = null; - private int minorCode = (int) 0; - private CompletionStatus completionStatus = null; - - // Constructors - - ReplyMessage_1_0(ORB orb) { - this.orb = orb; - this.wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - } - - ReplyMessage_1_0(ORB orb, ServiceContexts _service_contexts, - int _request_id, int _reply_status, IOR _ior) { - super(Message.GIOPBigMagic, false, Message.GIOPReply, 0); - this.orb = orb; - this.wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - service_contexts = _service_contexts; - request_id = _request_id; - reply_status = _reply_status; - ior = _ior; - } - - // Accessor methods - - public int getRequestId() { - return this.request_id; - } - - public int getReplyStatus() { - return this.reply_status; - } - - public short getAddrDisposition() { - return KeyAddr.value; - } - - public ServiceContexts getServiceContexts() { - return this.service_contexts; - } - - public void setServiceContexts( ServiceContexts sc ) { - this.service_contexts = sc; - } - - public SystemException getSystemException(String message) { - return MessageBase.getSystemException( - exClassName, minorCode, completionStatus, message, wrapper); - } - - public IOR getIOR() { - return this.ior; - } - - public void setIOR( IOR ior ) { - this.ior = ior; - } - - // IO methods - - public void read(org.omg.CORBA.portable.InputStream istream) { - super.read(istream); - this.service_contexts - = new ServiceContexts((org.omg.CORBA_2_3.portable.InputStream) istream); - this.request_id = istream.read_ulong(); - this.reply_status = istream.read_long(); - isValidReplyStatus(this.reply_status); // raises exception on error - - // The code below reads the reply body in some cases - // SYSTEM_EXCEPTION & LOCATION_FORWARD - if (this.reply_status == SYSTEM_EXCEPTION) { - - String reposId = istream.read_string(); - this.exClassName = ORBUtility.classNameOf(reposId); - this.minorCode = istream.read_long(); - int status = istream.read_long(); - - switch (status) { - case CompletionStatus._COMPLETED_YES: - this.completionStatus = CompletionStatus.COMPLETED_YES; - break; - case CompletionStatus._COMPLETED_NO: - this.completionStatus = CompletionStatus.COMPLETED_NO; - break; - case CompletionStatus._COMPLETED_MAYBE: - this.completionStatus = CompletionStatus.COMPLETED_MAYBE; - break; - default: - throw wrapper.badCompletionStatusInReply( - CompletionStatus.COMPLETED_MAYBE, new Integer(status) ); - } - - } else if (this.reply_status == USER_EXCEPTION) { - // do nothing. The client stub will read the exception from body. - } else if (this.reply_status == LOCATION_FORWARD) { - CDRInputStream cdr = (CDRInputStream) istream; - this.ior = IORFactories.makeIOR( cdr ) ; - } - } - - // Note, this writes only the header information. SystemException or - // IOR may be written afterwards into the reply mesg body. - public void write(org.omg.CORBA.portable.OutputStream ostream) { - super.write(ostream); - if (this.service_contexts != null) { - service_contexts.write( - (org.omg.CORBA_2_3.portable.OutputStream) ostream, - GIOPVersion.V1_0); - } else { - ServiceContexts.writeNullServiceContext( - (org.omg.CORBA_2_3.portable.OutputStream) ostream); - } - ostream.write_ulong(this.request_id); - ostream.write_long(this.reply_status); - } - - // Static methods - - public static void isValidReplyStatus(int replyStatus) { - switch (replyStatus) { - case NO_EXCEPTION : - case USER_EXCEPTION : - case SYSTEM_EXCEPTION : - case LOCATION_FORWARD : - break; - default : - ORBUtilSystemException localWrapper = ORBUtilSystemException.get( - CORBALogDomains.RPC_PROTOCOL ) ; - throw localWrapper.illegalReplyStatus( CompletionStatus.COMPLETED_MAYBE); - } - } - - public void callback(MessageHandler handler) - throws java.io.IOException - { - handler.handleInput(this); - } -} // diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/ReplyMessage_1_1.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/ReplyMessage_1_1.java deleted file mode 100644 index 65d8578f634..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/ReplyMessage_1_1.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.SystemException; - -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.IORFactories; - -import com.sun.corba.se.spi.orb.ORB; - -import com.sun.corba.se.spi.servicecontext.ServiceContexts; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.impl.encoding.CDRInputStream; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -/** - * This implements the GIOP 1.1 Reply header. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public final class ReplyMessage_1_1 extends Message_1_1 - implements ReplyMessage { - - // Instance variables - - private ORB orb = null; - private ORBUtilSystemException wrapper = null ; - private ServiceContexts service_contexts = null; - private int request_id = (int) 0; - private int reply_status = (int) 0; - private IOR ior = null; - private String exClassName = null; - private int minorCode = (int) 0; - private CompletionStatus completionStatus = null; - - // Constructors - - ReplyMessage_1_1(ORB orb) { - this.orb = orb; - this.wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - } - - ReplyMessage_1_1(ORB orb, ServiceContexts _service_contexts, - int _request_id, int _reply_status, IOR _ior) { - super(Message.GIOPBigMagic, GIOPVersion.V1_1, FLAG_NO_FRAG_BIG_ENDIAN, - Message.GIOPReply, 0); - this.orb = orb; - this.wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - service_contexts = _service_contexts; - request_id = _request_id; - reply_status = _reply_status; - ior = _ior; - } - - // Accessor methods - - public int getRequestId() { - return this.request_id; - } - - public int getReplyStatus() { - return this.reply_status; - } - - public short getAddrDisposition() { - return KeyAddr.value; - } - - public ServiceContexts getServiceContexts() { - return this.service_contexts; - } - - public void setServiceContexts( ServiceContexts sc ) { - this.service_contexts = sc; - } - - public SystemException getSystemException(String message) { - return MessageBase.getSystemException( - exClassName, minorCode, completionStatus, message, wrapper); - } - - public IOR getIOR() { - return this.ior; - } - - public void setIOR( IOR ior ) { - this.ior = ior; - } - - // IO methods - - public void read(org.omg.CORBA.portable.InputStream istream) { - super.read(istream); - this.service_contexts - = new ServiceContexts((org.omg.CORBA_2_3.portable.InputStream) istream); - this.request_id = istream.read_ulong(); - this.reply_status = istream.read_long(); - isValidReplyStatus(this.reply_status); // raises exception on error - - // The code below reads the reply body in some cases - // SYSTEM_EXCEPTION & LOCATION_FORWARD - if (this.reply_status == SYSTEM_EXCEPTION) { - - String reposId = istream.read_string(); - this.exClassName = ORBUtility.classNameOf(reposId); - this.minorCode = istream.read_long(); - int status = istream.read_long(); - - switch (status) { - case CompletionStatus._COMPLETED_YES: - this.completionStatus = CompletionStatus.COMPLETED_YES; - break; - case CompletionStatus._COMPLETED_NO: - this.completionStatus = CompletionStatus.COMPLETED_NO; - break; - case CompletionStatus._COMPLETED_MAYBE: - this.completionStatus = CompletionStatus.COMPLETED_MAYBE; - break; - default: - throw wrapper.badCompletionStatusInReply( - CompletionStatus.COMPLETED_MAYBE, new Integer(status) ); - } - } else if (this.reply_status == USER_EXCEPTION) { - // do nothing. The client stub will read the exception from body. - } else if (this.reply_status == LOCATION_FORWARD) { - CDRInputStream cdr = (CDRInputStream) istream; - this.ior = IORFactories.makeIOR(cdr) ; - } - } - - // Note, this writes only the header information. SystemException or - // IOR may be written afterwards into the reply mesg body. - public void write(org.omg.CORBA.portable.OutputStream ostream) { - super.write(ostream); - if (this.service_contexts != null) { - service_contexts.write( - (org.omg.CORBA_2_3.portable.OutputStream) ostream, - GIOPVersion.V1_1); - } else { - ServiceContexts.writeNullServiceContext( - (org.omg.CORBA_2_3.portable.OutputStream) ostream); - } - ostream.write_ulong(this.request_id); - ostream.write_long(this.reply_status); - } - - // Static methods - - public static void isValidReplyStatus(int replyStatus) { - switch (replyStatus) { - case NO_EXCEPTION : - case USER_EXCEPTION : - case SYSTEM_EXCEPTION : - case LOCATION_FORWARD : - break; - default : - ORBUtilSystemException localWrapper = ORBUtilSystemException.get( - CORBALogDomains.RPC_PROTOCOL ) ; - throw localWrapper.illegalReplyStatus( CompletionStatus.COMPLETED_MAYBE); - } - } - - public void callback(MessageHandler handler) - throws java.io.IOException - { - handler.handleInput(this); - } -} // diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/ReplyMessage_1_2.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/ReplyMessage_1_2.java deleted file mode 100644 index de97cbae005..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/ReplyMessage_1_2.java +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.SystemException; -import org.omg.CORBA.CompletionStatus; - -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.IORFactories ; - -import com.sun.corba.se.spi.orb.ORB; - -import com.sun.corba.se.spi.servicecontext.ServiceContexts; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; - -import com.sun.corba.se.impl.encoding.CDRInputStream; -import com.sun.corba.se.impl.encoding.CDROutputStream; -import com.sun.corba.se.impl.encoding.CDRInputStream_1_2; -import com.sun.corba.se.impl.encoding.CDROutputStream_1_2; - -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.orbutil.ORBConstants; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -/** - * This implements the GIOP 1.2 Reply header. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public final class ReplyMessage_1_2 extends Message_1_2 - implements ReplyMessage { - - // Instance variables - - private ORB orb = null; - private ORBUtilSystemException wrapper = null ; - private int reply_status = (int) 0; - private ServiceContexts service_contexts = null; - private IOR ior = null; - private String exClassName = null; - private int minorCode = (int) 0; - private CompletionStatus completionStatus = null; - private short addrDisposition = KeyAddr.value; // default; - - // Constructors - - ReplyMessage_1_2(ORB orb) { - this.orb = orb; - this.wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - } - - ReplyMessage_1_2(ORB orb, int _request_id, int _reply_status, - ServiceContexts _service_contexts, IOR _ior) { - super(Message.GIOPBigMagic, GIOPVersion.V1_2, FLAG_NO_FRAG_BIG_ENDIAN, - Message.GIOPReply, 0); - this.orb = orb; - this.wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - request_id = _request_id; - reply_status = _reply_status; - service_contexts = _service_contexts; - ior = _ior; - } - - // Accessor methods - - public int getRequestId() { - return this.request_id; - } - - public int getReplyStatus() { - return this.reply_status; - } - - public short getAddrDisposition() { - return this.addrDisposition; - } - - public ServiceContexts getServiceContexts() { - return this.service_contexts; - } - - public void setServiceContexts( ServiceContexts sc ) { - this.service_contexts = sc; - } - - public SystemException getSystemException(String message) { - return MessageBase.getSystemException( - exClassName, minorCode, completionStatus, message, wrapper); - } - - public IOR getIOR() { - return this.ior; - } - - public void setIOR( IOR ior ) { - this.ior = ior; - } - - // IO methods - - public void read(org.omg.CORBA.portable.InputStream istream) { - super.read(istream); - this.request_id = istream.read_ulong(); - this.reply_status = istream.read_long(); - isValidReplyStatus(this.reply_status); // raises exception on error - this.service_contexts - = new ServiceContexts((org.omg.CORBA_2_3.portable.InputStream) istream); - - // CORBA formal 00-11-0 15.4.2.2 GIOP 1.2 body must be - // aligned on an 8 octet boundary. - // Ensures that the first read operation called from the stub code, - // during body deconstruction, would skip the header padding, that was - // inserted to ensure that the body was aligned on an 8-octet boundary. - ((CDRInputStream)istream).setHeaderPadding(true); - - // The code below reads the reply body in some cases - // SYSTEM_EXCEPTION & LOCATION_FORWARD & LOCATION_FORWARD_PERM & - // NEEDS_ADDRESSING_MODE - if (this.reply_status == SYSTEM_EXCEPTION) { - - String reposId = istream.read_string(); - this.exClassName = ORBUtility.classNameOf(reposId); - this.minorCode = istream.read_long(); - int status = istream.read_long(); - - switch (status) { - case CompletionStatus._COMPLETED_YES: - this.completionStatus = CompletionStatus.COMPLETED_YES; - break; - case CompletionStatus._COMPLETED_NO: - this.completionStatus = CompletionStatus.COMPLETED_NO; - break; - case CompletionStatus._COMPLETED_MAYBE: - this.completionStatus = CompletionStatus.COMPLETED_MAYBE; - break; - default: - throw wrapper.badCompletionStatusInReply( - CompletionStatus.COMPLETED_MAYBE, new Integer(status) ); - } - - } else if (this.reply_status == USER_EXCEPTION) { - // do nothing. The client stub will read the exception from body. - } else if ( (this.reply_status == LOCATION_FORWARD) || - (this.reply_status == LOCATION_FORWARD_PERM) ){ - CDRInputStream cdr = (CDRInputStream) istream; - this.ior = IORFactories.makeIOR( cdr ) ; - } else if (this.reply_status == NEEDS_ADDRESSING_MODE) { - // read GIOP::AddressingDisposition from body and resend the - // original request using the requested addressing mode. The - // resending is transparent to the client program. - this.addrDisposition = AddressingDispositionHelper.read(istream); - } - } - - // Note, this writes only the header information. SystemException or - // IOR or GIOP::AddressingDisposition may be written afterwards into the - // reply mesg body. - public void write(org.omg.CORBA.portable.OutputStream ostream) { - super.write(ostream); - ostream.write_ulong(this.request_id); - ostream.write_long(this.reply_status); - if (this.service_contexts != null) { - service_contexts.write( - (org.omg.CORBA_2_3.portable.OutputStream) ostream, - GIOPVersion.V1_2); - } else { - ServiceContexts.writeNullServiceContext( - (org.omg.CORBA_2_3.portable.OutputStream) ostream); - } - - // CORBA formal 00-11-0 15.4.2.2 GIOP 1.2 body must be - // aligned on an 8 octet boundary. - // Ensures that the first write operation called from the stub code, - // during body construction, would insert a header padding, such that - // the body is aligned on an 8-octet boundary. - ((CDROutputStream)ostream).setHeaderPadding(true); - - } - - // Static methods - - public static void isValidReplyStatus(int replyStatus) { - switch (replyStatus) { - case NO_EXCEPTION : - case USER_EXCEPTION : - case SYSTEM_EXCEPTION : - case LOCATION_FORWARD : - case LOCATION_FORWARD_PERM : - case NEEDS_ADDRESSING_MODE : - break; - default : - ORBUtilSystemException localWrapper = ORBUtilSystemException.get( - CORBALogDomains.RPC_PROTOCOL ) ; - throw localWrapper.illegalReplyStatus( CompletionStatus.COMPLETED_MAYBE); - } - } - - public void callback(MessageHandler handler) - throws java.io.IOException - { - handler.handleInput(this); - } -} // class ReplyMessage_1_2 diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/RequestMessage.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/RequestMessage.java deleted file mode 100644 index 2a3df7854e9..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/RequestMessage.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import org.omg.CORBA.Principal; -import com.sun.corba.se.spi.ior.ObjectKey; -import com.sun.corba.se.spi.servicecontext.ServiceContexts; - -/** - * This interface captures the RequestMessage contract. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public interface RequestMessage extends Message { - - byte RESPONSE_EXPECTED_BIT = 0x01; - - ServiceContexts getServiceContexts(); - int getRequestId(); - boolean isResponseExpected(); - byte[] getReserved(); - ObjectKey getObjectKey(); - String getOperation(); - Principal getPrincipal(); - - // NOTE: This is a SUN PROPRIETARY EXTENSION - void setThreadPoolToUse(int poolToUse); - - -} // interface RequestMessage diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/RequestMessage_1_0.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/RequestMessage_1_0.java deleted file mode 100644 index 8dfa66b5bfe..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/RequestMessage_1_0.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import org.omg.CORBA.Principal; -import com.sun.corba.se.spi.servicecontext.ServiceContexts; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.ior.ObjectKey; - -/** - * This implements the GIOP 1.0 Request header. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public final class RequestMessage_1_0 extends Message_1_0 - implements RequestMessage { - - // Instance variables - - private ORB orb = null; - private ServiceContexts service_contexts = null; - private int request_id = (int) 0; - private boolean response_expected = false; - private byte[] object_key = null; - private String operation = null; - private Principal requesting_principal = null; - private ObjectKey objectKey = null; - - // Constructor - - RequestMessage_1_0(ORB orb) { - this.orb = orb; - } - - RequestMessage_1_0(ORB orb, ServiceContexts _service_contexts, - int _request_id, boolean _response_expected, byte[] _object_key, - String _operation, Principal _requesting_principal) { - super(Message.GIOPBigMagic, false, Message.GIOPRequest, 0); - this.orb = orb; - service_contexts = _service_contexts; - request_id = _request_id; - response_expected = _response_expected; - object_key = _object_key; - operation = _operation; - requesting_principal = _requesting_principal; - } - - // Accessor methods (RequestMessage interface) - - public ServiceContexts getServiceContexts() { - return this.service_contexts; - } - - public int getRequestId() { - return this.request_id; - } - - public boolean isResponseExpected() { - return this.response_expected; - } - - public byte[] getReserved() { - // REVISIT Should we throw an exception or return null ? - return null; - } - - public ObjectKey getObjectKey() { - if (this.objectKey == null) { - // this will raise a MARSHAL exception upon errors. - this.objectKey = MessageBase.extractObjectKey(object_key, orb); - } - - return this.objectKey; - } - - public String getOperation() { - return this.operation; - } - - public Principal getPrincipal() { - return this.requesting_principal; - } - - - // Mutators - - public void setThreadPoolToUse(int poolToUse) { - // No-op, must be GIOP Version 1.1 or greater - // to support this SUN PROPRIETARY EXTENSION. - } - - - // IO methods - - public void read(org.omg.CORBA.portable.InputStream istream) { - super.read(istream); - this.service_contexts - = new ServiceContexts((org.omg.CORBA_2_3.portable.InputStream) istream); - this.request_id = istream.read_ulong(); - this.response_expected = istream.read_boolean(); - int _len0 = istream.read_long(); - this.object_key = new byte[_len0]; - istream.read_octet_array(this.object_key, 0, _len0); - this.operation = istream.read_string(); - this.requesting_principal = istream.read_Principal(); - } - - public void write(org.omg.CORBA.portable.OutputStream ostream) { - super.write(ostream); - if (this.service_contexts != null) { - service_contexts.write( - (org.omg.CORBA_2_3.portable.OutputStream) ostream, - GIOPVersion.V1_0); - } else { - ServiceContexts.writeNullServiceContext( - (org.omg.CORBA_2_3.portable.OutputStream) ostream); - } - ostream.write_ulong(this.request_id); - ostream.write_boolean(this.response_expected); - nullCheck(this.object_key); - ostream.write_long(this.object_key.length); - ostream.write_octet_array(this.object_key, 0, this.object_key.length); - ostream.write_string(this.operation); - if (this.requesting_principal != null) { - ostream.write_Principal(this.requesting_principal); - } else { - ostream.write_long(0); - } - } - - public void callback(MessageHandler handler) - throws java.io.IOException - { - handler.handleInput(this); - } -} // class RequestMessage_1_0 diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/RequestMessage_1_1.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/RequestMessage_1_1.java deleted file mode 100644 index 00068b19061..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/RequestMessage_1_1.java +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import org.omg.CORBA.Principal; -import com.sun.corba.se.spi.servicecontext.ServiceContexts; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.ior.ObjectKey; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -/** - * This implements the GIOP 1.1 Request header. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public final class RequestMessage_1_1 extends Message_1_1 - implements RequestMessage { - - // Instance variables - - private ORB orb = null; - private ORBUtilSystemException wrapper = null ; - private ServiceContexts service_contexts = null; - private int request_id = (int) 0; - private boolean response_expected = false; - private byte[] reserved = null; // Added in GIOP 1.1 - private byte[] object_key = null; - private String operation = null; - private Principal requesting_principal = null; - private ObjectKey objectKey = null; - - // Constructors - - RequestMessage_1_1(ORB orb) { - this.orb = orb; - this.wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - } - - RequestMessage_1_1(ORB orb, ServiceContexts _service_contexts, - int _request_id, boolean _response_expected, byte[] _reserved, - byte[] _object_key, String _operation, - Principal _requesting_principal) { - super(Message.GIOPBigMagic, GIOPVersion.V1_1, FLAG_NO_FRAG_BIG_ENDIAN, - Message.GIOPRequest, 0); - this.orb = orb; - this.wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - service_contexts = _service_contexts; - request_id = _request_id; - response_expected = _response_expected; - reserved = _reserved; - object_key = _object_key; - operation = _operation; - requesting_principal = _requesting_principal; - } - - // Accessor methods (RequestMessage interface) - - public ServiceContexts getServiceContexts() { - return this.service_contexts; - } - - public int getRequestId() { - return this.request_id; - } - - public boolean isResponseExpected() { - return this.response_expected; - } - - public byte[] getReserved() { - return this.reserved; - } - - public ObjectKey getObjectKey() { - if (this.objectKey == null) { - // this will raise a MARSHAL exception upon errors. - this.objectKey = MessageBase.extractObjectKey(object_key, orb); - } - - return this.objectKey; - } - - public String getOperation() { - return this.operation; - } - - public Principal getPrincipal() { - return this.requesting_principal; - } - - // IO methods - - public void read(org.omg.CORBA.portable.InputStream istream) { - super.read(istream); - this.service_contexts - = new ServiceContexts((org.omg.CORBA_2_3.portable.InputStream) istream); - this.request_id = istream.read_ulong(); - this.response_expected = istream.read_boolean(); - this.reserved = new byte[3]; - for (int _o0 = 0;_o0 < (3); ++_o0) { - this.reserved[_o0] = istream.read_octet(); - } - int _len1 = istream.read_long(); - this.object_key = new byte[_len1]; - istream.read_octet_array(this.object_key, 0, _len1); - this.operation = istream.read_string(); - this.requesting_principal = istream.read_Principal(); - } - - public void write(org.omg.CORBA.portable.OutputStream ostream) { - super.write(ostream); - if (this.service_contexts != null) { - service_contexts.write( - (org.omg.CORBA_2_3.portable.OutputStream) ostream, - GIOPVersion.V1_1); - } else { - ServiceContexts.writeNullServiceContext( - (org.omg.CORBA_2_3.portable.OutputStream) ostream); - } - ostream.write_ulong(this.request_id); - ostream.write_boolean(this.response_expected); - nullCheck(this.reserved); - if (this.reserved.length != (3)) { - throw wrapper.badReservedLength( - org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE); - } - for (int _i0 = 0;_i0 < (3); ++_i0) { - ostream.write_octet(this.reserved[_i0]); - } - nullCheck(this.object_key); - ostream.write_long(this.object_key.length); - ostream.write_octet_array(this.object_key, 0, this.object_key.length); - ostream.write_string(this.operation); - if (this.requesting_principal != null) { - ostream.write_Principal(this.requesting_principal); - } else { - ostream.write_long(0); - } - } - - public void callback(MessageHandler handler) - throws java.io.IOException - { - handler.handleInput(this); - } -} // class RequestMessage_1_1 diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/RequestMessage_1_2.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/RequestMessage_1_2.java deleted file mode 100644 index 706bdc4f778..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/RequestMessage_1_2.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - -import org.omg.CORBA.Principal; -import com.sun.corba.se.spi.servicecontext.ServiceContexts; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.ior.ObjectKey; -import com.sun.corba.se.impl.encoding.CDRInputStream; -import com.sun.corba.se.impl.encoding.CDROutputStream; -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.impl.encoding.CDRInputStream_1_2; -import com.sun.corba.se.impl.encoding.CDROutputStream_1_2; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -/** - * This implements the GIOP 1.2 Request header. - * - * @author Ram Jeyaraman 05/14/2000 - */ - -public final class RequestMessage_1_2 extends Message_1_2 - implements RequestMessage { - - // Instance variables - - private ORB orb = null; - private ORBUtilSystemException wrapper = null ; - private byte response_flags = (byte) 0; - private byte reserved[] = null; - private TargetAddress target = null; - private String operation = null; - private ServiceContexts service_contexts = null; - private ObjectKey objectKey = null; - - // Constructors - - RequestMessage_1_2(ORB orb) { - this.orb = orb; - this.wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - } - - RequestMessage_1_2(ORB orb, int _request_id, byte _response_flags, - byte[] _reserved, TargetAddress _target, - String _operation, ServiceContexts _service_contexts) { - super(Message.GIOPBigMagic, GIOPVersion.V1_2, FLAG_NO_FRAG_BIG_ENDIAN, - Message.GIOPRequest, 0); - this.orb = orb; - this.wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - request_id = _request_id; - response_flags = _response_flags; - reserved = _reserved; - target = _target; - operation = _operation; - service_contexts = _service_contexts; - } - - // Accessor methods (RequestMessage interface) - - public int getRequestId() { - return this.request_id; - } - - public boolean isResponseExpected() { - /* - case 1: LSBit[1] == 1 - not a oneway call (DII flag INV_NO_RESPONSE is false) // Ox03 - LSBit[0] must be 1. - case 2: LSBit[1] == 0 - if (LSB[0] == 0) // Ox00 - oneway call - else if (LSB[0] == 1) // 0x01 - oneway call; but server may provide - a location forward response or system exception response. - */ - - if ( (this.response_flags & RESPONSE_EXPECTED_BIT) == RESPONSE_EXPECTED_BIT ) { - return true; - } - - return false; - } - - public byte[] getReserved() { - return this.reserved; - } - - public ObjectKey getObjectKey() { - if (this.objectKey == null) { - // this will raise a MARSHAL exception upon errors. - this.objectKey = MessageBase.extractObjectKey(target, orb); - } - - return this.objectKey; - } - - public String getOperation() { - return this.operation; - } - - public Principal getPrincipal() { - // REVISIT Should we throw an exception or return null ? - return null; - } - - public ServiceContexts getServiceContexts() { - return this.service_contexts; - } - - // IO methods - - public void read(org.omg.CORBA.portable.InputStream istream) { - super.read(istream); - this.request_id = istream.read_ulong(); - this.response_flags = istream.read_octet(); - this.reserved = new byte[3]; - for (int _o0 = 0;_o0 < (3); ++_o0) { - this.reserved[_o0] = istream.read_octet(); - } - this.target = TargetAddressHelper.read(istream); - getObjectKey(); // this does AddressingDisposition check - this.operation = istream.read_string(); - this.service_contexts - = new ServiceContexts((org.omg.CORBA_2_3.portable.InputStream) istream); - - // CORBA formal 00-11-0 15.4.2.2 GIOP 1.2 body must be - // aligned on an 8 octet boundary. - // Ensures that the first read operation called from the stub code, - // during body deconstruction, would skip the header padding, that was - // inserted to ensure that the body was aligned on an 8-octet boundary. - ((CDRInputStream)istream).setHeaderPadding(true); - - } - - public void write(org.omg.CORBA.portable.OutputStream ostream) { - super.write(ostream); - ostream.write_ulong(this.request_id); - ostream.write_octet(this.response_flags); - nullCheck(this.reserved); - if (this.reserved.length != (3)) { - throw wrapper.badReservedLength( - org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE); - } - for (int _i0 = 0;_i0 < (3); ++_i0) { - ostream.write_octet(this.reserved[_i0]); - } - nullCheck(this.target); - TargetAddressHelper.write(ostream, this.target); - ostream.write_string(this.operation); - if (this.service_contexts != null) { - service_contexts.write( - (org.omg.CORBA_2_3.portable.OutputStream) ostream, - GIOPVersion.V1_2); - } else { - ServiceContexts.writeNullServiceContext( - (org.omg.CORBA_2_3.portable.OutputStream) ostream); - } - - // CORBA formal 00-11-0 15.4.2.2 GIOP 1.2 body must be - // aligned on an 8 octet boundary. - // Ensures that the first write operation called from the stub code, - // during body construction, would insert a header padding, such that - // the body is aligned on an 8-octet boundary. - ((CDROutputStream)ostream).setHeaderPadding(true); - } - - public void callback(MessageHandler handler) - throws java.io.IOException - { - handler.handleInput(this); - } -} // class RequestMessage_1_2 diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/TargetAddress.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/TargetAddress.java deleted file mode 100644 index bfaf1a092c4..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/TargetAddress.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - - -/** -* com/sun/corba/se/impl/protocol/giopmsgheaders/TargetAddress.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ../../../../../../../src/share/classes/com/sun/corba/se/GiopIDL/g.idl -* Sunday, June 4, 2000 5:18:54 PM PDT -*/ - -public final class TargetAddress implements org.omg.CORBA.portable.IDLEntity -{ - private byte[] ___object_key; - private org.omg.IOP.TaggedProfile ___profile; - private com.sun.corba.se.impl.protocol.giopmsgheaders.IORAddressingInfo ___ior; - private short __discriminator; - private boolean __uninitialized = true; - - public TargetAddress () - { - } - - public short discriminator () - { - if (__uninitialized) - throw new org.omg.CORBA.BAD_OPERATION (); - return __discriminator; - } - - public byte[] object_key () - { - if (__uninitialized) - throw new org.omg.CORBA.BAD_OPERATION (); - verifyobject_key (__discriminator); - return ___object_key; - } - - public void object_key (byte[] value) - { - __discriminator = com.sun.corba.se.impl.protocol.giopmsgheaders.KeyAddr.value; - ___object_key = value; - __uninitialized = false; - } - - private void verifyobject_key (short discriminator) - { - if (discriminator != com.sun.corba.se.impl.protocol.giopmsgheaders.KeyAddr.value) - throw new org.omg.CORBA.BAD_OPERATION (); - } - - public org.omg.IOP.TaggedProfile profile () - { - if (__uninitialized) - throw new org.omg.CORBA.BAD_OPERATION (); - verifyprofile (__discriminator); - return ___profile; - } - - public void profile (org.omg.IOP.TaggedProfile value) - { - __discriminator = com.sun.corba.se.impl.protocol.giopmsgheaders.ProfileAddr.value; - ___profile = value; - __uninitialized = false; - } - - private void verifyprofile (short discriminator) - { - if (discriminator != com.sun.corba.se.impl.protocol.giopmsgheaders.ProfileAddr.value) - throw new org.omg.CORBA.BAD_OPERATION (); - } - - public com.sun.corba.se.impl.protocol.giopmsgheaders.IORAddressingInfo ior () - { - if (__uninitialized) - throw new org.omg.CORBA.BAD_OPERATION (); - verifyior (__discriminator); - return ___ior; - } - - public void ior (com.sun.corba.se.impl.protocol.giopmsgheaders.IORAddressingInfo value) - { - __discriminator = com.sun.corba.se.impl.protocol.giopmsgheaders.ReferenceAddr.value; - ___ior = value; - __uninitialized = false; - } - - private void verifyior (short discriminator) - { - if (discriminator != com.sun.corba.se.impl.protocol.giopmsgheaders.ReferenceAddr.value) - throw new org.omg.CORBA.BAD_OPERATION (); - } - - public void _default () - { - __discriminator = -32768; - __uninitialized = false; - } - -} // class TargetAddress diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/TargetAddressHelper.java b/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/TargetAddressHelper.java deleted file mode 100644 index 080e86d5c09..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/TargetAddressHelper.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.protocol.giopmsgheaders; - - -/** -* com/sun/corba/se/impl/protocol/giopmsgheaders/TargetAddressHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ../../../../../../../src/share/classes/com/sun/corba/se/GiopIDL/g.idl -* Sunday, June 4, 2000 5:18:54 PM PDT -*/ - -abstract public class TargetAddressHelper -{ - private static String _id = "IDL:messages/TargetAddress:1.0"; - - public static void insert (org.omg.CORBA.Any a, com.sun.corba.se.impl.protocol.giopmsgheaders.TargetAddress that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static com.sun.corba.se.impl.protocol.giopmsgheaders.TargetAddress extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - org.omg.CORBA.TypeCode _disTypeCode0; - _disTypeCode0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_short); - _disTypeCode0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.corba.se.impl.protocol.giopmsgheaders.AddressingDispositionHelper.id (), "AddressingDisposition", _disTypeCode0); - org.omg.CORBA.UnionMember[] _members0 = new org.omg.CORBA.UnionMember [3]; - org.omg.CORBA.TypeCode _tcOf_members0; - org.omg.CORBA.Any _anyOf_members0; - - // Branch for object_key - _anyOf_members0 = org.omg.CORBA.ORB.init ().create_any (); - _anyOf_members0.insert_short ((short)com.sun.corba.se.impl.protocol.giopmsgheaders.KeyAddr.value); - _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_octet); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_sequence_tc (0, _tcOf_members0); - _members0[0] = new org.omg.CORBA.UnionMember ( - "object_key", - _anyOf_members0, - _tcOf_members0, - null); - - // Branch for profile - _anyOf_members0 = org.omg.CORBA.ORB.init ().create_any (); - _anyOf_members0.insert_short ((short)com.sun.corba.se.impl.protocol.giopmsgheaders.ProfileAddr.value); - _tcOf_members0 = org.omg.IOP.TaggedProfileHelper.type (); - _members0[1] = new org.omg.CORBA.UnionMember ( - "profile", - _anyOf_members0, - _tcOf_members0, - null); - - // Branch for ior - _anyOf_members0 = org.omg.CORBA.ORB.init ().create_any (); - _anyOf_members0.insert_short ((short)com.sun.corba.se.impl.protocol.giopmsgheaders.ReferenceAddr.value); - _tcOf_members0 = com.sun.corba.se.impl.protocol.giopmsgheaders.IORAddressingInfoHelper.type (); - _members0[2] = new org.omg.CORBA.UnionMember ( - "ior", - _anyOf_members0, - _tcOf_members0, - null); - __typeCode = org.omg.CORBA.ORB.init ().create_union_tc (com.sun.corba.se.impl.protocol.giopmsgheaders.TargetAddressHelper.id (), "TargetAddress", _disTypeCode0, _members0); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static com.sun.corba.se.impl.protocol.giopmsgheaders.TargetAddress read (org.omg.CORBA.portable.InputStream istream) - { - com.sun.corba.se.impl.protocol.giopmsgheaders.TargetAddress value = new com.sun.corba.se.impl.protocol.giopmsgheaders.TargetAddress (); - short _dis0 = (short)0; - _dis0 = istream.read_short (); - switch (_dis0) - { - case com.sun.corba.se.impl.protocol.giopmsgheaders.KeyAddr.value: - byte _object_key[] = null; - int _len1 = istream.read_long (); - _object_key = new byte[_len1]; - istream.read_octet_array (_object_key, 0, _len1); - value.object_key (_object_key); - break; - case com.sun.corba.se.impl.protocol.giopmsgheaders.ProfileAddr.value: - org.omg.IOP.TaggedProfile _profile = null; - _profile = org.omg.IOP.TaggedProfileHelper.read (istream); - value.profile (_profile); - break; - case com.sun.corba.se.impl.protocol.giopmsgheaders.ReferenceAddr.value: - com.sun.corba.se.impl.protocol.giopmsgheaders.IORAddressingInfo _ior = null; - _ior = com.sun.corba.se.impl.protocol.giopmsgheaders.IORAddressingInfoHelper.read (istream); - value.ior (_ior); - break; - default: - throw new org.omg.CORBA.BAD_OPERATION (); - } - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.corba.se.impl.protocol.giopmsgheaders.TargetAddress value) - { - ostream.write_short (value.discriminator ()); - switch (value.discriminator ()) - { - case com.sun.corba.se.impl.protocol.giopmsgheaders.KeyAddr.value: - ostream.write_long (value.object_key ().length); - ostream.write_octet_array (value.object_key (), 0, value.object_key ().length); - break; - case com.sun.corba.se.impl.protocol.giopmsgheaders.ProfileAddr.value: - org.omg.IOP.TaggedProfileHelper.write (ostream, value.profile ()); - break; - case com.sun.corba.se.impl.protocol.giopmsgheaders.ReferenceAddr.value: - com.sun.corba.se.impl.protocol.giopmsgheaders.IORAddressingInfoHelper.write (ostream, value.ior ()); - break; - default: - throw new org.omg.CORBA.BAD_OPERATION (); - } - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/resolver/BootstrapResolverImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/resolver/BootstrapResolverImpl.java deleted file mode 100644 index cd02af72032..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/resolver/BootstrapResolverImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.resolver ; - -import org.omg.CORBA.portable.InputStream ; -import org.omg.CORBA.portable.OutputStream ; -import org.omg.CORBA.portable.ApplicationException ; -import org.omg.CORBA.portable.RemarshalException ; - -import com.sun.corba.se.spi.ior.IOR ; -import com.sun.corba.se.spi.ior.IORFactories ; -import com.sun.corba.se.spi.ior.IORTemplate ; -import com.sun.corba.se.spi.ior.ObjectKey ; -import com.sun.corba.se.spi.ior.ObjectKeyFactory ; -import com.sun.corba.se.spi.ior.iiop.IIOPAddress ; -import com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate ; -import com.sun.corba.se.spi.ior.iiop.IIOPFactories ; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion ; -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.resolver.Resolver ; - -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; -import com.sun.corba.se.impl.orbutil.ORBUtility ; - -public class BootstrapResolverImpl implements Resolver { - private org.omg.CORBA.portable.Delegate bootstrapDelegate ; - private ORBUtilSystemException wrapper ; - - public BootstrapResolverImpl(ORB orb, String host, int port) { - wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.ORB_RESOLVER ) ; - - // Create a new IOR with the magic of INIT - byte[] initialKey = "INIT".getBytes() ; - ObjectKey okey = orb.getObjectKeyFactory().create(initialKey) ; - - IIOPAddress addr = IIOPFactories.makeIIOPAddress( orb, host, port ) ; - IIOPProfileTemplate ptemp = IIOPFactories.makeIIOPProfileTemplate( - orb, GIOPVersion.V1_0, addr); - - IORTemplate iortemp = IORFactories.makeIORTemplate( okey.getTemplate() ) ; - iortemp.add( ptemp ) ; - - IOR initialIOR = iortemp.makeIOR( (com.sun.corba.se.spi.orb.ORB)orb, - "", okey.getId() ) ; - - bootstrapDelegate = ORBUtility.makeClientDelegate( initialIOR ) ; - } - - /** - * For the BootStrap operation we do not expect to have more than one - * parameter. We do not want to extend BootStrap protocol any further, - * as INS handles most of what BootStrap can handle in a portable way. - * - * @return InputStream which contains the response from the - * BootStrapOperation. - */ - private InputStream invoke( String operationName, String parameter ) - { - boolean remarshal = true; - - // Invoke. - - InputStream inStream = null; - - // If there is a location forward then you will need - // to invoke again on the updated information. - // Just calling this same routine with the same host/port - // does not take the location forward info into account. - - while (remarshal) { - org.omg.CORBA.Object objref = null ; - remarshal = false; - - OutputStream os = (OutputStream) bootstrapDelegate.request( objref, - operationName, true); - - if ( parameter != null ) { - os.write_string( parameter ); - } - - try { - // The only reason a null objref is passed is to get the version of - // invoke used by streams. Otherwise the PortableInterceptor - // call stack will become unbalanced since the version of - // invoke which only takes the stream does not call - // PortableInterceptor ending points. - // Note that the first parameter is ignored inside invoke. - - inStream = bootstrapDelegate.invoke( objref, os); - } catch (ApplicationException e) { - throw wrapper.bootstrapApplicationException( e ) ; - } catch (RemarshalException e) { - // XXX log this - remarshal = true; - } - } - - return inStream; - } - - public org.omg.CORBA.Object resolve( String identifier ) - { - InputStream inStream = null ; - org.omg.CORBA.Object result = null ; - - try { - inStream = invoke( "get", identifier ) ; - - result = inStream.read_Object(); - - // NOTE: do note trap and ignore errors. - // Let them flow out. - } finally { - bootstrapDelegate.releaseReply( null, inStream ) ; - } - - return result ; - } - - public java.util.Set list() - { - InputStream inStream = null ; - java.util.Set result = new java.util.HashSet() ; - - try { - inStream = invoke( "list", null ) ; - - int count = inStream.read_long(); - for (int i=0; i < count; i++) - result.add( inStream.read_string() ) ; - - // NOTE: do note trap and ignore errors. - // Let them flow out. - } finally { - bootstrapDelegate.releaseReply( null, inStream ) ; - } - - return result ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/resolver/CompositeResolverImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/resolver/CompositeResolverImpl.java deleted file mode 100644 index 0691055e19f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/resolver/CompositeResolverImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.resolver ; - -import java.util.Set ; -import java.util.HashSet ; - -import com.sun.corba.se.spi.resolver.Resolver ; - -public class CompositeResolverImpl implements Resolver { - private Resolver first ; - private Resolver second ; - - public CompositeResolverImpl( Resolver first, Resolver second ) - { - this.first = first ; - this.second = second ; - } - - public org.omg.CORBA.Object resolve( String name ) - { - org.omg.CORBA.Object result = first.resolve( name ) ; - if (result == null) - result = second.resolve( name ) ; - return result ; - } - - public java.util.Set list() - { - Set result = new HashSet() ; - result.addAll( first.list() ) ; - result.addAll( second.list() ) ; - return result ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/resolver/FileResolverImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/resolver/FileResolverImpl.java deleted file mode 100644 index 959406462fd..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/resolver/FileResolverImpl.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.resolver ; - -import org.omg.CORBA.ORBPackage.InvalidName; - -import com.sun.corba.se.spi.resolver.Resolver ; - -import java.util.Enumeration; -import java.util.Properties; -import java.util.Set; -import java.util.HashSet; - -import java.io.File; -import java.io.FileInputStream; - -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.impl.orbutil.CorbaResourceUtil ; - -public class FileResolverImpl implements Resolver -{ - private ORB orb ; - private File file ; - private Properties savedProps ; - private long fileModified = 0 ; - - public FileResolverImpl( ORB orb, File file ) - { - this.orb = orb ; - this.file = file ; - savedProps = new Properties() ; - } - - public org.omg.CORBA.Object resolve( String name ) - { - check() ; - String stringifiedObject = savedProps.getProperty( name ) ; - if (stringifiedObject == null) { - return null; - } - return orb.string_to_object( stringifiedObject ) ; - } - - public java.util.Set list() - { - check() ; - - Set result = new HashSet() ; - - // Obtain all the keys from the property object - Enumeration theKeys = savedProps.propertyNames(); - while (theKeys.hasMoreElements()) { - result.add( theKeys.nextElement() ) ; - } - - return result ; - } - - /** - * Checks the lastModified() timestamp of the file and optionally - * re-reads the Properties object from the file if newer. - */ - private void check() - { - if (file == null) - return; - - long lastMod = file.lastModified(); - if (lastMod > fileModified) { - try { - FileInputStream fileIS = new FileInputStream(file); - savedProps.clear(); - savedProps.load(fileIS); - fileIS.close(); - fileModified = lastMod; - } catch (java.io.FileNotFoundException e) { - System.err.println( CorbaResourceUtil.getText( - "bootstrap.filenotfound", file.getAbsolutePath())); - } catch (java.io.IOException e) { - System.err.println( CorbaResourceUtil.getText( - "bootstrap.exception", - file.getAbsolutePath(), e.toString())); - } - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/resolver/INSURLOperationImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/resolver/INSURLOperationImpl.java deleted file mode 100644 index 91976a2b5a2..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/resolver/INSURLOperationImpl.java +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.resolver; - -import java.util.List ; -import java.util.Map ; -import java.util.Comparator ; -import java.util.Iterator ; -import java.util.HashMap ; -import java.util.ArrayList ; -import java.util.Collections ; - -import org.omg.CosNaming.NamingContextExt ; -import org.omg.CosNaming.NamingContextExtHelper ; - -import sun.corba.EncapsInputStreamFactory; - -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.IORTemplate; -import com.sun.corba.se.spi.ior.ObjectKey; -import com.sun.corba.se.spi.ior.IORFactories; -import com.sun.corba.se.spi.ior.ObjectKeyFactory ; -import com.sun.corba.se.spi.ior.iiop.IIOPAddress; -import com.sun.corba.se.spi.ior.iiop.IIOPProfile ; -import com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate ; -import com.sun.corba.se.spi.ior.iiop.IIOPFactories ; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.ior.iiop.AlternateIIOPAddressComponent; -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.spi.orb.Operation; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.resolver.Resolver; - -import com.sun.corba.se.impl.encoding.EncapsInputStream; -import com.sun.corba.se.impl.logging.ORBUtilSystemException; -import com.sun.corba.se.impl.logging.OMGSystemException; -import com.sun.corba.se.impl.naming.namingutil.INSURLHandler; -import com.sun.corba.se.impl.naming.namingutil.IIOPEndpointInfo; -import com.sun.corba.se.impl.naming.namingutil.INSURL; -import com.sun.corba.se.impl.naming.namingutil.CorbalocURL; -import com.sun.corba.se.impl.naming.namingutil.CorbanameURL; -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.impl.orbutil.ORBUtility; - -/** - * This class provides an Operation that converts from CORBA INS URL strings into - * CORBA object references. It will eventually become extensible, but for now it - * simply encapsulates the existing implementation. Once the full extensibility - * is in place, we want this operation to convert string to INSURL, which has mainly - * a public resolver method that returns an object reference. - * - * @author Hemanth - * @author Ken - */ -public class INSURLOperationImpl implements Operation -{ - ORB orb; - ORBUtilSystemException wrapper ; - OMGSystemException omgWrapper ; - Resolver bootstrapResolver ; - - // Root Naming Context for default resolution of names. - private NamingContextExt rootNamingContextExt; - private Object rootContextCacheLock = new Object() ; - - // The URLHandler to parse INS URL's - private INSURLHandler insURLHandler = INSURLHandler.getINSURLHandler() ; - - public INSURLOperationImpl( ORB orb, Resolver bootstrapResolver ) - { - this.orb = orb ; - wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.ORB_RESOLVER ) ; - omgWrapper = OMGSystemException.get( orb, - CORBALogDomains.ORB_RESOLVER ) ; - this.bootstrapResolver = bootstrapResolver ; - } - - private static final int NIBBLES_PER_BYTE = 2 ; - private static final int UN_SHIFT = 4 ; // "UPPER NIBBLE" shift factor for << - - /** This static method takes a Stringified IOR and converts it into IOR object. - * It is the caller's responsibility to only pass strings that start with "IOR:". - */ - private org.omg.CORBA.Object getIORFromString( String str ) - { - // Length must be even for str to be valid - if ( (str.length() & 1) == 1 ) - throw wrapper.badStringifiedIorLen() ; - - byte[] buf = new byte[(str.length() - ORBConstants.STRINGIFY_PREFIX.length()) / NIBBLES_PER_BYTE]; - for (int i=ORBConstants.STRINGIFY_PREFIX.length(), j=0; i < str.length(); i +=NIBBLES_PER_BYTE, j++) { - buf[j] = (byte)((ORBUtility.hexOf(str.charAt(i)) << UN_SHIFT) & 0xF0); - buf[j] |= (byte)(ORBUtility.hexOf(str.charAt(i+1)) & 0x0F); - } - EncapsInputStream s = EncapsInputStreamFactory.newEncapsInputStream(orb, buf, buf.length, - orb.getORBData().getGIOPVersion()); - s.consumeEndian(); - return s.read_Object() ; - } - - public Object operate( Object arg ) - { - if (arg instanceof String) { - String str = (String)arg ; - - if (str.startsWith( ORBConstants.STRINGIFY_PREFIX )) - // XXX handle this as just another URL scheme - return getIORFromString( str ) ; - else { - INSURL insURL = insURLHandler.parseURL( str ) ; - if (insURL == null) - throw omgWrapper.soBadSchemeName() ; - return resolveINSURL( insURL ) ; - } - } - - throw wrapper.stringExpected() ; - } - - private org.omg.CORBA.Object resolveINSURL( INSURL theURLObject ) { - // XXX resolve should be a method on INSURL - if( theURLObject.isCorbanameURL() ) { - return resolveCorbaname( (CorbanameURL)theURLObject ); - } else { - return resolveCorbaloc( (CorbalocURL)theURLObject ); - } - } - - /** - * resolves a corbaloc: url that is encapsulated in a CorbalocURL object. - * - * @return the CORBA.Object if resolution is successful - */ - private org.omg.CORBA.Object resolveCorbaloc( - CorbalocURL theCorbaLocObject ) - { - org.omg.CORBA.Object result = null; - // If RIR flag is true use the Bootstrap protocol - if( theCorbaLocObject.getRIRFlag( ) ) { - result = bootstrapResolver.resolve(theCorbaLocObject.getKeyString()); - } else { - result = getIORUsingCorbaloc( theCorbaLocObject ); - } - - return result; - } - - /** - * resolves a corbaname: url that is encapsulated in a CorbanameURL object. - * - * @return the CORBA.Object if resolution is successful - */ - private org.omg.CORBA.Object resolveCorbaname( CorbanameURL theCorbaName ) { - org.omg.CORBA.Object result = null; - - try { - NamingContextExt theNamingContext = null; - - if( theCorbaName.getRIRFlag( ) ) { - // Case 1 of corbaname: rir# - theNamingContext = getDefaultRootNamingContext( ); - } else { - // Case 2 of corbaname: ::hostname# - org.omg.CORBA.Object corbalocResult = - getIORUsingCorbaloc( theCorbaName ); - if( corbalocResult == null ) { - return null; - } - - theNamingContext = - NamingContextExtHelper.narrow( corbalocResult ); - } - - String StringifiedName = theCorbaName.getStringifiedName( ); - - if( StringifiedName == null ) { - // This means return the Root Naming context - return theNamingContext; - } else { - return theNamingContext.resolve_str( StringifiedName ); - } - } catch( Exception e ) { - clearRootNamingContextCache( ); - return null; - } - } - - /** - * This is an internal method to get the IOR from the CorbalocURL object. - * - * @return the CORBA.Object if resolution is successful - */ - private org.omg.CORBA.Object getIORUsingCorbaloc( INSURL corbalocObject ) - { - Map profileMap = new HashMap(); - List profileList1_0 = new ArrayList(); - - // corbalocObject cannot be null, because it's validated during - // parsing. So no null check is required. - java.util.List theEndpointInfo = corbalocObject.getEndpointInfo(); - String theKeyString = corbalocObject.getKeyString(); - // If there is no KeyString then it's invalid - if( theKeyString == null ) { - return null; - } - - ObjectKey key = orb.getObjectKeyFactory().create( - theKeyString.getBytes() ); - IORTemplate iortemp = IORFactories.makeIORTemplate( key.getTemplate() ); - java.util.Iterator iterator = theEndpointInfo.iterator( ); - while( iterator.hasNext( ) ) { - IIOPEndpointInfo element = - (IIOPEndpointInfo) iterator.next( ); - IIOPAddress addr = IIOPFactories.makeIIOPAddress( orb, element.getHost(), - element.getPort() ); - GIOPVersion giopVersion = GIOPVersion.getInstance( (byte)element.getMajor(), - (byte)element.getMinor()); - IIOPProfileTemplate profileTemplate = null; - if (giopVersion.equals(GIOPVersion.V1_0)) { - profileTemplate = IIOPFactories.makeIIOPProfileTemplate( - orb, giopVersion, addr); - profileList1_0.add(profileTemplate); - } else { - if (profileMap.get(giopVersion) == null) { - profileTemplate = IIOPFactories.makeIIOPProfileTemplate( - orb, giopVersion, addr); - profileMap.put(giopVersion, profileTemplate); - } else { - profileTemplate = (IIOPProfileTemplate)profileMap.get(giopVersion); - AlternateIIOPAddressComponent iiopAddressComponent = - IIOPFactories.makeAlternateIIOPAddressComponent(addr); - profileTemplate.add(iiopAddressComponent); - } - } - } - - GIOPVersion giopVersion = orb.getORBData().getGIOPVersion(); - IIOPProfileTemplate pTemplate = (IIOPProfileTemplate)profileMap.get(giopVersion); - if (pTemplate != null) { - iortemp.add(pTemplate); // Add profile for GIOP version used by this ORB - profileMap.remove(giopVersion); // Now remove this value from the map - } - - // Create a comparator that can sort in decending order (1.2, 1.1, ...) - Comparator comp = new Comparator() { - public int compare(Object o1, Object o2) { - GIOPVersion gv1 = (GIOPVersion)o1; - GIOPVersion gv2 = (GIOPVersion)o2; - return (gv1.lessThan(gv2) ? 1 : (gv1.equals(gv2) ? 0 : -1)); - }; - }; - - // Now sort using the above comparator - List list = new ArrayList(profileMap.keySet()); - Collections.sort(list, comp); - - // Add the profiles in the sorted order - Iterator iter = list.iterator(); - while (iter.hasNext()) { - IIOPProfileTemplate pt = (IIOPProfileTemplate)profileMap.get(iter.next()); - iortemp.add(pt); - } - - // Finally add the 1.0 profiles - iortemp.addAll(profileList1_0); - - IOR ior = iortemp.makeIOR( orb, "", key.getId() ) ; - return ORBUtility.makeObjectReference( ior ) ; - } - - /** - * This is required for corbaname: resolution. Currently we - * are not caching RootNamingContext as the reference to rootNamingContext - * may not be Persistent in all the implementations. - * _REVISIT_ to clear the rootNamingContext in case of COMM_FAILURE. - * - * @return the org.omg.COSNaming.NamingContextExt if resolution is - * successful - * - */ - private NamingContextExt getDefaultRootNamingContext( ) { - synchronized( rootContextCacheLock ) { - if( rootNamingContextExt == null ) { - try { - rootNamingContextExt = - NamingContextExtHelper.narrow( - orb.getLocalResolver().resolve( "NameService" ) ); - } catch( Exception e ) { - rootNamingContextExt = null; - } - } - } - return rootNamingContextExt; - } - - /** - * A utility method to clear the RootNamingContext, if there is an - * exception in resolving CosNaming:Name from the RootNamingContext, - */ - private void clearRootNamingContextCache( ) { - synchronized( rootContextCacheLock ) { - rootNamingContextExt = null; - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/resolver/LocalResolverImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/resolver/LocalResolverImpl.java deleted file mode 100644 index b25bba2cc0d..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/resolver/LocalResolverImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.resolver ; - -import com.sun.corba.se.spi.resolver.LocalResolver ; -import com.sun.corba.se.spi.orbutil.closure.Closure ; - -public class LocalResolverImpl implements LocalResolver { - java.util.Map nameToClosure = new java.util.HashMap() ; - - public synchronized org.omg.CORBA.Object resolve( String name ) - { - Closure cl = (Closure)nameToClosure.get( name ) ; - if (cl == null) - return null ; - - return (org.omg.CORBA.Object)(cl.evaluate()) ; - } - - public synchronized java.util.Set list() - { - return nameToClosure.keySet() ; - } - - public synchronized void register( String name, Closure closure ) - { - nameToClosure.put( name, closure ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/resolver/ORBDefaultInitRefResolverImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/resolver/ORBDefaultInitRefResolverImpl.java deleted file mode 100644 index 6e0e335ceb9..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/resolver/ORBDefaultInitRefResolverImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.resolver ; - -import com.sun.corba.se.spi.resolver.Resolver ; - -import com.sun.corba.se.spi.orb.Operation ; - -public class ORBDefaultInitRefResolverImpl implements Resolver { - Operation urlHandler ; - String orbDefaultInitRef ; - - public ORBDefaultInitRefResolverImpl( Operation urlHandler, String orbDefaultInitRef ) - { - this.urlHandler = urlHandler ; - - // XXX Validate the URL? - this.orbDefaultInitRef = orbDefaultInitRef ; - } - - public org.omg.CORBA.Object resolve( String ident ) - { - // If the ORBDefaultInitRef is not defined simply return null - if( orbDefaultInitRef == null ) { - return null; - } - - String urlString; - // If the ORBDefaultInitDef is defined as corbaloc: then create the - // corbaloc String in the format - // / - // and resolve it using resolveCorbaloc method - if( orbDefaultInitRef.startsWith( "corbaloc:" ) ) { - urlString = orbDefaultInitRef + "/" + ident; - } else { - urlString = orbDefaultInitRef + "#" + ident; - } - - return (org.omg.CORBA.Object)urlHandler.operate( urlString ) ; - } - - public java.util.Set list() - { - return new java.util.HashSet() ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/resolver/ORBInitRefResolverImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/resolver/ORBInitRefResolverImpl.java deleted file mode 100644 index eac36a6ea99..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/resolver/ORBInitRefResolverImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.resolver ; - -import com.sun.corba.se.spi.resolver.Resolver ; - -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.spi.orb.Operation ; -import com.sun.corba.se.spi.orb.StringPair ; - -public class ORBInitRefResolverImpl implements Resolver { - Operation urlHandler ; - java.util.Map orbInitRefTable ; - - public ORBInitRefResolverImpl( Operation urlHandler, StringPair[] initRefs ) - { - this.urlHandler = urlHandler ; - orbInitRefTable = new java.util.HashMap() ; - - for( int i = 0; i < initRefs.length ; i++ ) { - StringPair sp = initRefs[i] ; - orbInitRefTable.put( sp.getFirst(), sp.getSecond() ) ; - } - } - - public org.omg.CORBA.Object resolve( String ident ) - { - String url = (String)orbInitRefTable.get( ident ) ; - if (url == null) - return null ; - - org.omg.CORBA.Object result = - (org.omg.CORBA.Object)urlHandler.operate( url ) ; - return result ; - } - - public java.util.Set list() - { - return orbInitRefTable.keySet() ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/resolver/SplitLocalResolverImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/resolver/SplitLocalResolverImpl.java deleted file mode 100644 index 20a1808f81b..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/resolver/SplitLocalResolverImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.resolver ; - -import com.sun.corba.se.spi.orbutil.closure.Closure ; - -import com.sun.corba.se.spi.resolver.Resolver ; -import com.sun.corba.se.spi.resolver.LocalResolver ; - -public class SplitLocalResolverImpl implements LocalResolver -{ - private Resolver resolver ; - private LocalResolver localResolver ; - - public SplitLocalResolverImpl( Resolver resolver, - LocalResolver localResolver ) - { - this.resolver = resolver ; - this.localResolver = localResolver ; - } - - public void register( String name, Closure closure ) - { - localResolver.register( name, closure ) ; - } - - public org.omg.CORBA.Object resolve( String name ) - { - return resolver.resolve( name ) ; - } - - public java.util.Set list() - { - return resolver.list() ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/ByteBufferPoolImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/transport/ByteBufferPoolImpl.java deleted file mode 100644 index 91b26c411ee..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/ByteBufferPoolImpl.java +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.transport; - -import java.nio.ByteBuffer; -import java.util.ArrayList; - -import com.sun.corba.se.spi.orb.ORB; - -import com.sun.corba.se.pept.transport.ByteBufferPool; - -/** - * @author Charlie Hunt - */ - -public class ByteBufferPoolImpl implements ByteBufferPool -{ - private ORB itsOrb; - private int itsByteBufferSize; - private ArrayList itsPool; - private int itsObjectCounter = 0; - private boolean debug; - - // Construct a ByteBufferPool for a pool of NIO ByteBuffers - // of ORB fragment size. - public ByteBufferPoolImpl(ORB theORB) - { - itsByteBufferSize = theORB.getORBData().getGIOPFragmentSize(); - itsPool = new ArrayList(); - itsOrb = theORB; - debug = theORB.transportDebugFlag; - } - - /* - * Locations where ByteBuffers are gotten from the pool: - * 1. ContactInfoBase.createMessageMediator() - * 2. ByteBufferWithInfo.growBuffer() - * 3. ByteBufferWithInfo(ORB, BufferManagerWrite) - constructor - */ - - // If the requested ByteBuffer size is less than or equal to - // the ORB fragment size, and we have not disabled use of - // direct byte buffers (normally for debugging purposes) - // then get a DirectByteBuffer from the - // pool if there is one, if there is not one in the pool, - // then allocate a a DirectByteBuffer of ORB fragment size. - // - // If the request ByteBuffer size is greater than the ORB fragment - // size, allocate a new non-direct ByteBuffer. - public ByteBuffer getByteBuffer(int theAskSize) - { - ByteBuffer abb = null; - - if ((theAskSize <= itsByteBufferSize) && - !itsOrb.getORBData().disableDirectByteBufferUse()) - { - // check if there's one in the pool, if not allocate one. - int poolSize; - synchronized (itsPool) - { - poolSize = itsPool.size(); - if (poolSize > 0) - { - abb = (ByteBuffer)itsPool.remove(poolSize - 1); - - // clear ByteBuffer before returning it - abb.clear(); - } - } - - // NOTE: Moved the 'else' part of the above if statement - // outside the synchronized block since it is likely - // less expensive to check poolSize than to allocate a - // DirectByteBuffer in the synchronized block. - if (poolSize <= 0) - { - abb = ByteBuffer.allocateDirect(itsByteBufferSize); - } - - // increment the number of ByteBuffers gotten from pool - // IMPORTANT: Since this counter is used only for information - // purposes, it does not use synchronized access. - itsObjectCounter++; - } - else - { - // Requested ByteBuffer size larger than the pool manages. - // Just allocate a non-direct ByteBuffer - abb = ByteBuffer.allocate(theAskSize); - } - - return abb; - } - - - /* - * Locations where ByteBuffers are released to the pool: - * 1. ByteBufferWithInfo.growBuffer() - * 2. BufferManagerWriteCollect.sendMessage() - * 3. CDROutputStream_1_0.close() - * 4. CDRInputStream_1_0.close() - * 5. BufferManagerReadStream.underflow() - * 6. BufferManagerWrite.close() - * 7. BufferManagerRead.close() - * 8. CorbaMessageMediatorImpl.releaseByteBufferToPool() - */ - - // If the ByteBuffer is a DirectByteBuffer, add it to the pool. - // Otherwise, set its reference to null since it's not kept in - // the pool and caller is saying he/she is done with it. - // NOTE: The size of the ByteBuffer is not checked with the - // this pool's ByteBuffer size since only DirectByteBuffers - // ever allocated. Hence, only DirectByteBuffer are checked - // here. An additional check could be added here for that though. - public void releaseByteBuffer(ByteBuffer thebb) - { - if (thebb.isDirect()) - { - synchronized (itsPool) - { - // use with debug to determine if byteBuffer is already - // in the pool. - boolean refInPool = false; - int bbAddr = 0; - - if (debug) - { - // Check to make sure we don't have 'thebb' reference - // already in the pool before adding it. - - for (int i = 0; i < itsPool.size() && refInPool == false; i++) - { - ByteBuffer tmpbb = (ByteBuffer)itsPool.get(i); - if (thebb == tmpbb) - { - refInPool = true; - bbAddr = System.identityHashCode(thebb); - } - } - - } - - // NOTE: The else part of this if will only get called - // if debug = true and refInPool = true, see logic above. - if (refInPool == false || debug == false) - { - // add ByteBuffer back to the pool - itsPool.add(thebb); - } - else // otherwise, log a stack trace with duplicate message - { - String threadName = Thread.currentThread().getName(); - Throwable t = - new Throwable(threadName + - ": Duplicate ByteBuffer reference (" + - bbAddr + ")"); - t.printStackTrace(System.out); - } - } - - // decrement the count of ByteBuffers released - // IMPORTANT: Since this counter is used only for information - // purposes, it does not use synchronized access. - itsObjectCounter--; - } - else - { - // ByteBuffer not pooled nor needed - thebb = null; - } - } - - - // Get a count of the outstanding allocated DirectByteBuffers. - // (Those allocated and have not been returned to the pool). - // IMPORTANT: Since this counter is used only for information - // purposes, it does not use synchronized access. - public int activeCount() - { - return itsObjectCounter; - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaConnectionCacheBase.java b/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaConnectionCacheBase.java deleted file mode 100644 index 4f8aedafc3d..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaConnectionCacheBase.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.transport; - -import java.util.Collection; -import java.util.Iterator; - -import com.sun.corba.se.pept.broker.Broker; -import com.sun.corba.se.pept.transport.Connection; -import com.sun.corba.se.pept.transport.ConnectionCache; - -import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.transport.CorbaConnection; -import com.sun.corba.se.spi.transport.CorbaConnectionCache; - -import com.sun.corba.se.impl.logging.ORBUtilSystemException; -import com.sun.corba.se.impl.orbutil.ORBUtility; - -/** - * @author Harold Carr - */ -public abstract class CorbaConnectionCacheBase - implements - ConnectionCache, - CorbaConnectionCache -{ - protected ORB orb; - protected long timestamp = 0; - protected String cacheType; - protected String monitoringName; - protected ORBUtilSystemException wrapper; - - protected CorbaConnectionCacheBase(ORB orb, String cacheType, - String monitoringName) - { - this.orb = orb; - this.cacheType = cacheType; - this.monitoringName = monitoringName; - wrapper =ORBUtilSystemException.get(orb,CORBALogDomains.RPC_TRANSPORT); - registerWithMonitoring(); - dprintCreation(); - } - - //////////////////////////////////////////////////// - // - // pept.transport.ConnectionCache - // - - public String getCacheType() - { - return cacheType; - } - - public synchronized void stampTime(Connection c) - { - // _REVISIT_ Need to worry about wrap around some day - c.setTimeStamp(timestamp++); - } - - public long numberOfConnections() - { - synchronized (backingStore()) { - return values().size(); - } - } - - public void close() { - synchronized (backingStore()) { - for (Object obj : values()) { - ((CorbaConnection)obj).closeConnectionResources() ; - } - } - } - - public long numberOfIdleConnections() - { - long count = 0; - synchronized (backingStore()) { - Iterator connections = values().iterator(); - while (connections.hasNext()) { - if (! ((Connection)connections.next()).isBusy()) { - count++; - } - } - } - return count; - } - - public long numberOfBusyConnections() - { - long count = 0; - synchronized (backingStore()) { - Iterator connections = values().iterator(); - while (connections.hasNext()) { - if (((Connection)connections.next()).isBusy()) { - count++; - } - } - } - return count; - } - - /** - * Discarding least recently used Connections that are not busy - * - * This method must be synchronized since one WorkerThread could - * be reclaming connections inside the synchronized backingStore - * block and a second WorkerThread (or a SelectorThread) could have - * already executed the if (numberOfConnections {@literal <=} .... ). As a - * result the second thread would also attempt to reclaim connections. - * - * If connection reclamation becomes a performance issue, the connection - * reclamation could make its own task and consequently executed in - * a separate thread. - * Currently, the accept {@literal &} reclaim are done in the same thread, WorkerThread - * by default. It could be changed such that the SelectorThread would do - * it for SocketChannels and WorkerThreads for Sockets by updating the - * ParserTable. - */ - synchronized public boolean reclaim() - { - try { - long numberOfConnections = numberOfConnections(); - - if (orb.transportDebugFlag) { - dprint(".reclaim->: " + numberOfConnections - + " (" - + orb.getORBData().getHighWaterMark() - + "/" - + orb.getORBData().getLowWaterMark() - + "/" - + orb.getORBData().getNumberToReclaim() - + ")"); - } - - if (numberOfConnections <= orb.getORBData().getHighWaterMark() || - numberOfConnections < orb.getORBData().getLowWaterMark()) { - return false; - } - - Object backingStore = backingStore(); - synchronized (backingStore) { - - // REVISIT - A less expensive alternative connection reclaiming - // algorithm could be investigated. - - for (int i=0; i < orb.getORBData().getNumberToReclaim(); i++) { - Connection toClose = null; - long lru = java.lang.Long.MAX_VALUE; - Iterator iterator = values().iterator(); - - // Find least recently used and not busy connection in cache - while ( iterator.hasNext() ) { - Connection c = (Connection) iterator.next(); - if ( !c.isBusy() && c.getTimeStamp() < lru ) { - toClose = c; - lru = c.getTimeStamp(); - } - } - - if ( toClose == null ) { - return false; - } - - try { - if (orb.transportDebugFlag) { - dprint(".reclaim: closing: " + toClose); - } - toClose.close(); - } catch (Exception ex) { - // REVISIT - log - } - } - - if (orb.transportDebugFlag) { - dprint(".reclaim: connections reclaimed (" - + (numberOfConnections - numberOfConnections()) + ")"); - } - } - - // XXX is necessary to do a GC to reclaim - // closed network connections ?? - // java.lang.System.gc(); - - return true; - } finally { - if (orb.transportDebugFlag) { - dprint(".reclaim<-: " + numberOfConnections()); - } - } - } - - //////////////////////////////////////////////////// - // - // spi.transport.ConnectionCache - // - - public String getMonitoringName() - { - return monitoringName; - } - - //////////////////////////////////////////////////// - // - // Implementation - // - - // This is public so folb.Server test can access it. - public abstract Collection values(); - - protected abstract Object backingStore(); - - protected abstract void registerWithMonitoring(); - - protected void dprintCreation() - { - if (orb.transportDebugFlag) { - dprint(".constructor: cacheType: " + getCacheType() - + " monitoringName: " + getMonitoringName()); - } - } - - protected void dprintStatistics() - { - if (orb.transportDebugFlag) { - dprint(".stats: " - + numberOfConnections() + "/total " - + numberOfBusyConnections() + "/busy " - + numberOfIdleConnections() + "/idle" - + " (" - + orb.getORBData().getHighWaterMark() + "/" - + orb.getORBData().getLowWaterMark() + "/" - + orb.getORBData().getNumberToReclaim() - + ")"); - } - } - - protected void dprint(String msg) - { - ORBUtility.dprint("CorbaConnectionCacheBase", msg); - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaContactInfoBase.java b/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaContactInfoBase.java deleted file mode 100644 index 419efe7e68d..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaContactInfoBase.java +++ /dev/null @@ -1,292 +0,0 @@ -/* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.transport; - -import java.io.InputStream; -import java.io.IOException; -import java.nio.ByteBuffer; - -import org.omg.CORBA.INTERNAL; - -import com.sun.corba.se.pept.broker.Broker; -import com.sun.corba.se.pept.encoding.InputObject; -import com.sun.corba.se.pept.encoding.OutputObject; -import com.sun.corba.se.pept.protocol.ClientRequestDispatcher; -import com.sun.corba.se.pept.protocol.MessageMediator; -import com.sun.corba.se.pept.transport.ByteBufferPool; -import com.sun.corba.se.pept.transport.ContactInfo; -import com.sun.corba.se.pept.transport.ContactInfoList; -import com.sun.corba.se.pept.transport.Connection; -import com.sun.corba.se.pept.transport.EventHandler; -import com.sun.corba.se.pept.transport.OutboundConnectionCache; - -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.ObjectKeyTemplate; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.ior.iiop.IIOPAddress ; -import com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate; -import com.sun.corba.se.spi.ior.iiop.IIOPProfile; -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; -import com.sun.corba.se.spi.protocol.RequestDispatcherRegistry; -import com.sun.corba.se.spi.transport.CorbaConnection; -import com.sun.corba.se.spi.transport.CorbaContactInfoList; -import com.sun.corba.se.spi.transport.CorbaContactInfo; - -import com.sun.corba.se.impl.encoding.ByteBufferWithInfo; -import com.sun.corba.se.impl.encoding.CDRInputObject; -import com.sun.corba.se.impl.encoding.CDRInputStream_1_0; -import com.sun.corba.se.impl.encoding.CDROutputObject; -import com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl; -import com.sun.corba.se.impl.protocol.giopmsgheaders.KeyAddr; -import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; -import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase; -import com.sun.corba.se.impl.orbutil.ORBUtility; - -/** - * @author Harold Carr - */ -public abstract class CorbaContactInfoBase - implements - CorbaContactInfo -{ - protected ORB orb; - protected CorbaContactInfoList contactInfoList; - // NOTE: This may be different from same named one in CorbaContactInfoList. - protected IOR effectiveTargetIOR; - protected short addressingDisposition; - protected OutboundConnectionCache connectionCache; - - //////////////////////////////////////////////////// - // - // pept.transport.ContactInfo - // - - public Broker getBroker() - { - return orb; - } - - public ContactInfoList getContactInfoList() - { - return contactInfoList; - } - - public ClientRequestDispatcher getClientRequestDispatcher() - { - int scid = - getEffectiveProfile().getObjectKeyTemplate().getSubcontractId() ; - RequestDispatcherRegistry scr = orb.getRequestDispatcherRegistry() ; - return scr.getClientRequestDispatcher( scid ) ; - } - - // Note: not all derived classes will use a connection cache. - // These are convenience methods that may not be used. - public void setConnectionCache(OutboundConnectionCache connectionCache) - { - this.connectionCache = connectionCache; - } - - public OutboundConnectionCache getConnectionCache() - { - return connectionCache; - } - - // Called when client making an invocation. - public MessageMediator createMessageMediator(Broker broker, - ContactInfo contactInfo, - Connection connection, - String methodName, - boolean isOneWay) - { - // REVISIT: Would like version, ior, requestid, etc., decisions - // to be in client subcontract. Cannot pass these to this - // factory method because it breaks generic abstraction. - // Maybe set methods on mediator called from subcontract - // after creation? - CorbaMessageMediator messageMediator = - new CorbaMessageMediatorImpl( - (ORB) broker, - contactInfo, - connection, - GIOPVersion.chooseRequestVersion( (ORB)broker, - effectiveTargetIOR), - effectiveTargetIOR, - ((CorbaConnection)connection).getNextRequestId(), - getAddressingDisposition(), - methodName, - isOneWay); - - return messageMediator; - } - - // Called when connection handling a read event. - public MessageMediator createMessageMediator(Broker broker,Connection conn) - { - ORB orb = (ORB) broker; - CorbaConnection connection = (CorbaConnection) conn; - - if (orb.transportDebugFlag) { - if (connection.shouldReadGiopHeaderOnly()) { - dprint( - ".createMessageMediator: waiting for message header on connection: " - + connection); - } else { - dprint( - ".createMessageMediator: waiting for message on connection: " - + connection); - } - } - - Message msg = null; - - if (connection.shouldReadGiopHeaderOnly()) { - // read giop header only - msg = MessageBase.readGIOPHeader(orb, connection); - } else { - // read entire giop message - msg = MessageBase.readGIOPMessage(orb, connection); - } - - ByteBuffer byteBuffer = msg.getByteBuffer(); - msg.setByteBuffer(null); - CorbaMessageMediator messageMediator = - new CorbaMessageMediatorImpl(orb, connection, msg, byteBuffer); - - return messageMediator; - } - - // Called when connection reading message body - public MessageMediator finishCreatingMessageMediator(Broker broker, - Connection conn, MessageMediator messageMediator) - { - ORB orb = (ORB) broker; - CorbaConnection connection = (CorbaConnection) conn; - CorbaMessageMediator corbaMessageMediator = - (CorbaMessageMediator)messageMediator; - - if (orb.transportDebugFlag) { - dprint( - ".finishCreatingMessageMediator: waiting for message body on connection: " - + connection); - } - - Message msg = corbaMessageMediator.getDispatchHeader(); - msg.setByteBuffer(corbaMessageMediator.getDispatchBuffer()); - - // read giop body only - msg = MessageBase.readGIOPBody(orb, connection, msg); - - ByteBuffer byteBuffer = msg.getByteBuffer(); - msg.setByteBuffer(null); - corbaMessageMediator.setDispatchHeader(msg); - corbaMessageMediator.setDispatchBuffer(byteBuffer); - - return corbaMessageMediator; - } - - public OutputObject createOutputObject(MessageMediator messageMediator) - { - CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator) - messageMediator; - - OutputObject outputObject = - sun.corba.OutputStreamFactory.newCDROutputObject(orb, messageMediator, - corbaMessageMediator.getRequestHeader(), - corbaMessageMediator.getStreamFormatVersion()); - - messageMediator.setOutputObject(outputObject); - return outputObject; - } - - public InputObject createInputObject(Broker broker, - MessageMediator messageMediator) - { - // REVISIT: Duplicate of acceptor code. - CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator) - messageMediator; - return new CDRInputObject((ORB)broker, - (CorbaConnection)messageMediator.getConnection(), - corbaMessageMediator.getDispatchBuffer(), - corbaMessageMediator.getDispatchHeader()); - } - - //////////////////////////////////////////////////// - // - // spi.transport.CorbaContactInfo - // - - public short getAddressingDisposition() - { - return addressingDisposition; - } - - public void setAddressingDisposition(short addressingDisposition) - { - this.addressingDisposition = addressingDisposition; - } - - // REVISIT - remove this. - public IOR getTargetIOR() - { - return contactInfoList.getTargetIOR(); - } - - public IOR getEffectiveTargetIOR() - { - return effectiveTargetIOR ; - } - - public IIOPProfile getEffectiveProfile() - { - return effectiveTargetIOR.getProfile(); - } - - //////////////////////////////////////////////////// - // - // java.lang.Object - // - - public String toString() - { - return - "CorbaContactInfoBase[" - + "]"; - } - - - //////////////////////////////////////////////////// - // - // Implementation - // - - protected void dprint(String msg) - { - ORBUtility.dprint("CorbaContactInfoBase", msg); - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaContactInfoListImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaContactInfoListImpl.java deleted file mode 100644 index cb8c895c3f8..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaContactInfoListImpl.java +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.transport; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import com.sun.corba.se.pept.transport.ContactInfo; - -import com.sun.corba.se.spi.ior.IOR ; -import com.sun.corba.se.spi.ior.iiop.IIOPProfile ; -import com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate ; -import com.sun.corba.se.spi.oa.ObjectAdapterFactory; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcher; -import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcherFactory; -import com.sun.corba.se.spi.transport.CorbaContactInfoList ; -import com.sun.corba.se.spi.transport.SocketInfo; - -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.impl.protocol.NotLocalLocalCRDImpl; - -/** - * @author Harold Carr - */ -public class CorbaContactInfoListImpl - implements - CorbaContactInfoList -{ - protected ORB orb; - protected LocalClientRequestDispatcher LocalClientRequestDispatcher; - protected IOR targetIOR; - protected IOR effectiveTargetIOR; - protected List effectiveTargetIORContactInfoList; - protected ContactInfo primaryContactInfo; - - // XREVISIT - is this used? - public CorbaContactInfoListImpl(ORB orb) - { - this.orb = orb; - } - - public CorbaContactInfoListImpl(ORB orb, IOR targetIOR) - { - this(orb); - setTargetIOR(targetIOR); - } - - //////////////////////////////////////////////////// - // - // pept.transport.ContactInfoList - // - - public synchronized Iterator iterator() - { - createContactInfoList(); - return new CorbaContactInfoListIteratorImpl( - orb, this, primaryContactInfo, - effectiveTargetIORContactInfoList); - } - - //////////////////////////////////////////////////// - // - // spi.transport.CorbaContactInfoList - // - - public synchronized void setTargetIOR(IOR targetIOR) - { - this.targetIOR = targetIOR; - setEffectiveTargetIOR(targetIOR); - } - - public synchronized IOR getTargetIOR() - { - return targetIOR; - } - - public synchronized void setEffectiveTargetIOR(IOR effectiveTargetIOR) - { - this.effectiveTargetIOR = effectiveTargetIOR; - effectiveTargetIORContactInfoList = null; - if (primaryContactInfo != null && - orb.getORBData().getIIOPPrimaryToContactInfo() != null) - { - orb.getORBData().getIIOPPrimaryToContactInfo() - .reset(primaryContactInfo); - } - primaryContactInfo = null; - setLocalSubcontract(); - } - - public synchronized IOR getEffectiveTargetIOR() - { - return effectiveTargetIOR; - } - - public synchronized LocalClientRequestDispatcher getLocalClientRequestDispatcher() - { - return LocalClientRequestDispatcher; - } - - //////////////////////////////////////////////////// - // - // org.omg.CORBA.portable.Delegate - // - - // REVISIT - hashCode(org.omg.CORBA.Object self) - - //////////////////////////////////////////////////// - // - // java.lang.Object - // - - public synchronized int hashCode() - { - return targetIOR.hashCode(); - } - - //////////////////////////////////////////////////// - // - // Implementation - // - - protected void createContactInfoList() - { - if (effectiveTargetIORContactInfoList != null) { - return; - } - - effectiveTargetIORContactInfoList = new ArrayList(); - - IIOPProfile iiopProfile = effectiveTargetIOR.getProfile(); - String hostname = - ((IIOPProfileTemplate)iiopProfile.getTaggedProfileTemplate()) - .getPrimaryAddress().getHost().toLowerCase(); - int port = - ((IIOPProfileTemplate)iiopProfile.getTaggedProfileTemplate()) - .getPrimaryAddress().getPort(); - // For use by "sticky manager" if one is registered. - primaryContactInfo = - createContactInfo(SocketInfo.IIOP_CLEAR_TEXT, hostname, port); - - if (iiopProfile.isLocal()) { - // NOTE: IMPORTANT: - // Only do local. The APP Server interceptors check - // effectiveTarget.isLocal - which is determined via - // the IOR - so if we added other addresses then - // transactions and interceptors would not execute. - ContactInfo contactInfo = new SharedCDRContactInfoImpl( - orb, this, effectiveTargetIOR, - orb.getORBData().getGIOPAddressDisposition()); - effectiveTargetIORContactInfoList.add(contactInfo); - } else { - addRemoteContactInfos(effectiveTargetIOR, - effectiveTargetIORContactInfoList); - } - } - - protected void addRemoteContactInfos( - IOR effectiveTargetIOR, - List effectiveTargetIORContactInfoList) - { - ContactInfo contactInfo; - List socketInfos = orb.getORBData() - .getIORToSocketInfo().getSocketInfo(effectiveTargetIOR); - Iterator iterator = socketInfos.iterator(); - while (iterator.hasNext()) { - SocketInfo socketInfo = (SocketInfo) iterator.next(); - String type = socketInfo.getType(); - String host = socketInfo.getHost().toLowerCase(); - int port = socketInfo.getPort(); - contactInfo = createContactInfo(type, host, port); - effectiveTargetIORContactInfoList.add(contactInfo); - } - } - - protected ContactInfo createContactInfo(String type, - String hostname, int port) - { - return new SocketOrChannelContactInfoImpl( - orb, this, - // XREVISIT - See Base Line 62 - effectiveTargetIOR, - orb.getORBData().getGIOPAddressDisposition(), - type, hostname, port); - } - - /** - * setLocalSubcontract sets cached information that is set whenever - * the effectiveTargetIOR changes. - * - * Note: this must be maintained accurately whether or not the ORB - * allows local optimization, because ServantManagers in the POA - * ALWAYS use local optimization ONLY (they do not have a remote case). - */ - protected void setLocalSubcontract() - { - if (!effectiveTargetIOR.getProfile().isLocal()) { - LocalClientRequestDispatcher = new NotLocalLocalCRDImpl(); - return; - } - - // XXX Note that this always uses the first IIOP profile to get the - // scid. What about multi-profile IORs? This should perhaps be - // tied to the current ContactInfo in some way, together with an - // implementation of ClientDelegate that generally prefers co-located - // ContactInfo. This may in fact mean that we should do this at - // the ContactInfo level, rather than the IOR/profile level. - int scid = effectiveTargetIOR.getProfile().getObjectKeyTemplate(). - getSubcontractId() ; - LocalClientRequestDispatcherFactory lcsf = orb.getRequestDispatcherRegistry().getLocalClientRequestDispatcherFactory( scid ) ; - LocalClientRequestDispatcher = lcsf.create( scid, effectiveTargetIOR ) ; - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaContactInfoListIteratorImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaContactInfoListIteratorImpl.java deleted file mode 100644 index 599752c5c71..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaContactInfoListIteratorImpl.java +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.transport; - -import java.util.Iterator; -import java.util.List; - -import org.omg.CORBA.COMM_FAILURE; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.SystemException; - -import com.sun.corba.se.pept.transport.ContactInfo ; -import com.sun.corba.se.pept.transport.ContactInfoList ; - -import com.sun.corba.se.spi.ior.IOR ; -import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.transport.CorbaContactInfo; -import com.sun.corba.se.spi.transport.CorbaContactInfoList; -import com.sun.corba.se.spi.transport.CorbaContactInfoListIterator; -import com.sun.corba.se.spi.transport.IIOPPrimaryToContactInfo; - -import com.sun.corba.se.impl.logging.ORBUtilSystemException; -import com.sun.corba.se.impl.protocol.CorbaInvocationInfo; - -// REVISIT: create a unit test for this class. - -public class CorbaContactInfoListIteratorImpl - implements - CorbaContactInfoListIterator -{ - protected ORB orb; - protected CorbaContactInfoList contactInfoList; - protected CorbaContactInfo successContactInfo; - protected CorbaContactInfo failureContactInfo; - protected RuntimeException failureException; - - // ITERATOR state - protected Iterator effectiveTargetIORIterator; - protected CorbaContactInfo previousContactInfo; - protected boolean isAddrDispositionRetry; - protected IIOPPrimaryToContactInfo primaryToContactInfo; - protected ContactInfo primaryContactInfo; - protected List listOfContactInfos; - // End ITERATOR state - - public CorbaContactInfoListIteratorImpl( - ORB orb, - CorbaContactInfoList corbaContactInfoList, - ContactInfo primaryContactInfo, - List listOfContactInfos) - { - this.orb = orb; - this.contactInfoList = corbaContactInfoList; - this.primaryContactInfo = primaryContactInfo; - if (listOfContactInfos != null) { - // listOfContactInfos is null when used by the legacy - // socket factory. In that case this iterator is NOT used. - this.effectiveTargetIORIterator = listOfContactInfos.iterator(); - } - // List is immutable so no need to synchronize access. - this.listOfContactInfos = listOfContactInfos; - - this.previousContactInfo = null; - this.isAddrDispositionRetry = false; - - this.successContactInfo = null; - this.failureContactInfo = null; - this.failureException = null; - - primaryToContactInfo = orb.getORBData().getIIOPPrimaryToContactInfo(); - } - - //////////////////////////////////////////////////// - // - // java.util.Iterator - // - - public boolean hasNext() - { - // REVISIT: Implement as internal closure iterator which would - // wraps sticky or default. Then hasNext and next just call - // the closure. - - if (isAddrDispositionRetry) { - return true; - } - - boolean result; - - if (primaryToContactInfo != null) { - result = primaryToContactInfo.hasNext(primaryContactInfo, - previousContactInfo, - listOfContactInfos); - } else { - result = effectiveTargetIORIterator.hasNext(); - } - - return result; - } - - public Object next() - { - if (isAddrDispositionRetry) { - isAddrDispositionRetry = false; - return previousContactInfo; - } - - // We hold onto the last in case we get an addressing - // disposition retry. Then we use it again. - - // We also hold onto it for the sticky manager. - - if (primaryToContactInfo != null) { - previousContactInfo = (CorbaContactInfo) - primaryToContactInfo.next(primaryContactInfo, - previousContactInfo, - listOfContactInfos); - } else { - previousContactInfo = (CorbaContactInfo) - effectiveTargetIORIterator.next(); - } - - return previousContactInfo; - } - - public void remove() - { - throw new UnsupportedOperationException(); - } - - //////////////////////////////////////////////////// - // - // com.sun.corba.se.pept.transport.ContactInfoListIterator - // - - public ContactInfoList getContactInfoList() - { - return contactInfoList; - } - - public void reportSuccess(ContactInfo contactInfo) - { - this.successContactInfo = (CorbaContactInfo)contactInfo; - } - - public boolean reportException(ContactInfo contactInfo, - RuntimeException ex) - { - this.failureContactInfo = (CorbaContactInfo)contactInfo; - this.failureException = ex; - if (ex instanceof COMM_FAILURE) { - SystemException se = (SystemException) ex; - if (se.completed == CompletionStatus.COMPLETED_NO) { - if (hasNext()) { - return true; - } - if (contactInfoList.getEffectiveTargetIOR() != - contactInfoList.getTargetIOR()) - { - // retry from root ior - updateEffectiveTargetIOR(contactInfoList.getTargetIOR()); - return true; - } - } - } - return false; - } - - public RuntimeException getFailureException() - { - if (failureException == null) { - return - ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_TRANSPORT ) - .invalidContactInfoListIteratorFailureException(); - } else { - return failureException; - } - } - - //////////////////////////////////////////////////// - // - // spi.CorbaContactInfoListIterator - // - - public void reportAddrDispositionRetry(CorbaContactInfo contactInfo, - short disposition) - { - previousContactInfo.setAddressingDisposition(disposition); - isAddrDispositionRetry = true; - } - - public void reportRedirect(CorbaContactInfo contactInfo, - IOR forwardedIOR) - { - updateEffectiveTargetIOR(forwardedIOR); - } - - //////////////////////////////////////////////////// - // - // Implementation. - // - - // - // REVISIT: - // - // The normal operation for a standard iterator is to throw - // ConcurrentModificationException whenever the underlying collection - // changes. This is implemented by keeping a modification counter (the - // timestamp may fail because the granularity is too coarse). - // Essentially what you need to do is whenever the iterator fails this - // way, go back to ContactInfoList and get a new iterator. - // - // Need to update CorbaClientRequestDispatchImpl to catch and use - // that exception. - // - - public void updateEffectiveTargetIOR(IOR newIOR) - { - contactInfoList.setEffectiveTargetIOR(newIOR); - // If we report the exception in _request (i.e., beginRequest - // we cannot throw RemarshalException to the stub because _request - // does not declare that exception. - // To keep the two-level dispatching (first level chooses ContactInfo, - // second level is specific to that ContactInfo/EPT) we need to - // ensure that the request dispatchers get their iterator from the - // InvocationStack (i.e., ThreadLocal). That way if the list iterator - // needs a complete update it happens right here. - ((CorbaInvocationInfo)orb.getInvocationInfo()) - .setContactInfoListIterator(contactInfoList.iterator()); - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaInboundConnectionCacheImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaInboundConnectionCacheImpl.java deleted file mode 100644 index 1f2f855781a..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaInboundConnectionCacheImpl.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.transport; - -import java.util.ArrayList; -import java.util.Collection; - -import com.sun.corba.se.pept.broker.Broker; -import com.sun.corba.se.pept.transport.Acceptor; -import com.sun.corba.se.pept.transport.Connection; -import com.sun.corba.se.pept.transport.InboundConnectionCache; - -import com.sun.corba.se.spi.monitoring.LongMonitoredAttributeBase; -import com.sun.corba.se.spi.monitoring.MonitoringConstants; -import com.sun.corba.se.spi.monitoring.MonitoringFactories; -import com.sun.corba.se.spi.monitoring.MonitoredObject; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.transport.CorbaConnectionCache; -import com.sun.corba.se.spi.transport.CorbaAcceptor; - -import com.sun.corba.se.impl.orbutil.ORBUtility; - -/** - * @author Harold Carr - */ -public class CorbaInboundConnectionCacheImpl - extends - CorbaConnectionCacheBase - implements - InboundConnectionCache -{ - protected Collection connectionCache; - - private Acceptor acceptor; - - public CorbaInboundConnectionCacheImpl(ORB orb, Acceptor acceptor) - { - super(orb, acceptor.getConnectionCacheType(), - ((CorbaAcceptor)acceptor).getMonitoringName()); - this.connectionCache = new ArrayList(); - this.acceptor = acceptor; - if (orb.transportDebugFlag) { - dprint(": " + acceptor ); - } - } - - //////////////////////////////////////////////////// - // - // pept.transport.InboundConnectionCache - // - - public void close () { - - super.close(); - if (orb.transportDebugFlag) { - dprint(".close: " + acceptor ); - } - this.acceptor.close(); - - } - - public Connection get(Acceptor acceptor) - { - throw wrapper.methodShouldNotBeCalled(); - } - - public Acceptor getAcceptor () { - return acceptor; - } - - public void put(Acceptor acceptor, Connection connection) - { - if (orb.transportDebugFlag) { - dprint(".put: " + acceptor + " " + connection); - } - synchronized (backingStore()) { - connectionCache.add(connection); - connection.setConnectionCache(this); - dprintStatistics(); - } - } - - public void remove(Connection connection) - { - if (orb.transportDebugFlag) { - dprint(".remove: " + connection); - } - synchronized (backingStore()) { - connectionCache.remove(connection); - dprintStatistics(); - } - } - - //////////////////////////////////////////////////// - // - // Implementation - // - - public Collection values() - { - return connectionCache; - } - - protected Object backingStore() - { - return connectionCache; - } - - protected void registerWithMonitoring() - { - // ORB - MonitoredObject orbMO = - orb.getMonitoringManager().getRootMonitoredObject(); - - // REVISIT - add ORBUtil mkdir -p like operation for this. - - // CONNECTION - MonitoredObject connectionMO = - orbMO.getChild(MonitoringConstants.CONNECTION_MONITORING_ROOT); - if (connectionMO == null) { - connectionMO = - MonitoringFactories.getMonitoredObjectFactory() - .createMonitoredObject( - MonitoringConstants.CONNECTION_MONITORING_ROOT, - MonitoringConstants.CONNECTION_MONITORING_ROOT_DESCRIPTION); - orbMO.addChild(connectionMO); - } - - // INBOUND CONNECTION - MonitoredObject inboundConnectionMO = - connectionMO.getChild( - MonitoringConstants.INBOUND_CONNECTION_MONITORING_ROOT); - if (inboundConnectionMO == null) { - inboundConnectionMO = - MonitoringFactories.getMonitoredObjectFactory() - .createMonitoredObject( - MonitoringConstants.INBOUND_CONNECTION_MONITORING_ROOT, - MonitoringConstants.INBOUND_CONNECTION_MONITORING_ROOT_DESCRIPTION); - connectionMO.addChild(inboundConnectionMO); - } - - // NODE FOR THIS CACHE - MonitoredObject thisMO = - inboundConnectionMO.getChild(getMonitoringName()); - if (thisMO == null) { - thisMO = - MonitoringFactories.getMonitoredObjectFactory() - .createMonitoredObject( - getMonitoringName(), - MonitoringConstants.CONNECTION_MONITORING_DESCRIPTION); - inboundConnectionMO.addChild(thisMO); - } - - LongMonitoredAttributeBase attribute; - - // ATTRIBUTE - attribute = new - LongMonitoredAttributeBase( - MonitoringConstants.CONNECTION_TOTAL_NUMBER_OF_CONNECTIONS, - MonitoringConstants.CONNECTION_TOTAL_NUMBER_OF_CONNECTIONS_DESCRIPTION) - { - public Object getValue() { - return new Long(CorbaInboundConnectionCacheImpl.this.numberOfConnections()); - } - }; - thisMO.addAttribute(attribute); - - // ATTRIBUTE - attribute = new - LongMonitoredAttributeBase( - MonitoringConstants.CONNECTION_NUMBER_OF_IDLE_CONNECTIONS, - MonitoringConstants.CONNECTION_NUMBER_OF_IDLE_CONNECTIONS_DESCRIPTION) - { - public Object getValue() { - return new Long(CorbaInboundConnectionCacheImpl.this.numberOfIdleConnections()); - } - }; - thisMO.addAttribute(attribute); - - // ATTRIBUTE - attribute = new - LongMonitoredAttributeBase( - MonitoringConstants.CONNECTION_NUMBER_OF_BUSY_CONNECTIONS, - MonitoringConstants.CONNECTION_NUMBER_OF_BUSY_CONNECTIONS_DESCRIPTION) - { - public Object getValue() { - return new Long(CorbaInboundConnectionCacheImpl.this.numberOfBusyConnections()); - } - }; - thisMO.addAttribute(attribute); - } - - protected void dprint(String msg) - { - ORBUtility.dprint("CorbaInboundConnectionCacheImpl", msg); - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaOutboundConnectionCacheImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaOutboundConnectionCacheImpl.java deleted file mode 100644 index b248de04422..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaOutboundConnectionCacheImpl.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.transport; - -import java.util.Collection; -import java.util.Hashtable; -import java.util.Iterator; - -import com.sun.corba.se.pept.broker.Broker; -import com.sun.corba.se.pept.transport.ContactInfo; -import com.sun.corba.se.pept.transport.Connection; -import com.sun.corba.se.pept.transport.OutboundConnectionCache; - -import com.sun.corba.se.spi.monitoring.LongMonitoredAttributeBase; -import com.sun.corba.se.spi.monitoring.MonitoringConstants; -import com.sun.corba.se.spi.monitoring.MonitoringFactories; -import com.sun.corba.se.spi.monitoring.MonitoredObject; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.transport.CorbaConnectionCache; -import com.sun.corba.se.spi.transport.CorbaContactInfo; - -import com.sun.corba.se.impl.orbutil.ORBUtility; - -/** - * @author Harold Carr - */ -public class CorbaOutboundConnectionCacheImpl - extends - CorbaConnectionCacheBase - implements - OutboundConnectionCache -{ - protected Hashtable connectionCache; - - public CorbaOutboundConnectionCacheImpl(ORB orb, ContactInfo contactInfo) - { - super(orb, contactInfo.getConnectionCacheType(), - ((CorbaContactInfo)contactInfo).getMonitoringName()); - this.connectionCache = new Hashtable(); - } - - //////////////////////////////////////////////////// - // - // pept.transport.OutboundConnectionCache - // - - public Connection get(ContactInfo contactInfo) - { - if (orb.transportDebugFlag) { - dprint(".get: " + contactInfo + " " + contactInfo.hashCode()); - } - synchronized (backingStore()) { - dprintStatistics(); - return (Connection) connectionCache.get(contactInfo); - } - } - - public void put(ContactInfo contactInfo, Connection connection) - { - if (orb.transportDebugFlag) { - dprint(".put: " + contactInfo + " " + contactInfo.hashCode() + " " - + connection); - } - synchronized (backingStore()) { - connectionCache.put(contactInfo, connection); - connection.setConnectionCache(this); - dprintStatistics(); - } - } - - public void remove(ContactInfo contactInfo) - { - if (orb.transportDebugFlag) { - dprint(".remove: " + contactInfo + " " + contactInfo.hashCode()); - } - synchronized (backingStore()) { - if (contactInfo != null) { - connectionCache.remove(contactInfo); - } - dprintStatistics(); - } - } - - //////////////////////////////////////////////////// - // - // Implementation - // - - public Collection values() - { - return connectionCache.values(); - } - - protected Object backingStore() - { - return connectionCache; - } - - protected void registerWithMonitoring() - { - // ORB - MonitoredObject orbMO = - orb.getMonitoringManager().getRootMonitoredObject(); - - // CONNECTION - MonitoredObject connectionMO = - orbMO.getChild(MonitoringConstants.CONNECTION_MONITORING_ROOT); - if (connectionMO == null) { - connectionMO = - MonitoringFactories.getMonitoredObjectFactory() - .createMonitoredObject( - MonitoringConstants.CONNECTION_MONITORING_ROOT, - MonitoringConstants.CONNECTION_MONITORING_ROOT_DESCRIPTION); - orbMO.addChild(connectionMO); - } - - // OUTBOUND CONNECTION - MonitoredObject outboundConnectionMO = - connectionMO.getChild( - MonitoringConstants.OUTBOUND_CONNECTION_MONITORING_ROOT); - if (outboundConnectionMO == null) { - outboundConnectionMO = - MonitoringFactories.getMonitoredObjectFactory() - .createMonitoredObject( - MonitoringConstants.OUTBOUND_CONNECTION_MONITORING_ROOT, - MonitoringConstants.OUTBOUND_CONNECTION_MONITORING_ROOT_DESCRIPTION); - connectionMO.addChild(outboundConnectionMO); - } - - // NODE FOR THIS CACHE - MonitoredObject thisMO = - outboundConnectionMO.getChild(getMonitoringName()); - if (thisMO == null) { - thisMO = - MonitoringFactories.getMonitoredObjectFactory() - .createMonitoredObject( - getMonitoringName(), - MonitoringConstants.CONNECTION_MONITORING_DESCRIPTION); - outboundConnectionMO.addChild(thisMO); - } - - LongMonitoredAttributeBase attribute; - - // ATTRIBUTE - attribute = new - LongMonitoredAttributeBase( - MonitoringConstants.CONNECTION_TOTAL_NUMBER_OF_CONNECTIONS, - MonitoringConstants.CONNECTION_TOTAL_NUMBER_OF_CONNECTIONS_DESCRIPTION) - { - public Object getValue() { - return new Long(CorbaOutboundConnectionCacheImpl.this.numberOfConnections()); - } - }; - thisMO.addAttribute(attribute); - - // ATTRIBUTE - attribute = new - LongMonitoredAttributeBase( - MonitoringConstants.CONNECTION_NUMBER_OF_IDLE_CONNECTIONS, - MonitoringConstants.CONNECTION_NUMBER_OF_IDLE_CONNECTIONS_DESCRIPTION) - { - public Object getValue() { - return new Long(CorbaOutboundConnectionCacheImpl.this.numberOfIdleConnections()); - } - }; - thisMO.addAttribute(attribute); - - // ATTRIBUTE - attribute = new - LongMonitoredAttributeBase( - MonitoringConstants.CONNECTION_NUMBER_OF_BUSY_CONNECTIONS, - MonitoringConstants.CONNECTION_NUMBER_OF_BUSY_CONNECTIONS_DESCRIPTION) - { - public Object getValue() { - return new Long(CorbaOutboundConnectionCacheImpl.this.numberOfBusyConnections()); - } - }; - thisMO.addAttribute(attribute); - } - - protected void dprint(String msg) - { - ORBUtility.dprint("CorbaOutboundConnectionCacheImpl", msg); - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaResponseWaitingRoomImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaResponseWaitingRoomImpl.java deleted file mode 100644 index 57104f297eb..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaResponseWaitingRoomImpl.java +++ /dev/null @@ -1,337 +0,0 @@ -/* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.transport; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.SystemException; - -import com.sun.corba.se.pept.encoding.InputObject; -import com.sun.corba.se.pept.encoding.OutputObject; -import com.sun.corba.se.pept.protocol.MessageMediator; - -import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; -import com.sun.corba.se.spi.transport.CorbaConnection; -import com.sun.corba.se.spi.transport.CorbaResponseWaitingRoom; - -import com.sun.corba.se.impl.encoding.BufferManagerReadStream; -import com.sun.corba.se.impl.encoding.CDRInputObject; -import com.sun.corba.se.impl.logging.ORBUtilSystemException; -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.protocol.giopmsgheaders.LocateReplyOrReplyMessage; -import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage; - -/** - * @author Harold Carr - */ -public class CorbaResponseWaitingRoomImpl - implements - CorbaResponseWaitingRoom -{ - final static class OutCallDesc - { - java.lang.Object done = new java.lang.Object(); - Thread thread; - MessageMediator messageMediator; - SystemException exception; - InputObject inputObject; - } - - private ORB orb; - private ORBUtilSystemException wrapper ; - - private CorbaConnection connection; - // Maps requestId to an OutCallDesc. - final private Map out_calls; - - public CorbaResponseWaitingRoomImpl(ORB orb, CorbaConnection connection) - { - this.orb = orb; - wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_TRANSPORT ) ; - this.connection = connection; - out_calls = - Collections.synchronizedMap(new HashMap()); - } - - //////////////////////////////////////////////////// - // - // pept.transport.ResponseWaitingRoom - // - - public void registerWaiter(MessageMediator mediator) - { - CorbaMessageMediator messageMediator = (CorbaMessageMediator) mediator; - - if (orb.transportDebugFlag) { - dprint(".registerWaiter: " + opAndId(messageMediator)); - } - - Integer requestId = messageMediator.getRequestIdInteger(); - - OutCallDesc call = new OutCallDesc(); - call.thread = Thread.currentThread(); - call.messageMediator = messageMediator; - out_calls.put(requestId, call); - } - - public void unregisterWaiter(MessageMediator mediator) - { - CorbaMessageMediator messageMediator = (CorbaMessageMediator) mediator; - - if (orb.transportDebugFlag) { - dprint(".unregisterWaiter: " + opAndId(messageMediator)); - } - - Integer requestId = messageMediator.getRequestIdInteger(); - - out_calls.remove(requestId); - } - - public InputObject waitForResponse(MessageMediator mediator) - { - CorbaMessageMediator messageMediator = (CorbaMessageMediator) mediator; - - try { - - InputObject returnStream = null; - - if (orb.transportDebugFlag) { - dprint(".waitForResponse->: " + opAndId(messageMediator)); - } - - Integer requestId = messageMediator.getRequestIdInteger(); - - if (messageMediator.isOneWay()) { - // The waiter is removed in releaseReply in the same - // way as a normal request. - - if (orb.transportDebugFlag) { - dprint(".waitForResponse: one way - not waiting: " - + opAndId(messageMediator)); - } - - return null; - } - - OutCallDesc call = out_calls.get(requestId); - if (call == null) { - throw wrapper.nullOutCall(CompletionStatus.COMPLETED_MAYBE); - } - - synchronized(call.done) { - - while (call.inputObject == null && call.exception == null) { - // Wait for the reply from the server. - // The ReaderThread reads in the reply IIOP message - // and signals us. - try { - if (orb.transportDebugFlag) { - dprint(".waitForResponse: waiting: " - + opAndId(messageMediator)); - } - call.done.wait(); - } catch (InterruptedException ie) {}; - } - - if (call.exception != null) { - if (orb.transportDebugFlag) { - dprint(".waitForResponse: exception: " - + opAndId(messageMediator)); - } - throw call.exception; - } - - returnStream = call.inputObject; - } - - // REVISIT -- exceptions from unmarshaling code will - // go up through this client thread! - - if (returnStream != null) { - // On fragmented streams the header MUST be unmarshaled here - // (in the client thread) in case it blocks. - // If the header was already unmarshaled, this won't - // do anything - // REVISIT: cast - need interface method. - ((CDRInputObject)returnStream).unmarshalHeader(); - } - - return returnStream; - - } finally { - if (orb.transportDebugFlag) { - dprint(".waitForResponse<-: " + opAndId(messageMediator)); - } - } - } - - public void responseReceived(InputObject is) - { - CDRInputObject inputObject = (CDRInputObject) is; - LocateReplyOrReplyMessage header = (LocateReplyOrReplyMessage) - inputObject.getMessageHeader(); - Integer requestId = new Integer(header.getRequestId()); - OutCallDesc call = out_calls.get(requestId); - - if (orb.transportDebugFlag) { - dprint(".responseReceived: id/" - + requestId + ": " - + header); - } - - // This is an interesting case. It could mean that someone sent us a - // reply message, but we don't know what request it was for. That - // would probably call for an error. However, there's another case - // that's normal and we should think about -- - // - // If the unmarshaling thread does all of its work inbetween the time - // the ReaderThread gives it the last fragment and gets to the - // out_calls.get line, then it will also be null, so just return; - if (call == null) { - if (orb.transportDebugFlag) { - dprint(".responseReceived: id/" - + requestId - + ": no waiter: " - + header); - } - return; - } - - // Set the reply InputObject and signal the client thread - // that the reply has been received. - // The thread signalled will remove outcall descriptor if appropriate. - // Otherwise, it'll be removed when last fragment for it has been put on - // BufferManagerRead's queue. - synchronized (call.done) { - CorbaMessageMediator messageMediator = (CorbaMessageMediator) - call.messageMediator; - - if (orb.transportDebugFlag) { - dprint(".responseReceived: " - + opAndId(messageMediator) - + ": notifying waiters"); - } - - messageMediator.setReplyHeader(header); - messageMediator.setInputObject(is); - inputObject.setMessageMediator(messageMediator); - call.inputObject = is; - call.done.notify(); - } - } - - public int numberRegistered() - { - return out_calls.size(); - } - - ////////////////////////////////////////////////// - // - // CorbaResponseWaitingRoom - // - - public void signalExceptionToAllWaiters(SystemException systemException) - { - - if (orb.transportDebugFlag) { - dprint(".signalExceptionToAllWaiters: " + systemException); - } - - synchronized (out_calls) { - if (orb.transportDebugFlag) { - dprint(".signalExceptionToAllWaiters: out_calls size :" + - out_calls.size()); - } - - for (OutCallDesc call : out_calls.values()) { - if (orb.transportDebugFlag) { - dprint(".signalExceptionToAllWaiters: signaling " + - call); - } - synchronized(call.done) { - try { - // anything waiting for BufferManagerRead's fragment queue - // needs to be cancelled - CorbaMessageMediator corbaMsgMediator = - (CorbaMessageMediator)call.messageMediator; - CDRInputObject inputObject = - (CDRInputObject)corbaMsgMediator.getInputObject(); - // IMPORTANT: If inputObject is null, then no need to tell - // BufferManagerRead to cancel request processing. - if (inputObject != null) { - BufferManagerReadStream bufferManager = - (BufferManagerReadStream)inputObject.getBufferManager(); - int requestId = corbaMsgMediator.getRequestId(); - bufferManager.cancelProcessing(requestId); - } - } catch (Exception e) { - } finally { - // attempt to wake up waiting threads in all cases - call.inputObject = null; - call.exception = systemException; - call.done.notifyAll(); - } - } - } - } - } - - public MessageMediator getMessageMediator(int requestId) - { - Integer id = new Integer(requestId); - OutCallDesc call = out_calls.get(id); - if (call == null) { - // This can happen when getting early reply fragments for a - // request which has completed (e.g., client marshaling error). - return null; - } - return call.messageMediator; - } - - //////////////////////////////////////////////////// - // - // Implementation. - // - - protected void dprint(String msg) - { - ORBUtility.dprint("CorbaResponseWaitingRoomImpl", msg); - } - - protected String opAndId(CorbaMessageMediator mediator) - { - return ORBUtility.operationNameAndRequestId(mediator); - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaTransportManagerImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaTransportManagerImpl.java deleted file mode 100644 index 970fde4a873..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaTransportManagerImpl.java +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.transport; - -import java.net.ServerSocket; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.omg.CORBA.INITIALIZE; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.CompletionStatus; - -import com.sun.corba.se.pept.transport.Acceptor; -import com.sun.corba.se.pept.transport.ConnectionCache; -import com.sun.corba.se.pept.transport.ByteBufferPool; -import com.sun.corba.se.pept.transport.ContactInfo; -import com.sun.corba.se.pept.transport.InboundConnectionCache; -import com.sun.corba.se.pept.transport.OutboundConnectionCache; -import com.sun.corba.se.pept.transport.Selector; - -import com.sun.corba.se.spi.ior.IORTemplate; -import com.sun.corba.se.spi.ior.ObjectAdapterId; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.transport.CorbaAcceptor; -import com.sun.corba.se.spi.transport.CorbaTransportManager; -import com.sun.corba.se.pept.transport.Connection; -import com.sun.corba.se.pept.transport.ConnectionCache; - -// REVISIT - impl/poa specific: -import com.sun.corba.se.impl.oa.poa.Policies; -import com.sun.corba.se.impl.orbutil.ORBUtility; - -/** - * @author Harold Carr - */ -public class CorbaTransportManagerImpl - implements - CorbaTransportManager -{ - protected ORB orb; - protected List acceptors; - protected Map outboundConnectionCaches; - protected Map inboundConnectionCaches; - protected Selector selector; - - public CorbaTransportManagerImpl(ORB orb) - { - this.orb = orb; - acceptors = new ArrayList(); - outboundConnectionCaches = new HashMap(); - inboundConnectionCaches = new HashMap(); - selector = new SelectorImpl(orb); - } - - //////////////////////////////////////////////////// - // - // pept TransportManager - // - - public ByteBufferPool getByteBufferPool(int id) - { - throw new RuntimeException(); - } - - public OutboundConnectionCache getOutboundConnectionCache( - ContactInfo contactInfo) - { - synchronized (contactInfo) { - if (contactInfo.getConnectionCache() == null) { - OutboundConnectionCache connectionCache = null; - synchronized (outboundConnectionCaches) { - connectionCache = (OutboundConnectionCache) - outboundConnectionCaches.get( - contactInfo.getConnectionCacheType()); - if (connectionCache == null) { - // REVISIT: Would like to be able to configure - // the connection cache type used. - connectionCache = - new CorbaOutboundConnectionCacheImpl(orb, - contactInfo); - outboundConnectionCaches.put( - contactInfo.getConnectionCacheType(), - connectionCache); - } - } - contactInfo.setConnectionCache(connectionCache); - } - return contactInfo.getConnectionCache(); - } - } - - public Collection getOutboundConnectionCaches() - { - return outboundConnectionCaches.values(); - } - - public InboundConnectionCache getInboundConnectionCache( - Acceptor acceptor) - { - synchronized (acceptor) { - if (acceptor.getConnectionCache() == null) { - InboundConnectionCache connectionCache = null; - synchronized (inboundConnectionCaches) { - connectionCache = (InboundConnectionCache) - inboundConnectionCaches.get( - acceptor.getConnectionCacheType()); - if (connectionCache == null) { - // REVISIT: Would like to be able to configure - // the connection cache type used. - connectionCache = - new CorbaInboundConnectionCacheImpl(orb, - acceptor); - inboundConnectionCaches.put( - acceptor.getConnectionCacheType(), - connectionCache); - } - } - acceptor.setConnectionCache(connectionCache); - } - return acceptor.getConnectionCache(); - } - } - - public Collection getInboundConnectionCaches() - { - return inboundConnectionCaches.values(); - } - - public Selector getSelector(int id) - { - return selector; - } - - public synchronized void registerAcceptor(Acceptor acceptor) - { - if (orb.transportDebugFlag) { - dprint(".registerAcceptor->: " + acceptor); - } - acceptors.add(acceptor); - if (orb.transportDebugFlag) { - dprint(".registerAcceptor<-: " + acceptor); - } - } - - public Collection getAcceptors() - { - return getAcceptors(null, null); - } - - public synchronized void unregisterAcceptor(Acceptor acceptor) - { - acceptors.remove(acceptor); - } - - public void close() - { - try { - if (orb.transportDebugFlag) { - dprint(".close->"); - } - for (Object cc : outboundConnectionCaches.values()) { - ((ConnectionCache)cc).close() ; - } - for (Object icc : inboundConnectionCaches.values()) { - ((ConnectionCache)icc).close() ; - unregisterAcceptor(((InboundConnectionCache)icc).getAcceptor()); - } - getSelector(0).close(); - } finally { - if (orb.transportDebugFlag) { - dprint(".close<-"); - } - } - } - - //////////////////////////////////////////////////// - // - // CorbaTransportManager - // - - public Collection getAcceptors(String objectAdapterManagerId, - ObjectAdapterId objectAdapterId) - { - // REVISIT - need to filter based on arguments. - - // REVISIT - initialization will be moved to OA. - // Lazy initialization of acceptors. - Iterator iterator = acceptors.iterator(); - while (iterator.hasNext()) { - Acceptor acceptor = (Acceptor) iterator.next(); - if (acceptor.initialize()) { - if (acceptor.shouldRegisterAcceptEvent()) { - orb.getTransportManager().getSelector(0) - .registerForEvent(acceptor.getEventHandler()); - } - } - } - return acceptors; - } - - // REVISIT - POA specific policies - public void addToIORTemplate(IORTemplate iorTemplate, - Policies policies, - String codebase, - String objectAdapterManagerId, - ObjectAdapterId objectAdapterId) - { - Iterator iterator = - getAcceptors(objectAdapterManagerId, objectAdapterId).iterator(); - while (iterator.hasNext()) { - CorbaAcceptor acceptor = (CorbaAcceptor) iterator.next(); - acceptor.addToIORTemplate(iorTemplate, policies, codebase); - } - } - - - //////////////////////////////////////////////////// - // - // implemenation - // - - protected void dprint(String msg) - { - ORBUtility.dprint("CorbaTransportManagerImpl", msg); - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/DefaultIORToSocketInfoImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/transport/DefaultIORToSocketInfoImpl.java deleted file mode 100644 index b899682b4df..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/DefaultIORToSocketInfoImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.transport; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.omg.IOP.TAG_ALTERNATE_IIOP_ADDRESS ; - -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.ObjectKeyTemplate; -import com.sun.corba.se.spi.ior.iiop.IIOPProfile ; -import com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate ; -import com.sun.corba.se.spi.ior.iiop.IIOPAddress ; -import com.sun.corba.se.spi.ior.iiop.AlternateIIOPAddressComponent; -import com.sun.corba.se.spi.transport.IORToSocketInfo; -import com.sun.corba.se.spi.transport.SocketInfo; - -public class DefaultIORToSocketInfoImpl - implements IORToSocketInfo -{ - public List getSocketInfo(IOR ior) - { - SocketInfo socketInfo; - List result = new ArrayList(); - - IIOPProfileTemplate iiopProfileTemplate = (IIOPProfileTemplate) - ior.getProfile().getTaggedProfileTemplate() ; - IIOPAddress primary = iiopProfileTemplate.getPrimaryAddress() ; - String hostname = primary.getHost().toLowerCase(); - int port = primary.getPort(); - // NOTE: we could check for 0 (i.e., CSIv2) but, for a - // non-CSIv2-configured client ORB talking to a CSIv2 configured - // server ORB you might end up with an empty contact info list - // which would then report a failure which would not be as - // instructive as leaving a ContactInfo with a 0 port in the list. - socketInfo = createSocketInfo(hostname, port); - result.add(socketInfo); - - Iterator iterator = iiopProfileTemplate.iteratorById( - TAG_ALTERNATE_IIOP_ADDRESS.value); - - while (iterator.hasNext()) { - AlternateIIOPAddressComponent alternate = - (AlternateIIOPAddressComponent) iterator.next(); - hostname = alternate.getAddress().getHost().toLowerCase(); - port = alternate.getAddress().getPort(); - socketInfo= createSocketInfo(hostname, port); - result.add(socketInfo); - } - return result; - } - - private SocketInfo createSocketInfo(final String hostname, final int port) - { - return new SocketInfo() { - public String getType() { return SocketInfo.IIOP_CLEAR_TEXT; } - public String getHost() { return hostname; } - public int getPort() { return port; }}; - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/DefaultSocketFactoryImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/transport/DefaultSocketFactoryImpl.java deleted file mode 100644 index 14536c6e291..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/DefaultSocketFactoryImpl.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.transport; - -import java.io.IOException; -import java.net.InetSocketAddress; -import java.net.Socket; -import java.net.SocketException; -import java.net.ServerSocket; -import java.nio.channels.SocketChannel; -import java.nio.channels.ServerSocketChannel; -import java.security.PrivilegedAction; - -import com.sun.corba.se.pept.transport.Acceptor; - -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.transport.ORBSocketFactory; - -import com.sun.corba.se.impl.orbutil.ORBConstants; - -public class DefaultSocketFactoryImpl - implements ORBSocketFactory -{ - private ORB orb; - private static final boolean keepAlive; - - static { - keepAlive = java.security.AccessController.doPrivileged( - new PrivilegedAction() { - @Override - public Boolean run () { - String value = - System.getProperty("com.sun.CORBA.transport.enableTcpKeepAlive"); - if (value != null) - return new Boolean(!"false".equalsIgnoreCase(value)); - - return Boolean.FALSE; - } - }); - } - - public void setORB(ORB orb) - { - this.orb = orb; - } - - public ServerSocket createServerSocket(String type, - InetSocketAddress inetSocketAddress) - throws IOException - { - ServerSocketChannel serverSocketChannel = null; - ServerSocket serverSocket = null; - - if (orb.getORBData().acceptorSocketType().equals(ORBConstants.SOCKETCHANNEL)) { - serverSocketChannel = ServerSocketChannel.open(); - serverSocket = serverSocketChannel.socket(); - } else { - serverSocket = new ServerSocket(); - } - serverSocket.bind(inetSocketAddress); - return serverSocket; - } - - public Socket createSocket(String type, - InetSocketAddress inetSocketAddress) - throws IOException - { - SocketChannel socketChannel = null; - Socket socket = null; - - if (orb.getORBData().connectionSocketType().equals(ORBConstants.SOCKETCHANNEL)) { - socketChannel = SocketChannel.open(inetSocketAddress); - socket = socketChannel.socket(); - } else { - socket = new Socket(inetSocketAddress.getHostName(), - inetSocketAddress.getPort()); - } - - // Disable Nagle's algorithm (i.e., always send immediately). - socket.setTcpNoDelay(true); - - if (keepAlive) - socket.setKeepAlive(true); - - return socket; - } - - public void setAcceptedSocketOptions(Acceptor acceptor, - ServerSocket serverSocket, - Socket socket) - throws SocketException - { - // Disable Nagle's algorithm (i.e., always send immediately). - socket.setTcpNoDelay(true); - if (keepAlive) - socket.setKeepAlive(true); - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/EventHandlerBase.java b/src/java.corba/share/classes/com/sun/corba/se/impl/transport/EventHandlerBase.java deleted file mode 100644 index 62fd7d18b24..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/EventHandlerBase.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.transport; - -import java.nio.channels.SelectionKey; - -import org.omg.CORBA.INTERNAL; - -import com.sun.corba.se.pept.transport.Acceptor; -import com.sun.corba.se.pept.transport.Connection; -import com.sun.corba.se.pept.transport.EventHandler; - -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.orbutil.threadpool.NoSuchThreadPoolException; -import com.sun.corba.se.spi.orbutil.threadpool.NoSuchWorkQueueException; -import com.sun.corba.se.spi.orbutil.threadpool.Work; - -import com.sun.corba.se.impl.orbutil.ORBUtility; - -public abstract class EventHandlerBase - implements - EventHandler -{ - protected ORB orb; - protected Work work; - protected boolean useWorkerThreadForEvent; - protected boolean useSelectThreadToWait; - protected SelectionKey selectionKey; - - //////////////////////////////////////////////////// - // - // EventHandler methods - // - - public void setUseSelectThreadToWait(boolean x) - { - useSelectThreadToWait = x; - } - - public boolean shouldUseSelectThreadToWait() - { - return useSelectThreadToWait; - } - - public void setSelectionKey(SelectionKey selectionKey) - { - this.selectionKey = selectionKey; - } - - public SelectionKey getSelectionKey() - { - return selectionKey; - } - - /* - * NOTE: - * This is not thread-safe by design. - * Only one thread should call it - a reader/listener/select thread. - * Not stateless: interest ops, registration. - */ - public void handleEvent() - { - if (orb.transportDebugFlag) { - dprint(".handleEvent->: " + this); - } - getSelectionKey().interestOps(getSelectionKey().interestOps() & - (~ getInterestOps())); - if (shouldUseWorkerThreadForEvent()) { - Throwable throwable = null; - try { - if (orb.transportDebugFlag) { - dprint(".handleEvent: addWork to pool: " + 0); - } - orb.getThreadPoolManager().getThreadPool(0) - .getWorkQueue(0).addWork(getWork()); - } catch (NoSuchThreadPoolException e) { - throwable = e; - } catch (NoSuchWorkQueueException e) { - throwable = e; - } - // REVISIT: need to close connection. - if (throwable != null) { - if (orb.transportDebugFlag) { - dprint(".handleEvent: " + throwable); - } - INTERNAL i = new INTERNAL("NoSuchThreadPoolException"); - i.initCause(throwable); - throw i; - } - } else { - if (orb.transportDebugFlag) { - dprint(".handleEvent: doWork"); - } - getWork().doWork(); - } - if (orb.transportDebugFlag) { - dprint(".handleEvent<-: " + this); - } - } - - public boolean shouldUseWorkerThreadForEvent() - { - return useWorkerThreadForEvent; - } - - public void setUseWorkerThreadForEvent(boolean x) - { - useWorkerThreadForEvent = x; - } - - public void setWork(Work work) - { - this.work = work; - } - - public Work getWork() - { - return work; - } - - private void dprint(String msg) - { - ORBUtility.dprint("EventHandlerBase", msg); - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/ListenerThreadImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/transport/ListenerThreadImpl.java deleted file mode 100644 index 6205b9171ee..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/ListenerThreadImpl.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.transport; - -import java.io.IOException; - -import com.sun.corba.se.pept.transport.Acceptor; -import com.sun.corba.se.pept.transport.ListenerThread; -import com.sun.corba.se.pept.transport.Selector; - -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.orbutil.threadpool.Work; - -import com.sun.corba.se.impl.orbutil.ORBUtility; - - -public class ListenerThreadImpl - implements - ListenerThread, - Work -{ - private ORB orb; - private Acceptor acceptor; - private Selector selector; - private boolean keepRunning; - private long enqueueTime; - - public ListenerThreadImpl(ORB orb, Acceptor acceptor, Selector selector) - { - this.orb = orb; - this.acceptor = acceptor; - this.selector = selector; - keepRunning = true; - } - - //////////////////////////////////////////////////// - // - // ListenerThread methods. - // - - public Acceptor getAcceptor() - { - return acceptor; - } - - public void close() - { - if (orb.transportDebugFlag) { - dprint(".close: " + acceptor); - } - - keepRunning = false; - } - - //////////////////////////////////////////////////// - // - // Work methods. - // - - // REVISIT - this needs alot more from previous ListenerThread - - public void doWork() - { - try { - if (orb.transportDebugFlag) { - dprint(".doWork: Start ListenerThread: " + acceptor); - } - while (keepRunning) { - try { - if (orb.transportDebugFlag) { - dprint(".doWork: BEFORE ACCEPT CYCLE: " + acceptor); - } - - acceptor.accept(); - - if (orb.transportDebugFlag) { - dprint(".doWork: AFTER ACCEPT CYCLE: " + acceptor); - } - } catch (Throwable t) { - if (orb.transportDebugFlag) { - dprint(".doWork: Exception in accept: " + acceptor,t); - } - orb.getTransportManager().getSelector(0) - .unregisterForEvent(getAcceptor().getEventHandler()); - getAcceptor().close(); - } - } - } finally { - if (orb.transportDebugFlag) { - dprint(".doWork: Terminated ListenerThread: " + acceptor); - } - } - } - - public void setEnqueueTime(long timeInMillis) - { - enqueueTime = timeInMillis; - } - - public long getEnqueueTime() - { - return enqueueTime; - } - - public String getName() { return "ListenerThread"; } - - //////////////////////////////////////////////////// - // - // Implementation. - // - - private void dprint(String msg) - { - ORBUtility.dprint("ListenerThreadImpl", msg); - } - - private void dprint(String msg, Throwable t) - { - dprint(msg); - t.printStackTrace(System.out); - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/ReadTCPTimeoutsImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/transport/ReadTCPTimeoutsImpl.java deleted file mode 100644 index 104e23ec809..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/ReadTCPTimeoutsImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.transport; - -import com.sun.corba.se.spi.transport.ReadTimeouts; - -/** - * @author Charlie Hunt - */ -public class ReadTCPTimeoutsImpl implements ReadTimeouts -{ - private int initial_time_to_wait; - private int max_time_to_wait; - private int max_giop_header_time_to_wait; - private double backoff_factor; - - // constructor - public ReadTCPTimeoutsImpl(int initial_time, - int max_time, - int max_giop_header_time, - int backoff_percent) { - this.initial_time_to_wait = initial_time; - this.max_time_to_wait = max_time; - this.max_giop_header_time_to_wait = max_giop_header_time; - this.backoff_factor = 1 + (double)(backoff_percent)/100; - } - - public int get_initial_time_to_wait() { return initial_time_to_wait; } - public int get_max_time_to_wait() { return max_time_to_wait; } - public double get_backoff_factor() { return backoff_factor; } - public int get_max_giop_header_time_to_wait() { - return max_giop_header_time_to_wait; } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/ReaderThreadImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/transport/ReaderThreadImpl.java deleted file mode 100644 index a4f65002d8c..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/ReaderThreadImpl.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.transport; - -import java.io.IOException; - -import com.sun.corba.se.pept.transport.Connection; -import com.sun.corba.se.pept.transport.ReaderThread; -import com.sun.corba.se.pept.transport.Selector; - -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.orbutil.threadpool.Work; - -import com.sun.corba.se.impl.orbutil.ORBUtility; - -public class ReaderThreadImpl - implements - ReaderThread, - Work -{ - private ORB orb; - private Connection connection; - private Selector selector; - private boolean keepRunning; - private long enqueueTime; - - public ReaderThreadImpl(ORB orb, - Connection connection, Selector selector) - { - this.orb = orb; - this.connection = connection; - this.selector = selector; - keepRunning = true; - } - - //////////////////////////////////////////////////// - // - // ReaderThread methods. - // - - public Connection getConnection() - { - return connection; - } - - public void close() - { - if (orb.transportDebugFlag) { - dprint(".close: " + connection); - } - - keepRunning = false; - } - - //////////////////////////////////////////////////// - // - // Work methods. - // - - // REVISIT - this needs alot more from previous ReaderThread. - public void doWork() - { - try { - if (orb.transportDebugFlag) { - dprint(".doWork: Start ReaderThread: " + connection); - } - while (keepRunning) { - try { - - if (orb.transportDebugFlag) { - dprint(".doWork: Start ReaderThread cycle: " - + connection); - } - - if (connection.read()) { - // REVISIT - put in pool; - return; - } - - if (orb.transportDebugFlag) { - dprint(".doWork: End ReaderThread cycle: " - + connection); - } - - } catch (Throwable t) { - if (orb.transportDebugFlag) { - dprint(".doWork: exception in read: " + connection,t); - } - orb.getTransportManager().getSelector(0) - .unregisterForEvent(getConnection().getEventHandler()); - getConnection().close(); - } - } - } finally { - if (orb.transportDebugFlag) { - dprint(".doWork: Terminated ReaderThread: " + connection); - } - } - } - - public void setEnqueueTime(long timeInMillis) - { - enqueueTime = timeInMillis; - } - - public long getEnqueueTime() - { - return enqueueTime; - } - - public String getName() { return "ReaderThread"; } - - //////////////////////////////////////////////////// - // - // Implementation. - // - - private void dprint(String msg) - { - ORBUtility.dprint("ReaderThreadImpl", msg); - } - - protected void dprint(String msg, Throwable t) - { - dprint(msg); - t.printStackTrace(System.out); - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/SelectorImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/transport/SelectorImpl.java deleted file mode 100644 index ac87ef9c932..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/SelectorImpl.java +++ /dev/null @@ -1,615 +0,0 @@ -/* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.transport; - -import java.io.IOException; -import java.net.ServerSocket; -import java.nio.channels.ClosedChannelException; -import java.nio.channels.SelectableChannel; -import java.nio.channels.ServerSocketChannel; -import java.nio.channels.SelectionKey; -import java.nio.channels.Selector; -import java.nio.channels.ClosedSelectorException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.Iterator; -import java.util.List; - - -import com.sun.corba.se.pept.broker.Broker; -import com.sun.corba.se.pept.transport.Acceptor; -import com.sun.corba.se.pept.transport.Connection; -import com.sun.corba.se.pept.transport.EventHandler; -import com.sun.corba.se.pept.transport.ListenerThread; -import com.sun.corba.se.pept.transport.ReaderThread; - -import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.orbutil.threadpool.Work; -import com.sun.corba.se.spi.orbutil.threadpool.NoSuchThreadPoolException; -import com.sun.corba.se.spi.orbutil.threadpool.NoSuchWorkQueueException; - -import com.sun.corba.se.impl.logging.ORBUtilSystemException; -import com.sun.corba.se.impl.orbutil.ORBUtility; - -/** - * @author Harold Carr - */ -class SelectorImpl - extends - Thread - implements - com.sun.corba.se.pept.transport.Selector -{ - private ORB orb; - private Selector selector; - private long timeout; - private List deferredRegistrations; - private List interestOpsList; - private HashMap listenerThreads; - private Map readerThreads; - private boolean selectorStarted; - private volatile boolean closed; - private ORBUtilSystemException wrapper; - - - public SelectorImpl(ORB orb) - { - super(null, null, "ORB-Selector-Thread", 0, false); - this.orb = orb; - selector = null; - selectorStarted = false; - timeout = 60000; - deferredRegistrations = new ArrayList(); - interestOpsList = new ArrayList(); - listenerThreads = new HashMap(); - readerThreads = java.util.Collections.synchronizedMap(new HashMap()); - closed = false; - wrapper = ORBUtilSystemException.get(orb,CORBALogDomains.RPC_TRANSPORT); - } - - public void setTimeout(long timeout) - { - this.timeout = timeout; - } - - public long getTimeout() - { - return timeout; - } - - public void registerInterestOps(EventHandler eventHandler) - { - if (orb.transportDebugFlag) { - dprint(".registerInterestOps:-> " + eventHandler); - } - - SelectionKey selectionKey = eventHandler.getSelectionKey(); - if (selectionKey.isValid()) { - int ehOps = eventHandler.getInterestOps(); - SelectionKeyAndOp keyAndOp = new SelectionKeyAndOp(selectionKey, ehOps); - synchronized(interestOpsList) { - interestOpsList.add(keyAndOp); - } - // tell Selector Thread there's an update to a SelectorKey's Ops - try { - if (selector != null) { - // wakeup Selector thread to process close request - selector.wakeup(); - } - } catch (Throwable t) { - if (orb.transportDebugFlag) { - dprint(".registerInterestOps: selector.wakeup: ", t); - } - } - } - else { - wrapper.selectionKeyInvalid(eventHandler.toString()); - if (orb.transportDebugFlag) { - dprint(".registerInterestOps: EventHandler SelectionKey not valid " + eventHandler); - } - } - - if (orb.transportDebugFlag) { - dprint(".registerInterestOps:<- "); - } - } - - public void registerForEvent(EventHandler eventHandler) - { - if (orb.transportDebugFlag) { - dprint(".registerForEvent: " + eventHandler); - } - - if (isClosed()) { - if (orb.transportDebugFlag) { - dprint(".registerForEvent: closed: " + eventHandler); - } - return; - } - - if (eventHandler.shouldUseSelectThreadToWait()) { - synchronized (deferredRegistrations) { - deferredRegistrations.add(eventHandler); - } - if (! selectorStarted) { - startSelector(); - } - selector.wakeup(); - return; - } - - switch (eventHandler.getInterestOps()) { - case SelectionKey.OP_ACCEPT : - createListenerThread(eventHandler); - break; - case SelectionKey.OP_READ : - createReaderThread(eventHandler); - break; - default: - if (orb.transportDebugFlag) { - dprint(".registerForEvent: default: " + eventHandler); - } - throw new RuntimeException( - "SelectorImpl.registerForEvent: unknown interest ops"); - } - } - - public void unregisterForEvent(EventHandler eventHandler) - { - if (orb.transportDebugFlag) { - dprint(".unregisterForEvent: " + eventHandler); - } - - if (isClosed()) { - if (orb.transportDebugFlag) { - dprint(".unregisterForEvent: closed: " + eventHandler); - } - return; - } - - if (eventHandler.shouldUseSelectThreadToWait()) { - SelectionKey selectionKey ; - synchronized(deferredRegistrations) { - selectionKey = eventHandler.getSelectionKey(); - } - if (selectionKey != null) { - selectionKey.cancel(); - } - if (selector != null) { - selector.wakeup(); - } - return; - } - - switch (eventHandler.getInterestOps()) { - case SelectionKey.OP_ACCEPT : - destroyListenerThread(eventHandler); - break; - case SelectionKey.OP_READ : - destroyReaderThread(eventHandler); - break; - default: - if (orb.transportDebugFlag) { - dprint(".unregisterForEvent: default: " + eventHandler); - } - throw new RuntimeException( - "SelectorImpl.uregisterForEvent: unknown interest ops"); - } - } - - public void close() - { - if (orb.transportDebugFlag) { - dprint(".close"); - } - - if (isClosed()) { - if (orb.transportDebugFlag) { - dprint(".close: already closed"); - } - return; - } - - setClosed(true); - - Iterator i; - - // Kill listeners. - - i = listenerThreads.values().iterator(); - while (i.hasNext()) { - ListenerThread listenerThread = (ListenerThread) i.next(); - listenerThread.close(); - } - - // Kill readers. - - i = readerThreads.values().iterator(); - while (i.hasNext()) { - ReaderThread readerThread = (ReaderThread) i.next(); - readerThread.close(); - } - - clearDeferredRegistrations(); - - // Selector - - try { - if (selector != null) { - // wakeup Selector thread to process close request - selector.wakeup(); - } - } catch (Throwable t) { - if (orb.transportDebugFlag) { - dprint(".close: selector.wakeup: ", t); - } - } - } - - /////////////////////////////////////////////////// - // - // Thread methods. - // - - public void run() - { - while (!closed) { - try { - int n = 0; - if (timeout == 0 && orb.transportDebugFlag) { - dprint(".run: Beginning of selection cycle"); - } - handleDeferredRegistrations(); - enableInterestOps(); - try { - n = selector.select(timeout); - } catch (IOException e) { - if (orb.transportDebugFlag) { - dprint(".run: selector.select: ", e); - } - } catch (ClosedSelectorException csEx) { - if (orb.transportDebugFlag) { - dprint(".run: selector.select: ", csEx); - } - break; - } - if (closed) { - break; - } - /* - if (timeout == 0 && orb.transportDebugFlag) { - dprint(".run: selector.select() returned: " + n); - } - if (n == 0) { - continue; - } - */ - Iterator iterator = selector.selectedKeys().iterator(); - if (orb.transportDebugFlag) { - if (iterator.hasNext()) { - dprint(".run: n = " + n); - } - } - while (iterator.hasNext()) { - SelectionKey selectionKey = (SelectionKey) iterator.next(); - iterator.remove(); - EventHandler eventHandler = (EventHandler) - selectionKey.attachment(); - try { - eventHandler.handleEvent(); - } catch (Throwable t) { - if (orb.transportDebugFlag) { - dprint(".run: eventHandler.handleEvent", t); - } - } - } - if (timeout == 0 && orb.transportDebugFlag) { - dprint(".run: End of selection cycle"); - } - } catch (Throwable t) { - // IMPORTANT: ignore all errors so the select thread keeps running. - // Otherwise a guaranteed hang. - if (orb.transportDebugFlag) { - dprint(".run: ignoring", t); - } - } - } - try { - if (selector != null) { - if (orb.transportDebugFlag) { - dprint(".run: selector.close "); - } - selector.close(); - } - } catch (Throwable t) { - if (orb.transportDebugFlag) { - dprint(".run: selector.close: ", t); - } - } - } - - ///////////////////////////////////////////////////// - // - // Implementation. - // - - private void clearDeferredRegistrations() { - synchronized (deferredRegistrations) { - int deferredListSize = deferredRegistrations.size(); - if (orb.transportDebugFlag) { - dprint(".clearDeferredRegistrations:deferred list size == " + deferredListSize); - } - for (int i = 0; i < deferredListSize; i++) { - EventHandler eventHandler = - (EventHandler)deferredRegistrations.get(i); - if (orb.transportDebugFlag) { - dprint(".clearDeferredRegistrations: " + eventHandler); - } - SelectableChannel channel = eventHandler.getChannel(); - SelectionKey selectionKey = null; - - try { - if (orb.transportDebugFlag) { - dprint(".clearDeferredRegistrations:close channel == " - + channel); - dprint(".clearDeferredRegistrations:close channel class == " - + channel.getClass().getName()); - } - channel.close(); - selectionKey = eventHandler.getSelectionKey(); - if (selectionKey != null) { - selectionKey.cancel(); - selectionKey.attach(null); - } - } catch (IOException ioEx) { - if (orb.transportDebugFlag) { - dprint(".clearDeferredRegistrations: ", ioEx); - } - } - } - deferredRegistrations.clear(); - } - } - - private synchronized boolean isClosed () - { - return closed; - } - - private synchronized void setClosed(boolean closed) - { - this.closed = closed; - } - - private void startSelector() - { - try { - selector = Selector.open(); - } catch (IOException e) { - if (orb.transportDebugFlag) { - dprint(".startSelector: Selector.open: IOException: ", e); - } - // REVISIT - better handling/reporting - RuntimeException rte = - new RuntimeException(".startSelector: Selector.open exception"); - rte.initCause(e); - throw rte; - } - setDaemon(true); - start(); - selectorStarted = true; - if (orb.transportDebugFlag) { - dprint(".startSelector: selector.start completed."); - } - } - - private void handleDeferredRegistrations() - { - synchronized (deferredRegistrations) { - int deferredListSize = deferredRegistrations.size(); - for (int i = 0; i < deferredListSize; i++) { - EventHandler eventHandler = - (EventHandler)deferredRegistrations.get(i); - if (orb.transportDebugFlag) { - dprint(".handleDeferredRegistrations: " + eventHandler); - } - SelectableChannel channel = eventHandler.getChannel(); - SelectionKey selectionKey = null; - try { - selectionKey = - channel.register(selector, - eventHandler.getInterestOps(), - (Object)eventHandler); - } catch (ClosedChannelException e) { - if (orb.transportDebugFlag) { - dprint(".handleDeferredRegistrations: ", e); - } - } - eventHandler.setSelectionKey(selectionKey); - } - deferredRegistrations.clear(); - } - } - - private void enableInterestOps() - { - synchronized (interestOpsList) { - int listSize = interestOpsList.size(); - if (listSize > 0) { - if (orb.transportDebugFlag) { - dprint(".enableInterestOps:->"); - } - SelectionKey selectionKey = null; - SelectionKeyAndOp keyAndOp = null; - int keyOp, selectionKeyOps = 0; - for (int i = 0; i < listSize; i++) { - keyAndOp = (SelectionKeyAndOp)interestOpsList.get(i); - selectionKey = keyAndOp.selectionKey; - - // Need to check if the SelectionKey is valid because a - // connection's SelectionKey could be put on the list to - // have its OP enabled and before it's enabled be reclaimed. - // Otherwise, the enabling of the OP will throw an exception - // here and exit this method an potentially not enable all - // registered ops. - // - // So, we ignore SelectionKeys that are invalid. They will get - // cleaned up on the next Selector.select() call. - - if (selectionKey.isValid()) { - if (orb.transportDebugFlag) { - dprint(".enableInterestOps: " + keyAndOp); - } - keyOp = keyAndOp.keyOp; - selectionKeyOps = selectionKey.interestOps(); - selectionKey.interestOps(selectionKeyOps | keyOp); - } - } - interestOpsList.clear(); - if (orb.transportDebugFlag) { - dprint(".enableInterestOps:<-"); - } - } - } - } - - private void createListenerThread(EventHandler eventHandler) - { - if (orb.transportDebugFlag) { - dprint(".createListenerThread: " + eventHandler); - } - Acceptor acceptor = eventHandler.getAcceptor(); - ListenerThread listenerThread = - new ListenerThreadImpl(orb, acceptor, this); - listenerThreads.put(eventHandler, listenerThread); - Throwable throwable = null; - try { - orb.getThreadPoolManager().getThreadPool(0) - .getWorkQueue(0).addWork((Work)listenerThread); - } catch (NoSuchThreadPoolException e) { - throwable = e; - } catch (NoSuchWorkQueueException e) { - throwable = e; - } - if (throwable != null) { - RuntimeException rte = new RuntimeException(throwable.toString()); - rte.initCause(throwable); - throw rte; - } - } - - private void destroyListenerThread(EventHandler eventHandler) - { - if (orb.transportDebugFlag) { - dprint(".destroyListenerThread: " + eventHandler); - } - ListenerThread listenerThread = (ListenerThread) - listenerThreads.get(eventHandler); - if (listenerThread == null) { - if (orb.transportDebugFlag) { - dprint(".destroyListenerThread: cannot find ListenerThread - ignoring."); - } - return; - } - listenerThreads.remove(eventHandler); - listenerThread.close(); - } - - private void createReaderThread(EventHandler eventHandler) - { - if (orb.transportDebugFlag) { - dprint(".createReaderThread: " + eventHandler); - } - Connection connection = eventHandler.getConnection(); - ReaderThread readerThread = - new ReaderThreadImpl(orb, connection, this); - readerThreads.put(eventHandler, readerThread); - Throwable throwable = null; - try { - orb.getThreadPoolManager().getThreadPool(0) - .getWorkQueue(0).addWork((Work)readerThread); - } catch (NoSuchThreadPoolException e) { - throwable = e; - } catch (NoSuchWorkQueueException e) { - throwable = e; - } - if (throwable != null) { - RuntimeException rte = new RuntimeException(throwable.toString()); - rte.initCause(throwable); - throw rte; - } - } - - private void destroyReaderThread(EventHandler eventHandler) - { - if (orb.transportDebugFlag) { - dprint(".destroyReaderThread: " + eventHandler); - } - ReaderThread readerThread = (ReaderThread) - readerThreads.get(eventHandler); - if (readerThread == null) { - if (orb.transportDebugFlag) { - dprint(".destroyReaderThread: cannot find ReaderThread - ignoring."); - } - return; - } - readerThreads.remove(eventHandler); - readerThread.close(); - } - - private void dprint(String msg) - { - ORBUtility.dprint("SelectorImpl", msg); - } - - protected void dprint(String msg, Throwable t) - { - dprint(msg); - t.printStackTrace(System.out); - } - - // Private class to contain a SelectionKey and a SelectionKey op. - // Used only by SelectorImpl to register and enable SelectionKey - // Op. - // REVISIT - Could do away with this class and use the EventHanlder - // directly. - private class SelectionKeyAndOp - { - // A SelectionKey.[OP_READ|OP_WRITE|OP_ACCEPT|OP_CONNECT] - public int keyOp; - public SelectionKey selectionKey; - - // constructor - public SelectionKeyAndOp(SelectionKey selectionKey, int keyOp) { - this.selectionKey = selectionKey; - this.keyOp = keyOp; - } - } - -// End of file. -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/SharedCDRContactInfoImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/transport/SharedCDRContactInfoImpl.java deleted file mode 100644 index 49f2b8a2062..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/SharedCDRContactInfoImpl.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.transport; - -import com.sun.corba.se.pept.broker.Broker; -import com.sun.corba.se.pept.encoding.OutputObject; -import com.sun.corba.se.pept.protocol.ClientRequestDispatcher; -import com.sun.corba.se.pept.protocol.MessageMediator; -import com.sun.corba.se.pept.transport.Connection; -import com.sun.corba.se.pept.transport.ContactInfo; - -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; -import com.sun.corba.se.spi.transport.CorbaContactInfoList; - -import com.sun.corba.se.impl.encoding.BufferManagerFactory; -import com.sun.corba.se.impl.encoding.CDROutputObject; -import com.sun.corba.se.impl.encoding.CDROutputStream; -import com.sun.corba.se.impl.logging.ORBUtilSystemException; -import com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl; -import com.sun.corba.se.impl.protocol.SharedCDRClientRequestDispatcherImpl; - -public class SharedCDRContactInfoImpl - extends - CorbaContactInfoBase -{ - // This is only necessary for the pi.clientrequestinfo test. - // It tests that request ids are different. - // Rather than rewrite the test, just fake it. - private static int requestId = 0; - - protected ORBUtilSystemException wrapper; - - public SharedCDRContactInfoImpl( - ORB orb, - CorbaContactInfoList contactInfoList, - IOR effectiveTargetIOR, - short addressingDisposition) - { - this.orb = orb; - this.contactInfoList = contactInfoList; - this.effectiveTargetIOR = effectiveTargetIOR; - this.addressingDisposition = addressingDisposition; - } - - //////////////////////////////////////////////////// - // - // pept.transport.ContactInfo - // - - public ClientRequestDispatcher getClientRequestDispatcher() - { - // REVISIT - use registry - return new SharedCDRClientRequestDispatcherImpl(); - } - - public boolean isConnectionBased() - { - return false; - } - - public boolean shouldCacheConnection() - { - return false; - } - - public String getConnectionCacheType() - { - throw getWrapper().methodShouldNotBeCalled(); - } - - public Connection createConnection() - { - throw getWrapper().methodShouldNotBeCalled(); - } - - // Called when client making an invocation. - public MessageMediator createMessageMediator(Broker broker, - ContactInfo contactInfo, - Connection connection, - String methodName, - boolean isOneWay) - { - if (connection != null) { - /// XXX LOGGING - throw new RuntimeException("connection is not null"); - } - - CorbaMessageMediator messageMediator = - new CorbaMessageMediatorImpl( - (ORB) broker, - contactInfo, - null, // Connection; - GIOPVersion.chooseRequestVersion( (ORB)broker, - effectiveTargetIOR), - effectiveTargetIOR, - requestId++, // Fake RequestId - getAddressingDisposition(), - methodName, - isOneWay); - - return messageMediator; - } - - public OutputObject createOutputObject(MessageMediator messageMediator) - { - CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator) - messageMediator; - // NOTE: GROW. - OutputObject outputObject = - sun.corba.OutputStreamFactory.newCDROutputObject(orb, messageMediator, - corbaMessageMediator.getRequestHeader(), - corbaMessageMediator.getStreamFormatVersion(), - BufferManagerFactory.GROW); - messageMediator.setOutputObject(outputObject); - return outputObject; - } - - //////////////////////////////////////////////////// - // - // spi.transport.CorbaContactInfo - // - - public String getMonitoringName() - { - throw getWrapper().methodShouldNotBeCalled(); - } - - //////////////////////////////////////////////////// - // - // java.lang.Object - // - - //////////////////////////////////////////////////// - // - // java.lang.Object - // - - public String toString() - { - return - "SharedCDRContactInfoImpl[" - + "]"; - } - - ////////////////////////////////////////////////// - // - // Implementation - // - - protected ORBUtilSystemException getWrapper() - { - if (wrapper == null) { - wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_TRANSPORT ) ; - } - return wrapper; - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelAcceptorImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelAcceptorImpl.java deleted file mode 100644 index 4b24c6b8376..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelAcceptorImpl.java +++ /dev/null @@ -1,664 +0,0 @@ -/* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.transport; - -import java.io.IOException; -import java.net.InetSocketAddress; -import java.net.ServerSocket; -import java.net.Socket; -import java.nio.channels.SelectableChannel; -import java.nio.channels.SelectionKey; -import java.nio.channels.ServerSocketChannel; -import java.nio.channels.SocketChannel; -import java.util.Iterator; - -import com.sun.corba.se.pept.broker.Broker; -import com.sun.corba.se.pept.encoding.InputObject; -import com.sun.corba.se.pept.encoding.OutputObject; -import com.sun.corba.se.pept.protocol.MessageMediator; -import com.sun.corba.se.pept.transport.Acceptor; -import com.sun.corba.se.pept.transport.Connection; -import com.sun.corba.se.pept.transport.ContactInfo; -import com.sun.corba.se.pept.transport.EventHandler; -import com.sun.corba.se.pept.transport.InboundConnectionCache; -import com.sun.corba.se.pept.transport.Selector; - -import com.sun.corba.se.spi.extension.RequestPartitioningPolicy; -import com.sun.corba.se.spi.ior.IORTemplate; -import com.sun.corba.se.spi.ior.TaggedProfileTemplate; -import com.sun.corba.se.spi.ior.iiop.IIOPAddress ; -import com.sun.corba.se.spi.ior.iiop.IIOPFactories; -import com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate ; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion ; -import com.sun.corba.se.spi.ior.iiop.AlternateIIOPAddressComponent; -import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.orbutil.threadpool.Work; -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; -import com.sun.corba.se.spi.transport.CorbaAcceptor; -import com.sun.corba.se.spi.transport.CorbaConnection; -import com.sun.corba.se.spi.transport.SocketInfo; -import com.sun.corba.se.spi.transport.SocketOrChannelAcceptor; - -import com.sun.corba.se.impl.encoding.CDRInputObject; -import com.sun.corba.se.impl.encoding.CDROutputObject; -import com.sun.corba.se.impl.logging.ORBUtilSystemException; -import com.sun.corba.se.impl.oa.poa.Policies; // REVISIT impl/poa specific -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.impl.orbutil.ORBUtility; - -// BEGIN Legacy support. -import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketEndPointInfo; -// END Legacy support. - -/** - * @author Harold Carr - */ -public class SocketOrChannelAcceptorImpl - extends - EventHandlerBase - implements - CorbaAcceptor, - SocketOrChannelAcceptor, - Work, - // BEGIN Legacy - SocketInfo, - LegacyServerSocketEndPointInfo - // END Legacy -{ - protected ServerSocketChannel serverSocketChannel; - protected ServerSocket serverSocket; - protected int port; - protected long enqueueTime; - protected boolean initialized; - protected ORBUtilSystemException wrapper ; - protected InboundConnectionCache connectionCache; - - // BEGIN Legacy - protected String type = ""; - protected String name = ""; - protected String hostname; - protected int locatorPort; - // END Legacy - - public SocketOrChannelAcceptorImpl(ORB orb) - { - this.orb = orb; - wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_TRANSPORT ) ; - - setWork(this); - initialized = false; - - // BEGIN Legacy support. - this.hostname = orb.getORBData().getORBServerHost(); - this.name = LegacyServerSocketEndPointInfo.NO_NAME; - this.locatorPort = -1; - // END Legacy support. - } - - public SocketOrChannelAcceptorImpl(ORB orb, int port) - { - this(orb); - this.port = port; - } - - // BEGIN Legacy support. - public SocketOrChannelAcceptorImpl(ORB orb, int port, - String name, String type) - { - this(orb, port); - this.name = name; - this.type = type; - } - // END Legacy support. - - //////////////////////////////////////////////////// - // - // pept.transport.Acceptor - // - - public boolean initialize() - { - if (initialized) { - return false; - } - if (orb.transportDebugFlag) { - dprint(".initialize: " + this); - } - InetSocketAddress inetSocketAddress = null; - try { - if (orb.getORBData().getListenOnAllInterfaces().equals(ORBConstants.LISTEN_ON_ALL_INTERFACES)) { - inetSocketAddress = new InetSocketAddress(port); - } else { - String host = orb.getORBData().getORBServerHost(); - inetSocketAddress = new InetSocketAddress(host, port); - } - serverSocket = orb.getORBData().getSocketFactory() - .createServerSocket(type, inetSocketAddress); - internalInitialize(); - } catch (Throwable t) { - throw wrapper.createListenerFailed( t, Integer.toString(port) ) ; - } - initialized = true; - return true; - } - - protected void internalInitialize() - throws Exception - { - // Determine the listening port (for the IOR). - // This is important when using emphemeral ports (i.e., - // when the port value to the constructor is 0). - - port = serverSocket.getLocalPort(); - - // Register with transport (also sets up monitoring). - - orb.getCorbaTransportManager().getInboundConnectionCache(this); - - // Finish configuation. - - serverSocketChannel = serverSocket.getChannel(); - - if (serverSocketChannel != null) { - setUseSelectThreadToWait( - orb.getORBData().acceptorSocketUseSelectThreadToWait()); - serverSocketChannel.configureBlocking( - ! orb.getORBData().acceptorSocketUseSelectThreadToWait()); - } else { - // Configure to use listener and reader threads. - setUseSelectThreadToWait(false); - } - setUseWorkerThreadForEvent( - orb.getORBData().acceptorSocketUseWorkerThreadForEvent()); - - } - - public boolean initialized() - { - return initialized; - } - - public String getConnectionCacheType() - { - return this.getClass().toString(); - } - - public void setConnectionCache(InboundConnectionCache connectionCache) - { - this.connectionCache = connectionCache; - } - - public InboundConnectionCache getConnectionCache() - { - return connectionCache; - } - - public boolean shouldRegisterAcceptEvent() - { - return true; - } - - public void accept() - { - try { - SocketChannel socketChannel = null; - Socket socket = null; - if (serverSocketChannel == null) { - socket = serverSocket.accept(); - } else { - socketChannel = serverSocketChannel.accept(); - socket = socketChannel.socket(); - } - orb.getORBData().getSocketFactory() - .setAcceptedSocketOptions(this, serverSocket, socket); - if (orb.transportDebugFlag) { - dprint(".accept: " + - (serverSocketChannel == null - ? serverSocket.toString() - : serverSocketChannel.toString())); - } - - CorbaConnection connection = - new SocketOrChannelConnectionImpl(orb, this, socket); - if (orb.transportDebugFlag) { - dprint(".accept: new: " + connection); - } - - // NOTE: The connection MUST be put in the cache BEFORE being - // registered with the selector. Otherwise if the bytes - // are read on the connection it will attempt a time stamp - // but the cache will be null, resulting in NPE. - - // A connection needs to be timestamped before putting to the cache. - // Otherwise the newly created connection (with 0 timestamp) could be - // incorrectly reclaimed by concurrent reclaim() call OR if there - // will be no events on this connection then it could be reclaimed - // by upcoming reclaim() call. - getConnectionCache().stampTime(connection); - getConnectionCache().put(this, connection); - - if (connection.shouldRegisterServerReadEvent()) { - Selector selector = orb.getTransportManager().getSelector(0); - if (selector != null) { - if (orb.transportDebugFlag) { - dprint(".accept: registerForEvent: " + connection); - } - selector.registerForEvent(connection.getEventHandler()); - } - } - - getConnectionCache().reclaim(); - - } catch (IOException e) { - if (orb.transportDebugFlag) { - dprint(".accept:", e); - } - Selector selector = orb.getTransportManager().getSelector(0); - if (selector != null) { - selector.unregisterForEvent(this); - // REVISIT - need to close - recreate - then register new one. - selector.registerForEvent(this); - // NOTE: if register cycling we do not want to shut down ORB - // since local beans will still work. Instead one will see - // a growing log file to alert admin of problem. - } - } - } - - public void close () - { - try { - if (orb.transportDebugFlag) { - dprint(".close->:"); - } - Selector selector = orb.getTransportManager().getSelector(0); - if (selector != null) { - selector.unregisterForEvent(this); - } - if (serverSocketChannel != null) { - serverSocketChannel.close(); - } - if (serverSocket != null) { - serverSocket.close(); - } - } catch (IOException e) { - if (orb.transportDebugFlag) { - dprint(".close:", e); - } - } finally { - if (orb.transportDebugFlag) { - dprint(".close<-:"); - } - } - } - - public EventHandler getEventHandler() - { - return this; - } - - //////////////////////////////////////////////////// - // - // CorbaAcceptor - // - - public String getObjectAdapterId() - { - return null; - } - - public String getObjectAdapterManagerId() - { - return null; - } - - public void addToIORTemplate(IORTemplate iorTemplate, - Policies policies, - String codebase) - { - Iterator iterator = iorTemplate.iteratorById( - org.omg.IOP.TAG_INTERNET_IOP.value); - - String hostname = orb.getORBData().getORBServerHost(); - - if (iterator.hasNext()) { - // REVISIT - how does this play with legacy ORBD port exchange? - IIOPAddress iiopAddress = - IIOPFactories.makeIIOPAddress(orb, hostname, port); - AlternateIIOPAddressComponent iiopAddressComponent = - IIOPFactories.makeAlternateIIOPAddressComponent(iiopAddress); - - while (iterator.hasNext()) { - TaggedProfileTemplate taggedProfileTemplate = - (TaggedProfileTemplate) iterator.next(); - taggedProfileTemplate.add(iiopAddressComponent); - } - } else { - GIOPVersion version = orb.getORBData().getGIOPVersion(); - int templatePort; - if (policies.forceZeroPort()) { - templatePort = 0; - } else if (policies.isTransient()) { - templatePort = port; - } else { - templatePort = orb.getLegacyServerSocketManager() - .legacyGetPersistentServerPort(SocketInfo.IIOP_CLEAR_TEXT); - } - IIOPAddress addr = - IIOPFactories.makeIIOPAddress(orb, hostname, templatePort); - IIOPProfileTemplate iiopProfile = - IIOPFactories.makeIIOPProfileTemplate(orb, version, addr); - if (version.supportsIORIIOPProfileComponents()) { - iiopProfile.add(IIOPFactories.makeCodeSetsComponent(orb)); - iiopProfile.add(IIOPFactories.makeMaxStreamFormatVersionComponent()); - RequestPartitioningPolicy rpPolicy = (RequestPartitioningPolicy) - policies.get_effective_policy( - ORBConstants.REQUEST_PARTITIONING_POLICY); - if (rpPolicy != null) { - iiopProfile.add( - IIOPFactories.makeRequestPartitioningComponent( - rpPolicy.getValue())); - } - if (codebase != null && codebase != "") { - iiopProfile.add(IIOPFactories. makeJavaCodebaseComponent(codebase)); - } - if (orb.getORBData().isJavaSerializationEnabled()) { - iiopProfile.add( - IIOPFactories.makeJavaSerializationComponent()); - } - } - iorTemplate.add(iiopProfile); - } - } - - public String getMonitoringName() - { - return "AcceptedConnections"; - } - - //////////////////////////////////////////////////// - // - // EventHandler methods - // - - public SelectableChannel getChannel() - { - return serverSocketChannel; - } - - public int getInterestOps() - { - return SelectionKey.OP_ACCEPT; - } - - public Acceptor getAcceptor() - { - return this; - } - - public Connection getConnection() - { - throw new RuntimeException("Should not happen."); - } - - //////////////////////////////////////////////////// - // - // Work methods. - // - - /* CONFLICT: with legacy below. - public String getName() - { - return this.toString(); - } - */ - - public void doWork() - { - try { - if (orb.transportDebugFlag) { - dprint(".doWork->: " + this); - } - if (selectionKey.isAcceptable()) { - accept(); - } else { - if (orb.transportDebugFlag) { - dprint(".doWork: ! selectionKey.isAcceptable: " + this); - } - } - } catch (SecurityException se) { - if (orb.transportDebugFlag) { - dprint(".doWork: ignoring SecurityException: " - + se - + " " + this); - } - String permissionStr = ORBUtility.getClassSecurityInfo(getClass()); - wrapper.securityExceptionInAccept(se, permissionStr); - } catch (Exception ex) { - if (orb.transportDebugFlag) { - dprint(".doWork: ignoring Exception: " - + ex - + " " + this); - } - wrapper.exceptionInAccept(ex); - } catch (Throwable t) { - if (orb.transportDebugFlag) { - dprint(".doWork: ignoring Throwable: " - + t - + " " + this); - } - } finally { - - // IMPORTANT: To avoid bug (4953599), we force the - // Thread that does the NIO select to also do the - // enable/disable of Ops using SelectionKey.interestOps(). - // Otherwise, the SelectionKey.interestOps() may block - // indefinitely. - // NOTE: If "acceptorSocketUseWorkerThreadForEvent" is - // set to to false in ParserTable.java, then this method, - // doWork(), will get executed by the same thread - // (SelectorThread) that does the NIO select. - // If "acceptorSocketUseWorkerThreadForEvent" is set - // to true, a WorkerThread will execute this method, - // doWork(). Hence, the registering of the enabling of - // the SelectionKey's interestOps is done here instead - // of calling SelectionKey.interestOps(). - - Selector selector = orb.getTransportManager().getSelector(0); - if (selector != null) { - selector.registerInterestOps(this); - } - - if (orb.transportDebugFlag) { - dprint(".doWork<-:" + this); - } - } - } - - public void setEnqueueTime(long timeInMillis) - { - enqueueTime = timeInMillis; - } - - public long getEnqueueTime() - { - return enqueueTime; - } - - - // - // Factory methods. - // - - // REVISIT: refactor into common base or delegate. - public MessageMediator createMessageMediator(Broker broker, - Connection connection) - { - // REVISIT - no factoring so cheat to avoid code dup right now. - // REVISIT **** COUPLING !!!! - ContactInfo contactInfo = new SocketOrChannelContactInfoImpl(); - return contactInfo.createMessageMediator(broker, connection); - } - - // REVISIT: refactor into common base or delegate. - public MessageMediator finishCreatingMessageMediator(Broker broker, - Connection connection, - MessageMediator messageMediator) - { - // REVISIT - no factoring so cheat to avoid code dup right now. - // REVISIT **** COUPLING !!!! - ContactInfo contactInfo = new SocketOrChannelContactInfoImpl(); - return contactInfo.finishCreatingMessageMediator(broker, - connection, messageMediator); - } - - public InputObject createInputObject(Broker broker, - MessageMediator messageMediator) - { - CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator) - messageMediator; - return new CDRInputObject((ORB)broker, - (CorbaConnection)messageMediator.getConnection(), - corbaMessageMediator.getDispatchBuffer(), - corbaMessageMediator.getDispatchHeader()); - } - - public OutputObject createOutputObject(Broker broker, - MessageMediator messageMediator) - { - CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator) - messageMediator; - return sun.corba.OutputStreamFactory.newCDROutputObject((ORB) broker, - corbaMessageMediator, corbaMessageMediator.getReplyHeader(), - corbaMessageMediator.getStreamFormatVersion()); - } - - //////////////////////////////////////////////////// - // - // SocketOrChannelAcceptor - // - - public ServerSocket getServerSocket() - { - return serverSocket; - } - - //////////////////////////////////////////////////// - // - // Implementation. - // - - public String toString() - { - String sock; - if (serverSocketChannel == null) { - if (serverSocket == null) { - sock = "(not initialized)"; - } else { - sock = serverSocket.toString(); - } - } else { - sock = serverSocketChannel.toString(); - } - - return - toStringName() + - "[" - + sock + " " - + type + " " - + shouldUseSelectThreadToWait() + " " - + shouldUseWorkerThreadForEvent() - + "]" ; - } - - protected String toStringName() - { - return "SocketOrChannelAcceptorImpl"; - } - - protected void dprint(String msg) - { - ORBUtility.dprint(toStringName(), msg); - } - - protected void dprint(String msg, Throwable t) - { - dprint(msg); - t.printStackTrace(System.out); - } - - // BEGIN Legacy support - //////////////////////////////////////////////////// - // - // LegacyServerSocketEndPointInfo and EndPointInfo - // - - public String getType() - { - return type; - } - - public String getHostName() - { - return hostname; - } - - public String getHost() - { - return hostname; - } - - public int getPort() - { - return port; - } - - public int getLocatorPort() - { - return locatorPort; - } - - public void setLocatorPort (int port) - { - locatorPort = port; - } - - public String getName() - { - // Kluge alert: - // Work and Legacy both define getName. - // Try to make this behave best for most cases. - String result = - name.equals(LegacyServerSocketEndPointInfo.NO_NAME) ? - this.toString() : name; - return result; - } - // END Legacy support -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java deleted file mode 100644 index f7c1e314eec..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java +++ /dev/null @@ -1,1687 +0,0 @@ -/* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.transport; - -import java.io.IOException; -import java.net.InetSocketAddress; -import java.net.Socket; -import java.nio.ByteBuffer; -import java.nio.channels.SelectableChannel; -import java.nio.channels.SelectionKey; -import java.nio.channels.SocketChannel; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.Collections; -import java.util.Hashtable; -import java.util.HashMap; -import java.util.Map; - -import org.omg.CORBA.COMM_FAILURE; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.DATA_CONVERSION; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.MARSHAL; -import org.omg.CORBA.OBJECT_NOT_EXIST; -import org.omg.CORBA.SystemException; - -import com.sun.org.omg.SendingContext.CodeBase; - -import com.sun.corba.se.pept.broker.Broker; -import com.sun.corba.se.pept.encoding.InputObject; -import com.sun.corba.se.pept.encoding.OutputObject; -import com.sun.corba.se.pept.protocol.MessageMediator; -import com.sun.corba.se.pept.transport.Acceptor; -import com.sun.corba.se.pept.transport.Connection; -import com.sun.corba.se.pept.transport.ConnectionCache; -import com.sun.corba.se.pept.transport.ContactInfo; -import com.sun.corba.se.pept.transport.EventHandler; -import com.sun.corba.se.pept.transport.InboundConnectionCache; -import com.sun.corba.se.pept.transport.OutboundConnectionCache; -import com.sun.corba.se.pept.transport.ResponseWaitingRoom; -import com.sun.corba.se.pept.transport.Selector; - -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.orbutil.threadpool.NoSuchThreadPoolException; -import com.sun.corba.se.spi.orbutil.threadpool.NoSuchWorkQueueException; -import com.sun.corba.se.spi.orbutil.threadpool.Work; -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; -import com.sun.corba.se.spi.transport.CorbaContactInfo; -import com.sun.corba.se.spi.transport.CorbaConnection; -import com.sun.corba.se.spi.transport.CorbaResponseWaitingRoom; -import com.sun.corba.se.spi.transport.ReadTimeouts; - -import com.sun.corba.se.impl.encoding.CachedCodeBase; -import com.sun.corba.se.impl.encoding.CDRInputStream_1_0; -import com.sun.corba.se.impl.encoding.CDROutputObject; -import com.sun.corba.se.impl.encoding.CDROutputStream_1_0; -import com.sun.corba.se.impl.encoding.CodeSetComponentInfo; -import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry; -import com.sun.corba.se.impl.logging.ORBUtilSystemException; -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; -import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase; -import com.sun.corba.se.impl.transport.CorbaResponseWaitingRoomImpl; - -/** - * @author Harold Carr - */ -public class SocketOrChannelConnectionImpl - extends - EventHandlerBase - implements - CorbaConnection, - Work -{ - public static boolean dprintWriteLocks = false; - - // - // New transport. - // - - protected long enqueueTime; - - protected SocketChannel socketChannel; - public SocketChannel getSocketChannel() - { - return socketChannel; - } - - // REVISIT: - // protected for test: genericRPCMSGFramework.IIOPConnection constructor. - protected CorbaContactInfo contactInfo; - protected Acceptor acceptor; - protected ConnectionCache connectionCache; - - // - // From iiop.Connection.java - // - - protected Socket socket; // The socket used for this connection. - protected long timeStamp = 0; - protected boolean isServer = false; - - // Start at some value other than zero since this is a magic - // value in some protocols. - protected int requestId = 5; - protected CorbaResponseWaitingRoom responseWaitingRoom; - protected int state; - protected java.lang.Object stateEvent = new java.lang.Object(); - protected java.lang.Object writeEvent = new java.lang.Object(); - protected boolean writeLocked; - protected int serverRequestCount = 0; - - // Server request map: used on the server side of Connection - // Maps request ID to IIOPInputStream. - Map serverRequestMap = null; - - // This is a flag associated per connection telling us if the - // initial set of sending contexts were sent to the receiver - // already... - protected boolean postInitialContexts = false; - - // Remote reference to CodeBase server (supplies - // FullValueDescription, among other things) - protected IOR codeBaseServerIOR; - - // CodeBase cache for this connection. This will cache remote operations, - // handle connecting, and ensure we don't do any remote operations until - // necessary. - protected CachedCodeBase cachedCodeBase = new CachedCodeBase(this); - - protected ORBUtilSystemException wrapper ; - - // transport read timeout values - protected ReadTimeouts readTimeouts; - - protected boolean shouldReadGiopHeaderOnly; - - // A message mediator used when shouldReadGiopHeaderOnly is - // true to maintain request message state across execution in a - // SelectorThread and WorkerThread. - protected CorbaMessageMediator partialMessageMediator = null; - - // Used in genericRPCMSGFramework test. - protected SocketOrChannelConnectionImpl(ORB orb) - { - this.orb = orb; - wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_TRANSPORT ) ; - - setWork(this); - responseWaitingRoom = new CorbaResponseWaitingRoomImpl(orb, this); - setReadTimeouts(orb.getORBData().getTransportTCPReadTimeouts()); - } - - // Both client and servers. - protected SocketOrChannelConnectionImpl(ORB orb, - boolean useSelectThreadToWait, - boolean useWorkerThread) - { - this(orb) ; - setUseSelectThreadToWait(useSelectThreadToWait); - setUseWorkerThreadForEvent(useWorkerThread); - } - - // Client constructor. - public SocketOrChannelConnectionImpl(ORB orb, - CorbaContactInfo contactInfo, - boolean useSelectThreadToWait, - boolean useWorkerThread, - String socketType, - String hostname, - int port) - { - this(orb, useSelectThreadToWait, useWorkerThread); - - this.contactInfo = contactInfo; - - try { - socket = orb.getORBData().getSocketFactory() - .createSocket(socketType, - new InetSocketAddress(hostname, port)); - socketChannel = socket.getChannel(); - - if (socketChannel != null) { - boolean isBlocking = !useSelectThreadToWait; - socketChannel.configureBlocking(isBlocking); - } else { - // IMPORTANT: non-channel-backed sockets must use - // dedicated reader threads. - setUseSelectThreadToWait(false); - } - if (orb.transportDebugFlag) { - dprint(".initialize: connection created: " + socket); - } - } catch (Throwable t) { - throw wrapper.connectFailure(t, socketType, hostname, - Integer.toString(port)); - } - state = OPENING; - } - - // Client-side convenience. - public SocketOrChannelConnectionImpl(ORB orb, - CorbaContactInfo contactInfo, - String socketType, - String hostname, - int port) - { - this(orb, contactInfo, - orb.getORBData().connectionSocketUseSelectThreadToWait(), - orb.getORBData().connectionSocketUseWorkerThreadForEvent(), - socketType, hostname, port); - } - - // Server-side constructor. - public SocketOrChannelConnectionImpl(ORB orb, - Acceptor acceptor, - Socket socket, - boolean useSelectThreadToWait, - boolean useWorkerThread) - { - this(orb, useSelectThreadToWait, useWorkerThread); - - this.socket = socket; - socketChannel = socket.getChannel(); - if (socketChannel != null) { - // REVISIT - try { - boolean isBlocking = !useSelectThreadToWait; - socketChannel.configureBlocking(isBlocking); - } catch (IOException e) { - RuntimeException rte = new RuntimeException(); - rte.initCause(e); - throw rte; - } - } - this.acceptor = acceptor; - - serverRequestMap = Collections.synchronizedMap(new HashMap()); - isServer = true; - - state = ESTABLISHED; - } - - // Server-side convenience - public SocketOrChannelConnectionImpl(ORB orb, - Acceptor acceptor, - Socket socket) - { - this(orb, acceptor, socket, - (socket.getChannel() == null - ? false - : orb.getORBData().connectionSocketUseSelectThreadToWait()), - (socket.getChannel() == null - ? false - : orb.getORBData().connectionSocketUseWorkerThreadForEvent())); - } - - //////////////////////////////////////////////////// - // - // framework.transport.Connection - // - - public boolean shouldRegisterReadEvent() - { - return true; - } - - public boolean shouldRegisterServerReadEvent() - { - return true; - } - - public boolean read() - { - try { - if (orb.transportDebugFlag) { - dprint(".read->: " + this); - } - CorbaMessageMediator messageMediator = readBits(); - if (messageMediator != null) { - // Null can happen when client closes stream - // causing purgecalls. - return dispatch(messageMediator); - } - return true; - } finally { - if (orb.transportDebugFlag) { - dprint(".read<-: " + this); - } - } - } - - protected CorbaMessageMediator readBits() - { - try { - - if (orb.transportDebugFlag) { - dprint(".readBits->: " + this); - } - - MessageMediator messageMediator; - // REVISIT - use common factory base class. - if (contactInfo != null) { - messageMediator = - contactInfo.createMessageMediator(orb, this); - } else if (acceptor != null) { - messageMediator = acceptor.createMessageMediator(orb, this); - } else { - throw - new RuntimeException("SocketOrChannelConnectionImpl.readBits"); - } - return (CorbaMessageMediator) messageMediator; - - } catch (ThreadDeath td) { - if (orb.transportDebugFlag) { - dprint(".readBits: " + this + ": ThreadDeath: " + td, td); - } - try { - purgeCalls(wrapper.connectionAbort(td), false, false); - } catch (Throwable t) { - if (orb.transportDebugFlag) { - dprint(".readBits: " + this + ": purgeCalls: Throwable: " + t, t); - } - } - throw td; - } catch (Throwable ex) { - if (orb.transportDebugFlag) { - dprint(".readBits: " + this + ": Throwable: " + ex, ex); - } - - try { - if (ex instanceof INTERNAL) { - sendMessageError(GIOPVersion.DEFAULT_VERSION); - } - } catch (IOException e) { - if (orb.transportDebugFlag) { - dprint(".readBits: " + this + - ": sendMessageError: IOException: " + e, e); - } - } - // REVISIT - make sure reader thread is killed. - Selector selector = orb.getTransportManager().getSelector(0); - if (selector != null) { - selector.unregisterForEvent(this); - } - // Notify anyone waiting. - purgeCalls(wrapper.connectionAbort(ex), true, false); - // REVISIT - //keepRunning = false; - // REVISIT - if this is called after purgeCalls then - // the state of the socket is ABORT so the writeLock - // in close throws an exception. It is ignored but - // causes IBM (screen scraping) tests to fail. - //close(); - } finally { - if (orb.transportDebugFlag) { - dprint(".readBits<-: " + this); - } - } - return null; - } - - protected CorbaMessageMediator finishReadingBits(MessageMediator messageMediator) - { - try { - - if (orb.transportDebugFlag) { - dprint(".finishReadingBits->: " + this); - } - - // REVISIT - use common factory base class. - if (contactInfo != null) { - messageMediator = - contactInfo.finishCreatingMessageMediator(orb, this, messageMediator); - } else if (acceptor != null) { - messageMediator = - acceptor.finishCreatingMessageMediator(orb, this, messageMediator); - } else { - throw - new RuntimeException("SocketOrChannelConnectionImpl.finishReadingBits"); - } - return (CorbaMessageMediator) messageMediator; - - } catch (ThreadDeath td) { - if (orb.transportDebugFlag) { - dprint(".finishReadingBits: " + this + ": ThreadDeath: " + td, td); - } - try { - purgeCalls(wrapper.connectionAbort(td), false, false); - } catch (Throwable t) { - if (orb.transportDebugFlag) { - dprint(".finishReadingBits: " + this + ": purgeCalls: Throwable: " + t, t); - } - } - throw td; - } catch (Throwable ex) { - if (orb.transportDebugFlag) { - dprint(".finishReadingBits: " + this + ": Throwable: " + ex, ex); - } - - try { - if (ex instanceof INTERNAL) { - sendMessageError(GIOPVersion.DEFAULT_VERSION); - } - } catch (IOException e) { - if (orb.transportDebugFlag) { - dprint(".finishReadingBits: " + this + - ": sendMessageError: IOException: " + e, e); - } - } - // REVISIT - make sure reader thread is killed. - orb.getTransportManager().getSelector(0).unregisterForEvent(this); - // Notify anyone waiting. - purgeCalls(wrapper.connectionAbort(ex), true, false); - // REVISIT - //keepRunning = false; - // REVISIT - if this is called after purgeCalls then - // the state of the socket is ABORT so the writeLock - // in close throws an exception. It is ignored but - // causes IBM (screen scraping) tests to fail. - //close(); - } finally { - if (orb.transportDebugFlag) { - dprint(".finishReadingBits<-: " + this); - } - } - return null; - } - - protected boolean dispatch(CorbaMessageMediator messageMediator) - { - try { - if (orb.transportDebugFlag) { - dprint(".dispatch->: " + this); - } - - // - // NOTE: - // - // This call is the transition from the tranport block - // to the protocol block. - // - - boolean result = - messageMediator.getProtocolHandler() - .handleRequest(messageMediator); - - return result; - - } catch (ThreadDeath td) { - if (orb.transportDebugFlag) { - dprint(".dispatch: ThreadDeath", td ); - } - try { - purgeCalls(wrapper.connectionAbort(td), false, false); - } catch (Throwable t) { - if (orb.transportDebugFlag) { - dprint(".dispatch: purgeCalls: Throwable", t); - } - } - throw td; - } catch (Throwable ex) { - if (orb.transportDebugFlag) { - dprint(".dispatch: Throwable", ex ) ; - } - - try { - if (ex instanceof INTERNAL) { - sendMessageError(GIOPVersion.DEFAULT_VERSION); - } - } catch (IOException e) { - if (orb.transportDebugFlag) { - dprint(".dispatch: sendMessageError: IOException", e); - } - } - purgeCalls(wrapper.connectionAbort(ex), false, false); - // REVISIT - //keepRunning = false; - } finally { - if (orb.transportDebugFlag) { - dprint(".dispatch<-: " + this); - } - } - - return true; - } - - public boolean shouldUseDirectByteBuffers() - { - return getSocketChannel() != null; - } - - public ByteBuffer read(int size, int offset, int length, long max_wait_time) - throws IOException - { - if (shouldUseDirectByteBuffers()) { - - ByteBuffer byteBuffer = - orb.getByteBufferPool().getByteBuffer(size); - - if (orb.transportDebugFlag) { - // print address of ByteBuffer gotten from pool - int bbAddress = System.identityHashCode(byteBuffer); - StringBuffer sb = new StringBuffer(80); - sb.append(".read: got ByteBuffer id ("); - sb.append(bbAddress).append(") from ByteBufferPool."); - String msgStr = sb.toString(); - dprint(msgStr); - } - - byteBuffer.position(offset); - byteBuffer.limit(size); - - readFully(byteBuffer, length, max_wait_time); - - return byteBuffer; - } - - byte[] buf = new byte[size]; - readFully(getSocket().getInputStream(), buf, - offset, length, max_wait_time); - ByteBuffer byteBuffer = ByteBuffer.wrap(buf); - byteBuffer.limit(size); - return byteBuffer; - } - - public ByteBuffer read(ByteBuffer byteBuffer, int offset, - int length, long max_wait_time) - throws IOException - { - int size = offset + length; - if (shouldUseDirectByteBuffers()) { - - if (! byteBuffer.isDirect()) { - throw wrapper.unexpectedNonDirectByteBufferWithChannelSocket(); - } - if (size > byteBuffer.capacity()) { - if (orb.transportDebugFlag) { - // print address of ByteBuffer being released - int bbAddress = System.identityHashCode(byteBuffer); - StringBuffer bbsb = new StringBuffer(80); - bbsb.append(".read: releasing ByteBuffer id (") - .append(bbAddress).append(") to ByteBufferPool."); - String bbmsg = bbsb.toString(); - dprint(bbmsg); - } - orb.getByteBufferPool().releaseByteBuffer(byteBuffer); - byteBuffer = orb.getByteBufferPool().getByteBuffer(size); - } - byteBuffer.position(offset); - byteBuffer.limit(size); - readFully(byteBuffer, length, max_wait_time); - byteBuffer.position(0); - byteBuffer.limit(size); - return byteBuffer; - } - if (byteBuffer.isDirect()) { - throw wrapper.unexpectedDirectByteBufferWithNonChannelSocket(); - } - byte[] buf = new byte[size]; - readFully(getSocket().getInputStream(), buf, - offset, length, max_wait_time); - return ByteBuffer.wrap(buf); - } - - public void readFully(ByteBuffer byteBuffer, int size, long max_wait_time) - throws IOException - { - int n = 0; - int bytecount = 0; - long time_to_wait = readTimeouts.get_initial_time_to_wait(); - long total_time_in_wait = 0; - - // The reading of data incorporates a strategy to detect a - // rogue client. The strategy is implemented as follows. As - // long as data is being read, at least 1 byte or more, we - // assume we have a well behaved client. If no data is read, - // then we sleep for a time to wait, re-calculate a new time to - // wait which is lengthier than the previous time spent waiting. - // Then, if the total time spent waiting does not exceed a - // maximum time we are willing to wait, we attempt another - // read. If the maximum amount of time we are willing to - // spend waiting for more data is exceeded, we throw an - // IOException. - - // NOTE: Reading of GIOP headers are treated with a smaller - // maximum time to wait threshold. Based on extensive - // performance testing, all GIOP headers are being - // read in 1 read access. - - do { - bytecount = getSocketChannel().read(byteBuffer); - - if (bytecount < 0) { - throw new IOException("End-of-stream"); - } - else if (bytecount == 0) { - try { - Thread.sleep(time_to_wait); - total_time_in_wait += time_to_wait; - time_to_wait = - (long)(time_to_wait*readTimeouts.get_backoff_factor()); - } - catch (InterruptedException ie) { - // ignore exception - if (orb.transportDebugFlag) { - dprint("readFully(): unexpected exception " - + ie.toString()); - } - } - } - else { - n += bytecount; - } - } - while (n < size && total_time_in_wait < max_wait_time); - - if (n < size && total_time_in_wait >= max_wait_time) - { - // failed to read entire message - throw wrapper.transportReadTimeoutExceeded(new Integer(size), - new Integer(n), new Long(max_wait_time), - new Long(total_time_in_wait)); - } - - getConnectionCache().stampTime(this); - } - - // To support non-channel connections. - public void readFully(java.io.InputStream is, byte[] buf, - int offset, int size, long max_wait_time) - throws IOException - { - int n = 0; - int bytecount = 0; - long time_to_wait = readTimeouts.get_initial_time_to_wait(); - long total_time_in_wait = 0; - - // The reading of data incorporates a strategy to detect a - // rogue client. The strategy is implemented as follows. As - // long as data is being read, at least 1 byte or more, we - // assume we have a well behaved client. If no data is read, - // then we sleep for a time to wait, re-calculate a new time to - // wait which is lengthier than the previous time spent waiting. - // Then, if the total time spent waiting does not exceed a - // maximum time we are willing to wait, we attempt another - // read. If the maximum amount of time we are willing to - // spend waiting for more data is exceeded, we throw an - // IOException. - - // NOTE: Reading of GIOP headers are treated with a smaller - // maximum time to wait threshold. Based on extensive - // performance testing, all GIOP headers are being - // read in 1 read access. - - do { - bytecount = is.read(buf, offset + n, size - n); - if (bytecount < 0) { - throw new IOException("End-of-stream"); - } - else if (bytecount == 0) { - try { - Thread.sleep(time_to_wait); - total_time_in_wait += time_to_wait; - time_to_wait = - (long)(time_to_wait*readTimeouts.get_backoff_factor()); - } - catch (InterruptedException ie) { - // ignore exception - if (orb.transportDebugFlag) { - dprint("readFully(): unexpected exception " - + ie.toString()); - } - } - } - else { - n += bytecount; - } - } - while (n < size && total_time_in_wait < max_wait_time); - - if (n < size && total_time_in_wait >= max_wait_time) - { - // failed to read entire message - throw wrapper.transportReadTimeoutExceeded(new Integer(size), - new Integer(n), new Long(max_wait_time), - new Long(total_time_in_wait)); - } - - getConnectionCache().stampTime(this); - } - - public void write(ByteBuffer byteBuffer) - throws IOException - { - if (shouldUseDirectByteBuffers()) { - /* NOTE: cannot perform this test. If one ask for a - ByteBuffer from the pool which is bigger than the size - of ByteBuffers managed by the pool, then the pool will - return a HeapByteBuffer. - if (byteBuffer.hasArray()) { - throw wrapper.unexpectedNonDirectByteBufferWithChannelSocket(); - } - */ - // IMPORTANT: For non-blocking SocketChannels, there's no guarantee - // all bytes are written on first write attempt. - do { - getSocketChannel().write(byteBuffer); - } - while (byteBuffer.hasRemaining()); - - } else { - if (! byteBuffer.hasArray()) { - throw wrapper.unexpectedDirectByteBufferWithNonChannelSocket(); - } - byte[] tmpBuf = byteBuffer.array(); - getSocket().getOutputStream().write(tmpBuf, 0, byteBuffer.limit()); - getSocket().getOutputStream().flush(); - } - - // TimeStamp connection to indicate it has been used - // Note granularity of connection usage is assumed for - // now to be that of a IIOP packet. - getConnectionCache().stampTime(this); - } - - /** - * Note:it is possible for this to be called more than once - */ - public synchronized void close() - { - try { - if (orb.transportDebugFlag) { - dprint(".close->: " + this); - } - writeLock(); - - // REVISIT It will be good to have a read lock on the reader thread - // before we proceed further, to avoid the reader thread (server side) - // from processing requests. This avoids the risk that a new request - // will be accepted by ReaderThread while the ListenerThread is - // attempting to close this connection. - - if (isBusy()) { // we are busy! - writeUnlock(); - if (orb.transportDebugFlag) { - dprint(".close: isBusy so no close: " + this); - } - return; - } - - try { - try { - sendCloseConnection(GIOPVersion.V1_0); - } catch (Throwable t) { - wrapper.exceptionWhenSendingCloseConnection(t); - } - - synchronized ( stateEvent ){ - state = CLOSE_SENT; - stateEvent.notifyAll(); - } - - // stop the reader without causing it to do purgeCalls - //Exception ex = new Exception(); - //reader.stop(ex); // REVISIT - - // NOTE: !!!!!! - // This does writeUnlock(). - purgeCalls(wrapper.connectionRebind(), false, true); - - } catch (Exception ex) { - if (orb.transportDebugFlag) { - dprint(".close: exception: " + this, ex); - } - } - try { - Selector selector = orb.getTransportManager().getSelector(0); - if (selector != null) { - selector.unregisterForEvent(this); - } - if (socketChannel != null) { - socketChannel.close(); - } - socket.close(); - } catch (IOException e) { - if (orb.transportDebugFlag) { - dprint(".close: " + this, e); - } - } - closeConnectionResources(); - } finally { - if (orb.transportDebugFlag) { - dprint(".close<-: " + this); - } - } - } - - public void closeConnectionResources() { - if (orb.transportDebugFlag) { - dprint(".closeConnectionResources->: " + this); - } - Selector selector = orb.getTransportManager().getSelector(0); - if (selector != null) { - selector.unregisterForEvent(this); - } - try { - if (socketChannel != null) - socketChannel.close() ; - if (socket != null && !socket.isClosed()) - socket.close() ; - } catch (IOException e) { - if (orb.transportDebugFlag) { - dprint( ".closeConnectionResources: " + this, e ) ; - } - } - if (orb.transportDebugFlag) { - dprint(".closeConnectionResources<-: " + this); - } - } - - - public Acceptor getAcceptor() - { - return acceptor; - } - - public ContactInfo getContactInfo() - { - return contactInfo; - } - - public EventHandler getEventHandler() - { - return this; - } - - public OutputObject createOutputObject(MessageMediator messageMediator) - { - // REVISIT - remove this method from Connection and all it subclasses. - throw new RuntimeException("*****SocketOrChannelConnectionImpl.createOutputObject - should not be called."); - } - - // This is used by the GIOPOutputObject in order to - // throw the correct error when handling code sets. - // Can we determine if we are on the server side by - // other means? XREVISIT - public boolean isServer() - { - return isServer; - } - - public boolean isBusy() - { - if (serverRequestCount > 0 || - getResponseWaitingRoom().numberRegistered() > 0) - { - return true; - } else { - return false; - } - } - - public long getTimeStamp() - { - return timeStamp; - } - - public void setTimeStamp(long time) - { - timeStamp = time; - } - - public void setState(String stateString) - { - synchronized (stateEvent) { - if (stateString.equals("ESTABLISHED")) { - state = ESTABLISHED; - stateEvent.notifyAll(); - } else { - // REVISIT: ASSERT - } - } - } - - /** - * Sets the writeLock for this connection. - * If the writeLock is already set by someone else, block till the - * writeLock is released and can set by us. - * IMPORTANT: this connection's lock must be acquired before - * setting the writeLock and must be unlocked after setting the writeLock. - */ - public void writeLock() - { - try { - if (dprintWriteLocks && orb.transportDebugFlag) { - dprint(".writeLock->: " + this); - } - // Keep looping till we can set the writeLock. - while ( true ) { - int localState = state; - switch ( localState ) { - - case OPENING: - synchronized (stateEvent) { - if (state != OPENING) { - // somebody has changed 'state' so be careful - break; - } - try { - stateEvent.wait(); - } catch (InterruptedException ie) { - if (orb.transportDebugFlag) { - dprint(".writeLock: OPENING InterruptedException: " + this); - } - } - } - // Loop back - break; - - case ESTABLISHED: - synchronized (writeEvent) { - if (!writeLocked) { - writeLocked = true; - return; - } - - try { - // do not stay here too long if state != ESTABLISHED - // Bug 4752117 - while (state == ESTABLISHED && writeLocked) { - writeEvent.wait(100); - } - } catch (InterruptedException ie) { - if (orb.transportDebugFlag) { - dprint(".writeLock: ESTABLISHED InterruptedException: " + this); - } - } - } - // Loop back - break; - - // - // XXX - // Need to distinguish between client and server roles - // here probably. - // - case ABORT: - synchronized ( stateEvent ){ - if (state != ABORT) { - break; - } - throw wrapper.writeErrorSend() ; - } - - case CLOSE_RECVD: - // the connection has been closed or closing - // ==> throw rebind exception - synchronized ( stateEvent ){ - if (state != CLOSE_RECVD) { - break; - } - throw wrapper.connectionCloseRebind() ; - } - - default: - if (orb.transportDebugFlag) { - dprint(".writeLock: default: " + this); - } - // REVISIT - throw new RuntimeException(".writeLock: bad state"); - } - } - } finally { - if (dprintWriteLocks && orb.transportDebugFlag) { - dprint(".writeLock<-: " + this); - } - } - } - - public void writeUnlock() - { - try { - if (dprintWriteLocks && orb.transportDebugFlag) { - dprint(".writeUnlock->: " + this); - } - synchronized (writeEvent) { - writeLocked = false; - writeEvent.notify(); // wake up one guy waiting to write - } - } finally { - if (dprintWriteLocks && orb.transportDebugFlag) { - dprint(".writeUnlock<-: " + this); - } - } - } - - // Assumes the caller handles writeLock and writeUnlock - public void sendWithoutLock(OutputObject outputObject) - { - // Don't we need to check for CloseConnection - // here? REVISIT - - // XREVISIT - Shouldn't the MessageMediator - // be the one to handle writing the data here? - - try { - - // Write the fragment/message - - CDROutputObject cdrOutputObject = (CDROutputObject) outputObject; - cdrOutputObject.writeTo(this); - // REVISIT - no flush? - //socket.getOutputStream().flush(); - - } catch (IOException e1) { - - /* - * ADDED(Ram J) 10/13/2000 In the event of an IOException, try - * sending a CancelRequest for regular requests / locate requests - */ - - // Since IIOPOutputStream's msgheader is set only once, and not - // altered during sending multiple fragments, the original - // msgheader will always have the requestId. - // REVISIT This could be optimized to send a CancelRequest only - // if any fragments had been sent already. - - /* REVISIT: MOVE TO SUBCONTRACT - Message msg = os.getMessage(); - if (msg.getType() == Message.GIOPRequest || - msg.getType() == Message.GIOPLocateRequest) { - GIOPVersion requestVersion = msg.getGIOPVersion(); - int requestId = MessageBase.getRequestId(msg); - try { - sendCancelRequest(requestVersion, requestId); - } catch (IOException e2) { - // most likely an abortive connection closure. - // ignore, since nothing more can be done. - if (orb.transportDebugFlag) { - - } - } - */ - - // REVISIT When a send failure happens, purgeCalls() need to be - // called to ensure that the connection is properly removed from - // further usage (ie., cancelling pending requests with COMM_FAILURE - // with an appropriate minor_code CompletionStatus.MAY_BE). - - // Relying on the IIOPOutputStream (as noted below) is not - // sufficient as it handles COMM_FAILURE only for the final - // fragment (during invoke processing). Note that COMM_FAILURE could - // happen while sending the initial fragments. - // Also the IIOPOutputStream does not properly close the connection. - // It simply removes the connection from the table. An orderly - // closure is needed (ie., cancel pending requests on the connection - // COMM_FAILURE as well. - - // IIOPOutputStream will cleanup the connection info when it - // sees this exception. - SystemException exc = wrapper.writeErrorSend(e1); - purgeCalls(exc, false, true); - throw exc; - } - } - - public void registerWaiter(MessageMediator messageMediator) - { - responseWaitingRoom.registerWaiter(messageMediator); - } - - public void unregisterWaiter(MessageMediator messageMediator) - { - responseWaitingRoom.unregisterWaiter(messageMediator); - } - - public InputObject waitForResponse(MessageMediator messageMediator) - { - return responseWaitingRoom.waitForResponse(messageMediator); - } - - public void setConnectionCache(ConnectionCache connectionCache) - { - this.connectionCache = connectionCache; - } - - public ConnectionCache getConnectionCache() - { - return connectionCache; - } - - //////////////////////////////////////////////////// - // - // EventHandler methods - // - - public void setUseSelectThreadToWait(boolean x) - { - useSelectThreadToWait = x; - // REVISIT - Reading of a GIOP header only is information - // that should be passed into the constructor - // from the SocketOrChannelConnection factory. - setReadGiopHeaderOnly(shouldUseSelectThreadToWait()); - } - - public void handleEvent() - { - if (orb.transportDebugFlag) { - dprint(".handleEvent->: " + this); - } - getSelectionKey().interestOps(getSelectionKey().interestOps() & - (~ getInterestOps())); - - if (shouldUseWorkerThreadForEvent()) { - Throwable throwable = null; - try { - int poolToUse = 0; - if (shouldReadGiopHeaderOnly()) { - partialMessageMediator = readBits(); - poolToUse = - partialMessageMediator.getThreadPoolToUse(); - } - - if (orb.transportDebugFlag) { - dprint(".handleEvent: addWork to pool: " + poolToUse); - } - orb.getThreadPoolManager().getThreadPool(poolToUse) - .getWorkQueue(0).addWork(getWork()); - } catch (NoSuchThreadPoolException e) { - throwable = e; - } catch (NoSuchWorkQueueException e) { - throwable = e; - } - // REVISIT: need to close connection. - if (throwable != null) { - if (orb.transportDebugFlag) { - dprint(".handleEvent: " + throwable); - } - INTERNAL i = new INTERNAL("NoSuchThreadPoolException"); - i.initCause(throwable); - throw i; - } - } else { - if (orb.transportDebugFlag) { - dprint(".handleEvent: doWork"); - } - getWork().doWork(); - } - if (orb.transportDebugFlag) { - dprint(".handleEvent<-: " + this); - } - } - - public SelectableChannel getChannel() - { - return socketChannel; - } - - public int getInterestOps() - { - return SelectionKey.OP_READ; - } - - // public Acceptor getAcceptor() - already defined above. - - public Connection getConnection() - { - return this; - } - - //////////////////////////////////////////////////// - // - // Work methods. - // - - public String getName() - { - return this.toString(); - } - - public void doWork() - { - try { - if (orb.transportDebugFlag) { - dprint(".doWork->: " + this); - } - - // IMPORTANT: Sanity checks on SelectionKeys such as - // SelectorKey.isValid() should not be done - // here. - // - - if (!shouldReadGiopHeaderOnly()) { - read(); - } - else { - // get the partialMessageMediator - // created by SelectorThread - CorbaMessageMediator messageMediator = - this.getPartialMessageMediator(); - - // read remaining info needed in a MessageMediator - messageMediator = finishReadingBits(messageMediator); - - if (messageMediator != null) { - // Null can happen when client closes stream - // causing purgecalls. - dispatch(messageMediator); - } - } - } catch (Throwable t) { - if (orb.transportDebugFlag) { - dprint(".doWork: ignoring Throwable: " - + t - + " " + this); - } - } finally { - if (orb.transportDebugFlag) { - dprint(".doWork<-: " + this); - } - } - } - - public void setEnqueueTime(long timeInMillis) - { - enqueueTime = timeInMillis; - } - - public long getEnqueueTime() - { - return enqueueTime; - } - - //////////////////////////////////////////////////// - // - // spi.transport.CorbaConnection. - // - - // IMPORTANT: Reader Threads must NOT read Giop header only. - public boolean shouldReadGiopHeaderOnly() { - return shouldReadGiopHeaderOnly; - } - - protected void setReadGiopHeaderOnly(boolean shouldReadHeaderOnly) { - shouldReadGiopHeaderOnly = shouldReadHeaderOnly; - } - - public ResponseWaitingRoom getResponseWaitingRoom() - { - return responseWaitingRoom; - } - - // REVISIT - inteface defines isServer but already defined in - // higher interface. - - public void serverRequestMapPut(int requestId, - CorbaMessageMediator messageMediator) - { - serverRequestMap.put(new Integer(requestId), messageMediator); - } - - public CorbaMessageMediator serverRequestMapGet(int requestId) - { - return (CorbaMessageMediator) - serverRequestMap.get(new Integer(requestId)); - } - - public void serverRequestMapRemove(int requestId) - { - serverRequestMap.remove(new Integer(requestId)); - } - - - // REVISIT: this is also defined in: - // com.sun.corba.se.spi.legacy.connection.Connection - public java.net.Socket getSocket() - { - return socket; - } - - /** It is possible for a Close Connection to have been - ** sent here, but we will not check for this. A "lazy" - ** Exception will be thrown in the Worker thread after the - ** incoming request has been processed even though the connection - ** is closed before the request is processed. This is o.k because - ** it is a boundary condition. To prevent it we would have to add - ** more locks which would reduce performance in the normal case. - **/ - public synchronized void serverRequestProcessingBegins() - { - serverRequestCount++; - } - - public synchronized void serverRequestProcessingEnds() - { - serverRequestCount--; - } - - // - // - // - - public synchronized int getNextRequestId() - { - return requestId++; - } - - // Negotiated code sets for char and wchar data - protected CodeSetComponentInfo.CodeSetContext codeSetContext = null; - - public ORB getBroker() - { - return orb; - } - - public CodeSetComponentInfo.CodeSetContext getCodeSetContext() { - // Needs to be synchronized for the following case when the client - // doesn't send the code set context twice, and we have two threads - // in ServerRequestDispatcher processCodeSetContext. - // - // Thread A checks to see if there is a context, there is none, so - // it calls setCodeSetContext, getting the synch lock. - // Thread B checks to see if there is a context. If we didn't synch, - // it might decide to outlaw wchar/wstring. - if (codeSetContext == null) { - synchronized(this) { - return codeSetContext; - } - } - - return codeSetContext; - } - - public synchronized void setCodeSetContext(CodeSetComponentInfo.CodeSetContext csc) { - // Double check whether or not we need to do this - if (codeSetContext == null) { - - if (OSFCodeSetRegistry.lookupEntry(csc.getCharCodeSet()) == null || - OSFCodeSetRegistry.lookupEntry(csc.getWCharCodeSet()) == null) { - // If the client says it's negotiated a code set that - // isn't a fallback and we never said we support, then - // it has a bug. - throw wrapper.badCodesetsFromClient() ; - } - - codeSetContext = csc; - } - } - - // - // from iiop.IIOPConnection.java - // - - // Map request ID to an InputObject. - // This is so the client thread can start unmarshaling - // the reply and remove it from the out_calls map while the - // ReaderThread can still obtain the input stream to give - // new fragments. Only the ReaderThread touches the clientReplyMap, - // so it doesn't incur synchronization overhead. - - public MessageMediator clientRequestMapGet(int requestId) - { - return responseWaitingRoom.getMessageMediator(requestId); - } - - protected MessageMediator clientReply_1_1; - - public void clientReply_1_1_Put(MessageMediator x) - { - clientReply_1_1 = x; - } - - public MessageMediator clientReply_1_1_Get() - { - return clientReply_1_1; - } - - public void clientReply_1_1_Remove() - { - clientReply_1_1 = null; - } - - protected MessageMediator serverRequest_1_1; - - public void serverRequest_1_1_Put(MessageMediator x) - { - serverRequest_1_1 = x; - } - - public MessageMediator serverRequest_1_1_Get() - { - return serverRequest_1_1; - } - - public void serverRequest_1_1_Remove() - { - serverRequest_1_1 = null; - } - - protected String getStateString( int state ) - { - synchronized ( stateEvent ){ - switch (state) { - case OPENING : return "OPENING" ; - case ESTABLISHED : return "ESTABLISHED" ; - case CLOSE_SENT : return "CLOSE_SENT" ; - case CLOSE_RECVD : return "CLOSE_RECVD" ; - case ABORT : return "ABORT" ; - default : return "???" ; - } - } - } - - public synchronized boolean isPostInitialContexts() { - return postInitialContexts; - } - - // Can never be unset... - public synchronized void setPostInitialContexts(){ - postInitialContexts = true; - } - - /** - * Wake up the outstanding requests on the connection, and hand them - * COMM_FAILURE exception with a given minor code. - * - * Also, delete connection from connection table and - * stop the reader thread. - - * Note that this should only ever be called by the Reader thread for - * this connection. - * - * @param minor_code The minor code for the COMM_FAILURE major code. - * @param die Kill the reader thread (this thread) before exiting. - */ - public void purgeCalls(SystemException systemException, - boolean die, boolean lockHeld) - { - int minor_code = systemException.minor; - - try{ - if (orb.transportDebugFlag) { - dprint(".purgeCalls->: " - + minor_code + "/" + die + "/" + lockHeld - + " " + this); - } - - // If this invocation is a result of ThreadDeath caused - // by a previous execution of this routine, just exit. - - synchronized ( stateEvent ){ - if ((state == ABORT) || (state == CLOSE_RECVD)) { - if (orb.transportDebugFlag) { - dprint(".purgeCalls: exiting since state is: " - + getStateString(state) - + " " + this); - } - return; - } - } - - // Grab the writeLock (freeze the calls) - try { - if (!lockHeld) { - writeLock(); - } - } catch (SystemException ex) { - if (orb.transportDebugFlag) - dprint(".purgeCalls: SystemException" + ex - + "; continuing " + this); - } - - // Mark the state of the connection - // and determine the request status - org.omg.CORBA.CompletionStatus completion_status; - synchronized ( stateEvent ){ - if (minor_code == ORBUtilSystemException.CONNECTION_REBIND) { - state = CLOSE_RECVD; - systemException.completed = CompletionStatus.COMPLETED_NO; - } else { - state = ABORT; - systemException.completed = CompletionStatus.COMPLETED_MAYBE; - } - stateEvent.notifyAll(); - } - - try { - socket.getInputStream().close(); - socket.getOutputStream().close(); - socket.close(); - } catch (Exception ex) { - if (orb.transportDebugFlag) { - dprint(".purgeCalls: Exception closing socket: " + ex - + " " + this); - } - } - - // Signal all threads with outstanding requests on this - // connection and give them the SystemException; - - responseWaitingRoom.signalExceptionToAllWaiters(systemException); - } finally { - if (contactInfo != null) { - ((OutboundConnectionCache)getConnectionCache()).remove(contactInfo); - } else if (acceptor != null) { - ((InboundConnectionCache)getConnectionCache()).remove(this); - } - - // - // REVISIT: Stop the reader thread - // - - // Signal all the waiters of the writeLock. - // There are 4 types of writeLock waiters: - // 1. Send waiters: - // 2. SendReply waiters: - // 3. cleanUp waiters: - // 4. purge_call waiters: - // - - writeUnlock(); - - if (orb.transportDebugFlag) { - dprint(".purgeCalls<-: " - + minor_code + "/" + die + "/" + lockHeld - + " " + this); - } - } - } - - /************************************************************************* - * The following methods are for dealing with Connection cleaning for - * better scalability of servers in high network load conditions. - **************************************************************************/ - - public void sendCloseConnection(GIOPVersion giopVersion) - throws IOException - { - Message msg = MessageBase.createCloseConnection(giopVersion); - sendHelper(giopVersion, msg); - } - - public void sendMessageError(GIOPVersion giopVersion) - throws IOException - { - Message msg = MessageBase.createMessageError(giopVersion); - sendHelper(giopVersion, msg); - } - - /** - * Send a CancelRequest message. This does not lock the connection, so the - * caller needs to ensure this method is called appropriately. - * @exception IOException - could be due to abortive connection closure. - */ - public void sendCancelRequest(GIOPVersion giopVersion, int requestId) - throws IOException - { - - Message msg = MessageBase.createCancelRequest(giopVersion, requestId); - sendHelper(giopVersion, msg); - } - - protected void sendHelper(GIOPVersion giopVersion, Message msg) - throws IOException - { - // REVISIT: See comments in CDROutputObject constructor. - CDROutputObject outputObject = - sun.corba.OutputStreamFactory.newCDROutputObject((ORB)orb, null, giopVersion, - this, msg, ORBConstants.STREAM_FORMAT_VERSION_1); - msg.write(outputObject); - - outputObject.writeTo(this); - } - - public void sendCancelRequestWithLock(GIOPVersion giopVersion, - int requestId) - throws IOException - { - writeLock(); - try { - sendCancelRequest(giopVersion, requestId); - } finally { - writeUnlock(); - } - } - - // Begin Code Base methods --------------------------------------- - // - // Set this connection's code base IOR. The IOR comes from the - // SendingContext. This is an optional service context, but all - // JavaSoft ORBs send it. - // - // The set and get methods don't need to be synchronized since the - // first possible get would occur during reading a valuetype, and - // that would be after the set. - - // Sets this connection's code base IOR. This is done after - // getting the IOR out of the SendingContext service context. - // Our ORBs always send this, but it's optional in CORBA. - - public final void setCodeBaseIOR(IOR ior) { - codeBaseServerIOR = ior; - } - - public final IOR getCodeBaseIOR() { - return codeBaseServerIOR; - } - - // Get a CodeBase stub to use in unmarshaling. The CachedCodeBase - // won't connect to the remote codebase unless it's necessary. - public final CodeBase getCodeBase() { - return cachedCodeBase; - } - - // End Code Base methods ----------------------------------------- - - // set transport read thresholds - protected void setReadTimeouts(ReadTimeouts readTimeouts) { - this.readTimeouts = readTimeouts; - } - - protected void setPartialMessageMediator(CorbaMessageMediator messageMediator) { - partialMessageMediator = messageMediator; - } - - protected CorbaMessageMediator getPartialMessageMediator() { - return partialMessageMediator; - } - - public String toString() - { - synchronized ( stateEvent ){ - return - "SocketOrChannelConnectionImpl[" + " " - + (socketChannel == null ? - socket.toString() : socketChannel.toString()) + " " - + getStateString( state ) + " " - + shouldUseSelectThreadToWait() + " " - + shouldUseWorkerThreadForEvent() + " " - + shouldReadGiopHeaderOnly() - + "]" ; - } - } - - // Must be public - used in encoding. - public void dprint(String msg) - { - ORBUtility.dprint("SocketOrChannelConnectionImpl", msg); - } - - protected void dprint(String msg, Throwable t) - { - dprint(msg); - t.printStackTrace(System.out); - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelContactInfoImpl.java b/src/java.corba/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelContactInfoImpl.java deleted file mode 100644 index 3970c329310..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelContactInfoImpl.java +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.transport; - -import com.sun.corba.se.pept.transport.Connection; - -import com.sun.corba.se.spi.ior.IOR ; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.transport.CorbaContactInfoList; -import com.sun.corba.se.spi.transport.CorbaTransportManager; -import com.sun.corba.se.spi.transport.SocketInfo; - -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.transport.CorbaContactInfoBase; - -/** - * @author Harold Carr - */ -public class SocketOrChannelContactInfoImpl - extends CorbaContactInfoBase - implements SocketInfo -{ - protected boolean isHashCodeCached = false; - protected int cachedHashCode; - - protected String socketType; - protected String hostname; - protected int port; - - // XREVISIT - // See SocketOrChannelAcceptorImpl.createMessageMediator - // See SocketFactoryContactInfoImpl.constructor() - // See SocketOrChannelContactInfoImpl.constructor() - protected SocketOrChannelContactInfoImpl() - { - } - - protected SocketOrChannelContactInfoImpl( - ORB orb, - CorbaContactInfoList contactInfoList) - { - this.orb = orb; - this.contactInfoList = contactInfoList; - } - - public SocketOrChannelContactInfoImpl( - ORB orb, - CorbaContactInfoList contactInfoList, - String socketType, - String hostname, - int port) - { - this(orb, contactInfoList); - this.socketType = socketType; - this.hostname = hostname; - this.port = port; - } - - // XREVISIT - public SocketOrChannelContactInfoImpl( - ORB orb, - CorbaContactInfoList contactInfoList, - IOR effectiveTargetIOR, - short addressingDisposition, - String socketType, - String hostname, - int port) - { - this(orb, contactInfoList, socketType, hostname, port); - this.effectiveTargetIOR = effectiveTargetIOR; - this.addressingDisposition = addressingDisposition; - } - - //////////////////////////////////////////////////// - // - // pept.transport.ContactInfo - // - - public boolean isConnectionBased() - { - return true; - } - - public boolean shouldCacheConnection() - { - return true; - } - - public String getConnectionCacheType() - { - return CorbaTransportManager.SOCKET_OR_CHANNEL_CONNECTION_CACHE; - } - - public Connection createConnection() - { - Connection connection = - new SocketOrChannelConnectionImpl(orb, this, - socketType, hostname, port); - return connection; - } - - //////////////////////////////////////////////////// - // - // spi.transport.CorbaContactInfo - // - - public String getMonitoringName() - { - return "SocketConnections"; - } - - //////////////////////////////////////////////////// - // - // pept.transport.ContactInfo - // - - public String getType() - { - return socketType; - } - - public String getHost() - { - return hostname; - } - - public int getPort() - { - return port; - } - - //////////////////////////////////////////////////// - // - // java.lang.Object - // - - public int hashCode() - { - if (! isHashCodeCached) { - cachedHashCode = socketType.hashCode() ^ hostname.hashCode() ^ port; - isHashCodeCached = true; - } - return cachedHashCode; - } - - public boolean equals(Object obj) - { - if (obj == null) { - return false; - } else if (!(obj instanceof SocketOrChannelContactInfoImpl)) { - return false; - } - - SocketOrChannelContactInfoImpl other = - (SocketOrChannelContactInfoImpl) obj; - - if (port != other.port) { - return false; - } - if (!hostname.equals(other.hostname)) { - return false; - } - if (socketType == null) { - if (other.socketType != null) { - return false; - } - } else if (!socketType.equals(other.socketType)) { - return false; - } - return true; - } - - public String toString() - { - return - "SocketOrChannelContactInfoImpl[" - + socketType + " " - + hostname + " " - + port - + "]"; - } - - //////////////////////////////////////////////////// - // - // Implementation - // - - protected void dprint(String msg) - { - ORBUtility.dprint("SocketOrChannelContactInfoImpl", msg); - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/util/IdentityHashtable.java b/src/java.corba/share/classes/com/sun/corba/se/impl/util/IdentityHashtable.java deleted file mode 100644 index c4ff3971fa4..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/util/IdentityHashtable.java +++ /dev/null @@ -1,373 +0,0 @@ -/* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.util; - -import java.util.Dictionary; -import java.util.Enumeration; -import java.util.NoSuchElementException; - -/** - * IdentityHashtable is a modified copy of the 1.1.6 Hashtable class which - * does not rely on the hashCode() and equals() methods of the key or value; - * instead, it uses the System.identityHashcode() method and pointer comparison. - * In addition, all synchronization has been removed. - */ -public final class IdentityHashtable extends Dictionary { - /** - * The hash table data. - */ - private transient IdentityHashtableEntry table[]; - - /** - * The total number of entries in the hash table. - */ - private transient int count; - - /** - * Rehashes the table when count exceeds this threshold. - */ - private int threshold; - - /** - * The load factor for the hashtable. - */ - private float loadFactor; - - /** - * Constructs a new, empty hashtable with the specified initial - * capacity and the specified load factor. - * - * @param initialCapacity the initial capacity of the hashtable. - * @param loadFactor a number between 0.0 and 1.0. - * @exception IllegalArgumentException if the initial capacity is less - * than or equal to zero, or if the load factor is less than - * or equal to zero. - * @since JDK1.0 - */ - public IdentityHashtable(int initialCapacity, float loadFactor) { - if ((initialCapacity <= 0) || (loadFactor <= 0.0)) { - throw new IllegalArgumentException(); - } - this.loadFactor = loadFactor; - table = new IdentityHashtableEntry[initialCapacity]; - threshold = (int)(initialCapacity * loadFactor); - } - - /** - * Constructs a new, empty hashtable with the specified initial capacity - * and default load factor. - * - * @param initialCapacity the initial capacity of the hashtable. - * @since JDK1.0 - */ - public IdentityHashtable(int initialCapacity) { - this(initialCapacity, 0.75f); - } - - /** - * Constructs a new, empty hashtable with a default capacity and load - * factor. - * - * @since JDK1.0 - */ - public IdentityHashtable() { - this(101, 0.75f); - } - - /** - * Returns the number of keys in this hashtable. - * - * @return the number of keys in this hashtable. - * @since JDK1.0 - */ - public int size() { - return count; - } - - /** - * Tests if this hashtable maps no keys to values. - * - * @return true if this hashtable maps no keys to values; - * false otherwise. - * @since JDK1.0 - */ - public boolean isEmpty() { - return count == 0; - } - - /** - * Returns an enumeration of the keys in this hashtable. - * - * @return an enumeration of the keys in this hashtable. - * @see java.util.Enumeration - * @see java.util.Hashtable#elements() - * @since JDK1.0 - */ - public Enumeration keys() { - return new IdentityHashtableEnumerator(table, true); - } - - /** - * Returns an enumeration of the values in this hashtable. - * Use the Enumeration methods on the returned object to fetch the elements - * sequentially. - * - * @return an enumeration of the values in this hashtable. - * @see java.util.Enumeration - * @see java.util.Hashtable#keys() - * @since JDK1.0 - */ - public Enumeration elements() { - return new IdentityHashtableEnumerator(table, false); - } - - /** - * Tests if some key maps into the specified value in this hashtable. - * This operation is more expensive than the containsKey - * method. - * - * @param value a value to search for. - * @return true if some key maps to the - * value argument in this hashtable; - * false otherwise. - * @exception NullPointerException if the value is null. - * @see java.util.Hashtable#containsKey(java.lang.Object) - * @since JDK1.0 - */ - public boolean contains(Object value) { - if (value == null) { - throw new NullPointerException(); - } - - IdentityHashtableEntry tab[] = table; - for (int i = tab.length ; i-- > 0 ;) { - for (IdentityHashtableEntry e = tab[i] ; e != null ; e = e.next) { - if (e.value == value) { - return true; - } - } - } - return false; - } - - /** - * Tests if the specified object is a key in this hashtable. - * - * @param key possible key. - * @return true if the specified object is a key in this - * hashtable; false otherwise. - * @see java.util.Hashtable#contains(java.lang.Object) - * @since JDK1.0 - */ - public boolean containsKey(Object key) { - IdentityHashtableEntry tab[] = table; - int hash = System.identityHashCode(key); - int index = (hash & 0x7FFFFFFF) % tab.length; - for (IdentityHashtableEntry e = tab[index] ; e != null ; e = e.next) { - if ((e.hash == hash) && e.key == key) { - return true; - } - } - return false; - } - - /** - * Returns the value to which the specified key is mapped in this hashtable. - * - * @param key a key in the hashtable. - * @return the value to which the key is mapped in this hashtable; - * null if the key is not mapped to any value in - * this hashtable. - * @see java.util.Hashtable#put(java.lang.Object, java.lang.Object) - * @since JDK1.0 - */ - public Object get(Object key) { - IdentityHashtableEntry tab[] = table; - int hash = System.identityHashCode(key); - int index = (hash & 0x7FFFFFFF) % tab.length; - for (IdentityHashtableEntry e = tab[index] ; e != null ; e = e.next) { - if ((e.hash == hash) && e.key == key) { - return e.value; - } - } - return null; - } - - /** - * Rehashes the contents of the hashtable into a hashtable with a - * larger capacity. This method is called automatically when the - * number of keys in the hashtable exceeds this hashtable's capacity - * and load factor. - * - * @since JDK1.0 - */ - protected void rehash() { - int oldCapacity = table.length; - IdentityHashtableEntry oldTable[] = table; - - int newCapacity = oldCapacity * 2 + 1; - IdentityHashtableEntry newTable[] = new IdentityHashtableEntry[newCapacity]; - - threshold = (int)(newCapacity * loadFactor); - table = newTable; - - //System.out.println("rehash old=" + oldCapacity + ", new=" + newCapacity + ", thresh=" + threshold + ", count=" + count); - - for (int i = oldCapacity ; i-- > 0 ;) { - for (IdentityHashtableEntry old = oldTable[i] ; old != null ; ) { - IdentityHashtableEntry e = old; - old = old.next; - - int index = (e.hash & 0x7FFFFFFF) % newCapacity; - e.next = newTable[index]; - newTable[index] = e; - } - } - } - - /** - * Maps the specified key to the specified - * value in this hashtable. Neither the key nor the - * value can be null. - *

            - * The value can be retrieved by calling the get method - * with a key that is equal to the original key. - * - * @param key the hashtable key. - * @param value the value. - * @return the previous value of the specified key in this hashtable, - * or null if it did not have one. - * @exception NullPointerException if the key or value is - * null. - * @see java.util.Hashtable#get(java.lang.Object) - * @since JDK1.0 - */ - public Object put(Object key, Object value) { - // Make sure the value is not null - if (value == null) { - throw new NullPointerException(); - } - - // Makes sure the key is not already in the hashtable. - IdentityHashtableEntry tab[] = table; - int hash = System.identityHashCode(key); - int index = (hash & 0x7FFFFFFF) % tab.length; - for (IdentityHashtableEntry e = tab[index] ; e != null ; e = e.next) { - if ((e.hash == hash) && e.key == key) { - Object old = e.value; - e.value = value; - return old; - } - } - - if (count >= threshold) { - // Rehash the table if the threshold is exceeded - rehash(); - return put(key, value); - } - - // Creates the new entry. - IdentityHashtableEntry e = new IdentityHashtableEntry(); - e.hash = hash; - e.key = key; - e.value = value; - e.next = tab[index]; - tab[index] = e; - count++; - return null; - } - - /** - * Removes the key (and its corresponding value) from this - * hashtable. This method does nothing if the key is not in the hashtable. - * - * @param key the key that needs to be removed. - * @return the value to which the key had been mapped in this hashtable, - * or null if the key did not have a mapping. - * @since JDK1.0 - */ - public Object remove(Object key) { - IdentityHashtableEntry tab[] = table; - int hash = System.identityHashCode(key); - int index = (hash & 0x7FFFFFFF) % tab.length; - for (IdentityHashtableEntry e = tab[index], prev = null ; e != null ; prev = e, e = e.next) { - if ((e.hash == hash) && e.key == key) { - if (prev != null) { - prev.next = e.next; - } else { - tab[index] = e.next; - } - count--; - return e.value; - } - } - return null; - } - - /** - * Clears this hashtable so that it contains no keys. - * - * @since JDK1.0 - */ - public void clear() { - IdentityHashtableEntry tab[] = table; - for (int index = tab.length; --index >= 0; ) - tab[index] = null; - count = 0; - } - - /** - * Returns a rather long string representation of this hashtable. - * - * @return a string representation of this hashtable. - * @since JDK1.0 - */ - public String toString() { - int max = size() - 1; - StringBuffer buf = new StringBuffer(); - Enumeration k = keys(); - Enumeration e = elements(); - buf.append("{"); - - for (int i = 0; i <= max; i++) { - String s1 = k.nextElement().toString(); - String s2 = e.nextElement().toString(); - buf.append(s1 + "=" + s2); - if (i < max) { - buf.append(", "); - } - } - buf.append("}"); - return buf.toString(); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/util/IdentityHashtableEntry.java b/src/java.corba/share/classes/com/sun/corba/se/impl/util/IdentityHashtableEntry.java deleted file mode 100644 index cb4198de96e..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/util/IdentityHashtableEntry.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.util; - -/** - * IdentityHashtable collision list. - */ -class IdentityHashtableEntry { - int hash; - Object key; - Object value; - IdentityHashtableEntry next; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/util/IdentityHashtableEnumerator.java b/src/java.corba/share/classes/com/sun/corba/se/impl/util/IdentityHashtableEnumerator.java deleted file mode 100644 index 7b5c9879276..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/util/IdentityHashtableEnumerator.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.util; - -import java.util.Dictionary; -import java.util.Enumeration; -import java.util.NoSuchElementException; - -/** - * A hashtable enumerator class. This class should remain opaque - * to the client. It will use the Enumeration interface. - */ -class IdentityHashtableEnumerator implements Enumeration { - boolean keys; - int index; - IdentityHashtableEntry table[]; - IdentityHashtableEntry entry; - - IdentityHashtableEnumerator(IdentityHashtableEntry table[], boolean keys) { - this.table = table; - this.keys = keys; - this.index = table.length; - } - - public boolean hasMoreElements() { - if (entry != null) { - return true; - } - while (index-- > 0) { - if ((entry = table[index]) != null) { - return true; - } - } - return false; -} - -public Object nextElement() { - if (entry == null) { - while ((index-- > 0) && ((entry = table[index]) == null)); - } - if (entry != null) { - IdentityHashtableEntry e = entry; - entry = e.next; - return keys ? e.key : e.value; - } - throw new NoSuchElementException("IdentityHashtableEnumerator"); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/util/JDKBridge.java b/src/java.corba/share/classes/com/sun/corba/se/impl/util/JDKBridge.java deleted file mode 100644 index 9088f79e4d7..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/util/JDKBridge.java +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Copyright (c) 1995, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.util; - -import java.rmi.Remote; -import java.rmi.NoSuchObjectException; -import java.rmi.server.RMIClassLoader; -import java.rmi.server.UnicastRemoteObject; -import org.omg.CORBA.BAD_PARAM; -import org.omg.CORBA.CompletionStatus; -import java.util.Properties; -import java.io.File; -import java.io.FileInputStream; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.net.MalformedURLException; -import com.sun.corba.se.impl.orbutil.GetPropertyAction; - -/** - * Utility methods for doing various method calls which are used - * by multiple classes - */ -public class JDKBridge { - - /** - * Get local codebase System property (java.rmi.server.codebase). - * May be null or a space separated array of URLS. - */ - public static String getLocalCodebase () { - return localCodebase; - } - - /** - * Return true if the system property "java.rmi.server.useCodebaseOnly" - * is set, false otherwise. - */ - public static boolean useCodebaseOnly () { - return useCodebaseOnly; - } - - /** - * Returns a class instance for the specified class. - * @param className the name of the class - * @param remoteCodebase a space-separated array of urls at which - * the class might be found. May be null. - * @param loader a ClassLoader who may be used to - * load the class if all other methods fail. - * @return the Class object representing the loaded class. - * @exception throws ClassNotFoundException if class cannot be loaded. - */ - public static Class loadClass (String className, - String remoteCodebase, - ClassLoader loader) - throws ClassNotFoundException { - - if (loader == null) { - return loadClassM(className,remoteCodebase,useCodebaseOnly); - } else { - try { - return loadClassM(className,remoteCodebase,useCodebaseOnly); - } catch (ClassNotFoundException e) { - return loader.loadClass(className); - } - } - } - - /** - * Returns a class instance for the specified class. - * @param className the name of the class - * @param remoteCodebase a space-separated array of urls at which - * the class might be found. May be null. - * @return the Class object representing the loaded class. - * @exception throws ClassNotFoundException if class cannot be loaded. - */ - public static Class loadClass (String className, - String remoteCodebase) - throws ClassNotFoundException { - return loadClass(className,remoteCodebase,null); - } - - /** - * Returns a class instance for the specified class. - * @param className the name of the class - * @return the Class object representing the loaded class. - * @exception throws ClassNotFoundException if class cannot be loaded. - */ - public static Class loadClass (String className) - throws ClassNotFoundException { - return loadClass(className,null,null); - } - - private static final String LOCAL_CODEBASE_KEY = "java.rmi.server.codebase"; - private static final String USE_CODEBASE_ONLY_KEY = "java.rmi.server.useCodebaseOnly"; - private static String localCodebase = null; - private static boolean useCodebaseOnly; - - static { - setCodebaseProperties(); - } - - public static final void main (String[] args) { - System.out.println("1.2 VM"); - - /* - // If on 1.2, use a policy with all permissions. - System.setSecurityManager (new javax.rmi.download.SecurityManager()); - String targetClass = "[[Lrmic.Typedef;"; - System.out.println("localCodebase = "+localCodebase); - System.out.println("Trying to load "+targetClass); - try { - Class clz = loadClass(targetClass,null,localCodebase); - System.out.println("Loaded: "+clz); - } catch (ClassNotFoundException e) { - System.out.println("Caught "+e); - } - */ - } - - /** - * Set the codebase and useCodebaseOnly properties. This is public - * only for test code. - */ - public static synchronized void setCodebaseProperties () { - String prop = (String)AccessController.doPrivileged( - new GetPropertyAction(LOCAL_CODEBASE_KEY) - ); - if (prop != null && prop.trim().length() > 0) { - localCodebase = prop; - } - - prop = (String)AccessController.doPrivileged( - new GetPropertyAction(USE_CODEBASE_ONLY_KEY) - ); - if (prop != null && prop.trim().length() > 0) { - useCodebaseOnly = Boolean.valueOf(prop).booleanValue(); - } - } - - /** - * Set the default code base. This method is here only - * for test code. - */ - public static synchronized void setLocalCodebase(String codebase) { - localCodebase = codebase; - } - - private static Class loadClassM (String className, - String remoteCodebase, - boolean useCodebaseOnly) - throws ClassNotFoundException { - - try { - return JDKClassLoader.loadClass(null,className); - } catch (ClassNotFoundException e) {} - try { - if (!useCodebaseOnly && remoteCodebase != null) { - return RMIClassLoader.loadClass(remoteCodebase, - className); - } else { - return RMIClassLoader.loadClass(className); - } - } catch (MalformedURLException e) { - className = className + ": " + e.toString(); - } - - throw new ClassNotFoundException(className); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/util/JDKClassLoader.java b/src/java.corba/share/classes/com/sun/corba/se/impl/util/JDKClassLoader.java deleted file mode 100644 index 2ba7896a4b2..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/util/JDKClassLoader.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.util; - -import sun.corba.Bridge ; - -import java.util.Map ; -import java.util.WeakHashMap ; -import java.util.Collections ; - -import java.security.AccessController ; -import java.security.PrivilegedAction ; - -/** - * Utility method for crawling call stack to load class - */ -class JDKClassLoader { - - private static final JDKClassLoaderCache classCache - = new JDKClassLoaderCache(); - - private static final Bridge bridge = - (Bridge)AccessController.doPrivileged( - new PrivilegedAction() { - public Object run() { - return Bridge.get() ; - } - } - ) ; - - static Class loadClass(Class aClass, String className) - throws ClassNotFoundException { - - // Maintain the same error semantics as Class.forName() - if (className == null) { - throw new NullPointerException(); - } - if (className.length() == 0) { - throw new ClassNotFoundException(); - } - - // It would be nice to bypass JDKClassLoader's attempts completely - // if it's known that the latest user defined ClassLoader will - // fail. - // - // Otherwise, we end up calling Class.forName here as well as in - // the next step in JDKBridge. That can take a long time depending - // on the length of the classpath. - - // Note: Looking at the only place in JDKBridge where this code - // is invoked, it is clear that aClass will always be null. - ClassLoader loader; - if (aClass != null) { - loader = aClass.getClassLoader(); - } else { - loader = bridge.getLatestUserDefinedLoader(); - } - // See createKey for a description of what's involved - Object key = classCache.createKey(className, loader); - - if (classCache.knownToFail(key)) { - throw new ClassNotFoundException(className); - } else { - try { - // Loading this class with the call stack - // loader isn't known to fail, so try - // to load it. - return Class.forName(className, false, loader); - } catch(ClassNotFoundException cnfe) { - // Record that we failed to find the class - // with this particular loader. This way, we won't - // waste time looking with this loader, again. - classCache.recordFailure(key); - throw cnfe; - } - } - } - - /** - * Private cache implementation specific to JDKClassLoader. - */ - private static class JDKClassLoaderCache - { - // JDKClassLoader couldn't find the class with the located - // ClassLoader. Note this in our cache so JDKClassLoader - // can abort early next time. - public final void recordFailure(Object key) { - cache.put(key, JDKClassLoaderCache.KNOWN_TO_FAIL); - } - - // Factory for a key (CacheKey is an implementation detail - // of JDKClassLoaderCache). - // - // A key currently consists of the class name as well as - // the latest user defined class loader, so it's fairly - // expensive to create. - public final Object createKey(String className, ClassLoader latestLoader) { - return new CacheKey(className, latestLoader); - } - - // Determine whether or not this combination of class name - // and ClassLoader is known to fail. - public final boolean knownToFail(Object key) { - return cache.get(key) == JDKClassLoaderCache.KNOWN_TO_FAIL; - } - - // Synchronized WeakHashMap - private final Map cache - = Collections.synchronizedMap(new WeakHashMap()); - - // Cache result used to mark the caches when there is - // no way JDKClassLoader could succeed with the given - // key - private static final Object KNOWN_TO_FAIL = new Object(); - - // Key consisting of the class name and the latest - // user defined class loader - private static class CacheKey - { - String className; - ClassLoader loader; - - public CacheKey(String className, ClassLoader loader) { - this.className = className; - this.loader = loader; - } - - // Try to incorporate both class name and loader - // into the hashcode - public int hashCode() { - if (loader == null) - return className.hashCode(); - else - return className.hashCode() ^ loader.hashCode(); - } - - public boolean equals(Object obj) { - try { - - // WeakHashMap may compare null keys - if (obj == null) - return false; - - CacheKey other = (CacheKey)obj; - - // I've made a decision to actually compare the - // loader references. I don't want a case when - // two loader instances override their equals - // methods and only compare code base. - // - // This way, at worst, our performance will - // be slower, but we know we'll do the correct - // loading. - return (className.equals(other.className) && - loader == other.loader); - - } catch (ClassCastException cce) { - return false; - } - } - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/util/ORBProperties.java b/src/java.corba/share/classes/com/sun/corba/se/impl/util/ORBProperties.java deleted file mode 100644 index dd74851d1b7..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/util/ORBProperties.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.util; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.PrintWriter; - -public class ORBProperties { - - public static final String ORB_CLASS = - "org.omg.CORBA.ORBClass=com.sun.corba.se.impl.orb.ORBImpl"; - public static final String ORB_SINGLETON_CLASS = - "org.omg.CORBA.ORBSingletonClass=com.sun.corba.se.impl.orb.ORBSingleton"; - - public static void main (String[] args) { - - try { - // Check if orb.properties exists - String javaHome = System.getProperty("java.home"); - File propFile = new File(javaHome + File.separator - + "lib" + File.separator - + "orb.properties"); - - if (propFile.exists()) - return; - - // Write properties to orb.properties - FileOutputStream out = new FileOutputStream(propFile); - PrintWriter pw = new PrintWriter(out); - - try { - pw.println(ORB_CLASS); - pw.println(ORB_SINGLETON_CLASS); - } finally { - pw.close(); - out.close(); - } - - } catch (Exception ex) { } - - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/util/PackagePrefixChecker.java b/src/java.corba/share/classes/com/sun/corba/se/impl/util/PackagePrefixChecker.java deleted file mode 100644 index 7c7873108cf..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/util/PackagePrefixChecker.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.impl.util; - -import java.io.File; - -/** - * PackagePrefixChecker provides static utility methods for getting package prefixes. - * @author M. Mortazavi - */ - -public final class PackagePrefixChecker { - - - private static final String PACKAGE_PREFIX = "org.omg.stub."; - - public static String packagePrefix(){ return PACKAGE_PREFIX;} - - public static String correctPackageName (String p){ - if (p==null) return p; - if ( hasOffendingPrefix(p)) - { - return PACKAGE_PREFIX+p; - } - return p; - } - - public static boolean isOffendingPackage(String p){ - return - !(p==null) - && - ( false || hasOffendingPrefix(p) ); - } - - public static boolean hasOffendingPrefix(String p){ - return - ( p.startsWith("java.") || p.equals("java") - // || p.startsWith("com.sun.") || p.equals("com.sun") - || p.startsWith("net.jini.") || p.equals("net.jini") - || p.startsWith("jini.") || p.equals("jini") - || p.startsWith("javax.") || p.equals("javax") - ); - } - - public static boolean hasBeenPrefixed(String p){ - return p.startsWith(packagePrefix()); - } - - public static String withoutPackagePrefix(String p){ - if(hasBeenPrefixed(p)) return p.substring(packagePrefix().length()); - else return p; - } - -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/util/RepositoryId.java b/src/java.corba/share/classes/com/sun/corba/se/impl/util/RepositoryId.java deleted file mode 100644 index 6bedab382ea..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/util/RepositoryId.java +++ /dev/null @@ -1,993 +0,0 @@ -/* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.util; - -import java.util.StringTokenizer; -import java.util.Hashtable; -import java.io.IOException; -import java.lang.reflect.Method; - -// Imports for using codebase URL to load class -import java.net.MalformedURLException; -import org.omg.CORBA.portable.ValueBase; -import org.omg.CORBA.portable.IDLEntity; - -//d11638 files in the same package, therefore remove their reference -//import com.sun.corba.se.impl.util.JDKBridge; -//import com.sun.corba.se.impl.util.IdentityHashtable; -import com.sun.corba.se.impl.io.ObjectStreamClass; - -import javax.rmi.CORBA.Util; - -public class RepositoryId { - - // Legal IDL Identifier characters (1 = legal). Note - // that '.' (2E) is marked as legal even though it is - // not legal in IDL. This allows us to treat a fully - // qualified Java name with '.' package separators - // uniformly, and is safe because that is the only - // legal use of '.' in a Java name. - - private static final byte[] IDL_IDENTIFIER_CHARS = { - - // 0 1 2 3 4 5 6 7 8 9 a b c d e f - 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // 00-0f - 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // 10-1f - 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,1,0, // 20-2f - 1,1,1,1, 1,1,1,1, 1,1,0,0, 0,0,0,0, // 30-3f - 0,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1, // 40-4f - 1,1,1,1, 1,1,1,1, 1,1,1,0, 0,0,0,1, // 50-5f - 0,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1, // 60-6f - 1,1,1,1, 1,1,1,1, 1,1,1,0, 0,0,0,0, // 70-7f - 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // 80-8f - 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // 90-9f - 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // a0-af - 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // b0-bf - 1,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1, // c0-cf - 0,1,1,1, 1,1,1,0, 1,1,1,1, 1,0,0,1, // d0-df - 1,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1, // e0-ef - 0,1,1,1, 1,1,1,0, 1,1,1,1, 1,0,0,1, // f0-ff - }; - - - private static final long serialVersionUID = 123456789L; - - private static String defaultServerURL = null; - private static boolean useCodebaseOnly = false; - - static { - if (defaultServerURL == null) - defaultServerURL = (String)JDKBridge.getLocalCodebase(); - useCodebaseOnly = JDKBridge.useCodebaseOnly(); - - } - - private static IdentityHashtable classToRepStr = new IdentityHashtable(); - private static IdentityHashtable classIDLToRepStr = new IdentityHashtable(); - private static IdentityHashtable classSeqToRepStr = new IdentityHashtable(); - - private static final IdentityHashtable repStrToByteArray = new IdentityHashtable(); - private static Hashtable repStrToClass = new Hashtable(); - - private String repId = null; - private boolean isSupportedFormat = true; - private String typeString = null; - private String versionString = null; - private boolean isSequence = false; - private boolean isRMIValueType = false; - private boolean isIDLType = false; - private String completeClassName = null; - private String unqualifiedName = null; - private String definedInId = null; - private Class clazz = null; - private String suid = null, actualSuid = null; - private long suidLong = ObjectStreamClass.kDefaultUID, actualSuidLong = ObjectStreamClass.kDefaultUID; - - // Repository ID fragments - private static final String kSequenceKeyword = "seq"; - private static final String kValuePrefix = "RMI:"; - private static final String kIDLPrefix = "IDL:"; - private static final String kIDLNamePrefix = "omg.org/"; - private static final String kIDLClassnamePrefix = "org.omg."; - private static final String kSequencePrefix = "["; - private static final String kCORBAPrefix = "CORBA/"; - private static final String kArrayPrefix = kValuePrefix + kSequencePrefix + kCORBAPrefix; - private static final int kValuePrefixLength = kValuePrefix.length(); - private static final int kIDLPrefixLength = kIDLPrefix.length(); - private static final int kSequencePrefixLength = kSequencePrefix.length(); - private static final String kInterfaceHashCode = ":0000000000000000"; - private static final String kInterfaceOnlyHashStr = "0000000000000000"; - private static final String kExternalizableHashStr = "0000000000000001"; - - // Value tag utility methods and constants - public static final int kInitialValueTag= 0x7fffff00; - public static final int kNoTypeInfo = 0; - public static final int kSingleRepTypeInfo = 0x02; - public static final int kPartialListTypeInfo = 0x06; - public static final int kChunkedMask = 0x08; - public static final int kPreComputed_StandardRMIUnchunked = RepositoryId.computeValueTag(false, RepositoryId.kSingleRepTypeInfo, false); - public static final int kPreComputed_CodeBaseRMIUnchunked = RepositoryId.computeValueTag(true, RepositoryId.kSingleRepTypeInfo, false); - public static final int kPreComputed_StandardRMIChunked = RepositoryId.computeValueTag(false, RepositoryId.kSingleRepTypeInfo, true); - public static final int kPreComputed_CodeBaseRMIChunked = RepositoryId.computeValueTag(true, RepositoryId.kSingleRepTypeInfo, true); - - public static final int kPreComputed_StandardRMIUnchunked_NoRep = RepositoryId.computeValueTag(false, RepositoryId.kNoTypeInfo, false); - public static final int kPreComputed_CodeBaseRMIUnchunked_NoRep = RepositoryId.computeValueTag(true, RepositoryId.kNoTypeInfo, false); - public static final int kPreComputed_StandardRMIChunked_NoRep = RepositoryId.computeValueTag(false, RepositoryId.kNoTypeInfo, true); - public static final int kPreComputed_CodeBaseRMIChunked_NoRep = RepositoryId.computeValueTag(true, RepositoryId.kNoTypeInfo, true); - - // Public, well known repository IDs - - // _REVISIT_ : A table structure with a good search routine for all of this - // would be more efficient and easier to maintain... - - // String - public static final String kWStringValueVersion = "1.0"; - public static final String kWStringValueHash = ":"+kWStringValueVersion; - public static final String kWStringStubValue = "WStringValue"; - public static final String kWStringTypeStr = "omg.org/CORBA/"+kWStringStubValue; - public static final String kWStringValueRepID = kIDLPrefix + kWStringTypeStr + kWStringValueHash; - - // Any - public static final String kAnyRepID = kIDLPrefix + "omg.org/CORBA/Any"; - - // Class - // Anita4: convert to uppercase - public static final String kClassDescValueHash = ":" + - Long.toHexString( - ObjectStreamClass.getActualSerialVersionUID(javax.rmi.CORBA.ClassDesc.class)).toUpperCase() + ":" + - Long.toHexString( - ObjectStreamClass.getSerialVersionUID(javax.rmi.CORBA.ClassDesc.class)).toUpperCase(); - public static final String kClassDescStubValue = "ClassDesc"; - public static final String kClassDescTypeStr = "javax.rmi.CORBA."+kClassDescStubValue; - public static final String kClassDescValueRepID = kValuePrefix + kClassDescTypeStr + kClassDescValueHash; - - // Object - public static final String kObjectValueHash = ":1.0"; - public static final String kObjectStubValue = "Object"; - - // Sequence - public static final String kSequenceValueHash = ":1.0"; - public static final String kPrimitiveSequenceValueHash = ":0000000000000000"; - - // Serializable - public static final String kSerializableValueHash = ":1.0"; - public static final String kSerializableStubValue = "Serializable"; - - // Externalizable - public static final String kExternalizableValueHash = ":1.0"; - public static final String kExternalizableStubValue = "Externalizable"; - - // Remote (The empty string is used for java.rmi.Remote) - public static final String kRemoteValueHash = ""; - public static final String kRemoteStubValue = ""; - public static final String kRemoteTypeStr = ""; - public static final String kRemoteValueRepID = ""; - - private static final Hashtable kSpecialArrayTypeStrings = new Hashtable(); - - static { - kSpecialArrayTypeStrings.put("CORBA.WStringValue", new StringBuffer(java.lang.String.class.getName())); - kSpecialArrayTypeStrings.put("javax.rmi.CORBA.ClassDesc", new StringBuffer(java.lang.Class.class.getName())); - kSpecialArrayTypeStrings.put("CORBA.Object", new StringBuffer(java.rmi.Remote.class.getName())); - - } - - private static final Hashtable kSpecialCasesRepIDs = new Hashtable(); - - static { - kSpecialCasesRepIDs.put(java.lang.String.class, kWStringValueRepID); - kSpecialCasesRepIDs.put(java.lang.Class.class, kClassDescValueRepID); - kSpecialCasesRepIDs.put(java.rmi.Remote.class, kRemoteValueRepID); - } - - private static final Hashtable kSpecialCasesStubValues = new Hashtable(); - - static { - kSpecialCasesStubValues.put(java.lang.String.class, kWStringStubValue); - kSpecialCasesStubValues.put(java.lang.Class.class, kClassDescStubValue); - kSpecialCasesStubValues.put(java.lang.Object.class, kObjectStubValue); - kSpecialCasesStubValues.put(java.io.Serializable.class, kSerializableStubValue); - kSpecialCasesStubValues.put(java.io.Externalizable.class, kExternalizableStubValue); - kSpecialCasesStubValues.put(java.rmi.Remote.class, kRemoteStubValue); - } - - - private static final Hashtable kSpecialCasesVersions = new Hashtable(); - - static { - kSpecialCasesVersions.put(java.lang.String.class, kWStringValueHash); - kSpecialCasesVersions.put(java.lang.Class.class, kClassDescValueHash); - kSpecialCasesVersions.put(java.lang.Object.class, kObjectValueHash); - kSpecialCasesVersions.put(java.io.Serializable.class, kSerializableValueHash); - kSpecialCasesVersions.put(java.io.Externalizable.class, kExternalizableValueHash); - kSpecialCasesVersions.put(java.rmi.Remote.class, kRemoteValueHash); - } - - private static final Hashtable kSpecialCasesClasses = new Hashtable(); - - static { - kSpecialCasesClasses.put(kWStringTypeStr, java.lang.String.class); - kSpecialCasesClasses.put(kClassDescTypeStr, java.lang.Class.class); - kSpecialCasesClasses.put(kRemoteTypeStr, java.rmi.Remote.class); - - kSpecialCasesClasses.put("org.omg.CORBA.WStringValue", java.lang.String.class); - kSpecialCasesClasses.put("javax.rmi.CORBA.ClassDesc", java.lang.Class.class); - //kSpecialCasesClasses.put(kRemoteTypeStr, java.rmi.Remote.class); - } - - private static final Hashtable kSpecialCasesArrayPrefix = new Hashtable(); - - static { - kSpecialCasesArrayPrefix.put(java.lang.String.class, kValuePrefix + kSequencePrefix + kCORBAPrefix); - kSpecialCasesArrayPrefix.put(java.lang.Class.class, kValuePrefix + kSequencePrefix + "javax/rmi/CORBA/"); - kSpecialCasesArrayPrefix.put(java.lang.Object.class, kValuePrefix + kSequencePrefix + "java/lang/"); - kSpecialCasesArrayPrefix.put(java.io.Serializable.class, kValuePrefix + kSequencePrefix + "java/io/"); - kSpecialCasesArrayPrefix.put(java.io.Externalizable.class, kValuePrefix + kSequencePrefix + "java/io/"); - kSpecialCasesArrayPrefix.put(java.rmi.Remote.class, kValuePrefix + kSequencePrefix + kCORBAPrefix); - } - - private static final Hashtable kSpecialPrimitives = new Hashtable(); - - static { - kSpecialPrimitives.put("int","long"); - kSpecialPrimitives.put("long","longlong"); - kSpecialPrimitives.put("byte","octet"); - } - - /** - * Used to convert ascii to hex. - */ - private static final byte ASCII_HEX[] = { - (byte)'0', - (byte)'1', - (byte)'2', - (byte)'3', - (byte)'4', - (byte)'5', - (byte)'6', - (byte)'7', - (byte)'8', - (byte)'9', - (byte)'A', - (byte)'B', - (byte)'C', - (byte)'D', - (byte)'E', - (byte)'F', - }; - - - // bug fix for 4328952; to eliminate possibility of overriding this - // in a subclass. - public static final RepositoryIdCache cache = new RepositoryIdCache(); - - // Interface Rep ID Strings - public static final String kjava_rmi_Remote = createForAnyType(java.rmi.Remote.class); - public static final String korg_omg_CORBA_Object = createForAnyType(org.omg.CORBA.Object.class); - - // Dummy arguments for getIdFromHelper method - public static final Class kNoParamTypes[] ={}; - public static final Object kNoArgs[] = {}; - - - // To create a RepositoryID, use code similar to the following: - // RepositoryId.cache.getId( id ); - - RepositoryId(){} - - RepositoryId(String aRepId){ - init(aRepId); - } - - RepositoryId init(String aRepId) - { - this.repId = aRepId; - - // Special case for remote - if (aRepId.length() == 0) { - clazz = java.rmi.Remote.class; - typeString = ""; - isRMIValueType = true; - suid = kInterfaceOnlyHashStr; - return this; - } else if (aRepId.equals(kWStringValueRepID)) { - clazz = java.lang.String.class; - typeString = kWStringTypeStr; - isIDLType = true; - // fix where Attempting to obtain a FullValueDescription - // for an RMI value type with a String field causes an exception. - completeClassName = "java.lang.String"; - versionString = kWStringValueVersion; - return this; - } else { - String repId = convertFromISOLatin1(aRepId); - - int firstIndex = repId.indexOf(':') ; - if (firstIndex == -1) - throw new IllegalArgumentException( "RepsitoryId must have the form :" ) ; - int secondIndex = repId.indexOf( ':', firstIndex + 1 ) ; - - if (secondIndex == -1) - versionString = "" ; - else - versionString = repId.substring(secondIndex) ; - - if (repId.startsWith(kIDLPrefix)) { - typeString = - repId.substring(kIDLPrefixLength, repId.indexOf(':', kIDLPrefixLength)); - isIDLType = true; - - if (typeString.startsWith(kIDLNamePrefix)) - completeClassName = kIDLClassnamePrefix + - typeString.substring(kIDLNamePrefix.length()).replace('/','.'); - else - completeClassName = typeString.replace('/','.'); - - } else if (repId.startsWith(kValuePrefix)) { - typeString = - repId.substring(kValuePrefixLength, repId.indexOf(':', kValuePrefixLength)); - isRMIValueType = true; - - if (versionString.indexOf('.') == -1) { - actualSuid = versionString.substring(1); - suid = actualSuid; // default if not explicitly specified - - if (actualSuid.indexOf(':') != -1){ - // we have a declared hash also - int pos = actualSuid.indexOf(':')+1; - // actualSuid = suid.substring(pos); - // suid = suid.substring(0, pos-1); - suid = actualSuid.substring(pos); - actualSuid = actualSuid.substring(0, pos-1); - } - } else { - // _REVISIT_ : Special case version failure ? - } - } else { - isSupportedFormat = false; - typeString = "" ; - } - - if (typeString.startsWith(kSequencePrefix)) { - isSequence = true; - } - - return this; - } - } - - public final String getUnqualifiedName() { - if (unqualifiedName == null){ - String className = getClassName(); - int index = className.lastIndexOf('.'); - if (index == -1){ - unqualifiedName = className; - definedInId = "IDL::1.0"; - } - else { - unqualifiedName = className.substring(index); - definedInId = "IDL:" + className.substring(0, index).replace('.','/') + ":1.0"; - } - } - - return unqualifiedName; - } - - public final String getDefinedInId() { - if (definedInId == null){ - getUnqualifiedName(); - } - - return definedInId; - } - - public final String getTypeString() { - return typeString; - } - - public final String getVersionString() { - return versionString; - } - - public final String getSerialVersionUID() { - return suid; - } - - public final String getActualSerialVersionUID() { - return actualSuid; - } - public final long getSerialVersionUIDAsLong() { - return suidLong; - } - - public final long getActualSerialVersionUIDAsLong() { - return actualSuidLong; - } - - public final boolean isRMIValueType() { - return isRMIValueType; - } - - public final boolean isIDLType() { - return isIDLType; - } - - public final String getRepositoryId() { - return repId; - } - - public static byte[] getByteArray(String repStr) { - synchronized (repStrToByteArray){ - return (byte[]) repStrToByteArray.get(repStr); - } - } - - public static void setByteArray(String repStr, byte[] repStrBytes) { - synchronized (repStrToByteArray){ - repStrToByteArray.put(repStr, repStrBytes); - } - } - - public final boolean isSequence() { - return isSequence; - } - - public final boolean isSupportedFormat() { - return isSupportedFormat; - } - - - // This method will return the classname from the typestring OR if the classname turns out to be - // a special class "pseudo" name, then the matching real classname is returned. - public final String getClassName() { - - if (isRMIValueType) - return typeString; - else if (isIDLType) - return completeClassName; - else return null; - - } - - // This method calls getClazzFromType() and falls back to the repStrToClass - // cache if no class was found. It's used where any class matching the - // given repid is an acceptable result. - public final Class getAnyClassFromType() throws ClassNotFoundException { - try { - return getClassFromType(); - } catch (ClassNotFoundException cnfe) { - Class clz = (Class)repStrToClass.get(repId); - if (clz != null) - return clz; - else - throw cnfe; - } - } - - public final Class getClassFromType() - throws ClassNotFoundException { - if (clazz != null) - return clazz; - - Class specialCase = (Class)kSpecialCasesClasses.get(getClassName()); - - if (specialCase != null){ - clazz = specialCase; - return specialCase; - } - else - { - try{ - return Util.loadClass(getClassName(), null, null); - } - catch(ClassNotFoundException cnfe){ - if (defaultServerURL != null) { - try{ - return getClassFromType(defaultServerURL); - } - catch(MalformedURLException mue){ - throw cnfe; - } - } - else throw cnfe; - } - } - - } - - public final Class getClassFromType(Class expectedType, String codebase) - throws ClassNotFoundException { - if (clazz != null) - return clazz; - - Class specialCase = (Class)kSpecialCasesClasses.get(getClassName()); - - if (specialCase != null){ - clazz = specialCase; - return specialCase; - } else { - ClassLoader expectedTypeClassLoader = (expectedType == null ? null : expectedType.getClassLoader()); - return Utility.loadClassOfType(getClassName(), - codebase, - expectedTypeClassLoader, - expectedType, - expectedTypeClassLoader); - } - - } - - public final Class getClassFromType(String url) - throws ClassNotFoundException, MalformedURLException { - return Util.loadClass(getClassName(), url, null); - } - - public final String toString() { - return repId; - } - - /** - * Checks to see if the FullValueDescription should be retrieved. - * @exception Throws IOException if suids do not match or if the repositoryID - * is not an RMIValueType - */ - public static boolean useFullValueDescription(Class clazz, String repositoryID) - throws IOException{ - - String clazzRepIDStr = createForAnyType(clazz); - - if (clazzRepIDStr.equals(repositoryID)) - return false; - - RepositoryId targetRepid; - RepositoryId clazzRepid; - - synchronized(cache) { - // to avoid race condition where multiple threads could be - // accessing this method, and their access to the cache may - // be interleaved giving unexpected results - - targetRepid = cache.getId(repositoryID); - clazzRepid = cache.getId(clazzRepIDStr); - } - //ObjectStreamClass osc = ObjectStreamClass.lookup(clazz); - - if ((targetRepid.isRMIValueType()) && (clazzRepid.isRMIValueType())){ - if (!targetRepid.getSerialVersionUID().equals(clazzRepid.getSerialVersionUID())) { - - String mssg = "Mismatched serialization UIDs : Source (Rep. ID" + - clazzRepid + ") = " + - clazzRepid.getSerialVersionUID() + " whereas Target (Rep. ID " + repositoryID + - ") = " + targetRepid.getSerialVersionUID(); - //com.sun.corba.se.impl.io.ValueUtility.log("RepositoryId",mssg); - throw new IOException(mssg); - } - else { - return true; - } - } - else { - - throw new IOException("The repository ID is not of an RMI value type (Expected ID = " + clazzRepIDStr + "; Received ID = " + repositoryID +")"); - } - } - - private static String createHashString(java.io.Serializable ser) { - - return createHashString(ser.getClass()); - } - - private static String createHashString(java.lang.Class clazz) { - - if (clazz.isInterface() || !java.io.Serializable.class.isAssignableFrom(clazz)) - return kInterfaceHashCode; - - //ObjectStreamClass osc = ObjectStreamClass.lookup(clazz); - - long actualLong = ObjectStreamClass.getActualSerialVersionUID(clazz); - String hash = null; - if (actualLong == 0) - hash = kInterfaceOnlyHashStr; - else if (actualLong == 1) - hash = kExternalizableHashStr; - else - hash = Long.toHexString(actualLong).toUpperCase(); - while(hash.length() < 16){ - hash = "0" + hash; - } - - long declaredLong = ObjectStreamClass.getSerialVersionUID(clazz); - String declared = null; - if (declaredLong == 0) - declared = kInterfaceOnlyHashStr; - else if (declaredLong == 1) - declared = kExternalizableHashStr; - else - declared = Long.toHexString(declaredLong).toUpperCase(); - while (declared.length() < 16){ - declared = "0" + declared; - } - hash = hash + ":" + declared; - - return ":" + hash; - } - - /** - * Creates a repository ID for a sequence. This is for expert users only as - * this method assumes the object passed is an array. If passed an object - * that is not an array, it will produce a rep id for a sequence of zero - * length. This would be an error. - * @param ser The Java object to create a repository ID for - **/ - public static String createSequenceRepID(java.lang.Object ser){ - return createSequenceRepID(ser.getClass()); - } - - /** - * Creates a repository ID for a sequence. This is for expert users only as - * this method assumes the object passed is an array. If passed an object - * that is not an array, it will produce a malformed rep id. - * @param clazz The Java class to create a repository ID for - **/ - public static String createSequenceRepID(java.lang.Class clazz){ - synchronized (classSeqToRepStr){ - - String repid = (String)classSeqToRepStr.get(clazz); - if (repid != null) - return repid; - - Class originalClazz = clazz; - - Class type = null; - int numOfDims = 0; - - while ((type = clazz.getComponentType()) != null) { - numOfDims++; - clazz = type; - } - - if (clazz.isPrimitive()) - repid = kValuePrefix + originalClazz.getName() + kPrimitiveSequenceValueHash; - else { - StringBuffer buf = new StringBuffer(); - buf.append(kValuePrefix); - while(numOfDims-- > 0) { - buf.append("["); - } - buf.append("L"); - buf.append(convertToISOLatin1(clazz.getName())); - buf.append(";"); - buf.append(createHashString(clazz)); - repid = buf.toString(); - } - classSeqToRepStr.put(originalClazz,repid); - return repid; - } - - } - - - public static String createForSpecialCase(java.lang.Class clazz){ - if (clazz.isArray()){ - return createSequenceRepID(clazz); - } - else { - return (String)kSpecialCasesRepIDs.get(clazz); - } - } - - public static String createForSpecialCase(java.io.Serializable ser){ - Class clazz = ser.getClass(); - if (clazz.isArray()){ - return createSequenceRepID(ser); - } - else - return createForSpecialCase(clazz); - } - - /** - * Creates a repository ID for a normal Java Type. - * @param ser The Java object to create a repository ID for - * @exception com.sun.corba.se.impl.io.TypeMismatchException if ser implements the - * org.omg.CORBA.portable.IDLEntity interface which indicates it is an IDL Value type. - **/ - public static String createForJavaType(java.io.Serializable ser) - throws com.sun.corba.se.impl.io.TypeMismatchException - { - synchronized (classToRepStr) { - String repid = createForSpecialCase(ser); - if (repid != null) - return repid; - Class clazz = ser.getClass(); - repid = (String)classToRepStr.get(clazz); - - if (repid != null) - return repid; - - repid = kValuePrefix + convertToISOLatin1(clazz.getName()) + - createHashString(clazz); - - classToRepStr.put(clazz, repid); - repStrToClass.put(repid, clazz); - return repid; - } - } - - /** - * Creates a repository ID for a normal Java Type. - * @param clz The Java class to create a repository ID for - * @exception com.sun.corba.se.impl.io.TypeMismatchException if ser implements the - * org.omg.CORBA.portable.IDLEntity interface which indicates it is an IDL Value type. - **/ - public static String createForJavaType(Class clz) - throws com.sun.corba.se.impl.io.TypeMismatchException - { - synchronized (classToRepStr){ - String repid = createForSpecialCase(clz); - if (repid != null) - return repid; - - repid = (String)classToRepStr.get(clz); - if (repid != null) - return repid; - - repid = kValuePrefix + convertToISOLatin1(clz.getName()) + - createHashString(clz); - - classToRepStr.put(clz, repid); - repStrToClass.put(repid, clz); - return repid; - } - } - - /** - * Creates a repository ID for an IDL Java Type. - * @param ser The IDL Value object to create a repository ID for - * @param major The major version number - * @param minor The minor version number - * @exception com.sun.corba.se.impl.io.TypeMismatchException if ser does not implement the - * org.omg.CORBA.portable.IDLEntity interface which indicates it is an IDL Value type. - **/ - public static String createForIDLType(Class ser, int major, int minor) - throws com.sun.corba.se.impl.io.TypeMismatchException - { - synchronized (classIDLToRepStr){ - String repid = (String)classIDLToRepStr.get(ser); - if (repid != null) - return repid; - - repid = kIDLPrefix + convertToISOLatin1(ser.getName()).replace('.','/') + - ":" + major + "." + minor; - classIDLToRepStr.put(ser, repid); - return repid; - } - } - - private static String getIdFromHelper(Class clazz){ - try { - Class helperClazz = Utility.loadClassForClass(clazz.getName()+"Helper", null, - clazz.getClassLoader(), clazz, clazz.getClassLoader()); - Method idMethod = helperClazz.getDeclaredMethod("id", kNoParamTypes); - return (String)idMethod.invoke(null, kNoArgs); - } - catch(java.lang.ClassNotFoundException cnfe) - { - throw new org.omg.CORBA.MARSHAL(cnfe.toString()); - } - catch(java.lang.NoSuchMethodException nsme) - { - throw new org.omg.CORBA.MARSHAL(nsme.toString()); - } - catch(java.lang.reflect.InvocationTargetException ite) - { - throw new org.omg.CORBA.MARSHAL(ite.toString()); - } - catch(java.lang.IllegalAccessException iae) - { - throw new org.omg.CORBA.MARSHAL(iae.toString()); - } - } - - /** - * Createa a repository ID for the type if it is either a java type - * or an IDL type. - * @param type The type to create rep. id for - * @return The rep. id. - **/ - public static String createForAnyType(Class type) { - try{ - if (type.isArray()) - return createSequenceRepID(type); - else if (IDLEntity.class.isAssignableFrom(type)) - { - try{ - return getIdFromHelper(type); - } - catch(Throwable t) { - return createForIDLType(type, 1, 0); - } - } - else return createForJavaType(type); - } - catch(com.sun.corba.se.impl.io.TypeMismatchException e){ - return null; - } - - } - - public static boolean isAbstractBase(Class clazz) { - return (clazz.isInterface() && - IDLEntity.class.isAssignableFrom(clazz) && - (!ValueBase.class.isAssignableFrom(clazz)) && - (!org.omg.CORBA.Object.class.isAssignableFrom(clazz))); - - } - - public static boolean isAnyRequired(Class clazz) { - return ((clazz == java.lang.Object.class) || - (clazz == java.io.Serializable.class) || - (clazz == java.io.Externalizable.class)); - } - - public static long fromHex(String hexNumber) { - if (hexNumber.startsWith("0x")) - return Long.valueOf(hexNumber.substring(2), 16).longValue(); - else return Long.valueOf(hexNumber, 16).longValue(); - } - - /** - * Convert strings with illegal IDL identifier characters. - *

            - * Section 5.5.7 of OBV spec. - */ - public static String convertToISOLatin1 (String name) { - - int length = name.length(); - if (length == 0) { - return name; - } - StringBuffer buffer = null; - - for (int i = 0; i < length; i++) { - - char c = name.charAt(i); - - if (c > 255 || IDL_IDENTIFIER_CHARS[c] == 0) { - - // We gotta convert. Have we already started? - - if (buffer == null) { - - // No, so get set up... - - buffer = new StringBuffer(name.substring(0,i)); - } - - // Convert the character into the IDL escape syntax... - buffer.append( - "\\U" + - (char)ASCII_HEX[(c & 0xF000) >>> 12] + - (char)ASCII_HEX[(c & 0x0F00) >>> 8] + - (char)ASCII_HEX[(c & 0x00F0) >>> 4] + - (char)ASCII_HEX[(c & 0x000F)]); - - } else { - if (buffer != null) { - buffer.append(c); - } - } - } - - if (buffer != null) { - name = buffer.toString(); - } - - return name; - } - - /** - * Convert strings with ISO Latin 1 escape sequences back to original strings. - *

            - * Section 5.5.7 of OBV spec. - */ - private static String convertFromISOLatin1 (String name) { - - int index = -1; - StringBuffer buf = new StringBuffer(name); - - while ((index = buf.toString().indexOf("\\U")) != -1){ - String str = "0000" + buf.toString().substring(index+2, index+6); - - // Convert Hexadecimal - byte[] buffer = new byte[(str.length() - 4) / 2]; - for (int i=4, j=0; i < str.length(); i +=2, j++) { - buffer[j] = (byte)((Utility.hexOf(str.charAt(i)) << 4) & 0xF0); - buffer[j] |= (byte)((Utility.hexOf(str.charAt(i+1)) << 0) & 0x0F); - } - buf = new StringBuffer(delete(buf.toString(), index, index+6)); - buf.insert(index, (char)buffer[1]); - } - - return buf.toString(); - - - } - - private static String delete(String str, int from, int to) - { - return str.substring(0, from) + str.substring(to, str.length()); - } - - private static String replace(String target, String arg, String source) - { - int i = 0; - i = target.indexOf(arg); - - while(i != -1) - { - String left = target.substring(0, i); - String right = target.substring(i+arg.length()); - target = new String(left+source+right); - i = target.indexOf(arg); - } - return target; - } - - public static int computeValueTag(boolean codeBasePresent, int typeInfo, boolean chunkedEncoding){ - int value_tag = kInitialValueTag; - - if (codeBasePresent) - value_tag = value_tag | 0x00000001; - - value_tag = value_tag | typeInfo; - - if (chunkedEncoding) - value_tag = value_tag | kChunkedMask; - - return value_tag; - } - - public static boolean isCodeBasePresent(int value_tag){ - return ((value_tag & 0x00000001) == 1); - } - - public static int getTypeInfo(int value_tag){ - return (value_tag & 0x00000006); - } - - public static boolean isChunkedEncoding(int value_tag){ - return ((value_tag & kChunkedMask) != 0); - } - - public static String getServerURL(){ - return defaultServerURL; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/util/RepositoryIdCache.java b/src/java.corba/share/classes/com/sun/corba/se/impl/util/RepositoryIdCache.java deleted file mode 100644 index 17a82f6a579..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/util/RepositoryIdCache.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.util; - -import java.util.Stack; -import java.util.Hashtable; -import java.util.EmptyStackException; -import java.util.Enumeration; - -// Really limited pool - in this case just creating several at a time... -class RepositoryIdPool extends Stack { - - private static int MAX_CACHE_SIZE = 4; - private RepositoryIdCache cache; - - public final synchronized RepositoryId popId() { - - try { - return (RepositoryId)super.pop(); - } - catch(EmptyStackException e) { - increasePool(5); - return (RepositoryId)super.pop(); - } - - } - - // Pool management - final void increasePool(int size) { - //if (cache.size() <= MAX_CACHE_SIZE) - for (int i = size; i > 0; i--) - push(new RepositoryId()); - /* - // _REVISIT_ This will not work w/out either thread tracing or weak references. I am - // betting that thread tracing almost completely negates benefit of reuse. Until either - // 1.2 only inclusion or proof to the contrary, I'll leave it this way... - else { - int numToReclaim = cache.size() / 2; - Enumeration keys = cache.keys(); - Enumeration elements = cache.elements(); - for (int i = numToReclaim; i > 0; i--) { - Object key = keys.nextElement(); - Object element = elements.nextElement(); - - push(element); - cache.remove(key); - } - } - */ - } - - final void setCaches(RepositoryIdCache cache) { - this.cache = cache; - } - -} - -public class RepositoryIdCache extends Hashtable { - - private RepositoryIdPool pool = new RepositoryIdPool(); - - public RepositoryIdCache() { - pool.setCaches(this); - } - - public final synchronized RepositoryId getId(String key) { - RepositoryId repId = (RepositoryId)super.get(key); - - if (repId != null) - return repId; - else { - //repId = pool.popId().init(key); - repId = new RepositoryId(key); - put(key, repId); - return repId; - } - - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/util/SUNVMCID.java b/src/java.corba/share/classes/com/sun/corba/se/impl/util/SUNVMCID.java deleted file mode 100644 index 93216a25db5..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/util/SUNVMCID.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.impl.util; - -/** - * The vendor minor code ID reserved for Sun by the OMG. - * All VMCIDs occupy the high order 20 bits. - */ - -public interface SUNVMCID { - - /** - * The vendor minor code ID reserved for Sun. This value is or'd with - * the high order 20 bits of the minor code to produce the minor value - * in a system exception. - */ - static final int value = 0x53550000; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/util/Utility.java b/src/java.corba/share/classes/com/sun/corba/se/impl/util/Utility.java deleted file mode 100644 index d2327f8e1f2..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/util/Utility.java +++ /dev/null @@ -1,1002 +0,0 @@ -/* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.util; - -import org.omg.CORBA.SystemException; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.BAD_OPERATION; -import org.omg.CORBA.BAD_INV_ORDER; -import org.omg.CORBA.BAD_PARAM; -import org.omg.CORBA.ORB; -import org.omg.CORBA.Any; -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.Principal; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; -import org.omg.CORBA.portable.BoxedValueHelper; -import org.omg.CORBA.portable.ValueFactory; -import org.omg.CORBA.portable.Streamable; -import org.omg.CORBA.portable.Delegate; - - -import java.util.Hashtable; -import java.util.NoSuchElementException; - -import java.rmi.Remote; -import java.rmi.NoSuchObjectException; -import java.rmi.RemoteException; -import java.rmi.server.RemoteStub; - -import javax.rmi.PortableRemoteObject; -import javax.rmi.CORBA.Stub; -import javax.rmi.CORBA.Tie; -import javax.rmi.CORBA.Util; - -import java.io.Serializable; -import java.io.File; -import java.io.FileInputStream; - -import org.omg.PortableServer.POA; - -import com.sun.org.omg.SendingContext.CodeBase; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.spi.presentation.rmi.PresentationManager; -import com.sun.corba.se.spi.presentation.rmi.StubAdapter ; - -import com.sun.corba.se.impl.logging.UtilSystemException ; -import com.sun.corba.se.impl.logging.OMGSystemException ; - -/** - * Handy class full of static functions. - */ -public final class Utility { - - public static final String STUB_PREFIX = "_"; - public static final String RMI_STUB_SUFFIX = "_Stub"; - public static final String DYNAMIC_STUB_SUFFIX = "_DynamicStub" ; - public static final String IDL_STUB_SUFFIX = "Stub"; - public static final String TIE_SUFIX = "_Tie"; - private static IdentityHashtable tieCache = new IdentityHashtable(); - private static IdentityHashtable tieToStubCache = new IdentityHashtable(); - private static IdentityHashtable stubToTieCache = new IdentityHashtable(); - private static Object CACHE_MISS = new Object(); - private static UtilSystemException wrapper = UtilSystemException.get( - CORBALogDomains.UTIL ) ; - private static OMGSystemException omgWrapper = OMGSystemException.get( - CORBALogDomains.UTIL ) ; - - /** - * Ensure that stubs, ties, and implementation objects - * are 'connected' to the runtime. Converts implementation - * objects to a type suitable for sending on the wire. - * @param obj the object to connect. - * @param orb the ORB to connect to if obj is exported to IIOP. - * @param convertToStub true if implementation types should be - * converted to Stubs rather than just org.omg.CORBA.Object. - * @return the connected object. - * @exception NoSuchObjectException if obj is an implementation - * which has not been exported. - */ - public static Object autoConnect(Object obj, ORB orb, boolean convertToStub) - { - if (obj == null) { - return obj; - } - - if (StubAdapter.isStub(obj)) { - try { - StubAdapter.getDelegate(obj) ; - } catch (BAD_OPERATION okay) { - try { - StubAdapter.connect( obj, orb ) ; - } catch (RemoteException e) { - // The stub could not be connected because it - // has an invalid IOR... - throw wrapper.objectNotConnected( e, - obj.getClass().getName() ) ; - } - } - - return obj; - } - - if (obj instanceof Remote) { - Remote remoteObj = (Remote)obj; - Tie theTie = Util.getTie(remoteObj); - if (theTie != null) { - try { - theTie.orb(); - } catch (SystemException okay) { - theTie.orb(orb); - } - - if (convertToStub) { - Object result = loadStub(theTie,null,null,true); - if (result != null) { - return result; - } else { - throw wrapper.couldNotLoadStub(obj.getClass().getName()); - } - } else { - return StubAdapter.activateTie( theTie ); - } - } else { - // This is an implementation object which has not been - // exported to IIOP OR is a JRMP stub or implementation - // object which cannot be marshalled into an ORB stream... - throw wrapper.objectNotExported( obj.getClass().getName() ) ; - } - } - - // Didn't need to do anything, just return the input... - - return obj; - } - - /* - * Get a new instance of an RMI-IIOP Tie for the - * given server object. - */ - public static Tie loadTie(Remote obj) { - Tie result = null; - Class objClass = obj.getClass(); - - // Have we tried to find this guy before? - - synchronized (tieCache) { - - Object it = tieCache.get(obj); - - if (it == null) { - - // No, so try it... - - try { - - // First try the classname... - - result = loadTie(objClass); - - // If we don't have a valid tie at this point, - // walk up the parent chain until we either - // load a tie or encounter PortableRemoteObject - // or java.lang.Object... - - while (result == null && - (objClass = objClass.getSuperclass()) != null && - objClass != PortableRemoteObject.class && - objClass != Object.class) { - - result = loadTie(objClass); - } - } catch (Exception ex) { - wrapper.loadTieFailed( ex, objClass.getName() ) ; - } - - // Did we get it? - - if (result == null) { - - // Nope, so cache that fact... - - tieCache.put(obj,CACHE_MISS); - - } else { - - // Yes, so cache it... - - tieCache.put(obj,result); - } - } else { - - // Yes, return a new instance or fail again if - // it was a miss last time... - - if (it != CACHE_MISS) { - try { - result = (Tie) it.getClass().newInstance(); - } catch (Exception e) { - } - } - } - } - - return result; - } - - /* - * Load an RMI-IIOP Tie - */ - private static Tie loadTie(Class theClass) - { - return com.sun.corba.se.spi.orb.ORB.getStubFactoryFactory(). - getTie( theClass ) ; - } - - /* - * Clear the stub/tie caches. Intended for use by - * test code. - */ - public static void clearCaches() { - synchronized (tieToStubCache) { - tieToStubCache.clear(); - } - synchronized (tieCache) { - tieCache.clear(); - } - synchronized (stubToTieCache) { - stubToTieCache.clear(); - } - } - - /* - * Load a class and check that it is assignable to a given type. - * @param className the class name. - * @param remoteCodebase the codebase to use. May be null. - * @param loader the class loader of last resort. May be null. - * @param expectedType the expected type. May be null. - * @return the loaded class. - */ - static Class loadClassOfType(String className, String remoteCodebase, - ClassLoader loader, Class expectedType, - ClassLoader expectedTypeClassLoader) throws ClassNotFoundException - { - Class loadedClass = null; - - try { - //Sequence finding of the stubs according to spec - try{ - //If-else is put here for speed up of J2EE. - //According to the OMG spec, the if clause is not dead code. - //It can occur if some compiler has allowed generation - //into org.omg.stub hierarchy for non-offending - //classes. This will encourage people to - //produce non-offending class stubs in their own hierarchy. - if (!PackagePrefixChecker.hasOffendingPrefix( - PackagePrefixChecker.withoutPackagePrefix(className))){ - loadedClass = Util.loadClass( - PackagePrefixChecker.withoutPackagePrefix(className), - remoteCodebase, - loader); - } else { - loadedClass = Util.loadClass(className, remoteCodebase, - loader); - } - } catch (ClassNotFoundException cnfe) { - loadedClass = Util.loadClass(className, remoteCodebase, - loader); - } - if (expectedType == null) - return loadedClass; - } catch (ClassNotFoundException cnfe) { - if (expectedType == null) - throw cnfe; - } - - // If no class was loaded, or if the loaded class is not of the - // correct type, make a further attempt to load the correct class - // using the classloader of the expected type. - // _REVISIT_ Is this step necessary, or should the Util,loadClass - // algorithm always produce a valid class if the setup is correct? - // Does the OMG standard algorithm need to be changed to include - // this step? - if (loadedClass == null || !expectedType.isAssignableFrom(loadedClass)){ - if (expectedType.getClassLoader() != expectedTypeClassLoader) - throw new IllegalArgumentException( - "expectedTypeClassLoader not class loader of " + - "expected Type."); - - if (expectedTypeClassLoader != null) - loadedClass = expectedTypeClassLoader.loadClass(className); - else { - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - if (cl == null) - cl = ClassLoader.getSystemClassLoader(); - - loadedClass = cl.loadClass(className); - } - } - - return loadedClass; - } - - /* - * Load a class and check that it is compatible with a given type. - * @param className the class name. - * @param remoteCodebase the codebase to use. May be null. - * @param loadingContext the loading context. May be null. - * @param relatedType the related type. May be null. - * @return the loaded class. - */ - public static Class loadClassForClass (String className, - String remoteCodebase, - ClassLoader loader, - Class relatedType, - ClassLoader relatedTypeClassLoader) - throws ClassNotFoundException - { - if (relatedType == null) - return Util.loadClass(className, remoteCodebase, loader); - - Class loadedClass = null; - try { - loadedClass = Util.loadClass(className, remoteCodebase, loader); - } catch (ClassNotFoundException cnfe) { - if (relatedType.getClassLoader() == null) - throw cnfe; - } - - // If no class was not loaded, or if the loaded class is not of the - // correct type, make a further attempt to load the correct class - // using the classloader of the related type. - // _REVISIT_ Is this step necessary, or should the Util,loadClass - // algorithm always produce a valid class if the setup is correct? - // Does the OMG standard algorithm need to be changed to include - // this step? - if (loadedClass == null || - (loadedClass.getClassLoader() != null && - loadedClass.getClassLoader().loadClass(relatedType.getName()) != - relatedType)) - { - if (relatedType.getClassLoader() != relatedTypeClassLoader) - throw new IllegalArgumentException( - "relatedTypeClassLoader not class loader of relatedType."); - - if (relatedTypeClassLoader != null) - loadedClass = relatedTypeClassLoader.loadClass(className); - } - - return loadedClass; - } - - /** - * Get the helper for an IDLValue - * - * Throws MARSHAL exception if no helper found. - */ - public static BoxedValueHelper getHelper(Class clazz, String codebase, - String repId) - { - String className = null; - if (clazz != null) { - className = clazz.getName(); - if (codebase == null) - codebase = Util.getCodebase(clazz); - } else { - if (repId != null) - className = RepositoryId.cache.getId(repId).getClassName(); - if (className == null) // no repId or unrecognized repId - throw wrapper.unableLocateValueHelper( - CompletionStatus.COMPLETED_MAYBE); - } - - try { - ClassLoader clazzLoader = - (clazz == null ? null : clazz.getClassLoader()); - Class helperClass = - loadClassForClass(className+"Helper", codebase, clazzLoader, - clazz, clazzLoader); - return (BoxedValueHelper)helperClass.newInstance(); - - } catch (ClassNotFoundException cnfe) { - throw wrapper.unableLocateValueHelper( CompletionStatus.COMPLETED_MAYBE, - cnfe ); - } catch (IllegalAccessException iae) { - throw wrapper.unableLocateValueHelper( CompletionStatus.COMPLETED_MAYBE, - iae ); - } catch (InstantiationException ie) { - throw wrapper.unableLocateValueHelper( CompletionStatus.COMPLETED_MAYBE, - ie ); - } catch (ClassCastException cce) { - throw wrapper.unableLocateValueHelper( CompletionStatus.COMPLETED_MAYBE, - cce ); - } - } - - /** - * Get the factory for an IDLValue - * - * Throws MARSHAL exception if no factory found. - */ - public static ValueFactory getFactory(Class clazz, String codebase, - ORB orb, String repId) - { - ValueFactory factory = null; - if ((orb != null) && (repId != null)) { - try { - factory = ((org.omg.CORBA_2_3.ORB)orb).lookup_value_factory( - repId); - } catch (org.omg.CORBA.BAD_PARAM ex) { - // Try other way - } - } - - String className = null; - if (clazz != null) { - className = clazz.getName(); - if (codebase == null) - codebase = Util.getCodebase(clazz); - } else { - if (repId != null) - className = RepositoryId.cache.getId(repId).getClassName(); - if (className == null) // no repId or unrecognized repId - throw omgWrapper.unableLocateValueFactory( - CompletionStatus.COMPLETED_MAYBE); - } - - // if earlier search found a non-default factory, or the same default - // factory that loadClassForClass would return, bale out now... - if (factory != null && - (!factory.getClass().getName().equals(className+"DefaultFactory") || - (clazz == null && codebase == null))) - return factory; - - try { - ClassLoader clazzLoader = - (clazz == null ? null : clazz.getClassLoader()); - Class factoryClass = - loadClassForClass(className+"DefaultFactory", codebase, - clazzLoader, clazz, clazzLoader); - return (ValueFactory)factoryClass.newInstance(); - - } catch (ClassNotFoundException cnfe) { - throw omgWrapper.unableLocateValueFactory( - CompletionStatus.COMPLETED_MAYBE, cnfe); - } catch (IllegalAccessException iae) { - throw omgWrapper.unableLocateValueFactory( - CompletionStatus.COMPLETED_MAYBE, iae); - } catch (InstantiationException ie) { - throw omgWrapper.unableLocateValueFactory( - CompletionStatus.COMPLETED_MAYBE, ie); - } catch (ClassCastException cce) { - throw omgWrapper.unableLocateValueFactory( - CompletionStatus.COMPLETED_MAYBE, cce); - } - } - - /* - * Load an RMI-IIOP Stub given a Tie. - * @param tie the tie. - * @param stubClass the stub class. May be null. - * @param remoteCodebase the codebase to use. May be null. - * @param onlyMostDerived if true, will fail if cannot load a stub for the - * first repID in the tie. If false, will walk all repIDs. - * @return the stub or null if not found. - */ - - public static Remote loadStub(Tie tie, - PresentationManager.StubFactory stubFactory, - String remoteCodebase, - boolean onlyMostDerived) - { - StubEntry entry = null; - - // Do we already have it cached? - synchronized (tieToStubCache) { - Object cached = tieToStubCache.get(tie); - if (cached == null) { - // No, so go try to load it... - entry = loadStubAndUpdateCache( - tie, stubFactory, remoteCodebase, onlyMostDerived); - } else { - // Yes, is it a stub? If not, it was a miss last - // time, so return null again... - if (cached != CACHE_MISS) { - // It's a stub. - entry = (StubEntry) cached; - - // Does the cached stub meet the requirements - // of the caller? If the caller does not require - // the most derived stub and does not require - // a specific stub type, we don't have to check - // any further because the cached type is good - // enough... - if (!entry.mostDerived && onlyMostDerived) { - // We must reload because we do not have - // the most derived cached already... - // The stubFactory arg must be null here - // to force onlyMostDerived=true to work - // correctly. - entry = loadStubAndUpdateCache(tie,null, - remoteCodebase,true); - } else if (stubFactory != null && - !StubAdapter.getTypeIds(entry.stub)[0].equals( - stubFactory.getTypeIds()[0]) ) - { - // We do not have exactly the right stub. First, try to - // upgrade the cached stub by forcing it to the most - // derived stub... - entry = loadStubAndUpdateCache(tie,null, - remoteCodebase,true); - - // If that failed, try again with the exact type - // we need... - if (entry == null) { - entry = loadStubAndUpdateCache(tie,stubFactory, - remoteCodebase,onlyMostDerived); - } - } else { - // Use the cached stub. Is the delegate set? - try { - Delegate stubDel = StubAdapter.getDelegate( - entry.stub ) ; - } catch (Exception e2) { - // No, so set it if we can... - try { - Delegate del = StubAdapter.getDelegate( - tie ) ; - StubAdapter.setDelegate( entry.stub, - del ) ; - } catch (Exception e) {} - } - } - } - } - } - - if (entry != null) { - return (Remote)entry.stub; - } else { - return null; - } - } - - /* - * Load an RMI-IIOP Stub given a Tie, but do not look in the cache. - * This method must be called with the lock held for tieToStubCache. - * @param tie the tie. - * @param stubFactory the stub factory. May be null. - * @param remoteCodebase the codebase to use. May be null. - * @param onlyMostDerived if true, will fail if cannot load a stub for the - * first repID in the tie. If false, will walk all repIDs. - * @return the StubEntry or null if not found. - */ - private static StubEntry loadStubAndUpdateCache ( - Tie tie, PresentationManager.StubFactory stubFactory, - String remoteCodebase, boolean onlyMostDerived) - { - org.omg.CORBA.Object stub = null; - StubEntry entry = null; - boolean tieIsStub = StubAdapter.isStub( tie ) ; - - if (stubFactory != null) { - try { - stub = stubFactory.makeStub(); - } catch (Throwable e) { - wrapper.stubFactoryCouldNotMakeStub( e ) ; - if (e instanceof ThreadDeath) { - throw (ThreadDeath) e; - } - } - } else { - String[] ids = null; - if (tieIsStub) { - ids = StubAdapter.getTypeIds( tie ) ; - } else { - // This will throw an exception if the tie - // is not a Servant. XXX Handle this better? - ids = ((org.omg.PortableServer.Servant)tie). - _all_interfaces( null, null ); - } - - if (remoteCodebase == null) { - remoteCodebase = Util.getCodebase(tie.getClass()); - } - - if (ids.length == 0) { - stub = new org.omg.stub.java.rmi._Remote_Stub(); - } else { - // Now walk all the RepIDs till we find a stub or fail... - for (int i = 0; i < ids.length; i++) { - if (ids[i].length() == 0) { - stub = new org.omg.stub.java.rmi._Remote_Stub(); - break; - } - - try { - PresentationManager.StubFactoryFactory stubFactoryFactory = - com.sun.corba.se.spi.orb.ORB.getStubFactoryFactory(); - RepositoryId rid = RepositoryId.cache.getId( ids[i] ) ; - String className = rid.getClassName() ; - boolean isIDLInterface = rid.isIDLType() ; - stubFactory = stubFactoryFactory.createStubFactory( - className, isIDLInterface, remoteCodebase, null, - tie.getClass().getClassLoader() ) ; - stub = stubFactory.makeStub(); - break; - } catch (Exception e) { - wrapper.errorInMakeStubFromRepositoryId( e ) ; - } - - if (onlyMostDerived) - break; - } - } - } - - if (stub == null) { - // Stub == null, so cache the miss... - tieToStubCache.put(tie,CACHE_MISS); - } else { - if (tieIsStub) { - try { - Delegate del = StubAdapter.getDelegate( tie ) ; - StubAdapter.setDelegate( stub, del ) ; - } catch( Exception e1 ) { - // The tie does not have a delegate set, so stash - // this tie away using the stub as a key so that - // later, when the stub is connected, we can find - // and connect the tie as well... - - synchronized (stubToTieCache) { - stubToTieCache.put(stub,tie); - } - } - } else { - // Tie extends Servant - try { - Delegate delegate = StubAdapter.getDelegate( tie ) ; - StubAdapter.setDelegate( stub, delegate ) ; - } catch( org.omg.CORBA.BAD_INV_ORDER bad) { - synchronized (stubToTieCache) { - stubToTieCache.put(stub,tie); - } - } catch( Exception e ) { - // Exception is caught because of any of the - // following reasons - // 1) POA is not associated with the TIE - // 2) POA Policies for the tie-associated POA - // does not support _this_object() call. - throw wrapper.noPoa( e ) ; - } - } - // Update the cache... - entry = new StubEntry(stub,onlyMostDerived); - tieToStubCache.put(tie,entry); - } - - return entry; - } - - /* - * If we loadStub(Tie,...) stashed away a tie which was - * not connected, remove it from the cache and return - * it. - */ - public static Tie getAndForgetTie (org.omg.CORBA.Object stub) { - synchronized (stubToTieCache) { - return (Tie) stubToTieCache.remove(stub); - } - } - - /* - * Remove any cached Stub for the given tie. - */ - public static void purgeStubForTie (Tie tie) { - StubEntry entry; - synchronized (tieToStubCache) { - entry = (StubEntry)tieToStubCache.remove(tie); - } - if (entry != null) { - synchronized (stubToTieCache) { - stubToTieCache.remove(entry.stub); - } - } - } - - /* - * Remove cached tie/servant pair. - */ - public static void purgeTieAndServant (Tie tie) { - synchronized (tieCache) { - Object target = tie.getTarget(); - if (target != null) - tieCache.remove(target); - } - } - - /* - * Convert a RepId to a stubName... - */ - public static String stubNameFromRepID (String repID) { - - // Convert the typeid to a RepositoryId instance, get - // the className and mangle it as needed... - - RepositoryId id = RepositoryId.cache.getId(repID); - String className = id.getClassName(); - - if (id.isIDLType()) { - className = idlStubName(className); - } else { - className = stubName(className); - } - return className; - } - - - /* - * Load an RMI-IIOP Stub. This is used in PortableRemoteObject.narrow. - */ - public static Remote loadStub (org.omg.CORBA.Object narrowFrom, - Class narrowTo) - { - Remote result = null; - - try { - // Get the codebase from the delegate to use when loading - // the new stub, if possible... - String codebase = null; - try { - // We can't assume that narrowFrom is a CORBA_2_3 stub, yet - // it may have a 2_3 Delegate that provides a codebase. Swallow - // the ClassCastException otherwise. - Delegate delegate = StubAdapter.getDelegate( narrowFrom ) ; - codebase = ((org.omg.CORBA_2_3.portable.Delegate)delegate). - get_codebase(narrowFrom); - - } catch (ClassCastException e) { - wrapper.classCastExceptionInLoadStub( e ) ; - } - - PresentationManager.StubFactoryFactory sff = - com.sun.corba.se.spi.orb.ORB.getStubFactoryFactory() ; - PresentationManager.StubFactory sf = sff.createStubFactory( - narrowTo.getName(), false, codebase, narrowTo, - narrowTo.getClassLoader() ) ; - result = (Remote)sf.makeStub() ; - StubAdapter.setDelegate( result, - StubAdapter.getDelegate( narrowFrom ) ) ; - } catch (Exception err) { - wrapper.exceptionInLoadStub( err ) ; - } - - return result; - } - - /* - * Load an RMI-IIOP Stub class. This is used in the - * StaticStubFactoryFactory code. - */ - public static Class loadStubClass(String repID, - String remoteCodebase, - Class expectedType) - throws ClassNotFoundException - { - // Get the repID and check for "" special case. - // We should never be called with it (See CDRInputStream - // and the loadStub() method)... - - if (repID.length() == 0) { - throw new ClassNotFoundException(); - } - - // Get the stubname from the repID and load - // the class. If we have a valid 'sender', fall - // back to using its codebase if we need to... - String className = Utility.stubNameFromRepID(repID); - ClassLoader expectedTypeClassLoader = (expectedType == null ? null : - expectedType.getClassLoader()); - - try { - return loadClassOfType(className, - remoteCodebase, - expectedTypeClassLoader, - expectedType, - expectedTypeClassLoader); - } catch (ClassNotFoundException e) { - return loadClassOfType(PackagePrefixChecker.packagePrefix() + className, - remoteCodebase, - expectedTypeClassLoader, - expectedType, - expectedTypeClassLoader); - } - } - - /** - * Create an RMI stub name. - */ - public static String stubName (String className) - { - return stubName( className, false ) ; - } - - public static String dynamicStubName( String className ) - { - return stubName( className, true ) ; - } - - private static String stubName( String className, - boolean isDynamic ) - { - String name = stubNameForCompiler( className, isDynamic ) ; - if (PackagePrefixChecker.hasOffendingPrefix( name )) - name = PackagePrefixChecker.packagePrefix() + name ; - return name ; - } - - public static String stubNameForCompiler (String className) - { - return stubNameForCompiler( className, false ) ; - } - - private static String stubNameForCompiler( String className, - boolean isDynamic ) - { - int index = className.indexOf('$'); - if (index < 0) { - index = className.lastIndexOf('.'); - } - - String suffix = isDynamic ? DYNAMIC_STUB_SUFFIX : - RMI_STUB_SUFFIX ; - - if (index > 0) { - return className.substring(0,index+1) + STUB_PREFIX + - className.substring(index+1) + suffix; - } else { - return STUB_PREFIX + className + suffix; - } - } - - /** - * Create an RMI tie name. - */ - public static String tieName (String className) - { - return - PackagePrefixChecker.hasOffendingPrefix(tieNameForCompiler(className)) ? - PackagePrefixChecker.packagePrefix() + tieNameForCompiler(className) : - tieNameForCompiler(className); - } - - public static String tieNameForCompiler (String className) - { - int index = className.indexOf('$'); - if (index < 0) { - index = className.lastIndexOf('.'); - } - if (index > 0) { - return className.substring(0,index+1) + - STUB_PREFIX + - className.substring(index+1) + - TIE_SUFIX; - } else { - return STUB_PREFIX + - className + - TIE_SUFIX; - } - } - - /** - * Throws the CORBA equivalent of a java.io.NotSerializableException - */ - public static void throwNotSerializableForCorba(String className) { - throw omgWrapper.notSerializable( CompletionStatus.COMPLETED_MAYBE, - className ) ; - } - - /** - * Create an IDL stub name. - */ - public static String idlStubName(String className) - { - String result = null; - int index = className.lastIndexOf('.'); - if (index > 0) { - result = className.substring(0,index+1) + - STUB_PREFIX + - className.substring(index+1) + - IDL_STUB_SUFFIX; - } else { - result = STUB_PREFIX + - className + - IDL_STUB_SUFFIX; - } - return result; - } - - public static void printStackTrace() - { - Throwable thr = new Throwable( "Printing stack trace:" ) ; - thr.fillInStackTrace() ; - thr.printStackTrace() ; - } - - /** - * Read an object reference from the input stream and narrow - * it to the desired type. - * @param in the stream to read from. - * @throws ClassCastException if narrowFrom cannot be cast to narrowTo. - */ - public static Object readObjectAndNarrow(InputStream in, - Class narrowTo) - throws ClassCastException - { - Object result = in.read_Object(); - if (result != null) - return PortableRemoteObject.narrow(result, narrowTo); - else - return null; - } - - /** - * Read an abstract interface type from the input stream and narrow - * it to the desired type. - * @param in the stream to read from. - * @throws ClassCastException if narrowFrom cannot be cast to narrowTo. - */ - public static Object readAbstractAndNarrow( - org.omg.CORBA_2_3.portable.InputStream in, Class narrowTo) - throws ClassCastException - { - Object result = in.read_abstract_interface(); - if (result != null) - return PortableRemoteObject.narrow(result, narrowTo); - else - return null; - } - - - /** Converts an Ascii Character into Hexadecimal digit - */ - static int hexOf( char x ) - { - int val; - - val = x - '0'; - if (val >=0 && val <= 9) - return val; - - val = (x - 'a') + 10; - if (val >= 10 && val <= 15) - return val; - - val = (x - 'A') + 10; - if (val >= 10 && val <= 15) - return val; - - throw wrapper.badHexDigit() ; - } -} - -class StubEntry { - org.omg.CORBA.Object stub; - boolean mostDerived; - - StubEntry(org.omg.CORBA.Object stub, boolean mostDerived) { - this.stub = stub; - this.mostDerived = mostDerived; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/impl/util/Version.java b/src/java.corba/share/classes/com/sun/corba/se/impl/util/Version.java deleted file mode 100644 index 45360cbe4e8..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/impl/util/Version.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package com.sun.corba.se.impl.util; -import java.util.Date; - -public class Version { - - public static final String PROJECT_NAME = "RMI-IIOP"; - public static final String VERSION = "1.0"; - public static final String BUILD = "0.0"; - public static final String BUILD_TIME = "unknown"; - public static final String FULL = PROJECT_NAME + " " + VERSION + " (" - + BUILD_TIME + ")"; - - public static String asString () { - return FULL; - } - - public static void main (String[] args) { - System.out.println(FULL); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/internal/CosNaming/BootstrapServer.java b/src/java.corba/share/classes/com/sun/corba/se/internal/CosNaming/BootstrapServer.java deleted file mode 100644 index e4501950265..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/internal/CosNaming/BootstrapServer.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.internal.CosNaming; - -import java.util.Enumeration; -import java.util.Properties; - -import java.io.File; -import java.io.FileInputStream; - -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.spi.resolver.Resolver ; -import com.sun.corba.se.spi.resolver.LocalResolver ; -import com.sun.corba.se.spi.resolver.ResolverDefault ; - -import com.sun.corba.se.impl.orbutil.CorbaResourceUtil; -import com.sun.corba.se.impl.orbutil.ORBConstants; - -/** - * Class BootstrapServer is the main entry point for the bootstrap server - * implementation. The BootstrapServer makes all object references - * defined in a configurable file available using the old - * naming bootstrap protocol. - */ -public class BootstrapServer -{ - private ORB orb; - - /** - * Main startup routine for the bootstrap server. - * It first determines the port on which to listen, checks that the - * specified file is available, and then creates the resolver - * that will be used to service the requests in the - * BootstrapServerRequestDispatcher. - * @param args the command-line arguments to the main program. - */ - public static final void main(String[] args) - { - String propertiesFilename = null; - int initialPort = ORBConstants.DEFAULT_INITIAL_PORT; - - // Process arguments - for (int i=0;i"Y", and an - * object, YY, then a subsequent call to - * ORB.resolve_initial_references( "Y" ) will - * return object YY. - * - * @param id The ID by which the initial reference will be known. - * @param obj The initial reference itself. - * @throws InvalidName if this operation is called with an empty string id - * or this operation is called with an id that is already registered, - * including the default names defined by OMG. - * @throws BAD_PARAM if the obj parameter is null. - */ - public void register_initial_reference( String id, - org.omg.CORBA.Object obj ) - throws InvalidName - { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/pept/broker/Broker.java b/src/java.corba/share/classes/com/sun/corba/se/pept/broker/Broker.java deleted file mode 100644 index 0f0e21189dc..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/pept/broker/Broker.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.pept.broker; - -import com.sun.corba.se.pept.protocol.ClientInvocationInfo; -import com.sun.corba.se.pept.transport.TransportManager; - -/** - * @author Harold Carr - */ -public interface Broker -{ - public ClientInvocationInfo createOrIncrementInvocationInfo(); - public ClientInvocationInfo getInvocationInfo(); - public void releaseOrDecrementInvocationInfo(); - - public abstract TransportManager getTransportManager(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/pept/encoding/InputObject.java b/src/java.corba/share/classes/com/sun/corba/se/pept/encoding/InputObject.java deleted file mode 100644 index 1e6eec132c9..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/pept/encoding/InputObject.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.pept.encoding; - -import java.io.IOException; - -import com.sun.corba.se.pept.protocol.MessageMediator; - -/** - *

            An InputObject is the interface used by the - * presentation block to get programming language typed data from data - * encoded in a message.

            - * - *

            The implementation of an InputObject contains the - * encoded data. When the presentation block asks for data the - * implementation of InputObject is responsible for converting - * the encoded representation of the data to the types expected by the - * programming language.

            - * - *

            A particular encoding would subclass - * InputObject. The subclass would provide methods to get - * the data types appropriate to the presentation block (e.g., simple - * types such as int or boolean, all the way to any type derived from - * java.io.Serializable.).

            - * - *

            Note: the protocol block may also use the InputObject to - * obtain header metadata.

            - * - * @author Harold Carr -*/ -public interface InputObject -{ - public void setMessageMediator(MessageMediator messageMediator); - - public MessageMediator getMessageMediator(); - - public void close() throws IOException; -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/pept/encoding/OutputObject.java b/src/java.corba/share/classes/com/sun/corba/se/pept/encoding/OutputObject.java deleted file mode 100644 index cb6b60f00f4..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/pept/encoding/OutputObject.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.pept.encoding; - -import java.io.IOException; - -import com.sun.corba.se.pept.protocol.MessageMediator; - -/** - *

            An OutputObject is the interface used by the - * presentation block to give programming language typed data to - * the encoding block to be encoded and sent in a message.

            - * - *

            The implementation of an OutputObject contains the - * encoded data. When the presentation block gives programming language - * typed data to - * OutputObject, the - * implementation of OutputObject is responsible for converting - * that data to the encoded representation of the data for a particular - * encoding.

            - * - *

            A particular encoding would subclass - * OutputObject. The subclass would provide methods to set - * the data types appropriate to the presentation block (e.g., simple - * types such as int or boolean, all the way to any type derived from - * java.io.Serializable.).

            - * - *

            Note: the protocol block may also use the OutputObject to - * set header metadata.

            - * - * @author Harold Carr -*/ -public interface OutputObject -{ - public void setMessageMediator(MessageMediator messageMediator); - - public MessageMediator getMessageMediator(); - - public void close() throws IOException; -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/pept/package.html b/src/java.corba/share/classes/com/sun/corba/se/pept/package.html deleted file mode 100644 index b96935e1f07..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/pept/package.html +++ /dev/null @@ -1,359 +0,0 @@ - - - - - - - -

            This package is the top-level package for the PEPt Remoting -Architecture. PEPt enables remoting (i.e., RPC and Messaging) -systems to dynamically use alternate encodings, protocols and -transports.

            - -

            Related Documentation

            - -

            -For papers, slides and examples of the PEPt architecture, please see: -

            -

            - -

            PEPt Architecture

            - -

            -PEPt stands for: -

              - -
            • Presentation: the data types that may be passed and the -APIs used to interact with the remoting system.
            • - -
            • Encoding: the process of transforming those programming -language data types into an underlying "wire" representation (and the -wire representation itself).
            • - -
            • Protocol: The metadata which accompanies a message and the -use of that metadata.
            • - -
            • transport: The mechanism used to move the encoded data and -metadata from one location to another.
            • - -
            -

            - -

            Key PEPt Interfaces

            -
              - -
            • {@link com.sun.corba.se.pept.transport.ContactInfoList ContactInfoList} - - Client-side address selection mechanism and factory for - alternate encodings, protocols and transports (EPT).
            • - -
            • {@link com.sun.corba.se.pept.transport.Acceptor Acceptor} - - Server-side endpoint, addressing and factory for alternate EPTs.
            • - -
            -

            - -

            PEPt Client-side Interfaces

            -
              -
            • Protocol -
                - -
              • {@link com.sun.corba.se.pept.protocol.ClientDelegate ClientDelegate} - - The presentation block interacts with ClientDelegate - to initiate and complete a message send (and a possible - response). ClientDelegate is a "portability" interface, - to allow different vendors to plug in their implementation into a - standard presentation block.
              • - -
              • {@link com.sun.corba.se.pept.protocol.ClientRequestDispatcher - ClientRequestDispatcher} - This interface controls the client-side - dispatch for a given EPT.
              • - -
              -
            • -
            • Transport -
                - -
              • {@link com.sun.corba.se.pept.protocol.ContactInfoList - ContactInfoList} - A list of ContactInfo associated - with a ClientDelegate
              • . - -
              • {@link com.sun.corba.se.pept.protocol.ContactInfoListIterator - ContactInfoListIterator} - An iterator which chooses the "next" - EPT-specific ContactInfo.
              • - -
              • {@link com.sun.corba.se.pept.protocol.ContactInfoList - ContactInfo} - The key PEPt client-side interface. The - presentation block uses a ClientDelegate to select an - EPT-specific ContactInfo. That ContactInfo - serves as a factory for EPT-specifc - ClientRequestDispatcher, - Input/OutputObjects and Connection.
              • - -
              -
            • -
            -

            - -

            PEPt Server-side Interfaces

            -
              -
            • Protocol -
                - -
              • {@link com.sun.corba.se.pept.protocol.ServerRequestDispatcher - ServerRequestDispatcher} - This interface controls the server-side - dispatch for a given EPT.
              • - -
              -
            • -
            • Transport -
                - -
              • {@link com.sun.corba.se.pept.protocol.Acceptor Acceptor} - - The key PEPt server-side interface. Aceptor - serves as a factory for EPT-specifc - ServerRequestDispatcher, - Input/OutputObjects and Connection.
              • - -
              -
            • -
            -

            - -

            PEPt Client and Server Interfaces

            -
              -
            • Presentation -
                - -
              • PEPt, at this time, does not provide interfaces for the - presentation level. PEPt is the architecture underlying Sun's CORBA - implementation. In that implementation the CORBA system provides - stubs, ties, DII and DSI presentation artifacts that interact with - the underlying PEPt interfaces.
              • - -
              -
            • -
            • Encoding -
                - -
              • {@link com.sun.corba.se.pept.encoding.InputObject InputObject} - - The presentation block uses an InputObject to - retrieve programming language typed data from encoded data sent in a - message.
              • - -
              • {@link com.sun.corba.se.pept.encoding.OutputObject OutputObject} - - The presentation block uses an OutputObject to - post programming language typed data to be encoded and sent in a - message.
              • - -
              -
            • -
            • Protocol -
                - -
              • {@link com.sun.corba.se.pept.protocol.MessageMediator MessageMediator} - - A "repository" of data associated with a message to be sent or one - received. It is the main object used as an argument for methods of - the interfaces of the PEPt architecture.
              • - -
              • {@link com.sun.corba.se.pept.protocol.ProtocolHandler ProtocolHandler} - - Used to determine an incoming message and dispatch it - appropriately.
              • - -
              -
            • -
            • transport -
                - -
              • {@link com.sun.corba.se.pept.protocol.Connection Connection} - - The top-level abstraction of a "connection" between two PEPt - peers. Concreate instances may be TCP/IP sockets, Solaris Doors, - Shared Memory, ATM, etc.
              • - -
              -
            • -
            -

            - -

            High-level view of PEPt Operation

            - -

            PEPt Client-side Operation

            - -
              -
            1. Presentation asks ClientDelegate for an -OutputObject.
            2. -
                -
              1. ClientDelegate gets an EPT-specific - ContactInfo.
              2. -
              3. ClientDelegate uses the chosen - ContactInfo as a factory to get an EPT-specific - ClientRequestDispatcher.
              4. -
              5. ClientDelegate transfers control to the - EPT-specific ClientRequestDispatcher.beginRequest. -
                  -
                1. ClientRequestDispatcher.beginRequest uses - ContactInfo as a factory to get EPT-specific - OutputObject, MessageMediator and - Connection.
                2. -
                3. ClientRequestDispatcher.beginRequest may marshal - or set header information on the OutputObject and it - may execute interceptors (which may add additional header - information) before returning the OutputObject to the - presentation block.
                4. -
                -
              -
            3. Presentation block sets data objects to be sent by calling -OutputObject methods.
            4. -
            5. Presentation block signals the PEPt architecture to send the -message by calling -ClientRequestDispatcher.marshalingComplete.
            6. -
            7. ClientRequestDispatcher.marshalingComplete sends the -headers and data encoded in OutputObject on the -Connection.
            8. -
            9. Depending on the EPT, -ClientRequestDispatcher.marshalingComplete may return -immediately (i.e., an asynchronous message send with no -acknowledgment), may wait to get an indication that the message send -was successfully (i.e., an acknowledged asynchronous send) or wait for -a response (a synchronous message send). The following steps assume -waiting for a response.
            10. -
            11. ClientRequestDispatcher.marshalingComplete waits for a -response. This may mean blocking on a read of the -Connection (e.g., SOAP/HTTP), or putting the client -thread to sleep while another thread demultiplexes replies (e.g., -RMI-IIOP), or using the client thread itself to perform the -server-side operation (e.g., colocation optimization).
            12. -
            13. When a response arrives on the Connection it gives -the raw bits of the response to ContactInfo which creates -an EPT-specific InputObject and calls -ProtocolHandler.handleRequest to determine the message -type.
            14. -
                -
              1. ProtocolHandler.handleRequest determines the - message type (e.g., Request, Response, Error, Cancel, Close, ...).
              2. -
              3. Suppose it is a response to an RMI-IIOP request. In that case - it would find the thread and MessageMediator which - originated the request and wake it up, after having passed it the - response InputObject.
              4. -
              -
            15. ClientRequestDispatcher.marshalingComplete may run -interceptors and use reply header metadata befor returning control to -the presentation block.
            16. -
            17. The presentation block call to -ClientRequestDispatcher.marshalingComplete would return -the response InputObject.
            18. -
            19. The presentation block would get response data objects from the -InputObject.
            20. -
            21. The presentation block would signal the PEPt architecture that -the invocation is complete by calling -ClientRequestDispatcher.endRequest.
            22. -
            23. ClientRequestDispatcher.endRequest may clean up -resources used in the invocation.
            24. -
            - -

            PEPt Server-side Operation

            - -

            Suppose a server support several EPTs.

            - -
              -
            1. For each EPT, register an Acceptor.
            2. -
            3. If the system supports the concept of an "object reference" then -the Acceptor is responsible for adding its EPT -information (e.g., address information) to the object reference.
            4. -
            5. The Acceptor acts as a "listener" for client -connection requests.
            6. -
            7. When the Acceptor receives a connection request it -creates an EPT-specific Connection on which to receive -messages.
            8. -
            9. When Connection receives a message, it gives the raw -bits of the message to Acceptor which creates an -EPT-specific InputObject and calls -ProtocolHandler.handleRequest to determine the message -type.
            10. -
                -
              1. ProtocolHandler.handleRequest determines the - message type.
              2. -
              3. Suppose it is a request. In that case it would read enough - header information to give to Acceptor to get an - EPT-specific InputObject, - ServerRequestDispatcher and MessageMediator.
              4. -
              5. Control would then transfer to - ServerRequestDispatcher.dispatch.
              6. -
                  -
                1. ServerRequestDispatcher.dispatch uses header - information to obtain appropriate presentation block artifacts - (e.g., Ties, DSI handlers).
                2. -
                3. As an example, a Tie would be given the InputObject.
                4. -
                    -
                  1. The Tie would get the request data from the - InputObject and make it available to user - code.
                  2. -
                  3. In the case of a synchronous message, the Tie would ask the - ServerRequestDispatcher for an - OutputObject.
                  4. -
                      -
                    1. The ServerRequestDispatcher would use the - Acceptor as a factory to create the EPT-specific - OutputObject.
                    2. -
                    -
                  5. The Tie would set the response data (normal or error) on - the OutputObject.
                  6. -
                  -
                5. ServerRequestDispatcher.dispatch would send the - header and response data encoded in OutputObject on - the Connection.
                6. -
                -
              7. ServerRequestDispatcher.dispatch may clean up - any resources used in the invocation.
              8. -
              -
            - - -

            Initial ContactInfo and Acceptor Creation

            - -

            ContactInfo and Acceptor are the -factories for all other objects involved in a message for a particular -EPT. The question naturally arises, how are these created?

            - -
              -
            • From a tool reading service descriptions (e.g., WSDL).
            • -
            • By reading the contents of an object reference (e.g., CORBA IOR).
            • -
            • From a configuration file.
            • -
            - -

            Other PEPt Interfaces

            - -
              -
            • {@link com.sun.corba.se.pept.broker.Broker Broker} - A repository -of resources such as transport managers, thread pools, thread local -data structures, etc.
            • -
            - - - diff --git a/src/java.corba/share/classes/com/sun/corba/se/pept/protocol/ClientDelegate.java b/src/java.corba/share/classes/com/sun/corba/se/pept/protocol/ClientDelegate.java deleted file mode 100644 index 13649f6037f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/pept/protocol/ClientDelegate.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.pept.protocol; - -import com.sun.corba.se.pept.broker.Broker; -import com.sun.corba.se.pept.transport.ContactInfoList; - -/** - *

            The presentation block interacts with the PEPt architecture - * via the ClientDelegate.

            - * - * @author Harold Carr - */ -public interface ClientDelegate -{ - /** - * The {@link com.sun.corba.se.pept.broker.Broker Broker} associated - * with an invocation. - * - * @return {@link com.sun.corba.se.pept.broker.Broker Broker} - */ - public Broker getBroker(); - - /** - * Get the - * {@link com.sun.corba.se.pept.transport.ContactInfoList ContactInfoList} - * which represents they encoding/protocol/transport combinations that - * may be used to contact the service. - * - * @return - * {@link com.sun.corba.se.pept.transport.ContactInfoList ContactInfoList} - */ - public ContactInfoList getContactInfoList(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/pept/protocol/ClientInvocationInfo.java b/src/java.corba/share/classes/com/sun/corba/se/pept/protocol/ClientInvocationInfo.java deleted file mode 100644 index e1b0e2c4bdb..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/pept/protocol/ClientInvocationInfo.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.pept.protocol; - -import com.sun.corba.se.pept.protocol.MessageMediator; -import com.sun.corba.se.pept.protocol.ClientRequestDispatcher; -import java.util.Iterator; - -/** - * @author Harold Carr - */ -public interface ClientInvocationInfo -{ - public Iterator getContactInfoListIterator(); - - public void setContactInfoListIterator(Iterator contactInfoListIterator); - - public boolean isRetryInvocation(); - - public void setIsRetryInvocation(boolean isRetryInvocation); - - public int getEntryCount(); - - public void incrementEntryCount(); - - public void decrementEntryCount(); - - public void setClientRequestDispatcher(ClientRequestDispatcher clientRequestDispatcher); - - public ClientRequestDispatcher getClientRequestDispatcher(); - - public void setMessageMediator(MessageMediator messageMediator); - - public MessageMediator getMessageMediator(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/pept/protocol/ClientRequestDispatcher.java b/src/java.corba/share/classes/com/sun/corba/se/pept/protocol/ClientRequestDispatcher.java deleted file mode 100644 index 25db65befaa..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/pept/protocol/ClientRequestDispatcher.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.pept.protocol; - -import com.sun.corba.se.pept.broker.Broker; -import com.sun.corba.se.pept.encoding.InputObject; -import com.sun.corba.se.pept.encoding.OutputObject; -import com.sun.corba.se.pept.transport.ContactInfo; - -/** - * ClientRequestDispatcher coordinates the request (and possible - * response) processing for a specific protocol. - * - * @author Harold Carr - */ -public interface ClientRequestDispatcher -{ - /** - * At the beginning of a request the presentation block uses this - * to obtain an - * {@link com.sun.corba.se.pept.encoding.OutputObject OutputObject} - * to set data to be sent on a message. - * - * @param self - - * @param methodName - the remote method name - * @param isOneWay - true if the message is asynchronous - * @param contactInfo - the - * {@link com.sun.corba.se.pept.transport.ContactInfo ContactInfo} - * which which created/chose this ClientRequestDispatcher - * - * @return - * {@link com.sun.corba.se.pept.encoding.OutputObject OutputObject} - */ - public OutputObject beginRequest(Object self, - String methodName, - boolean isOneWay, - ContactInfo contactInfo); - - /** - * After the presentation block has set data on the - * {@link com.sun.corba.se.pept.encoding.OutputObject OutputObject} - * it signals the PEPt runtime to send the encoded data by calling this - * method. - * - * @param self - - * @param outputObject - * - * @return - * {@link com.sun.corba.se.pept.encoding.InputObject InputObject} - * if the message is synchronous. - * - * @throws - * {@link org.omg.CORBA.portable.ApplicationException ApplicationException} - * if the remote side raises an exception declared in the remote interface. - * - * @throws - * {@link org.omg.CORBA.portable.RemarshalException RemarshalException} - * if the PEPt runtime would like the presentation block to start over. - */ - public InputObject marshalingComplete(java.lang.Object self, - OutputObject outputObject) - // REVISIT EXCEPTIONS - throws - org.omg.CORBA.portable.ApplicationException, - org.omg.CORBA.portable.RemarshalException; - - /** - * After the presentation block completes a request it signals - * the PEPt runtime by calling this method. - * - * This method may release resources. In some cases it may cause - * control or error messages to be sent. - * - * @param broker - - * @param inputObject - - */ - public void endRequest(Broker broker, - java.lang.Object self, - InputObject inputObject); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/pept/protocol/MessageMediator.java b/src/java.corba/share/classes/com/sun/corba/se/pept/protocol/MessageMediator.java deleted file mode 100644 index 448014674b8..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/pept/protocol/MessageMediator.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.pept.protocol; - -import com.sun.corba.se.pept.broker.Broker; -import com.sun.corba.se.pept.encoding.InputObject; -import com.sun.corba.se.pept.encoding.OutputObject; -import com.sun.corba.se.pept.transport.Connection; -import com.sun.corba.se.pept.transport.ContactInfo; - -import java.io.IOException; - -/** - * MessageMediator is a central repository for artifacts - * associated with an individual message. - * - * @author Harold Carr - */ -public interface MessageMediator -{ - /** - * The {@link com.sun.corba.se.pept.broker.Broker Broker} associated - * with an invocation. - * - * @return {@link com.sun.corba.se.pept.broker.Broker Broker} - */ - public Broker getBroker(); - - /** - * Get the - * {@link com.sun.corba.se.pept.transport.ContactInfo ContactInfo} - * which created this MessageMediator. - * - * @return - * {@link com.sun.corba.se.pept.transport.ContactInfo ContactInfo} - */ - public ContactInfo getContactInfo(); - - /** - * Get the - * {@link com.sun.corba.se.pept.transport.Connection Connection} - * on which this message is sent or received. - */ - public Connection getConnection(); - - /** - * Used to initialize message headers. - * - * Note: this should be moved to a RequestDispatcher. - */ - public void initializeMessage(); - - /** - * Used to send the message (or its last fragment). - * - * Note: this should be moved to a RequestDispatcher. - */ - public void finishSendingRequest(); - - /** - * Used to wait for a response for synchronous messages. - * - * @deprecated - */ - @Deprecated - public InputObject waitForResponse(); - - /** - * Used to set the - * {@link com.sun.corba.se.pept.encoding.OutputObject OutputObject} - * used for the message. - * - * @param outputObject - */ - public void setOutputObject(OutputObject outputObject); - - /** - * Used to get the - * {@link com.sun.corba.se.pept.encoding.OutputObject OutputObject} - * used for the message. - * - * @return - * {@link com.sun.corba.se.pept.encoding.OutputObject OutputObject} - */ - public OutputObject getOutputObject(); - - /** - * Used to set the - * {@link com.sun.corba.se.pept.encoding.InputObject InputObject} - * used for the message. - * - * @param inputObject - */ - public void setInputObject(InputObject inputObject); - - /** - * Used to get the - * {@link com.sun.corba.se.pept.encoding.InputObject InputObject} - * used for the message. - * - * @return - * {@link com.sun.corba.se.pept.encoding.InputObject InputObject} - */ - public InputObject getInputObject(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/pept/protocol/ProtocolHandler.java b/src/java.corba/share/classes/com/sun/corba/se/pept/protocol/ProtocolHandler.java deleted file mode 100644 index a820fa3bc0b..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/pept/protocol/ProtocolHandler.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.pept.protocol; - -import com.sun.corba.se.pept.protocol.MessageMediator; - -/** - * ProtocolHandler is used to determine the - * type of an incoming message. - * - * @author Harold Carr - */ -public interface ProtocolHandler -{ - // REVISIT - return type - /** - * This method determines the type of an incoming message and - * dispatches it appropriately. - * - * For example, on the server side, it may find a - * {@link com.sun.corba.se.pept.protocol.ServerRequestDispatcher - * ServerRequestDispatcher} to handle the request. On the client-side - * it may signal a waiting thread to handle a reply. - * - * @return deprecated - */ - public boolean handleRequest(MessageMediator messageMediator); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/pept/protocol/ServerRequestDispatcher.java b/src/java.corba/share/classes/com/sun/corba/se/pept/protocol/ServerRequestDispatcher.java deleted file mode 100644 index 3677e3c7d44..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/pept/protocol/ServerRequestDispatcher.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.pept.protocol; - -import com.sun.corba.se.pept.protocol.MessageMediator; - -/** - * ServerRequestDispatcher coordinates the request (and possible - * response) processing for a specific protocol. - - * @author Harold Carr - */ -public interface ServerRequestDispatcher -{ - /** - * This method coordinates the processing of a message received - * on the server side. - * - * For example, this may involve finding an "object adapter" which - * would return Ties/Servants to handle the request. - */ - public void dispatch(MessageMediator messageMediator); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/Acceptor.java b/src/java.corba/share/classes/com/sun/corba/se/pept/transport/Acceptor.java deleted file mode 100644 index 16e69d09daf..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/Acceptor.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.pept.transport; - -import com.sun.corba.se.pept.broker.Broker; -import com.sun.corba.se.pept.protocol.MessageMediator; -import com.sun.corba.se.pept.encoding.InputObject; -import com.sun.corba.se.pept.encoding.OutputObject; -import com.sun.corba.se.pept.transport.Connection; -import com.sun.corba.se.pept.transport.EventHandler; - -/** - *

            The primary PEPt server-side plug-in point and enabler - * for altenate encodings, protocols and transports.

            - * - *

            Acceptor is a factory for client-side - * artifacts used to receive a message (and possibly send a response).

            - * - * @author Harold Carr - */ -public interface Acceptor -{ - /** - * Used to initialize an Acceptor. - * - * For example, initialization may mean to create a - * {@link java.nio.channels.ServerSocketChannel ServerSocketChannel}. - * - * Note: this must be prepared to be be called multiple times. - * - * @return true when it performs initializatin - * actions (typically the first call. - */ - public boolean initialize(); - - /** - * Used to determine if an Acceptor has been initialized. - * - * @return true if the Acceptor has been - * initialized. - */ - public boolean initialized(); - - /** - * PEPt uses separate caches for each type of Acceptor - * as given by getConnectionCacheType. - * - * @return {@link java.lang.String} - */ - public String getConnectionCacheType(); - - /** - * Set the - * {@link com.sun.corba.se.pept.transport.InboundConnectionCache InboundConnectionCache} - * to be used by this Acceptor. - * - * PEPt uses separate caches for each type of Acceptor - * as given by {@link #getConnectionCacheType}. - * {@link #setConnectionCache} and {@link #getConnectionCache} support - * an optimzation to avoid hashing to find that cache. - * - * @param connectionCache. - */ - public void setConnectionCache(InboundConnectionCache connectionCache); - - /** - * Get the - * {@link com.sun.corba.se.pept.transport.InboundConnectionCache InboundConnectionCache} - * used by this Acceptor - * - * PEPt uses separate caches for each type of Acceptor - * as given by {@link #getConnectionCacheType}. - * {@link #setConnectionCache} and {@link #getConnectionCache} support - * an optimzation to avoid hashing to find that cache. - * - * @return - * {@link com.sun.corba.se.pept.transport.ConnectionCache ConnectionCache} - */ - public InboundConnectionCache getConnectionCache(); - - /** - * Used to determine if the Acceptor should register - * with - * {@link com.sun.corba.se.pept.transport.Selector Selector} - * to handle accept events. - * - * For example, this may be false in the case of Solaris Doors - * which do not actively listen. - * - * @return true if the Acceptor should be - * registered with - * {@link com.sun.corba.se.pept.transport.Selector Selector} - */ - public boolean shouldRegisterAcceptEvent(); - - /** - * Accept a connection request. - * - * This is called either when the selector gets an accept event - * for this Acceptor or by a - * {@link com.sun.corba.se.pept.transport.ListenerThread ListenerThread}. - * - * It results in a - * {@link com.sun.corba.se.pept.transport.Connection Connection} - * being created. - */ - public void accept(); - - /** - * Close the Acceptor. - */ - public void close(); - - /** - * Get the - * {@link com.sun.corba.se.pept.transport.EventHandler EventHandler} - * associated with this Acceptor. - * - * @return - * {@link com.sun.corba.se.pept.transport.EventHandler EventHandler} - */ - public EventHandler getEventHandler(); - - // - // Factory methods - // - - // REVISIT: Identical to ContactInfo method. Refactor into base interface. - - /** - * Used to get a - * {@link com.sun.corba.se.pept.protocol.MessageMeidator MessageMediator} - * to hold internal data for a message received using the specific - * encoding, protocol, transport combination represented by this - * Acceptor. - * - * @return - * {@link com.sun.corba.se.pept.protocol.MessageMeidator MessageMediator} - */ - public MessageMediator createMessageMediator(Broker xbroker, - Connection xconnection); - - // REVISIT: Identical to ContactInfo method. Refactor into base interface. - - /** - * Used to finish creating a - * {@link com.sun.corba.se.pept.protocol.MessageMeidator MessageMediator} - * to with internal data for a message received using the specific - * encoding, protocol, transport combination represented by this - * Acceptor. - * - * @return - * {@link com.sun.corba.se.pept.protocol.MessageMediator MessageMediator} - */ - - public MessageMediator finishCreatingMessageMediator(Broker broker, - Connection xconnection, - MessageMediator messageMediator); - - /** - * Used to get a - * {@link com.sun.corba.se.pept.encoding.InputObject InputObject} - * for the specific encoding represented by this - * Acceptor. - * - * @return - * {@link com.sun.corba.se.pept.encoding.InputObject InputObject} - */ - public InputObject createInputObject(Broker broker, - MessageMediator messageMediator); - - /** - * Used to get a - * {@link com.sun.corba.se.pept.encoding.OutputObject OutputObject} - * for the specific encoding represented by this - * Acceptor. - * - * @return - * {@link com.sun.corba.se.pept.encoding.OutputObject OutputObject} - */ - public OutputObject createOutputObject(Broker broker, - MessageMediator messageMediator); - - // - // Usage dictates implementation equals and hashCode. - // -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/ByteBufferPool.java b/src/java.corba/share/classes/com/sun/corba/se/pept/transport/ByteBufferPool.java deleted file mode 100644 index 667f833e84d..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/ByteBufferPool.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.pept.transport; - -import java.nio.ByteBuffer; - -/** - * @author Charlie Hunt - */ -public interface ByteBufferPool -{ - public ByteBuffer getByteBuffer(int theSize); - public void releaseByteBuffer(ByteBuffer thebb); - public int activeCount(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/Connection.java b/src/java.corba/share/classes/com/sun/corba/se/pept/transport/Connection.java deleted file mode 100644 index be756bc3e09..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/Connection.java +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.pept.transport; - -import java.io.IOException; - -import com.sun.corba.se.pept.encoding.InputObject; -import com.sun.corba.se.pept.encoding.OutputObject; -import com.sun.corba.se.pept.protocol.MessageMediator; -import com.sun.corba.se.pept.transport.EventHandler; - - -/** - *

            Connection represents a transport in the - * PEPt architecture.

            - * - * @author Harold Carr -*/ -public interface Connection -{ - /** - * Used to determine if the Connection should register - * with the - * {@link com.sun.corba.se.pept.transport.TransportManager - * TransportManager} - * {@link com.sun.corba.se.pept.transport.Selector Selector} - * to handle read events. - * - * For example, an HTTP transport would not register since the requesting - * thread would just block on read when waiting for the reply. - * - * @return true if it should be registered. - */ - public boolean shouldRegisterReadEvent(); - - /** - * Used to determine if the Connection should register - * with the - * {@link com.sun.corba.se.pept.transport.TransportManager - * TransportManager} - * {@link com.sun.corba.se.pept.transport.Selector Selector} - * to handle read events. - * - * For example, an HTTP transport would not register since the requesting - * thread would just block on read when waiting for the reply. - * - * @return true if it should be registered. - */ - public boolean shouldRegisterServerReadEvent(); // REVISIT - why special? - - /** - * Called to read incoming messages. - * - * @return true if the thread calling read can be released. - */ - public boolean read(); - - /** - * Close the Connection. - * - */ - public void close(); - - // REVISIT: replace next two with PlugInFactory (implemented by ContactInfo - // and Acceptor). - - /** - * Get the - * {@link com.sun.corba.se.pept.transport.Acceptor Acceptor} - * that created this Connection. - * - * @return - * {@link com.sun.corba.se.pept.transport.Acceptor Acceptor} - */ - public Acceptor getAcceptor(); - - /** - * Get the - * {@link com.sun.corba.se.pept.transport.ContactInfo ContactInfo} - * that created this Connection. - * - * @return - * {@link com.sun.corba.se.pept.transport.ContactInfo ContactInfo} - */ - public ContactInfo getContactInfo(); - - /** - * Get the - * {@link com.sun.corba.se.pept.transport.EventHandler EventHandler} - * associated with this Acceptor. - * - * @return - * {@link com.sun.corba.se.pept.transport.EventHandler EventHandler} - */ - public EventHandler getEventHandler(); - - /** - * Indicates whether a - * {@link com.sun.corba.se.pept.transport.ContactInfo ContactInfo} - * or a - * {@link com.sun.corba.se.pept.transport.Acceptor Acceptor} - * created the - * Connection. - * - * @return true if Connection an - * {@link com.sun.corba.se.pept.transport.Acceptor Acceptor} - * created the Connection. - */ - public boolean isServer(); - - /** - * Indicates if the Connection is in the process of - * sending or receiving a message. - * - * @return true if the Connection is busy. - */ - public boolean isBusy(); - - /** - * Timestamps are used for connection management, in particular, for - * reclaiming idle Connections. - * - * @return the "time" the Connection was last used. - */ - public long getTimeStamp(); - - /** - * Timestamps are used for connection management, in particular, for - * reclaiming idle Connections. - * - * @param time - the "time" the Connection was last used. - */ - public void setTimeStamp(long time); - - /** - * The "state" of the Connection. - * - * param state - */ - public void setState(String state); - - /** - * Grab a write lock on the Connection. - * - * If another thread already has a write lock then the calling - * thread will block until the lock is released. The calling - * thread must call - * {@link #writeUnlock} - * when it is done. - */ - public void writeLock(); - - /** - * Release a write lock on the Connection. - */ - public void writeUnlock(); - - /* - * Send the data encoded in - * {@link com.sun.corba.se.pept.encoding.OutputObject OutputObject} - * on the Connection. - * - * @param outputObject - */ - public void sendWithoutLock(OutputObject outputObject); - - /** - * Register an invocation's - * {@link com.sun.corba.se.pept.protocol.MessageMediator MessageMediator} - * with the Connection. - * - * This is useful in protocols which support fragmentation. - * - * @param messageMediator - */ - public void registerWaiter(MessageMediator messageMediator); - - /** - * If a message expect's a response then this method is called. - * - * This method might block on a read (e.g., HTTP), put the calling - * thread to sleep while another thread read's the response (e.g., GIOP), - * or it may use the calling thread to perform the server-side work - * (e.g., Solaris Doors). - * - * @param messageMediator - */ - public InputObject waitForResponse(MessageMediator messageMediator); - - /** - * Unregister an invocation's - * {@link com.sun.corba.se.pept.protocol.MessageMediator MessageMediator} - * with the Connection. - * - * @param messageMediator - */ - public void unregisterWaiter(MessageMediator messageMediator); - - public void setConnectionCache(ConnectionCache connectionCache); - - public ConnectionCache getConnectionCache(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/ConnectionCache.java b/src/java.corba/share/classes/com/sun/corba/se/pept/transport/ConnectionCache.java deleted file mode 100644 index 7d32050a909..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/ConnectionCache.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.pept.transport; - -/** - * @author Harold Carr - */ -public interface ConnectionCache -{ - public String getCacheType(); - - public void stampTime(Connection connection); - - public long numberOfConnections(); - - public long numberOfIdleConnections(); - - public long numberOfBusyConnections(); - - public boolean reclaim(); - - /** Close all connections in the connection cache. - * This is used as a final cleanup, and will result - * in abrupt termination of any pending communications. - */ - public void close(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/ContactInfo.java b/src/java.corba/share/classes/com/sun/corba/se/pept/transport/ContactInfo.java deleted file mode 100644 index 5e50a23af49..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/ContactInfo.java +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.pept.transport; - -import com.sun.corba.se.pept.broker.Broker; -import com.sun.corba.se.pept.encoding.InputObject; -import com.sun.corba.se.pept.encoding.OutputObject; -import com.sun.corba.se.pept.protocol.MessageMediator; -import com.sun.corba.se.pept.protocol.ClientRequestDispatcher; -import com.sun.corba.se.pept.transport.ConnectionCache; - -/** - *

            The primary PEPt client-side plug-in point and enabler - * for altenate encodings, protocols and transports.

            - * - *

            ContactInfo is a factory for client-side - * artifacts used - * to construct and send a message (and possibly receive and process a - * response).

            - * - * @author Harold Carr - */ -public interface ContactInfo -{ - /** - * The {@link com.sun.corba.se.pept.broker.Broker Broker} associated - * with an invocation. - * - * @return {@link com.sun.corba.se.pept.broker.Broker Broker} - */ - public Broker getBroker(); - - /** - * The parent - * {@link com.sun.corba.se.pept.broker.ContactInfoList ContactInfoList} - * for this ContactInfo. - * - * @return - * {@link com.sun.corba.se.pept.broker.ContactInfoList ContactInfoList} - */ - public ContactInfoList getContactInfoList(); - - /** - * Used to get a - * {@link com.sun.corba.se.pept.protocol.ClientRequestDispatcher - * ClientRequestDispatcher} - * used to handle the specific protocol represented by this - * ContactInfo. - * - * @return - * {@link com.sun.corba.se.pept.protocol.ClientRequestDispatcher - * ClientRequestDispatcher} */ - public ClientRequestDispatcher getClientRequestDispatcher(); - - /** - * Used to determine if a - * {@link com.sun.corba.se.pept.transport.Connection Connection} - * will be present in an invocation. - * - * For example, it may be - * false in the case of shared-memory - * Input/OutputObjects. - * - * @return true if a - * {@link com.sun.corba.se.pept.transport.Connection Connection} - * will be used for an invocation. - */ - public boolean isConnectionBased(); - - /** - * Used to determine if the - * {@link com.sun.corba.se.pept.transport.Connection Connection} - * used for a request should be cached. - * - * If true then PEPt will attempt to reuse an existing - * {@link com.sun.corba.se.pept.transport.Connection Connection}. If - * one is not found it will create a new one and cache it for future use. - * - * - * @return true if - * {@link com.sun.corba.se.pept.transport.Connection Connection}s - * created by this ContactInfo should be cached. - */ - public boolean shouldCacheConnection(); - - /** - * PEPt uses separate caches for each type of ContactInfo - * as given by getConnectionCacheType. - * - * @return {@link java.lang.String} - */ - public String getConnectionCacheType(); - - /** - * Set the - * {@link com.sun.corba.se.pept.transport.Outbound.ConnectionCache OutboundConnectionCache} - * to be used by this ContactInfo. - * - * PEPt uses separate caches for each type of ContactInfo - * as given by {@link #getConnectionCacheType}. - * {@link #setConnectionCache} and {@link #getConnectionCache} support - * an optimzation to avoid hashing to find that cache. - * - * @param connectionCache. - */ - public void setConnectionCache(OutboundConnectionCache connectionCache); - - /** - * Get the - * {@link com.sun.corba.se.pept.transport.Outbound.ConnectionCache OutboundConnectionCache} - * used by this ContactInfo - * - * PEPt uses separate caches for each type of ContactInfo - * as given by {@link #getConnectionCacheType}. - * {@link #setConnectionCache} and {@link #getConnectionCache} support - * an optimzation to avoid hashing to find that cache. - * - * @return - * {@link com.sun.corba.se.pept.transport.ConnectionCache ConnectionCache} - */ - public OutboundConnectionCache getConnectionCache(); - - /** - * Used to get a - * {@link com.sun.corba.se.pept.transport.Connection Connection} - * to send and receive messages on the specific transport - * represented by this ContactInfo. - * - * @return - * {@link com.sun.corba.se.pept.transport.Connection Connection} - */ - public Connection createConnection(); - - /** - * Used to get a - * {@link com.sun.corba.se.pept.protocol.MessageMeidator MessageMediator} - * to hold internal data for a message to be sent using the specific - * encoding, protocol, transport combination represented by this - * ContactInfo. - * - * @return - * {@link com.sun.corba.se.pept.protocol.MessageMediator MessageMediator} - */ - public MessageMediator createMessageMediator(Broker broker, - ContactInfo contactInfo, - Connection connection, - String methodName, - boolean isOneWay); - - /** - * Used to get a - * {@link com.sun.corba.se.pept.protocol.MessageMeidator MessageMediator} - * to hold internal data for a message received using the specific - * encoding, protocol, transport combination represented by this - * ContactInfo. - * - * @return - * {@link com.sun.corba.se.pept.protocol.MessageMeidator MessageMediator} - */ - public MessageMediator createMessageMediator(Broker broker, - Connection connection); - - /** - * Used to finish creating a - * {@link com.sun.corba.se.pept.protocol.MessageMeidator MessageMediator} - * with internal data for a message received using the specific - * encoding, protocol, transport combination represented by this - * ContactInfo. - * - * @return - * {@link com.sun.corba.se.pept.protocol.MessageMediator MessageMediator} - */ - public MessageMediator finishCreatingMessageMediator(Broker broker, - Connection connection, - MessageMediator messageMediator); - - /** - * Used to get a - * {@link com.sun.corba.se.pept.encoding.InputObject InputObject} - * for the specific encoding represented by this - * ContactInfo. - * - * @return - * {@link com.sun.corba.se.pept.encoding.InputObject InputObject} - */ - public InputObject createInputObject(Broker broker, - MessageMediator messageMediator); - - /** - * Used to get a - * {@link com.sun.corba.se.pept.encoding.OutputObject OutputObject} - * for the specific encoding represented by this - * ContactInfo. - * - * @return - * {@link com.sun.corba.se.pept.encoding.OutputObject OutputObject} - */ - public OutputObject createOutputObject(MessageMediator messageMediator); - - /** - * Used to lookup artifacts associated with this ContactInfo. - * - * @return the hash value. - */ - public int hashCode(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/ContactInfoList.java b/src/java.corba/share/classes/com/sun/corba/se/pept/transport/ContactInfoList.java deleted file mode 100644 index f5448b9a5f3..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/ContactInfoList.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.pept.transport; - -import java.util.Iterator; - -/** - *

            ContactInfoList contains one or more - * {@link com.sun.corba.se.pept.transport.ContactInfo ContactInfo}. - * - * @author Harold Carr - */ -public interface ContactInfoList -{ - /** - * Used to get a - * {@link com.sun.corba.se.pept.transport.ContactInfoListIterator - * ContactInfoListIterator} to retrieve individual - * {@link com.sun.corba.se.pept.transport.ContactInfo ContactInfo} - * from the list. - * - * @return A - * {@link com.sun.corba.se.pept.transport.ContactInfoListIterator - * ContactInfoListIterator}. - */ - public Iterator iterator(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/ContactInfoListIterator.java b/src/java.corba/share/classes/com/sun/corba/se/pept/transport/ContactInfoListIterator.java deleted file mode 100644 index 445bc42d783..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/ContactInfoListIterator.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.pept.transport; - -import java.util.Iterator; - -/** - * ContactInfoIterator is used to retrieve individual - * {@link com.sun.corba.se.pept.transport.ContactInfo ContactInfo}. - * - * @author Harold Carr - */ -public interface ContactInfoListIterator - extends - Iterator -{ - /** - * The underlying list for this iterator. - * - * @return The underlying list for this iterator. - */ - public ContactInfoList getContactInfoList(); - - /** - * Used to report information to the iterator to be used - * in future invocations. - * - * @param contactInfo The - * {@link com.sun.corba.se.pept.transport.ContactInfo ContactInfo} - * obtained from this iterator which resulted in a successful invocation. - */ - public void reportSuccess(ContactInfo contactInfo); - - /** - * Used to report information to the iterator to be used - * in future invocations. - * - * @param contactInfo The - * {@link com.sun.corba.se.pept.transport.ContactInfo ContactInfo} - * in effect when an invocation exception occurs. - * @param exception The - * {@link java.lang.RuntimeException RuntimeException}. - * - * @return Returns true if the request should be retried. - */ - public boolean reportException(ContactInfo contactInfo, - RuntimeException exception); - - /** - * The exception to report to the presentation block. - * - * @return If the iterator reaches the end before the invocation - * is successful one returns this exception (previously reported to - * the iterator via {@link #reportException}). - - */ - public RuntimeException getFailureException(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/EventHandler.java b/src/java.corba/share/classes/com/sun/corba/se/pept/transport/EventHandler.java deleted file mode 100644 index f79cd5f117f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/EventHandler.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.pept.transport; - -import java.nio.channels.SelectableChannel; -import java.nio.channels.SelectionKey; - -import com.sun.corba.se.spi.orbutil.threadpool.Work; - -/** - * @author Harold Carr - * - * This should only be registered with ONE selector. - */ -public interface EventHandler -{ - public void setUseSelectThreadToWait(boolean x); - public boolean shouldUseSelectThreadToWait(); - - public SelectableChannel getChannel(); - - public int getInterestOps(); - - public void setSelectionKey(SelectionKey selectionKey); - public SelectionKey getSelectionKey(); - - public void handleEvent(); - - // NOTE: if there is more than one interest op this does not - // allow discrimination between different ops and how threading - // is handled. - public void setUseWorkerThreadForEvent(boolean x); - public boolean shouldUseWorkerThreadForEvent(); - - public void setWork(Work work); - public Work getWork(); - - // REVISIT: need base class with two derived. - public Acceptor getAcceptor(); - public Connection getConnection(); - -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/InboundConnectionCache.java b/src/java.corba/share/classes/com/sun/corba/se/pept/transport/InboundConnectionCache.java deleted file mode 100644 index 3aee07176d7..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/InboundConnectionCache.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.pept.transport; - -/** - * @author Harold Carr - */ -public interface InboundConnectionCache - extends ConnectionCache -{ - public Connection get(Acceptor acceptor); // REVISIT - - public void put(Acceptor acceptor, Connection connection); - - public void remove(Connection connection); - - public Acceptor getAcceptor(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/ListenerThread.java b/src/java.corba/share/classes/com/sun/corba/se/pept/transport/ListenerThread.java deleted file mode 100644 index 18aa9a243a7..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/ListenerThread.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.pept.transport; - -/** - * @author Harold Carr - */ -public interface ListenerThread -{ - public Acceptor getAcceptor(); - public void close(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/OutboundConnectionCache.java b/src/java.corba/share/classes/com/sun/corba/se/pept/transport/OutboundConnectionCache.java deleted file mode 100644 index e72ddbbe564..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/OutboundConnectionCache.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.pept.transport; - -/** - * @author Harold Carr - */ -public interface OutboundConnectionCache - extends ConnectionCache -{ - public Connection get(ContactInfo contactInfo); - - public void put(ContactInfo contactInfo, Connection connection); - - public void remove(ContactInfo contactInfo); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/ReaderThread.java b/src/java.corba/share/classes/com/sun/corba/se/pept/transport/ReaderThread.java deleted file mode 100644 index d1fd2a70015..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/ReaderThread.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.pept.transport; - -/** - * @author Harold Carr - */ -public interface ReaderThread { - public Connection getConnection(); - public void close(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/ResponseWaitingRoom.java b/src/java.corba/share/classes/com/sun/corba/se/pept/transport/ResponseWaitingRoom.java deleted file mode 100644 index 51573f52f06..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/ResponseWaitingRoom.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.pept.transport; - -import com.sun.corba.se.pept.protocol.MessageMediator; -import com.sun.corba.se.pept.encoding.InputObject; - -/** - * @author Harold Carr - */ -public interface ResponseWaitingRoom -{ - public void registerWaiter(MessageMediator messageMediator); - - // REVISIT: maybe return void (or MessageMediator). - public InputObject waitForResponse(MessageMediator messageMediator); - - public void responseReceived(InputObject inputObject); - - public void unregisterWaiter(MessageMediator messageMediator); - - public int numberRegistered(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/Selector.java b/src/java.corba/share/classes/com/sun/corba/se/pept/transport/Selector.java deleted file mode 100644 index dbd54d38df6..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/Selector.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.pept.transport; - -/** - * @author Harold Carr - */ -public interface Selector -{ - public void setTimeout(long timeout); - public long getTimeout(); - public void registerInterestOps(EventHandler eventHandler); - public void registerForEvent(EventHandler eventHander); - public void unregisterForEvent(EventHandler eventHandler); - public void close(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/TransportManager.java b/src/java.corba/share/classes/com/sun/corba/se/pept/transport/TransportManager.java deleted file mode 100644 index f6240d56de7..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/pept/transport/TransportManager.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.pept.transport; - -import java.util.Collection; - -import com.sun.corba.se.pept.transport.Acceptor; -import com.sun.corba.se.pept.transport.ByteBufferPool; -import com.sun.corba.se.pept.transport.ConnectionCache; -import com.sun.corba.se.pept.transport.Selector; - -/** - * @author Harold Carr - */ -public interface TransportManager -{ - public ByteBufferPool getByteBufferPool(int id); - - public OutboundConnectionCache getOutboundConnectionCache( - ContactInfo contactInfo); - - public Collection getOutboundConnectionCaches(); - - public InboundConnectionCache getInboundConnectionCache(Acceptor acceptor); - - public Collection getInboundConnectionCaches(); - - public Selector getSelector(int id); - - public void registerAcceptor(Acceptor acceptor); - - public Collection getAcceptors(); - - public void unregisterAcceptor(Acceptor acceptor); - - public void close(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/activation/activation.idl b/src/java.corba/share/classes/com/sun/corba/se/spi/activation/activation.idl deleted file mode 100644 index 3d58a29d51e..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/activation/activation.idl +++ /dev/null @@ -1,305 +0,0 @@ -/* - * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -// - -module activation { - // Possible values for endpointType argument on Server.getEndpoint() - // If you change the value of this constant then update - // core.EndPoint accordingly. It has a duplicate definition - // to avoid a compilation dependency. - const string IIOP_CLEAR_TEXT = "IIOP_CLEAR_TEXT"; - - // REVISIT Use the CORBA 2.3 ORBid if we ever get the Java ORB ID - // issue resolved. - typedef string ORBid; - typedef long ServerId ; - typedef sequence POAName ; - - /** Raised if getEndpoint is called on a server callback object for - * an invalid endpoint type - */ - exception NoSuchEndPoint {} ; - - /** - * Raised if an attempt is made to retrieve ports corresponding to - * non-registered ORB - */ - - exception InvalidORBid {} ; - - /** Raised if an operation is attempted against an invalid server ID. - */ - exception ServerNotRegistered { - ServerId serverId ; - }; - - /** Raised if an operation is attempted for a server that is not running, - * and the server is required to be running for the operation. - */ - exception ServerNotActive { - ServerId serverId ; - }; - - /** Raised if an operation is attempted against a server that is in a - * hold down state. A server becomes held down if it fails to activate - * within 10 seconds. - */ - exception ServerHeldDown { - ServerId serverId ; - }; - - /** Raised if an attempt is made to activate a server that is already - * running. - */ - exception ServerAlreadyActive{ - ServerId serverId ; - }; - - /** Raised if an attempt is made to register a serverdef with the - * same applicationName as an existing serverdef. - */ - exception ServerAlreadyRegistered { - ServerId serverId; - }; - - /** Raised if an attempt is made to install a server that is currently - * installed. Note that a newly created server starts out in an uninstalled - * state. - */ - exception ServerAlreadyInstalled { - ServerId serverId; - } ; - - /** Raised if an attempt is made to uninstall a server that is currently - * uninstalled. Note that a newly created server starts out in an - * uninstalled - * state. - */ - exception ServerAlreadyUninstalled { - ServerId serverId; - } ; - - /** Raised if an attempt is made to register an invalid serverdef. - */ - exception BadServerDefinition { - string reason; - }; - - /** Raised if an attempt is made to register endpoints for the - * same ORB again - */ - exception ORBAlreadyRegistered { - ORBid orbId; - }; - - typedef long TCPPort ; - typedef sequence ServerIds; - - // passing a struct containing endpointType and port-#s - struct EndPointInfo { - string endpointType; - TCPPort port; - }; - - typedef sequence EndpointInfoList; - - // struct contain ORB and port info - struct ORBPortInfo { - ORBid orbId; - TCPPort port; - }; - - typedef sequence ORBPortInfoList; - - typedef sequence ORBidList; - - /** Server callback API, passed to Activator in active method. - */ - interface Server { - /** Shutdown this server. Returns after orb.shutdown() completes. - */ - void shutdown(); - - /** Install the server. Returns after the install hook completes - * execution in the server. - */ - void install(); - - /** Uninstall the server. Returns after the uninstall hook - * completes execution. - */ - void uninstall(); - }; - - interface Activator { - // A new ORB started server registers itself with the Activator - void active(in ServerId serverId, in Server serverObj) - raises (ServerNotRegistered); - - // Install a particular kind of endpoint - void registerEndpoints( in ServerId serverId, in ORBid orbId, - in EndpointInfoList endPointInfo) - raises (ServerNotRegistered,NoSuchEndPoint, ORBAlreadyRegistered) ; - - // list active servers - ServerIds getActiveServers(); - - // If the server is not running, start it up. - void activate(in ServerId serverId) - raises (ServerAlreadyActive, ServerNotRegistered, ServerHeldDown); - - // If the server is running, shut it down - void shutdown(in ServerId serverId) - raises (ServerNotActive, ServerNotRegistered); - - // Invoke the server install hook. If the server is not - // currently running, this method will activate it. - void install(in ServerId serverId) - raises (ServerNotRegistered, ServerHeldDown, - ServerAlreadyInstalled); - - // list all registered ORBs for a server - ORBidList getORBNames(in ServerId serverId) - raises (ServerNotRegistered); - - // Invoke the server uninstall hook. If the server is not - // currently running, this method will activate it. - // After this hook completes, the server may still be running. - void uninstall(in ServerId serverId) - raises (ServerNotRegistered, ServerHeldDown, - ServerAlreadyUninstalled); - }; - - interface Locator { - - // struct to return the list of endpoints for a server for a specific - // endpoint - struct ServerLocation { - string hostname; - ORBPortInfoList ports; - }; - - // struct to return the list of endpoints for a server for a specific - // ORB - struct ServerLocationPerORB { - string hostname; - EndpointInfoList ports; - }; - - // locate server - returns the port with a specific type for all registered - // ORBs of an active server. - // Starts the server if it is not already running. - ServerLocation locateServer( - in ServerId serverId, - in string endPoint) - raises(NoSuchEndPoint, ServerNotRegistered, ServerHeldDown); - - // locate server - returns all ports registered with a specified ORB for - // an active server - // Starts the server if it is not already running. - ServerLocationPerORB locateServerForORB( - in ServerId serverId, - in ORBid orbId) - raises(InvalidORBid, ServerNotRegistered, ServerHeldDown); - - // get the port for the endpoint of the locator - TCPPort getEndpoint(in string endPointType) - raises(NoSuchEndPoint); - - // Useful from external BadServerIdHandlers which need - // to pick a particular port type. - TCPPort getServerPortForType( - in ServerLocationPerORB location, - in string endPointType) - raises(NoSuchEndPoint); - }; - - interface ServerManager : Activator, Locator { }; - - interface InitialNameService { - exception NameAlreadyBound {}; - - // bind initial name - void bind ( - in string name, - in Object obj, - in boolean isPersistant) raises (NameAlreadyBound); - - }; - - interface Repository { - // server program definition. We should make this a ValueType. - struct ServerDef { - string applicationName; // alias used for servers with identical - // serverName values. - string serverName; // Class name of server's main class. - string serverClassPath; // class path used to run the server. - string serverArgs; - string serverVmArgs; - }; - - // register server definition - // This returns the serverId of the server. A newly created server is - // always uninstalled. - ServerId registerServer (in ServerDef serverDef) - raises (ServerAlreadyRegistered, BadServerDefinition); - - // unregister server definition - void unregisterServer (in ServerId serverId) - raises (ServerNotRegistered); - - // get server definition - ServerDef getServer(in ServerId serverId) - raises (ServerNotRegistered); - - // Return whether the server has been installed - boolean isInstalled( in ServerId serverId ) - raises (ServerNotRegistered); - - // Mark the server as being installed. Raises ServerAlreadyInstalled - // if the server is currently marked as installed. - void install( in ServerId serverId ) - raises (ServerNotRegistered, ServerAlreadyInstalled) ; - - // Mark the server as being uninstalled. Raises ServerAlreadyUninstalled - // if the server is currently marked as uninstalled. - void uninstall( in ServerId serverId ) - raises (ServerNotRegistered, ServerAlreadyUninstalled) ; - - // list registered servers - ServerIds listRegisteredServers (); - - typedef sequence StringSeq ; - - // Returns list of ALL applicationNames defined in ServerDefs of registered - // servers. - StringSeq getApplicationNames(); - - // Find the ServerID associated with the given application name. - ServerId getServerID( in string applicationName ) - raises (ServerNotRegistered) ; - }; -}; diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/copyobject/CopierManager.java b/src/java.corba/share/classes/com/sun/corba/se/spi/copyobject/CopierManager.java deleted file mode 100644 index abae75e81e9..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/copyobject/CopierManager.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.copyobject ; - -/** Manager of ObjectCopier implementations used to support javax.rmi.CORBA.Util.copyObject(s). - * This provides simple methods for registering all supported ObjectCopier factories. - * A default copier is also supported, for use in contexts where no specific copier id - * is available. - */ -public interface CopierManager -{ - /** Set the Id of the copier to use if no other copier has been set. - */ - void setDefaultId( int id ) ; - - /** Return the copier for the default copier id. Throws a BAD_PARAM exception - * if no default copier id has been set. - */ - int getDefaultId() ; - - ObjectCopierFactory getObjectCopierFactory( int id ) ; - - ObjectCopierFactory getDefaultObjectCopierFactory() ; - - /** Register an ObjectCopierFactory under a particular id. This can be retrieved - * later by getObjectCopierFactory. - */ - void registerObjectCopierFactory( ObjectCopierFactory factory, int id ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/copyobject/CopyobjectDefaults.java b/src/java.corba/share/classes/com/sun/corba/se/spi/copyobject/CopyobjectDefaults.java deleted file mode 100644 index 1c58e6ed8f3..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/copyobject/CopyobjectDefaults.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.copyobject ; - -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.impl.copyobject.ReferenceObjectCopierImpl ; -import com.sun.corba.se.impl.copyobject.FallbackObjectCopierImpl ; -import com.sun.corba.se.impl.copyobject.ORBStreamObjectCopierImpl ; -import com.sun.corba.se.impl.copyobject.JavaStreamObjectCopierImpl ; - -public abstract class CopyobjectDefaults -{ - private CopyobjectDefaults() { } - - /** Obtain the ORB stream copier factory. Note that this version behaves differently - * than the others: each ObjectCopier produced by the factory only preserves aliasing - * within a single call to copy. The others copiers all preserve aliasing across - * all calls to copy (on the same ObjectCopier instance). - */ - public static ObjectCopierFactory makeORBStreamObjectCopierFactory( final ORB orb ) - { - return new ObjectCopierFactory() { - public ObjectCopier make( ) - { - return new ORBStreamObjectCopierImpl( orb ) ; - } - } ; - } - - public static ObjectCopierFactory makeJavaStreamObjectCopierFactory( final ORB orb ) - { - return new ObjectCopierFactory() { - public ObjectCopier make( ) - { - return new JavaStreamObjectCopierImpl( orb ) ; - } - } ; - } - - private static final ObjectCopier referenceObjectCopier = new ReferenceObjectCopierImpl() ; - - private static ObjectCopierFactory referenceObjectCopierFactory = - new ObjectCopierFactory() { - public ObjectCopier make() - { - return referenceObjectCopier ; - } - } ; - - /** Obtain the reference object "copier". This does no copies: it just - * returns whatever is passed to it. - */ - public static ObjectCopierFactory getReferenceObjectCopierFactory() - { - return referenceObjectCopierFactory ; - } - - /** Create a fallback copier factory from the two ObjectCopierFactory - * arguments. This copier makes an ObjectCopierFactory that creates - * instances of a fallback copier that first tries an ObjectCopier - * created from f1, then tries one created from f2, if the first - * throws a ReflectiveCopyException. - */ - public static ObjectCopierFactory makeFallbackObjectCopierFactory( - final ObjectCopierFactory f1, final ObjectCopierFactory f2 ) - { - return new ObjectCopierFactory() { - public ObjectCopier make() - { - ObjectCopier c1 = f1.make() ; - ObjectCopier c2 = f2.make() ; - return new FallbackObjectCopierImpl( c1, c2 ) ; - } - } ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/copyobject/ObjectCopier.java b/src/java.corba/share/classes/com/sun/corba/se/spi/copyobject/ObjectCopier.java deleted file mode 100644 index 8df549143e7..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/copyobject/ObjectCopier.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.copyobject ; - -/** Provides an interface for a variety of means to copy an arbitrary - * object. Any implementation of this interface must return an exact - * copy of obj, preserving all aliasing across all objects reachable - * from obj. ReflectiveCopyException must be thrown if the implementation - * cannot copy obj for some reason. Note that a trivial implementation - * of this interface is possible (always return obj), but this is often - * not the desired implementation. - */ -public interface ObjectCopier { - Object copy( Object obj ) throws ReflectiveCopyException ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/copyobject/ObjectCopierFactory.java b/src/java.corba/share/classes/com/sun/corba/se/spi/copyobject/ObjectCopierFactory.java deleted file mode 100644 index e0f398ebeaa..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/copyobject/ObjectCopierFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.copyobject ; - -import com.sun.corba.se.spi.orb.ORB ; - -/** ObjectCopier factory interface used for registration. - */ -public interface ObjectCopierFactory { - /** Create a new instance of an ObjectCopier. - */ - ObjectCopier make() ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/copyobject/ReflectiveCopyException.java b/src/java.corba/share/classes/com/sun/corba/se/spi/copyobject/ReflectiveCopyException.java deleted file mode 100644 index 86d55168994..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/copyobject/ReflectiveCopyException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.spi.copyobject ; - -public class ReflectiveCopyException extends Exception { - public ReflectiveCopyException() - { - super() ; - } - - public ReflectiveCopyException( String msg ) - { - super( msg ) ; - } - - public ReflectiveCopyException( String msg, Throwable t ) - { - super( msg, t ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/encoding/CorbaInputObject.java b/src/java.corba/share/classes/com/sun/corba/se/spi/encoding/CorbaInputObject.java deleted file mode 100644 index 2bac77ac1de..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/encoding/CorbaInputObject.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.encoding ; - -import com.sun.corba.se.impl.encoding.CDRInputStream ; -import com.sun.corba.se.pept.encoding.InputObject ; - -public abstract class CorbaInputObject - extends CDRInputStream - implements InputObject -{ -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/encoding/CorbaOutputObject.java b/src/java.corba/share/classes/com/sun/corba/se/spi/encoding/CorbaOutputObject.java deleted file mode 100644 index 152fe821ecb..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/encoding/CorbaOutputObject.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.encoding ; - -import com.sun.corba.se.pept.encoding.OutputObject ; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.transport.CorbaConnection; - -import com.sun.corba.se.impl.encoding.CDROutputStream ; -import com.sun.corba.se.impl.encoding.BufferManagerWrite ; - - -public abstract class CorbaOutputObject - extends CDROutputStream - implements OutputObject -{ - public CorbaOutputObject( - ORB orb, GIOPVersion version, byte encodingVersion, - boolean littleEndian, BufferManagerWrite bufferManager, - byte streamFormatVersion, boolean usePooledByteBuffers) - { - super(orb, version, encodingVersion, littleEndian, bufferManager, - streamFormatVersion, usePooledByteBuffers); - } - - public abstract void writeTo(CorbaConnection connection) - throws java.io.IOException; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/extension/CopyObjectPolicy.java b/src/java.corba/share/classes/com/sun/corba/se/spi/extension/CopyObjectPolicy.java deleted file mode 100644 index 59f4ff6b8ee..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/extension/CopyObjectPolicy.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.extension ; - -import org.omg.CORBA.Policy ; -import org.omg.CORBA.LocalObject ; -import com.sun.corba.se.impl.orbutil.ORBConstants ; - -/** Policy used to specify the copyObject implementation to use. -*/ -public class CopyObjectPolicy extends LocalObject implements Policy -{ - private final int value ; - - public CopyObjectPolicy( int value ) - { - this.value = value ; - } - - public int getValue() - { - return value ; - } - - public int policy_type () - { - return ORBConstants.COPY_OBJECT_POLICY ; - } - - public org.omg.CORBA.Policy copy () - { - return this ; - } - - public void destroy () - { - // NO-OP - } - - public String toString() - { - return "CopyObjectPolicy[" + value + "]" ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/extension/RequestPartitioningPolicy.java b/src/java.corba/share/classes/com/sun/corba/se/spi/extension/RequestPartitioningPolicy.java deleted file mode 100644 index 10cf9f85e74..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/extension/RequestPartitioningPolicy.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.extension ; - -import org.omg.CORBA.Policy ; -import org.omg.CORBA.LocalObject ; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; - -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; -import com.sun.corba.se.impl.orbutil.ORBConstants ; - -/** Policy used to support the request partitioning feature and to - * specify the partition to use. -*/ -public class RequestPartitioningPolicy extends LocalObject implements Policy -{ - private static ORBUtilSystemException wrapper = - ORBUtilSystemException.get( CORBALogDomains.OA_IOR ) ; - public final static int DEFAULT_VALUE = 0; - private final int value; - - public RequestPartitioningPolicy( int value ) - { - if (value < ORBConstants.REQUEST_PARTITIONING_MIN_THREAD_POOL_ID || - value > ORBConstants.REQUEST_PARTITIONING_MAX_THREAD_POOL_ID) { - throw wrapper.invalidRequestPartitioningPolicyValue( - new Integer(value), - new Integer( - ORBConstants.REQUEST_PARTITIONING_MIN_THREAD_POOL_ID), - new Integer( - ORBConstants.REQUEST_PARTITIONING_MAX_THREAD_POOL_ID)); - } - this.value = value; - } - - public int getValue() - { - return value; - } - - public int policy_type() - { - return ORBConstants.REQUEST_PARTITIONING_POLICY; - } - - public org.omg.CORBA.Policy copy() - { - return this; - } - - public void destroy() - { - // NO-OP - } - - public String toString() - { - return "RequestPartitioningPolicy[" + value + "]" ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/extension/ServantCachingPolicy.java b/src/java.corba/share/classes/com/sun/corba/se/spi/extension/ServantCachingPolicy.java deleted file mode 100644 index 35f225dd141..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/extension/ServantCachingPolicy.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.extension ; - -import org.omg.CORBA.Policy ; -import org.omg.CORBA.LocalObject ; -import com.sun.corba.se.impl.orbutil.ORBConstants ; - -/** Policy used to implement servant caching optimization in the POA. -* Creating a POA with an instance pol of this policy where -* pol.getType() > NO_SERVANT_CACHING will cause the servant to be -* looked up in the POA and cached in the LocalClientRequestDispatcher when -* the ClientRequestDispatcher is colocated with the implementation of the -* objref. This greatly speeds up invocations at the cost of violating the -* POA semantics. In particular, every request to a particular objref -* must be handled by the same servant. Note that this is typically the -* case for EJB implementations. -*

            -* If servant caching is used, there are two different additional -* features of the POA that are expensive: -*

              -*
            1. POA current semantics -*
            2. Proper handling of POA destroy. -*
            -* POA current semantics requires maintaining a ThreadLocal stack of -* invocation information that is always available for POACurrent operations. -* Maintaining this stack is expensive on the timescale of optimized co-located -* calls, so the option is provided to turn it off. Similarly, causing -* POA.destroy() calls to wait for all active calls in the POA to complete -* requires careful tracking of the entry and exit of invocations in the POA. -* Again, tracking this is somewhat expensive. -*/ -public class ServantCachingPolicy extends LocalObject implements Policy -{ - /** Do not cache servants in the ClientRequestDispatcher. This will - * always support the full POA semantics, including changing the - * servant that handles requests on a particular objref. - */ - public static final int NO_SERVANT_CACHING = 0 ; - - /** Perform servant caching, preserving POA current and POA destroy semantics. - * We will use this as the new default, as the app server is making heavier use - * now of POA facilities. - */ - public static final int FULL_SEMANTICS = 1 ; - - /** Perform servant caching, preservent only POA current semantics. - * At least this level is required in order to support selection of ObjectCopiers - * for co-located RMI-IIOP calls, as the current copier is stored in - * OAInvocationInfo, which must be present on the stack inside the call. - */ - public static final int INFO_ONLY_SEMANTICS = 2 ; - - /** Perform servant caching, not preserving POA current or POA destroy semantics. - */ - public static final int MINIMAL_SEMANTICS = 3 ; - - private static ServantCachingPolicy policy = null ; - private static ServantCachingPolicy infoOnlyPolicy = null ; - private static ServantCachingPolicy minimalPolicy = null ; - - private int type ; - - public String typeToName() - { - switch (type) { - case FULL_SEMANTICS: - return "FULL" ; - case INFO_ONLY_SEMANTICS: - return "INFO_ONLY" ; - case MINIMAL_SEMANTICS: - return "MINIMAL" ; - default: - return "UNKNOWN(" + type + ")" ; - } - } - - public String toString() - { - return "ServantCachingPolicy[" + typeToName() + "]" ; - } - - private ServantCachingPolicy( int type ) - { - this.type = type ; - } - - public int getType() - { - return type ; - } - - /** Return the default servant caching policy. - */ - public synchronized static ServantCachingPolicy getPolicy() - { - return getFullPolicy() ; - } - - public synchronized static ServantCachingPolicy getFullPolicy() - { - if (policy == null) - policy = new ServantCachingPolicy( FULL_SEMANTICS ) ; - - return policy ; - } - - public synchronized static ServantCachingPolicy getInfoOnlyPolicy() - { - if (infoOnlyPolicy == null) - infoOnlyPolicy = new ServantCachingPolicy( INFO_ONLY_SEMANTICS ) ; - - return infoOnlyPolicy ; - } - - public synchronized static ServantCachingPolicy getMinimalPolicy() - { - if (minimalPolicy == null) - minimalPolicy = new ServantCachingPolicy( MINIMAL_SEMANTICS ) ; - - return minimalPolicy ; - } - - public int policy_type () - { - return ORBConstants.SERVANT_CACHING_POLICY ; - } - - public org.omg.CORBA.Policy copy () - { - return this ; - } - - public void destroy () - { - // NO-OP - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/extension/ZeroPortPolicy.java b/src/java.corba/share/classes/com/sun/corba/se/spi/extension/ZeroPortPolicy.java deleted file mode 100644 index 37a62866903..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/extension/ZeroPortPolicy.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.extension ; - -import org.omg.CORBA.Policy ; -import org.omg.CORBA.LocalObject ; -import com.sun.corba.se.impl.orbutil.ORBConstants ; - -/** Policy used to implement zero IIOP port policy in the POA. -*/ -public class ZeroPortPolicy extends LocalObject implements Policy -{ - private static ZeroPortPolicy policy = new ZeroPortPolicy( true ) ; - - private boolean flag = true ; - - private ZeroPortPolicy( boolean type ) - { - this.flag = type ; - } - - public String toString() - { - return "ZeroPortPolicy[" + flag + "]" ; - } - - public boolean forceZeroPort() - { - return flag ; - } - - public synchronized static ZeroPortPolicy getPolicy() - { - return policy ; - } - - public int policy_type () - { - return ORBConstants.ZERO_PORT_POLICY ; - } - - public org.omg.CORBA.Policy copy () - { - return this ; - } - - public void destroy () - { - // NO-OP - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/EncapsulationFactoryBase.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/EncapsulationFactoryBase.java deleted file mode 100644 index e82301633f4..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/EncapsulationFactoryBase.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior ; - -import org.omg.CORBA_2_3.portable.InputStream ; - -import com.sun.corba.se.impl.ior.EncapsulationUtility ; - -public abstract class EncapsulationFactoryBase implements IdentifiableFactory { - private int id ; - - public int getId() - { - return id ; - } - - public EncapsulationFactoryBase( int id ) - { - this.id = id ; - } - - public final Identifiable create( InputStream in ) - { - InputStream is = EncapsulationUtility.getEncapsulationStream( in ) ; - return readContents( is ) ; - } - - protected abstract Identifiable readContents( InputStream is ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IOR.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IOR.java deleted file mode 100644 index 62f21e84ec3..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IOR.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior; - -import java.util.List ; -import java.util.Iterator ; - -import com.sun.corba.se.spi.orb.ORBVersion ; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion ; -import com.sun.corba.se.spi.ior.iiop.IIOPProfile ; - -import com.sun.corba.se.spi.orb.ORB ; - -/** An IOR is represented as a list of profiles. -* Only instances of TaggedProfile are contained in the list. -*/ -public interface IOR extends List, Writeable, MakeImmutable -{ - ORB getORB() ; - - /** Return the type id string from the IOR. - */ - String getTypeId() ; - - /** Return an iterator that iterates over tagged profiles with - * identifier id. It is not possible to modify the list through this - * iterator. - */ - Iterator iteratorById( int id ) ; - - /** Return a representation of this IOR in the standard GIOP stringified - * format that begins with "IOR:". - */ - String stringify() ; - - /** Return a representation of this IOR in the standard GIOP marshalled - * form. - */ - org.omg.IOP.IOR getIOPIOR() ; - - /** Return true if this IOR has no profiles. - */ - boolean isNil() ; - - /** Return true if this IOR is equivalent to ior. Here equivalent means - * that the typeids are the same, they have the same number of profiles, - * and each profile is equivalent to the corresponding profile. - */ - boolean isEquivalent(IOR ior) ; - - /** Return the IORTemplate for this IOR. This is simply a list - * of all TaggedProfileTemplates derived from the TaggedProfiles - * of the IOR. - */ - IORTemplateList getIORTemplates() ; - - /** Return the first IIOPProfile in this IOR. - * XXX THIS IS TEMPORARY FOR BACKWARDS COMPATIBILITY AND WILL BE REMOVED - * SOON! - */ - IIOPProfile getProfile() ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IORFactories.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IORFactories.java deleted file mode 100644 index f19cf880e7c..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IORFactories.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior ; - -import java.io.Serializable ; - -import org.omg.CORBA_2_3.portable.InputStream ; - -import org.omg.CORBA.BAD_PARAM ; -import org.omg.CORBA.portable.ValueFactory ; - -import org.omg.PortableInterceptor.ObjectReferenceTemplate ; -import org.omg.PortableInterceptor.ObjectReferenceFactory ; - -import com.sun.corba.se.impl.ior.ObjectIdImpl ; -import com.sun.corba.se.impl.ior.ObjectKeyImpl ; -import com.sun.corba.se.impl.ior.IORImpl ; -import com.sun.corba.se.impl.ior.IORTemplateImpl ; -import com.sun.corba.se.impl.ior.IORTemplateListImpl ; -import com.sun.corba.se.impl.ior.ObjectReferenceProducerBase ; -import com.sun.corba.se.impl.ior.ObjectReferenceFactoryImpl ; -import com.sun.corba.se.impl.ior.ObjectReferenceTemplateImpl ; -import com.sun.corba.se.impl.ior.ObjectKeyFactoryImpl ; - -import com.sun.corba.se.impl.orbutil.ORBUtility ; - -import com.sun.corba.se.spi.orb.ORB ; - -/** This class provides a number of factory methods for creating - * various IOR SPI classes which are not subclassed for specific protocols. - * The following types must be created using this class: - *
              - *
            • ObjectId
            • - *
            • ObjectKey
            • - *
            • IOR
            • - *
            • IORTemplate
            • - *
            - */ -public class IORFactories { - private IORFactories() {} - - /** Create an ObjectId for the given byte sequence. - */ - public static ObjectId makeObjectId( byte[] id ) - { - return new ObjectIdImpl( id ) ; - } - - /** Create an ObjectKey for the given ObjectKeyTemplate and - * ObjectId. - */ - public static ObjectKey makeObjectKey( ObjectKeyTemplate oktemp, ObjectId oid ) - { - return new ObjectKeyImpl( oktemp, oid ) ; - } - - /** Create an empty IOR for the given orb and typeid. The result is mutable. - */ - public static IOR makeIOR( ORB orb, String typeid ) - { - return new IORImpl( orb, typeid ) ; - } - - /** Create an empty IOR for the given orb with a null typeid. The result is mutable. - */ - public static IOR makeIOR( ORB orb ) - { - return new IORImpl( orb ) ; - } - - /** Read an IOR from an InputStream. ObjectKeys are not shared. - */ - public static IOR makeIOR( InputStream is ) - { - return new IORImpl( is ) ; - } - - /** Create an IORTemplate with the given ObjectKeyTemplate. The result - * is mutable. - */ - public static IORTemplate makeIORTemplate( ObjectKeyTemplate oktemp ) - { - return new IORTemplateImpl( oktemp ) ; - } - - /** Read an IORTemplate from an InputStream. - */ - public static IORTemplate makeIORTemplate( InputStream is ) - { - return new IORTemplateImpl( is ) ; - } - - public static IORTemplateList makeIORTemplateList() - { - return new IORTemplateListImpl() ; - } - - public static IORTemplateList makeIORTemplateList( InputStream is ) - { - return new IORTemplateListImpl( is ) ; - } - - public static IORFactory getIORFactory( ObjectReferenceTemplate ort ) - { - if (ort instanceof ObjectReferenceTemplateImpl) { - ObjectReferenceTemplateImpl orti = - (ObjectReferenceTemplateImpl)ort ; - return orti.getIORFactory() ; - } - - throw new BAD_PARAM() ; - } - - public static IORTemplateList getIORTemplateList( ObjectReferenceFactory orf ) - { - if (orf instanceof ObjectReferenceProducerBase) { - ObjectReferenceProducerBase base = - (ObjectReferenceProducerBase)orf ; - return base.getIORTemplateList() ; - } - - throw new BAD_PARAM() ; - } - - public static ObjectReferenceTemplate makeObjectReferenceTemplate( ORB orb, - IORTemplate iortemp ) - { - return new ObjectReferenceTemplateImpl( orb, iortemp ) ; - } - - public static ObjectReferenceFactory makeObjectReferenceFactory( ORB orb, - IORTemplateList iortemps ) - { - return new ObjectReferenceFactoryImpl( orb, iortemps ) ; - } - - public static ObjectKeyFactory makeObjectKeyFactory( ORB orb ) - { - return new ObjectKeyFactoryImpl( orb ) ; - } - - public static IOR getIOR( org.omg.CORBA.Object obj ) - { - return ORBUtility.getIOR( obj ) ; - } - - public static org.omg.CORBA.Object makeObjectReference( IOR ior ) - { - return ORBUtility.makeObjectReference( ior ) ; - } - - /** This method must be called in order to register the value - * factories for the ObjectReferenceTemplate and ObjectReferenceFactory - * value types. - */ - public static void registerValueFactories( ORB orb ) - { - // Create and register the factory for the Object Reference Template - // implementation. - ValueFactory vf = new ValueFactory() { - public Serializable read_value( InputStream is ) - { - return new ObjectReferenceTemplateImpl( is ) ; - } - } ; - - orb.register_value_factory( ObjectReferenceTemplateImpl.repositoryId, vf ) ; - - // Create and register the factory for the Object Reference Factory - // implementation. - vf = new ValueFactory() { - public Serializable read_value( InputStream is ) - { - return new ObjectReferenceFactoryImpl( is ) ; - } - } ; - - orb.register_value_factory( ObjectReferenceFactoryImpl.repositoryId, vf ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IORFactory.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IORFactory.java deleted file mode 100644 index e6b6ad31c7d..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IORFactory.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior ; - -import com.sun.corba.se.spi.orb.ORB ; - -/** An IORFactory provides the capability of creating IORs. It contains - * some collection of TaggedProfileTemplates, which can be iterated over - * for portable interceptors. - */ -public interface IORFactory extends Writeable, MakeImmutable { - /** Construct an IOR containing the given ORB, typeid, and ObjectId. - * The same ObjectId will be used for all TaggedProfileTemplates in - * the IORFactory. - */ - IOR makeIOR( ORB orb, String typeid, ObjectId oid ) ; - - /** Return true iff this.makeIOR(orb,typeid,oid).isEquivalent( - * other.makeIOR(orb,typeid,oid) for all orb, typeid, and oid. - */ - boolean isEquivalent( IORFactory other ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IORTemplate.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IORTemplate.java deleted file mode 100644 index 91ea5d95964..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IORTemplate.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior ; - -import java.util.List ; -import java.util.Iterator ; - -/** An IORTemplate provides all of the data necessary to create an IOR except - * for the typeId and ObjectId. It is a list of TaggedProfileTemplates. - */ -public interface IORTemplate extends List, IORFactory, MakeImmutable { - /** Iterate over all TaggedProfileTemplates in this IORTemplate - * with the given id. - */ - Iterator iteratorById( int id ) ; - - ObjectKeyTemplate getObjectKeyTemplate() ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IORTemplateList.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IORTemplateList.java deleted file mode 100644 index 5ee8949d71d..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IORTemplateList.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior ; - -import java.util.List ; - -/** An IORTemplateList is a list of IORTemplate instances. It can be used to create IORs. - * This is useful for representing IORs made of profiles from different object - * adapters. - * Note that any IORFactory can be added to an IORTemplateList, but it is flattened - * so that the result is just a list of IORTemplate instances. - */ -public interface IORTemplateList extends List, IORFactory, MakeImmutable { -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IORTypeCheckRegistry.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IORTypeCheckRegistry.java deleted file mode 100644 index cf10bc61427..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IORTypeCheckRegistry.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior; - -public interface IORTypeCheckRegistry { - public boolean isValidIORType(String iorClassName); -} - diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/Identifiable.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/Identifiable.java deleted file mode 100644 index 01279d7226b..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/Identifiable.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package com.sun.corba.se.spi.ior; - - -/** This interface represents an entity that can be written to an - * OutputStream and has an identity that is represented by an integer. - * This identity is essentially the type of the entity, and is used in - * order to know how to read the entity back from an InputStream. - * @author Ken Cavanaugh - */ -public interface Identifiable extends Writeable -{ - /** Return the (type) identity of this entity. - * @return int - */ - public int getId(); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IdentifiableBase.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IdentifiableBase.java deleted file mode 100644 index a8e896a4aa2..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IdentifiableBase.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior; - -import org.omg.CORBA_2_3.portable.OutputStream ; - -import com.sun.corba.se.spi.ior.Writeable ; -import com.sun.corba.se.spi.ior.WriteContents ; -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.impl.ior.EncapsulationUtility ; - -/** Provide support for properly reading and writing Identifiable objects -* that are also encapsulations (tagged profiles and components). -*/ -public abstract class IdentifiableBase implements Identifiable, - WriteContents -{ - /** Write the data for this object as a CDR encapsulation. - * This is used for writing tagged components and profiles. - * These data types must be written out as encapsulations, - * which means that we need to first write the data out to - * an encapsulation stream, then extract the data and write - * it to os as an array of octets. - */ - final public void write( OutputStream os ) - { - EncapsulationUtility.writeEncapsulation( (WriteContents)this, os ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IdentifiableContainerBase.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IdentifiableContainerBase.java deleted file mode 100644 index ca902eaa6ed..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IdentifiableContainerBase.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior; - -import java.util.List; -import java.util.ArrayList; -import java.util.Iterator; - -import com.sun.corba.se.impl.ior.FreezableList ; - -import com.sun.corba.se.spi.ior.TaggedComponent ; -import com.sun.corba.se.spi.ior.Identifiable ; - -/** Convenience class for defining objects that contain lists of Identifiables. - * Mainly implements iteratorById. Also note that the constructor creates the - * list, which here is always an ArrayList, as this is much more efficient overall - * for short lists. - * @author Ken Cavanaugh - */ -public class IdentifiableContainerBase extends FreezableList -{ - /** Create this class with an empty list of identifiables. - * The current implementation uses an ArrayList. - */ - public IdentifiableContainerBase() - { - super( new ArrayList() ) ; - } - - /** Return an iterator which iterates over all contained Identifiables - * with type given by id. - */ - public Iterator iteratorById( final int id) - { - return new Iterator() { - Iterator iter = IdentifiableContainerBase.this.iterator() ; - Object current = advance() ; - - private Object advance() - { - while (iter.hasNext()) { - Identifiable ide = (Identifiable)(iter.next()) ; - if (ide.getId() == id) - return ide ; - } - - return null ; - } - - public boolean hasNext() - { - return current != null ; - } - - public Object next() - { - Object result = current ; - current = advance() ; - return result ; - } - - public void remove() - { - iter.remove() ; - } - } ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IdentifiableFactory.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IdentifiableFactory.java deleted file mode 100644 index ccb8e8da22a..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IdentifiableFactory.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior ; - -import org.omg.CORBA_2_3.portable.InputStream ; - -import com.sun.corba.se.spi.ior.Identifiable ; - -/** Factory interface for creating Identifiables. - */ -public interface IdentifiableFactory { - /** Return the id of this factory, which is the id of the result - * of any create call. - */ - public int getId() ; - - /** Construct the appropriate Identifiable object with the - * given id from the InputStream is. - */ - public Identifiable create( InputStream in ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IdentifiableFactoryFinder.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IdentifiableFactoryFinder.java deleted file mode 100644 index d3aaeb60793..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/IdentifiableFactoryFinder.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior; - -import org.omg.CORBA_2_3.portable.InputStream ; - -/** Interface used to manage a group of related IdentifiableFactory instances. - * Factories can be registered, and invoked through a create method, which - * must be implemented to handle the case of no registered factory - * appropriately. - * @author Ken Cavanaugh - */ -public interface IdentifiableFactoryFinder -{ - /** If there is a registered factory for id, use it to - * read an Identifiable from is. Otherwise create an - * appropriate generic container, or throw an error. - * The type of generic container, or error behavior is - * a property of the implementation. - */ - Identifiable create(int id, InputStream is); - - /** Register a factory for the given id. - */ - void registerFactory( IdentifiableFactory factory ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/MakeImmutable.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/MakeImmutable.java deleted file mode 100644 index 2af129349dd..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/MakeImmutable.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior ; - -public interface MakeImmutable { - void makeImmutable() ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/ObjectAdapterId.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/ObjectAdapterId.java deleted file mode 100644 index 14869019427..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/ObjectAdapterId.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior ; - -import java.util.Iterator ; - -/** This is the object adapter ID for an object adapter. -* Typically this is the path of strings starting from the -* Root POA to get to a POA, but other implementations are possible. -*/ -public interface ObjectAdapterId extends Writeable { - /** Return the number of elements in the adapter ID. - */ - int getNumLevels() ; - - /** Return an iterator that iterates over the components - * of this adapter ID. Each element is returned as a String. - */ - Iterator iterator() ; - - /** Get the adapter name simply as an array of strings. - */ - String[] getAdapterName() ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/ObjectId.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/ObjectId.java deleted file mode 100644 index 93f42aaa78a..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/ObjectId.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior; - -/** - * @author Ken Cavanaugh - */ -public interface ObjectId extends Writeable -{ - public byte[] getId() ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/ObjectKey.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/ObjectKey.java deleted file mode 100644 index b96fdd8354d..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/ObjectKey.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior; - -import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher ; - -import com.sun.corba.se.spi.orb.ORB ; - -/** The full object key, which is contained in an IIOPProfile. -* The object identifier corresponds to the information passed into -* POA::create_reference_with_id and POA::create_reference -* (in the POA case). The template -* represents the information that is object adapter specific and -* shared across multiple ObjectKey instances. -*/ -public interface ObjectKey extends Writeable -{ - /** Return the object identifier for this Object key. - */ - ObjectId getId() ; - - /** Return the template for this object key. - */ - ObjectKeyTemplate getTemplate() ; - - byte[] getBytes( org.omg.CORBA.ORB orb ) ; - - CorbaServerRequestDispatcher getServerRequestDispatcher( ORB orb ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/ObjectKeyFactory.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/ObjectKeyFactory.java deleted file mode 100644 index 7254ea0f6ee..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/ObjectKeyFactory.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior; - -import org.omg.CORBA_2_3.portable.InputStream ; - -import com.sun.corba.se.spi.ior.ObjectKey ; -import com.sun.corba.se.spi.ior.ObjectKeyTemplate ; - -/** Construct ObjectKey and ObjectKeyTemplate instances from their - * CDR-marshalled representation. - */ -public interface ObjectKeyFactory -{ - /** Create an ObjectKey from its octet sequence representation. - */ - ObjectKey create( byte[] key ) ; - - /** Create an ObjectKeyTemplate from its representation - * in an InputStream. - */ - ObjectKeyTemplate createTemplate( InputStream is ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/ObjectKeyTemplate.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/ObjectKeyTemplate.java deleted file mode 100644 index 348cd15b64a..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/ObjectKeyTemplate.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior; - -import org.omg.CORBA_2_3.portable.OutputStream ; - -import com.sun.corba.se.spi.orb.ORBVersion ; -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher ; - -/** An ObjectKeyTemplate represents the part of an Object Key - * that corresponds to the object adapter used to create an - * object reference. The template is shared between many - * object references. - */ -public interface ObjectKeyTemplate extends Writeable -{ - public ORBVersion getORBVersion() ; - - /** An ID used to determine how to perform operations on this - * ObjectKeyTemplate. This id determines how to process requests - * on this object reference, and what object adapter type to use. - */ - public int getSubcontractId(); - - /** Return the server ID for this template. - * For CORBA 3.0, this should be a String, but it is currently - * an int in the object key template. - */ - public int getServerId() ; - - /** Return the ORB ID for this template. - */ - public String getORBId() ; - - /** Return the object adapter ID for this template. - */ - public ObjectAdapterId getObjectAdapterId() ; - - /** Compute an adapter ID for this template than includes - * all of the template information. - * This value is cached to avoid the expense of recomputing - * it. - */ - public byte[] getAdapterId() ; - - public void write(ObjectId objectId, OutputStream os); - - public CorbaServerRequestDispatcher getServerRequestDispatcher( ORB orb, ObjectId id ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/TaggedComponent.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/TaggedComponent.java deleted file mode 100644 index 790029df79a..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/TaggedComponent.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior; - -import org.omg.CORBA_2_3.portable.OutputStream ; -import org.omg.CORBA.ORB ; - -/** Generic interface for all tagged components. Users of the ORB may -* create implementations of this class and also corresponding factories -* of type TaggedComponentFactory. The factories can be registered with an -* ORB instance, in which case they will be used to unmarshal IORs containing -* the registered tagged component. -*/ -public interface TaggedComponent extends Identifiable -{ - org.omg.IOP.TaggedComponent getIOPComponent( ORB orb ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/TaggedComponentBase.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/TaggedComponentBase.java deleted file mode 100644 index 74617235d70..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/TaggedComponentBase.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior; - -import org.omg.CORBA_2_3.portable.InputStream ; - -import com.sun.corba.se.impl.encoding.EncapsOutputStream ; - -import com.sun.corba.se.spi.orb.ORB ; - - -/** Base class to use for implementing TaggedComponents. It implements - * the getIOPComponent method using the TaggedComponent.write() method. - * @author Ken Cavanaugh - */ -public abstract class TaggedComponentBase extends IdentifiableBase - implements TaggedComponent -{ - public org.omg.IOP.TaggedComponent getIOPComponent( - org.omg.CORBA.ORB orb ) - { - EncapsOutputStream os = - sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)orb); - write( os ) ; - InputStream is = (InputStream)(os.create_input_stream() ) ; - return org.omg.IOP.TaggedComponentHelper.read( is ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/TaggedComponentFactoryFinder.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/TaggedComponentFactoryFinder.java deleted file mode 100644 index 0f295231b53..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/TaggedComponentFactoryFinder.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior; - -public interface TaggedComponentFactoryFinder extends IdentifiableFactoryFinder -{ - /** Create a tagged component from a GIOP marshalled representation - * of a tagged component. This is needed for portable interceptors. - */ - TaggedComponent create( org.omg.CORBA.ORB orb, - org.omg.IOP.TaggedComponent comp ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/TaggedProfile.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/TaggedProfile.java deleted file mode 100644 index 94bc80d7cd6..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/TaggedProfile.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior; - -import com.sun.corba.se.spi.orb.ORB ; - -/** TaggedProfile represents a tagged profile in an IOR. - * A profile contains all of the information necessary for an invocation. - * It contains one or more endpoints that may be used for an invocation. - * A TaggedProfile conceptually has three parts: A TaggedProfileTemplate, - * an ObjectKeyTemplate, and an ObjectId. - */ -public interface TaggedProfile extends Identifiable, MakeImmutable -{ - TaggedProfileTemplate getTaggedProfileTemplate() ; - - ObjectId getObjectId() ; - - ObjectKeyTemplate getObjectKeyTemplate() ; - - ObjectKey getObjectKey() ; - - /** Return true is prof is equivalent to this TaggedProfile. - * This means that this and prof are indistinguishable for - * the purposes of remote invocation. Typically this means that - * the profile data is identical and both profiles contain exactly - * the same components (if components are applicable). - * isEquivalent( prof ) should imply that getObjectId().equals( - * prof.getObjectId() ) is true, and so is - * getObjectKeyTemplate().equals( prof.getObjectKeyTemplate() ). - */ - boolean isEquivalent( TaggedProfile prof ) ; - - /** Return the TaggedProfile as a CDR encapsulation in the standard - * format. This is required for Portable interceptors. - */ - org.omg.IOP.TaggedProfile getIOPProfile(); - - /** Return true if this TaggedProfile was created in orb. - * Caches the result. - */ - boolean isLocal() ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/TaggedProfileTemplate.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/TaggedProfileTemplate.java deleted file mode 100644 index bac33083d07..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/TaggedProfileTemplate.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior; - -import java.util.List ; -import java.util.Iterator ; - -import org.omg.CORBA_2_3.portable.OutputStream ; - -import com.sun.corba.se.spi.ior.Identifiable ; -import com.sun.corba.se.spi.ior.Writeable ; -import com.sun.corba.se.spi.ior.ObjectId ; -import com.sun.corba.se.spi.ior.WriteContents ; - -import com.sun.corba.se.spi.orb.ORB ; - -/** Base template for creating TaggedProfiles. A TaggedProfile will often contain -* tagged components. A template that does not contain components acts like -* an empty immutable list. -* -* @author Ken Cavanaugh -*/ -public interface TaggedProfileTemplate extends List, Identifiable, - WriteContents, MakeImmutable -{ - /** Return an iterator that iterates over tagged components with - * identifier id. It is not possible to modify the list through this - * iterator. - */ - public Iterator iteratorById( int id ) ; - - /** Create a TaggedProfile from this template. - */ - TaggedProfile create( ObjectKeyTemplate oktemp, ObjectId id ) ; - - /** Write the profile create( oktemp, id ) to the OutputStream os. - */ - void write( ObjectKeyTemplate oktemp, ObjectId id, OutputStream os) ; - - /** Return true if temp is equivalent to this template. Equivalence - * means that in some sense an invocation on a profile created by this - * template has the same results as an invocation on a profile - * created from temp. Equivalence may be weaker than equality. - */ - boolean isEquivalent( TaggedProfileTemplate temp ); - - /** Return the tagged components in this profile (if any) - * in the GIOP marshalled form, which is required for Portable - * Interceptors. Returns null if either the profile has no - * components, or if this type of profile can never contain - * components. - */ - org.omg.IOP.TaggedComponent[] getIOPComponents( - ORB orb, int id ); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/TaggedProfileTemplateBase.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/TaggedProfileTemplateBase.java deleted file mode 100644 index 23f4c3e133a..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/TaggedProfileTemplateBase.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior; - -import java.util.Iterator ; - -import org.omg.CORBA_2_3.portable.OutputStream ; - -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.impl.ior.EncapsulationUtility ; - -public abstract class TaggedProfileTemplateBase - extends IdentifiableContainerBase - implements TaggedProfileTemplate -{ - public void write( OutputStream os ) - { - EncapsulationUtility.writeEncapsulation( this, os ) ; - } - - public org.omg.IOP.TaggedComponent[] getIOPComponents( ORB orb, int id ) - { - int count = 0 ; - Iterator iter = iteratorById( id ) ; - while (iter.hasNext()) { - iter.next() ; - count++ ; - } - - org.omg.IOP.TaggedComponent[] result = new - org.omg.IOP.TaggedComponent[count] ; - - int index = 0 ; - iter = iteratorById( id ) ; - while (iter.hasNext()) { - TaggedComponent comp = (TaggedComponent)(iter.next()) ; - result[index++] = comp.getIOPComponent( orb ) ; - } - - return result ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/WriteContents.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/WriteContents.java deleted file mode 100644 index b4d7e93d962..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/WriteContents.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior; - -import org.omg.CORBA_2_3.portable.OutputStream ; - -public interface WriteContents { - void writeContents( OutputStream os ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/Writeable.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/Writeable.java deleted file mode 100644 index dff85bef405..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/Writeable.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior; - -import org.omg.CORBA_2_3.portable.OutputStream ; - -/** This interface represents an entity that can be written to an OutputStream. - * @author Ken Cavanaugh - */ -public interface Writeable -{ - /** Write this object directly to the output stream. - */ - void write(OutputStream arg0); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/AlternateIIOPAddressComponent.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/AlternateIIOPAddressComponent.java deleted file mode 100644 index 8992d1c9421..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/AlternateIIOPAddressComponent.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior.iiop; - -import com.sun.corba.se.spi.ior.iiop.IIOPAddress ; -import com.sun.corba.se.spi.ior.TaggedComponent ; - -/** - * @author Ken Cavanaugh - */ -public interface AlternateIIOPAddressComponent extends TaggedComponent -{ - public IIOPAddress getAddress() ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/CodeSetsComponent.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/CodeSetsComponent.java deleted file mode 100644 index 78f42e81987..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/CodeSetsComponent.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior.iiop; - -import com.sun.corba.se.spi.ior.TaggedComponent ; - -import com.sun.corba.se.impl.encoding.CodeSetComponentInfo ; - -/** - * @author Ken Cavanaugh - */ -public interface CodeSetsComponent extends TaggedComponent -{ - public CodeSetComponentInfo getCodeSetComponentInfo() ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/GIOPVersion.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/GIOPVersion.java deleted file mode 100644 index a82f8ddb419..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/GIOPVersion.java +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior.iiop ; - -import com.sun.corba.se.spi.ior.IOR ; -import com.sun.corba.se.spi.ior.iiop.IIOPProfile; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.orb.ORBVersion; -import com.sun.corba.se.spi.orb.ORBVersionFactory; - -import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; - -public class GIOPVersion { - - // Static fields - - public static final GIOPVersion V1_0 = new GIOPVersion((byte)1, (byte)0); - public static final GIOPVersion V1_1 = new GIOPVersion((byte)1, (byte)1); - public static final GIOPVersion V1_2 = new GIOPVersion((byte)1, (byte)2); - public static final GIOPVersion V1_3 = new GIOPVersion((byte)1, (byte)3); - - // Major version 13 indicates Java serialization, - // Minor version [00-FF] is the version number. - public static final GIOPVersion V13_XX = - new GIOPVersion((byte)13, (byte)Message.JAVA_ENC_VERSION); - - public static final GIOPVersion DEFAULT_VERSION = V1_2; - - public static final int VERSION_1_0 = 0x0100; - public static final int VERSION_1_1 = 0x0101; - public static final int VERSION_1_2 = 0x0102; - public static final int VERSION_1_3 = 0x0103; - public static final int VERSION_13_XX = - ((0x0D << 8) & 0x0000FF00) | Message.JAVA_ENC_VERSION; - - // Instance variables - - private byte major = (byte) 0; - private byte minor = (byte) 0; - - // Constructor - - public GIOPVersion() {} - - public GIOPVersion(byte majorB, byte minorB) { - this.major = majorB; - this.minor = minorB; - } - - public GIOPVersion(int major, int minor) { - this.major = (byte)major; - this.minor = (byte)minor; - } - - // Accessor methods - - public byte getMajor() { - return this.major; - } - - public byte getMinor() { - return this.minor; - } - - // General methods - - public boolean equals(GIOPVersion gv){ - return gv.major == this.major && gv.minor == this.minor ; - } - - public boolean equals(Object obj) { - if (obj != null && (obj instanceof GIOPVersion)) - return equals((GIOPVersion)obj); - else - return false; - } - - public int hashCode() - { - return 37*major + minor ; - } - - public boolean lessThan(GIOPVersion gv) { - if (this.major < gv.major) { - return true; - } else if (this.major == gv.major) { - if (this.minor < gv.minor) { - return true; - } - } - - return false; - } - - public int intValue() - { - return (major << 8 | minor); - } - - public String toString() - { - return major + "." + minor; - } - - public static GIOPVersion getInstance(byte major, byte minor) - { - switch(((major << 8) | minor)) { - case VERSION_1_0: - return GIOPVersion.V1_0; - case VERSION_1_1: - return GIOPVersion.V1_1; - case VERSION_1_2: - return GIOPVersion.V1_2; - case VERSION_1_3: - return GIOPVersion.V1_3; - case VERSION_13_XX: - return GIOPVersion.V13_XX; - default: - return new GIOPVersion(major, minor); - } - } - - public static GIOPVersion parseVersion(String s) - { - int dotIdx = s.indexOf('.'); - - if (dotIdx < 1 || dotIdx == s.length() - 1) - throw new NumberFormatException("GIOP major, minor, and decimal point required: " + s); - - int major = Integer.parseInt(s.substring(0, dotIdx)); - int minor = Integer.parseInt(s.substring(dotIdx + 1, s.length())); - - return GIOPVersion.getInstance((byte)major, (byte)minor); - } - - /** - * This chooses the appropriate GIOP version. - * - * @return the GIOP version 13.00 if Java serialization is enabled, or - * smallest(profGIOPVersion, orbGIOPVersion) - */ - public static GIOPVersion chooseRequestVersion(ORB orb, IOR ior ) { - - GIOPVersion orbVersion = orb.getORBData().getGIOPVersion(); - IIOPProfile prof = ior.getProfile() ; - GIOPVersion profVersion = prof.getGIOPVersion(); - - // Check if the profile is from a legacy Sun ORB. - - ORBVersion targetOrbVersion = prof.getORBVersion(); - if (!(targetOrbVersion.equals(ORBVersionFactory.getFOREIGN())) && - targetOrbVersion.lessThan(ORBVersionFactory.getNEWER())) { - // we are dealing with a SUN legacy orb which emits 1.1 IORs, - // in spite of being able to handle only GIOP 1.0 messages. - return V1_0; - } - - // Now the target has to be (FOREIGN | NEWER*) - - byte prof_major = profVersion.getMajor(); - byte prof_minor = profVersion.getMinor(); - - byte orb_major = orbVersion.getMajor(); - byte orb_minor = orbVersion.getMinor(); - - if (orb_major < prof_major) { - return orbVersion; - } else if (orb_major > prof_major) { - return profVersion; - } else { // both major version are the same - if (orb_minor <= prof_minor) { - return orbVersion; - } else { - return profVersion; - } - } - } - - public boolean supportsIORIIOPProfileComponents() - { - return getMinor() > 0 || getMajor() > 1; - } - - // IO methods - - public void read(org.omg.CORBA.portable.InputStream istream) { - this.major = istream.read_octet(); - this.minor = istream.read_octet(); - } - - public void write(org.omg.CORBA.portable.OutputStream ostream) { - ostream.write_octet(this.major); - ostream.write_octet(this.minor); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/IIOPAddress.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/IIOPAddress.java deleted file mode 100644 index 4c1175d7b1a..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/IIOPAddress.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior.iiop; - -import com.sun.corba.se.spi.ior.Writeable ; - -/** IIOPAddress represents the host and port used to establish a - * TCP connection for an IIOP request. - */ -public interface IIOPAddress extends Writeable -{ - public String getHost() ; - - public int getPort() ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/IIOPFactories.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/IIOPFactories.java deleted file mode 100644 index 23403eb4ef3..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/IIOPFactories.java +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior.iiop ; - -import org.omg.CORBA_2_3.portable.InputStream ; - -import com.sun.corba.se.spi.ior.Identifiable ; -import com.sun.corba.se.spi.ior.IdentifiableFactory ; -import com.sun.corba.se.spi.ior.EncapsulationFactoryBase ; -import com.sun.corba.se.spi.ior.ObjectId ; -import com.sun.corba.se.spi.ior.ObjectKeyTemplate ; - -import com.sun.corba.se.spi.ior.iiop.IIOPAddress ; -import com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate ; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion ; - -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.impl.encoding.MarshalInputStream ; - -import com.sun.corba.se.impl.ior.iiop.IIOPAddressImpl ; -import com.sun.corba.se.impl.ior.iiop.CodeSetsComponentImpl ; -import com.sun.corba.se.impl.ior.iiop.AlternateIIOPAddressComponentImpl ; -import com.sun.corba.se.impl.ior.iiop.JavaCodebaseComponentImpl ; -import com.sun.corba.se.impl.ior.iiop.MaxStreamFormatVersionComponentImpl ; -import com.sun.corba.se.impl.ior.iiop.JavaSerializationComponent; -import com.sun.corba.se.impl.ior.iiop.ORBTypeComponentImpl ; -import com.sun.corba.se.impl.ior.iiop.IIOPProfileImpl ; -import com.sun.corba.se.impl.ior.iiop.IIOPProfileTemplateImpl ; -import com.sun.corba.se.impl.ior.iiop.RequestPartitioningComponentImpl ; -import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.impl.orbutil.ORBConstants; - -import org.omg.IOP.TAG_ALTERNATE_IIOP_ADDRESS ; -import org.omg.IOP.TAG_CODE_SETS ; -import org.omg.IOP.TAG_JAVA_CODEBASE ; -import org.omg.IOP.TAG_RMI_CUSTOM_MAX_STREAM_FORMAT ; -import org.omg.IOP.TAG_ORB_TYPE ; -import org.omg.IOP.TAG_INTERNET_IOP ; - -/** This class provides all of the factories for the IIOP profiles and - * components. This includes direct construction of profiles and templates, - * as well as constructing factories that can be registered with an - * IdentifiableFactoryFinder. - */ -public abstract class IIOPFactories { - private IIOPFactories() {} - - public static IdentifiableFactory makeRequestPartitioningComponentFactory() - { - return new EncapsulationFactoryBase(ORBConstants.TAG_REQUEST_PARTITIONING_ID) { - public Identifiable readContents(InputStream in) - { - int threadPoolToUse = in.read_ulong(); - Identifiable comp = - new RequestPartitioningComponentImpl(threadPoolToUse); - return comp; - } - }; - } - - public static RequestPartitioningComponent makeRequestPartitioningComponent( - int threadPoolToUse) - { - return new RequestPartitioningComponentImpl(threadPoolToUse); - } - - public static IdentifiableFactory makeAlternateIIOPAddressComponentFactory() - { - return new EncapsulationFactoryBase(TAG_ALTERNATE_IIOP_ADDRESS.value) { - public Identifiable readContents( InputStream in ) - { - IIOPAddress addr = new IIOPAddressImpl( in ) ; - Identifiable comp = - new AlternateIIOPAddressComponentImpl( addr ) ; - return comp ; - } - } ; - } - - public static AlternateIIOPAddressComponent makeAlternateIIOPAddressComponent( - IIOPAddress addr ) - { - return new AlternateIIOPAddressComponentImpl( addr ) ; - } - - public static IdentifiableFactory makeCodeSetsComponentFactory() - { - return new EncapsulationFactoryBase(TAG_CODE_SETS.value) { - public Identifiable readContents( InputStream in ) - { - return new CodeSetsComponentImpl( in ) ; - } - } ; - } - - public static CodeSetsComponent makeCodeSetsComponent( ORB orb ) - { - return new CodeSetsComponentImpl( orb ) ; - } - - public static IdentifiableFactory makeJavaCodebaseComponentFactory() - { - return new EncapsulationFactoryBase(TAG_JAVA_CODEBASE.value) { - public Identifiable readContents( InputStream in ) - { - String url = in.read_string() ; - Identifiable comp = new JavaCodebaseComponentImpl( url ) ; - return comp ; - } - } ; - } - - public static JavaCodebaseComponent makeJavaCodebaseComponent( - String codebase ) - { - return new JavaCodebaseComponentImpl( codebase ) ; - } - - public static IdentifiableFactory makeORBTypeComponentFactory() - { - return new EncapsulationFactoryBase(TAG_ORB_TYPE.value) { - public Identifiable readContents( InputStream in ) - { - int type = in.read_ulong() ; - Identifiable comp = new ORBTypeComponentImpl( type ) ; - return comp ; - } - } ; - } - - public static ORBTypeComponent makeORBTypeComponent( int type ) - { - return new ORBTypeComponentImpl( type ) ; - } - - public static IdentifiableFactory makeMaxStreamFormatVersionComponentFactory() - { - return new EncapsulationFactoryBase(TAG_RMI_CUSTOM_MAX_STREAM_FORMAT.value) { - public Identifiable readContents(InputStream in) - { - byte version = in.read_octet() ; - Identifiable comp = new MaxStreamFormatVersionComponentImpl(version); - return comp ; - } - }; - } - - public static MaxStreamFormatVersionComponent makeMaxStreamFormatVersionComponent() - { - return new MaxStreamFormatVersionComponentImpl() ; - } - - public static IdentifiableFactory makeJavaSerializationComponentFactory() { - return new EncapsulationFactoryBase( - ORBConstants.TAG_JAVA_SERIALIZATION_ID) { - public Identifiable readContents(InputStream in) { - byte version = in.read_octet(); - Identifiable cmp = new JavaSerializationComponent(version); - return cmp; - } - }; - } - - public static JavaSerializationComponent makeJavaSerializationComponent() { - return JavaSerializationComponent.singleton(); - } - - public static IdentifiableFactory makeIIOPProfileFactory() - { - return new EncapsulationFactoryBase(TAG_INTERNET_IOP.value) { - public Identifiable readContents( InputStream in ) - { - Identifiable result = new IIOPProfileImpl( in ) ; - return result ; - } - } ; - } - - public static IIOPProfile makeIIOPProfile( ORB orb, ObjectKeyTemplate oktemp, - ObjectId oid, IIOPProfileTemplate ptemp ) - { - return new IIOPProfileImpl( orb, oktemp, oid, ptemp ) ; - } - - public static IIOPProfile makeIIOPProfile( ORB orb, - org.omg.IOP.TaggedProfile profile ) - { - return new IIOPProfileImpl( orb, profile ) ; - } - - public static IdentifiableFactory makeIIOPProfileTemplateFactory() - { - return new EncapsulationFactoryBase(TAG_INTERNET_IOP.value) { - public Identifiable readContents( InputStream in ) - { - Identifiable result = new IIOPProfileTemplateImpl( in ) ; - return result ; - } - } ; - } - - public static IIOPProfileTemplate makeIIOPProfileTemplate( ORB orb, - GIOPVersion version, IIOPAddress primary ) - { - return new IIOPProfileTemplateImpl( orb, version, primary ) ; - } - - public static IIOPAddress makeIIOPAddress( ORB orb, String host, int port ) - { - return new IIOPAddressImpl( orb, host, port ) ; - } - - public static IIOPAddress makeIIOPAddress( InputStream is ) - { - return new IIOPAddressImpl( is ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/IIOPProfile.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/IIOPProfile.java deleted file mode 100644 index 0a42160b6e7..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/IIOPProfile.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior.iiop; - -import com.sun.corba.se.spi.ior.TaggedProfile ; - -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.orb.ORBVersion ; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion ; - -/** IIOPProfile represents an IIOP tagged profile. -* It is essentially composed of an object identifier and -* a template. The template contains all of the -* IIOP specific information in the profile. -* Templates are frequently shared between many different profiles, -* while the object identifiy is unique to each profile. -*/ -public interface IIOPProfile extends TaggedProfile -{ - ORBVersion getORBVersion() ; - - /** Return the servant for this profile, if it is local - * AND if the OA that implements this objref supports direct access to servants - * outside of an invocation. - * XXX move this to the ObjectKeyTemplate - */ - java.lang.Object getServant() ; - - /** Return the GIOPVersion of this profile. Caches the result. - */ - GIOPVersion getGIOPVersion() ; - - /** Return the Codebase of this profile. Caches the result. - */ - String getCodebase() ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/IIOPProfileTemplate.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/IIOPProfileTemplate.java deleted file mode 100644 index 939ec305b1f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/IIOPProfileTemplate.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior.iiop; - -import java.util.List ; -import java.util.Iterator ; - -import org.omg.CORBA_2_3.portable.OutputStream ; - -import com.sun.corba.se.spi.ior.TaggedProfileTemplate ; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion ; -import com.sun.corba.se.spi.orb.ORB ; - -/** - * IIOPProfileTemplate represents the parts of an IIOPProfile that are independent - * of the object identifier. It is a container of tagged components. - */ -public interface IIOPProfileTemplate extends TaggedProfileTemplate -{ - /** Return the GIOP version of this profile. - */ - public GIOPVersion getGIOPVersion() ; - - /** Return the IIOP address from the IIOP profile. This is called the - * primary address here since other addresses may be contained in - * components. - */ - public IIOPAddress getPrimaryAddress() ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/JavaCodebaseComponent.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/JavaCodebaseComponent.java deleted file mode 100644 index 11106e513a7..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/JavaCodebaseComponent.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior.iiop; - -import com.sun.corba.se.spi.ior.TaggedComponent ; - -/** - * @author Ken Cavanaugh - */ -public interface JavaCodebaseComponent extends TaggedComponent -{ - public String getURLs() ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/MaxStreamFormatVersionComponent.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/MaxStreamFormatVersionComponent.java deleted file mode 100644 index c67e942dcc8..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/MaxStreamFormatVersionComponent.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.spi.ior.iiop; - -import com.sun.corba.se.spi.ior.TaggedComponent ; - -// Java to IDL ptc 02-01-12 1.4.11 -// TAG_RMI_CUSTOM_MAX_STREAM_FORMAT -public interface MaxStreamFormatVersionComponent extends TaggedComponent -{ - public byte getMaxStreamFormatVersion() ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/ORBTypeComponent.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/ORBTypeComponent.java deleted file mode 100644 index d9dabe03918..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/ORBTypeComponent.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.ior.iiop; - -import com.sun.corba.se.spi.ior.TaggedComponent ; - -/** - * @author Ken Cavanaugh - */ -public interface ORBTypeComponent extends TaggedComponent -{ - public int getORBType() ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/RequestPartitioningComponent.java b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/RequestPartitioningComponent.java deleted file mode 100644 index a6716d9c85b..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iiop/RequestPartitioningComponent.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.spi.ior.iiop; - -import com.sun.corba.se.spi.ior.TaggedComponent; - -public interface RequestPartitioningComponent extends TaggedComponent -{ - public int getRequestPartitioningId(); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iornotes b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iornotes deleted file mode 100644 index 9784546c7ed..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/iornotes +++ /dev/null @@ -1,107 +0,0 @@ -Implementation hierarchies in the IOR code - -Utility classes: - impl.ior.ByteBuffer class used to speed up computation of the adapter id - impl.ior.EncapsulationUtility misc. utilities for dealing with CDR encapsulation - impl.ior.FreezableList special list class that can change from mutable to immutable (one way only) - impl.ior.MinorCodes minor codes for all IOR errors - impl.ior.ORTImpl wrapper around IORTemplate for ORT - spi.ior.IORFactories factory for all basic IOR types - spi.ior.IIOP.???Factories factory for IIOP IOR factory types (IIOPProfile, IIOPProfileTemplate, - and all of the supported IIOP tagged component factories) - This needs to provide access to all of the IdentifiableFactory instances - we need for registration. It also needs to provide factory methods for - creating all of these types. - impl.ior.iiop.TaggedComponentFactories needs to be absorbed here. - - -Support for non-registered (unknown) TaggedComponent and TaggedProfile instances - impl.ior.GenericIdEncapsulation - impl.ior.GenericTaggedComponent - impl.ior.GenericTaggedProfile - -Basic common representation for writing, getting ids, inherited lists: - spi.ior.IdentifiableContainerBase - spi.ior.Writeable - spi.ior.Identifiable - spi.ior.IdentifiableBase - -Some basic IOR types and their implementation: - spi.ior.IOR - impl.ior.IORImpl - - spi.ior.IORTemplate - impl.ior.IORTemplateImpl - - spi.ior.IdentifiableFactory (the basic factory type, which is never created in the spi.ior package. - All instances of this factory are necessarily protocol dependent, for example IIOP in the - spi.ior.iiop package). - spi.ior.IdentifiableFactoryFinder - impl.ior.IdentifiableFactoryFinderBase - impl.ior.TaggedComponentFactoryFinderImpl - impl.ior.TaggedProfileFactoryFinderImpl - - spi.ior.ObjectAdapterId - impl.ior.ObjectAdapterIdBase - impl.ior.ObjectAdapterIdArray - impl.ior.ObjectAdapterIdNumber - - spi.ior.ObjectId - impl.ior.ObjectIdImpl - - spi.ior.ObjectKey - impl.ior.ObjectKeyImpl - -The ObjectKeyTemplate family, which needs some work for pluggability yet: - impl.ior.ObjectKeyFactory - impl.ior.ObjectKeyTemplateFactory : should this be in the SPI? - spi.ior.ObjectKeyTemplate - impl.ior.WireObjectKeyTemplate - impl.ior.ObjectKeyTemplateBase - impl.ior.OldObjectKeyTemplateBase - impl.ior.OldJIDLObjectKeyTemplate - impl.ior.OldPOAObjectKeyTemplate - impl.ior.NewObjectKeyTemplateBase - impl.ior.JIDLObjectKeyTemplate - impl.ior.POAObjectKeyTemplate - -IIOP types and their implementations: - spi.ior.TaggedComponent - spi.ior.TaggedComponentBase - impl.ior.iiop.AlternateIIOPAddressComponent - impl.ior.iiop.CodeSetsComponent - impl.ior.iiop.JavaCodebaseComponent - impl.ior.iiop.MaxStreamFormatVersionComponent - impl.ior.iiop.ORBTypeComponent - impl.ior.iiop.PoliciesComponent - - spi.ior.TaggedProfile - spi.ior.iiop.IIOPProfile - impl.ior.iiop.IIOPProfileImpl - - spi.ior.TaggedProfileTemplate - spi.ior.iiop.IIOPProfileTemplate - impl.ior.iiop.IIOPProfileTemplateImpl - - spi.ior.iiop.IIOPAddress - impl.ior.iiop.IIOPAddressBase - impl.ior.iiop.IIOPAddressFutureImpl - impl.ior.iiop.IIOPAddressImpl - -Issues: - -1. GIOPVersion.chooseRequestVersion( ORB, IOR ) is not well-defined: it should be - (ORB, IIOPProfile). - Call sites: - Connection.locate: not used - Called from GIOPImpl.locate: not used - CorbaContactInfoImpl.createMessageMediator - This needs a version that looks only at a single profile. - -2. MessageBase.createRequest takes an IOR instead of an IIOPProfile. - -3. CDRInputStream_1_0.read_Object( Class ) calls IOR.getCodebase() in - a call to Utility.loadStubClass, which is - only defined on a profile. What do we do here? - Similar problem in same class internalIORToObject, which call IOR.getServant - and IOR.getCodebase. IOR.getCodeBase is called in loadStub. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/package.html b/src/java.corba/share/classes/com/sun/corba/se/spi/ior/package.html deleted file mode 100644 index e3784dcc4a4..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/ior/package.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - -

            -Provides access to the components and profiles in an IOR without the overhead -of CDR encoding. -

            -The abstract model of IORs works as follows: - -

              -
            • An IOR has a type ID string, and contains TaggedProfile instances.
            • -
            • An IIOPProfile isA TaggedProfile.
            • -
            • An IIOPProfile is composed of an IIOPProfileTemplate and an object ID.
            • -
            • An IIOPProfileTemplate has an ObjectKeyTemplate, and contains TaggedComponents.
            • -
            • A TaggedComponent has an ID, and can be written to an OuputStream.
            • -
            • A TaggedComponentFactory reads a TaggedComponent from an InputStream.
            • -
            -

            -In all cases, containment is represented by having the appropriate interface (IOR and -IIOPProfileTemplate above) extend java.util.List. This makes it easy to use all of the -facilities in the Java collections framework with IORs. However, note that all -objects available through these APIs are immutable. Thus all list update operations -through UnsupportedOperationException, and list iterators cannot modify the underlying -list. -

            -Templates are used because the basic object adapter model for object creation is to -establish all properties of an IOR (except for type and object ID) when the object -adapter is created. This has been present for the POA essentially from the beginning, -since policies can only be passed to create_POA, and cannot be changed on an existing -POA. The Portable Interceptors work has also made this clear, since the IOR interceptor -runs only when an object adapter is created, which is the only time that user code -can add tagged components to an IOR. - - - diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/connection/Connection.java b/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/connection/Connection.java deleted file mode 100644 index 653d776c187..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/connection/Connection.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.legacy.connection; - -/** - * This interface represents the connection on which a request is made. - */ - -public interface Connection -{ - public java.net.Socket getSocket(); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/connection/GetEndPointInfoAgainException.java b/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/connection/GetEndPointInfoAgainException.java deleted file mode 100644 index f81b0a58fc6..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/connection/GetEndPointInfoAgainException.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.legacy.connection; - -import com.sun.corba.se.spi.transport.SocketInfo; - -/** - * This exception is raised by ORBSocketFactory.createSocket. - * It informs the ORB that it should call - * ORBSocketFactory.getEndPointInfo again with the - * given socketInfo object as an argument (i.e., a cookie). - * - */ - -public class GetEndPointInfoAgainException - extends Exception -{ - private SocketInfo socketInfo; - - public GetEndPointInfoAgainException(SocketInfo socketInfo) - { - this.socketInfo = socketInfo; - } - - public SocketInfo getEndPointInfo() - { - return socketInfo; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/connection/LegacyServerSocketEndPointInfo.java b/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/connection/LegacyServerSocketEndPointInfo.java deleted file mode 100644 index 012ce2a3e6a..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/connection/LegacyServerSocketEndPointInfo.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.legacy.connection; - -/** - * LegacyServerSocketEndPointInfo is an abstraction of a port. - */ -public interface LegacyServerSocketEndPointInfo -{ - /** - * e.g.: "CLEAR_TEXT", "SSL", ... - */ - public String getType(); - - - /** - * Get the host name of this end point. Subcontracts must use this - * instead of InetAddress.getHostName() because this would take - * into account the value of the ORBServerHost property. - */ - public String getHostName(); - - public int getPort(); - - /** - * The ORBD's proxy port of this end point. - * Note: Pre-ORT "port-exchange" model. - */ - public int getLocatorPort(); - public void setLocatorPort(int port); - - // NAME is used while we still have a "port-exchange" ORBD - // to get what used to be called "default" or "bootstrap" endpoints. - - public static final String DEFAULT_ENDPOINT = "DEFAULT_ENDPOINT"; - public static final String BOOT_NAMING = "BOOT_NAMING"; - public static final String NO_NAME = "NO_NAME"; - - public String getName(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/connection/LegacyServerSocketManager.java b/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/connection/LegacyServerSocketManager.java deleted file mode 100644 index f30a4c39f2a..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/connection/LegacyServerSocketManager.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.legacy.connection; - -import java.util.Collection; - -import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketEndPointInfo; -import com.sun.corba.se.spi.transport.SocketOrChannelAcceptor; - -/** - * @author Harold Carr - */ -public interface LegacyServerSocketManager -{ - public int legacyGetTransientServerPort(String type); - public int legacyGetPersistentServerPort(String socketType); - public int legacyGetTransientOrPersistentServerPort(String socketType); - - public LegacyServerSocketEndPointInfo legacyGetEndpoint(String name); - - public boolean legacyIsLocalServerPort(int port); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/connection/ORBSocketFactory.java b/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/connection/ORBSocketFactory.java deleted file mode 100644 index d75aaa12005..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/connection/ORBSocketFactory.java +++ /dev/null @@ -1,358 +0,0 @@ -/* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.legacy.connection; - -import java.net.ServerSocket; -import java.net.Socket; -import java.io.IOException; - -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.transport.SocketInfo; - -/** - * - * DEPRECATED. DEPRECATED. DEPRECATED. DEPRECATED.

            - * DEPRECATED. DEPRECATED. DEPRECATED. DEPRECATED.

            - * - * This interface gives one the ability to plug in their own socket - * factory class to an ORB.

            - * - * Usage:

            - * - * One specifies a class which implements this interface via the - * - * ORBConstants.SOCKET_FACTORY_CLASS_PROPERTY - * - * property.

            - * - * Example: - - *

            - *   -Dcom.sun.CORBA.connection.ORBSocketFactoryClass=MySocketFactory
            - * 

            - * - * Typically one would use the same socket factory class on both the - * server side and the client side (but this is not required).

            - * - * A ORBSocketFactory class should have a public default - * constructor which is called once per instantiating ORB.init call. - * That ORB then calls the methods of that ORBSocketFactory - * to obtain client and server sockets.

            - * - * This interface also supports multiple server end points. See the - * documentation on createServerSocket below. - * - */ - -public interface ORBSocketFactory -{ - /** - * DEPRECATED. DEPRECATED. DEPRECATED. DEPRECATED.

            - * - * A server ORB always creates an "IIOP_CLEAR_TEXT" listening port. - * That port is put into IOP profiles of object references exported - * by an ORB.

            - * - * If - * - * createServerSocket(String type, int port) - * - * is passed IIOP_CLEAR_TEXT as a type - * argument it should then call and return - * - * new java.net.ServerSocket(int port)

            - * - * If - * - * createSocket(SocketInfo socketInfo) - * - * is passed IIOP_CLEAR_TEXT in - * socketInfo.getType() it should - * then call and return - * - *

            -     *     new java.net.Socket(socketInfo.getHost(),
            -     *                         socketInfo.getPort())
            -     * 
            - * - */ - public static final String IIOP_CLEAR_TEXT = "IIOP_CLEAR_TEXT"; - - - /** - * DEPRECATED. DEPRECATED. DEPRECATED. DEPRECATED.

            - * - * This method is used by a server side ORB.

            - * - * When an ORB needs to create a listen socket on which connection - * requests are accepted it calls - * - * createServerSocket(String type, int port). - * - * The type argument says which type of socket should be created.

            - * - * The interpretation of the type argument is the responsibility of - * an instance of ORBSocketFactory, except in the case - * of IIOP_CLEAR_TEXT, in which case a standard server - * socket should be created.

            - * - * - * Multiple Server Port API:

            - * - * In addition to the IIOP_CLEAR_TEXT listening port, it is possible - * to specify that an ORB listen on additional port of specific types.

            - * - * This API allows one to specify that an ORB should create an X, - * or an X and a Y listen socket.

            - * - * If X, to the user, means SSL, then one just plugs in an SSL - * socket factory.

            - * - * Or, another example, if X and Y, to the user, means SSL without - * authentication and SSL with authentication respectively, then they - * plug in a factory which will either create an X or a Y socket - * depending on the type given to - * - * createServerSocket(String type, int port).

            - * - * One specifies multiple listening ports (in addition to the - * default IIOP_CLEAR_TEXT port) using the - * - * ORBConstants.LISTEN_SOCKET_PROPERTY - * - * property.

            - * - * Example usage: - * - *

            -     *    ... \
            -     *    -Dcom.sun.CORBA.connection.ORBSocketFactoryClass=com.my.MySockFact \
            -     *    -Dcom.sun.CORBA.connection.ORBListenSocket=SSL:0,foo:1 \
            -     *    ...
            -     * 
            - * - * The meaning of the "type" (SSL and foo above) is controlled - * by the user.

            - * - * ORBListenSocket is only meaningful for servers.

            - * - * The property value is interpreted as follows. For each - * type/number pair:

            - * - * If number is 0 then use an emphemeral port for the listener of - * the associated type.

            - * - * If number is greater than 0 use that port number.

            - * - * An ORB creates a listener socket for each type - * specified by the user by calling - * - * createServerSocket(String type, int port) - * - * with the type specified by the user.

            - * - * After an ORB is initialized and the RootPOA has been resolved, - * it is then listening on - * all the end points which were specified. It may be necessary - * to add this additional end point information to object references - * exported by this ORB.

            - * - * Each object reference will contain the ORB's default IIOP_CLEAR_TEXT - * end point in its IOP profile. To add additional end point information - * (i.e., an SSL port) to an IOR (i.e., an object reference) one needs - * to intercept IOR creation using - * an PortableInterceptor::IORInterceptor.

            - * - * Using PortableInterceptors (with a non-standard extension):

            - * - * Register an IORInterceptor. Inside its - * establish_components operation: - * - *

            -     *
            -     * com.sun.corba.se.spi.legacy.interceptor.IORInfoExt ext;
            -     * ext = (com.sun.corba.se.spi.legacy.interceptor.IORInfoExt)info;
            -     *
            -     * int port = ext.getServerPort("myType");
            -     *
            -     * 
            - * - * Once you have the port you may add information to references - * created by the associated adapter by calling - * - * IORInfo::add_ior_component

            - * - * - * Note: if one is using a POA and the lifespan policy of that - * POA is persistent then the port number returned - * by getServerPort may - * be the corresponding ORBD port, depending on whether the POA/ORBD - * protocol is the present port exchange or if, in the future, - * the protocol is based on object reference template exchange. - * In either - * case, the port returned will be correct for the protocol. - * (In more detail, if the port exchange protocol is used then - * getServerPort will return the ORBD's port since the port - * exchange happens before, at ORB initialization. - * If object reference - * exchange is used then the server's transient port will be returned - * since the templates are exchanged after adding components.)

            - * - * - * Persistent object reference support:

            - * - * When creating persistent object references with alternate - * type/port info, ones needs to configure the ORBD to also support - * this alternate info. This is done as follows:

            - * - * - Give the ORBD the same socket factory you gave to the client - * and server.

            - * - * - specify ORBListenSocket ports of the same types that your - * servers support. You should probably specify explicit port - * numbers for ORBD if you embed these numbers inside IORs.

            - * - * Note: when using the port exchange protocol - * the ORBD and servers will exchange port - * numbers for each given type so they know about each other. - * When using object reference template exchange the server's - * transient ports are contained in the template.

            - * - * - * - specify your BadServerIdHandler (discussed below) - * using the - * - * ORBConstants.BAD_SERVER_ID_HANDLER_CLASS_PROPERTY

            - * - * Example: - * - *

            -     *
            -     * -Dcom.sun.CORBA.POA.ORBBadServerIdHandlerClass=corba.socketPersistent.MyBadServerIdHandler
            -     *
            -     * 
            - * - * The BadServerIdHandler ...

            - * - * See com.sun.corba.se.impl.activation.ServerManagerImpl.handle - * for example code on writing a bad server id handler. NOTE: This - * is an unsupported internal API. It will not exist in future releases. - *

            - * - * - * Secure connections to other services:

            - * - * If one wants secure connections to other services such as - * Naming then one should configure them with the same - * - * SOCKET_FACTORY_CLASS_PROPERTY and - * LISTEN_SOCKET_PROPERTY - * - * as used by other clients and servers in your distributed system. - * - */ - public ServerSocket createServerSocket(String type, int port) - throws - IOException; - - - - /** - * DEPRECATED. DEPRECATED. DEPRECATED. DEPRECATED.

            - * - * This method is used by a client side ORB.

            - * - * Each time a client invokes on an object reference, the reference's - * associated ORB will call - * - *

            -     *    getEndPointInfo(ORB orb,
            -     *                    IOR ior,
            -     *                    SocketInfo socketInfo)
            -     * 
            - * - * NOTE: The type of the ior argument is an internal - * representation for efficiency. If the ORBSocketFactory - * interface ever becomes standardized then the ior will - * most likely change to a standard type (e.g., a stringified ior, - * an org.omg.IOP.IOR, or ...).

            - * - * Typically, this method will look at tagged components in the - * given ior to determine what type of socket to create.

            - * - * Typically, the ior will contain a tagged component - * specifying an alternate port type and number.

            - * - * This method should return an SocketInfo object - * containing the type/host/port to be used for the connection. - * - * If there are no appropriate tagged components then this method - * should return an SocketInfo object with the type - * IIOP_CLEAR_TEXT and host/port from the ior's IOP - * profile.

            - * - * If the ORB already has an existing connection to the returned - * type/host/port, then that connection is used. Otherwise the ORB calls - * - * createSocket(SocketInfo socketInfo)

            - * - * The orb argument is useful for handling - * the ior argument.

            - * - * The SocketInfo given to getEndPointInfo - * is either null or an object obtained - * from GetEndPointInfoAgainException - * - */ - public SocketInfo getEndPointInfo(org.omg.CORBA.ORB orb, - IOR ior, - SocketInfo socketInfo); - - - /** - * DEPRECATED. DEPRECATED. DEPRECATED. DEPRECATED.

            - * - * This method is used by a client side ORB.

            - * - * This method should return a client socket of the given - * type/host/port.

            - * - * Note: the SocketInfo is the same instance as was - * returned by getSocketInfo so extra cookie info may - * be attached.

            - * - * If this method throws GetEndPointInfoAgainException then the - * ORB calls getEndPointInfo again, passing it the - * SocketInfo object contained in the exception. - * - */ - public Socket createSocket(SocketInfo socketInfo) - throws - IOException, - GetEndPointInfoAgainException; -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/connection/README.txt b/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/connection/README.txt deleted file mode 100644 index c8b528b7a3e..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/connection/README.txt +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -Summary and suggested reading order: - -============================================================================== -Connection interceptor (called an ORBSocketFactory): - -Summary: - -The server side part of the ORBSocketFactory is told the type to -create as well as a port number. - -The client side part of the ORBSocketFactory is called on every client -request. An ORB first asks the factory for type/host/port information -(given an IOR). If the ORB already has a connection of the -type/host/port it will use the existing connection. Otherwise it will -then ask the factory to create a client socket, giving it that -type/host/port. Finally, the createSocket method may throw an -exception to tell the ORB to ask it for type/host/port info again. -The information passed back and forth between the ORB and factory can -act as a cookie for the factory if desired. - -Interfaces: - - com.sun.corba.se.spi.legacy.connection.ORBSocketFactory - com.sun.corba.se.spi.legacy.connection.EndPointInfo - com.sun.corba.se.spi.legacy.connection.GetEndPointInfoAgainException - -============================================================================== -Access to a request's socket: - -Summary: - -The request's socket is available via ClientRequestInfo and -ServerRequestInfo. We enable this by having them implement the -RequestInfoExt interface. - -Interfaces: - - com.sun.corba.se.spi.legacy.interceptor.RequestInfoExt - com.sun.corba.se.spi.legacy.connection.Connection - -============================================================================== -Extending IORInfo to support the multiple server port API: - -Summary: - -We support the multiple server port API in PortableInterceptors by -having IORInfo implement the IORInfoExt interface. The description on -how to use the multiple server port APIs is found in -ORBSocketFactory.java. - -Interfaces: - - com.sun.corba.se.spi.legacy.interceptor.IORInfoExt - com.sun.corba.se.spi.legacy.interceptor.UnknownType - -;; End. - - diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/interceptor/IORInfoExt.java b/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/interceptor/IORInfoExt.java deleted file mode 100644 index fdf2239caa5..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/interceptor/IORInfoExt.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.legacy.interceptor; - -import com.sun.corba.se.spi.oa.ObjectAdapter; - -public interface IORInfoExt -{ - public int getServerPort(String type) - throws - UnknownType; - - public ObjectAdapter getObjectAdapter(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/interceptor/ORBInitInfoExt.java b/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/interceptor/ORBInitInfoExt.java deleted file mode 100644 index 9e6d4b526a4..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/interceptor/ORBInitInfoExt.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.legacy.interceptor; - -import com.sun.corba.se.spi.orb.ORB ; - -/** The interface defines an extension to the standard ORBInitInfo - * that gives access to the ORB being initialized. Interceptors run - * as the last stage of initialization of the ORB, so the ORB - * instance returned by getORB is fully initialized. Note that - * this facility eventually shows up post-CORBA 3.0 as a result - * of the resolution of OMG core issue on accessing the ORB from - * local objects. - */ -public interface ORBInitInfoExt -{ - ORB getORB() ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/interceptor/RequestInfoExt.java b/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/interceptor/RequestInfoExt.java deleted file mode 100644 index e57f9529a43..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/interceptor/RequestInfoExt.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.legacy.interceptor; - -import com.sun.corba.se.spi.legacy.connection.Connection; - -/** - * This interface is implemented by our implementation of - * PortableInterceptor.ClientRequestInfo and - * PortableInterceptor.ServerRequestInfo. - */ - -public interface RequestInfoExt -{ - /** - * @return The connection on which the request is made. - * The return value will be null when a local transport - * is used. - */ - public Connection connection(); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/interceptor/UnknownType.java b/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/interceptor/UnknownType.java deleted file mode 100644 index 651892efd5d..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/interceptor/UnknownType.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.legacy.interceptor; - -public class UnknownType - extends - Exception -{ - public UnknownType() - { - super(); - } - - public UnknownType(String msg) - { - super(msg); - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/logging/CORBALogDomains.java b/src/java.corba/share/classes/com/sun/corba/se/spi/logging/CORBALogDomains.java deleted file mode 100644 index 978b967c674..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/logging/CORBALogDomains.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.logging ; - -/** Defines constants for all of the logging domains used in the ORB. - * Note that this is the suffix to the log domain. The full domain is given by - * javax.enterprise.resource.corba.{ORBId}.{Log domain} - * where {ORBId} is the ORB ID of the ORB instance doing the logging. - *

            - * The ORB implementation packages are mapped into these domains as follows: - *

              - *
            • activation: orbd.* - *
            • corba: rpc.presentation (CORBA API, typecode/any), oa.invocation (DII) - *
            • core: service context code in rpc.protocol (will eventually move to its own package) - *
            • dynamicany: rpc.presentation - *
            • encoding: rpc.encoding - *
            • iiop: rmiiop.delegate (ShutdownUtilDelegate needs to move somewhere) - *
            • interceptors: rpc.protocol - *
            • io: rpc.encoding - *
            • ior: oa.ior - *
            • javax: rmiiiop.delegate - *
            • logging: logging does not have a domain - *
            • naming: naming - *
            • oa: oa - *
            • orb: orb.lifecycle - *
            • orbutil: util - *
            • protocol: rpc.protocol - *
            • resolver: orb.resolver - *
            • transport: rpc.transport - *
            • txpoa: this will be removed in the future. - *
            • util: util - *
            - */ -public abstract class CORBALogDomains { - private CORBALogDomains() {} - - // Top level log domain for CORBA - public static final String TOP_LEVEL_DOMAIN = "javax.enterprise.resource.corba"; - - public static final String RPC = "rpc" ; - - /** Log domain for code directly implementing the CORBA API and - * the typecode/any machinery. - */ - public static final String RPC_PRESENTATION = "rpc.presentation" ; - - /** Log domain for any sort of wire encoding used in marshalling - */ - public static final String RPC_ENCODING = "rpc.encoding" ; - - /** Log domain for the code used to handle any kind of invocation - * protocol. This includes client and server delegates, client and - * server request dispatchers, service contexts, portable interceptors, - * and the GIOP protocol (but not CDR representation of data). - */ - public static final String RPC_PROTOCOL = "rpc.protocol" ; - - /** Log domain for low-level transport details, which are - * independent of encoding and presentation details. This - * includes selectors, acceptors, connections, connection management, - * and any other transport management functions. - */ - public static final String RPC_TRANSPORT = "rpc.transport" ; - - public static final String NAMING = "naming" ; - - /** Log domain for naming context creation and destruction. - */ - public static final String NAMING_LIFECYCLE = "naming.lifecycle" ; - - /** Log domain for name service lookup. - */ - public static final String NAMING_READ = "naming.read" ; - - /** Log domain for name service bind, rebind, destroy, and other state - * change operations. - */ - public static final String NAMING_UPDATE = "naming.update" ; - - public static final String ORBD = "orbd" ; - - /** Log domain for the ORBD locator function, which forwards - * client requests to their current server incarnation. - */ - public static final String ORBD_LOCATOR = "orbd.locator" ; - - /** Log domain for the ORBD activator function, which starts - * server instances on demand. - */ - public static final String ORBD_ACTIVATOR = "orbd.activator" ; - - /** Log domain for the Implementation Repository. - */ - public static final String ORBD_REPOSITORY = "orbd.repository" ; - - /** Log domain for the servertool utilitiy used to update the - * implementation repository. - */ - public static final String ORBD_SERVERTOOL = "orbd.servertool" ; - - public static final String ORB = "orb" ; - - /** Log domain for ORB initialization, configuration, startup, - * and shutdown. - */ - public static final String ORB_LIFECYCLE = "orb.lifecycle" ; - - /** Log domain for ORB client side name resolution and supporting - * functions such as INS. - */ - public static final String ORB_RESOLVER = "orb.resolver" ; - - public static final String OA = "oa" ; - - /** Log domain for creation, destruction, and state change of - * Object Adapters and related classes (e.g. POAManager). - */ - public static final String OA_LIFECYCLE = "oa.lifecycle" ; - - /** Log domain for all IOR related code. - */ - public static final String OA_IOR = "oa.ior" ; - - /** Log domain for object adapter request dispatch. - */ - public static final String OA_INVOCATION = "oa.invocation" ; - - public static final String RMIIIOP = "rmiiiop" ; - - /** Log domain for the RMI-IIOP implementation in the Stub, Util, and - * PortableRemoteObject delegates. - */ - public static final String RMIIIOP_DELEGATE = "rmiiiop.delegate" ; - - /** Log domain for utility classes. - */ - public static final String UTIL = "util" ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/logging/LogWrapperBase.java b/src/java.corba/share/classes/com/sun/corba/se/spi/logging/LogWrapperBase.java deleted file mode 100644 index bc24147e36f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/logging/LogWrapperBase.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.logging ; - -import java.util.logging.Level ; -import java.util.logging.Logger ; -import java.util.logging.LogRecord ; - -public abstract class LogWrapperBase { - protected Logger logger ; - - protected String loggerName ; - - protected LogWrapperBase( Logger logger ) - { - this.logger = logger ; - this.loggerName = logger.getName( ); - } - - protected void doLog( Level level, String key, Object[] params, Class wrapperClass, - Throwable thr ) - { - LogRecord lrec = new LogRecord( level, key ) ; - if (params != null) - lrec.setParameters( params ) ; - inferCaller( wrapperClass, lrec ) ; - lrec.setThrown( thr ) ; - lrec.setLoggerName( loggerName ); - lrec.setResourceBundle( logger.getResourceBundle() ) ; - logger.log( lrec ) ; - } - - private void inferCaller( Class wrapperClass, LogRecord lrec ) - { - // Private method to infer the caller's class and method names - - // Get the stack trace. - StackTraceElement stack[] = (new Throwable()).getStackTrace(); - StackTraceElement frame = null ; - String wcname = wrapperClass.getName() ; - String baseName = LogWrapperBase.class.getName() ; - - // The top of the stack should always be a method in the wrapper class, - // or in this base class. - // Search back to the first method not in the wrapper class or this class. - int ix = 0; - while (ix < stack.length) { - frame = stack[ix]; - String cname = frame.getClassName(); - if (!cname.equals(wcname) && !cname.equals(baseName)) { - break; - } - - ix++; - } - - // Set the class and method if we are not past the end of the stack - // trace - if (ix < stack.length) { - lrec.setSourceClassName(frame.getClassName()); - lrec.setSourceMethodName(frame.getMethodName()); - } - } - - protected void doLog( Level level, String key, Class wrapperClass, Throwable thr ) - { - doLog( level, key, null, wrapperClass, thr ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/logging/LogWrapperFactory.java b/src/java.corba/share/classes/com/sun/corba/se/spi/logging/LogWrapperFactory.java deleted file mode 100644 index 04444963e46..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/logging/LogWrapperFactory.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.logging ; - -import java.util.logging.Logger ; - -import com.sun.corba.se.spi.logging.LogWrapperBase ; - -public interface LogWrapperFactory { - LogWrapperBase create( Logger logger ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/Activation.mc b/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/Activation.mc deleted file mode 100644 index 1286d5d0d75..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/Activation.mc +++ /dev/null @@ -1,36 +0,0 @@ -; -; Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. -; DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -; -; This code is free software; you can redistribute it and/or modify it -; under the terms of the GNU General Public License version 2 only, as -; published by the Free Software Foundation. Oracle designates this -; particular file as subject to the "Classpath" exception as provided -; by Oracle in the LICENSE file that accompanied this code. -; -; This code is distributed in the hope that it will be useful, but WITHOUT -; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -; version 2 for more details (a copy is included in the LICENSE file that -; accompanied this code). -; -; You should have received a copy of the GNU General Public License version -; 2 along with this work; if not, write to the Free Software Foundation, -; Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -; -; Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -; or visit www.oracle.com if you need additional information or have any -; questions. -; -("com.sun.corba.se.impl.logging" "ActivationSystemException" ACTIVATION - ( - (INITIALIZE - (CANNOT_READ_REPOSITORY_DB 1 WARNING "Cannot read repository datastore") - (CANNOT_ADD_INITIAL_NAMING 2 WARNING "Cannot add initial naming")) - (INTERNAL - (CANNOT_WRITE_REPOSITORY_DB 1 WARNING "Cannot write repository datastore") - (SERVER_NOT_EXPECTED_TO_REGISTER 3 WARNING "Server not expected to register") - (UNABLE_TO_START_PROCESS 4 WARNING "Unable to start server process") - (SERVER_NOT_RUNNING 6 WARNING "Server is not running")) - (OBJECT_NOT_EXIST - (ERROR_IN_BAD_SERVER_ID_HANDLER 1 WARNING "Error in BadServerIdHandler")))) diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/IOR.mc b/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/IOR.mc deleted file mode 100644 index 3527c846080..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/IOR.mc +++ /dev/null @@ -1,45 +0,0 @@ -; -; Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. -; DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -; -; This code is free software; you can redistribute it and/or modify it -; under the terms of the GNU General Public License version 2 only, as -; published by the Free Software Foundation. Oracle designates this -; particular file as subject to the "Classpath" exception as provided -; by Oracle in the LICENSE file that accompanied this code. -; -; This code is distributed in the hope that it will be useful, but WITHOUT -; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -; version 2 for more details (a copy is included in the LICENSE file that -; accompanied this code). -; -; You should have received a copy of the GNU General Public License version -; 2 along with this work; if not, write to the Free Software Foundation, -; Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -; -; Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -; or visit www.oracle.com if you need additional information or have any -; questions. -; -("com.sun.corba.se.impl.logging" "IORSystemException" IOR - ( - (INTERNAL - (ORT_NOT_INITIALIZED 1 WARNING "ObjectReferenceTemplate is not initialized") - (NULL_POA 2 WARNING "Null POA") - (BAD_MAGIC 3 WARNING "Bad magic number {0} in ObjectKeyTemplate") - (STRINGIFY_WRITE_ERROR 4 WARNING "Error while stringifying an object reference") - (TAGGED_PROFILE_TEMPLATE_FACTORY_NOT_FOUND 5 WARNING "Could not find a TaggedProfileTemplateFactory for id {0}") - (INVALID_JDK1_3_1_PATCH_LEVEL 6 WARNING "Found a JDK 1.3.1 patch level indicator with value {0} less than JDK 1.3.1_01 value of 1") - (GET_LOCAL_SERVANT_FAILURE 7 FINE "Exception occurred while looking for ObjectAdapter {0} in IIOPProfileImpl.getServant")) - (BAD_OPERATION - (ADAPTER_ID_NOT_AVAILABLE 1 WARNING "Adapter ID not available") - (SERVER_ID_NOT_AVAILABLE 2 WARNING "Server ID not available") - (ORB_ID_NOT_AVAILABLE 3 WARNING "ORB ID not available") - (OBJECT_ADAPTER_ID_NOT_AVAILABLE 4 WARNING "Object adapter ID not available")) - (BAD_PARAM - (BAD_OID_IN_IOR_TEMPLATE_LIST 1 WARNING "Profiles in IOR do not all have the same Object ID, so conversion to IORTemplateList is impossible") - (INVALID_TAGGED_PROFILE 2 WARNING "Error in reading IIOP TaggedProfile") - (BAD_IIOP_ADDRESS_PORT 3 WARNING "Attempt to create IIOPAdiress with port {0}, which is out of range")) - (INV_OBJREF - (IOR_MUST_HAVE_IIOP_PROFILE 1 WARNING "IOR must have at least one IIOP profile")))) diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/Interceptors.mc b/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/Interceptors.mc deleted file mode 100644 index c0677129ef1..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/Interceptors.mc +++ /dev/null @@ -1,68 +0,0 @@ -; -; Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. -; DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -; -; This code is free software; you can redistribute it and/or modify it -; under the terms of the GNU General Public License version 2 only, as -; published by the Free Software Foundation. Oracle designates this -; particular file as subject to the "Classpath" exception as provided -; by Oracle in the LICENSE file that accompanied this code. -; -; This code is distributed in the hope that it will be useful, but WITHOUT -; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -; version 2 for more details (a copy is included in the LICENSE file that -; accompanied this code). -; -; You should have received a copy of the GNU General Public License version -; 2 along with this work; if not, write to the Free Software Foundation, -; Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -; -; Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -; or visit www.oracle.com if you need additional information or have any -; questions. -; -("com.sun.corba.se.impl.logging" "InterceptorsSystemException" INTERCEPTORS - ( - (BAD_PARAM - (TYPE_OUT_OF_RANGE 1 WARNING "Interceptor type {0} is out of range") - (NAME_NULL 2 WARNING "Interceptor's name is null: use empty string for anonymous interceptors")) - (BAD_INV_ORDER - (RIR_INVALID_PRE_INIT 1 WARNING "resolve_initial_reference is invalid during pre_init") - (BAD_STATE1 2 WARNING "Expected state {0}, but current state is {1}") - (BAD_STATE2 3 WARNING "Expected state {0} or {1}, but current state is {2}")) - (COMM_FAILURE - (IOEXCEPTION_DURING_CANCEL_REQUEST 1 WARNING "IOException during cancel request")) - (INTERNAL - (EXCEPTION_WAS_NULL 1 WARNING "Exception was null") - (OBJECT_HAS_NO_DELEGATE 2 WARNING "Object has no delegate") - (DELEGATE_NOT_CLIENTSUB 3 WARNING "Delegate was not a ClientRequestDispatcher") - (OBJECT_NOT_OBJECTIMPL 4 WARNING "Object is not an ObjectImpl") - (EXCEPTION_INVALID 5 WARNING "Assertion failed: Interceptor set exception to UserException or ApplicationException") - (REPLY_STATUS_NOT_INIT 6 WARNING "Assertion failed: Reply status is initialized but not SYSTEM_EXCEPTION or LOCATION_FORWARD") - (EXCEPTION_IN_ARGUMENTS 7 WARNING "Exception in arguments") - (EXCEPTION_IN_EXCEPTIONS 8 WARNING "Exception in exceptions") - (EXCEPTION_IN_CONTEXTS 9 WARNING "Exception in contexts") - (EXCEPTION_WAS_NULL_2 10 WARNING "Another exception was null") - (SERVANT_INVALID 11 WARNING "Servant invalid") - (CANT_POP_ONLY_PICURRENT 12 WARNING "Can't pop only PICurrent") - (CANT_POP_ONLY_CURRENT_2 13 WARNING "Can't pop another PICurrent") - (PI_DSI_RESULT_IS_NULL 14 WARNING "DSI result is null") - (PI_DII_RESULT_IS_NULL 15 WARNING "DII result is null") - (EXCEPTION_UNAVAILABLE 16 WARNING "Exception is unavailable") - (CLIENT_INFO_STACK_NULL 17 WARNING "Assertion failed: client request info stack is null") - (SERVER_INFO_STACK_NULL 18 WARNING "Assertion failed: Server request info stack is null") - (MARK_AND_RESET_FAILED 19 WARNING "Mark and reset failed") - (SLOT_TABLE_INVARIANT 20 WARNING "currentIndex > tableContainer.size(): {0} > {1}") - (INTERCEPTOR_LIST_LOCKED 21 WARNING "InterceptorList is locked") - (SORT_SIZE_MISMATCH 22 WARNING "Invariant: sorted size + unsorted size == total size was violated")) - (NO_IMPLEMENT - (PI_ORB_NOT_POLICY_BASED 1 WARNING "Policies not implemented")) - (OBJECT_NOT_EXIST - (ORBINITINFO_INVALID 1 FINE "ORBInitInfo object is only valid during ORB_init")) - (UNKNOWN - (UNKNOWN_REQUEST_INVOKE - 1 FINE "Unknown request invocation error")) - )) - -;;; End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/Naming.mc b/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/Naming.mc deleted file mode 100644 index 605e4f32fbf..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/Naming.mc +++ /dev/null @@ -1,53 +0,0 @@ -; -; Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. -; DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -; -; This code is free software; you can redistribute it and/or modify it -; under the terms of the GNU General Public License version 2 only, as -; published by the Free Software Foundation. Oracle designates this -; particular file as subject to the "Classpath" exception as provided -; by Oracle in the LICENSE file that accompanied this code. -; -; This code is distributed in the hope that it will be useful, but WITHOUT -; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -; version 2 for more details (a copy is included in the LICENSE file that -; accompanied this code). -; -; You should have received a copy of the GNU General Public License version -; 2 along with this work; if not, write to the Free Software Foundation, -; Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -; -; Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -; or visit www.oracle.com if you need additional information or have any -; questions. -; -("com.sun.corba.se.impl.logging" "NamingSystemException" NAMING - ( - (BAD_PARAM - (TRANSIENT_NAME_SERVER_BAD_PORT 0 WARNING "Port 0 is not a valid port in the transient name server") - (TRANSIENT_NAME_SERVER_BAD_HOST 1 WARNING "A null hostname is not a valid hostname in the transient name server") - (OBJECT_IS_NULL 2 WARNING "Invalid object reference passed in rebind or bind operation") - (INS_BAD_ADDRESS 3 WARNING "Bad host address in -ORBInitDef")) - (UNKNOWN - (BIND_UPDATE_CONTEXT_FAILED 0 WARNING "Updated context failed for bind") - (BIND_FAILURE 1 WARNING "bind failure") - (RESOLVE_CONVERSION_FAILURE 2 WARNING "Resolve conversion failed") - (RESOLVE_FAILURE 3 WARNING "Resolve failure") - (UNBIND_FAILURE 4 WARNING "Unbind failure")) - (INITIALIZE - (TRANS_NS_CANNOT_CREATE_INITIAL_NC_SYS 50 WARNING "SystemException in transient name service while initializing") - (TRANS_NS_CANNOT_CREATE_INITIAL_NC 51 WARNING "Java exception in transient name service while initializing")) - (INTERNAL - (NAMING_CTX_REBIND_ALREADY_BOUND 0 WARNING "Unexpected AlreadyBound exception iun rebind") - (NAMING_CTX_REBINDCTX_ALREADY_BOUND 1 WARNING "Unexpected AlreadyBound exception in rebind_context") - (NAMING_CTX_BAD_BINDINGTYPE 2 WARNING "Bad binding type in internal binding implementation") - (NAMING_CTX_RESOLVE_CANNOT_NARROW_TO_CTX 3 WARNING "Object reference that is not CosNaming::NamingContext bound as a context") - (NAMING_CTX_BINDING_ITERATOR_CREATE 4 WARNING "Error in creating POA for BindingIterator") - (TRANS_NC_BIND_ALREADY_BOUND 100 WARNING "Bind implementation encountered a previous bind") - (TRANS_NC_LIST_GOT_EXC 101 WARNING "list operation caught an unexpected Java exception while creating list iterator") - (TRANS_NC_NEWCTX_GOT_EXC 102 WARNING "new_context operation caught an unexpected Java excpetion creating the NewContext servant") - (TRANS_NC_DESTROY_GOT_EXC 103 WARNING "Destroy operation caught a Java exception while disconnecting from ORB") - (INS_BAD_SCHEME_NAME 105 WARNING "Stringified object reference with unknown protocol specified") - (INS_BAD_SCHEME_SPECIFIC_PART 107 WARNING "Malformed URL in -ORBInitDef") - (INS_OTHER 108 WARNING "Malformed URL in -ORBInitDef")))) diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/OMG.mc b/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/OMG.mc deleted file mode 100644 index 9af41dddb46..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/OMG.mc +++ /dev/null @@ -1,177 +0,0 @@ -; -; Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. -; DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -; -; This code is free software; you can redistribute it and/or modify it -; under the terms of the GNU General Public License version 2 only, as -; published by the Free Software Foundation. Oracle designates this -; particular file as subject to the "Classpath" exception as provided -; by Oracle in the LICENSE file that accompanied this code. -; -; This code is distributed in the hope that it will be useful, but WITHOUT -; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -; version 2 for more details (a copy is included in the LICENSE file that -; accompanied this code). -; -; You should have received a copy of the GNU General Public License version -; 2 along with this work; if not, write to the Free Software Foundation, -; Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -; -; Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -; or visit www.oracle.com if you need additional information or have any -; questions. -; -("com.sun.corba.se.impl.logging" "OMGSystemException" OMG - ( - (BAD_CONTEXT - (IDL_CONTEXT_NOT_FOUND 1 WARNING "IDL context not found") - (NO_MATCHING_IDL_CONTEXT 2 WARNING "No matching IDL context property")) - (BAD_INV_ORDER - (DEP_PREVENT_DESTRUCTION 1 WARNING "Dependency exists in IFR preventing destruction of this object") - (DESTROY_INDESTRUCTIBLE 2 WARNING "Attempt to destroy indestructible objects in IFR") - (SHUTDOWN_WAIT_FOR_COMPLETION_DEADLOCK 3 WARNING "Operation would deadlock") - (BAD_OPERATION_AFTER_SHUTDOWN 4 WARNING "ORB has shutdown") - (BAD_INVOKE 5 WARNING "Attempt to invoke send or invoke operation of the same Request object more than once ") - (BAD_SET_SERVANT_MANAGER 6 WARNING "Attempt to set a servent manager after one has already been set") - (BAD_ARGUMENTS_CALL 7 WARNING "ServerRequest::arguments called more than once or after a call to ServerRequest::set_exception") - (BAD_CTX_CALL 8 WARNING "ServerRequest::ctx called more than once or before ServerRequest::arguments or after ServerRequest::ctx, ServerRequest::set_result or ServerRequest::set_exception") - (BAD_RESULT_CALL 9 WARNING "ServerRequest::set_result called more than once or before ServerRequest::arguments or after ServerRequest::set_result or ServerRequest::set_exception") - (BAD_SEND 10 WARNING "Attempt to send a DII request after it was sent previously") - (BAD_POLL_BEFORE 11 WARNING "Attempt to poll a DII request or to retrieve its result before the request was sent") - (BAD_POLL_AFTER 12 WARNING "Attempt to poll a DII request or to retrieve its result after the result was retrieved previously") - (BAD_POLL_SYNC 13 WARNING "Attempt to poll a synchronous DII request or to retrieve results from a synchronous DII request") - (INVALID_PI_CALL1 14 FINE "Invalid call to forward_reference() when reply status is not LOCATION_FORWARD") - (INVALID_PI_CALL2 14 FINE "Cannot access this attribute or method at this point") - (INVALID_PI_CALL3 14 FINE "Cannot call set_slot from within an ORBInitializer") - (INVALID_PI_CALL4 14 FINE "Cannot call get_slot from within an ORBInitializer") - (SERVICE_CONTEXT_ADD_FAILED 15 FINE "Service context add failed in portable interceptor because a service context with id {0} already exists") - (POLICY_FACTORY_REG_FAILED 16 WARNING "Registration of PolicyFactory failed because a factory already exists for the given PolicyType {0}") - (CREATE_POA_DESTROY 17 WARNING "POA cannot create POAs while undergoing destruction") - (PRIORITY_REASSIGN 18 WARNING "Attempt to reassign priority") - (XA_START_OUTSIZE 19 WARNING "An OTS/XA integration xa_start() call returned XAER_OUTSIDE") - (XA_START_PROTO 20 WARNING "An OTS/XA integration xa_ call returned XAER_PROTO")) - (BAD_OPERATION - (BAD_SERVANT_MANAGER_TYPE 1 WARNING "ServantManager returned wrong servant type") - (OPERATION_UNKNOWN_TO_TARGET 2 WARNING "Operation or attribute not known to target object ")) - (BAD_PARAM - (UNABLE_REGISTER_VALUE_FACTORY 1 WARNING "Failure to register, unregister or lookup value factory") - (RID_ALREADY_DEFINED 2 WARNING "RID already defined in IFR") - (NAME_USED_IFR 3 WARNING "Name already used in the context in IFR ") - (TARGET_NOT_CONTAINER 4 WARNING "Target is not a valid container") - (NAME_CLASH 5 WARNING "Name clash in inherited context") - (NOT_SERIALIZABLE 6 WARNING "Class {0} is not Serializable") - (SO_BAD_SCHEME_NAME 7 WARNING "string_to_object conversion failed due to bad scheme name") - (SO_BAD_ADDRESS 8 WARNING "string_to_object conversion failed due to bad address") - (SO_BAD_SCHEMA_SPECIFIC 9 WARNING "string_to_object conversion failed due to bad bad schema specific part") - (SO_NON_SPECIFIC 10 WARNING "string_to_object conversion failed due to non specific reason") - (IR_DERIVE_ABS_INT_BASE 11 WARNING "Attempt to derive abstract interface from non-abstract base interface in the Interface Repository") - (IR_VALUE_SUPPORT 12 WARNING "Attempt to let a ValueDef support more than one non-abstract interface in the Interface Repository") - (INCOMPLETE_TYPECODE 13 WARNING "Attempt to use an incomplete TypeCode as a parameter") - (INVALID_OBJECT_ID 14 WARNING "Invalid object id passed to POA::create_reference_by_id ") - (TYPECODE_BAD_NAME 15 WARNING "Bad name argument in TypeCode operation") - (TYPECODE_BAD_REPID 16 WARNING "Bad RepositoryId argument in TypeCode operation") - (TYPECODE_INV_MEMBER 17 WARNING "Invalid member name in TypeCode operation ") - (TC_UNION_DUP_LABEL 18 WARNING "Duplicate label value in create_union_tc ") - (TC_UNION_INCOMPATIBLE 19 WARNING "Incompatible TypeCode of label and discriminator in create_union_tc ") - (TC_UNION_BAD_DISC 20 WARNING "Supplied discriminator type illegitimate in create_union_tc ") - (SET_EXCEPTION_BAD_ANY 21 WARNING "Any passed to ServerRequest::set_exception does not contain an exception ") - (SET_EXCEPTION_UNLISTED 22 WARNING "Unlisted user exception passed to ServerRequest::set_exception ") - (NO_CLIENT_WCHAR_CODESET_CTX 23 WARNING "wchar transmission code set not in service context") - (ILLEGAL_SERVICE_CONTEXT 24 WARNING "Service context is not in OMG-defined range") - (ENUM_OUT_OF_RANGE 25 WARNING "Enum value out of range") - (INVALID_SERVICE_CONTEXT_ID 26 FINE "Invalid service context Id in portable interceptor") - (RIR_WITH_NULL_OBJECT 27 WARNING "Attempt to call register_initial_reference with a null Object") - (INVALID_COMPONENT_ID 28 FINE "Invalid component Id {0} in portable interceptor") - (INVALID_PROFILE_ID 29 WARNING "Profile ID does not define a known profile or it is impossible to add components to that profile") - (POLICY_TYPE_DUPLICATE 30 WARNING "Two or more Policy objects with the same PolicyType value supplied to Object::set_policy_overrides or PolicyManager::set_policy_overrides") - (BAD_ONEWAY_DEFINITION 31 WARNING "Attempt to define a oneway operation with non-void result, out or inout parameters or user exceptions") - (DII_FOR_IMPLICIT_OPERATION 32 WARNING "DII asked to create request for an implicit operation") - (XA_CALL_INVAL 33 WARNING "An OTS/XA integration xa_ call returned XAER_INVAL") - (UNION_BAD_DISCRIMINATOR 34 WARNING "Union branch modifier method called with bad case label discriminator") - (CTX_ILLEGAL_PROPERTY_NAME 35 WARNING "Illegal IDL context property name") - (CTX_ILLEGAL_SEARCH_STRING 36 WARNING "Illegal IDL property search string") - (CTX_ILLEGAL_NAME 37 WARNING "Illegal IDL context name") - (CTX_NON_EMPTY 38 WARNING "Non-empty IDL context") - (INVALID_STREAM_FORMAT_VERSION 39 WARNING "Unsupported RMI/IDL custom value type stream format {0}") - (NOT_A_VALUEOUTPUTSTREAM 40 WARNING "ORB output stream does not support ValueOutputStream interface") - (NOT_A_VALUEINPUTSTREAM 41 WARNING "ORB input stream does not support ValueInputStream interface")) - (BAD_TYPECODE - (MARSHALL_INCOMPLETE_TYPECODE 1 WARNING "Attempt to marshal incomplete TypeCode") - (BAD_MEMBER_TYPECODE 2 WARNING "Member type code illegitimate in TypeCode operation") - (ILLEGAL_PARAMETER 3 WARNING "Illegal parameter type")) - (DATA_CONVERSION - (CHAR_NOT_IN_CODESET 1 WARNING "Character does not map to negotiated transmission code set") - (PRIORITY_MAP_FAILRE 2 WARNING "Failure of PriorityMapping object")) - (IMP_LIMIT - (NO_USABLE_PROFILE 1 WARNING "Unable to use any profile in IOR")) - (INITIALIZE - (PRIORITY_RANGE_RESTRICT 1 WARNING "Priority range too restricted for ORB")) - (INV_OBJREF - (NO_SERVER_WCHAR_CODESET_CMP 1 WARNING "wchar Code Set support not specified") - (CODESET_COMPONENT_REQUIRED 2 WARNING "Codeset component required for type using wchar or wstring data")) - (INV_POLICY - (IOR_POLICY_RECONCILE_ERROR 1 WARNING "Unable to reconcile IOR specified policy with effective policy override") - (POLICY_UNKNOWN 2 WARNING "Invalid PolicyType") - (NO_POLICY_FACTORY 3 WARNING "No PolicyFactory has been registered for the given PolicyType")) - (INTERNAL - (XA_RMERR 1 WARNING "An OTS/XA integration xa_ call returned XAER_RMERR") - (XA_RMFAIL 2 WARNING "An OTS/XA integration xa_ call returned XAER_RMFAIL")) - (INTF_REPOS - (NO_IR 1 WARNING "Interface Repository not available") - (NO_INTERFACE_IN_IR 2 WARNING "No entry for requested interface in Interface Repository")) - (MARSHAL - (UNABLE_LOCATE_VALUE_FACTORY 1 FINE "Unable to locate value factory") - (SET_RESULT_BEFORE_CTX 2 WARNING "ServerRequest::set_result called before ServerRequest::ctx when the operation IDL contains a context clause ") - (BAD_NVLIST 3 WARNING "NVList passed to ServerRequest::arguments does not describe all parameters passed by client") - (NOT_AN_OBJECT_IMPL 4 WARNING "Attempt to marshal Local object") - (WCHAR_BAD_GIOP_VERSION_SENT 5 WARNING "wchar or wstring data erroneosly sent by client over GIOP 1.0 connection ") - (WCHAR_BAD_GIOP_VERSION_RETURNED 6 WARNING "wchar or wstring data erroneously returned by server over GIOP 1.0 connection ") - (UNSUPPORTED_FORMAT_VERSION 7 WARNING "Unsupported RMI/IDL custom value type stream format") - (RMIIIOP_OPTIONAL_DATA_INCOMPATIBLE1 8 WARNING "No optional data available") - (RMIIIOP_OPTIONAL_DATA_INCOMPATIBLE2 8 WARNING "Not enough space left in current chunk") - (RMIIIOP_OPTIONAL_DATA_INCOMPATIBLE3 8 FINE "Not enough optional data available")) - (NO_IMPLEMENT - (MISSING_LOCAL_VALUE_IMPL 1 WARNING "Missing local value implementation") - (INCOMPATIBLE_VALUE_IMPL 2 WARNING "Incompatible value implementation version") - (NO_USABLE_PROFILE_2 3 WARNING "Unable to use any profile in IOR") - (DII_LOCAL_OBJECT 4 WARNING "Attempt to use DII on Local object") - (BIO_RESET 5 WARNING "Biomolecular Sequence Analysis iterator cannot be reset") - (BIO_META_NOT_AVAILABLE 6 WARNING "Biomolecular Sequence Analysis metadata is not available as XML") - (BIO_GENOMIC_NO_ITERATOR 7 WARNING "Genomic Maps iterator cannot be reset")) - (NO_RESOURCES - (PI_OPERATION_NOT_SUPPORTED1 1 FINE "The portable Java bindings do not support arguments()") - (PI_OPERATION_NOT_SUPPORTED2 1 FINE "The portable Java bindings do not support exceptions()") - (PI_OPERATION_NOT_SUPPORTED3 1 FINE "The portable Java bindings do not support contexts()") - (PI_OPERATION_NOT_SUPPORTED4 1 FINE "The portable Java bindings do not support operation_context()") - (PI_OPERATION_NOT_SUPPORTED5 1 FINE "The portable Java bindings do not support result()") - (PI_OPERATION_NOT_SUPPORTED6 1 FINE "The object ID was never set") - (PI_OPERATION_NOT_SUPPORTED7 1 FINE "The ObjectKeyTemplate was never set") - (PI_OPERATION_NOT_SUPPORTED8 1 FINE "ServerRequest::arguments() was never called") - (NO_CONNECTION_PRIORITY 2 WARNING "No connection for request's priority")) - (TRANSACTION_ROLLEDBACK - (XA_RB 1 WARNING "An OTS/XA integration xa_ call returned XAER_RB") - (XA_NOTA 2 WARNING "An OTS/XA integration xa_ call returned XAER_NOTA") - (XA_END_TRUE_ROLLBACK_DEFERRED 3 WARNING "OTS/XA integration end() was called with success set to TRUE while transaction rollback was deferred")) - (TRANSIENT - (POA_REQUEST_DISCARD 1 WARNING "Request discarded because of resource exhaustion in POA or because POA is in DISCARDING state") - (NO_USABLE_PROFILE_3 2 WARNING "No usable profile in IOR") - (REQUEST_CANCELLED 3 WARNING "Request cancelled") - (POA_DESTROYED 4 WARNING "POA destroyed")) - (OBJECT_NOT_EXIST - (UNREGISTERED_VALUE_AS_OBJREF 1 WARNING "Attempt to pass an unactivated (unregistered) value as an object reference") - (NO_OBJECT_ADAPTOR 2 FINE "Failed to create or locate Object Adaptor") - (BIO_NOT_AVAILABLE 3 WARNING "Biomolecular Sequence Analysis Service is no longer available") - (OBJECT_ADAPTER_INACTIVE 4 WARNING "Object Adapter Inactive")) - (OBJ_ADAPTER - (ADAPTER_ACTIVATOR_EXCEPTION 1 WARNING "System exception in POA::unknown_adapter for POA {0} with parent POA {1}") - (BAD_SERVANT_TYPE 2 WARNING "Incorrect servant type returned by servant manager ") - (NO_DEFAULT_SERVANT 3 WARNING "No default servant available [POA policy]") - (NO_SERVANT_MANAGER 4 WARNING "No servant manager available [POA Policy]") - (BAD_POLICY_INCARNATE 5 WARNING "Violation of POA policy by ServantActivator::incarnate") - (PI_EXC_COMP_ESTABLISHED 6 WARNING "Exception in PortableInterceptor::IORInterceptor.components_established") - (NULL_SERVANT_RETURNED 7 FINE "Null servant returned by servant manager")) - (UNKNOWN - (UNKNOWN_USER_EXCEPTION 1 FINE "Unlisted user exception received by client ") - (UNSUPPORTED_SYSTEM_EXCEPTION 2 WARNING "Non-standard System Exception not supported") - (PI_UNKNOWN_USER_EXCEPTION 3 WARNING "An unknown user exception received by a portable interceptor")))) diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/ORBUtil.mc b/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/ORBUtil.mc deleted file mode 100644 index da1ab4de948..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/ORBUtil.mc +++ /dev/null @@ -1,407 +0,0 @@ -; - -; Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. -; DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -; -; This code is free software; you can redistribute it and/or modify it -; under the terms of the GNU General Public License version 2 only, as -; published by the Free Software Foundation. Oracle designates this -; particular file as subject to the "Classpath" exception as provided -; by Oracle in the LICENSE file that accompanied this code. -; -; This code is distributed in the hope that it will be useful, but WITHOUT -; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -; version 2 for more details (a copy is included in the LICENSE file that -; accompanied this code). -; -; You should have received a copy of the GNU General Public License version -; 2 along with this work; if not, write to the Free Software Foundation, -; Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -; -; Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -; or visit www.oracle.com if you need additional information or have any -; questions. -; -("com.sun.corba.se.impl.logging" "ORBUtilSystemException" ORBUTIL - ( - (BAD_OPERATION - (ADAPTER_ID_NOT_AVAILABLE 1 WARNING "Adapter ID not available") - (SERVER_ID_NOT_AVAILABLE 2 WARNING "Server ID not available") - (ORB_ID_NOT_AVAILABLE 3 WARNING "ORB ID not available") - (OBJECT_ADAPTER_ID_NOT_AVAILABLE 4 WARNING "Object adapter ID not available") - (CONNECTING_SERVANT 5 WARNING "Error connecting servant") - (EXTRACT_WRONG_TYPE 6 FINE "Expected typecode kind {0} but got typecode kind {1}") - (EXTRACT_WRONG_TYPE_LIST 7 WARNING "Expected typecode kind to be one of {0} but got typecode kind {1}") - (BAD_STRING_BOUNDS 8 WARNING "String length of {0} exceeds bounded string length of {1}") - (INSERT_OBJECT_INCOMPATIBLE 10 WARNING "Tried to insert an object of an incompatible type into an Any for an object reference") - (INSERT_OBJECT_FAILED 11 WARNING "insert_Object call failed on an Any") - (EXTRACT_OBJECT_INCOMPATIBLE 12 WARNING "extract_Object call failed on an Any") - (FIXED_NOT_MATCH 13 WARNING "Fixed type does not match typecode") - (FIXED_BAD_TYPECODE 14 WARNING "Tried to insert Fixed type for non-Fixed typecode") - (SET_EXCEPTION_CALLED_NULL_ARGS 23 WARNING "set_exception(Any) called with null args for DSI ServerRequest") - (SET_EXCEPTION_CALLED_BAD_TYPE 24 WARNING "set_exception(Any) called with a bad (non-exception) type") - (CONTEXT_CALLED_OUT_OF_ORDER 25 WARNING "ctx() called out of order for DSI ServerRequest") - (BAD_ORB_CONFIGURATOR 26 WARNING "ORB configurator class {0} could not be instantiated") - (ORB_CONFIGURATOR_ERROR 27 WARNING "Error in running ORB configurator") - (ORB_DESTROYED 28 WARNING "This ORB instance has been destroyed, so no operations can be performed on it") - (NEGATIVE_BOUNDS 29 WARNING "Negative bound for string TypeCode is illegal") - (EXTRACT_NOT_INITIALIZED 30 WARNING "Called typecode extract on an uninitialized typecode") - (EXTRACT_OBJECT_FAILED 31 WARNING "extract_Object failed on an uninitialized Any") - (METHOD_NOT_FOUND_IN_TIE 32 FINE "Could not find method named {0} in class {1} in reflective Tie") - (CLASS_NOT_FOUND1 33 FINE "ClassNotFoundException while attempting to load preferred stub named {0}") - (CLASS_NOT_FOUND2 34 FINE "ClassNotFoundException while attempting to load alternate stub named {0}") - (CLASS_NOT_FOUND3 35 FINE "ClassNotFoundException while attempting to load interface {0}") - (GET_DELEGATE_SERVANT_NOT_ACTIVE 36 WARNING "POA ServantNotActive exception while trying get an org.omg.CORBA.Portable.Delegate for an org.omg.PortableServer.Servant") - (GET_DELEGATE_WRONG_POLICY 37 WARNING "POA WrongPolicy exception while trying get an org.omg.CORBA.Portable.Delegate for an org.omg.PortableServer.Servant") - (SET_DELEGATE_REQUIRES_STUB 38 FINE "Call to StubAdapter.setDelegate did not pass a stub") - (GET_DELEGATE_REQUIRES_STUB 39 WARNING "Call to StubAdapter.getDelegate did not pass a stub") - (GET_TYPE_IDS_REQUIRES_STUB 40 WARNING "Call to StubAdapter.getTypeIds did not pass a stub") - (GET_ORB_REQUIRES_STUB 41 WARNING "Call to StubAdapter.getORB did not pass a stub") - (CONNECT_REQUIRES_STUB 42 WARNING "Call to StubAdapter.connect did not pass a stub") - (IS_LOCAL_REQUIRES_STUB 43 WARNING "Call to StubAdapter.isLocal did not pass a stub") - (REQUEST_REQUIRES_STUB 44 WARNING "Call to StubAdapter.request did not pass a stub") - (BAD_ACTIVATE_TIE_CALL 45 WARNING "Call to StubAdapter.activateTie did not pass a valid Tie") - (IO_EXCEPTION_ON_CLOSE 46 FINE "Useless exception on call to Closeable.close()") - ) - (BAD_PARAM - (NULL_PARAM 1 WARNING "Null parameter") - (UNABLE_FIND_VALUE_FACTORY 2 FINE "Unable to find value factory") - (ABSTRACT_FROM_NON_ABSTRACT 3 WARNING "Abstract interface derived from non-abstract interface") - (INVALID_TAGGED_PROFILE 4 WARNING "Error in reading IIOP TaggedProfile") - (OBJREF_FROM_FOREIGN_ORB 5 WARNING "Object reference came from foreign ORB") - (LOCAL_OBJECT_NOT_ALLOWED 6 FINE "Local object not allowed") - (NULL_OBJECT_REFERENCE 7 WARNING "null object reference") - (COULD_NOT_LOAD_CLASS 8 WARNING "Could not load class {0}") - (BAD_URL 9 WARNING "Malformed URL {0}") - (FIELD_NOT_FOUND 10 WARNING "Field {0} not found in parser data object") - (ERROR_SETTING_FIELD 11 WARNING "Error in setting field {0} to value {1} in parser data object") - (BOUNDS_ERROR_IN_DII_REQUEST 12 WARNING "Bounds error occurred in DII request") - (PERSISTENT_SERVER_INIT_ERROR 13 WARNING "Initialization error for persistent server") - (COULD_NOT_CREATE_ARRAY 14 WARNING "Could not create array for field {0} with component type {1} and size {2}") - (COULD_NOT_SET_ARRAY 15 WARNING "Could not set array for field {0} at index {1} with component type {2} and size {3} to value {4}") - (ILLEGAL_BOOTSTRAP_OPERATION 16 WARNING "Illegal bootstrap operation {0}") - (BOOTSTRAP_RUNTIME_EXCEPTION 17 WARNING "Runtime Exception during bootstrap operation") - (BOOTSTRAP_EXCEPTION 18 WARNING "Exception during bootstrap operation") - (STRING_EXPECTED 19 WARNING "Expected a string, but argument was not of String type") - (INVALID_TYPECODE_KIND 20 WARNING "{0} does not represent a valid kind of typecode") - (SOCKET_FACTORY_AND_CONTACT_INFO_LIST_AT_SAME_TIME - 21 WARNING "cannot have a SocketFactory and a ContactInfoList at the same time") - (ACCEPTORS_AND_LEGACY_SOCKET_FACTORY_AT_SAME_TIME - 22 WARNING "cannot have Acceptors and a legacy SocketFactory at the same time") - (BAD_ORB_FOR_SERVANT - 23 WARNING "Reflective POA Servant requires an instance of org.omg.CORBA_2_3.ORB") - (INVALID_REQUEST_PARTITIONING_POLICY_VALUE 24 WARNING - "Request partitioning value specified, {0}, is outside supported range, {1} - {2}") - (INVALID_REQUEST_PARTITIONING_COMPONENT_VALUE 25 WARNING - "Could not set request partitioning component value to {0}, valid values are {1} - {2}") - (INVALID_REQUEST_PARTITIONING_ID - 26 WARNING "Invalid request partitioning id {0}, valid values are {1} - {2}") - (ERROR_IN_SETTING_DYNAMIC_STUB_FACTORY_FACTORY - 27 FINE "ORBDynamicStubFactoryFactoryClass property had value {0}, which could not be loaded by the ORB ClassLoader" ) - ) - (BAD_INV_ORDER - (DSIMETHOD_NOTCALLED 1 WARNING "DSI method not called") - (ARGUMENTS_CALLED_MULTIPLE 2 WARNING "arguments(NVList) called more than once for DSI ServerRequest") - (ARGUMENTS_CALLED_AFTER_EXCEPTION 3 WARNING "arguments(NVList) called after exceptions set for DSI ServerRequest") - (ARGUMENTS_CALLED_NULL_ARGS 4 WARNING "arguments(NVList) called with null args for DSI ServerRequest") - (ARGUMENTS_NOT_CALLED 5 FINE "arguments(NVList) not called for DSI ServerRequest") - (SET_RESULT_CALLED_MULTIPLE 6 WARNING "set_result(Any) called more than once for DSI ServerRequest") - (SET_RESULT_AFTER_EXCEPTION 7 FINE "set_result(Any) called exception was set for DSI ServerRequest") - (SET_RESULT_CALLED_NULL_ARGS 8 WARNING "set_result(Any) called with null args for DSI ServerRequest")) - (BAD_TYPECODE - (BAD_REMOTE_TYPECODE 1 WARNING "Foreign to native typecode conversion constructor should not be called with native typecode") - (UNRESOLVED_RECURSIVE_TYPECODE 2 WARNING "Invoked operation on unresolved recursive TypeCode")) - (COMM_FAILURE - (CONNECT_FAILURE - 1 WARNING "Connection failure: socketType: {0}; hostname: {1}; port: {2}") - (CONNECTION_CLOSE_REBIND - 2 WARNING "Connection close: rebind") - (WRITE_ERROR_SEND - 3 FINE "Write error sent") - (GET_PROPERTIES_ERROR - 4 WARNING "Get properties error") - (BOOTSTRAP_SERVER_NOT_AVAIL - 5 WARNING "Bootstrap server is not available") - (INVOKE_ERROR - 6 WARNING "Invocation error") - (DEFAULT_CREATE_SERVER_SOCKET_GIVEN_NON_IIOP_CLEAR_TEXT - 7 WARNING "DefaultSocketFactory.createServerSocket only handles IIOP_CLEAR_TEXT, given {0}") - (CONNECTION_ABORT - 8 FINE "Connection abort") - (CONNECTION_REBIND - 9 FINE "Connection rebind") - (RECV_MSG_ERROR - 10 WARNING "Received a GIOP MessageError, indicating header corruption or version mismatch") - (IOEXCEPTION_WHEN_READING_CONNECTION - 11 FINE "IOException when reading connection") - (SELECTION_KEY_INVALID - 12 FINE "SelectionKey invalid on channel, {0}") - (EXCEPTION_IN_ACCEPT - 13 FINE "Unexpected {0} in accept") - (SECURITY_EXCEPTION_IN_ACCEPT - 14 FINE "Unexpected {0}, has permissions {1}") - (TRANSPORT_READ_TIMEOUT_EXCEEDED - 15 WARNING "Read of full message failed : bytes requested = {0} bytes read = {1} max wait time = {2} total time spent waiting = {3}") - (CREATE_LISTENER_FAILED - 16 SEVERE "Unable to create listener thread on the specified port: {0}") - (BUFFER_READ_MANAGER_TIMEOUT - 17 WARNING "Timeout while reading data in buffer manager") - ) - (DATA_CONVERSION - (BAD_STRINGIFIED_IOR_LEN 1 WARNING "A character did not map to the transmission code set") - (BAD_STRINGIFIED_IOR 2 WARNING "Bad stringified IOR") - (BAD_MODIFIER 3 WARNING "Unable to perform resolve_initial_references due to bad host or port configuration") - (CODESET_INCOMPATIBLE 4 WARNING "Codesets incompatible") - (BAD_HEX_DIGIT 5 WARNING "Illegal hexadecimal digit") - (BAD_UNICODE_PAIR 6 WARNING "Invalid unicode pair detected during code set conversion") - (BTC_RESULT_MORE_THAN_ONE_CHAR 7 WARNING "Tried to convert bytes to a single java char, but conversion yielded more than one Java char (Surrogate pair?)") - (BAD_CODESETS_FROM_CLIENT 8 WARNING "Client sent code set service context that we do not support") - (INVALID_SINGLE_CHAR_CTB 9 WARNING "Char to byte conversion for a CORBA char resulted in more than one byte") - (BAD_GIOP_1_1_CTB 10 WARNING "Character to byte conversion did not exactly double number of chars (GIOP 1.1 only)") - (BAD_SEQUENCE_BOUNDS 12 WARNING "Tried to insert a sequence of length {0} into a bounded sequence of maximum length {1} in an Any") - (ILLEGAL_SOCKET_FACTORY_TYPE 13 WARNING "Class {0} is not a subtype of ORBSocketFactory") - (BAD_CUSTOM_SOCKET_FACTORY 14 WARNING "{0} is not a valid custom socket factory") - (FRAGMENT_SIZE_MINIMUM 15 WARNING "Fragment size {0} is too small: it must be at least {1}") - (FRAGMENT_SIZE_DIV 16 WARNING "Illegal valiue for fragment size ({0}): must be divisible by {1}") - (ORB_INITIALIZER_FAILURE - 17 WARNING "Could not instantiate ORBInitializer {0}") - (ORB_INITIALIZER_TYPE - 18 WARNING "orb initializer class {0} is not a subtype of ORBInitializer") - (ORB_INITIALREFERENCE_SYNTAX - 19 WARNING "Bad syntax for ORBInitialReference") - (ACCEPTOR_INSTANTIATION_FAILURE - 20 WARNING "Could not instantiate Acceptor {0}") - (ACCEPTOR_INSTANTIATION_TYPE_FAILURE - 21 WARNING "Acceptor class {0} is not a subtype of Acceptor") - (ILLEGAL_CONTACT_INFO_LIST_FACTORY_TYPE - 22 WARNING "Class {0} is not a subtype of CorbaContactInfoListFactory") - (BAD_CONTACT_INFO_LIST_FACTORY - 23 WARNING "{0} is not a valid CorbaContactInfoListFactory") - (ILLEGAL_IOR_TO_SOCKET_INFO_TYPE - 24 WARNING "Class {0} is not a subtype of IORToSocketInfo") - (BAD_CUSTOM_IOR_TO_SOCKET_INFO - 25 WARNING "{0} is not a valid custom IORToSocketInfo") - (ILLEGAL_IIOP_PRIMARY_TO_CONTACT_INFO_TYPE - 26 WARNING "Class {0} is not a subtype of IIOPPrimaryToContactInfo") - (BAD_CUSTOM_IIOP_PRIMARY_TO_CONTACT_INFO - 27 WARNING "{0} is not a valid custom IIOPPrimaryToContactInfo") - - ) - (INV_OBJREF - (BAD_CORBALOC_STRING 1 WARNING "Bad corbaloc: URL") - (NO_PROFILE_PRESENT 2 WARNING "No profile in IOR")) - (INITIALIZE - (CANNOT_CREATE_ORBID_DB 1 WARNING "Cannot create ORB ID datastore") - (CANNOT_READ_ORBID_DB 2 WARNING "Cannot read ORB ID datastore") - (CANNOT_WRITE_ORBID_DB 3 WARNING "Cannot write ORB ID datastore") - (GET_SERVER_PORT_CALLED_BEFORE_ENDPOINTS_INITIALIZED 4 WARNING "legacyGetServerPort called before endpoints initialized") - (PERSISTENT_SERVERPORT_NOT_SET 5 WARNING "Persistent server port is not set") - (PERSISTENT_SERVERID_NOT_SET 6 WARNING "Persistent server ID is not set")) - (INTERNAL - (NON_EXISTENT_ORBID 1 WARNING "Non-existent ORB ID") - (NO_SERVER_SUBCONTRACT 2 WARNING "No server request dispatcher") - (SERVER_SC_TEMP_SIZE 3 WARNING "server request dispatcher template size error") - (NO_CLIENT_SC_CLASS 4 WARNING "No client request dispatcher class") - (SERVER_SC_NO_IIOP_PROFILE 5 WARNING "No IIOP profile in server request dispatcher") - (GET_SYSTEM_EX_RETURNED_NULL 6 WARNING "getSystemException returned null") - (PEEKSTRING_FAILED 7 WARNING "The repository ID of a user exception had a bad length") - (GET_LOCAL_HOST_FAILED 8 WARNING "Unable to determine local hostname from InetAddress.getLocalHost().getHostName()") - ;; 9 is not used at this time - it is available for reuse. - (BAD_LOCATE_REQUEST_STATUS 10 WARNING "Bad locate request status in IIOP locate reply") - (STRINGIFY_WRITE_ERROR 11 WARNING "Error while stringifying an object reference") - (BAD_GIOP_REQUEST_TYPE 12 WARNING "IIOP message with bad GIOP 1.0 message type") - (ERROR_UNMARSHALING_USEREXC 13 WARNING "Error in unmarshalling user exception") - (RequestDispatcherRegistry_ERROR 14 WARNING "Overflow in RequestDispatcherRegistry") - (LOCATIONFORWARD_ERROR 15 WARNING "Error in processing a LocationForward") - (WRONG_CLIENTSC 16 WARNING "Wrong client request dispatcher") - (BAD_SERVANT_READ_OBJECT 17 WARNING "Bad servant in read_Object") - (MULT_IIOP_PROF_NOT_SUPPORTED 18 WARNING "multiple IIOP profiles not supported") - (GIOP_MAGIC_ERROR 20 WARNING "Error in GIOP magic") - (GIOP_VERSION_ERROR 21 WARNING "Error in GIOP version") - (ILLEGAL_REPLY_STATUS 22 WARNING "Illegal reply status in GIOP reply message") - (ILLEGAL_GIOP_MSG_TYPE 23 WARNING "Illegal GIOP message type") - (FRAGMENTATION_DISALLOWED 24 WARNING "Fragmentation not allowed for this message type") - (BAD_REPLYSTATUS 25 WARNING "Bad status in the IIOP reply message") - (CTB_CONVERTER_FAILURE 26 WARNING "character to byte converter failure") - (BTC_CONVERTER_FAILURE 27 WARNING "byte to character converter failure") - (WCHAR_ARRAY_UNSUPPORTED_ENCODING 28 WARNING "Unsupported wchar encoding: ORB only supports fixed width UTF-16 encoding") - (ILLEGAL_TARGET_ADDRESS_DISPOSITION 29 WARNING "Illegal target address disposition value") - (NULL_REPLY_IN_GET_ADDR_DISPOSITION 30 WARNING "No reply while attempting to get addressing disposition") - (ORB_TARGET_ADDR_PREFERENCE_IN_EXTRACT_OBJECTKEY_INVALID 31 WARNING "Invalid GIOP target addressing preference") - (INVALID_ISSTREAMED_TCKIND 32 WARNING "Invalid isStreamed TCKind {0}") - (INVALID_JDK1_3_1_PATCH_LEVEL 33 WARNING "Found a JDK 1.3.1 patch level indicator with value less than JDK 1.3.1_01 value of 1") - (SVCCTX_UNMARSHAL_ERROR 34 WARNING "Error unmarshalling service context data") - (NULL_IOR 35 WARNING "null IOR") - (UNSUPPORTED_GIOP_VERSION 36 WARNING "Unsupported GIOP version {0}") - (APPLICATION_EXCEPTION_IN_SPECIAL_METHOD 37 WARNING "Application exception in special method: should not happen") - (STATEMENT_NOT_REACHABLE1 38 WARNING "Assertion failed: statement not reachable (1)") - (STATEMENT_NOT_REACHABLE2 39 WARNING "Assertion failed: statement not reachable (2)") - (STATEMENT_NOT_REACHABLE3 40 WARNING "Assertion failed: statement not reachable (3)") - (STATEMENT_NOT_REACHABLE4 41 FINE "Assertion failed: statement not reachable (4)") - (STATEMENT_NOT_REACHABLE5 42 WARNING "Assertion failed: statement not reachable (5)") - (STATEMENT_NOT_REACHABLE6 43 WARNING "Assertion failed: statement not reachable (6)") - (UNEXPECTED_DII_EXCEPTION 44 WARNING "Unexpected exception while unmarshalling DII user exception") - (METHOD_SHOULD_NOT_BE_CALLED 45 WARNING "This method should never be called") - (CANCEL_NOT_SUPPORTED 46 WARNING "We do not support cancel request for GIOP 1.1") - (EMPTY_STACK_RUN_SERVANT_POST_INVOKE 47 WARNING "Empty stack exception while calling runServantPostInvoke") - (PROBLEM_WITH_EXCEPTION_TYPECODE 48 WARNING "Bad exception typecode") - (ILLEGAL_SUBCONTRACT_ID 49 WARNING "Illegal Subcontract id {0}") - (BAD_SYSTEM_EXCEPTION_IN_LOCATE_REPLY 50 WARNING "Bad system exception in locate reply") - (BAD_SYSTEM_EXCEPTION_IN_REPLY 51 WARNING "Bad system exception in reply") - (BAD_COMPLETION_STATUS_IN_LOCATE_REPLY 52 WARNING "Bad CompletionStatus {0} in locate reply") - (BAD_COMPLETION_STATUS_IN_REPLY 53 WARNING "Bad CompletionStatus {0} in reply") - (BADKIND_CANNOT_OCCUR 54 WARNING "The BadKind exception should never occur here") - (ERROR_RESOLVING_ALIAS 55 WARNING "Could not resolve alias typecode") - (TK_LONG_DOUBLE_NOT_SUPPORTED 56 WARNING "The long double type is not supported in Java") - (TYPECODE_NOT_SUPPORTED 57 WARNING "Illegal typecode kind") - (BOUNDS_CANNOT_OCCUR 59 WARNING "Bounds exception cannot occur in this context") - (NUM_INVOCATIONS_ALREADY_ZERO 61 WARNING "Number of invocations is already zero, but another invocation has completed") - (ERROR_INIT_BADSERVERIDHANDLER 62 WARNING "Error in constructing instance of bad server ID handler") - (NO_TOA 63 WARNING "No TOAFactory is availble") - (NO_POA 64 WARNING "No POAFactory is availble") - (INVOCATION_INFO_STACK_EMPTY 65 WARNING "Invocation info stack is unexpectedly empty") - (BAD_CODE_SET_STRING 66 WARNING "Empty or null code set string") - (UNKNOWN_NATIVE_CODESET 67 WARNING "Unknown native codeset: {0}") - (UNKNOWN_CONVERSION_CODE_SET 68 WARNING "Unknown conversion codset: {0}") - (INVALID_CODE_SET_NUMBER 69 WARNING "Invalid codeset number") - (INVALID_CODE_SET_STRING 70 WARNING "Invalid codeset string {0}") - (INVALID_CTB_CONVERTER_NAME 71 WARNING "Invalid CTB converter {0}") - (INVALID_BTC_CONVERTER_NAME 72 WARNING "Invalid BTC converter {0}") - (COULD_NOT_DUPLICATE_CDR_INPUT_STREAM 73 WARNING "Could not duplicate CDRInputStream") - (BOOTSTRAP_APPLICATION_EXCEPTION 74 WARNING "BootstrapResolver caught an unexpected ApplicationException") - (DUPLICATE_INDIRECTION_OFFSET 75 WARNING "Old entry in serialization indirection table has a different value than the value being added with the same key") - (BAD_MESSAGE_TYPE_FOR_CANCEL 76 WARNING "GIOP Cancel request contained a bad request ID: the request ID did not match the request that was to be cancelled") - (DUPLICATE_EXCEPTION_DETAIL_MESSAGE 77 WARNING "Duplicate ExceptionDetailMessage") - (BAD_EXCEPTION_DETAIL_MESSAGE_SERVICE_CONTEXT_TYPE 78 WARNING "Bad ExceptionDetailMessage ServiceContext type") - (UNEXPECTED_DIRECT_BYTE_BUFFER_WITH_NON_CHANNEL_SOCKET 79 WARNING "unexpected direct ByteBuffer with non-channel socket") - (UNEXPECTED_NON_DIRECT_BYTE_BUFFER_WITH_CHANNEL_SOCKET 80 WARNING "unexpected non-direct ByteBuffer with channel socket") - (INVALID_CONTACT_INFO_LIST_ITERATOR_FAILURE_EXCEPTION 82 WARNING "There should be at least one CorbaContactInfo to try (and fail) so this error should not be seen.") - (REMARSHAL_WITH_NOWHERE_TO_GO 83 WARNING "Remarshal with nowhere to go") - (EXCEPTION_WHEN_SENDING_CLOSE_CONNECTION 84 WARNING "Exception when sending close connection") - (INVOCATION_ERROR_IN_REFLECTIVE_TIE 85 WARNING "A reflective tie got an error while invoking method {0} on class {1}") - (BAD_HELPER_WRITE_METHOD 86 WARNING "Could not find or invoke write method on exception Helper class {0}") - (BAD_HELPER_READ_METHOD 87 WARNING "Could not find or invoke read method on exception Helper class {0}") - (BAD_HELPER_ID_METHOD 88 WARNING "Could not find or invoke id method on exception Helper class {0}") - (WRITE_UNDECLARED_EXCEPTION 89 WARNING "Tried to write exception of type {0} that was not declared on method") - (READ_UNDECLARED_EXCEPTION 90 WARNING "Tried to read undeclared exception with ID {0}") - (UNABLE_TO_SET_SOCKET_FACTORY_ORB 91 WARNING "Unable to setSocketFactoryORB") - (UNEXPECTED_EXCEPTION 92 WARNING "Unexpected exception occurred where no exception should occur") - (NO_INVOCATION_HANDLER 93 WARNING "No invocation handler available for {0}") - (INVALID_BUFF_MGR_STRATEGY 94 WARNING "{0}: invalid buffer manager strategy for Java serialization") - (JAVA_STREAM_INIT_FAILED 95 WARNING "Java stream initialization failed") - (DUPLICATE_ORB_VERSION_SERVICE_CONTEXT 96 WARNING "An ORBVersionServiceContext was already in the service context list") - (DUPLICATE_SENDING_CONTEXT_SERVICE_CONTEXT 97 WARNING "A SendingContextServiceContext was already in the service context list") - (WORK_QUEUE_THREAD_INTERRUPTED 98 FINE "Worker Thread from thread pool {0} was interrupted: closeCalled is {1}.") - (WORKER_THREAD_CREATED - 104 FINE "Worker thread {0} has been created with ClassLoader {1}") - (WORKER_THREAD_THROWABLE_FROM_REQUEST_WORK - 109 FINE "Worker thread {0} caught throwable {1} when requesting work from work queue {2}.") - (WORKER_THREAD_NOT_NEEDED - 110 FINE "Worker thread {0} will exit; current thread count, {1}, greater than minunum worker threads needed, {2}.") - (WORKER_THREAD_DO_WORK_THROWABLE - 111 FINE "Worker thread {0} caught throwable {1} while executing work.") - (WORKER_THREAD_CAUGHT_UNEXPECTED_THROWABLE - 112 WARNING "Worker thread {0} caught unexpected throwable {1}.") - (WORKER_THREAD_CREATION_FAILURE - 113 SEVERE "Worker thread creation failure; cause {0}.") - (WORKER_THREAD_SET_NAME_FAILURE - 114 WARNING "Unable to set worker thread {0} name to {1}; cause {2}.") - (WORK_QUEUE_REQUEST_WORK_NO_WORK_FOUND - 116 WARNING "Ignoring unexpected {0} when retrieving of work from work queue, {1}.") - (THREAD_POOL_CLOSE_ERROR 126 WARNING "Error in closing ThreadPool") - (THREAD_GROUP_IS_DESTROYED 127 WARNING "ThreadGroup {0} is already destroyed: can't destroy it") - (THREAD_GROUP_HAS_ACTIVE_THREADS_IN_CLOSE 128 WARNING "ThreadGroup {0} has {1} active threads: destroy may cause exception") - (THREAD_GROUP_HAS_SUB_GROUPS_IN_CLOSE 129 WARNING "ThreadGroup {0} has {1} sub-thread groups: destroy may cause exception") - (THREAD_GROUP_DESTROY_FAILED 130 WARNING "ThreadGroup {0} could not be destroyed") - (INTERRUPTED_JOIN_CALL_WHILE_CLOSING_THREAD_POOL 131 WARNING "Join was interrupted on thread {0} while closing ThreadPool {1}") - ) - - (MARSHAL - (CHUNK_OVERFLOW 1 WARNING "Data read past end of chunk without closing the chunk") - (UNEXPECTED_EOF 2 WARNING "Grow buffer strategy called underflow handler") - (READ_OBJECT_EXCEPTION 3 WARNING "Error in reading marshalled object") - (CHARACTER_OUTOFRANGE 4 WARNING "Character not IOS Latin-1 compliant in marshalling") - (DSI_RESULT_EXCEPTION 5 WARNING "Exception thrown during result() on ServerRequest") - (IIOPINPUTSTREAM_GROW 6 WARNING "grow() called on IIOPInputStream") - (END_OF_STREAM 7 FINE "Underflow in BufferManagerReadStream after last fragment in message") - (INVALID_OBJECT_KEY 8 WARNING "Invalid ObjectKey in request header") - (MALFORMED_URL 9 WARNING "Unable to locate value class for repository ID {0} because codebase URL {1] is malformed") - (VALUEHANDLER_READ_ERROR 10 WARNING "Error from readValue on ValueHandler in CDRInputStream") - (VALUEHANDLER_READ_EXCEPTION 11 WARNING "Exception from readValue on ValueHandler in CDRInputStream") - (BAD_KIND 12 WARNING "Bad kind in isCustomType in CDRInputStream") - (CNFE_READ_CLASS 13 WARNING "Could not find class {0} in CDRInputStream.readClass") - (BAD_REP_ID_INDIRECTION 14 WARNING "Bad repository ID indirection at index {0}") - (BAD_CODEBASE_INDIRECTION 15 WARNING "Bad codebase string indirection at index {0}") - (UNKNOWN_CODESET 16 WARNING "Unknown code set {0} specified by client ORB as a negotiated code set") - (WCHAR_DATA_IN_GIOP_1_0 17 WARNING "Attempt to marshal wide character or string data in GIOP 1.0") - (NEGATIVE_STRING_LENGTH 18 WARNING "String or wstring with a negative length {0}") - (EXPECTED_TYPE_NULL_AND_NO_REP_ID 19 WARNING "CDRInputStream.read_value(null) called, but no repository ID information on the wire") - (READ_VALUE_AND_NO_REP_ID 20 WARNING "CDRInputStream.read_value() called, but no repository ID information on the wire") - (UNEXPECTED_ENCLOSING_VALUETYPE 22 WARNING "Received end tag {0}, which is less than the expected value {1}") - (POSITIVE_END_TAG 23 WARNING "Read non-negative end tag {0} at offset {1} (end tags should always be negative)") - (NULL_OUT_CALL 24 WARNING "Out call descriptor is missing") - (WRITE_LOCAL_OBJECT 25 WARNING "write_Object called with a local object") - (BAD_INSERTOBJ_PARAM 26 WARNING "Tried to insert non-ObjectImpl {0} into an Any via insert_Object") - (CUSTOM_WRAPPER_WITH_CODEBASE 27 WARNING "Codebase present in RMI-IIOP stream format version 1 optional data valuetype header") - (CUSTOM_WRAPPER_INDIRECTION 28 WARNING "Indirection preseint in RMI-IIOP stream format version 2 optional data valuetype header") - (CUSTOM_WRAPPER_NOT_SINGLE_REPID 29 WARNING "0 or more than one repository ID found reading the optional data valuetype header") - (BAD_VALUE_TAG 30 WARNING "Bad valuetag {0} found while reading repository IDs") - (BAD_TYPECODE_FOR_CUSTOM_VALUE 31 WARNING "Bad typecode found for custom valuetype") - (ERROR_INVOKING_HELPER_WRITE 32 WARNING "An error occurred using reflection to invoke IDL Helper write method") - (BAD_DIGIT_IN_FIXED 33 WARNING "A bad digit was found while marshalling an IDL fixed type") - (REF_TYPE_INDIR_TYPE 34 WARNING "Referenced type of indirect type not marshaled") - (BAD_RESERVED_LENGTH 35 WARNING "Request message reserved bytes has invalid length") - (NULL_NOT_ALLOWED 36 WARNING "A null object is not allowed here") - (UNION_DISCRIMINATOR_ERROR 38 WARNING "Error in typecode union discriminator") - (CANNOT_MARSHAL_NATIVE 39 WARNING "Cannot marshal a native TypeCode") - (CANNOT_MARSHAL_BAD_TCKIND 40 WARNING "Cannot marshal an invalid TypeCode kind") - (INVALID_INDIRECTION 41 WARNING "Invalid indirection value {0} (>-4): probable stream corruption") - (INDIRECTION_NOT_FOUND 42 FINE "No type found at indirection {0}: probably stream corruption") - (RECURSIVE_TYPECODE_ERROR 43 WARNING "Recursive TypeCode not supported by InputStream subtype") - (INVALID_SIMPLE_TYPECODE 44 WARNING "TypeCode is of wrong kind to be simple") - (INVALID_COMPLEX_TYPECODE 45 WARNING "TypeCode is of wrong kind to be complex") - (INVALID_TYPECODE_KIND_MARSHAL 46 WARNING "Cannot marshal typecode of invalid kind") - (UNEXPECTED_UNION_DEFAULT 47 WARNING "Default union branch not expected") - (ILLEGAL_UNION_DISCRIMINATOR_TYPE 48 WARNING "Illegal discriminator type in union") - (COULD_NOT_SKIP_BYTES 49 WARNING "Could not skip over {0} bytes at offset {1}") - (BAD_CHUNK_LENGTH 50 WARNING "Incorrect chunk length {0} at offset {1}") - (UNABLE_TO_LOCATE_REP_ID_ARRAY 51 WARNING "Unable to locate array of repository IDs from indirection {0}") - (BAD_FIXED 52 WARNING "Fixed of length {0} in buffer of length {1}") - (READ_OBJECT_LOAD_CLASS_FAILURE 53 WARNING "Failed to load stub for {0} with class {1}") - (COULD_NOT_INSTANTIATE_HELPER 54 WARNING "Could not instantiate Helper class {0}") - (BAD_TOA_OAID 55 WARNING "Bad ObjectAdapterId for TOA") - (COULD_NOT_INVOKE_HELPER_READ_METHOD 56 WARNING "Could not invoke helper read method for helper {0}") - (COULD_NOT_FIND_CLASS 57 WARNING "Could not find class") - (BAD_ARGUMENTS_NVLIST 58 FINE "Error in arguments(NVList) for DSI ServerRequest") - (STUB_CREATE_ERROR 59 FINE "Could not create stub") - (JAVA_SERIALIZATION_EXCEPTION 60 WARNING "Java serialization exception during {0} operation")) - (NO_IMPLEMENT - (GENERIC_NO_IMPL 1 FINE "feature not implemented") - (CONTEXT_NOT_IMPLEMENTED 2 FINE "IDL request context is not implemented") - (GETINTERFACE_NOT_IMPLEMENTED 3 FINE "getInterface() is not implemented") - (SEND_DEFERRED_NOTIMPLEMENTED 4 FINE "send deferred is not implemented") - (LONG_DOUBLE_NOT_IMPLEMENTED 5 FINE "IDL type long double is not supported in Java")) - (OBJ_ADAPTER - (NO_SERVER_SC_IN_DISPATCH 1 WARNING "No server request dispatcher found when dispatching request to object adapter") - (ORB_CONNECT_ERROR 2 WARNING "Error in connecting servant to ORB") - (ADAPTER_INACTIVE_IN_ACTIVATION 3 FINE "StubAdapter.getDelegate failed to activate a Servant")) - (OBJECT_NOT_EXIST - (LOCATE_UNKNOWN_OBJECT 1 WARNING "Locate response indicated that the object was unknown") - (BAD_SERVER_ID 2 FINE "The server ID in the target object key does not match the server key expected by the server") - (BAD_SKELETON 3 WARNING "No skeleton found in the server that matches the target object key") - (SERVANT_NOT_FOUND 4 WARNING "Servant not found") - (NO_OBJECT_ADAPTER_FACTORY 5 WARNING "No object adapter factory") - (BAD_ADAPTER_ID 6 WARNING "Bad adapter ID") - (DYN_ANY_DESTROYED 7 WARNING "Dynamic Any was destroyed: all operations are invalid")) - (TRANSIENT - (REQUEST_CANCELED 1 WARNING "Request cancelled by exception")) - (UNKNOWN - (UNKNOWN_CORBA_EXC 1 WARNING "Unknown user exception while unmarshalling") - (RUNTIMEEXCEPTION 2 WARNING "Unknown user exception thrown by the server") - (UNKNOWN_SERVER_ERROR 3 WARNING "Unknown exception or error thrown by the ORB or application") - (UNKNOWN_DSI_SYSEX 4 WARNING "Error while marshalling SystemException after DSI-based invocation") - (UNKNOWN_SYSEX 5 WARNING "Error while unmarshalling SystemException") - (WRONG_INTERFACE_DEF 6 WARNING "InterfaceDef object of wrong type returned by server") - (NO_INTERFACE_DEF_STUB 7 WARNING "org.omg.CORBA._InterfaceDefStub class not available") - (UNKNOWN_EXCEPTION_IN_DISPATCH 9 FINE "UnknownException in dispatch")))) diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/POA.mc b/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/POA.mc deleted file mode 100644 index 5eb198dd555..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/POA.mc +++ /dev/null @@ -1,107 +0,0 @@ -; -; Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. -; DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -; -; This code is free software; you can redistribute it and/or modify it -; under the terms of the GNU General Public License version 2 only, as -; published by the Free Software Foundation. Oracle designates this -; particular file as subject to the "Classpath" exception as provided -; by Oracle in the LICENSE file that accompanied this code. -; -; This code is distributed in the hope that it will be useful, but WITHOUT -; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -; version 2 for more details (a copy is included in the LICENSE file that -; accompanied this code). -; -; You should have received a copy of the GNU General Public License version -; 2 along with this work; if not, write to the Free Software Foundation, -; Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -; -; Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -; or visit www.oracle.com if you need additional information or have any -; questions. -; -("com.sun.corba.se.impl.logging" "POASystemException" POA - ( - (BAD_INV_ORDER - (SERVANT_MANAGER_ALREADY_SET 1 WARNING "Servant Manager already set") - (DESTROY_DEADLOCK 2 WARNING "Request to wait for POA destruction while servicing request would deadlock")) - (BAD_OPERATION - (SERVANT_ORB 1 WARNING "Bad operation on servant ORB???") - (BAD_SERVANT 2 WARNING "Bad Servant???") - (ILLEGAL_FORWARD_REQUEST 3 WARNING "Illegal Forward Request???")) - (BAD_PARAM - (BAD_TRANSACTION_CONTEXT 1 WARNING "Bad transaction context") - (BAD_REPOSITORY_ID 2 WARNING "Bad repository id")) - (INTERNAL - (INVOKESETUP 1 WARNING "invoke setup???") - (BAD_LOCALREPLYSTATUS 2 WARNING "bad local reply status???") - (PERSISTENT_SERVERPORT_ERROR 3 WARNING "persistent serverport error???") - (SERVANT_DISPATCH 4 WARNING "servant dispatch???") - (WRONG_CLIENTSC 5 WARNING "wrong client request dispatcher???") - (CANT_CLONE_TEMPLATE 6 WARNING "can't clone template???") - (POACURRENT_UNBALANCED_STACK 7 WARNING "POACurrent stack is unbalanced") - (POACURRENT_NULL_FIELD 8 WARNING "Null field in POACurrent") - (POA_INTERNAL_GET_SERVANT_ERROR 9 WARNING "POA internalGetServant error") - (MAKE_FACTORY_NOT_POA 10 WARNING "First Object Adapter name is {0}, should be RootPOA") - (DUPLICATE_ORB_VERSION_SC 11 WARNING "Duplicate ORB version service context") - (PREINVOKE_CLONE_ERROR 12 WARNING "preinvoke clone error") - (PREINVOKE_POA_DESTROYED 13 WARNING "preinvoke POA destroyed") - (PMF_CREATE_RETAIN 14 WARNING "Bad dispatch policy for RETAIN policy in POAPolicyMediatorFactory") - (PMF_CREATE_NON_RETAIN 15 WARNING "Bad dispatch policy for NON_RETAIN policy in POAPolicyMediatorFactory") - (POLICY_MEDIATOR_BAD_POLICY_IN_FACTORY 16 WARNING "Inconsistent policy in PolicyMediator") - (SERVANT_TO_ID_OAA 17 WARNING "ObjectAlreadyActive in servantToId") - (SERVANT_TO_ID_SAA 18 WARNING "ServantAlreadyActive in servantToId") - (SERVANT_TO_ID_WP 19 WARNING "WrongPolicy in servantToId") - (CANT_RESOLVE_ROOT_POA 20 WARNING "Can't resolve root POA") - (SERVANT_MUST_BE_LOCAL 21 WARNING "Call made to local client request dispatcher with non-local servant") - (NO_PROFILES_IN_IOR 22 WARNING "IOR does not have any profiles") - (AOM_ENTRY_DEC_ZERO 23 WARNING "Tried to decrement AOMEntry counter that is already 0") - (ADD_POA_INACTIVE 24 WARNING "Tried to add a POA to an inactive POAManager") - (ILLEGAL_POA_STATE_TRANS 25 WARNING "POA tried to make an illegal state transition") - (UNEXPECTED_EXCEPTION 26 WARNING "Unexpected exception in POA {0}")) - (NO_IMPLEMENT - (SINGLE_THREAD_NOT_SUPPORTED 1 WARNING "Single thread policy is not supported") - (METHOD_NOT_IMPLEMENTED 2 WARNING "This method is not implemented")) - (OBJ_ADAPTER - (POA_LOOKUP_ERROR 1 WARNING "Error in find_POA") - (POA_INACTIVE 2 FINE "POA is inactive") - (POA_NO_SERVANT_MANAGER 3 WARNING "POA has no servant manager") - (POA_NO_DEFAULT_SERVANT 4 WARNING "POA has no default servant") - (POA_SERVANT_NOT_UNIQUE 5 WARNING "POA servant is not unique") - (POA_WRONG_POLICY 6 WARNING "Bad policy in POA") - (FINDPOA_ERROR 7 WARNING "Another error in find_POA") - (POA_SERVANT_ACTIVATOR_LOOKUP_FAILED 9 WARNING "POA ServantActivator lookup failed") - (POA_BAD_SERVANT_MANAGER 10 WARNING "POA has bad servant manager") - (POA_SERVANT_LOCATOR_LOOKUP_FAILED 11 WARNING "POA ServantLocator lookup failed") - (POA_UNKNOWN_POLICY 12 WARNING "Unknown policy passed to POA") - (POA_NOT_FOUND 13 WARNING "POA not found") - (SERVANT_LOOKUP 14 WARNING "Error in servant lookup") - (LOCAL_SERVANT_LOOKUP 15 WARNING "Error in local servant lookup") - (SERVANT_MANAGER_BAD_TYPE 16 WARNING "Bad type for servant manager") - (DEFAULT_POA_NOT_POAIMPL 17 WARNING "Servant's _default_POA must be an instance of POAImpl") - (WRONG_POLICIES_FOR_THIS_OBJECT 18 WARNING "Wrong POA policies for _this_object called outside of an invocation context") - (THIS_OBJECT_SERVANT_NOT_ACTIVE 19 WARNING "ServantNotActive exception in _this_object") - (THIS_OBJECT_WRONG_POLICY 20 WARNING "WrongPolicy exception in _this_object") - (NO_CONTEXT 21 FINE "Operation called outside of invocation context") - (INCARNATE_RETURNED_NULL 22 WARNING "ServantActivator.incarnate() returned a null Servant")) - (INITIALIZE - (JTS_INIT_ERROR 1 WARNING "JTS initialization error") - (PERSISTENT_SERVERID_NOT_SET 2 WARNING "Persistent server ID is not set") - (PERSISTENT_SERVERPORT_NOT_SET 3 WARNING "Persistent server port is not set") - (ORBD_ERROR 4 WARNING "Error in ORBD") - (BOOTSTRAP_ERROR 5 WARNING "Error in bootstrap")) - (TRANSIENT - (POA_DISCARDING 1 FINE "POA is in discarding state")) - (UNKNOWN - (OTSHOOKEXCEPTION 1 WARNING "Error in OTS hook") - (UNKNOWN_SERVER_EXCEPTION 2 WARNING "Unknown server exception") - (UNKNOWN_SERVERAPP_EXCEPTION 3 WARNING "Unknown server application exception") - (UNKNOWN_LOCALINVOCATION_ERROR 4 WARNING "Unknon local invocation error")) - (OBJECT_NOT_EXIST - (ADAPTER_ACTIVATOR_NONEXISTENT 1 WARNING "AdapterActivator does not exist") - (ADAPTER_ACTIVATOR_FAILED 2 WARNING "AdapterActivator failed") - (BAD_SKELETON 3 WARNING "Bad skeleton") - (NULL_SERVANT 4 FINE "Null servant") - (ADAPTER_DESTROYED 5 WARNING "POA has been destroyed")))) diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/Util.mc b/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/Util.mc deleted file mode 100644 index f46e0ef599e..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/Util.mc +++ /dev/null @@ -1,64 +0,0 @@ -; -; Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. -; DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -; -; This code is free software; you can redistribute it and/or modify it -; under the terms of the GNU General Public License version 2 only, as -; published by the Free Software Foundation. Oracle designates this -; particular file as subject to the "Classpath" exception as provided -; by Oracle in the LICENSE file that accompanied this code. -; -; This code is distributed in the hope that it will be useful, but WITHOUT -; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -; version 2 for more details (a copy is included in the LICENSE file that -; accompanied this code). -; -; You should have received a copy of the GNU General Public License version -; 2 along with this work; if not, write to the Free Software Foundation, -; Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -; -; Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -; or visit www.oracle.com if you need additional information or have any -; questions. -; -("com.sun.corba.se.impl.logging" "UtilSystemException" UTIL - ( - (BAD_OPERATION - (STUB_FACTORY_COULD_NOT_MAKE_STUB 1 FINE "StubFactory failed on makeStub call") - (ERROR_IN_MAKE_STUB_FROM_REPOSITORY_ID 2 FINE "Error in making stub given RepositoryId") - (CLASS_CAST_EXCEPTION_IN_LOAD_STUB 3 FINE "ClassCastException in loadStub") - (EXCEPTION_IN_LOAD_STUB 4 FINE "Exception in loadStub") - ) - (BAD_PARAM - (NO_POA 2 WARNING "Error in loadStubAndUpdateCache caused by _this_object") - (CONNECT_WRONG_ORB 3 FINE "Tried to connect already connected Stub Delegate to a different ORB") - (CONNECT_NO_TIE 4 WARNING "Tried to connect unconnected Stub Delegate but no Tie was found") - (CONNECT_TIE_WRONG_ORB 5 WARNING "Tried to connect unconnected stub with Tie in a different ORB") - (CONNECT_TIE_NO_SERVANT 6 WARNING "Tried to connect unconnected stub to unconnected Tie") - (LOAD_TIE_FAILED 7 FINE "Failed to load Tie of class {0}") - ) - (DATA_CONVERSION - (BAD_HEX_DIGIT 1 WARNING "Bad hex digit in string_to_object")) - (MARSHAL - (UNABLE_LOCATE_VALUE_HELPER 2 WARNING "Could not locate value helper") - (INVALID_INDIRECTION 3 WARNING "Invalid indirection {0}")) - (INV_OBJREF - (OBJECT_NOT_CONNECTED 1 WARNING "{0} did not originate from a connected object") - (COULD_NOT_LOAD_STUB 2 WARNING "Could not load stub for class {0}") - (OBJECT_NOT_EXPORTED 3 WARNING "Class {0} not exported, or else is actually a JRMP stub")) - (INTERNAL - (ERROR_SET_OBJECT_FIELD 1 WARNING "Error in setting object field {0} in {1} to {2}") - (ERROR_SET_BOOLEAN_FIELD 2 WARNING "Error in setting boolean field {0} in {1} to {2}") - (ERROR_SET_BYTE_FIELD 3 WARNING "Error in setting byte field {0} in {1} to {2}") - (ERROR_SET_CHAR_FIELD 4 WARNING "Error in setting char field {0} in {1} to {2}") - (ERROR_SET_SHORT_FIELD 5 WARNING "Error in setting short field {0} in {1} to {2}") - (ERROR_SET_INT_FIELD 6 WARNING "Error in setting int field {0} in {1} to {2}") - (ERROR_SET_LONG_FIELD 7 WARNING "Error in setting long field {0} in {1} to {2}") - (ERROR_SET_FLOAT_FIELD 8 WARNING "Error in setting float field {0} in {1} to {2}") - (ERROR_SET_DOUBLE_FIELD 9 WARNING "Error in setting double field {0} in {1} to {2}") - (ILLEGAL_FIELD_ACCESS 10 WARNING "IllegalAccessException while trying to write to field {0}") - (BAD_BEGIN_UNMARSHAL_CUSTOM_VALUE 11 WARNING "State should be saved and reset first") - (CLASS_NOT_FOUND 12 WARNING "Failure while loading specific Java remote exception class: {0}")) - (UNKNOWN - (UNKNOWN_SYSEX 1 WARNING "Unknown System Exception")))) diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/LongMonitoredAttributeBase.java b/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/LongMonitoredAttributeBase.java deleted file mode 100644 index 0b3b6b396ee..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/LongMonitoredAttributeBase.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.spi.monitoring; - -import java.util.*; - -/** - * @author Hemanth Puttaswamy - * - * A Cleaner Abstraction to provide a Monitored Attribute of type 'Long' - */ -public abstract class LongMonitoredAttributeBase extends MonitoredAttributeBase { - - /////////////////////////////////////// - // operations - - -/** - * Constructs LongMonitoredAttribute, by creating the - * MonitoredAttributeInfo with 'Long' as the class type. - * Users are expected to extend this class and provide the implementation - * for getValue() and if needed clearState() as well. - * - * @param name of the MonitoredAttribute - * @param description of the Attribute, Please provid a well thought out - * description, so that the admin can make sense of the attribute supplied. - */ - public LongMonitoredAttributeBase(String name, String description) { - super( name ); - MonitoredAttributeInfoFactory f = - MonitoringFactories.getMonitoredAttributeInfoFactory(); - MonitoredAttributeInfo maInfo = f.createMonitoredAttributeInfo( - description, Long.class, false, false ); - this.setMonitoredAttributeInfo( maInfo ); - } // end LongMonitoredAttributeBase - - -} // end LongMonitoredAttributeBase diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttribute.java b/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttribute.java deleted file mode 100644 index 094b33f5337..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttribute.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.spi.monitoring; - -import com.sun.corba.se.spi.monitoring.MonitoredAttributeInfo; -import java.util.*; - -/** - * @author Hemanth Puttaswamy - * - * Monitored Attribute is the interface to represent a Monitorable - * Attribute. Using this interface, one can get the value of the attribute - * and set the value if it is a writeable attribute. - */ -public interface MonitoredAttribute { - - /////////////////////////////////////// - // operations - -/** - * Gets the Monitored Attribute Info for the attribute. - * - * @return monitoredAttributeInfo for this Monitored Attribute. - */ - public MonitoredAttributeInfo getAttributeInfo(); -/** - * Sets the value for the Monitored Attribute if isWritable() is false, the - * method will throw ILLEGAL Operation exception. - * - * Also, the type of 'value' should be same as specified in the - * MonitoredAttributeInfo for a particular instance. - * - * @param value should be any one of the Basic Java Type Objects which are - * Long, Double, Float, String, Integer, Short, Character, Byte. - */ - public void setValue(Object value); - - -/** - * Gets the value of the Monitored Attribute. The value can be obtained - * from different parts of the module. User may choose to delegate the call - * to getValue() to other variables. - * - * NOTE: It is important to make sure that the type of Object returned in - * getvalue is same as the one specified in MonitoredAttributeInfo for this - * attribute. - * - * @return the current value for this MonitoredAttribute - */ - public Object getValue(); -/** - * Gets the name of the Monitored Attribute. - * - * @return name of this Attribute - */ - public String getName(); -/** - * If this attribute needs to be cleared, the user needs to implement this - * method to reset the state to initial state. If the Monitored Attribute - * doesn't change like for example (ConnectionManager High Water Mark), - * then clearState() is a No Op. - */ - public void clearState(); - -} // end MonitoredAttribute diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttributeBase.java b/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttributeBase.java deleted file mode 100644 index b4456e44de2..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttributeBase.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.spi.monitoring; - -import java.util.*; - -/** - * @author Hemanth Puttaswamy - * - * A Convenient class provided to help users extend and implement only - * getValue(), if there is no need to clear the state and the attribute is not - * writable. - */ -public abstract class MonitoredAttributeBase implements MonitoredAttribute { - String name; - MonitoredAttributeInfo attributeInfo; - /** - * Constructor. - */ - public MonitoredAttributeBase( String name, MonitoredAttributeInfo info ) { - this.name = name; - this.attributeInfo = info; - } - - - /** - * A Package Private Constructor for internal use only. - */ - MonitoredAttributeBase( String name ) { - this.name = name; - } - - - /** - * A Package Private convenience method for setting MonitoredAttributeInfo - * for this Monitored Attribute. - */ - void setMonitoredAttributeInfo( MonitoredAttributeInfo info ) { - this.attributeInfo = info; - } - - /** - * If the concrete class decides not to provide the implementation of this - * method, then it's OK. Some of the examples where we may decide to not - * provide the implementation is the connection state. Irrespective of - * the call to clearState, the connection state will be showing the - * currect state of the connection. - * NOTE: This method is only used to clear the Monitored Attribute state, - * not the real state of the system itself. - */ - public void clearState( ) { - } - - /** - * This method should be implemented by the concrete class. - */ - public abstract Object getValue( ); - - /** - * This method should be implemented by the concrete class only if the - * attribute is writable. If the attribute is not writable and if this - * method called, it will result in an IllegalStateException. - */ - public void setValue( Object value ) { - if( !attributeInfo.isWritable() ) { - throw new IllegalStateException( - "The Attribute " + name + " is not Writable..." ); - } - throw new IllegalStateException( - "The method implementation is not provided for the attribute " + - name ); - } - - - /** - * Gets the MonitoredAttributeInfo for the attribute. - */ - public MonitoredAttributeInfo getAttributeInfo( ) { - return attributeInfo; - } - - /** - * Gets the name of the attribute. - */ - public String getName( ) { - return name; - } -} // end MonitoredAttributeBase diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttributeInfo.java b/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttributeInfo.java deleted file mode 100644 index 45f9c4ae239..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttributeInfo.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.spi.monitoring; - -import java.util.*; - -/** - * @author Hemanth Puttaswamy - * - * Monitored AttributeInfo contains the meta information of the Monitored - * Attribute. - */ -public interface MonitoredAttributeInfo { - - /////////////////////////////////////// - // operations - -/** - * If the Attribute is writable from ASAdmin then isWritable() will return - * true. - * - * @return a boolean with true or false - */ - public boolean isWritable(); -/** - * isStatistic() is true if the attribute is presented as a Statistic. - * - * @return a boolean with true or false - */ - public boolean isStatistic(); -/** - * Class Type: We will allow only basic class types: - *
              - *
            1. Boolean
            2. - *
            3. Integer
            4. - *
            5. Byte
            6. - *
            7. Long
            8. - *
            9. Float
            10. - *
            11. Double
            12. - *
            13. String
            14. - *
            15. Character
            16. - *
            - * - * @return a Class Type - */ - public Class type(); -/** - * Get's the description for the Monitored Attribute. - * - * @return a String with description - */ - public String getDescription(); - -} // end MonitoredAttributeInfo diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttributeInfoFactory.java b/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttributeInfoFactory.java deleted file mode 100644 index bac25fa7713..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttributeInfoFactory.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.spi.monitoring; - -/** - * @author Hemanth Puttaswamy - * - * MonitoredAttributeInfoFactory used mostly by internal classes. If the - * User needs to define some special MonitoredAttributes like a Character - * type Monitored Attribute, they can use this factory to build the meta - * information. - */ - -public interface MonitoredAttributeInfoFactory { - /** - * A Simple Factory Method to create the Monitored Attribute Info. - */ - MonitoredAttributeInfo createMonitoredAttributeInfo( String description, - Class type, boolean isWritable, boolean isStatistic ); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredObject.java b/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredObject.java deleted file mode 100644 index 6514a6bbfe4..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredObject.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.spi.monitoring; - - -import com.sun.corba.se.spi.monitoring.MonitoredAttribute; -import java.util.*; -import java.util.Collection; - -/** - * @author Hemanth Puttaswamy - * - * Monitored Object provides an Hierarchichal view of the ORB Monitoring - * System. It can contain multiple children and a single parent. Each - * Monitored Object may also contain Multiple Monitored Attributes. - */ -public interface MonitoredObject { - - /////////////////////////////////////// - // operations -/** - * Gets the name of this MonitoredObject - * - * @return a String with name of this Monitored Object - */ - public String getName(); -/** - * Gets the description of MonitoredObject - * - * @return a String with Monitored Object Description. - */ - public String getDescription(); -/** - * This method will add a child Monitored Object to this Monitored Object. - */ - public void addChild( MonitoredObject m ); -/** - * This method will remove child Monitored Object identified by the given name - * - * @param name of the ChildMonitored Object - */ - public void removeChild( String name ); - -/** - * Gets the child MonitoredObject associated with this MonitoredObject - * instance using name as the key. The name should be fully qualified name - * like orb.connectionmanager - * - * @return a MonitoredObject identified by the given name - * @param name of the ChildMonitored Object - */ - public MonitoredObject getChild(String name); -/** - * Gets all the Children registered under this instance of Monitored - * Object. - * - * @return Collection of immediate Children associated with this MonitoredObject. - */ - public Collection getChildren(); -/** - * Sets the parent for this Monitored Object. - */ - public void setParent( MonitoredObject m ); -/** - * There will be only one parent for an instance of MontoredObject, this - * call gets parent and returns null if the Monitored Object is the root. - * - * @return a MonitoredObject which is a Parent of this Monitored Object instance - */ - public MonitoredObject getParent(); - -/** - * Adds the attribute with the given name. - * - * @param value is the MonitoredAttribute which will be set as one of the - * attribute of this MonitoredObject. - */ - public void addAttribute(MonitoredAttribute value); -/** - * Removes the attribute with the given name. - * - * @param name is the MonitoredAttribute name - */ - public void removeAttribute(String name); - -/** - * Gets the Monitored Object registered by the given name - * - * @return a MonitoredAttribute identified by the given name - * @param name of the attribute - */ - public MonitoredAttribute getAttribute(String name); -/** - * Gets all the Monitored Attributes for this Monitored Objects. It doesn't - * include the Child Monitored Object, that needs to be traversed using - * getChild() or getChildren() call. - * - * @return Collection of all the Attributes for this MonitoredObject - */ - public Collection getAttributes(); -/** - * Clears the state of all the Monitored Attributes associated with the - * Monitored Object. It will also clear the state on all it's child - * Monitored Object. The call to clearState will be initiated from - * CORBAMBean.startMonitoring() call. - */ - public void clearState(); - -} // end MonitoredObject diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredObjectFactory.java b/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredObjectFactory.java deleted file mode 100644 index d7b03e7d701..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredObjectFactory.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.spi.monitoring; - -/** - * @author Hemanth Puttaswamy - * - * MonitoredObject Factory to create Monitored Object. - */ -public interface MonitoredObjectFactory { - /** - * A Simple Factory Method to create the Monitored Object. The name - * should be the leaf level name. - */ - MonitoredObject createMonitoredObject( String name, String description ); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoringConstants.java b/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoringConstants.java deleted file mode 100644 index 73c618db17e..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoringConstants.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.monitoring; - -public interface MonitoringConstants -{ - public static final String DEFAULT_MONITORING_ROOT = "orb"; - public static final String DEFAULT_MONITORING_ROOT_DESCRIPTION = - "ORB Management and Monitoring Root"; - - // - // Connection Monitoring - // - - public static final String CONNECTION_MONITORING_ROOT = - "Connections"; - public static final String CONNECTION_MONITORING_ROOT_DESCRIPTION = - "Statistics on inbound/outbound connections"; - - public static final String INBOUND_CONNECTION_MONITORING_ROOT = - "Inbound"; - public static final String INBOUND_CONNECTION_MONITORING_ROOT_DESCRIPTION= - "Statistics on inbound connections"; - - public static final String OUTBOUND_CONNECTION_MONITORING_ROOT = - "Outbound"; - public static final String OUTBOUND_CONNECTION_MONITORING_ROOT_DESCRIPTION= - "Statistics on outbound connections"; - - public static final String CONNECTION_MONITORING_DESCRIPTION = - "Connection statistics"; - - public static final String CONNECTION_TOTAL_NUMBER_OF_CONNECTIONS = - "NumberOfConnections"; - public static final String CONNECTION_TOTAL_NUMBER_OF_CONNECTIONS_DESCRIPTION = - "The total number of connections"; - public static final String CONNECTION_NUMBER_OF_IDLE_CONNECTIONS = - "NumberOfIdleConnections"; - public static final String CONNECTION_NUMBER_OF_IDLE_CONNECTIONS_DESCRIPTION = - "The number of idle connections"; - public static final String CONNECTION_NUMBER_OF_BUSY_CONNECTIONS = - "NumberOfBusyConnections"; - public static final String CONNECTION_NUMBER_OF_BUSY_CONNECTIONS_DESCRIPTION = - "The number of busy connections"; - - // - // ThreadPool and WorkQueue monitoring constants - // - - public static final String THREADPOOL_MONITORING_ROOT = "threadpool"; - public static final String THREADPOOL_MONITORING_ROOT_DESCRIPTION = - "Monitoring for all ThreadPool instances"; - public static final String THREADPOOL_MONITORING_DESCRIPTION = - "Monitoring for a ThreadPool"; - public static final String THREADPOOL_CURRENT_NUMBER_OF_THREADS = - "currentNumberOfThreads"; - public static final String THREADPOOL_CURRENT_NUMBER_OF_THREADS_DESCRIPTION = - "Current number of total threads in the ThreadPool"; - public static final String THREADPOOL_NUMBER_OF_AVAILABLE_THREADS = - "numberOfAvailableThreads"; - public static final String THREADPOOL_NUMBER_OF_AVAILABLE_THREADS_DESCRIPTION = - "Number of available threads in the ThreadPool"; - public static final String THREADPOOL_NUMBER_OF_BUSY_THREADS = - "numberOfBusyThreads"; - public static final String THREADPOOL_NUMBER_OF_BUSY_THREADS_DESCRIPTION = - "Number of busy threads in the ThreadPool"; - public static final String THREADPOOL_AVERAGE_WORK_COMPLETION_TIME = - "averageWorkCompletionTime"; - public static final String THREADPOOL_AVERAGE_WORK_COMPLETION_TIME_DESCRIPTION = - "Average elapsed time taken to complete a work item by the ThreadPool"; - public static final String THREADPOOL_CURRENT_PROCESSED_COUNT = - "currentProcessedCount"; - public static final String THREADPOOL_CURRENT_PROCESSED_COUNT_DESCRIPTION = - "Number of Work items processed by the ThreadPool"; - - public static final String WORKQUEUE_MONITORING_DESCRIPTION = - "Monitoring for a Work Queue"; - public static final String WORKQUEUE_TOTAL_WORK_ITEMS_ADDED = - "totalWorkItemsAdded"; - public static final String WORKQUEUE_TOTAL_WORK_ITEMS_ADDED_DESCRIPTION = - "Total number of Work items added to the Queue"; - public static final String WORKQUEUE_WORK_ITEMS_IN_QUEUE = - "workItemsInQueue"; - public static final String WORKQUEUE_WORK_ITEMS_IN_QUEUE_DESCRIPTION = - "Number of Work items in the Queue to be processed"; - public static final String WORKQUEUE_AVERAGE_TIME_IN_QUEUE = - "averageTimeInQueue"; - public static final String WORKQUEUE_AVERAGE_TIME_IN_QUEUE_DESCRIPTION = - "Average time a work item waits in the work queue"; -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoringFactories.java b/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoringFactories.java deleted file mode 100644 index f34ad375b43..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoringFactories.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.spi.monitoring; - -import com.sun.corba.se.impl.monitoring.MonitoredObjectFactoryImpl; -import com.sun.corba.se.impl.monitoring.MonitoredAttributeInfoFactoryImpl; -import com.sun.corba.se.impl.monitoring.MonitoringManagerFactoryImpl; - -/** - * @author Hemanth Puttaswamy - * - * This is used for getting the default factories for - * MonitoredObject, MonitoredAttributeInfo and MonitoringManager. We do not - * expect users to use the MonitoredAttributeInfo factory most of the time - * because the Info is automatically built by StringMonitoredAttributeBase - * and LongMonitoredAttributeBase. - */ -public class MonitoringFactories { - /////////////////////////////////////// - // attributes - private static final MonitoredObjectFactoryImpl monitoredObjectFactory = - new MonitoredObjectFactoryImpl( ); - private static final MonitoredAttributeInfoFactoryImpl - monitoredAttributeInfoFactory = - new MonitoredAttributeInfoFactoryImpl( ); - private static final MonitoringManagerFactoryImpl monitoringManagerFactory = - new MonitoringManagerFactoryImpl( ); - - - /////////////////////////////////////// - // operations - -/** - * Gets the MonitoredObjectFactory - * - * @return a MonitoredObjectFactory - */ - public static MonitoredObjectFactory getMonitoredObjectFactory( ) { - return monitoredObjectFactory; - } - -/** - * Gets the MonitoredAttributeInfoFactory. The user is not expected to use this - * Factory, since the MonitoredAttributeInfo is internally created by - * StringMonitoredAttributeBase, LongMonitoredAttributeBase and - * StatisticMonitoredAttribute. If User wants to create a MonitoredAttribute - * of some other special type like a DoubleMonitoredAttribute, they can - * build a DoubleMonitoredAttributeBase like LongMonitoredAttributeBase - * and build a MonitoredAttributeInfo required by MonitoredAttributeBase - * internally by using this Factory. - * - * @return a MonitoredAttributeInfoFactory - */ - public static MonitoredAttributeInfoFactory - getMonitoredAttributeInfoFactory( ) - { - return monitoredAttributeInfoFactory; - } - -/** - * Gets the MonitoredManagerFactory. The user is not expected to use this - * Factory, since the ORB will be automatically initialized with the - * MonitoringManager. - * - * User can get hold of MonitoringManager associated with ORB by calling - * orb.getMonitoringManager( ) - * - * @return a MonitoredManagerFactory - */ - public static MonitoringManagerFactory getMonitoringManagerFactory( ) { - return monitoringManagerFactory; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoringManager.java b/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoringManager.java deleted file mode 100644 index 5b5082a042a..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoringManager.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.spi.monitoring; - -import java.io.Closeable; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.monitoring.MonitoredObject; -import java.util.*; - -/** - * Monitoring Manager will have a 1 to 1 association with the ORB. This - * gives access to the top level Monitored Object, using which more - * Monitored Objects and Attributes can be added and traversed. - * - * @author Hemanth Puttaswamy - */ -public interface MonitoringManager extends Closeable { - - /////////////////////////////////////// - // operations - -/** - * Gets the Root Monitored Object which contains a Hierarchy Of Monitored - * Objects exposing various Monitorable Attributes of Various modules. - */ - public MonitoredObject getRootMonitoredObject(); -/** - * Initialize is called whenever there is a start monitoring call to CORBA - * MBean. This will result in triaging initialize to all the - * MonitoredObjects and it's Monitored Attributes. - */ - public void clearState(); - -} // end MonitoringManager diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoringManagerFactory.java b/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoringManagerFactory.java deleted file mode 100644 index 8d117392068..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoringManagerFactory.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.spi.monitoring; - -/** - * @author Hemanth Puttaswamy - * - * MonitoringObjectFactory is used internally by the ORB, It is not for - * general public use. - */ -public interface MonitoringManagerFactory { - /** - * A Simple Factory Method to create the Monitored Attribute Info. - */ - MonitoringManager createMonitoringManager( String nameOfTheRoot, - String description ); - - void remove(String nameOfTheRoot); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/StatisticMonitoredAttribute.java b/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/StatisticMonitoredAttribute.java deleted file mode 100644 index f28ab0efad7..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/StatisticMonitoredAttribute.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.spi.monitoring; - -import java.util.*; - -/** - * @author Hemanth Puttaswamy - * - * StatisticsMonitoredAttribute is provided as a convenience to collect the - * Statistics of any entity. The getValue() call will be delegated to the - * StatisticsAccumulator set by the user. - */ -public class StatisticMonitoredAttribute extends MonitoredAttributeBase { - - - // Every StatisticMonitoredAttribute will have a StatisticAccumulator. User - // will use Statisticsaccumulator to accumulate the samples associated with - // this Monitored Attribute - private StatisticsAccumulator statisticsAccumulator; - - // Mutex is passed from the user class which is providing the sample values. - // getValue() and clearState() is synchronized on this user provided mutex - private Object mutex; - - - /////////////////////////////////////// - // operations - - -/** - * Constructs the StaisticMonitoredAttribute, builds the required - * MonitoredAttributeInfo with Long as the class type and is always - * readonly attribute. - * - * @param name Of this attribute - * @param desc should provide a good description on the kind of statistics - * collected, a good example is "Connection Response Time Stats will Provide the - * detailed stats based on the samples provided from every request completion - * time" - * @param s is the StatisticsAcumulator that user will use to accumulate the - * samples and this Attribute Object will get the computed statistics values - * from. - * @param mutex using which clearState() and getValue() calls need to be locked. - */ - public StatisticMonitoredAttribute(String name, String desc, - StatisticsAccumulator s, Object mutex) - { - super( name ); - MonitoredAttributeInfoFactory f = - MonitoringFactories.getMonitoredAttributeInfoFactory(); - MonitoredAttributeInfo maInfo = f.createMonitoredAttributeInfo( - desc, String.class, false, true ); - - this.setMonitoredAttributeInfo( maInfo ); - this.statisticsAccumulator = s; - this.mutex = mutex; - } // end StatisticMonitoredAttribute - - - -/** - * Gets the value from the StatisticsAccumulator, the value will be a formatted - * String with the computed statistics based on the samples accumulated in the - * Statistics Accumulator. - */ - public Object getValue( ) { - synchronized( mutex ) { - return statisticsAccumulator.getValue( ); - } - } - -/** - * Clears the state on Statistics Accumulator, After this call all samples are - * treated fresh and the old sample computations are disregarded. - */ - public void clearState( ) { - synchronized( mutex ) { - statisticsAccumulator.clearState( ); - } - } - -/** - * Gets the statistics accumulator associated with StatisticMonitoredAttribute. - * Usually, the user don't need to use this method as they can keep the handle - * to Accumulator to collect the samples. - */ - public StatisticsAccumulator getStatisticsAccumulator( ) { - return statisticsAccumulator; - } -} // end StatisticMonitoredAttribute diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/StatisticsAccumulator.java b/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/StatisticsAccumulator.java deleted file mode 100644 index a172216908c..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/StatisticsAccumulator.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.spi.monitoring; - -import java.util.*; - -/** - * @author Hemanth Puttaswamy - * - * StatisticsAccumulator accumulates the samples provided by the user and - * computes the value of minimum, maximum, sum and sample square sum. When - * the StatisticMonitoredAttribute calls getValue(), it will compute all - * the statistics for the collected samples (Which are Minimum, Maximum, - * Average, StandardDeviation) and provides a nice printable record as a - * String. - * - * Users can easily extend this class and provide the implementation of - * toString() method to format the stats as desired. By default all the stats - * are printed in a single line. - */ -public class StatisticsAccumulator { - - /////////////////////////////////////// - // attributes - - - // Users can extend this class to get access to current Max value - protected double max = Double.MIN_VALUE; - - // Users can extend this class to get access to current Min value - protected double min = Double.MAX_VALUE; - - private double sampleSum; - - private double sampleSquareSum; - - private long sampleCount; - - protected String unit; - - - - /////////////////////////////////////// - // operations - - - -/** - * User will use this method to just register a sample with the - * StatisticsAccumulator. This is the only method that User will use to - * expose the statistics, internally the StatisticMonitoredAttribute will - * collect the information when requested from the ASAdmin. - * - * @param value a double value to make it more precise - */ - public void sample(double value) { - sampleCount++; - if( value < min ) min = value; - if( value > max) max = value; - sampleSum += value; - sampleSquareSum += (value * value); - } // end sample - - - - /** - * Computes the Standard Statistic Results based on the samples collected - * so far and provides the complete value as a formatted String - */ - public String getValue( ) { - return toString(); - } - - /** - * Users can extend StatisticsAccumulator to provide the complete - * Stats in the format they prefer, if the default format doesn't suffice. - */ - public String toString( ) { - return "Minimum Value = " + min + " " + unit + " " + - "Maximum Value = " + max + " " + unit + " " + - "Average Value = " + computeAverage() + " " + unit + " " + - "Standard Deviation = " + computeStandardDeviation() + " " + unit + - " " + "Samples Collected = " + sampleCount; - } - - /** - * If users choose to custom format the stats. - */ - protected double computeAverage( ) { - return (sampleSum / sampleCount); - } - - - /** - * We use a derived Standard Deviation formula to compute SD. This way - * there is no need to hold on to all the samples provided. - * - * The method is protected to let users extend and format the results. - */ - protected double computeStandardDeviation( ) { - double sampleSumSquare = sampleSum * sampleSum; - return Math.sqrt( - (sampleSquareSum-((sampleSumSquare)/sampleCount))/(sampleCount-1)); - } - -/** - * Construct the Statistics Accumulator by providing the unit as a String. - * The examples of units are "Hours", "Minutes", - * "Seconds", "MilliSeconds", "Micro Seconds" etc. - * - * @param unit a String representing the units for the samples collected - */ - public StatisticsAccumulator( String unit ) { - this.unit = unit; - sampleCount = 0; - sampleSum = 0; - sampleSquareSum = 0; - } - - - /** - * Clears the samples and starts fresh on new samples. - */ - void clearState( ) { - min = Double.MAX_VALUE; - max = Double.MIN_VALUE; - sampleCount = 0; - sampleSum = 0; - sampleSquareSum = 0; - } - - /** - * This is an internal API to test StatisticsAccumulator... - */ - public void unitTestValidate( String expectedUnit, double expectedMin, - double expectedMax, long expectedSampleCount, double expectedAverage, - double expectedStandardDeviation ) - { - if( !expectedUnit.equals( unit ) ){ - throw new RuntimeException( - "Unit is not same as expected Unit" + - "\nUnit = " + unit + "ExpectedUnit = " + expectedUnit ); - } - if( min != expectedMin ) { - throw new RuntimeException( - "Minimum value is not same as expected minimum value" + - "\nMin Value = " + min + "Expected Min Value = " + expectedMin); - } - if( max != expectedMax ) { - throw new RuntimeException( - "Maximum value is not same as expected maximum value" + - "\nMax Value = " + max + "Expected Max Value = " + expectedMax); - } - if( sampleCount != expectedSampleCount ) { - throw new RuntimeException( - "Sample count is not same as expected Sample Count" + - "\nSampleCount = " + sampleCount + "Expected Sample Count = " + - expectedSampleCount); - } - if( computeAverage() != expectedAverage ) { - throw new RuntimeException( - "Average is not same as expected Average" + - "\nAverage = " + computeAverage() + "Expected Average = " + - expectedAverage); - } - // We are computing Standard Deviation from two different methods - // for comparison. So, the values will not be the exact same to the last - // few digits. So, we are taking the difference and making sure that - // the difference is not greater than 1. - double difference = Math.abs( - computeStandardDeviation() - expectedStandardDeviation); - if( difference > 1 ) { - throw new RuntimeException( - "Standard Deviation is not same as expected Std Deviation" + - "\nStandard Dev = " + computeStandardDeviation() + - "Expected Standard Dev = " + expectedStandardDeviation); - } - } - - -} // end StatisticsAccumulator diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/StringMonitoredAttributeBase.java b/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/StringMonitoredAttributeBase.java deleted file mode 100644 index 5b11ae61c64..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/StringMonitoredAttributeBase.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.spi.monitoring; - -import java.util.*; - -/** - * @author Hemanth Puttaswamy - * - * A Convenient Abstraction to present String type Monitored Attribute. One - * of the examples of StringMonitoredAttribute is the State information. - */ -public abstract class StringMonitoredAttributeBase - extends MonitoredAttributeBase -{ - - /////////////////////////////////////// - // operations - - -/** - * Constructs StringMonitoredAttribute with the MonitoredAttributeInfo - * built with the class type of String. - * - * @param name of this attribute - * @param description of this attribute - */ - public StringMonitoredAttributeBase(String name, String description) { - super( name ); - MonitoredAttributeInfoFactory f = - MonitoringFactories.getMonitoredAttributeInfoFactory(); - MonitoredAttributeInfo maInfo = f.createMonitoredAttributeInfo( - description, String.class, false, false ); - this.setMonitoredAttributeInfo( maInfo ); - } // end StringMonitoredAttributeBase - - -} // end StringMonitoredAttributeBase diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/package.html b/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/package.html deleted file mode 100644 index f73b0cbb907..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/package.html +++ /dev/null @@ -1,302 +0,0 @@ - - - - - - package - - - -General Information -

            Monitoring Framework SPI's is used internally by the ORB to instrument -for JMX based Management and Monitoring. The -
            framework is very generic and easy to use and acts as facade to retrieve -the information from the running CORBA system. -

            This framework helps in building a nice Hierarchical Structure of Monitored -Objects that contains Monitored Attributes. -
            com.sun.corba.se.spi.orb.ORB has an API to get the RootMonitoredObject -and then User can traverse through the tree to -
            either instrument or retrieve the information for Monitoring. -

            -Code Snippet to Instrument Connection Monitored Object

            -This example shows on how to instrument CorbaConnectionImpl 's attributes. -It exposes two -
            attributes, namely -

            1. Connection State -
            2. Response time statistics to Appeserver Admin Console or CLI -
              -

            -1. Instrumenting Connection State

            -/** -
             *  Code Snippet to Instrument Connection Monitored Object -with -
             *  ConnectionState Monitored Attribute. Steps to follow -
             * -
             *  Step 1: Define a Monitored Attribute (ConnectionStateMonitoredAttribute) -Class by extending -
             *               -StringMonitoredAttributeBase -
             * -
             *  Step 2: Create Connection Manager Monitored Object and -add that to -
             *                -Root Monitored Object. -
             * -
             *  Step 3: Create Connection Monitored Object  and -add it to Connection Manager Monitored Object -
             * -
             *  Step 4: Instantiate Concrete Attribute (ConnectionStateMonitoredAttribute) -Class and add that to -
             *                -the Connection MonitoredObject -
             * -
             *  Step 5: Adds ConnectionMonitoredObject to ConnectionManagerMonitoredObject -
             * -
             */ -

            /** -
              *  Step 1: Define a Monitored Attribute Class by extending -
              *                -StringMonitoredAttributeBase -
              */ -

            /** -
              *  ConnectionState gets the value on demand. -
              */ -
            #import com.sun.corba.se.spi.monitoring.LongMonitoredAttributeBase -
            #import com.sun.corba.se.spi.transport.CorbaConnection; -

            public class ConnectionStateMonitoredAttribute extends StringMonitoredAttributeBase -
            { -
                CorbaConnection connection; -
                public ConnectionInUseMonitoredAttribute( String -name, String desc, -
                    CorbaConnection con ) -
                { -
                    super( name, desc ); -
                    connection = con; -
                } -

                public Object getValue( ) { -
                    // Delegate the getValue -call to connection -
                    // so, there is no state -maintained in this attribute object itself -
                    // and also the locking -will be the responsibility of Connection -
                    // Object. By doing this -we will avoid global locking and possibly -
                    // avoiding the bottleneck -
                    return connection.getState( -); -
                } -

                // IMPORTANT: In this case we don't have to implement -clearState() method -
                // If there is a need to implement this method like -for POACounter, the -
                // call again can be delegated to the Object which -maintains the real -
                // state. clearState() is invoked whenever there -is a call to CORBAMBean.startMonitoring() -
            } -
              -

            /** -
             *  Step 2: Create Connection Manager Monitored Object and -add that to -
             *          Root -Monitored Object. -
             */ -
            import com.sun.corba.se.spi.monitoring.MonitoringFactories; -
            import com.sun.corba.se.spi.monitoring.MonitoredObject; -

            private static MonitoredObject connectionManagerMonitoredObject; -
            private static MonitoredObject connectionMonitoredObject; -
              -

                private void instrumentConnectionManager( ) { -
                    connectionManagerMonitoredObject -= -
                        -MonitoringFactories.getMonitoredObjectFactory().createMonitoredObject( -
                            -"ConnectionManagerMonitoredObject", -
                            -"Used to Monitor the stats on All IIOP Connections " ); -
                    orb.getRootMonitoredObject().addChild(connectionManagerMonitoredObject -); -
                } -
              -

            /** -
              *  Step 3: Create Connection Monitored Object  and -add it to Connection Manager Monitored Object -
              * -
              *  Step 4: Instantiate Concrete Attribute (ConnectionStateMonitoredAttribute) -Class and add that to -
              *                -the Connection MonitoredObject -
              * -
              *  Step 5: Add ConnectionMonitoredObject to ConnectionManagerMonitoredObject -
              */ -
            private void instrumentConnectionObject( CorbConnection connection -) { -
                // Step 3 -
                MonitoredObject connectionMonitoredObject = -
                    MonitoringFactories.getMonitoredObjectFactory().createMonitoredObject( -
                        -connection.getName(), -
                        -"Used to Monitor the stats on one connection" ); -
                // Step 4 -
                ConnectionStateMonitoredAttribute connectionState -= -
                    new ConnectionStateMonitoredAttribute( -"Connection_State", -
                        -"Provides the state of the IIOP Connection ...",  connection ); -
                connectionMonitoredObject.addAttribute( connectionState -); -
                // Step 5 -
                connectionManagerMonitoredObject.addChild( connectionMonitoredObject -); -
            } -
              -
              -

            Code Snippet to Instrument A Statistic Type Monitored -Attribute -

            /** -
              *  Assuming ConnectionMonitoredObject is already added -to the MonitoredObject Hierarchy. -
              *  This example code shows how to instrument ConnectionMonitoredObject -with a new -
              *   StatisticMonitoredAttribute. -
              * -
              *    IMPORTANT: StatisticsMonitoredAttribute -is mostly write mostly and read sparingly, i.e., -
              *    the frequency of writes(Collecting samples) -is high.  It is the responsibility of user to synchronize -
              *    the sample() method and the StatisticMonitoredAttribute -will synchronize clearState() and -
              *    getValue() using the mutex object sent. -
              */ -
            private void instrumentStatsToConnectionObject( MonitoredObject connectionMonitoredObject  -) { -
                 // Step 4 -
                StatisticsAccumulator connectRequestStatsAccumulator -= -
                    // Microseconds is the unit -used for statistics measure -
                    new StatisticsAccumulator( -"Micro Seconds" ); -

                // Pass Name, Description, Statistic Accumulator -Instance, Mutex (The -
                // Object on which we need to synchronize for stats -sample collection) -
                StatisticMonitoredAttribute sm = new StatisticMonitoredAttribute( -
                    connection.getName() + "Stats", -
                    "Connection Request Stats", -connectRequestStatsAccumulator, this ); -

                connectionMonitoredObject.addAttribute( sm ); -
              -

                // Now, The user can accumulate the samples by calling -into -
                // connectRequestStatsAccumulator.sample( <value> -); -
                // Finally When ASAdmin request for the value of -this Stats Monitored Attribute -
                // by using standard getValue() call. It will return -a formatted Stats Value like -
                //  For Example -
                // -
                //  Minimum Value = 200 Microseconds -
                //  Maximum Value = 928 Microseconds -
                //  Average Value = 523 Microseconds -
                //  Standard Deviation = 53.72 Microseconds -
                //  Sample Collected = 435 -

            } -

            Caution On Global Locking (Synchronization): -

            It's important to make sure that collecting Stats and other state information -for monitoring doesn't impact performance. Please look at the following -don'ts -
            to understand better. -

            Do not add a special mutex for synchronizing MonitoredObject: -
            Let's take an example of exposing a counter that counts Requests on -this connection and 2 possible ways of doing this -
            1. Define Counter by extending LongMonitoredAttributeBase -
                 public class Counter extends LongMonitoredAttributeBase -{ -
                    private long counter; -
              -
                    Counter( String name, String -desc ) { -
                        -super( name, desc ); -
                    } -
              -
                     public synchronized -void increment( ) { -
                          -counter++; -
                     } -

                      public synchronized -Object getValue( ) { -
                          -return new Long( counter ); -
                      } -
                } -
              -

            2. Or Define a RequestCounter by extending LongMonitoredAttributeBase -again, but no special -
                synchronization is done -

                public class RequestCounter extends LongMonitoredAttributeBase -{ -
                    private CorbaConnection -connection; -
                    RequestCounter( String name, -String desc, CorbaConnection con ) { -
                        -super( name, desc ); -
                        -connection = con; -
                    } -

                    public Object getValue( ) -{ -
                        -return connection.getRequestCount( ); -
                   } -
                } -

                The problem with Alternative (1) is that there may -be unneccesary extra synchronization happening for every method and it -may become a bottle neck -
                 particularly if this object is accessed quite -often. In Alternative (2), the synchronization happens only in the Connection -object and no special sync -
                 is required in the RequestCounter object. -
              -

            Important Thing To Know On StatisticMonitoredAttribute -type: -
            The clearState() and getValue() call will be synchronized using the -mutex passed by the external object, but sample() method in StatisticsAccumulator -
            is not synchronized. It is the responsibility of user to synchronize -to make sure that the samples collected (The mutex passed into the StatisticsAccumulator must be the one used to synchronize calls to sample() ). -
              -

            @since JDK1.5 @serial exclude - - diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/oa/NullServant.java b/src/java.corba/share/classes/com/sun/corba/se/spi/oa/NullServant.java deleted file mode 100644 index 3b3110b02c3..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/oa/NullServant.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.oa ; - -import org.omg.CORBA.SystemException ; - -/** NullServant is used to represent a null servant returned - * OAInvocationInfo after a - * ObjectAdapter.getInvocationServant( OAInvocationInfo ) call. - * If the getInvocationServant call could not locate a servant - * for the ObjectId in the OAInvocationInfo, getServantContainer - * will contain a NullServant. Later stages of the request - * dispatch may choose either to throw the exception or perform - * some other action in response to the NullServant result. - */ -public interface NullServant -{ - /** Obtain the exception that is associated with this - * NullServant instance. - */ - SystemException getException() ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/oa/OADefault.java b/src/java.corba/share/classes/com/sun/corba/se/spi/oa/OADefault.java deleted file mode 100644 index 766ba6354e8..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/oa/OADefault.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.oa ; - -import com.sun.corba.se.impl.oa.poa.POAFactory ; -import com.sun.corba.se.impl.oa.toa.TOAFactory ; -import com.sun.corba.se.spi.orb.ORB ; - -/** OADefault provides methods to create the standard ObjectAdapterFactory - * instances for this version of the ORB. These methods are generally - * used in ORBConfigurator instances to construct an ORB instance. - */ -public class OADefault { - public static ObjectAdapterFactory makePOAFactory( ORB orb ) - { - ObjectAdapterFactory oaf = new POAFactory() ; - oaf.init( orb ) ; - return oaf ; - } - - public static ObjectAdapterFactory makeTOAFactory( ORB orb ) - { - ObjectAdapterFactory oaf = new TOAFactory() ; - oaf.init( orb ) ; - return oaf ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/oa/OADestroyed.java b/src/java.corba/share/classes/com/sun/corba/se/spi/oa/OADestroyed.java deleted file mode 100644 index 101dc9bd978..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/oa/OADestroyed.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.spi.oa; - -/** This exception is thrown when an operation on an ObjectAdapter - * fails because the ObjectAdapter was destroyed during the operation. - */ -public class OADestroyed extends java.lang.Exception { -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/oa/OAInvocationInfo.java b/src/java.corba/share/classes/com/sun/corba/se/spi/oa/OAInvocationInfo.java deleted file mode 100644 index e2eb526869a..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/oa/OAInvocationInfo.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.spi.oa; - -import javax.rmi.CORBA.Tie ; - -import org.omg.CORBA.portable.ServantObject; - -import org.omg.PortableServer.Servant; - -import org.omg.PortableServer.ServantLocatorPackage.CookieHolder; - -import com.sun.corba.se.spi.oa.ObjectAdapter ; -import com.sun.corba.se.spi.copyobject.ObjectCopierFactory ; - -/** This class is a holder for the information required to implement POACurrent. -* It is also used for the ServantObject that is returned by _servant_preinvoke calls. -* This allows us to avoid allocating an extra object on each collocated invocation. -*/ -public class OAInvocationInfo extends ServantObject { - // This is the container object for the servant. - // In the RMI-IIOP case, it is the RMI-IIOP Tie, and the servant is the - // target of the Tie. - // In all other cases, it is the same as the Servant. - private java.lang.Object servantContainer ; - - // These fields are to support standard OMG APIs. - private ObjectAdapter oa; - private byte[] oid; - - // These fields are to support the Object adapter implementation. - private CookieHolder cookieHolder; - private String operation; - - // This is the copier to be used by javax.rmi.CORBA.Util.copyObject(s) - // For the current request. - private ObjectCopierFactory factory ; - - public OAInvocationInfo(ObjectAdapter oa, byte[] id ) - { - this.oa = oa; - this.oid = id; - } - - // Copy constructor of sorts; used in local optimization path - public OAInvocationInfo( OAInvocationInfo info, String operation ) - { - this.servant = info.servant ; - this.servantContainer = info.servantContainer ; - this.cookieHolder = info.cookieHolder ; - this.oa = info.oa; - this.oid = info.oid; - this.factory = info.factory ; - - this.operation = operation; - } - - //getters - public ObjectAdapter oa() { return oa ; } - public byte[] id() { return oid ; } - public Object getServantContainer() { return servantContainer ; } - - // Create CookieHolder on demand. This is only called by a single - // thread, so no synchronization is needed. - public CookieHolder getCookieHolder() - { - if (cookieHolder == null) - cookieHolder = new CookieHolder() ; - - return cookieHolder; - } - - public String getOperation() { return operation; } - public ObjectCopierFactory getCopierFactory() { return factory; } - - //setters - public void setOperation( String operation ) { this.operation = operation ; } - public void setCopierFactory( ObjectCopierFactory factory ) { this.factory = factory ; } - - public void setServant(Object servant) - { - servantContainer = servant ; - if (servant instanceof Tie) - this.servant = ((Tie)servant).getTarget() ; - else - this.servant = servant; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/oa/ObjectAdapter.java b/src/java.corba/share/classes/com/sun/corba/se/spi/oa/ObjectAdapter.java deleted file mode 100644 index dbe1ac9648c..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/oa/ObjectAdapter.java +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.oa ; - -import org.omg.CORBA.Policy ; - -import org.omg.PortableInterceptor.ObjectReferenceTemplate ; -import org.omg.PortableInterceptor.ObjectReferenceFactory ; - -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.spi.oa.OADestroyed ; - -import com.sun.corba.se.spi.ior.IORTemplate ; - -// REVISIT: What should the order be? enter/push...pop/exit? - -/** ObjectAdapter represents the abstract model of an object -* adapter that was introduced by ORT. This means that all -* object adapters must: -*

              -*
            • Have an ORB
            • -*
            • Have a name
            • -*
            • Have an adapter manager (represented by an ID)
            • -*
            • Have an adapter template
            • -*
            • Support getting and setting their ObjectReferenceFactory
            • -*
            • Provide access to their current state
            • -*
            • Support adding components to their profiles expressed in the adapter template
            • -*
            -* Other requirements: -*
              -*
            • All object adapters must invoke ORB.AdapterCreated when they are created. -*
            • -*
            • All adapter managers must invoke ORB.AdapterManagerStateChanged when -* their state changes, mapping the internal state to an ORT state.
            • -*
            • AdapterStateChanged must be invoked (from somewhere) whenever -* an adapter state changes that is not due to an adapter manager state change.
            • -*
            -*

            -* Object adapters must also provide mechanisms for: -*

              -*
            • Managing object reference lifecycle
            • -*
            • Controlling how servants are associated with object references
            • -*
            • Manage the state of the adapter, if the adapter desires to implement such mechanisms
            • -*
            -* Such mechanisms are all object adapter specific, and so we do not attempt to -* create general APIs for these functions here. The object adapter itself -* must provide these APIs directly to the user, and they do not affect the rest of the -* ORB. This interface basically makes it possible to plug any object adapter into the -* ORB and have the OA work propertly with portable interceptors, and also have requests -* dispatched properly to the object adapter. -*

            -* The basic function of an ObjectAdapter is to map object IDs to servants and to support -* the dispatch operation of the subcontract, which dispatches requests to servants. -* This is the purpose of the getInvocationServant method. In addition, ObjectAdapters must be -* able to change state gracefully in the presence of executing methods. This -* requires the use of the enter/exit methods. Finally, ObjectAdapters often -* require access to information about requests. This is accomodated through the -* OAInvocationInfo class and the thread local stack maintained by push/pop/peekInvocationInfo -* on the ORB. -*

            -* To be useful, this dispatch cycle must be extremely efficient. There are several -* scenarios that matter: -*

              -*
            1. A remote invocation, where the dispatch is handled in the server subcontract.
            2. -*
            3. A local invocation, where the dispatch is handled in the client subcontract.
            4. -*
            5. A cached local invocation, where the servant is cached when the IOR is established -* for the client subcontract, and the dispatch is handled in the client subcontract -* to the cached subcontract.
            6. -*
            -*

            -* Each of these 3 cases is handled a bit differently. On each request, assume as known -* ObjectId and ObjectAdapterId, which can be obtained from the object key. -* The ObjectAdaptorFactory is available in the subcontract registry, where it is -* registered under the subcontract ID. The Subcontract ID is also available in the -* object key. -*

              -*
            1. The remote pattern: -*
                -*
              1. oa = oaf.find( oaid )
              2. -*
              3. oa.enter()
              4. -*
              5. info = oa.makeInvocationInfo( oid )
              6. -*
              7. info.setOperation( operation )
              8. -*
              9. push info
              10. -*
              11. oa.getInvocationServant( info )
              12. -*
              13. sreq.setExecuteReturnServantInResponseConstructor( true )
              14. -*
              15. dispatch to servant
              16. -*
              17. oa.returnServant()
              18. -*
              19. oa.exit()
              20. -*
              21. pop info
              22. -*
              -*
            2. -* -*
            3. The local pattern: -*
                -*
              1. oa = oaf.find( oaid )
              2. -*
              3. oa.enter()
              4. -*
              5. info = oa.makeInvocationInfo( oid )
              6. -*
              7. info.setOperation( operation )
              8. -*
              9. push info
              10. -*
              11. oa.getInvocationServant( info )
              12. -*
              13. dispatch to servant
              14. -*
              15. oa.returnServant()
              16. -*
              17. oa.exit()
              18. -*
              19. pop info
              20. -*
              -*
            4. -* -*
            5. The fast local pattern: When delegate is constructed, -* first extract ObjectKey from IOR in delegate, -* then get ObjectId, ObjectAdapterId, and ObjectAdapterFactory (oaf). Then: -*
                -*
              1. oa = oaf.find( oaid )
              2. -*
              3. info = oa.makeInvocationInfo( oid ) (note: no operation!)
              4. -*
              5. push info (needed for the correct functioning of getInvocationServant)
              6. -*
              7. oa.getInvocationServant( info )
              8. -*
              9. pop info -*
              -* The info instance (which includes the Servant) is cached in the client subcontract. -*

              Then, on each invocation: -*

                -*
              1. newinfo = copy of info (clone)
              2. -*
              3. info.setOperation( operation )
              4. -*
              5. push newinfo
              6. -*
              7. oa.enter()
              8. -*
              9. dispatch to servant
              10. -*
              11. oa.returnServant()
              12. -*
              13. oa.exit()
              14. -*
              15. pop info
              16. -*
              -*
            6. -*
            -* XXX fast local should not call returnServant: what is correct here? -*/ -public interface ObjectAdapter -{ - //////////////////////////////////////////////////////////////////////////// - // Basic methods for supporting interceptors - //////////////////////////////////////////////////////////////////////////// - - /** Returns the ORB associated with this adapter. - */ - ORB getORB() ; - - Policy getEffectivePolicy( int type ) ; - - /** Returns the IOR template of this adapter. The profiles - * in this template may be updated only during the AdapterCreated call. - * After that call completes, the IOR template must be made immutable. - * Note that the server ID, ORB ID, and adapter name are all available - * from the IOR template. - */ - IORTemplate getIORTemplate() ; - - //////////////////////////////////////////////////////////////////////////// - // Methods needed to support ORT. - //////////////////////////////////////////////////////////////////////////// - - /** Return the ID of the AdapterManager for this object adapter. - */ - int getManagerId() ; - - /** Return the current state of this object adapter (see - * org.omg.PortableInterceptors for states. - */ - short getState() ; - - ObjectReferenceTemplate getAdapterTemplate() ; - - ObjectReferenceFactory getCurrentFactory() ; - - /** Change the current factory. This may only be called during the - * AdapterCreated call. - */ - void setCurrentFactory( ObjectReferenceFactory factory ) ; - - //////////////////////////////////////////////////////////////////////////// - // Methods required for dispatching to servants - //////////////////////////////////////////////////////////////////////////// - - /** Get the servant corresponding to the given objectId, if this is supported. - * This method is only used for models where the servant is an ObjectImpl, - * which allows the servant to be used directly as the stub. This allows an object - * reference to be replaced by its servant when it is unmarshalled locally. - * Such objects are not ORB mediated. - */ - org.omg.CORBA.Object getLocalServant( byte[] objectId ) ; - - /** Get the servant for the request given by the parameters. - * info must contain a valid objectId in this call. - * The servant is set in the InvocationInfo argument that is passed into - * this call. - * @param info is the InvocationInfo object for the object reference - * @exception ForwardException (a runtime exception) is thrown if the request - * is to be handled by a different object reference. - */ - void getInvocationServant( OAInvocationInfo info ) ; - - /** enter must be called before each request is invoked on a servant. - * @exception OADestroyed is thrown when an OA has been destroyed, which - * requires a retry in the case where an AdapterActivator is present. - */ - void enter( ) throws OADestroyed ; - - /** exit must be called after each request has been completed. If enter - * is called, there must always be a corresponding exit. - */ - void exit( ) ; - - /** Must be called every time getInvocationServant is called after - * the request has completed. - */ - public void returnServant() ; - - /** Create an instance of InvocationInfo that is appropriate for this - * Object adapter. - */ - OAInvocationInfo makeInvocationInfo( byte[] objectId ) ; - - /** Return the most derived interface for the given servant and objectId. - */ - String[] getInterfaces( Object servant, byte[] objectId ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/oa/ObjectAdapterBase.java b/src/java.corba/share/classes/com/sun/corba/se/spi/oa/ObjectAdapterBase.java deleted file mode 100644 index 35893e3970a..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/oa/ObjectAdapterBase.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.spi.oa ; - -import org.omg.PortableInterceptor.ObjectReferenceTemplate ; -import org.omg.PortableInterceptor.ObjectReferenceFactory ; - -import org.omg.CORBA.Policy ; - -import org.omg.PortableInterceptor.ACTIVE ; - -import com.sun.corba.se.spi.copyobject.ObjectCopierFactory ; -import com.sun.corba.se.spi.ior.IORFactories ; -import com.sun.corba.se.spi.ior.IORTemplate ; -import com.sun.corba.se.spi.ior.ObjectAdapterId; -import com.sun.corba.se.spi.ior.ObjectKeyTemplate ; -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.spi.oa.OADestroyed ; -import com.sun.corba.se.spi.oa.ObjectAdapter ; -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.protocol.PIHandler ; - -import com.sun.corba.se.impl.logging.POASystemException ; -import com.sun.corba.se.impl.logging.OMGSystemException ; -import com.sun.corba.se.impl.oa.poa.Policies; - -abstract public class ObjectAdapterBase extends org.omg.CORBA.LocalObject - implements ObjectAdapter -{ - private ORB orb; - - // Exception wrappers - private final POASystemException _iorWrapper ; - private final POASystemException _invocationWrapper ; - private final POASystemException _lifecycleWrapper ; - private final OMGSystemException _omgInvocationWrapper ; - private final OMGSystemException _omgLifecycleWrapper ; - - // Data related to the construction of object references and - // supporting the Object Reference Template. - private IORTemplate iortemp; - private byte[] adapterId ; - private ObjectReferenceTemplate adapterTemplate ; - private ObjectReferenceFactory currentFactory ; - - public ObjectAdapterBase( ORB orb ) - { - this.orb = orb ; - _iorWrapper = POASystemException.get( orb, - CORBALogDomains.OA_IOR ) ; - _lifecycleWrapper = POASystemException.get( orb, - CORBALogDomains.OA_LIFECYCLE ) ; - _omgLifecycleWrapper = OMGSystemException.get( orb, - CORBALogDomains.OA_LIFECYCLE ) ; - _invocationWrapper = POASystemException.get( orb, - CORBALogDomains.OA_INVOCATION ) ; - _omgInvocationWrapper = OMGSystemException.get( orb, - CORBALogDomains.OA_INVOCATION ) ; - } - - public final POASystemException iorWrapper() - { - return _iorWrapper ; - } - - public final POASystemException lifecycleWrapper() - { - return _lifecycleWrapper ; - } - - public final OMGSystemException omgLifecycleWrapper() - { - return _omgLifecycleWrapper ; - } - - public final POASystemException invocationWrapper() - { - return _invocationWrapper ; - } - - public final OMGSystemException omgInvocationWrapper() - { - return _omgInvocationWrapper ; - } - - /* - * This creates the complete template. - * When it is done, reference creation can proceed. - */ - final public void initializeTemplate( ObjectKeyTemplate oktemp, - boolean notifyORB, Policies policies, String codebase, - String objectAdapterManagerId, ObjectAdapterId objectAdapterId) - { - adapterId = oktemp.getAdapterId() ; - - iortemp = IORFactories.makeIORTemplate(oktemp) ; - - // This calls acceptors which create profiles and may - // add tagged components to those profiles. - orb.getCorbaTransportManager().addToIORTemplate( - iortemp, policies, - codebase, objectAdapterManagerId, objectAdapterId); - - adapterTemplate = IORFactories.makeObjectReferenceTemplate( orb, - iortemp ) ; - currentFactory = adapterTemplate ; - - if (notifyORB) { - PIHandler pih = orb.getPIHandler() ; - if (pih != null) - // This runs the IORInterceptors. - pih.objectAdapterCreated( this ) ; - } - - iortemp.makeImmutable() ; - } - - final public org.omg.CORBA.Object makeObject( String repId, byte[] oid ) - { - return currentFactory.make_object( repId, oid ) ; - } - - final public byte[] getAdapterId() - { - return adapterId ; - } - - final public ORB getORB() - { - return orb ; - } - - abstract public Policy getEffectivePolicy( int type ) ; - - final public IORTemplate getIORTemplate() - { - return iortemp ; - } - - abstract public int getManagerId() ; - - abstract public short getState() ; - - final public ObjectReferenceTemplate getAdapterTemplate() - { - return adapterTemplate ; - } - - final public ObjectReferenceFactory getCurrentFactory() - { - return currentFactory ; - } - - final public void setCurrentFactory( ObjectReferenceFactory factory ) - { - currentFactory = factory ; - } - - abstract public org.omg.CORBA.Object getLocalServant( byte[] objectId ) ; - - abstract public void getInvocationServant( OAInvocationInfo info ) ; - - abstract public void returnServant() ; - - abstract public void enter() throws OADestroyed ; - - abstract public void exit() ; - - abstract protected ObjectCopierFactory getObjectCopierFactory() ; - - // Note that all current subclasses share the same implementation of this method, - // but overriding it would make sense for OAs that use a different InvocationInfo. - public OAInvocationInfo makeInvocationInfo( byte[] objectId ) - { - OAInvocationInfo info = new OAInvocationInfo( this, objectId ) ; - info.setCopierFactory( getObjectCopierFactory() ) ; - return info ; - } - - abstract public String[] getInterfaces( Object servant, byte[] objectId ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/oa/ObjectAdapterFactory.java b/src/java.corba/share/classes/com/sun/corba/se/spi/oa/ObjectAdapterFactory.java deleted file mode 100644 index 7f1964deff2..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/oa/ObjectAdapterFactory.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.oa ; - -import com.sun.corba.se.spi.oa.ObjectAdapter ; - -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.spi.ior.ObjectAdapterId ; - -public interface ObjectAdapterFactory { - /** Initialize this object adapter factory instance. - */ - void init( ORB orb ) ; - - /** Shutdown all object adapters and other state associated - * with this factory. - */ - void shutdown( boolean waitForCompletion ) ; - - /** Find the ObjectAdapter instance that corresponds to the - * given ObjectAdapterId. - */ - ObjectAdapter find( ObjectAdapterId oaid ) ; - - ORB getORB() ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orb/DataCollector.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orb/DataCollector.java deleted file mode 100644 index 6f1e8977e16..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orb/DataCollector.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.spi.orb ; - -import java.applet.Applet ; -import java.util.Properties ; -import java.util.Vector ; - -/** Interface for collecting all sources of ORB configuration properties - * into a single properties object. A PropertyParser is needed so that - * the set of property names of interest is known. - */ -public interface DataCollector { - /** Return true iff this DataCollector was created from - * applet data. - */ - boolean isApplet() ; - - /** Return true iff the local host and ORB initial host are the same. - * This is provided to avoid exposing the local host in insecure - * contexts. - */ - boolean initialHostIsLocal() ; - - /** Set the parser which is used to obtain property names. - * This must be called before getProperties - * may be called. It may be called multiple times if different - * sets of properties are needed for the same data sources. - */ - void setParser( PropertyParser parser ) ; - - /** Return the consolidated property information to be used - * for ORB configuration. Note that -ORBInitRef arguments are - * handled specially: all -ORBInitRef name=value arguments are - * converted into ( org.omg.CORBA.ORBInitRef.name, value ) - * mappings in the resulting properties. Also, -ORBInitialServices - * is handled specially in applet mode: they are converted from - * relative to absolute URLs. - * @throws IllegalStateException if setPropertyNames has not - * been called. - */ - Properties getProperties() ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orb/ORB.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orb/ORB.java deleted file mode 100644 index 2e73453f974..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orb/ORB.java +++ /dev/null @@ -1,511 +0,0 @@ -/* - * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.orb; - -import java.util.Map ; -import java.util.HashMap ; -import java.util.Properties ; -import java.util.concurrent.ConcurrentHashMap; -import java.util.logging.Logger ; - -import org.omg.CORBA.TCKind ; - -import com.sun.corba.se.pept.broker.Broker ; -import com.sun.corba.se.pept.transport.ByteBufferPool; - -import com.sun.corba.se.spi.protocol.RequestDispatcherRegistry ; -import com.sun.corba.se.spi.protocol.ClientDelegateFactory ; -import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher ; -import com.sun.corba.se.spi.protocol.PIHandler ; -import com.sun.corba.se.spi.resolver.LocalResolver ; -import com.sun.corba.se.spi.resolver.Resolver ; -import com.sun.corba.se.spi.transport.CorbaContactInfoListFactory ; -import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketManager; -import com.sun.corba.se.spi.monitoring.MonitoringConstants; -import com.sun.corba.se.spi.monitoring.MonitoringManager; -import com.sun.corba.se.spi.monitoring.MonitoringFactories; - -import com.sun.corba.se.spi.ior.IdentifiableFactoryFinder ; -import com.sun.corba.se.spi.ior.TaggedComponentFactoryFinder ; -import com.sun.corba.se.spi.ior.ObjectKey ; -import com.sun.corba.se.spi.ior.ObjectKeyFactory ; -import com.sun.corba.se.spi.ior.IOR ; - -import com.sun.corba.se.spi.orbutil.threadpool.ThreadPoolManager; - -import com.sun.corba.se.spi.oa.OAInvocationInfo ; -import com.sun.corba.se.spi.transport.CorbaTransportManager; - -import com.sun.corba.se.spi.logging.LogWrapperFactory ; -import com.sun.corba.se.spi.logging.LogWrapperBase ; -import com.sun.corba.se.spi.logging.CORBALogDomains ; - -import com.sun.corba.se.spi.copyobject.CopierManager ; - -import com.sun.corba.se.spi.presentation.rmi.PresentationManager ; -import com.sun.corba.se.spi.presentation.rmi.PresentationDefaults ; - -import com.sun.corba.se.spi.servicecontext.ServiceContextRegistry ; - -// XXX needs an SPI or else it does not belong here -import com.sun.corba.se.impl.corba.TypeCodeImpl ; -import com.sun.corba.se.impl.corba.TypeCodeFactory ; - -// XXX Should there be a SPI level constants ? -import com.sun.corba.se.impl.orbutil.ORBConstants ; - -import com.sun.corba.se.impl.oa.poa.BadServerIdHandler ; - -import com.sun.corba.se.impl.transport.ByteBufferPoolImpl; - -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; -import com.sun.corba.se.impl.logging.OMGSystemException ; - -import com.sun.corba.se.impl.presentation.rmi.PresentationManagerImpl ; - -public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB - implements Broker, TypeCodeFactory -{ - // As much as possible, this class should be stateless. However, - // there are a few reasons why it is not: - // - // 1. The ORB debug flags are defined here because they are accessed - // frequently, and we do not want a cast to the impl just for that. - // 2. typeCodeMap and primitiveTypeCodeConstants are here because they - // are needed in both ORBImpl and ORBSingleton. - // 3. Logging support is here so that we can avoid problems with - // incompletely initialized ORBs that need to perform logging. - - // Flag set at compile time to debug flag processing: this can't - // be one of the xxxDebugFlags because it is used to debug the mechanism - // that sets the xxxDebugFlags! - public static boolean ORBInitDebug = false; - - // Currently defined debug flags. Any additions must be called xxxDebugFlag. - // All debug flags must be public boolean types. - // These are set by passing the flag -ORBDebug x,y,z in the ORB init args. - // Note that x,y,z must not contain spaces. - public boolean transportDebugFlag = false ; - public boolean subcontractDebugFlag = false ; - public boolean poaDebugFlag = false ; - public boolean poaConcurrencyDebugFlag = false ; - public boolean poaFSMDebugFlag = false ; - public boolean orbdDebugFlag = false ; - public boolean namingDebugFlag = false ; - public boolean serviceContextDebugFlag = false ; - public boolean transientObjectManagerDebugFlag = false ; - public boolean giopVersionDebugFlag = false; - public boolean shutdownDebugFlag = false; - public boolean giopDebugFlag = false; - public boolean invocationTimingDebugFlag = false ; - public boolean orbInitDebugFlag = false ; - - // SystemException log wrappers. Protected so that they can be used in - // subclasses. - protected static ORBUtilSystemException staticWrapper ; - protected ORBUtilSystemException wrapper ; - protected OMGSystemException omgWrapper ; - - // This map is needed for resolving recursive type code placeholders - // based on the unique repository id. - // XXX Should this be a WeakHashMap for GC? - private Map typeCodeMap; - - private TypeCodeImpl[] primitiveTypeCodeConstants; - - // ByteBufferPool - needed by both ORBImpl and ORBSingleton - ByteBufferPool byteBufferPool; - - // Local testing - // XXX clean this up, probably remove these - public abstract boolean isLocalHost( String hostName ) ; - public abstract boolean isLocalServerId( int subcontractId, int serverId ) ; - - // Invocation stack manipulation - public abstract OAInvocationInfo peekInvocationInfo() ; - public abstract void pushInvocationInfo( OAInvocationInfo info ) ; - public abstract OAInvocationInfo popInvocationInfo() ; - - public abstract CorbaTransportManager getCorbaTransportManager(); - public abstract LegacyServerSocketManager getLegacyServerSocketManager(); - - // wrapperMap maintains a table of LogWrapper instances used by - // different classes to log exceptions. The key is a StringPair - // representing LogDomain and ExceptionGroup. - private Map wrapperMap; - - static class Holder { - static final PresentationManager defaultPresentationManager = - setupPresentationManager(); - } - - private static Map staticWrapperMap = - new ConcurrentHashMap<>(); - - protected MonitoringManager monitoringManager; - - private static PresentationManager setupPresentationManager() { - staticWrapper = ORBUtilSystemException.get( - CORBALogDomains.RPC_PRESENTATION ) ; - - boolean useDynamicStub = false; - - PresentationManager.StubFactoryFactory dynamicStubFactoryFactory = null; - - PresentationManager pm = new PresentationManagerImpl( useDynamicStub ) ; - pm.setStubFactoryFactory( false, - PresentationDefaults.getStaticStubFactoryFactory() ) ; - pm.setStubFactoryFactory( true, dynamicStubFactoryFactory ) ; - return pm; - } - - public void destroy() { - wrapper = null; - omgWrapper = null; - typeCodeMap = null; - primitiveTypeCodeConstants = null; - byteBufferPool = null; - } - - /** Get the single instance of the PresentationManager - */ - public static PresentationManager getPresentationManager() - { - return Holder.defaultPresentationManager; - } - - /** Get the appropriate StubFactoryFactory. This - * will be dynamic or static depending on whether - * com.sun.CORBA.ORBUseDynamicStub is true or false. - */ - public static PresentationManager.StubFactoryFactory - getStubFactoryFactory() - { - PresentationManager gPM = getPresentationManager(); - boolean useDynamicStubs = gPM.useDynamicStubs() ; - return gPM.getStubFactoryFactory( useDynamicStubs ) ; - } - - protected ORB() - { - // Initialize logging first, since it is needed nearly - // everywhere (for example, in TypeCodeImpl). - wrapperMap = new ConcurrentHashMap<>(); - wrapper = ORBUtilSystemException.get( this, - CORBALogDomains.RPC_PRESENTATION ) ; - omgWrapper = OMGSystemException.get( this, - CORBALogDomains.RPC_PRESENTATION ) ; - - typeCodeMap = new HashMap<>(); - - primitiveTypeCodeConstants = new TypeCodeImpl[] { - new TypeCodeImpl(this, TCKind._tk_null), - new TypeCodeImpl(this, TCKind._tk_void), - new TypeCodeImpl(this, TCKind._tk_short), - new TypeCodeImpl(this, TCKind._tk_long), - new TypeCodeImpl(this, TCKind._tk_ushort), - new TypeCodeImpl(this, TCKind._tk_ulong), - new TypeCodeImpl(this, TCKind._tk_float), - new TypeCodeImpl(this, TCKind._tk_double), - new TypeCodeImpl(this, TCKind._tk_boolean), - new TypeCodeImpl(this, TCKind._tk_char), - new TypeCodeImpl(this, TCKind._tk_octet), - new TypeCodeImpl(this, TCKind._tk_any), - new TypeCodeImpl(this, TCKind._tk_TypeCode), - new TypeCodeImpl(this, TCKind._tk_Principal), - new TypeCodeImpl(this, TCKind._tk_objref), - null, // tk_struct - null, // tk_union - null, // tk_enum - new TypeCodeImpl(this, TCKind._tk_string), - null, // tk_sequence - null, // tk_array - null, // tk_alias - null, // tk_except - new TypeCodeImpl(this, TCKind._tk_longlong), - new TypeCodeImpl(this, TCKind._tk_ulonglong), - new TypeCodeImpl(this, TCKind._tk_longdouble), - new TypeCodeImpl(this, TCKind._tk_wchar), - new TypeCodeImpl(this, TCKind._tk_wstring), - new TypeCodeImpl(this, TCKind._tk_fixed), - new TypeCodeImpl(this, TCKind._tk_value), - new TypeCodeImpl(this, TCKind._tk_value_box), - new TypeCodeImpl(this, TCKind._tk_native), - new TypeCodeImpl(this, TCKind._tk_abstract_interface) - } ; - - monitoringManager = - MonitoringFactories.getMonitoringManagerFactory( ). - createMonitoringManager( - MonitoringConstants.DEFAULT_MONITORING_ROOT, - MonitoringConstants.DEFAULT_MONITORING_ROOT_DESCRIPTION); - } - - // Typecode support: needed in both ORBImpl and ORBSingleton - public TypeCodeImpl get_primitive_tc(int kind) - { - synchronized (this) { - checkShutdownState(); - } - try { - return primitiveTypeCodeConstants[kind] ; - } catch (Throwable t) { - throw wrapper.invalidTypecodeKind( t, new Integer(kind) ) ; - } - } - - public synchronized void setTypeCode(String id, TypeCodeImpl code) - { - checkShutdownState(); - typeCodeMap.put(id, code); - } - - public synchronized TypeCodeImpl getTypeCode(String id) - { - checkShutdownState(); - return typeCodeMap.get(id); - } - - public MonitoringManager getMonitoringManager( ) { - synchronized (this) { - checkShutdownState(); - } - return monitoringManager; - } - - // Special non-standard set_parameters method for - // creating a precisely controlled ORB instance. - // An ORB created by this call is affected only by - // those properties passes explicitly in props, not by - // the system properties and orb.properties files as - // with the standard ORB.init methods. - public abstract void set_parameters( Properties props ) ; - - // ORB versioning - public abstract ORBVersion getORBVersion() ; - public abstract void setORBVersion( ORBVersion version ) ; - - // XXX This needs a better name - public abstract IOR getFVDCodeBaseIOR() ; - - /** - * Handle a bad server id for the given object key. This should - * always through an exception: either a ForwardException to - * allow another server to handle the request, or else an error - * indication. XXX Remove after ORT for ORBD work is integrated. - */ - public abstract void handleBadServerId( ObjectKey okey ) ; - public abstract void setBadServerIdHandler( BadServerIdHandler handler ) ; - public abstract void initBadServerIdHandler() ; - - public abstract void notifyORB() ; - - public abstract PIHandler getPIHandler() ; - - public abstract void checkShutdownState(); - - // Dispatch support: in the ORB because it is needed for shutdown. - // This is used by the first level server side subcontract. - public abstract boolean isDuringDispatch() ; - public abstract void startingDispatch(); - public abstract void finishedDispatch(); - - /** Return this ORB's transient server ID. This is needed for - * initializing object adapters. - */ - public abstract int getTransientServerId(); - - public abstract ServiceContextRegistry getServiceContextRegistry() ; - - public abstract RequestDispatcherRegistry getRequestDispatcherRegistry(); - - public abstract ORBData getORBData() ; - - public abstract void setClientDelegateFactory( ClientDelegateFactory factory ) ; - - public abstract ClientDelegateFactory getClientDelegateFactory() ; - - public abstract void setCorbaContactInfoListFactory( CorbaContactInfoListFactory factory ) ; - - public abstract CorbaContactInfoListFactory getCorbaContactInfoListFactory() ; - - // XXX These next 7 methods should be moved to a ResolverManager. - - /** Set the resolver used in this ORB. This resolver will be used for list_initial_services - * and resolve_initial_references. - */ - public abstract void setResolver( Resolver resolver ) ; - - /** Get the resolver used in this ORB. This resolver will be used for list_initial_services - * and resolve_initial_references. - */ - public abstract Resolver getResolver() ; - - /** Set the LocalResolver used in this ORB. This LocalResolver is used for - * register_initial_reference only. - */ - public abstract void setLocalResolver( LocalResolver resolver ) ; - - /** Get the LocalResolver used in this ORB. This LocalResolver is used for - * register_initial_reference only. - */ - public abstract LocalResolver getLocalResolver() ; - - /** Set the operation used in string_to_object calls. The Operation must expect a - * String and return an org.omg.CORBA.Object. - */ - public abstract void setURLOperation( Operation stringToObject ) ; - - /** Get the operation used in string_to_object calls. The Operation must expect a - * String and return an org.omg.CORBA.Object. - */ - public abstract Operation getURLOperation() ; - - /** Set the ServerRequestDispatcher that should be used for handling INS requests. - */ - public abstract void setINSDelegate( CorbaServerRequestDispatcher insDelegate ) ; - - // XXX The next 5 operations should be moved to an IORManager. - - /** Factory finders for the various parts of the IOR: tagged components, tagged - * profiles, and tagged profile templates. - */ - public abstract TaggedComponentFactoryFinder getTaggedComponentFactoryFinder() ; - public abstract IdentifiableFactoryFinder getTaggedProfileFactoryFinder() ; - public abstract IdentifiableFactoryFinder getTaggedProfileTemplateFactoryFinder() ; - - public abstract ObjectKeyFactory getObjectKeyFactory() ; - public abstract void setObjectKeyFactory( ObjectKeyFactory factory ) ; - - // Logging SPI - - /** - * Returns the logger based on the category. - */ - public Logger getLogger( String domain ) - { - synchronized (this) { - checkShutdownState(); - } - ORBData odata = getORBData() ; - - // Determine the correct ORBId. There are 3 cases: - // 1. odata is null, which happens if we are getting a logger before - // ORB initialization is complete. In this case we cannot determine - // the ORB ID (it's not known yet), so we set the ORBId to - // _INITIALIZING_. - // 2. odata is not null, so initialization is complete, but ORBId is set to - // the default "". To avoid a ".." in - // the log domain, we simply use _DEFAULT_ in this case. - // 3. odata is not null, ORBId is not "": just use the ORBId. - String ORBId ; - if (odata == null) - ORBId = "_INITIALIZING_" ; - else { - ORBId = odata.getORBId() ; - if (ORBId.equals("")) - ORBId = "_DEFAULT_" ; - } - - return getCORBALogger( ORBId, domain ) ; - } - - public static Logger staticGetLogger( String domain ) - { - return getCORBALogger( "_CORBA_", domain ) ; - } - - private static Logger getCORBALogger( String ORBId, String domain ) - { - String fqLogDomain = CORBALogDomains.TOP_LEVEL_DOMAIN + "." + - ORBId + "." + domain; - - return Logger.getLogger( fqLogDomain, ORBConstants.LOG_RESOURCE_FILE ); - } - - /** get the log wrapper class (its type is dependent on the exceptionGroup) for the - * given log domain and exception group in this ORB instance. - */ - public LogWrapperBase getLogWrapper(String logDomain, - String exceptionGroup, LogWrapperFactory factory) - { - return wrapperMap.computeIfAbsent( - new StringPair(logDomain, exceptionGroup), - x -> factory.create(getLogger(logDomain))); - } - - /** get the log wrapper class (its type is dependent on the exceptionGroup) for the - * given log domain and exception group in this ORB instance. - */ - public static LogWrapperBase staticGetLogWrapper(String logDomain, - String exceptionGroup, LogWrapperFactory factory) - { - return staticWrapperMap.computeIfAbsent( - new StringPair(logDomain, exceptionGroup), - x -> factory.create(staticGetLogger(logDomain))); - } - - // get a reference to a ByteBufferPool, a pool of NIO ByteBuffers - // NOTE: ByteBuffer pool must be unique per ORB, not per process. - // There can be more than one ORB per process. - // This method must also be inherited by both ORB and ORBSingleton. - public ByteBufferPool getByteBufferPool() - { - synchronized (this) { - checkShutdownState(); - } - if (byteBufferPool == null) - byteBufferPool = new ByteBufferPoolImpl(this); - - return byteBufferPool; - } - - public abstract void setThreadPoolManager(ThreadPoolManager mgr); - - public abstract ThreadPoolManager getThreadPoolManager(); - - public abstract CopierManager getCopierManager() ; - - /* - * This method is called to verify that a stringified IOR passed to - * an org.omg.CORBA.ORB::string_to_object method contains a valid and acceptable IOR type. - * If an ORB is configured with IOR type checking enabled, - * the ORB executes a IOR type registry lookup to - * validate that the class name extract from a type id in - * a stringified IOR is a known and accepted type. - * A CORBA {@code org.omg.CORBA.DATA_CONVERSION} exception will be thrown should the type check fail. - * - * @param iorClassName - * a string representing the class name corresponding to the type id of an IOR - * @throws org.omg.CORBA.DATA_CONVERSION - * exception with an indication that it is a "Bad stringified IOR", which is thrown - * when the type check fails. - */ - public abstract void validateIORClass(String iorClassName); - -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orb/ORBConfigurator.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orb/ORBConfigurator.java deleted file mode 100644 index b5729696a7b..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orb/ORBConfigurator.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.spi.orb ; - -/** Interface used to configure an ORB instance. The DataCollector dc has all - * available config info available. The configure method may constructor a - * parser, call dc.setParser( parser ), get the consolidated properties from dc, - * and parse this information. The configure method may also register ORB - * components with the ORB and perform other parts of ORB initialization. - * Implementations of this interface must have a public no-args constructor. - */ -public interface ORBConfigurator { - void configure( DataCollector dc, ORB orb ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orb/ORBData.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orb/ORBData.java deleted file mode 100644 index 3311c7cf436..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orb/ORBData.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.orb ; - -import java.lang.reflect.Field ; - -import java.util.Map ; -import java.util.Set ; -import java.util.Iterator ; -import java.util.Properties ; - -import org.omg.PortableInterceptor.ORBInitializer ; - -import com.sun.corba.se.pept.transport.Acceptor; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion ; -import com.sun.corba.se.spi.transport.CorbaContactInfoListFactory; -import com.sun.corba.se.spi.transport.IORToSocketInfo; -import com.sun.corba.se.spi.transport.IIOPPrimaryToContactInfo; -import com.sun.corba.se.spi.transport.ReadTimeouts; - -import com.sun.corba.se.impl.legacy.connection.USLPort; -import com.sun.corba.se.impl.encoding.CodeSetComponentInfo ; - -public interface ORBData { - public String getORBInitialHost() ; - - public int getORBInitialPort() ; - - public String getORBServerHost() ; - - public int getORBServerPort() ; - - public String getListenOnAllInterfaces(); - - public com.sun.corba.se.spi.legacy.connection.ORBSocketFactory getLegacySocketFactory () ; - - public com.sun.corba.se.spi.transport.ORBSocketFactory getSocketFactory(); - - public USLPort[] getUserSpecifiedListenPorts () ; - - public IORToSocketInfo getIORToSocketInfo(); - - public IIOPPrimaryToContactInfo getIIOPPrimaryToContactInfo(); - - public String getORBId() ; - - public boolean getORBServerIdPropertySpecified() ; - - public boolean isLocalOptimizationAllowed() ; - - public GIOPVersion getGIOPVersion() ; - - public int getHighWaterMark() ; - - public int getLowWaterMark() ; - - public int getNumberToReclaim() ; - - public int getGIOPFragmentSize() ; - - public int getGIOPBufferSize() ; - - public int getGIOPBuffMgrStrategy(GIOPVersion gv) ; - - /** - * @return the GIOP Target Addressing preference of the ORB. - * This ORB by default supports all addressing dispositions unless specified - * otherwise via a java system property ORBConstants.GIOP_TARGET_ADDRESSING - */ - public short getGIOPTargetAddressPreference() ; - - public short getGIOPAddressDisposition() ; - - public boolean useByteOrderMarkers() ; - - public boolean useByteOrderMarkersInEncapsulations() ; - - public boolean alwaysSendCodeSetServiceContext() ; - - public boolean getPersistentPortInitialized() ; - - public int getPersistentServerPort(); - - public boolean getPersistentServerIdInitialized() ; - - /** Return the persistent-server-id of this server. This id is the same - * across multiple activations of this server. This is in contrast to - * com.sun.corba.se.impl.iiop.ORB.getTransientServerId() which - * returns a transient id that is guaranteed to be different - * across multiple activations of - * this server. The user/environment is required to supply the - * persistent-server-id every time this server is started, in - * the ORBServerId parameter, System properties, or other means. - * The user is also required to ensure that no two persistent servers - * on the same host have the same server-id. - */ - public int getPersistentServerId(); - - public boolean getServerIsORBActivated() ; - - public Class getBadServerIdHandler(); - - /** - * Get the prefered code sets for connections. Should the client send the - * code set service context on every request? - */ - public CodeSetComponentInfo getCodeSetComponentInfo() ; - - public ORBInitializer[] getORBInitializers(); - - public StringPair[] getORBInitialReferences(); - - public String getORBDefaultInitialReference() ; - - public String[] getORBDebugFlags(); - - public Acceptor[] getAcceptors(); - - public CorbaContactInfoListFactory getCorbaContactInfoListFactory(); - - public String acceptorSocketType(); - public boolean acceptorSocketUseSelectThreadToWait(); - public boolean acceptorSocketUseWorkerThreadForEvent(); - public String connectionSocketType(); - public boolean connectionSocketUseSelectThreadToWait(); - public boolean connectionSocketUseWorkerThreadForEvent(); - - public ReadTimeouts getTransportTCPReadTimeouts(); - public boolean disableDirectByteBufferUse() ; - public boolean isJavaSerializationEnabled(); - public boolean useRepId(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orb/ORBVersion.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orb/ORBVersion.java deleted file mode 100644 index ce74c58ec5c..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orb/ORBVersion.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.orb ; - -import org.omg.CORBA.portable.OutputStream ; - -public interface ORBVersion extends Comparable -{ - byte FOREIGN = 0 ; // ORB from another vendor - byte OLD = 1 ; // JDK 1.3.0 or earlier - byte NEW = 2 ; // JDK 1.3.1 FCS - byte JDK1_3_1_01 = 3; // JDK1_3_1_01 patch - byte NEWER = 10 ; // JDK 1.4.x - byte PEORB = 20 ; // PEORB in JDK 1.5, S1AS 8, J2EE 1.4 - - byte getORBType() ; - - void write( OutputStream os ) ; - - public boolean lessThan( ORBVersion version ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orb/ORBVersionFactory.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orb/ORBVersionFactory.java deleted file mode 100644 index e024b2c006c..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orb/ORBVersionFactory.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.orb ; - -import com.sun.corba.se.spi.orb.ORBVersion ; -import com.sun.corba.se.impl.orb.ORBVersionImpl ; -import org.omg.CORBA.portable.InputStream ; -import org.omg.CORBA.INTERNAL ; - -public class ORBVersionFactory { - private ORBVersionFactory() {} ; - - public static ORBVersion getFOREIGN() - { - return ORBVersionImpl.FOREIGN ; - } - - public static ORBVersion getOLD() - { - return ORBVersionImpl.OLD ; - } - - public static ORBVersion getNEW() - { - return ORBVersionImpl.NEW ; - } - - public static ORBVersion getJDK1_3_1_01() - { - return ORBVersionImpl.JDK1_3_1_01 ; - } - - public static ORBVersion getNEWER() - { - return ORBVersionImpl.NEWER ; - } - - public static ORBVersion getPEORB() - { - return ORBVersionImpl.PEORB ; - } - - /** Return the current version of this ORB - */ - public static ORBVersion getORBVersion() - { - return ORBVersionImpl.PEORB ; - } - - public static ORBVersion create( InputStream is ) - { - byte value = is.read_octet() ; - return byteToVersion( value ) ; - } - - private static ORBVersion byteToVersion( byte value ) - { - /* Throwing an exception here would cause this version to be - * incompatible with future versions of the ORB, to the point - * that this version could - * not even unmarshal objrefs from a newer version that uses - * extended versioning. Therefore, we will simply treat all - * unknown versions as the latest version. - if (value < 0) - throw new INTERNAL() ; - */ - - /** - * Update: If we treat all unknown versions as the latest version - * then when we send an IOR with a PEORB version to an ORB that - * doesn't know the PEORB version it will treat it as whatever - * its idea of the latest version is. Then, if that IOR is - * sent back to the server and compared with the original - * the equality check will fail because the versions will be - * different. - * - * Instead, just capture the version bytes. - */ - - switch (value) { - case ORBVersion.FOREIGN : return ORBVersionImpl.FOREIGN ; - case ORBVersion.OLD : return ORBVersionImpl.OLD ; - case ORBVersion.NEW : return ORBVersionImpl.NEW ; - case ORBVersion.JDK1_3_1_01: return ORBVersionImpl.JDK1_3_1_01 ; - case ORBVersion.NEWER : return ORBVersionImpl.NEWER ; - case ORBVersion.PEORB : return ORBVersionImpl.PEORB ; - default : return new ORBVersionImpl(value); - } - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orb/Operation.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orb/Operation.java deleted file mode 100644 index f9173932927..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orb/Operation.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.spi.orb ; - -/** A generic class representing a function that takes a value and returns - * a value. This is a building block for property parsing. - */ -public interface Operation{ - /** Apply some function to a value and return the result. - */ - Object operate( Object value ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orb/OperationFactory.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orb/OperationFactory.java deleted file mode 100644 index d84523b0fd9..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orb/OperationFactory.java +++ /dev/null @@ -1,567 +0,0 @@ -/* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.corba.se.spi.orb ; - -import java.util.StringTokenizer ; -import java.util.Arrays ; - -import java.lang.reflect.Array ; - -import java.net.URL ; -import java.net.MalformedURLException ; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; - -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; -import com.sun.corba.se.impl.orbutil.ObjectUtility ; - -import sun.corba.SharedSecrets; - -/** This is a static factory class for commonly used operations -* for property parsing. The following operations are supported: -*
              -*
            • maskErrorAction( Operation op ) executes op and returns the result. If op throws an -* exception, the result is null. -*
            • indexAction( int arg ) returns the [arg] element of value, which must be an Object[]
            • -*
            • identityAction() return the value
            • -*
            • booleanAction() return a Boolean representing true or false values of the String value
            • -*
            • integerAction() returns an Integer for the String value, which must be a decimal integer
            • -*
            • stringAction() returns the String value
            • -*
            • classAction() returns a class for the String value, as loaded by the ORB classloader
            • -*
            • setFlagAction() always return Boolean.TRUE
            • -*
            • URLAction() returns a java.net.URL for the String value, which must be a valid URL
            • -*
            • integerRangeAction( int min, int max ) returns an Integer for the String value, which must be a -* decimal integer in the range min to max inclusive
            • -*
            • listAction( String sep, Operation ) tokenizes the String value with sep as separator, then -* applies the Operation to each token, and returns an array of the result
            • -*
            • sequenceAction( String, Operation[] ) tokenizes the String value with sep as separator, then -* applies each Operation in the Operation array to successive tokens, and returns an array of the results
            • -*
            • compose( Operation op1, Operation op2 ) is the operation that applies op2 to the result of applying -* op1 to the value
            • -*
            • mapAction( Operation ) applies the Operation to each element of an array of objects, and returns -* an array of the results
            • -*
            • mapSequenceAction( Operation[] ) applies the corresponding element of the Operation array to an -* element of the Object[] value, and returns an array of the results
            • -*
            • convertIntegerToShort coerces an Integer into a Short.
            • -*
            -* Other operations can be directly defined, and combined using these basic operations. -*/ -public abstract class OperationFactory { - private OperationFactory() {} - - private static String getString( Object obj ) - { - if (obj instanceof String) - return (String)obj ; - else - throw new Error( "String expected" ) ; - } - - private static Object[] getObjectArray( Object obj ) - { - if (obj instanceof Object[]) - return (Object[])obj ; - else - throw new Error( "Object[] expected" ) ; - } - - private static StringPair getStringPair( Object obj ) - { - if (obj instanceof StringPair) - return (StringPair)obj ; - else - throw new Error( "StringPair expected" ) ; - } - - private static abstract class OperationBase implements Operation{ - public boolean equals( Object obj ) - { - if (this==obj) - return true ; - - if (!(obj instanceof OperationBase)) - return false ; - - OperationBase other = (OperationBase)obj ; - - return toString().equals( other.toString() ) ; - } - - public int hashCode() - { - return toString().hashCode() ; - } - } - - private static class MaskErrorAction extends OperationBase - { - private Operation op ; - - public MaskErrorAction( Operation op ) - { - this.op = op ; - } - - public Object operate( Object arg ) - { - try { - return op.operate( arg ) ; - } catch (java.lang.Exception exc) { - return null ; - } - } - - public String toString() - { - return "maskErrorAction(" + op + ")" ; - } - } - - public static Operation maskErrorAction( Operation op ) - { - return new MaskErrorAction( op ) ; - } - - private static class IndexAction extends OperationBase - { - private int index ; - - public IndexAction( int index ) - { - this.index = index ; - } - - public Object operate( Object value ) - { - return getObjectArray( value )[ index ] ; - } - - public String toString() - { - return "indexAction(" + index + ")" ; - } - } - - public static Operation indexAction( int index ) - { - return new IndexAction( index ) ; - } - - private static class SuffixAction extends OperationBase - { - public Object operate( Object value ) - { - return getStringPair( value ).getFirst() ; - } - - public String toString() { return "suffixAction" ; } - } - - private static Operation suffixActionImpl = new SuffixAction() ; - - private static class ValueAction extends OperationBase - { - public Object operate( Object value ) - { - return getStringPair( value ).getSecond() ; - } - - public String toString() { return "valueAction" ; } - } - - private static Operation valueActionImpl = new ValueAction() ; - - private static class IdentityAction extends OperationBase - { - public Object operate( Object value ) - { - return value ; - } - - public String toString() { return "identityAction" ; } - } - - private static Operation identityActionImpl = new IdentityAction() ; - - private static class BooleanAction extends OperationBase - { - public Object operate( Object value ) - { - return new Boolean( getString( value ) ) ; - } - - public String toString() { return "booleanAction" ; } - } - - private static Operation booleanActionImpl = new BooleanAction() ; - - private static class IntegerAction extends OperationBase - { - public Object operate( Object value ) - { - return new Integer( getString( value ) ) ; - } - - public String toString() { return "integerAction" ; } - } - - private static Operation integerActionImpl = new IntegerAction() ; - - private static class StringAction extends OperationBase - { - public Object operate( Object value ) - { - return value ; - } - - public String toString() { return "stringAction" ; } - } - - private static Operation stringActionImpl = new StringAction() ; - - private static class ClassAction extends OperationBase - { - public Object operate( Object value ) - { - String className = getString( value ) ; - - try { - Class result = - SharedSecrets.getJavaCorbaAccess().loadClass( className ) ; - return result ; - } catch (Exception exc) { - ORBUtilSystemException wrapper = ORBUtilSystemException.get( - CORBALogDomains.ORB_LIFECYCLE ) ; - throw wrapper.couldNotLoadClass( exc, className ) ; - } - } - - public String toString() { return "classAction" ; } - } - - private static Operation classActionImpl = new ClassAction() ; - - private static class SetFlagAction extends OperationBase - { - public Object operate( Object value ) - { - return Boolean.TRUE ; - } - - public String toString() { return "setFlagAction" ; } - } - - private static Operation setFlagActionImpl = new SetFlagAction() ; - - private static class URLAction extends OperationBase - { - public Object operate( Object value ) - { - String val = (String)value ; - try { - return new URL( val ) ; - } catch (MalformedURLException exc) { - ORBUtilSystemException wrapper = ORBUtilSystemException.get( - CORBALogDomains.ORB_LIFECYCLE ) ; - throw wrapper.badUrl( exc, val ) ; - } - } - - public String toString() { return "URLAction" ; } - } - - private static Operation URLActionImpl = new URLAction() ; - - public static Operation identityAction() - { - return identityActionImpl ; - } - - public static Operation suffixAction() - { - return suffixActionImpl ; - } - - public static Operation valueAction() - { - return valueActionImpl ; - } - - public static Operation booleanAction() - { - return booleanActionImpl ; - } - - public static Operation integerAction() - { - return integerActionImpl ; - } - - public static Operation stringAction() - { - return stringActionImpl ; - } - - public static Operation classAction() - { - return classActionImpl ; - } - - public static Operation setFlagAction() - { - return setFlagActionImpl ; - } - - public static Operation URLAction() - { - return URLActionImpl ; - } - - private static class IntegerRangeAction extends OperationBase - { - private int min ; - private int max ; - - IntegerRangeAction( int min, int max ) - { - this.min = min ; - this.max = max ; - } - - public Object operate( Object value ) - { - int result = Integer.parseInt( getString( value ) ) ; - if ((result >= min) && (result <= max)) - return new Integer( result ) ; - else - throw new IllegalArgumentException( - "Property value " + result + " is not in the range " + - min + " to " + max ) ; - } - - public String toString() { - return "integerRangeAction(" + min + "," + max + ")" ; - } - } - - public static Operation integerRangeAction( int min, int max ) - { - return new IntegerRangeAction( min, max ) ; - } - - private static class ListAction extends OperationBase { - private String sep ; - private Operation act ; - - ListAction( String sep, Operation act ) - { - this.sep = sep ; - this.act = act ; - } - - // Note that this method carefully constructs an array of the type - // of the first result, rather than just using Object[], which is - // not convertible into the correct type. Also note that no tokens - // results in a null result. - public Object operate( Object value ) - { - StringTokenizer st = new StringTokenizer( getString( value ), - sep ) ; - int length = st.countTokens() ; - Object result = null ; - int ctr = 0 ; - while (st.hasMoreTokens()) { - String next = st.nextToken() ; - Object val = act.operate( next ) ; - if (result == null) - result = Array.newInstance( val.getClass(), length ) ; - Array.set( result, ctr++, val ) ; - } - - return result ; - } - - public String toString() { - return "listAction(separator=\"" + sep + - "\",action=" + act + ")" ; - } - } - - public static Operation listAction( String sep, Operation act ) - { - return new ListAction( sep, act ) ; - } - - private static class SequenceAction extends OperationBase - { - private String sep ; - private Operation[] actions ; - - SequenceAction( String sep, Operation[] actions ) - { - this.sep = sep ; - this.actions = actions ; - } - - public Object operate( Object value ) - { - StringTokenizer st = new StringTokenizer( getString( value ), - sep ) ; - - int numTokens = st.countTokens() ; - if (numTokens != actions.length) - throw new Error( - "Number of tokens and number of actions do not match" ) ; - - int ctr = 0 ; - Object[] result = new Object[ numTokens ] ; - while (st.hasMoreTokens()) { - Operation act = actions[ctr] ; - String next = st.nextToken() ; - result[ctr++] = act.operate( next ) ; - } - - return result ; - } - - public String toString() { - return "sequenceAction(separator=\"" + sep + - "\",actions=" + - Arrays.toString(actions) + ")" ; - } - } - - public static Operation sequenceAction( String sep, - Operation[] actions ) - { - return new SequenceAction( sep, actions ) ; - } - - private static class ComposeAction extends OperationBase - { - private Operation op1 ; - private Operation op2 ; - - ComposeAction( Operation op1, Operation op2 ) - { - this.op1 = op1 ; - this.op2 = op2 ; - } - - public Object operate( Object value ) - { - return op2.operate( op1.operate( value ) ) ; - } - - public String toString() { - return "composition(" + op1 + "," + op2 + ")" ; - } - } - - public static Operation compose( Operation op1, Operation op2 ) - { - return new ComposeAction( op1, op2 ) ; - } - - private static class MapAction extends OperationBase - { - Operation op ; - - MapAction( Operation op ) - { - this.op = op ; - } - - public Object operate( Object value ) - { - Object[] values = (Object[])value ; - Object[] result = new Object[ values.length ] ; - for (int ctr=0; ctrLet S be the current state of the FSM. - * If there are guarded actions for S with input in, evaluate their guards successively until - * all have been evaluted, or one returns a non-DISABLED Result. - *
              - *
            1. If a DEFERED result is returned, retry the input - *
            2. If a ENABLED result is returned, the action for the guarded action - * is the current action - *
            3. Otherwise there is no enabled action. If S has a default action and next state, use them; otherwise - * use the state engine default action (the next state is always the current state). - *
            - * After the action is available, the transition proceeds as follows: - *
              - *
            1. If the next state is not the current state, execute the current state postAction method. - *
            2. Execute the action. - *
            3. If the next state is not the current state, execute the next state preAction method. - *
            4. Set the current state to the next state. - *
            - */ - public void doIt( Input in ) - { - stateEngine.doIt( this, in, debug ) ; - } - - // Methods for use only by StateEngineImpl - - public void internalSetState( State nextState ) - { - if (debug) { - ORBUtility.dprint( this, "Calling internalSetState with nextState = " + - nextState ) ; - } - - state = nextState ; - - if (debug) { - ORBUtility.dprint( this, "Exiting internalSetState with state = " + - state ) ; - } - } -} - -// end of FSMImpl.java diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/FSMTest.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/FSMTest.java deleted file mode 100644 index 1f3f36d133e..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/FSMTest.java +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.orbutil.fsm ; - -import com.sun.corba.se.spi.orbutil.fsm.Input ; -import com.sun.corba.se.spi.orbutil.fsm.Action ; -import com.sun.corba.se.spi.orbutil.fsm.Guard ; -import com.sun.corba.se.spi.orbutil.fsm.StateEngine ; -import com.sun.corba.se.spi.orbutil.fsm.StateImpl ; -import com.sun.corba.se.spi.orbutil.fsm.StateEngineFactory ; -import com.sun.corba.se.spi.orbutil.fsm.FSM ; - -class TestInput { - TestInput( Input value, String msg ) - { - this.value = value ; - this.msg = msg ; - } - - public String toString() - { - return "Input " + value + " : " + msg ; - } - - public Input getInput() - { - return value ; - } - - Input value ; - String msg ; -} - -class TestAction1 implements Action -{ - public void doIt( FSM fsm, Input in ) - { - System.out.println( "TestAction1:" ) ; - System.out.println( "\tlabel = " + label ) ; - System.out.println( "\toldState = " + oldState ) ; - System.out.println( "\tnewState = " + newState ) ; - if (label != in) - throw new Error( "Unexcepted Input " + in ) ; - if (oldState != fsm.getState()) - throw new Error( "Unexpected old State " + fsm.getState() ) ; - } - - public TestAction1( State oldState, Input label, State newState ) - { - this.oldState = oldState ; - this.newState = newState ; - this.label = label ; - } - - private State oldState ; - private Input label ; - private State newState ; -} - -class TestAction2 implements Action -{ - private State oldState ; - private State newState ; - - public void doIt( FSM fsm, Input in ) - { - System.out.println( "TestAction2:" ) ; - System.out.println( "\toldState = " + oldState ) ; - System.out.println( "\tnewState = " + newState ) ; - System.out.println( "\tinput = " + in ) ; - if (oldState != fsm.getState()) - throw new Error( "Unexpected old State " + fsm.getState() ) ; - } - - public TestAction2( State oldState, State newState ) - { - this.oldState = oldState ; - this.newState = newState ; - } -} - -class TestAction3 implements Action { - private State oldState ; - private Input label ; - - public void doIt( FSM fsm, Input in ) - { - System.out.println( "TestAction1:" ) ; - System.out.println( "\tlabel = " + label ) ; - System.out.println( "\toldState = " + oldState ) ; - if (label != in) - throw new Error( "Unexcepted Input " + in ) ; - } - - public TestAction3( State oldState, Input label ) - { - this.oldState = oldState ; - this.label = label ; - } -} - -class NegateGuard implements Guard { - Guard guard ; - - public NegateGuard( Guard guard ) - { - this.guard = guard ; - } - - public Guard.Result evaluate( FSM fsm, Input in ) - { - return guard.evaluate( fsm, in ).complement() ; - } -} - -class MyFSM extends FSMImpl { - public MyFSM( StateEngine se ) - { - super( se, FSMTest.STATE1 ) ; - } - - public int counter = 0 ; -} - -public class FSMTest { - public static final State STATE1 = new StateImpl( "1" ) ; - public static final State STATE2 = new StateImpl( "2" ) ; - public static final State STATE3 = new StateImpl( "3" ) ; - public static final State STATE4 = new StateImpl( "4" ) ; - - public static final Input INPUT1 = new InputImpl( "1" ) ; - public static final Input INPUT2 = new InputImpl( "2" ) ; - public static final Input INPUT3 = new InputImpl( "3" ) ; - public static final Input INPUT4 = new InputImpl( "4" ) ; - - private Guard counterGuard = new Guard() { - public Guard.Result evaluate( FSM fsm, Input in ) - { - MyFSM mfsm = (MyFSM) fsm ; - return Guard.Result.convert( mfsm.counter < 3 ) ; - } - } ; - - private static void add1( StateEngine se, State oldState, Input in, State newState ) - { - se.add( oldState, in, new TestAction1( oldState, in, newState ), newState ) ; - } - - private static void add2( StateEngine se, State oldState, State newState ) - { - se.setDefault( oldState, new TestAction2( oldState, newState ), newState ) ; - } - - public static void main( String[] args ) - { - TestAction3 ta3 = new TestAction3( STATE3, INPUT1 ) ; - - StateEngine se = StateEngineFactory.create() ; - add1( se, STATE1, INPUT1, STATE1 ) ; - add2( se, STATE1, STATE2 ) ; - - add1( se, STATE2, INPUT1, STATE2 ) ; - add1( se, STATE2, INPUT2, STATE2 ) ; - add1( se, STATE2, INPUT3, STATE1 ) ; - add1( se, STATE2, INPUT4, STATE3 ) ; - - se.add( STATE3, INPUT1, ta3, STATE3 ) ; - se.add( STATE3, INPUT1, ta3, STATE4 ) ; - add1( se, STATE3, INPUT2, STATE1 ) ; - add1( se, STATE3, INPUT3, STATE2 ) ; - add1( se, STATE3, INPUT4, STATE2 ) ; - - MyFSM fsm = new MyFSM( se ) ; - TestInput in11 = new TestInput( INPUT1, "1.1" ) ; - TestInput in12 = new TestInput( INPUT1, "1.2" ) ; - TestInput in21 = new TestInput( INPUT2, "2.1" ) ; - TestInput in22 = new TestInput( INPUT2, "2.2" ) ; - TestInput in31 = new TestInput( INPUT3, "3.1" ) ; - TestInput in32 = new TestInput( INPUT3, "3.2" ) ; - TestInput in33 = new TestInput( INPUT3, "3.3" ) ; - TestInput in41 = new TestInput( INPUT4, "4.1" ) ; - - fsm.doIt( in11.getInput() ) ; - fsm.doIt( in12.getInput() ) ; - fsm.doIt( in41.getInput() ) ; - fsm.doIt( in11.getInput() ) ; - fsm.doIt( in22.getInput() ) ; - fsm.doIt( in31.getInput() ) ; - fsm.doIt( in33.getInput() ) ; - fsm.doIt( in41.getInput() ) ; - fsm.doIt( in41.getInput() ) ; - fsm.doIt( in41.getInput() ) ; - fsm.doIt( in22.getInput() ) ; - fsm.doIt( in32.getInput() ) ; - fsm.doIt( in41.getInput() ) ; - fsm.doIt( in11.getInput() ) ; - fsm.doIt( in12.getInput() ) ; - fsm.doIt( in11.getInput() ) ; - fsm.doIt( in11.getInput() ) ; - fsm.doIt( in11.getInput() ) ; - fsm.doIt( in11.getInput() ) ; - fsm.doIt( in11.getInput() ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/Guard.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/Guard.java deleted file mode 100644 index 2fd467c6e9d..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/Guard.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.orbutil.fsm; - -/** - * - * @author Ken Cavanaugh - */ -public interface Guard -{ - public static final class Complement extends GuardBase { - private Guard guard ; - - public Complement( GuardBase guard ) - { - super( "not(" + guard.getName() + ")" ) ; - this.guard = guard ; - } - - public Result evaluate( FSM fsm, Input in ) - { - return guard.evaluate( fsm, in ).complement() ; - } - } - - public static final class Result { - private String name ; - - private Result( String name ) - { - this.name = name ; - } - - public static Result convert( boolean res ) - { - return res ? ENABLED : DISABLED ; - } - - public Result complement() - { - if (this == ENABLED) - return DISABLED ; - else if (this == DISABLED) - return ENABLED ; - else - return DEFERED ; - } - - public String toString() - { - return "Guard.Result[" + name + "]" ; - } - - public static final Result ENABLED = new Result( "ENABLED" ) ; - public static final Result DISABLED = new Result( "DISABLED" ) ; - public static final Result DEFERED = new Result( "DEFERED" ) ; - } - - /** Called by the state engine to determine whether a - * transition is enabled, defered, or disabled. - * The result is interpreted as follows: - *
              - *
            • ENABLED if the transition is ready to proceed - *
            • DISABLED if the transition is not ready to proceed - *
            • DEFERED if the action associated with the transition - * is to be deferred. This means that the input will not be - * acted upon, but rather it will be saved for later execution. - * Typically this is implemented using a CondVar wait, and the - * blocked thread represents the defered input. The defered - * input is retried when the thread runs again. - *
            - * - * @param fsm is the state machine causing this action. - * @param in is the input that caused the transition. - */ - public Result evaluate( FSM fsm, Input in ) ; -} - -// end of Action.java diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/GuardBase.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/GuardBase.java deleted file mode 100644 index b84abb9e0aa..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/GuardBase.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.orbutil.fsm ; - -import com.sun.corba.se.impl.orbutil.fsm.NameBase ; - -public abstract class GuardBase extends NameBase implements Guard { - public GuardBase( String name ) { super( name ) ; } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/Input.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/Input.java deleted file mode 100644 index 9f39958cf63..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/Input.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.orbutil.fsm; - -/** - * This interface must be implemented by any class that is used as - * an input to a FSM. The FSM only needs the identity of this - * object, so all that is really needs is the default equals implementation. - * The toString() method should also be overridden to give a concise - * description or name of the input. - * - * @author Ken Cavanaugh - */ -public interface Input -{ -} - -// end of Input.java diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/InputImpl.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/InputImpl.java deleted file mode 100644 index 28bbe865754..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/InputImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.orbutil.fsm ; - -import com.sun.corba.se.impl.orbutil.fsm.NameBase ; - -public class InputImpl extends NameBase implements Input { - public InputImpl( String name ) { super( name ) ; } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/State.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/State.java deleted file mode 100644 index 53ea514529f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/State.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.orbutil.fsm ; - -/** - * This interface must be implemented by any class that is used as - * a state in a FSM. The FSM only needs the identity of this - * object, so all that is really needs is the default equals implementation. - * The toString() method should also be overridden to give a concise - * description or name of the state. The StateImpl class handles this. - *

            - * Pre- and post- actions are taken only on completed transitions between - * different states. Assume that the FSM is in state A, and the FSM will - * transition to state B under input I with action X. If A != B and X completes - * successfully, then after X completes execution, A.postAction is executed, - * followed by B.preAction. - * - * @author Ken Cavanaugh - */ -public interface State -{ - /** Method that defines action that occurs whenever this state is entered. - * Any exceptions thrown by this method are ignored. - */ - void preAction( FSM fsm ) ; - - /** Method that defines action that occurs whenever this state is exited. - * Any exceptions thrown by this method are ignored. - */ - void postAction( FSM fsm ) ; -} - -// end of State.java diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/StateEngine.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/StateEngine.java deleted file mode 100644 index e9d862492c7..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/StateEngine.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.orbutil.fsm; - -/** - * A StateEngine defines the state transition function for a - * finite state machine (FSM). A FSM always has a current state. - * In response to an Input, the FSM performs an Action and - * makes a transition to a new state. Note that any object can - * be used as an input if it supports the Input interface. - * For example, a protocol message may be an input. The FSM - * uses only the result of calling getLabel on the Input to - * drive the transition. - *

            - * The function can be non-deterministic - * in that the same input may cause transitions to different new - * states from the current state. In this case, the action that - * is executed for the transition must set the correct new state. - * - * @author Ken Cavanaugh - */ -public interface StateEngine -{ - /** Add a new transition (old,in,guard,act,new) to the state engine. - * Multiple calls to add with the same old and in are permitted, - * in which case only a transition in which the guard evaluates to - * true will be taken. If no such transition is enabled, a default - * will be taken. If more than one transition is enabled, one will - * be chosen arbitrarily. - * This method can only be called before done(). An attempt to - * call it after done() results in an IllegalStateException. - */ - public StateEngine add( State oldState, Input input, Guard guard, - Action action, State newState ) throws IllegalStateException ; - - /** Add a transition with a guard that always evaluates to true. - */ - public StateEngine add( State oldState, Input input, - Action action, State newState ) throws IllegalStateException ; - - /** Set the default transition and action for a state. - * This transition will be used if no more specific transition was - * defined for the actual input. Repeated calls to this method - * simply change the default. - * This method can only be called before done(). An attempt to - * call it after done() results in an IllegalStateException. - */ - public StateEngine setDefault( State oldState, Action action, State newState ) - throws IllegalStateException ; - - /** Equivalent to setDefault( oldState, act, newState ) where act is an - * action that does nothing. - */ - public StateEngine setDefault( State oldState, State newState ) - throws IllegalStateException ; - - /** Euaivalent to setDefault( oldState, oldState ) - */ - public StateEngine setDefault( State oldState ) - throws IllegalStateException ; - - /** Set the default action used in this state engine. This is the - * action that is called whenever there is no applicable transition. - * Normally this would simply flag an error. This method can only - * be called before done(). An attempt to - * call it after done() results in an IllegalStateException. - */ - public void setDefaultAction( Action act ) throws IllegalStateException ; - - /** Called after all transitions have been added to the state engine. - * This provides an opportunity for the implementation to optimize - * its representation before the state engine is used. This method - * may only be called once. An attempt to call it more than once - * results in an IllegalStateException. - */ - public void done() throws IllegalStateException ; - - /** Create an instance of a FSM that uses this state engine. - * The initial state of the FSM will be the stateState specified - * here. This method can only be called after done(). An attempt - * to call it before done results in an IllegalStateException. - */ - public FSM makeFSM( State startState ) throws IllegalStateException ; -} - -// end of StateEngine.java diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/StateEngineFactory.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/StateEngineFactory.java deleted file mode 100644 index d2e8f2bd61c..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/StateEngineFactory.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.orbutil.fsm; - -import com.sun.corba.se.impl.orbutil.fsm.StateEngineImpl ; - -/** - * Factory for creating the standard state machine implementation. - * - * @author Ken Cavanaugh - */ -public class StateEngineFactory { - private StateEngineFactory() {} - - public static StateEngine create() - { - return new StateEngineImpl() ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/StateImpl.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/StateImpl.java deleted file mode 100644 index 49df29af2c3..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/StateImpl.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.orbutil.fsm ; - -import com.sun.corba.se.impl.orbutil.fsm.NameBase ; - -import java.util.Map ; -import java.util.HashMap ; -import java.util.Set ; -import java.util.HashSet ; - -import com.sun.corba.se.impl.orbutil.fsm.GuardedAction ; -import com.sun.corba.se.impl.orbutil.fsm.NameBase ; - -/** Base class for all states in a StateEngine. This must be used -* as the base class for all states in transitions added to a StateEngine. -*/ -public class StateImpl extends NameBase implements State { - private Action defaultAction ; - private State defaultNextState ; - private Map inputToGuardedActions ; - - public StateImpl( String name ) - { - super( name ) ; - defaultAction = null ; - inputToGuardedActions = new HashMap() ; - } - - public void preAction( FSM fsm ) - { - } - - public void postAction( FSM fsm ) - { - } - - // Methods for use only by StateEngineImpl. - - public State getDefaultNextState() - { - return defaultNextState ; - } - - public void setDefaultNextState( State defaultNextState ) - { - this.defaultNextState = defaultNextState ; - } - - public Action getDefaultAction() - { - return defaultAction ; - } - - public void setDefaultAction( Action defaultAction ) - { - this.defaultAction = defaultAction ; - } - - public void addGuardedAction( Input in, GuardedAction ga ) - { - Set gas = (Set)inputToGuardedActions.get( in ) ; - if (gas == null) { - gas = new HashSet() ; - inputToGuardedActions.put( in, gas ) ; - } - - gas.add( ga ) ; - } - - public Set getGuardedActions( Input in ) - { - return (Set)inputToGuardedActions.get( in ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/proxy/CompositeInvocationHandler.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/proxy/CompositeInvocationHandler.java deleted file mode 100644 index 54b7aade49d..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/proxy/CompositeInvocationHandler.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.orbutil.proxy ; - -import java.io.Serializable ; -import java.lang.reflect.InvocationHandler ; - -public interface CompositeInvocationHandler extends InvocationHandler, - Serializable -{ - /** Add an invocation handler for all methods on interface interf. - */ - void addInvocationHandler( Class interf, InvocationHandler handler ) ; - - /** Set the default invocation handler to use if none of the - * invocation handlers added by calls to addInvocationHandler apply. - */ - void setDefaultHandler( InvocationHandler handler ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/proxy/CompositeInvocationHandlerImpl.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/proxy/CompositeInvocationHandlerImpl.java deleted file mode 100644 index 577f07e3774..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/proxy/CompositeInvocationHandlerImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.orbutil.proxy ; - -import java.io.Serializable ; - -import java.util.Map ; -import java.util.LinkedHashMap ; - -import java.lang.reflect.Proxy ; -import java.lang.reflect.Method ; -import java.lang.reflect.InvocationHandler ; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; -import com.sun.corba.se.impl.presentation.rmi.DynamicAccessPermission; - -public class CompositeInvocationHandlerImpl implements - CompositeInvocationHandler -{ - private Map classToInvocationHandler = new LinkedHashMap() ; - private InvocationHandler defaultHandler = null ; - - public void addInvocationHandler( Class interf, - InvocationHandler handler ) - { - checkAccess(); - classToInvocationHandler.put( interf, handler ) ; - } - - public void setDefaultHandler( InvocationHandler handler ) - { - checkAccess(); - defaultHandler = handler ; - } - - public Object invoke( Object proxy, Method method, Object[] args ) - throws Throwable - { - // Note that the declaring class in method is the interface - // in which the method was defined, not the proxy class. - Class cls = method.getDeclaringClass() ; - InvocationHandler handler = - (InvocationHandler)classToInvocationHandler.get( cls ) ; - - if (handler == null) { - if (defaultHandler != null) - handler = defaultHandler ; - else { - ORBUtilSystemException wrapper = ORBUtilSystemException.get( - CORBALogDomains.UTIL ) ; - throw wrapper.noInvocationHandler( "\"" + method.toString() + - "\"" ) ; - } - } - - // handler should never be null here. - - return handler.invoke( proxy, method, args ) ; - } - - private static final DynamicAccessPermission perm = new DynamicAccessPermission("access"); - private void checkAccess() { - final SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - sm.checkPermission(perm); -} - } - - private static final long serialVersionUID = 4571178305984833743L; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/proxy/DelegateInvocationHandlerImpl.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/proxy/DelegateInvocationHandlerImpl.java deleted file mode 100644 index 981cf660d4e..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/proxy/DelegateInvocationHandlerImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.orbutil.proxy ; - -import java.io.Serializable ; - -import java.util.Map ; -import java.util.LinkedHashMap ; - -import java.lang.reflect.Proxy ; -import java.lang.reflect.Method ; -import java.lang.reflect.InvocationHandler ; -import java.lang.reflect.InvocationTargetException ; -import com.sun.corba.se.impl.presentation.rmi.DynamicAccessPermission ; - -public abstract class DelegateInvocationHandlerImpl -{ - private DelegateInvocationHandlerImpl() {} - - public static InvocationHandler create( final Object delegate ) - { - SecurityManager s = System.getSecurityManager(); - if (s != null) { - s.checkPermission(new DynamicAccessPermission("access")); - } - return new InvocationHandler() { - public Object invoke( Object proxy, Method method, Object[] args ) - throws Throwable - { - // This throws an IllegalArgument exception if the delegate - // is not assignable from method.getDeclaring class. - try { - return method.invoke( delegate, args ) ; - } catch (InvocationTargetException ite) { - // Propagate the underlying exception as the - // result of the invocation - throw ite.getCause() ; - } - } - } ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/proxy/InvocationHandlerFactory.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/proxy/InvocationHandlerFactory.java deleted file mode 100644 index 2016fd87d7a..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/proxy/InvocationHandlerFactory.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.orbutil.proxy ; - -import java.lang.reflect.InvocationHandler ; - -public interface InvocationHandlerFactory -{ - /** Get an InvocationHandler. - */ - InvocationHandler getInvocationHandler() ; - - /** Get the interfaces that InvocationHandler instances - * produced by this InvocationHandlerFactory support. - */ - Class[] getProxyInterfaces() ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/proxy/LinkedInvocationHandler.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/proxy/LinkedInvocationHandler.java deleted file mode 100644 index a0e611ab8eb..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/proxy/LinkedInvocationHandler.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.orbutil.proxy ; - -import java.lang.reflect.InvocationHandler ; -import java.lang.reflect.Proxy ; - -/** This interface is used for InvocationHandler types that are - * linked to their Proxy. This is useful when the InvocationHandler - * needs access to data keyed by identity on the Proxy. - */ -public interface LinkedInvocationHandler extends InvocationHandler -{ - void setProxy( Proxy proxy ) ; - - Proxy getProxy() ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/threadpool/NoSuchThreadPoolException.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/threadpool/NoSuchThreadPoolException.java deleted file mode 100644 index dd8609bf137..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/threadpool/NoSuchThreadPoolException.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.orbutil.threadpool; - -public class NoSuchThreadPoolException extends Exception -{ -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/threadpool/NoSuchWorkQueueException.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/threadpool/NoSuchWorkQueueException.java deleted file mode 100644 index 90f40e7303d..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/threadpool/NoSuchWorkQueueException.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.orbutil.threadpool; - -public class NoSuchWorkQueueException extends Exception -{ -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/threadpool/ThreadPool.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/threadpool/ThreadPool.java deleted file mode 100644 index dd61ff22032..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/threadpool/ThreadPool.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.orbutil.threadpool; - -import java.io.Closeable; - -/** This interface defines a thread pool execution service. The ORB uses this - * interface, which preceeds the JDK 5 ExecutorService. Note that the close - * method must be called in order to reclaim thread resources. - */ -public interface ThreadPool extends Closeable -{ - - /** - * This method will return any instance of the WorkQueue. If the ThreadPool - * instance only services one WorkQueue then that WorkQueue instance will - * be returned. If there are more than one WorkQueues serviced by this - * ThreadPool, then this method would return a WorkQueue based on the - * implementation of the class that implements this interface. For PE 8.0 we - * would return a WorkQueue in a roundrobin fashion everytime this method - * is called. In the future we could allow pluggability of Policy objects for this. - */ - public WorkQueue getAnyWorkQueue(); - - /** - * This method will return an instance of the of the WorkQueue given a queueId. - * This will be useful in situations where there are more than one WorkQueues - * managed by the ThreadPool and the user of the ThreadPool wants to always use - * the same WorkQueue for doing the Work. - * If the number of WorkQueues in the ThreadPool are 10, then queueIds will go - * from 0-9 - * - * @throws NoSuchWorkQueueException thrown when queueId passed is invalid - */ - public WorkQueue getWorkQueue(int queueId) throws NoSuchWorkQueueException; - - /** - * This method will return the number of WorkQueues serviced by the threadpool. - */ - public int numberOfWorkQueues(); - - /** - * This method will return the minimum number of threads maintained by the threadpool. - */ - public int minimumNumberOfThreads(); - - /** - * This method will return the maximum number of threads in the threadpool at any - * point in time, for the life of the threadpool - */ - public int maximumNumberOfThreads(); - - /** - * This method will return the time in milliseconds when idle threads in the threadpool are - * removed. - */ - public long idleTimeoutForThreads(); - - /** - * This method will return the current number of threads in the threadpool. This method - * returns a value which is not synchronized. - */ - public int currentNumberOfThreads(); - - /** - * This method will return the number of available threads in the threadpool which are - * waiting for work. This method returns a value which is not synchronized. - */ - public int numberOfAvailableThreads(); - - /** - * This method will return the number of busy threads in the threadpool - * This method returns a value which is not synchronized. - */ - public int numberOfBusyThreads(); - - /** - * This method returns the number of Work items processed by the threadpool - */ - public long currentProcessedCount(); - - /** - * This method returns the average elapsed time taken to complete a Work - * item. - */ - public long averageWorkCompletionTime(); - - /** - * This method will return the name of the threadpool. - */ - public String getName(); - -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/threadpool/ThreadPoolChooser.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/threadpool/ThreadPoolChooser.java deleted file mode 100644 index ffd58e6f1da..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/threadpool/ThreadPoolChooser.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.orbutil.threadpool; - - -public interface ThreadPoolChooser -{ - /** - * This method is used to return an instance of ThreadPool based on the - * strategy/policy implemented in the ThreadPoolChooser from the set of - * ThreadPools allowed to be used by the ORB. Typically, the set of - * ThreadPools would be specified by passing the threadpool-ids - * configured in the ORB element of the domain.xml of the appserver. - */ - public ThreadPool getThreadPool(); - - /** - * This method is used to return an instance of ThreadPool that is obtained - * by using the id argument passed to it. This method will be used in - * situations where the threadpool id is known to the caller e.g. by the - * connection object or looking at the high order bits of the request id - */ - public ThreadPool getThreadPool(int id); - - /** - * This method is a convenience method to see what threadpool-ids are being - * used by the ThreadPoolChooser - */ - public String[] getThreadPoolIds(); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/threadpool/ThreadPoolManager.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/threadpool/ThreadPoolManager.java deleted file mode 100644 index 14875f6d20a..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/threadpool/ThreadPoolManager.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.orbutil.threadpool; - -import java.io.Closeable; - -public interface ThreadPoolManager extends Closeable -{ - /** - * This method will return an instance of the threadpool given a threadpoolId, - * that can be used by any component in the app. server. - * - * @throws NoSuchThreadPoolException thrown when invalid threadpoolId is passed - * as a parameter - */ - public ThreadPool getThreadPool(String threadpoolId) throws NoSuchThreadPoolException; - - /** - * This method will return an instance of the threadpool given a numeric threadpoolId. - * This method will be used by the ORB to support the functionality of - * dedicated threadpool for EJB beans - * - * @throws NoSuchThreadPoolException thrown when invalidnumericIdForThreadpool is passed - * as a parameter - */ - public ThreadPool getThreadPool(int numericIdForThreadpool) throws NoSuchThreadPoolException; - - /** - * This method is used to return the numeric id of the threadpool, given a String - * threadpoolId. This is used by the POA interceptors to add the numeric threadpool - * Id, as a tagged component in the IOR. This is used to provide the functionality of - * dedicated threadpool for EJB beans - */ - public int getThreadPoolNumericId(String threadpoolId); - - /** - * Return a String Id for a numericId of a threadpool managed by the threadpool - * manager - */ - public String getThreadPoolStringId(int numericIdForThreadpool); - - /** - * Returns the first instance of ThreadPool in the ThreadPoolManager - */ - public ThreadPool getDefaultThreadPool(); - - /** - * Return an instance of ThreadPoolChooser based on the componentId that was - * passed as argument - */ - public ThreadPoolChooser getThreadPoolChooser(String componentId); - - /** - * Return an instance of ThreadPoolChooser based on the componentIndex that was - * passed as argument. This is added for improved performance so that the caller - * does not have to pay the cost of computing hashcode for the componentId - */ - public ThreadPoolChooser getThreadPoolChooser(int componentIndex); - - /** - * Sets a ThreadPoolChooser for a particular componentId in the ThreadPoolManager. This - * would enable any component to add a ThreadPoolChooser for their specific use - */ - public void setThreadPoolChooser(String componentId, ThreadPoolChooser aThreadPoolChooser); - - /** - * Gets the numeric index associated with the componentId specified for a - * ThreadPoolChooser. This method would help the component call the more - * efficient implementation i.e. getThreadPoolChooser(int componentIndex) - */ - public int getThreadPoolChooserNumericId(String componentId); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/threadpool/Work.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/threadpool/Work.java deleted file mode 100644 index 75f76e35925..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/threadpool/Work.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.orbutil.threadpool; - -public interface Work -{ - - /** - * This method denotes the actual work that is done by the work item. - */ - public void doWork(); - - /** - * This methods sets the time in millis in the work item, when this - * work item was enqueued in the work queue. - */ - public void setEnqueueTime(long timeInMillis); - - /** - * This methods gets the time in millis in the work item, when this - * work item was enqueued in the work queue. - */ - public long getEnqueueTime(); - - /** - * This method will return the name of the work item. - */ - public String getName(); - -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/threadpool/WorkQueue.java b/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/threadpool/WorkQueue.java deleted file mode 100644 index d6057cc47fe..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/threadpool/WorkQueue.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.orbutil.threadpool; - -public interface WorkQueue -{ - - /** - * This method is used to add work to the WorkQueue - */ - public void addWork(Work aWorkItem); - - /** - * This method will return the name of the WorkQueue. - */ - public String getName(); - - /** - * Returns the total number of Work items added to the Queue. - */ - public long totalWorkItemsAdded(); - - /** - * Returns the total number of Work items in the Queue to be processed. - */ - public int workItemsInQueue(); - - /** - * Returns the average time a work item is waiting in the queue before - * getting processed. - */ - public long averageTimeInQueue(); - - /** - * Set the ThreadPool instance servicing this WorkQueue - */ - public void setThreadPool(ThreadPool aThreadPool); - - /** - * Get the ThreadPool instance servicing this WorkQueue - */ - public ThreadPool getThreadPool(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/presentation/rmi/DynamicMethodMarshaller.java b/src/java.corba/share/classes/com/sun/corba/se/spi/presentation/rmi/DynamicMethodMarshaller.java deleted file mode 100644 index 9055ab73a3f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/presentation/rmi/DynamicMethodMarshaller.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.presentation.rmi ; - -import org.omg.CORBA_2_3.portable.InputStream ; -import org.omg.CORBA_2_3.portable.OutputStream ; -import org.omg.CORBA.portable.ApplicationException ; - -import java.lang.reflect.Method ; - -import java.rmi.RemoteException ; - -import com.sun.corba.se.spi.orb.ORB ; - -/** Used to read and write arguments and results for a particular method. -* -*/ -public interface DynamicMethodMarshaller -{ - /** Returns the method used to create this DynamicMethodMarshaller. - */ - Method getMethod() ; - - /** Copy the arguments as needed for this particular method. - * Can be optimized so that as little copying as possible is - * performed. - */ - Object[] copyArguments( Object[] args, ORB orb ) throws RemoteException ; - - /** Read the arguments for this method from the InputStream. - * Returns null if there are no arguments. - */ - Object[] readArguments( InputStream is ) ; - - /** Write arguments for this method to the OutputStream. - * Does nothing if there are no arguments. - */ - void writeArguments( OutputStream os, Object[] args ) ; - - /** Copy the result as needed for this particular method. - * Can be optimized so that as little copying as possible is - * performed. - */ - Object copyResult( Object result, ORB orb ) throws RemoteException ; - - /** Read the result from the InputStream. Returns null - * if the result type is null. - */ - Object readResult( InputStream is ) ; - - /** Write the result to the OutputStream. Does nothing if - * the result type is null. - */ - void writeResult( OutputStream os, Object result ) ; - - /** Returns true iff thr's class is a declared exception (or a subclass of - * a declared exception) for this DynamicMethodMarshaller's method. - */ - boolean isDeclaredException( Throwable thr ) ; - - /** Write the repository ID of the exception and the value of the - * exception to the OutputStream. ex should be a declared exception - * for this DynamicMethodMarshaller's method. - */ - void writeException( OutputStream os, Exception ex ) ; - - /** Reads an exception ID and the corresponding exception from - * the input stream. This should be an exception declared in - * this method. - */ - Exception readException( ApplicationException ae ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/presentation/rmi/DynamicStub.java b/src/java.corba/share/classes/com/sun/corba/se/spi/presentation/rmi/DynamicStub.java deleted file mode 100644 index 54c1bb84f53..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/presentation/rmi/DynamicStub.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.presentation.rmi ; - -import java.rmi.RemoteException ; - -import org.omg.CORBA.portable.Delegate ; -import org.omg.CORBA.portable.OutputStream ; - -import org.omg.CORBA.ORB ; - -/** Interface used to support dynamically generated stubs. - * This supplies some methods that are found in - * org.omg.CORBA.portable.ObjectImpl that are not available - * in org.omg.CORBA.Object. - */ -public interface DynamicStub extends org.omg.CORBA.Object -{ - /** Similar to ObjectImpl._set_delegate - */ - void setDelegate( Delegate delegate ) ; - - /** Similar to ObjectImpl._get_delegate - */ - Delegate getDelegate() ; - - /** Similar to ObjectImpl._orb() - */ - ORB getORB() ; - - /** Similar to ObjectImpl._ids - */ - String[] getTypeIds() ; - - /** Connect this dynamic stub to an ORB. - * Just as in standard RMI-IIOP, this is required after - * a dynamic stub is deserialized from an ObjectInputStream. - * It is not needed when unmarshalling from a - * org.omg.CORBA.portable.InputStream. - */ - void connect( ORB orb ) throws RemoteException ; - - boolean isLocal() ; - - OutputStream request( String operation, boolean responseExpected ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/presentation/rmi/IDLNameTranslator.java b/src/java.corba/share/classes/com/sun/corba/se/spi/presentation/rmi/IDLNameTranslator.java deleted file mode 100644 index 6ac876def20..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/presentation/rmi/IDLNameTranslator.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.presentation.rmi ; - -import java.lang.reflect.Method ; - -/** Translates between methods on an interface and RMI-IIOP encodings - * of those methods as names. - */ -public interface IDLNameTranslator -{ - /** Get the interfaces that this IDLNameTranslator describes. - */ - Class[] getInterfaces() ; - - /** Get all methods for this remote interface. - * The methods are returned in a canonical order, that is, - * they are always in the same order for a particular interface. - */ - Method[] getMethods() ; - - /** Get the method from this IDLNameTranslator's interfaces that - * corresponds to the mangled name idlName. Returns null - * if there is no matching method. - */ - Method getMethod( String idlName ) ; - - /** Get the mangled name that corresponds to the given method - * on this IDLNameTranslator's interface. Returns null - * if there is no matching name. - */ - String getIDLName( Method method ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/presentation/rmi/PresentationDefaults.java b/src/java.corba/share/classes/com/sun/corba/se/spi/presentation/rmi/PresentationDefaults.java deleted file mode 100644 index 81ff426a0cb..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/presentation/rmi/PresentationDefaults.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.presentation.rmi; - -import com.sun.corba.se.spi.orb.ORB; - -import com.sun.corba.se.spi.presentation.rmi.PresentationManager; - -import com.sun.corba.se.impl.presentation.rmi.StubFactoryFactoryProxyImpl; -import com.sun.corba.se.impl.presentation.rmi.StubFactoryFactoryStaticImpl; -import com.sun.corba.se.impl.presentation.rmi.StubFactoryStaticImpl; - -public abstract class PresentationDefaults -{ - private static StubFactoryFactoryStaticImpl staticImpl = null ; - - private PresentationDefaults() {} - - public synchronized static PresentationManager.StubFactoryFactory - getStaticStubFactoryFactory() - { - if (staticImpl == null) - staticImpl = new StubFactoryFactoryStaticImpl( ); - - return staticImpl ; - } - - public static PresentationManager.StubFactoryFactory - getProxyStubFactoryFactory() - { - return new StubFactoryFactoryProxyImpl(); - } - - public static PresentationManager.StubFactory makeStaticStubFactory( - Class stubClass ) - { - return new StubFactoryStaticImpl( stubClass ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/presentation/rmi/PresentationManager.java b/src/java.corba/share/classes/com/sun/corba/se/spi/presentation/rmi/PresentationManager.java deleted file mode 100644 index adc670b175f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/presentation/rmi/PresentationManager.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.presentation.rmi ; - -import java.util.Map ; - -import java.lang.reflect.Method ; -import java.lang.reflect.InvocationHandler ; - -import javax.rmi.CORBA.Tie ; - -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.orbutil.proxy.InvocationHandlerFactory ; - - -/** Provides access to RMI-IIOP stubs and ties. - * Any style of stub and tie generation may be used. - * This includes compiler generated stubs and runtime generated stubs - * as well as compiled and reflective ties. There is normally - * only one instance of this interface per VM. The instance - * is obtained from the static method - * com.sun.corba.se.spi.orb.ORB.getPresentationManager. - *

            - * Note that - * the getClassData and getDynamicMethodMarshaller methods - * maintain caches to avoid redundant computation. - */ -public interface PresentationManager -{ - /** Creates StubFactory and Tie instances. - */ - public interface StubFactoryFactory - { - /** Return the standard name of a stub (according to the RMI-IIOP specification - * and rmic). This is needed so that the name of a stub is known for - * standalone clients of the app server. - */ - String getStubName( String className ) ; - - /** Create a stub factory for stubs for the interface whose type is given by - * className. className may identify either an IDL interface or an RMI-IIOP - * interface. - * @param className The name of the remote interface as a Java class name. - * @param isIDLStub True if className identifies an IDL stub, else false. - * @param remoteCodeBase The CodeBase to use for loading Stub classes, if - * necessary (may be null or unused). - * @param expectedClass The expected stub type (may be null or unused). - * @param classLoader The classLoader to use (may be null). - */ - PresentationManager.StubFactory createStubFactory( String className, - boolean isIDLStub, String remoteCodeBase, Class expectedClass, - ClassLoader classLoader); - - /** Return a Tie for the given class. - */ - Tie getTie( Class cls ) ; - - /** Return whether or not this StubFactoryFactory creates StubFactory - * instances that create dynamic stubs and ties. At the top level, - * true indicates that rmic -iiop is not needed for generating stubs - * or ties. - */ - boolean createsDynamicStubs() ; - } - - /** Creates the actual stub needed for RMI-IIOP remote - * references. - */ - public interface StubFactory - { - /** Create a new dynamic stub. It has the type that was - * used to create this factory. - */ - org.omg.CORBA.Object makeStub() ; - - /** Return the repository ID information for all Stubs - * created by this stub factory. - */ - String[] getTypeIds() ; - } - - public interface ClassData - { - /** Get the class used to create this ClassData instance - */ - Class getMyClass() ; - - /** Get the IDLNameTranslator for the class used to create - * this ClassData instance. - */ - IDLNameTranslator getIDLNameTranslator() ; - - /** Return the array of repository IDs for all of the remote - * interfaces implemented by this class. - */ - String[] getTypeIds() ; - - /** Get the InvocationHandlerFactory that is used to create - * an InvocationHandler for dynamic stubs of the type of the - * ClassData. - */ - InvocationHandlerFactory getInvocationHandlerFactory() ; - - /** Get the dictionary for this ClassData instance. - * This is used to hold class-specific information for a Class - * in the class data. This avoids the need to create other - * caches for accessing the information. - */ - Map getDictionary() ; - } - - /** Get the ClassData for a particular class. - * This class may be an implementation class, in which - * case the IDLNameTranslator handles all Remote interfaces implemented by - * the class. If the class implements more than one remote interface, and not - * all of the remote interfaces are related by inheritance, then the type - * IDs have the implementation class as element 0. - */ - ClassData getClassData( Class cls ) ; - - /** Given a particular method, return a DynamicMethodMarshaller - * for that method. This is used for dynamic stubs and ties. - */ - DynamicMethodMarshaller getDynamicMethodMarshaller( Method method ) ; - - /** Return the registered StubFactoryFactory. - */ - StubFactoryFactory getStubFactoryFactory( boolean isDynamic ) ; - - /** Register the StubFactoryFactory. Note that - * a static StubFactoryFactory is always required for IDL. The - * dynamic stubFactoryFactory is optional. - */ - void setStubFactoryFactory( boolean isDynamic, StubFactoryFactory sff ) ; - - /** Equivalent to getStubFactoryFactory( true ).getTie( null ). - * Provided for compatibility with earlier versions of PresentationManager - * as used in the app server. The class argument is ignored in - * the dynamic case, so this is safe. - */ - Tie getTie() ; - - /** Returns the value of the com.sun.CORBA.ORBUseDynamicStub - * property. - */ - boolean useDynamicStubs() ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/presentation/rmi/StubAdapter.java b/src/java.corba/share/classes/com/sun/corba/se/spi/presentation/rmi/StubAdapter.java deleted file mode 100644 index 879803f1c2c..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/presentation/rmi/StubAdapter.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.presentation.rmi ; - -import javax.rmi.CORBA.Tie ; - -import org.omg.CORBA.portable.Delegate ; -import org.omg.CORBA.portable.ObjectImpl ; -import org.omg.CORBA.portable.OutputStream ; - -import org.omg.PortableServer.POA ; -import org.omg.PortableServer.POAManager ; -import org.omg.PortableServer.Servant ; - -import org.omg.PortableServer.POAPackage.WrongPolicy ; -import org.omg.PortableServer.POAPackage.ServantNotActive ; -import org.omg.PortableServer.POAManagerPackage.AdapterInactive ; - -import org.omg.CORBA.ORB ; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -// XXX Getting rid of this requires introducing an ObjectAdapterManager abstraction -// as an interface into the OA framework. -import com.sun.corba.se.impl.oa.poa.POAManagerImpl ; - -/** Provide access to stub delegate and type id information - * independent of the stub type. This class exists because - * ObjectImpl does not have an interface for the 3 delegate and - * type id methods, so a DynamicStub has a different type. - * We cannot simply change ObjectImpl as it is a standard API. - * We also cannot change the code generation of Stubs, as that - * is also standard. Hence I am left with this ugly class. - */ -public abstract class StubAdapter -{ - private StubAdapter() {} - - private static ORBUtilSystemException wrapper = - ORBUtilSystemException.get( CORBALogDomains.RPC_PRESENTATION ) ; - - public static boolean isStubClass( Class cls ) - { - return (ObjectImpl.class.isAssignableFrom( cls )) || - (DynamicStub.class.isAssignableFrom( cls )) ; - } - - public static boolean isStub( Object stub ) - { - return (stub instanceof DynamicStub) || - (stub instanceof ObjectImpl) ; - } - - public static void setDelegate( Object stub, Delegate delegate ) - { - if (stub instanceof DynamicStub) - ((DynamicStub)stub).setDelegate( delegate ) ; - else if (stub instanceof ObjectImpl) - ((ObjectImpl)stub)._set_delegate( delegate ) ; - else - throw wrapper.setDelegateRequiresStub() ; - } - - /** Use implicit activation to get an object reference for the servant. - */ - public static org.omg.CORBA.Object activateServant( Servant servant ) - { - POA poa = servant._default_POA() ; - org.omg.CORBA.Object ref = null ; - - try { - ref = poa.servant_to_reference( servant ) ; - } catch (ServantNotActive sna) { - throw wrapper.getDelegateServantNotActive( sna ) ; - } catch (WrongPolicy wp) { - throw wrapper.getDelegateWrongPolicy( wp ) ; - } - - // Make sure that the POAManager is activated if no other - // POAManager state management has taken place. - POAManager mgr = poa.the_POAManager() ; - if (mgr instanceof POAManagerImpl) { - POAManagerImpl mgrImpl = (POAManagerImpl)mgr ; - mgrImpl.implicitActivation() ; - } - - return ref ; - } - - /** Given any Tie, return the corresponding object refernce, activating - * the Servant if necessary. - */ - public static org.omg.CORBA.Object activateTie( Tie tie ) - { - /** Any implementation of Tie should be either a Servant or an ObjectImpl, - * depending on which style of code generation is used. rmic -iiop by - * default results in an ObjectImpl-based Tie, while rmic -iiop -poa - * results in a Servant-based Tie. Dynamic RMI-IIOP also uses Servant-based - * Ties (see impl.presentation.rmi.ReflectiveTie). - */ - if (tie instanceof ObjectImpl) { - return tie.thisObject() ; - } else if (tie instanceof Servant) { - Servant servant = (Servant)tie ; - return activateServant( servant ) ; - } else { - throw wrapper.badActivateTieCall() ; - } - } - - - /** This also gets the delegate from a Servant by - * using Servant._this_object() - */ - public static Delegate getDelegate( Object stub ) - { - if (stub instanceof DynamicStub) - return ((DynamicStub)stub).getDelegate() ; - else if (stub instanceof ObjectImpl) - return ((ObjectImpl)stub)._get_delegate() ; - else if (stub instanceof Tie) { - Tie tie = (Tie)stub ; - org.omg.CORBA.Object ref = activateTie( tie ) ; - return getDelegate( ref ) ; - } else - throw wrapper.getDelegateRequiresStub() ; - } - - public static ORB getORB( Object stub ) - { - if (stub instanceof DynamicStub) - return ((DynamicStub)stub).getORB() ; - else if (stub instanceof ObjectImpl) - return (ORB)((ObjectImpl)stub)._orb() ; - else - throw wrapper.getOrbRequiresStub() ; - } - - public static String[] getTypeIds( Object stub ) - { - if (stub instanceof DynamicStub) - return ((DynamicStub)stub).getTypeIds() ; - else if (stub instanceof ObjectImpl) - return ((ObjectImpl)stub)._ids() ; - else - throw wrapper.getTypeIdsRequiresStub() ; - } - - public static void connect( Object stub, - ORB orb ) throws java.rmi.RemoteException - { - if (stub instanceof DynamicStub) - ((DynamicStub)stub).connect( - (com.sun.corba.se.spi.orb.ORB)orb ) ; - else if (stub instanceof javax.rmi.CORBA.Stub) - ((javax.rmi.CORBA.Stub)stub).connect( orb ) ; - else if (stub instanceof ObjectImpl) - orb.connect( (org.omg.CORBA.Object)stub ) ; - else - throw wrapper.connectRequiresStub() ; - } - - public static boolean isLocal( Object stub ) - { - if (stub instanceof DynamicStub) - return ((DynamicStub)stub).isLocal() ; - else if (stub instanceof ObjectImpl) - return ((ObjectImpl)stub)._is_local() ; - else - throw wrapper.isLocalRequiresStub() ; - } - - public static OutputStream request( Object stub, - String operation, boolean responseExpected ) - { - if (stub instanceof DynamicStub) - return ((DynamicStub)stub).request( operation, - responseExpected ) ; - else if (stub instanceof ObjectImpl) - return ((ObjectImpl)stub)._request( operation, - responseExpected ) ; - else - throw wrapper.requestRequiresStub() ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/presentation/rmi/StubWrapper.java b/src/java.corba/share/classes/com/sun/corba/se/spi/presentation/rmi/StubWrapper.java deleted file mode 100644 index 1a683e7e547..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/presentation/rmi/StubWrapper.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.presentation.rmi ; - -import java.rmi.RemoteException ; - -import org.omg.CORBA.portable.Delegate ; -import org.omg.CORBA.ORB ; -import org.omg.CORBA.Request ; -import org.omg.CORBA.Context ; -import org.omg.CORBA.NamedValue ; -import org.omg.CORBA.NVList ; -import org.omg.CORBA.ContextList ; -import org.omg.CORBA.ExceptionList ; -import org.omg.CORBA.Policy ; -import org.omg.CORBA.DomainManager ; -import org.omg.CORBA.SetOverrideType ; - -import org.omg.CORBA.portable.OutputStream ; - -/** Wrapper that can take any stub (object x such that StubAdapter.isStub(x)) - * and treat it as a DynamicStub. - */ -public class StubWrapper implements DynamicStub -{ - private org.omg.CORBA.Object object ; - - public StubWrapper( org.omg.CORBA.Object object ) - { - if (!(StubAdapter.isStub(object))) - throw new IllegalStateException() ; - - this.object = object ; - } - - public void setDelegate( Delegate delegate ) - { - StubAdapter.setDelegate( object, delegate ) ; - } - - public Delegate getDelegate() - { - return StubAdapter.getDelegate( object ) ; - } - - public ORB getORB() - { - return StubAdapter.getORB( object ) ; - } - - public String[] getTypeIds() - { - return StubAdapter.getTypeIds( object ) ; - } - - public void connect( ORB orb ) throws RemoteException - { - StubAdapter.connect( object, (com.sun.corba.se.spi.orb.ORB)orb ) ; - } - - public boolean isLocal() - { - return StubAdapter.isLocal( object ) ; - } - - public OutputStream request( String operation, boolean responseExpected ) - { - return StubAdapter.request( object, operation, responseExpected ) ; - } - - public boolean _is_a(String repositoryIdentifier) - { - return object._is_a( repositoryIdentifier ) ; - } - - public boolean _is_equivalent(org.omg.CORBA.Object other) - { - return object._is_equivalent( other ) ; - } - - public boolean _non_existent() - { - return object._non_existent() ; - } - - public int _hash(int maximum) - { - return object._hash( maximum ) ; - } - - public org.omg.CORBA.Object _duplicate() - { - return object._duplicate() ; - } - - public void _release() - { - object._release() ; - } - - public org.omg.CORBA.Object _get_interface_def() - { - return object._get_interface_def() ; - } - - public Request _request(String operation) - { - return object._request( operation ) ; - } - - public Request _create_request( Context ctx, String operation, NVList arg_list, - NamedValue result) - { - return object._create_request( ctx, operation, arg_list, result ) ; - } - - public Request _create_request( Context ctx, String operation, NVList arg_list, - NamedValue result, ExceptionList exclist, ContextList ctxlist) - { - return object._create_request( ctx, operation, arg_list, result, - exclist, ctxlist ) ; - } - - public Policy _get_policy(int policy_type) - { - return object._get_policy( policy_type ) ; - } - - public DomainManager[] _get_domain_managers() - { - return object._get_domain_managers() ; - } - - public org.omg.CORBA.Object _set_policy_override( Policy[] policies, - SetOverrideType set_add) - { - return object._set_policy_override( policies, set_add ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/ClientDelegateFactory.java b/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/ClientDelegateFactory.java deleted file mode 100644 index 97ae509990f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/ClientDelegateFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.protocol ; - -import com.sun.corba.se.spi.transport.CorbaContactInfoList ; - -import com.sun.corba.se.spi.protocol.CorbaClientDelegate ; - -/** Interface used to create a ClientDelegate from a ContactInfoList. - */ -public interface ClientDelegateFactory { - CorbaClientDelegate create( CorbaContactInfoList list ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/CorbaClientDelegate.java b/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/CorbaClientDelegate.java deleted file mode 100644 index 5737844327d..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/CorbaClientDelegate.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.protocol; - -public abstract class CorbaClientDelegate - extends org.omg.CORBA_2_3.portable.Delegate - implements com.sun.corba.se.pept.protocol.ClientDelegate -{ -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/CorbaMessageMediator.java b/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/CorbaMessageMediator.java deleted file mode 100644 index b34de3b3af8..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/CorbaMessageMediator.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.protocol; - -import java.nio.ByteBuffer; - -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.SystemException; -import org.omg.CORBA.portable.ResponseHandler; -import org.omg.CORBA.portable.UnknownException; -import org.omg.CORBA_2_3.portable.InputStream; -import org.omg.CORBA_2_3.portable.OutputStream; - -import com.sun.corba.se.pept.broker.Broker; -import com.sun.corba.se.pept.protocol.MessageMediator; -import com.sun.corba.se.pept.encoding.InputObject; -import com.sun.corba.se.pept.encoding.OutputObject; -import com.sun.corba.se.pept.protocol.ProtocolHandler; -import com.sun.corba.se.pept.transport.Connection; - -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.ior.ObjectKey; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.protocol.CorbaProtocolHandler; -import com.sun.corba.se.spi.servicecontext.ServiceContexts; - -import com.sun.corba.se.impl.protocol.giopmsgheaders.LocateReplyMessage; -import com.sun.corba.se.impl.protocol.giopmsgheaders.LocateReplyOrReplyMessage; -import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; -import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase; -import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageHandler; -import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage; -import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage_1_0; -import com.sun.corba.se.impl.protocol.giopmsgheaders.RequestMessage; -import com.sun.corba.se.impl.protocol.giopmsgheaders.RequestMessage_1_0; - -/** - * @author Harold Carr - */ -public interface CorbaMessageMediator - extends - MessageMediator, - ResponseHandler -{ - public void setReplyHeader(LocateReplyOrReplyMessage header); - public LocateReplyMessage getLocateReplyHeader(); - public ReplyMessage getReplyHeader(); - public void setReplyExceptionDetailMessage(String message); - public RequestMessage getRequestHeader(); - public GIOPVersion getGIOPVersion(); - public byte getEncodingVersion(); - public int getRequestId(); - public Integer getRequestIdInteger(); - public boolean isOneWay(); - public short getAddrDisposition(); - public String getOperationName(); - public ServiceContexts getRequestServiceContexts(); - public ServiceContexts getReplyServiceContexts(); - public Message getDispatchHeader(); - public void setDispatchHeader(Message msg); - public ByteBuffer getDispatchBuffer(); - public void setDispatchBuffer(ByteBuffer byteBuffer); - public int getThreadPoolToUse(); - public byte getStreamFormatVersion(); // REVIST name ForRequest? - public byte getStreamFormatVersionForReply(); - - // REVISIT - not sure if the final fragment and DII stuff should - // go here. - - public void sendCancelRequestIfFinalFragmentNotSent(); - - public void setDIIInfo(org.omg.CORBA.Request request); - public boolean isDIIRequest(); - public Exception unmarshalDIIUserException(String repoId, - InputStream inputStream); - public void setDIIException(Exception exception); - public void handleDIIReply(InputStream inputStream); - - - public boolean isSystemExceptionReply(); - public boolean isUserExceptionReply(); - public boolean isLocationForwardReply(); - public boolean isDifferentAddrDispositionRequestedReply(); - public short getAddrDispositionReply(); - public IOR getForwardedIOR(); - public SystemException getSystemExceptionReply(); - - //////////////////////////////////////////////////// - // - // Server side - // - - public ObjectKey getObjectKey(); - public void setProtocolHandler(CorbaProtocolHandler protocolHandler); - public CorbaProtocolHandler getProtocolHandler(); - - //////////////////////////////////////////////////// - // - // ResponseHandler - // - - public org.omg.CORBA.portable.OutputStream createReply(); - public org.omg.CORBA.portable.OutputStream createExceptionReply(); - - //////////////////////////////////////////////////// - // - // from core.ServerRequest - // - - public boolean executeReturnServantInResponseConstructor(); - - public void setExecuteReturnServantInResponseConstructor(boolean b); - - public boolean executeRemoveThreadInfoInResponseConstructor(); - - public void setExecuteRemoveThreadInfoInResponseConstructor(boolean b); - - public boolean executePIInResponseConstructor(); - - public void setExecutePIInResponseConstructor( boolean b ); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/CorbaProtocolHandler.java b/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/CorbaProtocolHandler.java deleted file mode 100644 index bdb5b2e4020..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/CorbaProtocolHandler.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.protocol; - -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.SystemException; -import org.omg.CORBA.portable.UnknownException; - -import com.sun.corba.se.pept.protocol.ProtocolHandler; - -import com.sun.corba.se.spi.ior.IOR ; -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; - -import com.sun.corba.se.spi.servicecontext.ServiceContexts; -import com.sun.corba.se.impl.protocol.giopmsgheaders.LocateRequestMessage; -import com.sun.corba.se.impl.protocol.giopmsgheaders.RequestMessage; - -/** - * @author Harold Carr - */ -public interface CorbaProtocolHandler - extends ProtocolHandler -{ - public void handleRequest(RequestMessage header, - CorbaMessageMediator messageMediator); - - public void handleRequest(LocateRequestMessage header, - CorbaMessageMediator messageMediator); - - public CorbaMessageMediator createResponse( - CorbaMessageMediator messageMediator, - ServiceContexts svc); - public CorbaMessageMediator createUserExceptionResponse( - CorbaMessageMediator messageMediator, - ServiceContexts svc); - public CorbaMessageMediator createUnknownExceptionResponse( - CorbaMessageMediator messageMediator, - UnknownException ex); - public CorbaMessageMediator createSystemExceptionResponse( - CorbaMessageMediator messageMediator, - SystemException ex, - ServiceContexts svc); - public CorbaMessageMediator createLocationForward( - CorbaMessageMediator messageMediator, - IOR ior, - ServiceContexts svc); - - public void handleThrowableDuringServerDispatch( - CorbaMessageMediator request, - Throwable exception, - CompletionStatus completionStatus); - -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/CorbaServerRequestDispatcher.java b/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/CorbaServerRequestDispatcher.java deleted file mode 100644 index 7b6f1e72f21..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/CorbaServerRequestDispatcher.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.protocol; - -import com.sun.corba.se.pept.protocol.ServerRequestDispatcher; - -import com.sun.corba.se.spi.ior.ObjectKey; - -// XXX These must all be replaced by Sun private APIs. -import com.sun.corba.se.spi.ior.IOR ; - -/** - * Server delegate adds behavior on the server-side -- specifically - * on the dispatch path. A single server delegate instance serves - * many server objects. This is the second level of the dispatch - * on the server side: Acceptor to ServerSubcontract to ServerRequestDispatcher to - * ObjectAdapter to Servant, although this may be short-circuited. - * Instances of this class are registered in the subcontract Registry. - */ -public interface CorbaServerRequestDispatcher - extends ServerRequestDispatcher -{ - /** - * Handle a locate request. - */ - public IOR locate(ObjectKey key); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/ForwardException.java b/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/ForwardException.java deleted file mode 100644 index dccf11998c3..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/ForwardException.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.protocol; - -import org.omg.CORBA.BAD_PARAM ; - -import com.sun.corba.se.impl.orbutil.ORBUtility ; - -import com.sun.corba.se.spi.ior.IOR ; - -import com.sun.corba.se.spi.orb.ORB ; - -/** - * Thrown to signal an OBJECT_FORWARD or LOCATION_FORWARD - */ -public class ForwardException extends RuntimeException { - private ORB orb ; - private org.omg.CORBA.Object obj; - private IOR ior ; - - public ForwardException( ORB orb, IOR ior ) { - super(); - - this.orb = orb ; - this.obj = null ; - this.ior = ior ; - } - - public ForwardException( ORB orb, org.omg.CORBA.Object obj) { - super(); - - // This check is done early so that no attempt - // may be made to do a location forward to a local - // object. Doing this lazily would allow - // forwarding to locals in some restricted cases. - if (obj instanceof org.omg.CORBA.LocalObject) - throw new BAD_PARAM() ; - - this.orb = orb ; - this.obj = obj ; - this.ior = null ; - } - - public synchronized org.omg.CORBA.Object getObject() - { - if (obj == null) { - obj = ORBUtility.makeObjectReference( ior ) ; - } - - return obj ; - } - - public synchronized IOR getIOR() - { - if (ior == null) { - ior = ORBUtility.getIOR( obj ) ; - } - - return ior ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/InitialServerRequestDispatcher.java b/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/InitialServerRequestDispatcher.java deleted file mode 100644 index fb93eeef50f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/InitialServerRequestDispatcher.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.protocol; - -import com.sun.corba.se.spi.resolver.Resolver ; - -/** InitialServerRequestDispatcher is a specialized version of a ServerRequestDispatcher - * that provides an initialization method. This delegate is used - * to implement bootstrapping of initial object references. - */ -public interface InitialServerRequestDispatcher - extends CorbaServerRequestDispatcher -{ - /** Plug in the resolver that this InitialServerRequestDispatcher should - * use in order to lookup or list initial name to object reference - * bindings. - */ - void init( Resolver resolver ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/LocalClientRequestDispatcher.java b/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/LocalClientRequestDispatcher.java deleted file mode 100644 index 653b014cb9c..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/LocalClientRequestDispatcher.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.protocol; - -import org.omg.CORBA.portable.ServantObject; - -/** - * @author Harold Carr - */ - -public interface LocalClientRequestDispatcher -{ - public boolean useLocalInvocation(org.omg.CORBA.Object self); - - public boolean is_local(org.omg.CORBA.Object self); - - /** - * Returns a Java reference to the servant which should be used for this - * request. servant_preinvoke() is invoked by a local stub. - * If a ServantObject object is returned, then its servant field - * has been set to an object of the expected type (Note: the object may - * or may not be the actual servant instance). The local stub may cast - * the servant field to the expected type, and then invoke the operation - * directly. - * - * @param self The object reference which delegated to this delegate. - * - * @param operation a string containing the operation name. - * The operation name corresponds to the operation name as it would be - * encoded in a GIOP request. - * - * @param expectedType a Class object representing the expected type of the servant. - * The expected type is the Class object associated with the operations - * class of the stub's interface (e.g. A stub for an interface Foo, - * would pass the Class object for the FooOperations interface). - * - * @return a ServantObject object. - * The method may return a null value if it does not wish to support - * this optimization (e.g. due to security, transactions, etc). - * The method must return null if the servant is not of the expected type. - */ - public ServantObject servant_preinvoke(org.omg.CORBA.Object self, - String operation, - Class expectedType); - - public void servant_postinvoke(org.omg.CORBA.Object self, - ServantObject servant); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/LocalClientRequestDispatcherFactory.java b/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/LocalClientRequestDispatcherFactory.java deleted file mode 100644 index e05c731a0e2..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/LocalClientRequestDispatcherFactory.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.protocol; - -import com.sun.corba.se.spi.ior.IOR ; - -public interface LocalClientRequestDispatcherFactory { - public LocalClientRequestDispatcher create( int id, IOR ior ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/PIHandler.java b/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/PIHandler.java deleted file mode 100644 index ac25b79510a..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/PIHandler.java +++ /dev/null @@ -1,306 +0,0 @@ -/* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.protocol; - -import java.io.Closeable; - -import org.omg.PortableInterceptor.ObjectReferenceTemplate ; -import org.omg.PortableInterceptor.Interceptor ; -import org.omg.PortableInterceptor.Current ; -import org.omg.PortableInterceptor.PolicyFactory ; -import org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName ; - -import org.omg.CORBA.NVList ; -import org.omg.CORBA.Any ; -import org.omg.CORBA.Policy ; -import org.omg.CORBA.PolicyError ; - -import org.omg.CORBA.portable.RemarshalException; - -import com.sun.corba.se.spi.oa.ObjectAdapter ; - -import com.sun.corba.se.spi.protocol.CorbaMessageMediator ; - -import com.sun.corba.se.spi.ior.ObjectKeyTemplate ; - -// XXX These need to go away. -import com.sun.corba.se.impl.corba.RequestImpl ; -import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage ; - -/** This interface defines the PI interface that is used to interface the rest of the - * ORB to the PI implementation. - */ -public interface PIHandler extends Closeable { - /** Complete the initialization of the PIHandler. This will execute the methods - * on the ORBInitializers, if any are defined. This must be done here so that - * the ORB can obtain the PIHandler BEFORE the ORBInitializers run, since they - * will need access to the PIHandler through the ORB. - */ - public void initialize() ; - - public void destroyInterceptors() ; - - /* - **************************** - * IOR interceptor PI hooks - ****************************/ - - /** - * Called when a new object adapter is created. - * - * @param oa The adapter associated with the interceptors to be - * invoked. - */ - void objectAdapterCreated( ObjectAdapter oa ) ; - - /** - * Called whenever a state change occurs in an adapter manager. - * - * @param managerId managerId The adapter manager id - * @param newState newState The new state of the adapter manager, - * and by implication of all object adapters managed by this manager. - */ - void adapterManagerStateChanged( int managerId, - short newState ) ; - - /** Called whenever a state change occurs in an object adapter that - * was not caused by an adapter manager state change. - * - * @param templates The templates that are changing state. - * @param newState The new state of the adapters identified by the - * templates. - */ - void adapterStateChanged( ObjectReferenceTemplate[] templates, - short newState ) ; - - /* - ***************** - * Client PI hooks - *****************/ - - /** - * Called for pseudo-ops to temporarily disable portable interceptor - * hooks for calls on this thread. Keeps track of the number of - * times this is called and increments the disabledCount. - */ - void disableInterceptorsThisThread() ; - - /** - * Called for pseudo-ops to re-enable portable interceptor - * hooks for calls on this thread. Decrements the disabledCount. - * If disabledCount is 0, interceptors are re-enabled. - */ - void enableInterceptorsThisThread() ; - - /** - * Called when the send_request or send_poll portable interception point - * is to be invoked for all appropriate client-side request interceptors. - * - * @exception RemarhsalException - Thrown when this request needs to - * be retried. - */ - void invokeClientPIStartingPoint() - throws RemarshalException ; - - /** - * Called when the appropriate client ending interception point is - * to be invoked for all apporpriate client-side request interceptors. - * - * @param replyStatus One of the constants in iiop.messages.ReplyMessage - * indicating which reply status to set. - * @param exception The exception before ending interception points have - * been invoked, or null if no exception at the moment. - * @return The exception to be thrown, after having gone through - * all ending points, or null if there is no exception to be - * thrown. Note that this exception can be either the same or - * different from the exception set using setClientPIException. - * There are four possible return types: null (no exception), - * SystemException, UserException, or RemarshalException. - */ - Exception invokeClientPIEndingPoint( - int replyStatus, Exception exception ) ; - - /** - * Called when a retry is needed after initiateClientPIRequest but - * before invokeClientPIRequest. In this case, we need to properly - * balance initiateClientPIRequest/cleanupClientPIRequest calls, - * but WITHOUT extraneous calls to invokeClientPIEndingPoint - * (see bug 6763340). - * - * @param replyStatus One of the constants in iiop.messages.ReplyMessage - * indicating which reply status to set. - * @param exception The exception before ending interception points have - * been invoked, or null if no exception at the moment. - * @return The exception to be thrown, after having gone through - * all ending points, or null if there is no exception to be - * thrown. Note that this exception can be either the same or - * different from the exception set using setClientPIException. - * There are four possible return types: null (no exception), - * SystemException, UserException, or RemarshalException. - */ - Exception makeCompletedClientRequest( - int replyStatus, Exception exception ) ; - - /** - * Invoked when a request is about to be created. Must be called before - * any of the setClientPI* methods so that a new info object can be - * prepared for information collection. - * - * @param diiRequest True if this is to be a DII request, or false if it - * is a "normal" request. In the DII case, initiateClientPIRequest - * is called twice and we need to ignore the second one. - */ - void initiateClientPIRequest( boolean diiRequest ) ; - - /** - * Invoked when a request is about to be cleaned up. Must be called - * after ending points are called so that the info object on the stack - * can be deinitialized and popped from the stack at the appropriate - * time. - */ - void cleanupClientPIRequest() ; - - /** - * Notifies PI of additional information for client-side interceptors. - * PI will use this information as a source of information for the - * ClientRequestInfo object. - */ - void setClientPIInfo( RequestImpl requestImpl ) ; - - /** - * Notify PI of the MessageMediator for the request. - */ - void setClientPIInfo(CorbaMessageMediator messageMediator) ; - - /* - ***************** - * Server PI hooks - *****************/ - - /** - * Called when the appropriate server starting interception point is - * to be invoked for all appropriate server-side request interceptors. - * - * @throws ForwardException Thrown if an interceptor raises - * ForwardRequest. This is an unchecked exception so that we need - * not modify the entire execution path to declare throwing - * ForwardException. - */ - void invokeServerPIStartingPoint() ; - - /** - * Called when the appropriate server intermediate interception point is - * to be invoked for all appropriate server-side request interceptors. - * - * @throws ForwardException Thrown if an interceptor raises - * ForwardRequest. This is an unchecked exception so that we need - * not modify the entire execution path to declare throwing - * ForwardException. - */ - void invokeServerPIIntermediatePoint() ; - - /** - * Called when the appropriate server ending interception point is - * to be invoked for all appropriate server-side request interceptors. - * - * @param replyMessage The iiop.messages.ReplyMessage containing the - * reply status. - * @throws ForwardException Thrown if an interceptor raises - * ForwardRequest. This is an unchecked exception so that we need - * not modify the entire execution path to declare throwing - * ForwardException. - */ - void invokeServerPIEndingPoint( ReplyMessage replyMessage ) ; - - /** - * Notifies PI to start a new server request and set initial - * information for server-side interceptors. - * PI will use this information as a source of information for the - * ServerRequestInfo object. poaimpl is declared as an Object so that - * we need not introduce a dependency on the POA package. - */ - void initializeServerPIInfo( CorbaMessageMediator request, - ObjectAdapter oa, byte[] objectId, ObjectKeyTemplate oktemp ) ; - - /** - * Notifies PI of additional information reqired for ServerRequestInfo. - * - * @param servant The servant. This is java.lang.Object because in the - * POA case, this will be a org.omg.PortableServer.Servant whereas - * in the ServerRequestDispatcher case this will be an ObjectImpl. - * @param targetMostDerivedInterface. The most derived interface. This - * is passed in instead of calculated when needed because it requires - * extra information in the POA case that we didn't want to bother - * creating extra methods for to pass in. - */ - void setServerPIInfo( java.lang.Object servant, - String targetMostDerivedInterface ) ; - - /** - * Notifies PI of additional information required for ServerRequestInfo. - */ - void setServerPIInfo( Exception exception ) ; - - /** - * Notifies PI of additional information for server-side interceptors. - * PI will use this information as a source of information for the - * ServerRequestInfo object. These are the arguments for a DSI request. - */ - void setServerPIInfo( NVList arguments ) ; - - /** - * Notifies PI of additional information for server-side interceptors. - * PI will use this information as a source of information for the - * ServerRequestInfo object. This is the exception of a DSI request. - */ - void setServerPIExceptionInfo( Any exception ) ; - - /** - * Notifies PI of additional information for server-side interceptors. - * PI will use this information as a source of information for the - * ServerRequestInfo object. This is the result of a DSI request. - */ - void setServerPIInfo( Any result ) ; - - /** - * Invoked when a request is about to be cleaned up. Must be called - * after ending points are called so that the info object on the stack - * can be deinitialized and popped from the stack at the appropriate - * time. - */ - void cleanupServerPIRequest() ; - - Policy create_policy( int type, Any val ) throws PolicyError ; - - void register_interceptor( Interceptor interceptor, int type ) - throws DuplicateName ; - - Current getPICurrent() ; - - void registerPolicyFactory( int type, PolicyFactory factory ) ; - - int allocateServerRequestId() ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/RequestDispatcherDefault.java b/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/RequestDispatcherDefault.java deleted file mode 100644 index 748dc61a1b0..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/RequestDispatcherDefault.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.protocol ; - -import com.sun.corba.se.pept.protocol.ClientRequestDispatcher; - -import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcherFactory ; -import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher ; - -import com.sun.corba.se.spi.orb.ORB ; - -// Used only in the implementation: no client of this class ever needs these -import com.sun.corba.se.spi.ior.IOR ; - -import com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl ; -import com.sun.corba.se.impl.protocol.CorbaServerRequestDispatcherImpl ; -import com.sun.corba.se.impl.protocol.MinimalServantCacheLocalCRDImpl ; -import com.sun.corba.se.impl.protocol.InfoOnlyServantCacheLocalCRDImpl ; -import com.sun.corba.se.impl.protocol.FullServantCacheLocalCRDImpl ; -import com.sun.corba.se.impl.protocol.JIDLLocalCRDImpl ; -import com.sun.corba.se.impl.protocol.POALocalCRDImpl ; -import com.sun.corba.se.impl.protocol.INSServerRequestDispatcher ; -import com.sun.corba.se.impl.protocol.BootstrapServerRequestDispatcher ; - -public final class RequestDispatcherDefault { - private RequestDispatcherDefault() {} - - public static ClientRequestDispatcher makeClientRequestDispatcher() - { - return new CorbaClientRequestDispatcherImpl() ; - } - - public static CorbaServerRequestDispatcher makeServerRequestDispatcher( ORB orb ) - { - return new CorbaServerRequestDispatcherImpl( (com.sun.corba.se.spi.orb.ORB)orb ) ; - } - - public static CorbaServerRequestDispatcher makeBootstrapServerRequestDispatcher( ORB orb ) - { - return new BootstrapServerRequestDispatcher( orb ) ; - } - - public static CorbaServerRequestDispatcher makeINSServerRequestDispatcher( ORB orb ) - { - return new INSServerRequestDispatcher( orb ) ; - } - - public static LocalClientRequestDispatcherFactory makeMinimalServantCacheLocalClientRequestDispatcherFactory( final ORB orb ) - { - return new LocalClientRequestDispatcherFactory() { - public LocalClientRequestDispatcher create( int id, IOR ior ) { - return new MinimalServantCacheLocalCRDImpl( orb, id, ior ) ; - } - } ; - } - - public static LocalClientRequestDispatcherFactory makeInfoOnlyServantCacheLocalClientRequestDispatcherFactory( final ORB orb ) - { - return new LocalClientRequestDispatcherFactory() { - public LocalClientRequestDispatcher create( int id, IOR ior ) { - return new InfoOnlyServantCacheLocalCRDImpl( orb, id, ior ) ; - } - } ; - } - - public static LocalClientRequestDispatcherFactory makeFullServantCacheLocalClientRequestDispatcherFactory( final ORB orb ) - { - return new LocalClientRequestDispatcherFactory() { - public LocalClientRequestDispatcher create( int id, IOR ior ) { - return new FullServantCacheLocalCRDImpl( orb, id, ior ) ; - } - } ; - } - - public static LocalClientRequestDispatcherFactory makeJIDLLocalClientRequestDispatcherFactory( final ORB orb ) - { - return new LocalClientRequestDispatcherFactory() { - public LocalClientRequestDispatcher create( int id, IOR ior ) { - return new JIDLLocalCRDImpl( orb, id, ior ) ; - } - } ; - } - - public static LocalClientRequestDispatcherFactory makePOALocalClientRequestDispatcherFactory( final ORB orb ) - { - return new LocalClientRequestDispatcherFactory() { - public LocalClientRequestDispatcher create( int id, IOR ior ) { - return new POALocalCRDImpl( orb, id, ior ) ; - } - } ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/RequestDispatcherRegistry.java b/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/RequestDispatcherRegistry.java deleted file mode 100644 index f5aae43731d..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/RequestDispatcherRegistry.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.protocol; - -import java.util.Set; - -import com.sun.corba.se.pept.protocol.ClientRequestDispatcher ; -import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher ; -import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcherFactory ; - -import com.sun.corba.se.spi.oa.ObjectAdapterFactory ; - -/** - * This is a registry of all subcontract ID dependent objects. This includes: - * LocalClientRequestDispatcherFactory, ClientRequestDispatcher, ServerRequestDispatcher, and - * ObjectAdapterFactory. - */ -public interface RequestDispatcherRegistry { - - /** Register a ClientRequestDispatcher for a particular subcontract ID. - * The subcontract ID appears in the ObjectKey of an object reference, and is used - * to control how a remote method invocation is processed by the ORB for a - * particular kind of object reference. - */ - void registerClientRequestDispatcher( ClientRequestDispatcher csc, int scid) ; - - /** Get the ClientRequestDispatcher for subcontract ID scid. - */ - ClientRequestDispatcher getClientRequestDispatcher( int scid ) ; - - /** Register a LocalClientRequestDispatcher for a particular subcontract ID. - * The subcontract ID appears in the ObjectKey of an object reference, and is used - * to control how a particular kind of colocated request is processed. - */ - void registerLocalClientRequestDispatcherFactory( LocalClientRequestDispatcherFactory csc, int scid) ; - - /** Get the LocalClientRequestDispatcher for subcontract ID scid. - */ - LocalClientRequestDispatcherFactory getLocalClientRequestDispatcherFactory( int scid ) ; - - /** Register a CorbaServerRequestDispatcher for a particular subcontract ID. - * The subcontract ID appears in the ObjectKey of an object reference, and is used - * to control how a particular kind of request is processed when received by the ORB. - */ - void registerServerRequestDispatcher( CorbaServerRequestDispatcher ssc, int scid) ; - - /** Get the CorbaServerRequestDispatcher for subcontract ID scid. - */ - CorbaServerRequestDispatcher getServerRequestDispatcher(int scid) ; - - /** Register a CorbaServerRequestDispatcher for handling an explicit object key name. - * This is used for non-standard invocations such as INS and the bootstrap name service. - */ - void registerServerRequestDispatcher( CorbaServerRequestDispatcher ssc, String name ) ; - - /** Get the CorbaServerRequestDispatcher for a particular object key. - */ - CorbaServerRequestDispatcher getServerRequestDispatcher( String name ) ; - - /** Register an ObjectAdapterFactory for a particular subcontract ID. - * This controls how Object references are created and managed. - */ - void registerObjectAdapterFactory( ObjectAdapterFactory oaf, int scid) ; - - /** Get the ObjectAdapterFactory for a particular subcontract ID scid. - */ - ObjectAdapterFactory getObjectAdapterFactory( int scid ) ; - - /** Return the set of all ObjectAdapterFactory instances that are registered. - */ - Set getObjectAdapterFactories(); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/RetryType.java b/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/RetryType.java deleted file mode 100644 index 6035011d3e9..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/protocol/RetryType.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.protocol ; - -// Introduce more information about WHY we are re-trying a request -// so we can properly handle the two cases: -// - BEFORE_RESPONSE means that the retry is caused by -// something that happened BEFORE the message was sent: either -// an exception from the SocketFactory, or one from the -// Client side send_request interceptor point. -// - AFTER_RESPONSE means that the retry is a result either of the -// request sent to the server (from the response), or from the -// Client side receive_xxx interceptor point. -public enum RetryType { - NONE( false ), - BEFORE_RESPONSE( true ), - AFTER_RESPONSE( true ) ; - - private final boolean isRetry ; - - RetryType( boolean isRetry ) { - this.isRetry = isRetry ; - } - - public boolean isRetry() { - return this.isRetry ; - } -} ; - diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/resolver/LocalResolver.java b/src/java.corba/share/classes/com/sun/corba/se/spi/resolver/LocalResolver.java deleted file mode 100644 index bd0d63f6804..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/resolver/LocalResolver.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.resolver ; - -import com.sun.corba.se.spi.orbutil.closure.Closure ; - -/** A LocalResolver is a Resolver that allows registration of (name, CORBA object) - * bindings. - */ -public interface LocalResolver extends Resolver { - /** Register the Closure with the given name. - * The Closure must evaluate to an org.omg.CORBA.Object. - */ - void register( String name, Closure closure ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/resolver/Resolver.java b/src/java.corba/share/classes/com/sun/corba/se/spi/resolver/Resolver.java deleted file mode 100644 index 0391648fb48..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/resolver/Resolver.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.resolver ; - -/** Resolver defines the operations needed to support ORB operations for - * resolve_initial_references and list_initial_services. - */ -public interface Resolver { - /** Look up the name using this resolver and return the CORBA object - * reference bound to this name, if any. Returns null if no object - * is bound to the name. - */ - org.omg.CORBA.Object resolve( String name ) ; - - /** Return the entire collection of names that are currently bound - * by this resolver. Resulting collection contains only strings for - * which resolve does not return null. Some resolvers may not support - * this method, in which case they return an empty set. - */ - java.util.Set list() ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/resolver/ResolverDefault.java b/src/java.corba/share/classes/com/sun/corba/se/spi/resolver/ResolverDefault.java deleted file mode 100644 index 5342f373849..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/resolver/ResolverDefault.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.resolver ; - -import java.io.File ; - -import com.sun.corba.se.impl.resolver.LocalResolverImpl ; -import com.sun.corba.se.impl.resolver.ORBInitRefResolverImpl ; -import com.sun.corba.se.impl.resolver.ORBDefaultInitRefResolverImpl ; -import com.sun.corba.se.impl.resolver.BootstrapResolverImpl ; -import com.sun.corba.se.impl.resolver.CompositeResolverImpl ; -import com.sun.corba.se.impl.resolver.INSURLOperationImpl ; -import com.sun.corba.se.impl.resolver.SplitLocalResolverImpl ; -import com.sun.corba.se.impl.resolver.FileResolverImpl ; - -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.orb.Operation ; -import com.sun.corba.se.spi.orb.StringPair ; - -/** Utility class that provides factory methods for all of the - * standard resolvers that we provide. - */ -public class ResolverDefault { - /** Return a local resolver that simply stores bindings in a map. - */ - public static LocalResolver makeLocalResolver( ) - { - return new LocalResolverImpl() ; - } - - /** Return a resolver that relies on configured values of ORBInitRef for data. - */ - public static Resolver makeORBInitRefResolver( Operation urlOperation, - StringPair[] initRefs ) - { - return new ORBInitRefResolverImpl( urlOperation, initRefs ) ; - } - - public static Resolver makeORBDefaultInitRefResolver( Operation urlOperation, - String defaultInitRef ) - { - return new ORBDefaultInitRefResolverImpl( urlOperation, - defaultInitRef ) ; - } - - /** Return a resolver that uses the proprietary bootstrap protocol - * to implement a resolver. Obtains the necessary host and port - * information from the ORB. - */ - public static Resolver makeBootstrapResolver( ORB orb, String host, int port ) - { - return new BootstrapResolverImpl( orb, host, port ) ; - } - - /** Return a resolver composed of the two given resolvers. result.list() is the - * union of first.list() and second.list(). result.resolve( name ) returns - * first.resolve( name ) if that is not null, otherwise returns the result of - * second.resolve( name ). - */ - public static Resolver makeCompositeResolver( Resolver first, Resolver second ) - { - return new CompositeResolverImpl( first, second ) ; - } - - public static Operation makeINSURLOperation( ORB orb, Resolver bootstrapResolver ) - { - return new INSURLOperationImpl( - (com.sun.corba.se.spi.orb.ORB)orb, bootstrapResolver ) ; - } - - public static LocalResolver makeSplitLocalResolver( Resolver resolver, - LocalResolver localResolver ) - { - return new SplitLocalResolverImpl( resolver, localResolver ) ; - } - - public static Resolver makeFileResolver( ORB orb, File file ) - { - return new FileResolverImpl( orb, file ) ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/CodeSetServiceContext.java b/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/CodeSetServiceContext.java deleted file mode 100644 index 587b597c10c..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/CodeSetServiceContext.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.servicecontext; - -import org.omg.CORBA.SystemException; -import org.omg.CORBA_2_3.portable.InputStream; -import org.omg.CORBA_2_3.portable.OutputStream; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.impl.encoding.MarshalInputStream ; -import com.sun.corba.se.impl.encoding.MarshalOutputStream ; -import com.sun.corba.se.impl.encoding.CodeSetComponentInfo ; - -public class CodeSetServiceContext extends ServiceContext { - public CodeSetServiceContext( CodeSetComponentInfo.CodeSetContext csc ) - { - this.csc = csc ; - } - - public CodeSetServiceContext(InputStream is, GIOPVersion gv) - { - super(is, gv) ; - csc = new CodeSetComponentInfo.CodeSetContext() ; - csc.read( (MarshalInputStream)in ) ; - } - - // Required SERVICE_CONTEXT_ID and getId definitions - public static final int SERVICE_CONTEXT_ID = 1 ; - public int getId() { return SERVICE_CONTEXT_ID ; } - - public void writeData( OutputStream os ) throws SystemException - { - csc.write( (MarshalOutputStream)os ) ; - } - - public CodeSetComponentInfo.CodeSetContext getCodeSetContext() - { - return csc ; - } - - private CodeSetComponentInfo.CodeSetContext csc ; - - public String toString() - { - return "CodeSetServiceContext[ csc=" + csc + " ]" ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/MaxStreamFormatVersionServiceContext.java b/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/MaxStreamFormatVersionServiceContext.java deleted file mode 100644 index ec0267bd27a..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/MaxStreamFormatVersionServiceContext.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/** - */ -package com.sun.corba.se.spi.servicecontext; - -import org.omg.IOP.RMICustomMaxStreamFormat; -import javax.rmi.CORBA.*; -import org.omg.CORBA.SystemException; -import org.omg.CORBA_2_3.portable.InputStream; -import org.omg.CORBA_2_3.portable.OutputStream; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.impl.encoding.MarshalInputStream; -import com.sun.corba.se.impl.encoding.MarshalOutputStream; -import com.sun.corba.se.impl.orbutil.ORBUtility; - -public class MaxStreamFormatVersionServiceContext extends ServiceContext { - - private byte maxStreamFormatVersion; - - // The singleton uses the maximum version indicated by our - // ValueHandler. - public static final MaxStreamFormatVersionServiceContext singleton - = new MaxStreamFormatVersionServiceContext(); - - public MaxStreamFormatVersionServiceContext() { - maxStreamFormatVersion = ORBUtility.getMaxStreamFormatVersion(); - } - - public MaxStreamFormatVersionServiceContext(byte maxStreamFormatVersion) { - this.maxStreamFormatVersion = maxStreamFormatVersion; - } - - public MaxStreamFormatVersionServiceContext(InputStream is, - GIOPVersion gv) { - super(is, gv) ; - - maxStreamFormatVersion = is.read_octet(); - } - - public static final int SERVICE_CONTEXT_ID = RMICustomMaxStreamFormat.value; - public int getId() { return SERVICE_CONTEXT_ID; } - - public void writeData(OutputStream os) throws SystemException - { - os.write_octet(maxStreamFormatVersion); - } - - public byte getMaximumStreamFormatVersion() - { - return maxStreamFormatVersion; - } - - public String toString() - { - return "MaxStreamFormatVersionServiceContext[" - + maxStreamFormatVersion + "]"; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/ORBVersionServiceContext.java b/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/ORBVersionServiceContext.java deleted file mode 100644 index b610a52181e..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/ORBVersionServiceContext.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.servicecontext; - -import org.omg.CORBA.SystemException; -import org.omg.CORBA_2_3.portable.InputStream ; -import org.omg.CORBA_2_3.portable.OutputStream ; - -import com.sun.corba.se.spi.orb.ORBVersion ; -import com.sun.corba.se.spi.orb.ORBVersionFactory ; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.servicecontext.ServiceContext ; -import com.sun.corba.se.impl.orbutil.ORBConstants ; - -public class ORBVersionServiceContext extends ServiceContext { - - public ORBVersionServiceContext( ) - { - version = ORBVersionFactory.getORBVersion() ; - } - - public ORBVersionServiceContext( ORBVersion ver ) - { - this.version = ver ; - } - - public ORBVersionServiceContext(InputStream is, GIOPVersion gv) - { - super(is, gv) ; - // pay particular attention to where the version is being read from! - // is contains an encapsulation, ServiceContext reads off the - // encapsulation and leaves the pointer in the variable "in", - // which points to the long value. - - version = ORBVersionFactory.create( in ) ; - } - - // Required SERVICE_CONTEXT_ID and getId definitions - public static final int SERVICE_CONTEXT_ID = ORBConstants.TAG_ORB_VERSION ; - public int getId() { return SERVICE_CONTEXT_ID ; } - - public void writeData( OutputStream os ) throws SystemException - { - version.write( os ) ; - } - - public ORBVersion getVersion() - { - return version ; - } - - // current ORB Version - private ORBVersion version = ORBVersionFactory.getORBVersion() ; - - public String toString() - { - return "ORBVersionServiceContext[ version=" + version + " ]" ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/SendingContextServiceContext.java b/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/SendingContextServiceContext.java deleted file mode 100644 index a26231c4ce4..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/SendingContextServiceContext.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.servicecontext; - -import org.omg.CORBA.SystemException; -import org.omg.CORBA_2_3.portable.InputStream ; -import org.omg.CORBA_2_3.portable.OutputStream ; -import com.sun.corba.se.spi.ior.IOR ; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.servicecontext.ServiceContext ; -import com.sun.corba.se.impl.encoding.MarshalOutputStream ; -import com.sun.corba.se.impl.ior.IORImpl ; - -public class SendingContextServiceContext extends ServiceContext { - public SendingContextServiceContext( IOR ior ) - { - this.ior = ior ; - } - - public SendingContextServiceContext(InputStream is, GIOPVersion gv) - { - super(is, gv) ; - ior = new IORImpl( in ) ; - } - - // Required SERVICE_CONTEXT_ID and getId definitions - public static final int SERVICE_CONTEXT_ID = 6 ; - public int getId() { return SERVICE_CONTEXT_ID ; } - - public void writeData( OutputStream os ) throws SystemException - { - ior.write( os ) ; - } - - public IOR getIOR() - { - return ior ; - } - - private IOR ior = null ; - - public String toString() - { - return "SendingContexServiceContext[ ior=" + ior + " ]" ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/ServiceContext.java b/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/ServiceContext.java deleted file mode 100644 index c2b07a25384..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/ServiceContext.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.servicecontext; - -import org.omg.CORBA.SystemException; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA_2_3.portable.InputStream ; -import org.omg.CORBA_2_3.portable.OutputStream ; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.impl.encoding.CDRInputStream ; -import com.sun.corba.se.impl.encoding.EncapsInputStream ; -import com.sun.corba.se.impl.encoding.EncapsOutputStream ; -import com.sun.corba.se.impl.orbutil.ORBUtility ; - -/** Base class for all ServiceContext classes. -* There is a derived ServiceContext class for each service context that -* the ORB supports. Each subclass encapsulates the representation of -* the service context and provides any needed methods for manipulating -* the service context. Each subclass must provide the following -* members: -*

              -*
            • a public static final int SERVICE_CONTEXT_ID that gives the OMG -* (or other) defined id for the service context. This is needed for the -* registration mechanism defined in ServiceContexts. OMG defined -* service context ids are taken from section 13.6.7 of ptc/98-12-04.
            • -*
            • a public constructor that takes an InputStream as its argument.
            • -*
            • Appropriate definitions of getId() and writeData(). getId() must -* return SERVICE_CONTEXT_ID.
            • -*
            -*

            -* The subclass can be constructed either directly from the service context -* representation, or by reading the representation from an input stream. -* These cases are needed when the service context is created and written to -* the request or reply, and when the service context is read from the -* received request or reply. -*/ -public abstract class ServiceContext { - /** Simple default constructor used when subclass is constructed - * from its representation. - */ - protected ServiceContext() { } - - private void dprint( String msg ) - { - ORBUtility.dprint( this, msg ) ; - } - - /** Stream constructor used when subclass is constructed from an - * InputStream. This constructor must be called by super( stream ) - * in the subclass. After this constructor completes, the service - * context representation can be read from in. - * Note that the service context id has been consumed from the input - * stream before this object is constructed. - */ - protected ServiceContext(InputStream s, GIOPVersion gv) throws SystemException - { - in = s; - } - - /** Returns Service context id. Must be overloaded in subclass. - */ - public abstract int getId() ; - - /** Write the service context to an output stream. This method - * must be used for writing the service context to a request or reply - * header. - */ - public void write(OutputStream s, GIOPVersion gv) throws SystemException - { - EncapsOutputStream os = - sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)(s.orb()), gv); - os.putEndian() ; - writeData( os ) ; - byte[] data = os.toByteArray() ; - - s.write_long(getId()); - s.write_long(data.length); - s.write_octet_array(data, 0, data.length); - } - - /** Writes the data used to represent the subclasses service context - * into an encapsulation stream. Must be overloaded in subclass. - */ - protected abstract void writeData( OutputStream os ) ; - - /** in is the stream containing the service context representation. - * It is constructed by the stream constructor, and available for use - * in the subclass stream constructor. - */ - protected InputStream in = null ; - - public String toString() - { - return "ServiceContext[ id=" + getId() + " ]" ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/ServiceContextData.java b/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/ServiceContextData.java deleted file mode 100644 index 2ee34f32265..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/ServiceContextData.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.servicecontext; - -import org.omg.CORBA.BAD_PARAM ; -import org.omg.CORBA_2_3.portable.InputStream ; -import com.sun.corba.se.spi.servicecontext.ServiceContext ; -import java.lang.reflect.InvocationTargetException ; -import java.lang.reflect.Modifier ; -import java.lang.reflect.Field ; -import java.lang.reflect.Constructor ; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.impl.orbutil.ORBUtility ; - -/** Internal class used to hold data about a service context class. -*/ -public class ServiceContextData { - private void dprint( String msg ) - { - ORBUtility.dprint( this, msg ) ; - } - - private void throwBadParam( String msg, Throwable exc ) - { - BAD_PARAM error = new BAD_PARAM( msg ) ; - if (exc != null) - error.initCause( exc ) ; - throw error ; - } - - public ServiceContextData( Class cls ) - { - if (ORB.ORBInitDebug) - dprint( "ServiceContextData constructor called for class " + cls ) ; - - scClass = cls ; - - try { - if (ORB.ORBInitDebug) - dprint( "Finding constructor for " + cls ) ; - - // Find the appropriate constructor in cls - Class[] args = new Class[2] ; - args[0] = InputStream.class ; - args[1] = GIOPVersion.class; - try { - scConstructor = cls.getConstructor( args ) ; - } catch (NoSuchMethodException nsme) { - throwBadParam( "Class does not have an InputStream constructor", nsme ) ; - } - - if (ORB.ORBInitDebug) - dprint( "Finding SERVICE_CONTEXT_ID field in " + cls ) ; - - // get the ID from the public static final int SERVICE_CONTEXT_ID - Field fld = null ; - try { - fld = cls.getField( "SERVICE_CONTEXT_ID" ) ; - } catch (NoSuchFieldException nsfe) { - throwBadParam( "Class does not have a SERVICE_CONTEXT_ID member", nsfe ) ; - } catch (SecurityException se) { - throwBadParam( "Could not access SERVICE_CONTEXT_ID member", se ) ; - } - - if (ORB.ORBInitDebug) - dprint( "Checking modifiers of SERVICE_CONTEXT_ID field in " + cls ) ; - - int mod = fld.getModifiers() ; - if (!Modifier.isPublic(mod) || !Modifier.isStatic(mod) || - !Modifier.isFinal(mod) ) - throwBadParam( "SERVICE_CONTEXT_ID field is not public static final", null ) ; - - if (ORB.ORBInitDebug) - dprint( "Getting value of SERVICE_CONTEXT_ID in " + cls ) ; - - try { - scId = fld.getInt( null ) ; - } catch (IllegalArgumentException iae) { - throwBadParam( "SERVICE_CONTEXT_ID not convertible to int", iae ) ; - } catch (IllegalAccessException iae2) { - throwBadParam( "Could not access value of SERVICE_CONTEXT_ID", iae2 ) ; - } - } catch (BAD_PARAM nssc) { - if (ORB.ORBInitDebug) - dprint( "Exception in ServiceContextData constructor: " + nssc ) ; - throw nssc ; - } catch (Throwable thr) { - if (ORB.ORBInitDebug) - dprint( "Unexpected Exception in ServiceContextData constructor: " + - thr ) ; - } - - if (ORB.ORBInitDebug) - dprint( "ServiceContextData constructor completed" ) ; - } - - /** Factory method used to create a ServiceContext object by - * unmarshalling it from the InputStream. - */ - public ServiceContext makeServiceContext(InputStream is, GIOPVersion gv) - { - Object[] args = new Object[2]; - args[0] = is ; - args[1] = gv; - ServiceContext sc = null ; - - try { - sc = (ServiceContext)(scConstructor.newInstance( args )) ; - } catch (IllegalArgumentException iae) { - throwBadParam( "InputStream constructor argument error", iae ) ; - } catch (IllegalAccessException iae2) { - throwBadParam( "InputStream constructor argument error", iae2 ) ; - } catch (InstantiationException ie) { - throwBadParam( "InputStream constructor called for abstract class", ie ) ; - } catch (InvocationTargetException ite) { - throwBadParam( "InputStream constructor threw exception " + - ite.getTargetException(), ite ) ; - } - - return sc ; - } - - int getId() - { - return scId ; - } - - public String toString() - { - return "ServiceContextData[ scClass=" + scClass + " scConstructor=" + - scConstructor + " scId=" + scId + " ]" ; - } - - private Class scClass ; - private Constructor scConstructor ; - private int scId ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/ServiceContextRegistry.java b/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/ServiceContextRegistry.java deleted file mode 100644 index 41bbd23187f..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/ServiceContextRegistry.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.servicecontext; - -import org.omg.CORBA.BAD_PARAM; -import java.util.Vector ; -import java.util.Enumeration ; -import com.sun.corba.se.spi.servicecontext.ServiceContext ; -import com.sun.corba.se.spi.servicecontext.ServiceContextData ; -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.impl.orbutil.ORBUtility ; - -public class ServiceContextRegistry { - private ORB orb ; - private Vector scCollection ; - - private void dprint( String msg ) - { - ORBUtility.dprint( this, msg ) ; - } - - public ServiceContextRegistry( ORB orb ) - { - scCollection = new Vector() ; - this.orb = orb ; - } - - /** Register the ServiceContext class so that it will be recognized - * by the read method. - * Class cls must have the following properties: - *

              - *
            • It must derive from com.sun.corba.se.spi.servicecontext.ServiceContext.
            • - *
            • It must have a public static final int SERVICE_CONTEXT_ID - * member.
            • - *
            • It must implement a constructor that takes a - * org.omg.CORBA_2_3.portable.InputStream argument.
            • - *
            - */ - public void register( Class cls ) - { - if (ORB.ORBInitDebug) - dprint( "Registering service context class " + cls ) ; - - ServiceContextData scd = new ServiceContextData( cls ) ; - - if (findServiceContextData(scd.getId()) == null) - scCollection.addElement( scd ) ; - else - throw new BAD_PARAM( "Tried to register duplicate service context" ) ; - } - - public ServiceContextData findServiceContextData( int scId ) - { - if (ORB.ORBInitDebug) - dprint( "Searching registry for service context id " + scId ) ; - - Enumeration enumeration = scCollection.elements() ; - while (enumeration.hasMoreElements()) { - ServiceContextData scd = - (ServiceContextData)(enumeration.nextElement()) ; - if (scd.getId() == scId) { - if (ORB.ORBInitDebug) - dprint( "Service context data found: " + scd ) ; - - return scd ; - } - } - - if (ORB.ORBInitDebug) - dprint( "Service context data not found" ) ; - - return null ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/ServiceContexts.java b/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/ServiceContexts.java deleted file mode 100644 index ea4569b1a14..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/ServiceContexts.java +++ /dev/null @@ -1,415 +0,0 @@ -/* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.servicecontext; - -import java.lang.reflect.InvocationTargetException ; -import java.lang.reflect.Modifier ; -import java.lang.reflect.Field ; -import java.lang.reflect.Constructor ; -import java.util.*; - -import org.omg.CORBA.OctetSeqHelper; -import org.omg.CORBA.SystemException; -import org.omg.CORBA.INTERNAL; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA_2_3.portable.OutputStream ; -import org.omg.CORBA_2_3.portable.InputStream ; - -import com.sun.org.omg.SendingContext.CodeBase; - -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; - -import com.sun.corba.se.spi.orb.ORB ; - -import com.sun.corba.se.spi.logging.CORBALogDomains; - - -import com.sun.corba.se.spi.servicecontext.ServiceContext ; -import com.sun.corba.se.spi.servicecontext.ServiceContextRegistry ; -import com.sun.corba.se.spi.servicecontext.ServiceContextData ; -import com.sun.corba.se.spi.servicecontext.UnknownServiceContext ; - -import com.sun.corba.se.impl.encoding.CDRInputStream; -import com.sun.corba.se.impl.encoding.EncapsInputStream ; -import com.sun.corba.se.impl.orbutil.ORBUtility ; -import com.sun.corba.se.impl.util.Utility ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -import sun.corba.EncapsInputStreamFactory; - - -public class ServiceContexts { - private static boolean isDebugging( OutputStream os ) - { - ORB orb = (ORB)(os.orb()) ; - if (orb==null) - return false ; - return orb.serviceContextDebugFlag ; - } - - private static boolean isDebugging( InputStream is ) - { - ORB orb = (ORB)(is.orb()) ; - if (orb==null) - return false ; - return orb.serviceContextDebugFlag ; - } - - private void dprint( String msg ) - { - ORBUtility.dprint( this, msg ) ; - } - - public static void writeNullServiceContext( OutputStream os ) - { - if (isDebugging(os)) - ORBUtility.dprint( "ServiceContexts", "Writing null service context" ) ; - os.write_long( 0 ) ; - } - - /** - * Given the input stream, this fills our service - * context map. See the definition of scMap for - * details. Creates a HashMap. - * - * Note that we don't actually unmarshal the - * bytes of the service contexts here. That is - * done when they are actually requested via - * get(int). - */ - private void createMapFromInputStream(InputStream is) - { - orb = (ORB)(is.orb()) ; - if (orb.serviceContextDebugFlag) - dprint( "Constructing ServiceContexts from input stream" ) ; - - int numValid = is.read_long() ; - - if (orb.serviceContextDebugFlag) - dprint("Number of service contexts = " + numValid); - - for (int ctr = 0; ctr < numValid; ctr++) { - int scId = is.read_long(); - - if (orb.serviceContextDebugFlag) - dprint("Reading service context id " + scId); - - byte[] data = OctetSeqHelper.read(is); - - if (orb.serviceContextDebugFlag) - dprint("Service context" + scId + " length: " + data.length); - - scMap.put(new Integer(scId), data); - } - } - - public ServiceContexts( ORB orb ) - { - this.orb = orb ; - wrapper = ORBUtilSystemException.get( orb, - CORBALogDomains.RPC_PROTOCOL ) ; - - addAlignmentOnWrite = false ; - - scMap = new HashMap(); - - // Use the GIOP version of the ORB. Should - // be specified in ServiceContext. - // See REVISIT below concerning giopVersion. - giopVersion = orb.getORBData().getGIOPVersion(); - codeBase = null ; - } - - /** - * Read the Service contexts from the input stream. - */ - public ServiceContexts(InputStream s) - { - this( (ORB)(s.orb()) ) ; - - // We need to store this so that we can have access - // to the CodeBase for unmarshaling possible - // RMI-IIOP valuetype data within an encapsulation. - // (Known case: UnknownExceptionInfo) - codeBase = ((CDRInputStream)s).getCodeBase(); - - createMapFromInputStream(s); - - // Fix for bug 4904723 - giopVersion = ((CDRInputStream)s).getGIOPVersion(); - } - - /** - * Find the ServiceContextData for a given scId and unmarshal - * the bytes. - */ - private ServiceContext unmarshal(Integer scId, byte[] data) { - - ServiceContextRegistry scr = orb.getServiceContextRegistry(); - - ServiceContextData scd = scr.findServiceContextData(scId.intValue()); - ServiceContext sc = null; - - if (scd == null) { - if (orb.serviceContextDebugFlag) { - dprint("Could not find ServiceContextData for " - + scId - + " using UnknownServiceContext"); - } - - sc = new UnknownServiceContext(scId.intValue(), data); - - } else { - - if (orb.serviceContextDebugFlag) { - dprint("Found " + scd); - } - - // REVISIT. GIOP version should be specified as - // part of a service context's definition, so should - // be accessible from ServiceContextData via - // its ServiceContext implementation class. - // - // Since we don't have that, yet, I'm using the GIOP - // version of the input stream, presuming that someone - // can't send a service context of a later GIOP - // version than its stream version. - // - // Note: As of Jan 2001, no standard OMG or Sun service contexts - // ship wchar data or are defined as using anything but GIOP 1.0 CDR. - EncapsInputStream eis - = EncapsInputStreamFactory.newEncapsInputStream(orb, - data, - data.length, - giopVersion, - codeBase); - eis.consumeEndian(); - - // Now the input stream passed to a ServiceContext - // constructor is already the encapsulation input - // stream with the endianness read off, so the - // service context should just unmarshal its own - // data. - sc = scd.makeServiceContext(eis, giopVersion); - if (sc == null) - throw wrapper.svcctxUnmarshalError( - CompletionStatus.COMPLETED_MAYBE); - } - - return sc; - } - - public void addAlignmentPadding() - { - // Make service context 12 bytes longer by adding - // JAVAIDL_ALIGN_SERVICE_ID service context at end. - // The exact length - // must be >8 (minimum service context size) and - // =4 mod 8, so 12 is the minimum. - addAlignmentOnWrite = true ; - } - - /** - * Hopefully unused scid: This should be changed to a proper - * VMCID aligned value. REVISIT! - */ - private static final int JAVAIDL_ALIGN_SERVICE_ID = 0xbe1345cd ; - - /** - * Write the service contexts to the output stream. - * - * If they haven't been unmarshaled, we don't have to - * unmarshal them. - */ - public void write(OutputStream os, GIOPVersion gv) - { - if (isDebugging(os)) { - dprint( "Writing service contexts to output stream" ) ; - Utility.printStackTrace() ; - } - - int numsc = scMap.size(); - - if (addAlignmentOnWrite) { - if (isDebugging(os)) - dprint( "Adding alignment padding" ) ; - - numsc++ ; - } - - if (isDebugging(os)) - dprint( "Service context has " + numsc + " components" ) ; - - os.write_long( numsc ) ; - - writeServiceContextsInOrder(os, gv); - - if (addAlignmentOnWrite) { - if (isDebugging(os)) - dprint( "Writing alignment padding" ) ; - - os.write_long( JAVAIDL_ALIGN_SERVICE_ID ) ; - os.write_long( 4 ) ; - os.write_octet( (byte)0 ) ; - os.write_octet( (byte)0 ) ; - os.write_octet( (byte)0 ) ; - os.write_octet( (byte)0 ) ; - } - - if (isDebugging(os)) - dprint( "Service context writing complete" ) ; - } - - /** - * Write the service contexts in scMap in a desired order. - * Right now, the only special case we have is UnknownExceptionInfo, - * so I'm merely writing it last if present. - */ - private void writeServiceContextsInOrder(OutputStream os, GIOPVersion gv) { - - // Temporarily remove this rather than check it per iteration - Integer ueInfoId - = new Integer(UEInfoServiceContext.SERVICE_CONTEXT_ID); - - Object unknownExceptionInfo = scMap.remove(ueInfoId); - - Iterator iter = scMap.keySet().iterator(); - - while (iter.hasNext()) { - Integer id = (Integer)iter.next(); - - writeMapEntry(os, id, scMap.get(id), gv); - } - - // Write the UnknownExceptionInfo service context last - // (so it will be after the CodeBase) and restore it in - // the map. - if (unknownExceptionInfo != null) { - writeMapEntry(os, ueInfoId, unknownExceptionInfo, gv); - - scMap.put(ueInfoId, unknownExceptionInfo); - } - } - - /** - * Write the given entry from the scMap to the OutputStream. - * See note on giopVersion. The service context should - * know the GIOP version it is meant for. - */ - private void writeMapEntry(OutputStream os, Integer id, Object scObj, GIOPVersion gv) { - - // If it's still in byte[] form, we don't need to - // unmarshal it here, just copy the bytes into - // the new stream. - - if (scObj instanceof byte[]) { - if (isDebugging(os)) - dprint( "Writing service context bytes for id " + id); - - OctetSeqHelper.write(os, (byte[])scObj); - - } else { - - // We actually unmarshaled it into a ServiceContext - // at some point. - ServiceContext sc = (ServiceContext)scObj; - - if (isDebugging(os)) - dprint( "Writing service context " + sc ) ; - - sc.write(os, gv); - } - } - - /** Add a service context to the stream, if there is not already - * a service context in this object with the same id as sc. - */ - public void put( ServiceContext sc ) - { - Integer id = new Integer(sc.getId()); - scMap.put(id, sc); - } - - public void delete( int scId ) { - this.delete(new Integer(scId)); - } - - public void delete(Integer id) - { - scMap.remove(id) ; - } - - public ServiceContext get(int scId) { - return this.get(new Integer(scId)); - } - - public ServiceContext get(Integer id) - { - Object result = scMap.get(id); - if (result == null) - return null ; - - // Lazy unmarshaling on first use. - if (result instanceof byte[]) { - - ServiceContext sc = unmarshal(id, (byte[])result); - - scMap.put(id, sc); - - return sc; - } else { - return (ServiceContext)result; - } - } - - private ORB orb ; - - /** - * Map of all ServiceContext objects in this container. - * - * Keys are java.lang.Integers for service context IDs. - * Values are either instances of ServiceContext or the - * unmarshaled byte arrays (unmarshaled on first use). - * - * This provides a mild optimization if we don't happen to - * use a given service context, but it's main advantage is - * that it allows us to change the order in which we - * unmarshal them. We need to do the UnknownExceptionInfo service - * context after the SendingContextRunTime service context so that we can - * get the CodeBase if necessary. - */ - private Map scMap; - - /** - * If true, write out a special alignment service context to force the - * correct alignment on re-marshalling. - */ - private boolean addAlignmentOnWrite ; - - private CodeBase codeBase; - private GIOPVersion giopVersion; - private ORBUtilSystemException wrapper ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/UEInfoServiceContext.java b/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/UEInfoServiceContext.java deleted file mode 100644 index 847dfb15271..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/UEInfoServiceContext.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.servicecontext; - -import java.io.Serializable ; -import org.omg.CORBA.SystemException; -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.UNKNOWN; -import org.omg.CORBA_2_3.portable.InputStream; -import org.omg.CORBA_2_3.portable.OutputStream; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.servicecontext.ServiceContext ; - -public class UEInfoServiceContext extends ServiceContext { - public UEInfoServiceContext( Throwable ex ) - { - unknown = ex ; - } - - public UEInfoServiceContext(InputStream is, GIOPVersion gv) - { - super(is, gv) ; - - try { - unknown = (Throwable) in.read_value() ; - } catch (ThreadDeath d) { - throw d ; - } catch (Throwable e) { - unknown = new UNKNOWN( 0, CompletionStatus.COMPLETED_MAYBE ) ; - } - } - - // Required SERVICE_CONTEXT_ID and getId definitions - public static final int SERVICE_CONTEXT_ID = 9 ; - public int getId() { return SERVICE_CONTEXT_ID ; } - - public void writeData( OutputStream os ) throws SystemException - { - os.write_value( (Serializable)unknown ) ; - } - - public Throwable getUE() { return unknown ; } - - private Throwable unknown = null ; - - public String toString() - { - return "UEInfoServiceContext[ unknown=" + unknown.toString() + " ]" ; - } -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/UnknownServiceContext.java b/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/UnknownServiceContext.java deleted file mode 100644 index e814cfade64..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/UnknownServiceContext.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.servicecontext; - -import org.omg.CORBA.SystemException; -import org.omg.CORBA_2_3.portable.InputStream; -import org.omg.CORBA_2_3.portable.OutputStream; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.servicecontext.ServiceContext ; - -public class UnknownServiceContext extends ServiceContext { - public UnknownServiceContext( int id, byte[] data ) - { - this.id = id ; - this.data = data ; - } - - public UnknownServiceContext( int id, InputStream is ) - { - this.id = id ; - - int len = is.read_long(); - data = new byte[len]; - is.read_octet_array(data,0,len); - } - - public int getId() { return id ; } - - public void writeData( OutputStream os ) throws SystemException - { - } - - public void write( OutputStream os , GIOPVersion gv) - throws SystemException - { - os.write_long( id ) ; - os.write_long( data.length ) ; - os.write_octet_array( data, 0, data.length ) ; - } - - public byte[] getData() - { - return data ; - } - - private int id = -1 ; - private byte[] data = null ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaAcceptor.java b/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaAcceptor.java deleted file mode 100644 index ba6a46fbd77..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaAcceptor.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.transport; - -import com.sun.corba.se.pept.transport.Acceptor; - -import com.sun.corba.se.spi.ior.IORTemplate; - -// REVISIT - impl/poa specific: -import com.sun.corba.se.impl.oa.poa.Policies; - -/** - * @author Harold Carr - */ -public interface CorbaAcceptor - extends - Acceptor -{ - public String getObjectAdapterId(); - public String getObjectAdapterManagerId(); - public void addToIORTemplate(IORTemplate iorTemplate, Policies policies, - String codebase); - public String getMonitoringName(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaConnection.java b/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaConnection.java deleted file mode 100644 index 59bbd514076..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaConnection.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.transport; - -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.channels.SocketChannel; - -import org.omg.CORBA.SystemException; - -import com.sun.org.omg.SendingContext.CodeBase; - -import com.sun.corba.se.pept.encoding.InputObject; -import com.sun.corba.se.pept.encoding.OutputObject; -import com.sun.corba.se.pept.protocol.MessageMediator; -import com.sun.corba.se.pept.transport.Connection; -import com.sun.corba.se.pept.transport.ResponseWaitingRoom; - -import com.sun.corba.se.spi.ior.IOR ; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; - -import com.sun.corba.se.impl.encoding.CodeSetComponentInfo; -import com.sun.corba.se.impl.logging.ORBUtilSystemException; - -/** - * @author Harold Carr - */ -public interface CorbaConnection - extends - Connection, - com.sun.corba.se.spi.legacy.connection.Connection -{ - public boolean shouldUseDirectByteBuffers(); - - public boolean shouldReadGiopHeaderOnly(); - - public ByteBuffer read(int size, int offset, int length, long max_wait_time) - throws IOException; - - public ByteBuffer read(ByteBuffer byteBuffer, int offset, - int length, long max_wait_time) throws IOException; - - public void write(ByteBuffer byteBuffer) - throws IOException; - - public void dprint(String msg); - - // - // From iiop.Connection.java - // - - public int getNextRequestId(); - public ORB getBroker(); - public CodeSetComponentInfo.CodeSetContext getCodeSetContext(); - public void setCodeSetContext(CodeSetComponentInfo.CodeSetContext csc); - - // - // from iiop.IIOPConnection.java - // - - // Facade to ResponseWaitingRoom. - public MessageMediator clientRequestMapGet(int requestId); - - public void clientReply_1_1_Put(MessageMediator x); - public MessageMediator clientReply_1_1_Get(); - public void clientReply_1_1_Remove(); - - public void serverRequest_1_1_Put(MessageMediator x); - public MessageMediator serverRequest_1_1_Get(); - public void serverRequest_1_1_Remove(); - - public boolean isPostInitialContexts(); - - // Can never be unset... - public void setPostInitialContexts(); - - public void purgeCalls(SystemException systemException, - boolean die, boolean lockHeld); - - // - // Connection status - // - public static final int OPENING = 1; - public static final int ESTABLISHED = 2; - public static final int CLOSE_SENT = 3; - public static final int CLOSE_RECVD = 4; - public static final int ABORT = 5; - - // Begin Code Base methods --------------------------------------- - // - // Set this connection's code base IOR. The IOR comes from the - // SendingContext. This is an optional service context, but all - // JavaSoft ORBs send it. - // - // The set and get methods don't need to be synchronized since the - // first possible get would occur during reading a valuetype, and - // that would be after the set. - - // Sets this connection's code base IOR. This is done after - // getting the IOR out of the SendingContext service context. - // Our ORBs always send this, but it's optional in CORBA. - - void setCodeBaseIOR(IOR ior); - - IOR getCodeBaseIOR(); - - // Get a CodeBase stub to use in unmarshaling. The CachedCodeBase - // won't connect to the remote codebase unless it's necessary. - CodeBase getCodeBase(); - - // End Code Base methods ----------------------------------------- - - public void sendCloseConnection(GIOPVersion giopVersion) - throws IOException; - - public void sendMessageError(GIOPVersion giopVersion) - throws IOException; - - public void sendCancelRequest(GIOPVersion giopVersion, int requestId) - throws - IOException; - - public void sendCancelRequestWithLock(GIOPVersion giopVersion, - int requestId) - throws - IOException; - - public ResponseWaitingRoom getResponseWaitingRoom(); - - public void serverRequestMapPut(int requestId, - CorbaMessageMediator messageMediator); - public CorbaMessageMediator serverRequestMapGet(int requestId); - public void serverRequestMapRemove(int requestId); - - // REVISIT: WRONG: should not expose sockets here. - public SocketChannel getSocketChannel(); - - // REVISIT - MessageMediator parameter? - public void serverRequestProcessingBegins(); - public void serverRequestProcessingEnds(); - - /** Clean up all connection resources. Used when shutting down an ORB. - */ - public void closeConnectionResources(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaConnectionCache.java b/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaConnectionCache.java deleted file mode 100644 index 9e9915f097e..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaConnectionCache.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.transport; - -/** - * @author Harold Carr - */ -public interface CorbaConnectionCache -{ - public String getMonitoringName(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaContactInfo.java b/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaContactInfo.java deleted file mode 100644 index a5fed87585c..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaContactInfo.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.transport; - -import com.sun.corba.se.spi.ior.IOR ; -import com.sun.corba.se.spi.ior.iiop.IIOPProfile; - -import com.sun.corba.se.pept.transport.ContactInfo ; - -/** - * @author Harold Carr - */ -public interface CorbaContactInfo - extends - ContactInfo -{ - public IOR getTargetIOR(); - public IOR getEffectiveTargetIOR(); - public IIOPProfile getEffectiveProfile(); // REVISIT - type - public void setAddressingDisposition(short addressingDisposition); - public short getAddressingDisposition(); - public String getMonitoringName(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaContactInfoList.java b/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaContactInfoList.java deleted file mode 100644 index 653e36693ec..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaContactInfoList.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.transport; - -import com.sun.corba.se.spi.ior.IOR ; - -import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcher ; - -import com.sun.corba.se.pept.transport.ContactInfoList ; - -/** - * @author Harold Carr - */ -public interface CorbaContactInfoList - extends - ContactInfoList -{ - public void setTargetIOR(IOR ior); - public IOR getTargetIOR(); - - public void setEffectiveTargetIOR(IOR locatedIor); - public IOR getEffectiveTargetIOR(); - - public LocalClientRequestDispatcher getLocalClientRequestDispatcher(); - - public int hashCode(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaContactInfoListFactory.java b/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaContactInfoListFactory.java deleted file mode 100644 index 14d34943ab4..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaContactInfoListFactory.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.transport ; - -import com.sun.corba.se.spi.transport.CorbaContactInfoList ; - -import com.sun.corba.se.spi.ior.IOR ; -import com.sun.corba.se.spi.orb.ORB; - -/** Interface used to create a ContactInfoList from an IOR, as required - * for supporting CORBA semantics using the DCS framework. This is a - * natural correspondence since an IOR contains the information for - * contacting one or more communication endpoints that can be used to - * invoke a method on an object, along with the necessary information - * on particular transports, encodings, and protocols to use. - * Note that the actual implementation may support more than one - * IOR in the case of GIOP with Location Forward messages. - */ -public interface CorbaContactInfoListFactory { - /** - * This will be called after the no-arg constructor before - * create is called. - */ - public void setORB(ORB orb); - - public CorbaContactInfoList create( IOR ior ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaContactInfoListIterator.java b/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaContactInfoListIterator.java deleted file mode 100644 index ce93e69a96d..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaContactInfoListIterator.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.transport ; - -import com.sun.corba.se.pept.transport.ContactInfoListIterator ; - -import com.sun.corba.se.spi.ior.IOR; -import com.sun.corba.se.spi.transport.CorbaContactInfo; - -public interface CorbaContactInfoListIterator extends ContactInfoListIterator -{ - // REVISIT: this is GIOP specific. - public void reportAddrDispositionRetry(CorbaContactInfo contactInfo, - short disposition); - - public void reportRedirect(CorbaContactInfo contactInfo, - IOR forwardedIOR); - -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaResponseWaitingRoom.java b/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaResponseWaitingRoom.java deleted file mode 100644 index 58992c3309e..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaResponseWaitingRoom.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.transport; - -import com.sun.corba.se.pept.protocol.MessageMediator; -import com.sun.corba.se.pept.transport.ResponseWaitingRoom; -import org.omg.CORBA.SystemException; - -/** - * @author Harold Carr - */ -public interface CorbaResponseWaitingRoom - extends - ResponseWaitingRoom -{ - public void signalExceptionToAllWaiters(SystemException systemException); - - public MessageMediator getMessageMediator(int requestId); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaTransportManager.java b/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaTransportManager.java deleted file mode 100644 index 6605c366fc1..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/CorbaTransportManager.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.transport; - -import java.util.Collection; - -import com.sun.corba.se.pept.transport.TransportManager; -import com.sun.corba.se.spi.ior.IORTemplate; -import com.sun.corba.se.spi.ior.ObjectAdapterId; - -// REVISIT - impl/poa specific: -import com.sun.corba.se.impl.oa.poa.Policies; - -/** - * @author Harold Carr - */ -public interface CorbaTransportManager - extends - TransportManager -{ - public static final String SOCKET_OR_CHANNEL_CONNECTION_CACHE = - "SocketOrChannelConnectionCache"; - - public Collection getAcceptors(String objectAdapterManagerId, - ObjectAdapterId objectAdapterId); - - // REVISIT - POA specific policies - public void addToIORTemplate(IORTemplate iorTemplate, - Policies policies, - String codebase, - String objectAdapterManagerId, - ObjectAdapterId objectAdapterId); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/IIOPPrimaryToContactInfo.java b/src/java.corba/share/classes/com/sun/corba/se/spi/transport/IIOPPrimaryToContactInfo.java deleted file mode 100644 index 763fa400f9c..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/IIOPPrimaryToContactInfo.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.transport; - -import java.util.List; - -import com.sun.corba.se.pept.transport.ContactInfo; - -/** - * This interface is the "sticky manager" for IIOP failover. The default - * ORB does NOT contain a sticky manager. One is registered by supplying - * a class via the com.sun.CORBA.transport.ORBIIOPPrimaryToContactInfoClass. - * - * It uses the IIOP primary host/port (with a SocketInfo.IIOP_CLEAR_TEXT type) - * as a key to map to the last ContactInfo that resulted in successful' - * communication. - * - * It mainly prevents "fallback" - if a previously failed replica comes - * back up we do NOT want to switch back to using it - particularly in the - * case of statefull session beans. - * - * Note: This assumes static lists of replicas (e.g., AS 8.1 EE). - * This does NOT work well with LOCATION_FORWARD. - * - * @author Harold Carr - */ -public interface IIOPPrimaryToContactInfo -{ - /** - * @param primary - clear any state relating to primary. - */ - public void reset(ContactInfo primary); - - /** - * @param primary - the key. - * @param previous - if null return true. Otherwise, find previous in - * contactInfos and if another ContactInfo - * follows it in the list then return true. Otherwise false. - * @param contactInfos - the list of replicas associated with the - * primary. - */ - public boolean hasNext(ContactInfo primary, - ContactInfo previous, - List contactInfos); - - /** - * @param primary - the key. - * @param previous - if null then map primary to failover. If failover is - * empty then map primary to primary and return primary. If failover is - * non-empty then return failover. If previous is non-null that - * indicates that the previous failed. Therefore, find previous in - * contactInfos. Map the ContactInfo following - * previous to primary and return that ContactInfo. - */ - public ContactInfo next(ContactInfo primary, - ContactInfo previous, - List contactInfos); - -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/IORToSocketInfo.java b/src/java.corba/share/classes/com/sun/corba/se/spi/transport/IORToSocketInfo.java deleted file mode 100644 index 5af3a985eab..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/IORToSocketInfo.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.transport; - -import java.util.List; - -import com.sun.corba.se.spi.ior.IOR; - -public interface IORToSocketInfo -{ - /** - * Used to extract socket address information from an IOR. - * - * @param ior. - * - * @return List - a list of SocketInfo. - * - */ - public List getSocketInfo(IOR ior); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/IORTransformer.java b/src/java.corba/share/classes/com/sun/corba/se/spi/transport/IORTransformer.java deleted file mode 100644 index 13b3dce4ca1..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/IORTransformer.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.transport ; - -import com.sun.corba.se.spi.ior.IOR ; -import com.sun.corba.se.spi.encoding.CorbaInputObject ; -import com.sun.corba.se.spi.encoding.CorbaOutputObject ; - -/** Interface that provides operations to transorm an IOR - * between its programmatic representation and a representation - * in an Input or Output object. - */ -public interface IORTransformer { - IOR unmarshal( CorbaInputObject io ) ; - - void marshal( CorbaOutputObject oo, IOR ior ) ; -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/ORBSocketFactory.java b/src/java.corba/share/classes/com/sun/corba/se/spi/transport/ORBSocketFactory.java deleted file mode 100644 index 7b0bdb4e917..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/ORBSocketFactory.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.transport; - -import java.io.IOException; -import java.net.InetSocketAddress; -import java.net.Socket; -import java.net.SocketException; -import java.net.ServerSocket; - -import com.sun.corba.se.pept.transport.Acceptor; -import com.sun.corba.se.spi.orb.ORB; - -/** - * @author Harold Carr - */ -public interface ORBSocketFactory -{ - public void setORB(ORB orb); - - public ServerSocket createServerSocket(String type, - InetSocketAddress inetSocketAddress) - throws IOException; - - public Socket createSocket(String type, - InetSocketAddress inetSocketAddress) - throws IOException; - - public void setAcceptedSocketOptions(Acceptor acceptor, - ServerSocket serverSocket, - Socket socket) - throws SocketException; - -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/ReadTimeouts.java b/src/java.corba/share/classes/com/sun/corba/se/spi/transport/ReadTimeouts.java deleted file mode 100644 index a295462e837..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/ReadTimeouts.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.transport; - -public interface ReadTimeouts { - public int get_initial_time_to_wait(); - public int get_max_time_to_wait(); - public double get_backoff_factor(); - public int get_max_giop_header_time_to_wait(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/ReadTimeoutsFactory.java b/src/java.corba/share/classes/com/sun/corba/se/spi/transport/ReadTimeoutsFactory.java deleted file mode 100644 index ea203d8adcc..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/ReadTimeoutsFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.transport ; - -import com.sun.corba.se.spi.transport.ReadTimeouts; - -public interface ReadTimeoutsFactory { - // create transport read timeouts - public ReadTimeouts create(int initial_wait_time, - int max_wait_time, - int max_giop_hdr_wait_time, - int backoff_percent_factor); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/SocketInfo.java b/src/java.corba/share/classes/com/sun/corba/se/spi/transport/SocketInfo.java deleted file mode 100644 index e406f788f80..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/SocketInfo.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.transport; - -public interface SocketInfo -{ - // Endpoint types known in advance. - // If you change the value of this constant then update - // activation.idl accordingly. It has a duplicate definition - // to avoid a compilation dependency. - - public static final String IIOP_CLEAR_TEXT = "IIOP_CLEAR_TEXT"; - - - public String getType(); - - public String getHost(); - - public int getPort(); -} diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/SocketOrChannelAcceptor.java b/src/java.corba/share/classes/com/sun/corba/se/spi/transport/SocketOrChannelAcceptor.java deleted file mode 100644 index ce3b256a466..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/SocketOrChannelAcceptor.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.transport; - -import java.net.ServerSocket; - -/** - * @author Harold Carr - */ -public interface SocketOrChannelAcceptor -{ - public ServerSocket getServerSocket(); -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/TransportDefault.java b/src/java.corba/share/classes/com/sun/corba/se/spi/transport/TransportDefault.java deleted file mode 100644 index 19d9bcff081..00000000000 --- a/src/java.corba/share/classes/com/sun/corba/se/spi/transport/TransportDefault.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.transport ; - -import com.sun.corba.se.spi.protocol.CorbaClientDelegate ; -import com.sun.corba.se.spi.protocol.ClientDelegateFactory ; -import com.sun.corba.se.spi.transport.CorbaContactInfoList ; -import com.sun.corba.se.spi.transport.CorbaContactInfoListFactory ; -import com.sun.corba.se.spi.transport.ReadTimeouts; -import com.sun.corba.se.spi.transport.ReadTimeoutsFactory; -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.ior.IOR ; - -// Internal imports, not used in the interface to this package -import com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl ; -import com.sun.corba.se.impl.transport.CorbaContactInfoListImpl; -import com.sun.corba.se.impl.transport.ReadTCPTimeoutsImpl; - -/** This class provices standard building blocks for the ORB, as do all Default classes - * in the various packages. - */ -public abstract class TransportDefault { - private TransportDefault() {} - - public static CorbaContactInfoListFactory makeCorbaContactInfoListFactory( - final ORB broker ) - { - return new CorbaContactInfoListFactory() { - public void setORB(ORB orb) { } - public CorbaContactInfoList create( IOR ior ) { - return new CorbaContactInfoListImpl( - (com.sun.corba.se.spi.orb.ORB)broker, ior ) ; - } - }; - } - - public static ClientDelegateFactory makeClientDelegateFactory( - final ORB broker ) - { - return new ClientDelegateFactory() { - public CorbaClientDelegate create( CorbaContactInfoList info ) { - return new CorbaClientDelegateImpl( - (com.sun.corba.se.spi.orb.ORB)broker, info ) ; - } - }; - } - - public static IORTransformer makeIORTransformer( - final ORB broker ) - { - return null ; - } - - public static ReadTimeoutsFactory makeReadTimeoutsFactory() - { - return new ReadTimeoutsFactory() { - public ReadTimeouts create(int initial_wait_time, - int max_wait_time, - int max_giop_hdr_wait_time, - int backoff_percent_factor) - { - return new ReadTCPTimeoutsImpl( - initial_wait_time, - max_wait_time, - max_giop_hdr_wait_time, - backoff_percent_factor); - }; - }; - } -} - -// End of file. diff --git a/src/java.corba/share/classes/com/sun/jndi/cosnaming/CNBindingEnumeration.java b/src/java.corba/share/classes/com/sun/jndi/cosnaming/CNBindingEnumeration.java deleted file mode 100644 index 7c6d58de772..00000000000 --- a/src/java.corba/share/classes/com/sun/jndi/cosnaming/CNBindingEnumeration.java +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.jndi.cosnaming; - -import javax.naming.*; -import javax.naming.spi.NamingManager; - -import java.util.NoSuchElementException; -import java.util.Hashtable; - -import org.omg.CosNaming.*; - -import com.sun.jndi.toolkit.corba.CorbaUtils; - -/** - * Implements the JNDI NamingEnumeration interface for COS - * Naming. Gets hold of a list of bindings from the COS Naming Server - * and allows the client to iterate through them. - * - * @author Raj Krishnamurthy - * @author Rosanna Lee - */ - -final class CNBindingEnumeration - implements NamingEnumeration { - - private static final int DEFAULT_BATCHSIZE = 100; - private BindingListHolder _bindingList; // list of bindings - private BindingIterator _bindingIter; // iterator for getting list of bindings - private int counter; // pointer in _bindingList - private int batchsize = DEFAULT_BATCHSIZE; // how many to ask for each time - private CNCtx _ctx; // ctx to list - private Hashtable _env; // environment for getObjectInstance - private boolean more = false; // iterator done? - private boolean isLookedUpCtx = false; // iterating on a context beneath this context ? - - /** - * Creates a CNBindingEnumeration object. - * @param ctx Context to enumerate - */ - CNBindingEnumeration(CNCtx ctx, boolean isLookedUpCtx, Hashtable env) { - // Get batch size to use - String batch = (env != null ? - (String)env.get(javax.naming.Context.BATCHSIZE) : null); - if (batch != null) { - try { - batchsize = Integer.parseInt(batch); - } catch (NumberFormatException e) { - throw new IllegalArgumentException("Batch size not numeric: " + batch); - } - } - _ctx = ctx; - _ctx.incEnumCount(); - this.isLookedUpCtx = isLookedUpCtx; - _env = env; - _bindingList = new BindingListHolder(); - BindingIteratorHolder _bindingIterH = new BindingIteratorHolder(); - - // Perform listing and request that bindings be returned in _bindingIter - // Upon return,_bindingList returns a zero length list - _ctx._nc.list(0, _bindingList, _bindingIterH); - - _bindingIter = _bindingIterH.value; - - // Get first batch using _bindingIter - if (_bindingIter != null) { - more = _bindingIter.next_n(batchsize, _bindingList); - } else { - more = false; - } - counter = 0; - } - - /** - * Returns the next binding in the list. - * @exception NamingException any naming exception. - */ - - public javax.naming.Binding next() throws NamingException { - if (more && counter >= _bindingList.value.length) { - getMore(); - } - if (more && counter < _bindingList.value.length) { - org.omg.CosNaming.Binding bndg = _bindingList.value[counter]; - counter++; - return mapBinding(bndg); - } else { - throw new NoSuchElementException(); - } - } - - - /** - * Returns true or false depending on whether there are more bindings. - * @return boolean value - */ - - public boolean hasMore() throws NamingException { - // If there's more, check whether current bindingList has been exhausted, - // and if so, try to get more. - // If no more, just say so. - return more ? (counter < _bindingList.value.length || getMore()) : false; - } - - /** - * Returns true or false depending on whether there are more bindings. - * Need to define this to satisfy the Enumeration api requirement. - * @return boolean value - */ - - public boolean hasMoreElements() { - try { - return hasMore(); - } catch (NamingException e) { - return false; - } - } - - /** - * Returns the next binding in the list. - * @exception NoSuchElementException Thrown when the end of the - * list is reached. - */ - - public javax.naming.Binding nextElement() { - try { - return next(); - } catch (NamingException ne) { - throw new NoSuchElementException(); - } - } - - public void close() throws NamingException { - more = false; - if (_bindingIter != null) { - _bindingIter.destroy(); - _bindingIter = null; - } - if (_ctx != null) { - _ctx.decEnumCount(); - - /** - * context was obtained by CNCtx, the user doesn't have a handle to - * it, close it as we are done enumerating through the context - */ - if (isLookedUpCtx) { - _ctx.close(); - } - _ctx = null; - } - } - - protected void finalize() { - try { - close(); - } catch (NamingException e) { - // ignore failures - } - } - - /** - * Get the next batch using _bindingIter. Update the 'more' field. - */ - private boolean getMore() throws NamingException { - try { - more = _bindingIter.next_n(batchsize, _bindingList); - counter = 0; // reset - } catch (Exception e) { - more = false; - NamingException ne = new NamingException( - "Problem getting binding list"); - ne.setRootCause(e); - throw ne; - } - return more; - } - - /** - * Constructs a JNDI Binding object from the COS Naming binding - * object. - * @exception NameNotFound No objects under the name. - * @exception CannotProceed Unable to obtain a continuation context - * @exception InvalidName Name not understood. - * @exception NamingException One of the above. - */ - - private javax.naming.Binding mapBinding(org.omg.CosNaming.Binding bndg) - throws NamingException { - java.lang.Object obj = _ctx.callResolve(bndg.binding_name); - - Name cname = CNNameParser.cosNameToName(bndg.binding_name); - - try { - // Check whether object factory codebase is trusted - if (CorbaUtils.isObjectFactoryTrusted(obj)) { - obj = NamingManager.getObjectInstance(obj, cname, _ctx, _env); - } - } catch (NamingException e) { - throw e; - } catch (Exception e) { - NamingException ne = new NamingException( - "problem generating object using object factory"); - ne.setRootCause(e); - throw ne; - } - - // Use cname.toString() instead of bindingName because the name - // in the binding should be a composite name - String cnameStr = cname.toString(); - javax.naming.Binding jbndg = new javax.naming.Binding(cnameStr, obj); - - NameComponent[] comps = _ctx.makeFullName(bndg.binding_name); - String fullName = CNNameParser.cosNameToInsString(comps); - jbndg.setNameInNamespace(fullName); - return jbndg; - } -} diff --git a/src/java.corba/share/classes/com/sun/jndi/cosnaming/CNCtx.java b/src/java.corba/share/classes/com/sun/jndi/cosnaming/CNCtx.java deleted file mode 100644 index 82078e3f0dc..00000000000 --- a/src/java.corba/share/classes/com/sun/jndi/cosnaming/CNCtx.java +++ /dev/null @@ -1,1178 +0,0 @@ -/* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.jndi.cosnaming; - -import javax.naming.*; -import javax.naming.spi.NamingManager; -import javax.naming.spi.ResolveResult; - -import java.util.Hashtable; -import java.net.MalformedURLException; -import java.net.URL; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.BufferedReader; -import java.io.IOException; -import java.security.AccessController; -import java.security.PrivilegedAction; - -import org.omg.CosNaming.*; -import org.omg.CosNaming.NamingContextPackage.*; -import org.omg.CORBA.*; - -import com.sun.jndi.toolkit.corba.CorbaUtils; - -// Needed for creating default ORB -import java.applet.Applet; - -/** - * Provides a bridge to the CosNaming server provided by - * JavaIDL. This class provides the InitialContext from CosNaming. - * - * @author Raj Krishnamurthy - * @author Rosanna Lee - */ - -public class CNCtx implements javax.naming.Context { - - private final static boolean debug = false; - - /* - * Implement one shared ORB among all CNCtx. However, there is a public constructor - * accepting an ORB, so we need the option of using a given ORB. - */ - private static ORB _defaultOrb; - ORB _orb; // used by ExceptionMapper and RMI/IIOP factory - public NamingContext _nc; // public for accessing underlying NamingContext - - private synchronized static ORB getDefaultOrb() { - if (_defaultOrb == null) { - _defaultOrb = CorbaUtils.getOrb(null, -1, - new Hashtable()); - } - return _defaultOrb; - } - - private NameComponent[] _name = null; - - Hashtable _env; // used by ExceptionMapper - static final CNNameParser parser = new CNNameParser(); - - private static final String FED_PROP = "com.sun.jndi.cosnaming.federation"; - boolean federation = false; - - /** - * Determines whether classes may be loaded from an arbitrary URL code base. - */ - public static final boolean trustURLCodebase; - static { - // System property to control whether classes may be loaded from an - // arbitrary URL code base - PrivilegedAction act = () -> System.getProperty( - "com.sun.jndi.cosnaming.object.trustURLCodebase", "false"); - String trust = AccessController.doPrivileged(act); - trustURLCodebase = "true".equalsIgnoreCase(trust); - } - - // Reference counter for tracking _orb references - OrbReuseTracker orbTracker = null; - int enumCount; - boolean isCloseCalled = false; - - /** - * Create a CNCtx object. Gets the initial naming - * reference for the COS Naming Service from the ORB. - * The ORB can be passed in via the java.naming.corba.orb property - * or be created using properties in the environment properties. - * @param env Environment properties for initializing name service. - * @exception NamingException Cannot initialize ORB or naming context. - */ - @SuppressWarnings("unchecked") - CNCtx(Hashtable env) throws NamingException { - if (env != null) { - env = (Hashtable)env.clone(); - } - _env = (Hashtable)env; - federation = "true".equals(env != null ? env.get(FED_PROP) : null); - initOrbAndRootContext(env); - } - - private CNCtx() { - } - - /** - * This method is used by the iiop and iiopname URL Context factories. - */ - @SuppressWarnings("unchecked") - public static ResolveResult createUsingURL(String url, Hashtable env) - throws NamingException { - CNCtx ctx = new CNCtx(); - if (env != null) { - env = (Hashtable) env.clone(); - } - ctx._env = (Hashtable)env; - String rest = ctx.initUsingUrl( - env != null ? - (org.omg.CORBA.ORB) env.get("java.naming.corba.orb") - : null, - url, env); - - // rest is the INS name - // Return the parsed form to prevent subsequent lookup - // from parsing the string as a composite name - // The caller should be aware that a toString() of the name, - // which came from the environment will yield its INS syntax, - // rather than a composite syntax - return new ResolveResult(ctx, parser.parse(rest)); - } - - /** - * Creates a CNCtx object which supports the javax.naming - * apis given a COS Naming Context object. - * @param orb The ORB used by this context - * @param tracker The ORB reuse tracker for tracking references to the - * orb object - * @param nctx The COS NamingContext object associated with this context - * @param name The name of this context relative to the root - */ - - CNCtx(ORB orb, OrbReuseTracker tracker, NamingContext nctx, - Hashtable env, NameComponent[]name) - throws NamingException { - if (orb == null || nctx == null) - throw new ConfigurationException( - "Must supply ORB or NamingContext"); - if (orb != null) { - _orb = orb; - } else { - _orb = getDefaultOrb(); - } - _nc = nctx; - _env = env; - _name = name; - federation = "true".equals(env != null ? env.get(FED_PROP) : null); - } - - NameComponent[] makeFullName(NameComponent[] child) { - if (_name == null || _name.length == 0) { - return child; - } - NameComponent[] answer = new NameComponent[_name.length+child.length]; - - // parent - System.arraycopy(_name, 0, answer, 0, _name.length); - - // child - System.arraycopy(child, 0, answer, _name.length, child.length); - return answer; - } - - - public String getNameInNamespace() throws NamingException { - if (_name == null || _name.length == 0) { - return ""; - } - return CNNameParser.cosNameToInsString(_name); - } - - /** - * These are the URL schemes that need to be processed. - * IOR and corbaloc URLs can be passed directly to ORB.string_to_object() - */ - private static boolean isCorbaUrl(String url) { - return url.startsWith("iiop://") - || url.startsWith("iiopname://") - || url.startsWith("corbaname:") - ; - } - - /** - * Initializes the COS Naming Service. - * This method initializes the three instance fields: - * _nc : The root naming context. - * _orb: The ORB to use for connecting RMI/IIOP stubs and for - * getting the naming context (_nc) if one was not specified - * explicitly via PROVIDER_URL. - * _name: The name of the root naming context. - *

            - * _orb is obtained from java.naming.corba.orb if it has been set. - * Otherwise, _orb is created using the host/port from PROVIDER_URL - * (if it contains an "iiop" or "iiopname" URL), or from initialization - * properties specified in env. - *

            - * _nc is obtained from the IOR stored in PROVIDER_URL if it has been - * set and does not contain an "iiop" or "iiopname" URL. It can be - * a stringified IOR, "corbaloc" URL, "corbaname" URL, - * or a URL (such as file/http/ftp) to a location - * containing a stringified IOR. If PROVIDER_URL has not been - * set in this way, it is obtained from the result of - * ORB.resolve_initial_reference("NameService"); - *

            - * _name is obtained from the "iiop", "iiopname", or "corbaname" URL. - * It is the empty name by default. - * - * @param env Environment The possibly null environment. - * @exception NamingException When an error occurs while initializing the - * ORB or the naming context. - */ - private void initOrbAndRootContext(Hashtable env) throws NamingException { - org.omg.CORBA.ORB inOrb = null; - String ncIor = null; - - if (inOrb == null && env != null) { - inOrb = (org.omg.CORBA.ORB) env.get("java.naming.corba.orb"); - } - - if (inOrb == null) - inOrb = getDefaultOrb(); // will create a default ORB if none exists - - // Extract PROVIDER_URL from environment - String provUrl = null; - if (env != null) { - provUrl = (String)env.get(javax.naming.Context.PROVIDER_URL); - } - - if (provUrl != null && !isCorbaUrl(provUrl)) { - // Initialize the root naming context by using the IOR supplied - // in the PROVIDER_URL - ncIor = getStringifiedIor(provUrl); - setOrbAndRootContext(inOrb, ncIor); - } else if (provUrl != null) { - // Initialize the root naming context by using the URL supplied - // in the PROVIDER_URL - String insName = initUsingUrl(inOrb, provUrl, env); - - // If name supplied in URL, resolve it to a NamingContext - if (insName.length() > 0) { - _name = CNNameParser.nameToCosName(parser.parse(insName)); - try { - org.omg.CORBA.Object obj = _nc.resolve(_name); - _nc = NamingContextHelper.narrow(obj); - if (_nc == null) { - throw new ConfigurationException(insName + - " does not name a NamingContext"); - } - } catch (org.omg.CORBA.BAD_PARAM e) { - throw new ConfigurationException(insName + - " does not name a NamingContext"); - } catch (Exception e) { - throw ExceptionMapper.mapException(e, this, _name); - } - } - } else { - // No PROVIDER_URL supplied; initialize using defaults - if (debug) { - System.err.println("Getting default ORB: " + inOrb + env); - } - setOrbAndRootContext(inOrb, (String)null); - } - } - - - private String initUsingUrl(ORB orb, String url, Hashtable env) - throws NamingException { - if (url.startsWith("iiop://") || url.startsWith("iiopname://")) { - return initUsingIiopUrl(orb, url, env); - } else { - return initUsingCorbanameUrl(orb, url, env); - } - } - - /** - * Handles "iiop" and "iiopname" URLs (INS 98-10-11) - */ - private String initUsingIiopUrl(ORB defOrb, String url, Hashtable env) - throws NamingException { - - if (defOrb == null) - defOrb = getDefaultOrb(); - - try { - IiopUrl parsedUrl = new IiopUrl(url); - - NamingException savedException = null; - - for (IiopUrl.Address addr : parsedUrl.getAddresses()) { - - try { - try { - String tmpUrl = "corbaloc:iiop:" + addr.host - + ":" + addr.port + "/NameService"; - if (debug) { - System.err.println("Using url: " + tmpUrl); - } - org.omg.CORBA.Object rootCtx = - defOrb.string_to_object(tmpUrl); - setOrbAndRootContext(defOrb, rootCtx); - return parsedUrl.getStringName(); - } catch (Exception e) {} // keep going - - // Get ORB - if (debug) { - System.err.println("Getting ORB for " + addr.host - + " and port " + addr.port); - } - - // Assign to fields - setOrbAndRootContext(defOrb, (String)null); - return parsedUrl.getStringName(); - - } catch (NamingException ne) { - savedException = ne; - } - } - if (savedException != null) { - throw savedException; - } else { - throw new ConfigurationException("Problem with URL: " + url); - } - } catch (MalformedURLException e) { - throw new ConfigurationException(e.getMessage()); - } - } - - /** - * Initializes using "corbaname" URL (INS 99-12-03) - */ - private String initUsingCorbanameUrl(ORB orb, String url, Hashtable env) - throws NamingException { - - if (orb == null) - orb = getDefaultOrb(); - - try { - CorbanameUrl parsedUrl = new CorbanameUrl(url); - - String corbaloc = parsedUrl.getLocation(); - String cosName = parsedUrl.getStringName(); - - setOrbAndRootContext(orb, corbaloc); - - return parsedUrl.getStringName(); - } catch (MalformedURLException e) { - throw new ConfigurationException(e.getMessage()); - } - } - - private void setOrbAndRootContext(ORB orb, String ncIor) - throws NamingException { - _orb = orb; - try { - org.omg.CORBA.Object ncRef; - if (ncIor != null) { - if (debug) { - System.err.println("Passing to string_to_object: " + ncIor); - } - ncRef = _orb.string_to_object(ncIor); - } else { - ncRef = _orb.resolve_initial_references("NameService"); - } - if (debug) { - System.err.println("Naming Context Ref: " + ncRef); - } - _nc = NamingContextHelper.narrow(ncRef); - if (_nc == null) { - if (ncIor != null) { - throw new ConfigurationException( - "Cannot convert IOR to a NamingContext: " + ncIor); - } else { - throw new ConfigurationException( -"ORB.resolve_initial_references(\"NameService\") does not return a NamingContext"); - } - } - } catch (org.omg.CORBA.ORBPackage.InvalidName in) { - NamingException ne = - new ConfigurationException( -"COS Name Service not registered with ORB under the name 'NameService'"); - ne.setRootCause(in); - throw ne; - } catch (org.omg.CORBA.COMM_FAILURE e) { - NamingException ne = - new CommunicationException("Cannot connect to ORB"); - ne.setRootCause(e); - throw ne; - } catch (org.omg.CORBA.BAD_PARAM e) { - NamingException ne = new ConfigurationException( - "Invalid URL or IOR: " + ncIor); - ne.setRootCause(e); - throw ne; - } catch (org.omg.CORBA.INV_OBJREF e) { - NamingException ne = new ConfigurationException( - "Invalid object reference: " + ncIor); - ne.setRootCause(e); - throw ne; - } - } - - private void setOrbAndRootContext(ORB orb, org.omg.CORBA.Object ncRef) - throws NamingException { - _orb = orb; - try { - _nc = NamingContextHelper.narrow(ncRef); - if (_nc == null) { - throw new ConfigurationException( - "Cannot convert object reference to NamingContext: " + ncRef); - } - } catch (org.omg.CORBA.COMM_FAILURE e) { - NamingException ne = - new CommunicationException("Cannot connect to ORB"); - ne.setRootCause(e); - throw ne; - } - } - - private String getStringifiedIor(String url) throws NamingException { - if (url.startsWith("IOR:") || url.startsWith("corbaloc:")) { - return url; - } else { - InputStream in = null; - try { - URL u = new URL(url); - in = u.openStream(); - if (in != null) { - BufferedReader bufin = - new BufferedReader(new InputStreamReader(in, "8859_1")); - String str; - while ((str = bufin.readLine()) != null) { - if (str.startsWith("IOR:")) { - return str; - } - } - } - } catch (IOException e) { - NamingException ne = - new ConfigurationException("Invalid URL: " + url); - ne.setRootCause(e); - throw ne; - } finally { - try { - if (in != null) { - in.close(); - } - } catch (IOException e) { - NamingException ne = - new ConfigurationException("Invalid URL: " + url); - ne.setRootCause(e); - throw ne; - } - } - throw new ConfigurationException(url + " does not contain an IOR"); - } - } - - - /** - * Does the job of calling the COS Naming API, - * resolve, and performs the exception mapping. If the resolved - * object is a COS Naming Context (sub-context), then this function - * returns a new JNDI naming context object. - * @param path the NameComponent[] object. - * @exception NotFound No objects under the name. - * @exception CannotProceed Unable to obtain a continuation context - * @exception InvalidName Name not understood. - * @return Resolved object returned by the COS Name Server. - */ - java.lang.Object callResolve(NameComponent[] path) - throws NamingException { - try { - org.omg.CORBA.Object obj = _nc.resolve(path); - try { - NamingContext nc = - NamingContextHelper.narrow(obj); - if (nc != null) { - return new CNCtx(_orb, orbTracker, nc, _env, - makeFullName(path)); - } else { - return obj; - } - } catch (org.omg.CORBA.SystemException e) { - return obj; - } - } catch (Exception e) { - throw ExceptionMapper.mapException(e, this, path); - } - } - - /** - * Converts the "String" name into a CompositeName - * returns the object resolved by the COS Naming api, - * resolve. Returns the current context if the name is empty. - * Returns either an org.omg.CORBA.Object or javax.naming.Context object. - * @param name string used to resolve the object. - * @exception NamingException See callResolve. - * @return the resolved object - */ - public java.lang.Object lookup(String name) throws NamingException { - if (debug) { - System.out.println("Looking up: " + name); - } - return lookup(new CompositeName(name)); - } - - /** - * Converts the "Name" name into a NameComponent[] object and - * returns the object resolved by the COS Naming api, - * resolve. Returns the current context if the name is empty. - * Returns either an org.omg.CORBA.Object or javax.naming.Context object. - * @param name JNDI Name used to resolve the object. - * @exception NamingException See callResolve. - * @return the resolved object - */ - public java.lang.Object lookup(Name name) - throws NamingException { - if (_nc == null) - throw new ConfigurationException( - "Context does not have a corresponding NamingContext"); - if (name.size() == 0 ) - return this; // %%% should clone() so that env can be changed - NameComponent[] path = CNNameParser.nameToCosName(name); - java.lang.Object answer = null; - - try { - answer = callResolve(path); - try { - // Check whether object factory codebase is trusted - if (CorbaUtils.isObjectFactoryTrusted(answer)) { - answer = NamingManager.getObjectInstance( - answer, name, this, _env); - } - } catch (NamingException e) { - throw e; - } catch (Exception e) { - NamingException ne = new NamingException( - "problem generating object using object factory"); - ne.setRootCause(e); - throw ne; - } - } catch (CannotProceedException cpe) { - javax.naming.Context cctx = getContinuationContext(cpe); - return cctx.lookup(cpe.getRemainingName()); - } - return answer; - } - - /** - * Performs bind or rebind in the context depending on whether the - * flag rebind is set. The only objects allowed to be bound are of - * types org.omg.CORBA.Object, org.omg.CosNaming.NamingContext. - * You can use a state factory to turn other objects (such as - * Remote) into these acceptable forms. - * - * Uses the COS Naming apis bind/rebind or - * bind_context/rebind_context. - * @param pth NameComponent[] object - * @param obj Object to be bound. - * @param rebind perform rebind ? if true performs a rebind. - * @exception NotFound No objects under the name. - * @exception CannotProceed Unable to obtain a continuation context - * @exception AlreadyBound An object is already bound to this name. - */ - private void callBindOrRebind(NameComponent[] pth, Name name, - java.lang.Object obj, boolean rebind) throws NamingException { - if (_nc == null) - throw new ConfigurationException( - "Context does not have a corresponding NamingContext"); - try { - // Call state factories to convert - obj = NamingManager.getStateToBind(obj, name, this, _env); - - if (obj instanceof CNCtx) { - // Use naming context object reference - obj = ((CNCtx)obj)._nc; - } - - if ( obj instanceof org.omg.CosNaming.NamingContext) { - NamingContext nobj = - NamingContextHelper.narrow((org.omg.CORBA.Object)obj); - if (rebind) - _nc.rebind_context(pth,nobj); - else - _nc.bind_context(pth,nobj); - - } else if (obj instanceof org.omg.CORBA.Object) { - if (rebind) - _nc.rebind(pth,(org.omg.CORBA.Object)obj); - else - _nc.bind(pth,(org.omg.CORBA.Object)obj); - } - else - throw new IllegalArgumentException( - "Only instances of org.omg.CORBA.Object can be bound"); - } catch (BAD_PARAM e) { - // probably narrow() failed? - NamingException ne = new NotContextException(name.toString()); - ne.setRootCause(e); - throw ne; - } catch (Exception e) { - throw ExceptionMapper.mapException(e, this, pth); - } - } - - /** - * Converts the "Name" name into a NameComponent[] object and - * performs the bind operation. Uses callBindOrRebind. Throws an - * invalid name exception if the name is empty. We need a name to - * bind the object even when we work within the current context. - * @param name JNDI Name object - * @param obj Object to be bound. - * @exception NamingException See callBindOrRebind - */ - public void bind(Name name, java.lang.Object obj) - throws NamingException { - if (name.size() == 0 ) { - throw new InvalidNameException("Name is empty"); - } - - if (debug) { - System.out.println("Bind: " + name); - } - NameComponent[] path = CNNameParser.nameToCosName(name); - - try { - callBindOrRebind(path, name, obj, false); - } catch (CannotProceedException e) { - javax.naming.Context cctx = getContinuationContext(e); - cctx.bind(e.getRemainingName(), obj); - } - } - - static private javax.naming.Context - getContinuationContext(CannotProceedException cpe) - throws NamingException { - try { - return NamingManager.getContinuationContext(cpe); - } catch (CannotProceedException e) { - java.lang.Object resObj = e.getResolvedObj(); - if (resObj instanceof Reference) { - Reference ref = (Reference)resObj; - RefAddr addr = ref.get("nns"); - if (addr.getContent() instanceof javax.naming.Context) { - NamingException ne = new NameNotFoundException( - "No object reference bound for specified name"); - ne.setRootCause(cpe.getRootCause()); - ne.setRemainingName(cpe.getRemainingName()); - throw ne; - } - } - throw e; - } - } - - /** - * Converts the "String" name into a CompositeName object and - * performs the bind operation. Uses callBindOrRebind. Throws an - * invalid name exception if the name is empty. - * @param name string - * @param obj Object to be bound. - * @exception NamingException See callBindOrRebind - */ - public void bind(String name, java.lang.Object obj) throws NamingException { - bind(new CompositeName(name), obj); - } - - /** - * Converts the "Name" name into a NameComponent[] object and - * performs the rebind operation. Uses callBindOrRebind. Throws an - * invalid name exception if the name is empty. We must have a name - * to rebind the object to even if we are working within the current - * context. - * @param name string - * @param obj Object to be bound. - * @exception NamingException See callBindOrRebind - */ - public void rebind(Name name, java.lang.Object obj) - throws NamingException { - if (name.size() == 0 ) { - throw new InvalidNameException("Name is empty"); - } - NameComponent[] path = CNNameParser.nameToCosName(name); - try { - callBindOrRebind(path, name, obj, true); - } catch (CannotProceedException e) { - javax.naming.Context cctx = getContinuationContext(e); - cctx.rebind(e.getRemainingName(), obj); - } - } - - /** - * Converts the "String" name into a CompositeName object and - * performs the rebind operation. Uses callBindOrRebind. Throws an - * invalid name exception if the name is an empty string. - * @param name string - * @param obj Object to be bound. - * @exception NamingException See callBindOrRebind - */ - public void rebind(String name, java.lang.Object obj) - throws NamingException { - rebind(new CompositeName(name), obj); - } - - /** - * Calls the unbind api of COS Naming and uses the exception mapper - * class to map the exceptions - * @param path NameComponent[] object - * @exception NotFound No objects under the name. If leaf - * is not found, that's OK according to the JNDI spec - * @exception CannotProceed Unable to obtain a continuation context - * @exception InvalidName Name not understood. - */ - private void callUnbind(NameComponent[] path) throws NamingException { - if (_nc == null) - throw new ConfigurationException( - "Context does not have a corresponding NamingContext"); - try { - _nc.unbind(path); - } catch (NotFound e) { - // If leaf is the one missing, return success - // as per JNDI spec - - if (leafNotFound(e, path[path.length-1])) { - // do nothing - } else { - throw ExceptionMapper.mapException(e, this, path); - } - } catch (Exception e) { - throw ExceptionMapper.mapException(e, this, path); - } - } - - private boolean leafNotFound(NotFound e, NameComponent leaf) { - - // This test is not foolproof because some name servers - // always just return one component in rest_of_name - // so you might not be able to tell whether that is - // the leaf (e.g. aa/aa/aa, which one is missing?) - - NameComponent rest; - return e.why.value() == NotFoundReason._missing_node && - e.rest_of_name.length == 1 && - (rest=e.rest_of_name[0]).id.equals(leaf.id) && - (rest.kind == leaf.kind || - (rest.kind != null && rest.kind.equals(leaf.kind))); - } - - /** - * Converts the "String" name into a CompositeName object and - * performs the unbind operation. Uses callUnbind. If the name is - * empty, throws an invalid name exception. Do we unbind the - * current context (JNDI spec says work with the current context if - * the name is empty) ? - * @param name string - * @exception NamingException See callUnbind - */ - public void unbind(String name) throws NamingException { - unbind(new CompositeName(name)); - } - - /** - * Converts the "Name" name into a NameComponent[] object and - * performs the unbind operation. Uses callUnbind. Throws an - * invalid name exception if the name is empty. - * @param name string - * @exception NamingException See callUnbind - */ - public void unbind(Name name) - throws NamingException { - if (name.size() == 0 ) - throw new InvalidNameException("Name is empty"); - NameComponent[] path = CNNameParser.nameToCosName(name); - try { - callUnbind(path); - } catch (CannotProceedException e) { - javax.naming.Context cctx = getContinuationContext(e); - cctx.unbind(e.getRemainingName()); - } - } - - /** - * Renames an object. Since COS Naming does not support a rename - * api, this method unbinds the object with the "oldName" and - * creates a new binding. - * @param oldName string, existing name for the binding. - * @param newName string, name used to replace. - * @exception NamingException See bind - */ - public void rename(String oldName,String newName) - throws NamingException { - rename(new CompositeName(oldName), new CompositeName(newName)); - } - - /** - * Renames an object. Since COS Naming does not support a rename - * api, this method unbinds the object with the "oldName" and - * creates a new binding. - * @param oldName JNDI Name, existing name for the binding. - * @param newName JNDI Name, name used to replace. - * @exception NamingException See bind - */ - public void rename(Name oldName,Name newName) - throws NamingException { - if (_nc == null) - throw new ConfigurationException( - "Context does not have a corresponding NamingContext"); - if (oldName.size() == 0 || newName.size() == 0) - throw new InvalidNameException("One or both names empty"); - java.lang.Object obj = lookup(oldName); - bind(newName,obj); - unbind(oldName); - } - - /** - * Returns a NameClassEnumeration object which has a list of name - * class pairs. Lists the current context if the name is empty. - * @param name string - * @exception NamingException All exceptions thrown by lookup - * with a non-null argument - * @return a list of name-class objects as a NameClassEnumeration. - */ - public NamingEnumeration list(String name) throws NamingException { - return list(new CompositeName(name)); - } - - /** - * Returns a NameClassEnumeration object which has a list of name - * class pairs. Lists the current context if the name is empty. - * @param name JNDI Name - * @exception NamingException All exceptions thrown by lookup - * @return a list of name-class objects as a NameClassEnumeration. - */ - @SuppressWarnings("unchecked") - public NamingEnumeration list(Name name) - throws NamingException { - return (NamingEnumeration)listBindings(name); - } - - /** - * Returns a BindingEnumeration object which has a list of name - * object pairs. Lists the current context if the name is empty. - * @param name string - * @exception NamingException all exceptions returned by lookup - * @return a list of bindings as a BindingEnumeration. - */ - public NamingEnumeration listBindings(String name) - throws NamingException { - return listBindings(new CompositeName(name)); - } - - /** - * Returns a BindingEnumeration object which has a list of name - * class pairs. Lists the current context if the name is empty. - * @param name JNDI Name - * @exception NamingException all exceptions returned by lookup. - * @return a list of bindings as a BindingEnumeration. - */ - public NamingEnumeration listBindings(Name name) - throws NamingException { - if (_nc == null) - throw new ConfigurationException( - "Context does not have a corresponding NamingContext"); - if (name.size() > 0) { - try { - java.lang.Object obj = lookup(name); - if (obj instanceof CNCtx) { - return new CNBindingEnumeration( - (CNCtx) obj, true, _env); - } else { - throw new NotContextException(name.toString()); - } - } catch (NamingException ne) { - throw ne; - } catch (BAD_PARAM e) { - NamingException ne = - new NotContextException(name.toString()); - ne.setRootCause(e); - throw ne; - } - } - return new CNBindingEnumeration(this, false, _env); - } - - /** - * Calls the destroy on the COS Naming Server - * @param nc The NamingContext object to use. - * @exception NotEmpty when the context is not empty and cannot be destroyed. - */ - private void callDestroy(NamingContext nc) - throws NamingException { - if (_nc == null) - throw new ConfigurationException( - "Context does not have a corresponding NamingContext"); - try { - nc.destroy(); - } catch (Exception e) { - throw ExceptionMapper.mapException(e, this, null); - } - } - - /** - * Uses the callDestroy function to destroy the context. If name is - * empty destroys the current context. - * @param name string - * @exception OperationNotSupportedException when list is invoked - * with a non-null argument - */ - public void destroySubcontext(String name) throws NamingException { - destroySubcontext(new CompositeName(name)); - } - - /** - * Uses the callDestroy function to destroy the context. Destroys - * the current context if name is empty. - * @param name JNDI Name - * @exception OperationNotSupportedException when list is invoked - * with a non-null argument - */ - public void destroySubcontext(Name name) - throws NamingException { - if (_nc == null) - throw new ConfigurationException( - "Context does not have a corresponding NamingContext"); - NamingContext the_nc = _nc; - NameComponent[] path = CNNameParser.nameToCosName(name); - if ( name.size() > 0) { - try { - javax.naming.Context ctx = - (javax.naming.Context) callResolve(path); - CNCtx cnc = (CNCtx)ctx; - the_nc = cnc._nc; - cnc.close(); //remove the reference to the context - } catch (ClassCastException e) { - throw new NotContextException(name.toString()); - } catch (CannotProceedException e) { - javax.naming.Context cctx = getContinuationContext(e); - cctx.destroySubcontext(e.getRemainingName()); - return; - } catch (NameNotFoundException e) { - // If leaf is the one missing, return success - // as per JNDI spec - - if (e.getRootCause() instanceof NotFound && - leafNotFound((NotFound)e.getRootCause(), - path[path.length-1])) { - return; // leaf missing OK - } - throw e; - } catch (NamingException e) { - throw e; - } - } - callDestroy(the_nc); - callUnbind(path); - } - - /** - * Calls the bind_new_context COS naming api to create a new subcontext. - * @param path NameComponent[] object - * @exception NotFound No objects under the name. - * @exception CannotProceed Unable to obtain a continuation context - * @exception InvalidName Name not understood. - * @exception AlreadyBound An object is already bound to this name. - * @return the new context object. - */ - private javax.naming.Context callBindNewContext(NameComponent[] path) - throws NamingException { - if (_nc == null) - throw new ConfigurationException( - "Context does not have a corresponding NamingContext"); - try { - NamingContext nctx = _nc.bind_new_context(path); - return new CNCtx(_orb, orbTracker, nctx, _env, - makeFullName(path)); - } catch (Exception e) { - throw ExceptionMapper.mapException(e, this, path); - } - } - - /** - * Uses the callBindNewContext convenience function to create a new - * context. Throws an invalid name exception if the name is empty. - * @param name string - * @exception NamingException See callBindNewContext - * @return the new context object. - */ - public javax.naming.Context createSubcontext(String name) - throws NamingException { - return createSubcontext(new CompositeName(name)); - } - - /** - * Uses the callBindNewContext convenience function to create a new - * context. Throws an invalid name exception if the name is empty. - * @param name string - * @exception NamingException See callBindNewContext - * @return the new context object. - */ - public javax.naming.Context createSubcontext(Name name) - throws NamingException { - if (name.size() == 0 ) - throw new InvalidNameException("Name is empty"); - NameComponent[] path = CNNameParser.nameToCosName(name); - try { - return callBindNewContext(path); - } catch (CannotProceedException e) { - javax.naming.Context cctx = getContinuationContext(e); - return cctx.createSubcontext(e.getRemainingName()); - } - } - - /** - * Is mapped to resolve in the COS Naming api. - * @param name string - * @exception NamingException See lookup. - * @return the resolved object. - */ - public java.lang.Object lookupLink(String name) throws NamingException { - return lookupLink(new CompositeName(name)); - } - - /** - * Is mapped to resolve in the COS Naming api. - * @param name string - * @exception NamingException See lookup. - * @return the resolved object. - */ - public java.lang.Object lookupLink(Name name) throws NamingException { - return lookup(name); - } - - /** - * Allow access to the name parser object. - * @param name JNDI name, is ignored since there is only one Name - * Parser object. - * @exception NamingException -- - * @return NameParser object - */ - public NameParser getNameParser(String name) throws NamingException { - return parser; - } - - /** - * Allow access to the name parser object. - * @param name JNDI name, is ignored since there is only one Name - * Parser object. - * @exception NamingException -- - * @return NameParser object - */ - public NameParser getNameParser(Name name) throws NamingException { - return parser; - } - - /** - * Returns the current environment. - * @return Environment. - */ - @SuppressWarnings("unchecked") - public Hashtable getEnvironment() throws NamingException { - if (_env == null) { - return new Hashtable<>(5, 0.75f); - } else { - return (Hashtable)_env.clone(); - } - } - - public String composeName(String name, String prefix) throws NamingException { - return composeName(new CompositeName(name), - new CompositeName(prefix)).toString(); - } - - public Name composeName(Name name, Name prefix) throws NamingException { - Name result = (Name)prefix.clone(); - return result.addAll(name); - } - - /** - * Adds to the environment for the current context. - * Record change but do not reinitialize ORB. - * - * @param propName The property name. - * @param propValue The ORB. - * @return the previous value of this property if any. - */ - @SuppressWarnings("unchecked") - public java.lang.Object addToEnvironment(String propName, - java.lang.Object propValue) - throws NamingException { - if (_env == null) { - _env = new Hashtable<>(7, 0.75f); - } else { - // copy-on-write - _env = (Hashtable)_env.clone(); - } - - return _env.put(propName, propValue); - } - - // Record change but do not reinitialize ORB - @SuppressWarnings("unchecked") - public java.lang.Object removeFromEnvironment(String propName) - throws NamingException { - if (_env != null && _env.get(propName) != null) { - // copy-on-write - _env = (Hashtable)_env.clone(); - return _env.remove(propName); - } - return null; - } - - synchronized public void incEnumCount() { - enumCount++; - if (debug) { - System.out.println("incEnumCount, new count:" + enumCount); - } - } - - synchronized public void decEnumCount() - throws NamingException { - enumCount--; - if (debug) { - System.out.println("decEnumCount, new count:" + enumCount + - " isCloseCalled:" + isCloseCalled); - } - if ((enumCount == 0) && isCloseCalled) { - close(); - } - } - - synchronized public void close() throws NamingException { - - if (enumCount > 0) { - isCloseCalled = true; - return; - } - - // Never destroy an orb in CNCtx. - // The orb we have is either the shared/default orb, or one passed in to a constructor - // from elsewhere, so that orb is somebody else's responsibility. - } - - protected void finalize() { - try { - close(); - } catch (NamingException e) { - // ignore failures - } - } -} diff --git a/src/java.corba/share/classes/com/sun/jndi/cosnaming/CNCtxFactory.java b/src/java.corba/share/classes/com/sun/jndi/cosnaming/CNCtxFactory.java deleted file mode 100644 index 04bcf4d968b..00000000000 --- a/src/java.corba/share/classes/com/sun/jndi/cosnaming/CNCtxFactory.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.jndi.cosnaming; - -import javax.naming.spi.InitialContextFactory; -import javax.naming.*; - -import java.util.Hashtable; - -/** - * Implements the JNDI SPI InitialContextFactory interface used to - * create the InitialContext objects. - * - * @author Raj Krishnamurthy - */ - -public class CNCtxFactory implements InitialContextFactory { - - /** - * Creates the InitialContext object. Properties parameter should - * should contain the ORB object for the value jndi.corba.orb. - * @param env Properties object - */ - - public Context getInitialContext(Hashtable env) throws NamingException { - return new CNCtx(env); - } -} diff --git a/src/java.corba/share/classes/com/sun/jndi/cosnaming/CNNameParser.java b/src/java.corba/share/classes/com/sun/jndi/cosnaming/CNNameParser.java deleted file mode 100644 index 2b416941fc6..00000000000 --- a/src/java.corba/share/classes/com/sun/jndi/cosnaming/CNNameParser.java +++ /dev/null @@ -1,500 +0,0 @@ -/* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.jndi.cosnaming; - -import javax.naming.*; -import java.util.Properties; -import java.util.Vector; -import java.util.Enumeration; - -import org.omg.CosNaming.NameComponent; - -/** - * Parsing routines for NameParser as well as COS Naming stringified names. - * This is used by CNCtx to create a NameComponent[] object and vice versa. - * It follows Section 4.5 of Interoperable Naming Service (INS) 98-10-11. - * In summary, the stringified form is a left-to-right, forward-slash - * separated name. id and kinds are separated by '.'. backslash is the - * escape character. - * - * @author Rosanna Lee - */ - -final public class CNNameParser implements NameParser { - - private static final Properties mySyntax = new Properties(); - private static final char kindSeparator = '.'; - private static final char compSeparator = '/'; - private static final char escapeChar = '\\'; - static { - mySyntax.put("jndi.syntax.direction", "left_to_right"); - mySyntax.put("jndi.syntax.separator", ""+compSeparator); - mySyntax.put("jndi.syntax.escape", ""+escapeChar); - }; - - /** - * Constructs a new name parser for parsing names in INS syntax. - */ - public CNNameParser() { - } - - /** - * Returns a CompoundName given a string in INS syntax. - * @param name The non-null string representation of the name. - * @return a non-null CompoundName - */ - public Name parse(String name) throws NamingException { - Vector comps = insStringToStringifiedComps(name); - return new CNCompoundName(comps.elements()); - } - - /** - * Creates a NameComponent[] from a Name structure. - * Used by CNCtx to convert the input Name arg into a NameComponent[]. - * @param a CompoundName or a CompositeName; - * each component must be the stringified form of a NameComponent. - */ - static NameComponent[] nameToCosName(Name name) - throws InvalidNameException { - int len = name.size(); - if (len == 0) { - return new NameComponent[0]; - } - - NameComponent[] answer = new NameComponent[len]; - for (int i = 0; i < len; i++) { - answer[i] = parseComponent(name.get(i)); - } - return answer; - } - - /** - * Returns the INS stringified form of a NameComponent[]. - * Used by CNCtx.getNameInNamespace(), CNCompoundName.toString(). - */ - static String cosNameToInsString(NameComponent[] cname) { - StringBuilder str = new StringBuilder(); - for ( int i = 0; i < cname.length; i++) { - if ( i > 0) { - str.append(compSeparator); - } - str.append(stringifyComponent(cname[i])); - } - return str.toString(); - } - - /** - * Creates a CompositeName from a NameComponent[]. - * Used by ExceptionMapper and CNBindingEnumeration to convert - * a NameComponent[] into a composite name. - */ - static Name cosNameToName(NameComponent[] cname) { - Name nm = new CompositeName(); - for ( int i = 0; cname != null && i < cname.length; i++) { - try { - nm.add(stringifyComponent(cname[i])); - } catch (InvalidNameException e) { - // ignore - } - } - return nm; - } - - /** - * Converts an INS-syntax string name into a Vector in which - * each element of the vector contains a stringified form of - * a NameComponent. - */ - private static Vector insStringToStringifiedComps(String str) - throws InvalidNameException { - - int len = str.length(); - Vector components = new Vector<>(10); - char[] id = new char[len]; - char[] kind = new char[len]; - int idCount, kindCount; - boolean idMode; - for (int i = 0; i < len; ) { - idCount = kindCount = 0; // reset for new component - idMode = true; // always start off parsing id - while (i < len) { - if (str.charAt(i) == compSeparator) { - break; - - } else if (str.charAt(i) == escapeChar) { - if (i + 1 >= len) { - throw new InvalidNameException(str + - ": unescaped \\ at end of component"); - } else if (isMeta(str.charAt(i+1))) { - ++i; // skip escape and let meta through - if (idMode) { - id[idCount++] = str.charAt(i++); - } else { - kind[kindCount++] = str.charAt(i++); - } - } else { - throw new InvalidNameException(str + - ": invalid character being escaped"); - } - - } else if (idMode && str.charAt(i) == kindSeparator) { - // just look for the first kindSeparator - ++i; // skip kind separator - idMode = false; - - } else { - if (idMode) { - id[idCount++] = str.charAt(i++); - } else { - kind[kindCount++] = str.charAt(i++); - } - } - } - components.addElement(stringifyComponent( - new NameComponent(new String(id, 0, idCount), - new String(kind, 0, kindCount)))); - - if (i < len) { - ++i; // skip separator - } - } - - return components; - } - - /** - * Return a NameComponent given its stringified form. - */ - private static NameComponent parseComponent(String compStr) - throws InvalidNameException { - NameComponent comp = new NameComponent(); - int kindSep = -1; - int len = compStr.length(); - - int j = 0; - char[] newStr = new char[len]; - boolean escaped = false; - - // Find the kind separator - for (int i = 0; i < len && kindSep < 0; i++) { - if (escaped) { - newStr[j++] = compStr.charAt(i); - escaped = false; - } else if (compStr.charAt(i) == escapeChar) { - if (i + 1 >= len) { - throw new InvalidNameException(compStr + - ": unescaped \\ at end of component"); - } else if (isMeta(compStr.charAt(i+1))) { - escaped = true; - } else { - throw new InvalidNameException(compStr + - ": invalid character being escaped"); - } - } else if (compStr.charAt(i) == kindSeparator) { - kindSep = i; - } else { - newStr[j++] = compStr.charAt(i); - } - } - - // Set id - comp.id = new String(newStr, 0, j); - - // Set kind - if (kindSep < 0) { - comp.kind = ""; // no kind separator - } else { - // unescape kind - j = 0; - escaped = false; - for (int i = kindSep+1; i < len; i++) { - if (escaped) { - newStr[j++] = compStr.charAt(i); - escaped = false; - } else if (compStr.charAt(i) == escapeChar) { - if (i + 1 >= len) { - throw new InvalidNameException(compStr + - ": unescaped \\ at end of component"); - } else if (isMeta(compStr.charAt(i+1))) { - escaped = true; - } else { - throw new InvalidNameException(compStr + - ": invalid character being escaped"); - } - } else { - newStr[j++] = compStr.charAt(i); - } - } - comp.kind = new String(newStr, 0, j); - } - return comp; - } - - private static String stringifyComponent(NameComponent comp) { - StringBuilder one = new StringBuilder(escape(comp.id)); - if (comp.kind != null && !comp.kind.equals("")) { - one.append(kindSeparator).append(escape(comp.kind)); - } - if (one.length() == 0) { - return ""+kindSeparator; // if neither id nor kind specified - } else { - return one.toString(); - } - } - - /** - * Returns a string with '.', '\', '/' escaped. Used when - * stringifying the name into its INS stringified form. - */ - private static String escape(String str) { - if (str.indexOf(kindSeparator) < 0 && - str.indexOf(compSeparator) < 0 && - str.indexOf(escapeChar) < 0) { - return str; // no meta characters to escape - } else { - int len = str.length(); - int j = 0; - char[] newStr = new char[len+len]; - for (int i = 0; i < len; i++) { - if (isMeta(str.charAt(i))) { - newStr[j++] = escapeChar; // escape meta character - } - newStr[j++] = str.charAt(i); - } - return new String(newStr, 0, j); - } - } - - /** - * In INS, there are three meta characters: '.', '/' and '\'. - */ - private static boolean isMeta(char ch) { - switch (ch) { - case kindSeparator: - case compSeparator: - case escapeChar: - return true; - } - return false; - } - - /** - * An implementation of CompoundName that bypasses the parsing - * and stringifying code of the default CompoundName. - */ - static final class CNCompoundName extends CompoundName { - CNCompoundName(Enumeration enum_) { - super(enum_, CNNameParser.mySyntax); - } - - public Object clone() { - return new CNCompoundName(getAll()); - } - - public Name getPrefix(int posn) { - Enumeration comps = super.getPrefix(posn).getAll(); - return new CNCompoundName(comps); - } - - public Name getSuffix(int posn) { - Enumeration comps = super.getSuffix(posn).getAll(); - return new CNCompoundName(comps); - } - - public String toString() { - try { - // Convert Name to NameComponent[] then stringify - return cosNameToInsString(nameToCosName(this)); - } catch (InvalidNameException e) { - return super.toString(); - } - } - - private static final long serialVersionUID = -6599252802678482317L; - } - -// for testing only -/* - private static void print(String input) { - try { - System.out.println("\n >>>>>> input: " + input); - - System.out.println("--Compound Name: "); - NameParser parser = new CNNameParser(); - Name name = parser.parse(input); - for (int i = 0; i < name.size(); i++) { - System.out.println("\t" + i + ": " + name.get(i)); - NameComponent cp = parseComponent(name.get(i)); - System.out.println("\t\t" + "id: " + cp.id + ";kind: " + cp.kind); - } - System.out.println("\t" + name.toString()); - - System.out.println("--Composite Name: "); - Name composite = new CompositeName(input); - for (int i = 0; i < composite.size(); i++) { - System.out.println("\t" + i+": " + composite.get(i)); - } - System.out.println("\t" + composite.toString()); - - System.out.println("--Composite To NameComponent"); - NameComponent[] names = nameToCosName(composite); - for (int i = 0; i < composite.size(); i++) { - System.out.println("\t" + i+": id: " + names[i].id + "; kind: " + names[i].kind); - } - System.out.println("\t" + cosNameToInsString(names)); - } catch (NamingException e) { - System.out.println(e); - } - } - - private static void checkName(Name name, String[] comps) throws Exception { - if (name.size() != comps.length) { - throw new Exception( - "test failed; incorrect component count in " + name + "; " + - "expecting " + comps.length + " got " + name.size()); - } - for (int i = 0; i < name.size(); i++) { - if (!comps[i].equals(name.get(i))) { - throw new Exception ( - "test failed; invalid component in " + name + "; " + - "expecting '" + comps[i] + "' got '" + name.get(i) + "'"); - } - } - } - - private static void checkCompound(NameParser parser, - String input, String[] comps) throws Exception { - checkName(parser.parse(input), comps); - } - - private static void checkComposite(String input, String[] comps) - throws Exception { - checkName(new CompositeName(input), comps); - } - - private static String[] compounds = { - "a/b/c", - "a.b/c.d", - "a", - ".", - "a.", - "c.d", - ".e", - "a/x\\/y\\/z/b", - "a\\.b.c\\.d/e.f", - "a/b\\\\/c", - "x\\\\.y", - "x\\.y", - "x.\\\\y", - "x.y\\\\", - "\\\\x.y", - "a.b\\.c/d" - }; - private static String[][] compoundComps = { - {"a", "b", "c"}, - {"a.b", "c.d"}, - {"a"}, - {"."}, - {"a"}, - {"c.d"}, - {".e"}, - {"a", "x\\/y\\/z", "b"}, - {"a\\.b.c\\.d", "e.f"}, - {"a", "b\\\\", "c"}, - {"x\\\\.y"}, - {"x\\.y"}, - {"x.\\\\y"}, - {"x.y\\\\"}, - {"\\\\x.y"}, - {"a.b\\.c", "d"}, - }; - - private static String[] composites = { - "a/b/c", - "a.b/c.d", - "a", - ".", - "a.", - "c.d", - ".e", - "a/x\\\\\\/y\\\\\\/z/b", - "a\\\\.b.c\\\\.d/e.f", - "a/b\\\\\\\\/c", - "x\\\\\\.y", - "x\\\\.y", - "x.\\\\\\\\y", - "x.y\\\\\\\\", - "\\\\\\\\x.y" - }; - - private static String[][] compositeComps = { - {"a", "b", "c"}, - {"a.b", "c.d"}, - {"a"}, - {"."}, - {"a."}, // unlike compound, kind sep is not consumed - {"c.d"}, - {".e"}, - {"a", "x\\/y\\/z", "b"}, - {"a\\.b.c\\.d", "e.f"}, - {"a", "b\\\\", "c"}, - {"x\\\\.y"}, - {"x\\.y"}, - {"x.\\\\y"}, - {"x.y\\\\"}, - {"\\\\x.y"} - }; - - public static void main(String[] args) throws Exception { - if (args.length > 0) { - for (int i = 0; i < args.length; i++) { - print(args[0]); - } - } else { - print("x\\\\.y"); - print("x\\.y"); - print("x.\\\\y"); - print("x.y\\\\"); - print("\\\\x.y"); - } - - NameParser parser = new com.sun.jndi.cosnaming.CNNameParser(); - for (int i = 0; i < compounds.length; i++) { - checkCompound(parser, compounds[i], compoundComps[i]); - } - for (int i = 0; i < composites.length; i++) { - checkComposite(composites[i], compositeComps[i]); - } - - System.out.println("hardwire"); - NameComponent[] foo = new NameComponent[1]; - foo[0] = new NameComponent("foo\\", "bar"); - - System.out.println(cosNameToInsString(foo)); - System.out.println(cosNameToName(foo)); - } -*/ -} diff --git a/src/java.corba/share/classes/com/sun/jndi/cosnaming/CorbanameUrl.java b/src/java.corba/share/classes/com/sun/jndi/cosnaming/CorbanameUrl.java deleted file mode 100644 index a24044a52cb..00000000000 --- a/src/java.corba/share/classes/com/sun/jndi/cosnaming/CorbanameUrl.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.jndi.cosnaming; - -import javax.naming.Name; -import javax.naming.NamingException; - -import java.net.MalformedURLException; -import com.sun.jndi.toolkit.corba.CorbaUtils; - -/** - * Extract components of a "corbaname" URL. - * - * The format of an corbaname URL is defined in INS 99-12-03 as follows. - *

            {@code
            - * corbaname url = "corbaname:"  ["#" ]
            - * corbaloc_obj  =  ["/" ]
            - * obj_addr_list = as defined in a corbaloc URL
            - * key_string    = as defined in a corbaloc URL
            - * string_name   = stringified COS name | empty_string
            - * }
            - * Characters in {@code } are escaped as follows. - * US-ASCII alphanumeric characters are not escaped. Any characters outside - * of this range are escaped except for the following: - *
            {@code
            - *        ; / : ? @ & = + $ , - _ . ! ~ * ; ( )
            - * }
            - * Escaped characters is escaped by using a % followed by its 2 hexadecimal - * numbers representing the octet. - *

            - * The corbaname URL is parsed into two parts: a corbaloc URL and a COS name. - * The corbaloc URL is constructed by concatenation {@code "corbaloc:"} with - * {@code }. - * The COS name is {@code } with the escaped characters resolved. - *

            - * A corbaname URL is resolved by: - *

              - *
            1. Construct a corbaloc URL by concatenating {@code "corbaloc:"} and {@code }. - *
            2. Resolve the corbaloc URL to a NamingContext by using - *
              {@code
              - *     nctx = ORB.string_to_object(corbalocUrl);
              - * }
              - *
            3. Resolve {@code } in the NamingContext. - *
            - * - * @author Rosanna Lee - */ - -public final class CorbanameUrl { - private String stringName; - private String location; - - /** - * Returns a possibly empty but non-null string that is the "string_name" - * portion of the URL. - */ - public String getStringName() { - return stringName; - } - - public Name getCosName() throws NamingException { - return CNCtx.parser.parse(stringName); - } - - public String getLocation() { - return "corbaloc:" + location; - } - - public CorbanameUrl(String url) throws MalformedURLException { - - if (!url.startsWith("corbaname:")) { - throw new MalformedURLException("Invalid corbaname URL: " + url); - } - - int addrStart = 10; // "corbaname:" - - int addrEnd = url.indexOf('#', addrStart); - if (addrEnd < 0) { - addrEnd = url.length(); - stringName = ""; - } else { - stringName = CorbaUtils.decode(url.substring(addrEnd+1)); - } - location = url.substring(addrStart, addrEnd); - - int keyStart = location.indexOf('/'); - if (keyStart >= 0) { - // Has key string - if (keyStart == (location.length() -1)) { - location += "NameService"; - } - } else { - location += "/NameService"; - } - } -/* - // for testing only - public static void main(String[] args) { - try { - CorbanameUrl url = new CorbanameUrl(args[0]); - - System.out.println("location: " + url.getLocation()); - System.out.println("string name: " + url.getStringName()); - } catch (MalformedURLException e) { - e.printStackTrace(); - } - } -*/ -} diff --git a/src/java.corba/share/classes/com/sun/jndi/cosnaming/ExceptionMapper.java b/src/java.corba/share/classes/com/sun/jndi/cosnaming/ExceptionMapper.java deleted file mode 100644 index 1f626d5da0d..00000000000 --- a/src/java.corba/share/classes/com/sun/jndi/cosnaming/ExceptionMapper.java +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.jndi.cosnaming; - -import javax.naming.*; -import javax.naming.directory.*; -import javax.naming.spi.*; - -import org.omg.CosNaming.*; -import org.omg.CosNaming.NamingContextPackage.*; -import org.omg.CORBA.*; - -import com.sun.jndi.toolkit.corba.CorbaUtils; - -/** - * A convenience class to map the COS Naming exceptions to the JNDI exceptions. - * @author Raj Krishnamurthy - */ - -public final class ExceptionMapper { - private ExceptionMapper() {} // ensure no instance - private static final boolean debug = false; - - public static final NamingException mapException(Exception e, - CNCtx ctx, NameComponent[] inputName) throws NamingException { - if (e instanceof NamingException) { - return (NamingException)e; - } - - if (e instanceof RuntimeException) { - throw (RuntimeException)e; - } - - NamingException ne; - if (e instanceof NotFound) { - if (ctx.federation) { - return tryFed((NotFound)e, ctx, inputName); - - } else { - ne = new NameNotFoundException(); - } - - } else if (e instanceof CannotProceed) { - - ne = new CannotProceedException(); - NamingContext nc = ((CannotProceed) e).cxt; - NameComponent[] rest = ((CannotProceed) e).rest_of_name; - - // %%% We assume that rest returns *all* unprocessed components. - // Don't' know if that is a good assumption, given - // NotFound doesn't set rest as expected. -RL - if (inputName != null && (inputName.length > rest.length)) { - NameComponent[] resolvedName = - new NameComponent[inputName.length - rest.length]; - System.arraycopy(inputName, 0, resolvedName, 0, resolvedName.length); - // Wrap resolved NamingContext inside a CNCtx - // Guess that its name (which is relative to ctx) - // is the part of inputName minus rest_of_name - ne.setResolvedObj(new CNCtx(ctx._orb, ctx.orbTracker, nc, - ctx._env, - ctx.makeFullName(resolvedName))); - } else { - ne.setResolvedObj(ctx); - } - - ne.setRemainingName(CNNameParser.cosNameToName(rest)); - - } else if (e instanceof InvalidName) { - ne = new InvalidNameException(); - } else if (e instanceof AlreadyBound) { - ne = new NameAlreadyBoundException(); - } else if (e instanceof NotEmpty) { - ne = new ContextNotEmptyException(); - } else { - ne = new NamingException("Unknown reasons"); - } - - ne.setRootCause(e); - return ne; - } - - private static final NamingException tryFed(NotFound e, CNCtx ctx, - NameComponent[] inputName) throws NamingException { - NameComponent[] rest = e.rest_of_name; - - if (debug) { - System.out.println(e.why.value()); - System.out.println(rest.length); - } - - // %%% Using 1.2 & 1.3 Sun's tnameserv, 'rest' contains only the first - // component that failed, not *rest* as advertized. This is useless - // because what if you have something like aa/aa/aa/aa/aa. - // If one of those is not found, you get "aa" as 'rest'. - if (rest.length == 1 && inputName != null) { - // Check that we're not talking to 1.2/1.3 Sun tnameserv - NameComponent lastIn = inputName[inputName.length-1]; - if (rest[0].id.equals(lastIn.id) && - rest[0].kind != null && - rest[0].kind.equals(lastIn.kind)) { - // Might be legit - ; - } else { - // Due to 1.2/1.3 bug that always returns single-item 'rest' - NamingException ne = new NameNotFoundException(); - ne.setRemainingName(CNNameParser.cosNameToName(rest)); - ne.setRootCause(e); - throw ne; - } - } - // Fixed in 1.4; perform calculations based on correct (1.4) behavior - - // Calculate the components of the name that has been resolved - NameComponent[] resolvedName = null; - int len = 0; - if (inputName != null && (inputName.length >= rest.length)) { - - if (e.why == NotFoundReason.not_context) { - // First component of rest is found but not a context; keep it - // as part of resolved name - len = inputName.length - (rest.length - 1); - - // Remove resolved component from rest - if (rest.length == 1) { - // No more remaining - rest = null; - } else { - NameComponent[] tmp = new NameComponent[rest.length-1]; - System.arraycopy(rest, 1, tmp, 0, tmp.length); - rest = tmp; - } - } else { - len = inputName.length - rest.length; - } - - if (len > 0) { - resolvedName = new NameComponent[len]; - System.arraycopy(inputName, 0, resolvedName, 0, len); - } - } - - // Create CPE and set common fields - CannotProceedException cpe = new CannotProceedException(); - cpe.setRootCause(e); - if (rest != null && rest.length > 0) { - cpe.setRemainingName(CNNameParser.cosNameToName(rest)); - } - cpe.setEnvironment(ctx._env); - - if (debug) { - System.out.println("rest of name: " + cpe.getRemainingName()); - } - - // Lookup resolved name to get resolved object - final java.lang.Object resolvedObj = - (resolvedName != null) ? ctx.callResolve(resolvedName) : ctx; - - if (resolvedObj instanceof javax.naming.Context) { - // obj is a context and child is not found - // try getting its nns dynamically by constructing - // a Reference containing obj. - RefAddr addr = new RefAddr("nns") { - public java.lang.Object getContent() { - return resolvedObj; - } - private static final long serialVersionUID = - 669984699392133792L; - }; - Reference ref = new Reference("java.lang.Object", addr); - - // Resolved name has trailing slash to indicate nns - CompositeName cname = new CompositeName(); - cname.add(""); // add trailing slash - - cpe.setResolvedObj(ref); - cpe.setAltName(cname); - cpe.setAltNameCtx((javax.naming.Context)resolvedObj); - - return cpe; - } else { - // Not a context, use object factory to transform object. - - Name cname = CNNameParser.cosNameToName(resolvedName); - java.lang.Object resolvedObj2 = null; - try { - // Check whether object factory codebase is trusted - if (CorbaUtils.isObjectFactoryTrusted(resolvedObj)) { - resolvedObj2 = NamingManager.getObjectInstance(resolvedObj, - cname, ctx, ctx._env); - } - } catch (NamingException ge) { - throw ge; - } catch (Exception ge) { - NamingException ne = new NamingException( - "problem generating object using object factory"); - ne.setRootCause(ge); - throw ne; - } - - // If a context, continue operation with context - if (resolvedObj2 instanceof javax.naming.Context) { - cpe.setResolvedObj(resolvedObj2); - } else { - // Add trailing slash - cname.add(""); - cpe.setAltName(cname); - - // Create nns reference - final java.lang.Object rf2 = resolvedObj2; - RefAddr addr = new RefAddr("nns") { - public java.lang.Object getContent() { - return rf2; - } - private static final long serialVersionUID = - -785132553978269772L; - }; - Reference ref = new Reference("java.lang.Object", addr); - cpe.setResolvedObj(ref); - cpe.setAltNameCtx(ctx); - } - return cpe; - } - } -} diff --git a/src/java.corba/share/classes/com/sun/jndi/cosnaming/IiopUrl.java b/src/java.corba/share/classes/com/sun/jndi/cosnaming/IiopUrl.java deleted file mode 100644 index d328f52ab24..00000000000 --- a/src/java.corba/share/classes/com/sun/jndi/cosnaming/IiopUrl.java +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.jndi.cosnaming; - -import javax.naming.Name; -import javax.naming.NamingException; - -import java.net.MalformedURLException; -import java.util.Vector; -import java.util.StringTokenizer; -import com.sun.jndi.toolkit.corba.CorbaUtils; - -/** - * Extract components of an "iiop" or "iiopname" URL. - * - * The format of an iiopname URL is defined in INS 98-10-11 as follows: - * - *
            - * iiopname url = "iiopname://" [addr_list]["/" string_name]
            - * addr_list    = [address ","]* address
            - * address      = [version host [":" port]]
            - * host         = DNS style host name | IP address
            - * version      = major "." minor "@" | empty_string
            - * port         = number
            - * major        = number
            - * minor        = number
            - * string_name  = stringified name | empty_string
            - * 
            - * - * The default port is 9999. The default version is "1.0" - * US-ASCII alphanumeric characters are not escaped. Any characters outside - * of this range are escaped except for the following: - *
            {@code
            - * ; / : ? : @ & = + $ , - _ . ! ~ *  ' ( )
            - * }
            - * Escaped characters is escaped by using a % followed by its 2 hexadecimal - * numbers representing the octet. - * - * For backward compatibility, the "iiop" URL as defined in INS 97-6-6 - * is also supported: - *
            {@code
            - * iiop url     = "iiop://" [host [":" port]] ["/" string_name]
            - * }
            - * The default port is 900. - * - * @author Rosanna Lee - */ - -public final class IiopUrl { - static final private int DEFAULT_IIOPNAME_PORT = 9999; - static final private int DEFAULT_IIOP_PORT = 900; - static final private String DEFAULT_HOST = "localhost"; - private Vector
            addresses; - private String stringName; - - public static class Address { - public int port = -1; - public int major, minor; - public String host; - - public Address(String hostPortVers, boolean oldFormat) - throws MalformedURLException { - // [version host [":" port]] - int start; - - // Parse version - int at; - if (oldFormat || (at = hostPortVers.indexOf('@')) < 0) { - major = 1; - minor = 0; - start = 0; // start at the beginning - } else { - int dot = hostPortVers.indexOf('.'); - if (dot < 0) { - throw new MalformedURLException( - "invalid version: " + hostPortVers); - } - try { - major = Integer.parseInt(hostPortVers.substring(0, dot)); - minor = Integer.parseInt(hostPortVers.substring(dot+1, at)); - } catch (NumberFormatException e) { - throw new MalformedURLException( - "Nonnumeric version: " + hostPortVers); - } - start = at + 1; // skip '@' sign - } - - // Parse host and port - int slash = hostPortVers.indexOf('/', start); - if (slash < 0) { - slash = hostPortVers.length(); - } - if (hostPortVers.startsWith("[", start)) { // at IPv6 literal - int brac = hostPortVers.indexOf(']', start + 1); - if (brac < 0 || brac > slash) { - throw new IllegalArgumentException( - "IiopURL: name is an Invalid URL: " + hostPortVers); - } - - // include brackets - host = hostPortVers.substring(start, brac + 1); - start = brac + 1; - } else { // at hostname or IPv4 - int colon = hostPortVers.indexOf(':', start); - int hostEnd = (colon < 0 || colon > slash) - ? slash - : colon; - if (start < hostEnd) { - host = hostPortVers.substring(start, hostEnd); - } - start = hostEnd; // skip past host - } - if ((start + 1 < slash)) { - if ( hostPortVers.startsWith(":", start)) { // parse port - start++; // skip past ":" - port = Integer.parseInt(hostPortVers. - substring(start, slash)); - } else { - throw new IllegalArgumentException( - "IiopURL: name is an Invalid URL: " + hostPortVers); - } - } - start = slash; - if ("".equals(host) || host == null) { - host = DEFAULT_HOST ; - } - if (port == -1) { - port = (oldFormat ? DEFAULT_IIOP_PORT : - DEFAULT_IIOPNAME_PORT); - } - } - } - - public Vector
            getAddresses() { - return addresses; - } - - /** - * Returns a possibly empty but non-null string that is the "string_name" - * portion of the URL. - */ - public String getStringName() { - return stringName; - } - - public Name getCosName() throws NamingException { - return CNCtx.parser.parse(stringName); - } - - public IiopUrl(String url) throws MalformedURLException { - int addrStart; - boolean oldFormat; - - if (url.startsWith("iiopname://")) { - oldFormat = false; - addrStart = 11; - } else if (url.startsWith("iiop://")) { - oldFormat = true; - addrStart = 7; - } else { - throw new MalformedURLException("Invalid iiop/iiopname URL: " + url); - } - int addrEnd = url.indexOf('/', addrStart); - if (addrEnd < 0) { - addrEnd = url.length(); - stringName = ""; - } else { - stringName = CorbaUtils.decode(url.substring(addrEnd+1)); - } - addresses = new Vector<>(3); - if (oldFormat) { - // Only one host:port part, not multiple - addresses.addElement( - new Address(url.substring(addrStart, addrEnd), oldFormat)); - } else { - StringTokenizer tokens = - new StringTokenizer(url.substring(addrStart, addrEnd), ","); - while (tokens.hasMoreTokens()) { - addresses.addElement(new Address(tokens.nextToken(), oldFormat)); - } - if (addresses.size() == 0) { - addresses.addElement(new Address("", oldFormat)); - } - } - } - - // for testing only - /*public static void main(String[] args) { - try { - IiopUrl url = new IiopUrl(args[0]); - Vector addrs = url.getAddresses(); - String name = url.getStringName(); - - for (int i = 0; i < addrs.size(); i++) { - Address addr = (Address)addrs.elementAt(i); - System.out.println("host: " + addr.host); - System.out.println("port: " + addr.port); - System.out.println("version: " + addr.major + " " + addr.minor); - } - System.out.println("name: " + name); - } catch (MalformedURLException e) { - e.printStackTrace(); - } - } */ -} diff --git a/src/java.corba/share/classes/com/sun/jndi/cosnaming/OrbReuseTracker.java b/src/java.corba/share/classes/com/sun/jndi/cosnaming/OrbReuseTracker.java deleted file mode 100644 index 25063e73001..00000000000 --- a/src/java.corba/share/classes/com/sun/jndi/cosnaming/OrbReuseTracker.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.jndi.cosnaming; - -import org.omg.CORBA.ORB; - -/** - * This class keeps track of references to the shared ORB object - * and destroys it when no more references are made to the ORB - * object. This object is created for each ORB object that CNCtx - * creates. - */ -class OrbReuseTracker { - - int referenceCnt; - ORB orb; - - private static final boolean debug = false; - - OrbReuseTracker(ORB orb) { - this.orb = orb; - referenceCnt++; - if (debug) { - System.out.println("New OrbReuseTracker created"); - } - } - - synchronized void incRefCount() { - referenceCnt++; - if (debug) { - System.out.println("Increment orb ref count to:" + referenceCnt); - } - } - - synchronized void decRefCount() { - referenceCnt--; - if (debug) { - System.out.println("Decrement orb ref count to:" + referenceCnt); - } - if ((referenceCnt == 0)) { - if (debug) { - System.out.println("Destroying the ORB"); - } - orb.destroy(); - } - } -} diff --git a/src/java.corba/share/classes/com/sun/jndi/cosnaming/RemoteToCorba.java b/src/java.corba/share/classes/com/sun/jndi/cosnaming/RemoteToCorba.java deleted file mode 100644 index 9f8414a9573..00000000000 --- a/src/java.corba/share/classes/com/sun/jndi/cosnaming/RemoteToCorba.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.jndi.cosnaming; - -import javax.naming.*; -import javax.naming.spi.StateFactory; -import java.util.Hashtable; - -import org.omg.CORBA.ORB; - -import java.rmi.Remote; -import java.rmi.server.ExportException; - -import com.sun.jndi.toolkit.corba.CorbaUtils; // for RMI-IIOP - -/** - * StateFactory that turns java.rmi.Remote objects to org.omg.CORBA.Object. - * - * @author Rosanna Lee - */ - -public class RemoteToCorba implements StateFactory { - public RemoteToCorba() { - } - - /** - * Returns the CORBA object for a Remote object. - * If input is not a Remote object, or if Remote object uses JRMP, return null. - * If the RMI-IIOP library is not available, throw ConfigurationException. - * - * @param orig The object to turn into a CORBA object. If not Remote, - * or if is a JRMP stub or impl, return null. - * @param name Ignored - * @param ctx The non-null CNCtx whose ORB to use. - * @param env Ignored - * @return The CORBA object for {@code orig} or null. - * @exception ConfigurationException If the CORBA object cannot be obtained - * due to configuration problems, for instance, if RMI-IIOP not available. - * @exception NamingException If some other problem prevented a CORBA - * object from being obtained from the Remote object. - */ - public Object getStateToBind(Object orig, Name name, Context ctx, - Hashtable env) throws NamingException { - if (orig instanceof org.omg.CORBA.Object) { - // Already a CORBA object, just use it - return null; - } - - if (orig instanceof Remote) { - // Turn remote object into org.omg.CORBA.Object - // Returns null if JRMP; let next factory try - // CNCtx will eventually throw IllegalArgumentException if - // no CORBA object gotten - return CorbaUtils.remoteToCorba((Remote)orig, ((CNCtx)ctx)._orb); - } - return null; // pass and let next state factory try - } -} diff --git a/src/java.corba/share/classes/com/sun/jndi/cosnaming/jndiprovider.properties b/src/java.corba/share/classes/com/sun/jndi/cosnaming/jndiprovider.properties deleted file mode 100644 index 23ace2d7071..00000000000 --- a/src/java.corba/share/classes/com/sun/jndi/cosnaming/jndiprovider.properties +++ /dev/null @@ -1,4 +0,0 @@ -# Provider resource file for the COS Naming service provider. - -# State factory to turn java.rmi.Remote into org.omg.CORBA.Object. -java.naming.factory.state=com.sun.jndi.cosnaming.RemoteToCorba diff --git a/src/java.corba/share/classes/com/sun/jndi/toolkit/corba/CorbaUtils.java b/src/java.corba/share/classes/com/sun/jndi/toolkit/corba/CorbaUtils.java deleted file mode 100644 index 856ce9d24d2..00000000000 --- a/src/java.corba/share/classes/com/sun/jndi/toolkit/corba/CorbaUtils.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.jndi.toolkit.corba; - -// Needed for RMI/IIOP -import java.rmi.Remote; - -import java.rmi.RemoteException; -import java.util.Hashtable; -import java.util.Properties; -import java.util.Enumeration; -import java.applet.Applet; - -import org.omg.CORBA.ORB; - -import javax.naming.*; -import javax.rmi.CORBA.Stub; -import javax.rmi.PortableRemoteObject; - -import com.sun.jndi.cosnaming.CNCtx; - -import java.io.UnsupportedEncodingException; -import java.net.MalformedURLException; -import java.net.URLDecoder; - -/** - * Contains utilities for performing CORBA-related tasks: - * 1. Get the org.omg.CORBA.Object for a java.rmi.Remote object. - * 2. Create an ORB to use for a given host/port, and environment properties. - * ... - * - * @author Simon Nash - * @author Bryan Atsatt - */ - -public class CorbaUtils { - /** - * Returns the CORBA object reference associated with a Remote - * object by using the javax.rmi.CORBA package. - *

            - * This method effective does the following: - *

            -      * java.lang.Object stub;
            -      * try {
            -      *     stub = PortableRemoteObject.toStub(remoteObj);
            -      * } catch (Exception e) {
            -      *     throw new ConfigurationException("Object not exported or not found");
            -      * }
            -      * if (!(stub instanceof javax.rmi.CORBA.Stub)) {
            -      *     return null; // JRMP impl or JRMP stub
            -      * }
            -      * try {
            -      *     ((javax.rmi.CORBA.Stub)stub).connect(orb);  // try to connect IIOP stub
            -      * } catch (RemoteException e) {
            -      *     // ignore 'already connected' error
            -      * }
            -      * return (javax.rmi.CORBA.Stub)stub;
            -      * 
            - * - * @param remoteObj The non-null remote object for - * @param orb The non-null ORB to connect the remote object to - * @return The CORBA Object for remoteObj; null if {@code remoteObj} - * is a JRMP implementation or JRMP stub. - * @exception ConfigurationException The CORBA Object cannot be obtained - * because of configuration problems. - */ - public static org.omg.CORBA.Object remoteToCorba(Remote remoteObj, ORB orb) - throws ConfigurationException { - -// First, get remoteObj's stub - - // javax.rmi.CORBA.Stub stub = PortableRemoteObject.toStub(remoteObj); - - Remote stub; - - try { - stub = PortableRemoteObject.toStub(remoteObj); - } catch (Throwable t) { - ConfigurationException ce = new ConfigurationException( - "Problem with PortableRemoteObject.toStub(); object not exported or stub not found"); - ce.setRootCause(t); - throw ce; - } - -// Next, make sure that the stub is javax.rmi.CORBA.Stub - - if (!(stub instanceof Stub)) { - return null; // JRMP implementation or JRMP stub - } - -// Next, make sure that the stub is connected - try { - ((Stub) stub).connect(orb); - } catch (RemoteException e) { - // ignore RemoteException because stub might have already - // been connected - } catch (Throwable t) { - ConfigurationException ce = new ConfigurationException( - "Problem invoking javax.rmi.CORBA.Stub.connect()"); - ce.setRootCause(t); - throw ce; - } -// Finally, return stub - return (org.omg.CORBA.Object)stub; - } - - /** - * Get ORB using given server and port number, and properties from environment. - * - * @param server Possibly null server; if null means use default; - * For applet, it is the applet host; for app, it is localhost. - * @param port Port number, -1 means default port - * @param env Possibly null environment. Contains environment properties. - * Could contain ORB itself; or applet used for initializing ORB. - * Use all String properties from env for initializing ORB - * @return A non-null ORB. - */ - public static ORB getOrb(String server, int port, Hashtable env) { - // See if we can get info from environment - Properties orbProp; - - // Extract any org.omg.CORBA properties from environment - if (env != null) { - if (env instanceof Properties) { - // Already a Properties, just clone - orbProp = (Properties) env.clone(); - } else { - // Get all String properties - Enumeration envProp; - orbProp = new Properties(); - for (envProp = env.keys(); envProp.hasMoreElements();) { - String key = (String)envProp.nextElement(); - Object val = env.get(key); - if (val instanceof String) { - orbProp.put(key, val); - } - } - } - } else { - orbProp = new Properties(); - } - - if (server != null) { - orbProp.put("org.omg.CORBA.ORBInitialHost", server); - } - if (port >= 0) { - orbProp.put("org.omg.CORBA.ORBInitialPort", ""+port); - } - - // Get Applet from environment - if (env != null) { - @SuppressWarnings("deprecation") - Applet applet = (Applet) env.get(Context.APPLET); - if (applet != null) { - // Create ORBs using applet and orbProp - return ORB.init(applet, orbProp); - } - } - - return ORB.init(new String[0], orbProp); - } - - /** - * Check whether object factory code base is trusted. - * Classes may only be loaded from an arbitrary URL code base when - * the system property com.sun.jndi.rmi.object.trustURLCodebase - * has been set to "true". - */ - public static boolean isObjectFactoryTrusted(Object obj) - throws NamingException { - - // Extract Reference, if possible - Reference ref = null; - if (obj instanceof Reference) { - ref = (Reference) obj; - } else if (obj instanceof Referenceable) { - ref = ((Referenceable)(obj)).getReference(); - } - - if (ref != null && ref.getFactoryClassLocation() != null && - !CNCtx.trustURLCodebase) { - throw new ConfigurationException( - "The object factory is untrusted. Set the system property" + - " 'com.sun.jndi.cosnaming.object.trustURLCodebase' to 'true'."); - } - return true; - } - - /** - * Decode a URI string (according to RFC 2396). - */ - public static final String decode(String s) throws MalformedURLException { - try { - return decode(s, "8859_1"); - } catch (UnsupportedEncodingException e) { - // ISO-Latin-1 should always be available? - throw new MalformedURLException("ISO-Latin-1 decoder unavailable"); - } - } - - /** - * Decode a URI string (according to RFC 2396). - * - * Three-character sequences '%xy', where 'xy' is the two-digit - * hexadecimal representation of the lower 8-bits of a character, - * are decoded into the character itself. - * - * The string is subsequently converted using the specified encoding - */ - public static final String decode(String s, String enc) - throws MalformedURLException, UnsupportedEncodingException { - try { - return URLDecoder.decode(s, enc); - } catch (IllegalArgumentException iae) { - MalformedURLException mue = new MalformedURLException("Invalid URI encoding: " + s); - mue.initCause(iae); - throw mue; - } - } - -} diff --git a/src/java.corba/share/classes/com/sun/jndi/url/corbaname/corbanameURLContextFactory.java b/src/java.corba/share/classes/com/sun/jndi/url/corbaname/corbanameURLContextFactory.java deleted file mode 100644 index f5df93a13de..00000000000 --- a/src/java.corba/share/classes/com/sun/jndi/url/corbaname/corbanameURLContextFactory.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.jndi.url.corbaname; - -import com.sun.jndi.url.iiop.iiopURLContextFactory; - -/** - * A corbaname URL context factory. - * It just uses the iiop URL context factory but is needed here - * so that NamingManager.getURLContext() will find it. - * - * @author Rosanna Lee - */ -final public class corbanameURLContextFactory extends iiopURLContextFactory { -} diff --git a/src/java.corba/share/classes/com/sun/jndi/url/iiop/GenericURLContext.java b/src/java.corba/share/classes/com/sun/jndi/url/iiop/GenericURLContext.java deleted file mode 100644 index 1c78b925637..00000000000 --- a/src/java.corba/share/classes/com/sun/jndi/url/iiop/GenericURLContext.java +++ /dev/null @@ -1,537 +0,0 @@ -/* - * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.jndi.url.iiop; - -import com.sun.jndi.toolkit.corba.CorbaUtils; - -import javax.naming.*; -import javax.naming.spi.ResolveResult; -import javax.naming.spi.NamingManager; - -import java.util.Hashtable; -import java.net.MalformedURLException; - -/** - * This abstract class is a generic URL context that accepts as the - * name argument either a string URL or a Name whose first component - * is a URL. It resolves the URL to a target context and then continues - * the operation using the remaining name in the target context as if - * the first component names a junction. - * - * A subclass must define getRootURLContext() - * to process the URL into head/tail pieces. If it wants to control how - * URL strings are parsed and compared for the rename() operation, then - * it should override getNonRootURLSuffixes() and urlEquals(). - * - * @author Scott Seligman - * @author Rosanna Lee - */ -abstract public class GenericURLContext implements Context { - protected Hashtable myEnv = null; - - @SuppressWarnings("unchecked") // Expect Hashtable - public GenericURLContext(Hashtable env) { - // context that is not tied to any specific URL - myEnv = - (Hashtable)(env == null ? null : env.clone()); - } - - public void close() throws NamingException { - myEnv = null; - } - - public String getNameInNamespace() throws NamingException { - return ""; // %%% check this out: A URL context's name is "" - } - - /** - * Resolves 'name' into a target context with remaining name. - * For example, with a JNDI URL "jndi://dnsname/rest_name", - * this method resolves "jndi://dnsname/" to a target context, - * and returns the target context with "rest_name". - * The definition of "root URL" and how much of the URL to - * consume is implementation specific. - * If rename() is supported for a particular URL scheme, - * getRootURLContext(), getURLPrefix(), and getURLSuffix() - * must be in sync wrt how URLs are parsed and returned. - */ - abstract protected ResolveResult getRootURLContext(String url, - Hashtable env) throws NamingException; - - /** - * Returns the suffix of the url. The result should be identical to - * that of calling getRootURLContext().getRemainingName(), but - * without the overhead of doing anything with the prefix like - * creating a context. - *

            - * This method returns a Name instead of a String because to give - * the provider an opportunity to return a Name (for example, - * for weakly separated naming systems like COS naming). - *

            - * The default implementation uses skips 'prefix', calls - * CorbaUtils.decode() on it, and returns the result as a single component - * CompositeName. - * Subclass should override if this is not appropriate. - * This method is used only by rename(). - * If rename() is supported for a particular URL scheme, - * getRootURLContext(), getURLPrefix(), and getURLSuffix() - * must be in sync wrt how URLs are parsed and returned. - *

            - * For many URL schemes, this method is very similar to URL.getFile(), - * except getFile() will return a leading slash in the - * 2nd, 3rd, and 4th cases. For schemes like "ldap" and "iiop", - * the leading slash must be skipped before the name is an acceptable - * format for operation by the Context methods. For schemes that treat the - * leading slash as significant (such as "file"), - * the subclass must override getURLSuffix() to get the correct behavior. - * Remember, the behavior must match getRootURLContext(). - * - *

            {@code
            -     * URL                                     Suffix
            -     * foo://host:port                         
            -     * foo://host:port/rest/of/name            rest/of/name
            -     * foo:///rest/of/name                     rest/of/name
            -     * foo:/rest/of/name                       rest/of/name
            -     * foo:rest/of/name                        rest/of/name
            -     * }
            - */ - protected Name getURLSuffix(String prefix, String url) throws NamingException { - String suffix = url.substring(prefix.length()); - if (suffix.length() == 0) { - return new CompositeName(); - } - - if (suffix.charAt(0) == '/') { - suffix = suffix.substring(1); // skip leading slash - } - - try { - return new CompositeName().add(CorbaUtils.decode(suffix)); - } catch (MalformedURLException e) { - throw new InvalidNameException(e.getMessage()); - } - } - - /** - * Finds the prefix of a URL. - * Default implementation looks for slashes and then extracts - * prefixes using String.substring(). - * Subclass should override if this is not appropriate. - * This method is used only by rename(). - * If rename() is supported for a particular URL scheme, - * getRootURLContext(), getURLPrefix(), and getURLSuffix() - * must be in sync wrt how URLs are parsed and returned. - *

            - * URL Prefix - * foo://host:port foo://host:port - * foo://host:port/rest/of/name foo://host:port - * foo:///rest/of/name foo:// - * foo:/rest/of/name foo: - * foo:rest/of/name foo: - */ - protected String getURLPrefix(String url) throws NamingException { - int start = url.indexOf(':'); - - if (start < 0) { - throw new OperationNotSupportedException("Invalid URL: " + url); - } - ++start; // skip ':' - - if (url.startsWith("//", start)) { - start += 2; // skip double slash - - // find last slash - int posn = url.indexOf('/', start); - if (posn >= 0) { - start = posn; - } else { - start = url.length(); // rest of URL - } - } - - // else 0 or 1 initial slashes; start is unchanged - return url.substring(0, start); - } - - /** - * Determines whether two URLs are the same. - * Default implementation uses String.equals(). - * Subclass should override if this is not appropriate. - * This method is used by rename(). - */ - protected boolean urlEquals(String url1, String url2) { - return url1.equals(url2); - } - - /** - * Gets the context in which to continue the operation. This method - * is called when this context is asked to process a multicomponent - * Name in which the first component is a URL. - * Treat the first component like a junction: resolve it and then use - * NamingManager.getContinuationContext() to get the target context in - * which to operate on the remainder of the name (n.getSuffix(1)). - */ - protected Context getContinuationContext(Name n) throws NamingException { - Object obj = lookup(n.get(0)); - CannotProceedException cpe = new CannotProceedException(); - cpe.setResolvedObj(obj); - cpe.setEnvironment(myEnv); - return NamingManager.getContinuationContext(cpe); - } - - public Object lookup(String name) throws NamingException { - ResolveResult res = getRootURLContext(name, myEnv); - Context ctx = (Context)res.getResolvedObj(); - try { - return ctx.lookup(res.getRemainingName()); - } finally { - ctx.close(); - } - } - - public Object lookup(Name name) throws NamingException { - if (name.size() == 1) { - return lookup(name.get(0)); - } else { - Context ctx = getContinuationContext(name); - try { - return ctx.lookup(name.getSuffix(1)); - } finally { - ctx.close(); - } - } - } - - public void bind(String name, Object obj) throws NamingException { - ResolveResult res = getRootURLContext(name, myEnv); - Context ctx = (Context)res.getResolvedObj(); - try { - ctx.bind(res.getRemainingName(), obj); - } finally { - ctx.close(); - } - } - - public void bind(Name name, Object obj) throws NamingException { - if (name.size() == 1) { - bind(name.get(0), obj); - } else { - Context ctx = getContinuationContext(name); - try { - ctx.bind(name.getSuffix(1), obj); - } finally { - ctx.close(); - } - } - } - - public void rebind(String name, Object obj) throws NamingException { - ResolveResult res = getRootURLContext(name, myEnv); - Context ctx = (Context)res.getResolvedObj(); - try { - ctx.rebind(res.getRemainingName(), obj); - } finally { - ctx.close(); - } - } - - public void rebind(Name name, Object obj) throws NamingException { - if (name.size() == 1) { - rebind(name.get(0), obj); - } else { - Context ctx = getContinuationContext(name); - try { - ctx.rebind(name.getSuffix(1), obj); - } finally { - ctx.close(); - } - } - } - - public void unbind(String name) throws NamingException { - ResolveResult res = getRootURLContext(name, myEnv); - Context ctx = (Context)res.getResolvedObj(); - try { - ctx.unbind(res.getRemainingName()); - } finally { - ctx.close(); - } - } - - public void unbind(Name name) throws NamingException { - if (name.size() == 1) { - unbind(name.get(0)); - } else { - Context ctx = getContinuationContext(name); - try { - ctx.unbind(name.getSuffix(1)); - } finally { - ctx.close(); - } - } - } - - public void rename(String oldName, String newName) throws NamingException { - String oldPrefix = getURLPrefix(oldName); - String newPrefix = getURLPrefix(newName); - if (!urlEquals(oldPrefix, newPrefix)) { - throw new OperationNotSupportedException( - "Renaming using different URL prefixes not supported : " + - oldName + " " + newName); - } - - ResolveResult res = getRootURLContext(oldName, myEnv); - Context ctx = (Context)res.getResolvedObj(); - try { - ctx.rename(res.getRemainingName(), getURLSuffix(newPrefix, newName)); - } finally { - ctx.close(); - } - } - - public void rename(Name name, Name newName) throws NamingException { - if (name.size() == 1) { - if (newName.size() != 1) { - throw new OperationNotSupportedException( - "Renaming to a Name with more components not supported: " + newName); - } - rename(name.get(0), newName.get(0)); - } else { - // > 1 component with 1st one being URL - // URLs must be identical; cannot deal with diff URLs - if (!urlEquals(name.get(0), newName.get(0))) { - throw new OperationNotSupportedException( - "Renaming using different URLs as first components not supported: " + - name + " " + newName); - } - - Context ctx = getContinuationContext(name); - try { - ctx.rename(name.getSuffix(1), newName.getSuffix(1)); - } finally { - ctx.close(); - } - } - } - - public NamingEnumeration list(String name) throws NamingException { - ResolveResult res = getRootURLContext(name, myEnv); - Context ctx = (Context)res.getResolvedObj(); - try { - return ctx.list(res.getRemainingName()); - } finally { - ctx.close(); - } - } - - public NamingEnumeration list(Name name) throws NamingException { - if (name.size() == 1) { - return list(name.get(0)); - } else { - Context ctx = getContinuationContext(name); - try { - return ctx.list(name.getSuffix(1)); - } finally { - ctx.close(); - } - } - } - - public NamingEnumeration listBindings(String name) - throws NamingException { - ResolveResult res = getRootURLContext(name, myEnv); - Context ctx = (Context)res.getResolvedObj(); - try { - return ctx.listBindings(res.getRemainingName()); - } finally { - ctx.close(); - } - } - - public NamingEnumeration listBindings(Name name) throws NamingException { - if (name.size() == 1) { - return listBindings(name.get(0)); - } else { - Context ctx = getContinuationContext(name); - try { - return ctx.listBindings(name.getSuffix(1)); - } finally { - ctx.close(); - } - } - } - - public void destroySubcontext(String name) throws NamingException { - ResolveResult res = getRootURLContext(name, myEnv); - Context ctx = (Context)res.getResolvedObj(); - try { - ctx.destroySubcontext(res.getRemainingName()); - } finally { - ctx.close(); - } - } - - public void destroySubcontext(Name name) throws NamingException { - if (name.size() == 1) { - destroySubcontext(name.get(0)); - } else { - Context ctx = getContinuationContext(name); - try { - ctx.destroySubcontext(name.getSuffix(1)); - } finally { - ctx.close(); - } - } - } - - public Context createSubcontext(String name) throws NamingException { - ResolveResult res = getRootURLContext(name, myEnv); - Context ctx = (Context)res.getResolvedObj(); - try { - return ctx.createSubcontext(res.getRemainingName()); - } finally { - ctx.close(); - } - } - - public Context createSubcontext(Name name) throws NamingException { - if (name.size() == 1) { - return createSubcontext(name.get(0)); - } else { - Context ctx = getContinuationContext(name); - try { - return ctx.createSubcontext(name.getSuffix(1)); - } finally { - ctx.close(); - } - } - } - - public Object lookupLink(String name) throws NamingException { - ResolveResult res = getRootURLContext(name, myEnv); - Context ctx = (Context)res.getResolvedObj(); - try { - return ctx.lookupLink(res.getRemainingName()); - } finally { - ctx.close(); - } - } - - public Object lookupLink(Name name) throws NamingException { - if (name.size() == 1) { - return lookupLink(name.get(0)); - } else { - Context ctx = getContinuationContext(name); - try { - return ctx.lookupLink(name.getSuffix(1)); - } finally { - ctx.close(); - } - } - } - - public NameParser getNameParser(String name) throws NamingException { - ResolveResult res = getRootURLContext(name, myEnv); - Context ctx = (Context)res.getResolvedObj(); - try { - return ctx.getNameParser(res.getRemainingName()); - } finally { - ctx.close(); - } - } - - public NameParser getNameParser(Name name) throws NamingException { - if (name.size() == 1) { - return getNameParser(name.get(0)); - } else { - Context ctx = getContinuationContext(name); - try { - return ctx.getNameParser(name.getSuffix(1)); - } finally { - ctx.close(); - } - } - } - - public String composeName(String name, String prefix) - throws NamingException { - if (prefix.equals("")) { - return name; - } else if (name.equals("")) { - return prefix; - } else { - return (prefix + "/" + name); - } - } - - public Name composeName(Name name, Name prefix) throws NamingException { - Name result = (Name)prefix.clone(); - result.addAll(name); - return result; - } - - public Object removeFromEnvironment(String propName) - throws NamingException { - if (myEnv == null) { - return null; - } - return myEnv.remove(propName); - } - - public Object addToEnvironment(String propName, Object propVal) - throws NamingException { - if (myEnv == null) { - myEnv = new Hashtable(11, 0.75f); - } - return myEnv.put(propName, propVal); - } - - @SuppressWarnings("unchecked") // clone() - public Hashtable getEnvironment() throws NamingException { - if (myEnv == null) { - return new Hashtable<>(5, 0.75f); - } else { - return (Hashtable)myEnv.clone(); - } - } - -/* -// To test, declare getURLPrefix and getURLSuffix static. - - public static void main(String[] args) throws Exception { - String[] tests = {"file://host:port", - "file:///rest/of/name", - "file://host:port/rest/of/name", - "file:/rest/of/name", - "file:rest/of/name"}; - for (int i = 0; i < tests.length; i++) { - String pre = getURLPrefix(tests[i]); - System.out.println(pre); - System.out.println(getURLSuffix(pre, tests[i])); - } - } -*/ -} diff --git a/src/java.corba/share/classes/com/sun/jndi/url/iiop/iiopURLContext.java b/src/java.corba/share/classes/com/sun/jndi/url/iiop/iiopURLContext.java deleted file mode 100644 index 2f83f4aaa41..00000000000 --- a/src/java.corba/share/classes/com/sun/jndi/url/iiop/iiopURLContext.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.jndi.url.iiop; - -import javax.naming.spi.ResolveResult; -import javax.naming.*; -import java.util.Hashtable; -import java.net.MalformedURLException; - -import com.sun.jndi.cosnaming.IiopUrl; -import com.sun.jndi.cosnaming.CorbanameUrl; - -/** - * An IIOP URL context. - * - * @author Rosanna Lee - */ - -public class iiopURLContext - extends GenericURLContext { - - iiopURLContext(Hashtable env) { - super(env); - } - - /** - * Resolves 'name' into a target context with remaining name. - * It only resolves the hostname/port number. The remaining name - * contains the rest of the name found in the URL. - * - * For example, with a iiop URL "iiop://localhost:900/rest/of/name", - * this method resolves "iiop://localhost:900/" to the "NameService" - * context on for the ORB at 'localhost' on port 900, - * and returns as the remaining name "rest/of/name". - */ - protected ResolveResult getRootURLContext(String name, Hashtable env) - throws NamingException { - return iiopURLContextFactory.getUsingURLIgnoreRest(name, env); - } - - /** - * Return the suffix of an "iiop", "iiopname", or "corbaname" url. - * prefix parameter is ignored. - */ - protected Name getURLSuffix(String prefix, String url) - throws NamingException { - try { - if (url.startsWith("iiop://") || url.startsWith("iiopname://")) { - IiopUrl parsedUrl = new IiopUrl(url); - return parsedUrl.getCosName(); - } else if (url.startsWith("corbaname:")) { - CorbanameUrl parsedUrl = new CorbanameUrl(url); - return parsedUrl.getCosName(); - } else { - throw new MalformedURLException("Not a valid URL: " + url); - } - } catch (MalformedURLException e) { - throw new InvalidNameException(e.getMessage()); - } - } -} diff --git a/src/java.corba/share/classes/com/sun/jndi/url/iiop/iiopURLContextFactory.java b/src/java.corba/share/classes/com/sun/jndi/url/iiop/iiopURLContextFactory.java deleted file mode 100644 index 1371581a728..00000000000 --- a/src/java.corba/share/classes/com/sun/jndi/url/iiop/iiopURLContextFactory.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.jndi.url.iiop; - -import javax.naming.*; -import javax.naming.spi.*; - -import java.util.Hashtable; - -import com.sun.jndi.cosnaming.CNCtx; - -/** - * An IIOP URL context factory. - * - * @author Rosanna Lee - */ - -public class iiopURLContextFactory implements ObjectFactory { - - public Object getObjectInstance(Object urlInfo, Name name, Context nameCtx, - Hashtable env) throws Exception { - -//System.out.println("iiopURLContextFactory " + urlInfo); - if (urlInfo == null) { - return new iiopURLContext(env); - } - if (urlInfo instanceof String) { - return getUsingURL((String)urlInfo, env); - } else if (urlInfo instanceof String[]) { - return getUsingURLs((String[])urlInfo, env); - } else { - throw (new IllegalArgumentException( - "iiopURLContextFactory.getObjectInstance: " + - "argument must be a URL String or array of URLs")); - } - } - - /** - * Resolves 'name' into a target context with remaining name. - * It only resolves the hostname/port number. The remaining name - * contains the rest of the name found in the URL. - * - * For example, with a iiop URL "iiop://localhost:900/rest/of/name", - * this method resolves "iiop://localhost:900/" to the "NameService" - * context on for the ORB at 'localhost' on port 900, - * and returns as the remaining name "rest/of/name". - */ - static ResolveResult getUsingURLIgnoreRest(String url, Hashtable env) - throws NamingException { - return CNCtx.createUsingURL(url, env); - } - - private static Object getUsingURL(String url, Hashtable env) - throws NamingException { - ResolveResult res = getUsingURLIgnoreRest(url, env); - - Context ctx = (Context)res.getResolvedObj(); - try { - return ctx.lookup(res.getRemainingName()); - } finally { - ctx.close(); - } - } - - private static Object getUsingURLs(String[] urls, Hashtable env) { - for (int i = 0; i < urls.length; i++) { - String url = urls[i]; - try { - Object obj = getUsingURL(url, env); - if (obj != null) { - return obj; - } - } catch (NamingException e) { - } - } - return null; // %%% exception?? - } -} diff --git a/src/java.corba/share/classes/com/sun/jndi/url/iiopname/iiopnameURLContextFactory.java b/src/java.corba/share/classes/com/sun/jndi/url/iiopname/iiopnameURLContextFactory.java deleted file mode 100644 index 76e32cff0a2..00000000000 --- a/src/java.corba/share/classes/com/sun/jndi/url/iiopname/iiopnameURLContextFactory.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.jndi.url.iiopname; - -import com.sun.jndi.url.iiop.iiopURLContextFactory; - -/** - * An iiopname URL context factory. - * It just uses the iiop URL context factory but is needed here - * so that NamingManager.getURLContext() will find it. - * - * @author Rosanna Lee - */ -final public class iiopnameURLContextFactory extends iiopURLContextFactory { -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/AttrDescriptionSeqHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/AttrDescriptionSeqHelper.java deleted file mode 100644 index 2367e1ab935..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/AttrDescriptionSeqHelper.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/AttrDescriptionSeqHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:51 AM PDT -*/ - -public final class AttrDescriptionSeqHelper -{ - private static String _id = "IDL:omg.org/CORBA/AttrDescriptionSeq:1.0"; - - public AttrDescriptionSeqHelper() - { - } - - public static void insert (org.omg.CORBA.Any a, com.sun.org.omg.CORBA.AttributeDescription[] that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static com.sun.org.omg.CORBA.AttributeDescription[] extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = com.sun.org.omg.CORBA.AttributeDescriptionHelper.type (); - __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.AttrDescriptionSeqHelper.id (), "AttrDescriptionSeq", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static com.sun.org.omg.CORBA.AttributeDescription[] read (org.omg.CORBA.portable.InputStream istream) - { - com.sun.org.omg.CORBA.AttributeDescription value[] = null; - int _len0 = istream.read_long (); - value = new com.sun.org.omg.CORBA.AttributeDescription[_len0]; - for (int _o1 = 0;_o1 < value.length; ++_o1) - value[_o1] = com.sun.org.omg.CORBA.AttributeDescriptionHelper.read (istream); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.org.omg.CORBA.AttributeDescription[] value) - { - ostream.write_long (value.length); - for (int _i0 = 0;_i0 < value.length; ++_i0) - com.sun.org.omg.CORBA.AttributeDescriptionHelper.write (ostream, value[_i0]); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/AttributeDescription.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/AttributeDescription.java deleted file mode 100644 index 3d0bf5a3213..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/AttributeDescription.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/AttributeDescription.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:50 AM PDT -*/ - -public final class AttributeDescription implements org.omg.CORBA.portable.IDLEntity -{ - public String name = null; - public String id = null; - public String defined_in = null; - public String version = null; - public org.omg.CORBA.TypeCode type = null; - public com.sun.org.omg.CORBA.AttributeMode mode = null; - - public AttributeDescription () - { - } // ctor - - public AttributeDescription (String _name, String _id, String _defined_in, String _version, org.omg.CORBA.TypeCode _type, com.sun.org.omg.CORBA.AttributeMode _mode) - { - name = _name; - id = _id; - defined_in = _defined_in; - version = _version; - type = _type; - mode = _mode; - } // ctor - -} // class AttributeDescription diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/AttributeDescriptionHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/AttributeDescriptionHelper.java deleted file mode 100644 index 66ad04bb09c..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/AttributeDescriptionHelper.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/AttributeDescriptionHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:50 AM PDT -*/ - -public final class AttributeDescriptionHelper -{ - private static String _id = "IDL:omg.org/CORBA/AttributeDescription:1.0"; - - public AttributeDescriptionHelper() - { - } - - public static void insert (org.omg.CORBA.Any a, com.sun.org.omg.CORBA.AttributeDescription that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static com.sun.org.omg.CORBA.AttributeDescription extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - private static boolean __active = false; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - synchronized (org.omg.CORBA.TypeCode.class) - { - if (__typeCode == null) - { - if (__active) - { - return org.omg.CORBA.ORB.init().create_recursive_tc ( _id ); - } - __active = true; - org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [6]; - org.omg.CORBA.TypeCode _tcOf_members0 = null; - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.IdentifierHelper.id (), "Identifier", _tcOf_members0); - _members0[0] = new org.omg.CORBA.StructMember ( - "name", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.RepositoryIdHelper.id (), "RepositoryId", _tcOf_members0); - _members0[1] = new org.omg.CORBA.StructMember ( - "id", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.RepositoryIdHelper.id (), "RepositoryId", _tcOf_members0); - _members0[2] = new org.omg.CORBA.StructMember ( - "defined_in", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.VersionSpecHelper.id (), "VersionSpec", _tcOf_members0); - _members0[3] = new org.omg.CORBA.StructMember ( - "version", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_TypeCode); - _members0[4] = new org.omg.CORBA.StructMember ( - "type", - _tcOf_members0, - null); - _tcOf_members0 = com.sun.org.omg.CORBA.AttributeModeHelper.type (); - _members0[5] = new org.omg.CORBA.StructMember ( - "mode", - _tcOf_members0, - null); - __typeCode = org.omg.CORBA.ORB.init ().create_struct_tc (com.sun.org.omg.CORBA.AttributeDescriptionHelper.id (), "AttributeDescription", _members0); - __active = false; - } - } - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static com.sun.org.omg.CORBA.AttributeDescription read (org.omg.CORBA.portable.InputStream istream) - { - com.sun.org.omg.CORBA.AttributeDescription value = new com.sun.org.omg.CORBA.AttributeDescription (); - value.name = istream.read_string (); - value.id = istream.read_string (); - value.defined_in = istream.read_string (); - value.version = istream.read_string (); - value.type = istream.read_TypeCode (); - value.mode = com.sun.org.omg.CORBA.AttributeModeHelper.read (istream); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.org.omg.CORBA.AttributeDescription value) - { - ostream.write_string (value.name); - ostream.write_string (value.id); - ostream.write_string (value.defined_in); - ostream.write_string (value.version); - ostream.write_TypeCode (value.type); - com.sun.org.omg.CORBA.AttributeModeHelper.write (ostream, value.mode); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/AttributeMode.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/AttributeMode.java deleted file mode 100644 index ca5314cfc3d..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/AttributeMode.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/AttributeMode.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:50 AM PDT -*/ - -public class AttributeMode implements org.omg.CORBA.portable.IDLEntity -{ - private int __value; - private static int __size = 2; - private static com.sun.org.omg.CORBA.AttributeMode[] __array = new com.sun.org.omg.CORBA.AttributeMode [__size]; - - public static final int _ATTR_NORMAL = 0; - public static final com.sun.org.omg.CORBA.AttributeMode ATTR_NORMAL = new com.sun.org.omg.CORBA.AttributeMode(_ATTR_NORMAL); - public static final int _ATTR_READONLY = 1; - public static final com.sun.org.omg.CORBA.AttributeMode ATTR_READONLY = new com.sun.org.omg.CORBA.AttributeMode(_ATTR_READONLY); - - public int value () - { - return __value; - } - - public static com.sun.org.omg.CORBA.AttributeMode from_int (int value) - { - if (value >= 0 && value < __size) - return __array[value]; - else - throw new org.omg.CORBA.BAD_PARAM (); - } - - protected AttributeMode (int value) - { - __value = value; - __array[__value] = this; - } -} // class AttributeMode diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/AttributeModeHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/AttributeModeHelper.java deleted file mode 100644 index 7d27d667ade..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/AttributeModeHelper.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/AttributeModeHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:50 AM PDT -*/ - -public final class AttributeModeHelper -{ - private static String _id = "IDL:omg.org/CORBA/AttributeMode:1.0"; - - public AttributeModeHelper() - { - } - - public static void insert (org.omg.CORBA.Any a, com.sun.org.omg.CORBA.AttributeMode that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static com.sun.org.omg.CORBA.AttributeMode extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_enum_tc (com.sun.org.omg.CORBA.AttributeModeHelper.id (), "AttributeMode", new String[] { "ATTR_NORMAL", "ATTR_READONLY"} ); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static com.sun.org.omg.CORBA.AttributeMode read (org.omg.CORBA.portable.InputStream istream) - { - return com.sun.org.omg.CORBA.AttributeMode.from_int (istream.read_long ()); - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.org.omg.CORBA.AttributeMode value) - { - ostream.write_long (value.value ()); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ContextIdSeqHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/ContextIdSeqHelper.java deleted file mode 100644 index 77129c2aeac..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ContextIdSeqHelper.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/ContextIdSeqHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:51 AM PDT -*/ - -public final class ContextIdSeqHelper -{ - private static String _id = "IDL:omg.org/CORBA/ContextIdSeq:1.0"; - - public ContextIdSeqHelper() - { - } - - public static void insert (org.omg.CORBA.Any a, String[] that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static String[] extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_string_tc (0); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.IdentifierHelper.id (), "Identifier", __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.ContextIdentifierHelper.id (), "ContextIdentifier", __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.ContextIdSeqHelper.id (), "ContextIdSeq", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static String[] read (org.omg.CORBA.portable.InputStream istream) - { - String value[] = null; - int _len0 = istream.read_long (); - value = new String[_len0]; - for (int _o1 = 0;_o1 < value.length; ++_o1) - value[_o1] = com.sun.org.omg.CORBA.ContextIdentifierHelper.read (istream); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, String[] value) - { - ostream.write_long (value.length); - for (int _i0 = 0;_i0 < value.length; ++_i0) - com.sun.org.omg.CORBA.ContextIdentifierHelper.write (ostream, value[_i0]); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ContextIdentifierHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/ContextIdentifierHelper.java deleted file mode 100644 index 9c07fa08bd8..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ContextIdentifierHelper.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/ContextIdentifierHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:50 AM PDT -*/ - -public final class ContextIdentifierHelper -{ - private static String _id = "IDL:omg.org/CORBA/ContextIdentifier:1.0"; - - public ContextIdentifierHelper() - { - } - - public static void insert (org.omg.CORBA.Any a, String that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static String extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_string_tc (0); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.IdentifierHelper.id (), "Identifier", __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.ContextIdentifierHelper.id (), "ContextIdentifier", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static String read (org.omg.CORBA.portable.InputStream istream) - { - String value = null; - value = istream.read_string (); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, String value) - { - ostream.write_string (value); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/DefinitionKindHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/DefinitionKindHelper.java deleted file mode 100644 index 29b6288849b..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/DefinitionKindHelper.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/DefinitionKindHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:43 AM PDT -*/ - -// This file has been manually _CHANGED_ - -public final class DefinitionKindHelper -{ - private static String _id = "IDL:omg.org/CORBA/DefinitionKind:1.0"; - - public DefinitionKindHelper() - { - } - - // _CHANGED_ - //public static void insert (org.omg.CORBA.Any a, com.sun.org.omg.CORBA.DefinitionKind that) - public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.DefinitionKind that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - // _CHANGED_ - //public static com.sun.org.omg.CORBA.DefinitionKind extract (org.omg.CORBA.Any a) - public static org.omg.CORBA.DefinitionKind extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_enum_tc (com.sun.org.omg.CORBA.DefinitionKindHelper.id (), "DefinitionKind", new String[] { "dk_none", "dk_all", "dk_Attribute", "dk_Constant", "dk_Exception", "dk_Interface", "dk_Module", "dk_Operation", "dk_Typedef", "dk_Alias", "dk_Struct", "dk_Union", "dk_Enum", "dk_Primitive", "dk_String", "dk_Sequence", "dk_Array", "dk_Repository", "dk_Wstring", "dk_Fixed", "dk_Value", "dk_ValueBox", "dk_ValueMember", "dk_Native"} ); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - // _CHANGED_ - //public static com.sun.org.omg.CORBA.DefinitionKind read (org.omg.CORBA.portable.InputStream istream) - public static org.omg.CORBA.DefinitionKind read (org.omg.CORBA.portable.InputStream istream) - { - // _CHANGED_ - //return com.sun.org.omg.CORBA.DefinitionKind.from_int (istream.read_long ()); - return org.omg.CORBA.DefinitionKind.from_int (istream.read_long ()); - } - - // _CHANGED_ - //public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.org.omg.CORBA.DefinitionKind value) - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.DefinitionKind value) - { - ostream.write_long (value.value ()); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ExcDescriptionSeqHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/ExcDescriptionSeqHelper.java deleted file mode 100644 index e58eef777ca..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ExcDescriptionSeqHelper.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/ExcDescriptionSeqHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:51 AM PDT -*/ - -public final class ExcDescriptionSeqHelper -{ - private static String _id = "IDL:omg.org/CORBA/ExcDescriptionSeq:1.0"; - - public ExcDescriptionSeqHelper() - { - } - - public static void insert (org.omg.CORBA.Any a, com.sun.org.omg.CORBA.ExceptionDescription[] that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static com.sun.org.omg.CORBA.ExceptionDescription[] extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = com.sun.org.omg.CORBA.ExceptionDescriptionHelper.type (); - __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.ExcDescriptionSeqHelper.id (), "ExcDescriptionSeq", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static com.sun.org.omg.CORBA.ExceptionDescription[] read (org.omg.CORBA.portable.InputStream istream) - { - com.sun.org.omg.CORBA.ExceptionDescription value[] = null; - int _len0 = istream.read_long (); - value = new com.sun.org.omg.CORBA.ExceptionDescription[_len0]; - for (int _o1 = 0;_o1 < value.length; ++_o1) - value[_o1] = com.sun.org.omg.CORBA.ExceptionDescriptionHelper.read (istream); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.org.omg.CORBA.ExceptionDescription[] value) - { - ostream.write_long (value.length); - for (int _i0 = 0;_i0 < value.length; ++_i0) - com.sun.org.omg.CORBA.ExceptionDescriptionHelper.write (ostream, value[_i0]); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ExceptionDescription.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/ExceptionDescription.java deleted file mode 100644 index 09897e40f37..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ExceptionDescription.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/ExceptionDescription.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:50 AM PDT -*/ - -public final class ExceptionDescription implements org.omg.CORBA.portable.IDLEntity -{ - public String name = null; - public String id = null; - public String defined_in = null; - public String version = null; - public org.omg.CORBA.TypeCode type = null; - - public ExceptionDescription () - { - } // ctor - - public ExceptionDescription (String _name, String _id, String _defined_in, String _version, org.omg.CORBA.TypeCode _type) - { - name = _name; - id = _id; - defined_in = _defined_in; - version = _version; - type = _type; - } // ctor - -} // class ExceptionDescription diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ExceptionDescriptionHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/ExceptionDescriptionHelper.java deleted file mode 100644 index 5196b359af4..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ExceptionDescriptionHelper.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/ExceptionDescriptionHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:50 AM PDT -*/ - -public final class ExceptionDescriptionHelper -{ - private static String _id = "IDL:omg.org/CORBA/ExceptionDescription:1.0"; - - public ExceptionDescriptionHelper() - { - } - - public static void insert (org.omg.CORBA.Any a, com.sun.org.omg.CORBA.ExceptionDescription that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static com.sun.org.omg.CORBA.ExceptionDescription extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - private static boolean __active = false; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - synchronized (org.omg.CORBA.TypeCode.class) - { - if (__typeCode == null) - { - if (__active) - { - return org.omg.CORBA.ORB.init().create_recursive_tc ( _id ); - } - __active = true; - org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [5]; - org.omg.CORBA.TypeCode _tcOf_members0 = null; - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.IdentifierHelper.id (), "Identifier", _tcOf_members0); - _members0[0] = new org.omg.CORBA.StructMember ( - "name", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.RepositoryIdHelper.id (), "RepositoryId", _tcOf_members0); - _members0[1] = new org.omg.CORBA.StructMember ( - "id", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.RepositoryIdHelper.id (), "RepositoryId", _tcOf_members0); - _members0[2] = new org.omg.CORBA.StructMember ( - "defined_in", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.VersionSpecHelper.id (), "VersionSpec", _tcOf_members0); - _members0[3] = new org.omg.CORBA.StructMember ( - "version", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_TypeCode); - _members0[4] = new org.omg.CORBA.StructMember ( - "type", - _tcOf_members0, - null); - __typeCode = org.omg.CORBA.ORB.init ().create_struct_tc (com.sun.org.omg.CORBA.ExceptionDescriptionHelper.id (), "ExceptionDescription", _members0); - __active = false; - } - } - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static com.sun.org.omg.CORBA.ExceptionDescription read (org.omg.CORBA.portable.InputStream istream) - { - com.sun.org.omg.CORBA.ExceptionDescription value = new com.sun.org.omg.CORBA.ExceptionDescription (); - value.name = istream.read_string (); - value.id = istream.read_string (); - value.defined_in = istream.read_string (); - value.version = istream.read_string (); - value.type = istream.read_TypeCode (); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.org.omg.CORBA.ExceptionDescription value) - { - ostream.write_string (value.name); - ostream.write_string (value.id); - ostream.write_string (value.defined_in); - ostream.write_string (value.version); - ostream.write_TypeCode (value.type); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/IDLTypeHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/IDLTypeHelper.java deleted file mode 100644 index ac156033848..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/IDLTypeHelper.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/IDLTypeHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:45 AM PDT -*/ - -// This file has been _CHANGED_ - -public final class IDLTypeHelper -{ - private static String _id = "IDL:omg.org/CORBA/IDLType:1.0"; - - public IDLTypeHelper() - { - } - - // _CHANGED_ - //public static void insert (org.omg.CORBA.Any a, com.sun.org.omg.CORBA.IDLType that) - public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.IDLType that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - // _CHANGED_ - //public static com.sun.org.omg.CORBA.IDLType extract (org.omg.CORBA.Any a) - public static org.omg.CORBA.IDLType extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (com.sun.org.omg.CORBA.IDLTypeHelper.id (), "IDLType"); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - // _CHANGED_ - //public static com.sun.org.omg.CORBA.IDLType read (org.omg.CORBA.portable.InputStream istream) - public static org.omg.CORBA.IDLType read (org.omg.CORBA.portable.InputStream istream) - { - return narrow (istream.read_Object (_IDLTypeStub.class)); - } - - // _CHANGED_ - //public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.org.omg.CORBA.IDLType value) - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.IDLType value) - { - ostream.write_Object ((org.omg.CORBA.Object) value); - } - - // _CHANGED_ - //public static com.sun.org.omg.CORBA.IDLType narrow (org.omg.CORBA.Object obj) - public static org.omg.CORBA.IDLType narrow (org.omg.CORBA.Object obj) - { - if (obj == null) - return null; - // _CHANGED_ - //else if (obj instanceof com.sun.org.omg.CORBA.IDLType) - else if (obj instanceof org.omg.CORBA.IDLType) - // _CHANGED_ - //return (com.sun.org.omg.CORBA.IDLType)obj; - return (org.omg.CORBA.IDLType)obj; - else if (!obj._is_a (id ())) - throw new org.omg.CORBA.BAD_PARAM (); - else - { - org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate (); - return new com.sun.org.omg.CORBA._IDLTypeStub (delegate); - } - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/IdentifierHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/IdentifierHelper.java deleted file mode 100644 index 41049034726..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/IdentifierHelper.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/IdentifierHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:42 AM PDT -*/ - -public final class IdentifierHelper -{ - private static String _id = "IDL:omg.org/CORBA/Identifier:1.0"; - - public IdentifierHelper() - { - } - - public static void insert (org.omg.CORBA.Any a, String that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static String extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_string_tc (0); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.IdentifierHelper.id (), "Identifier", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static String read (org.omg.CORBA.portable.InputStream istream) - { - String value = null; - value = istream.read_string (); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, String value) - { - ostream.write_string (value); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/Initializer.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/Initializer.java deleted file mode 100644 index abf80ec28ee..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/Initializer.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/Initializer.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:44 AM PDT -*/ - -// This file has been _CHANGED_ - -public final class Initializer implements org.omg.CORBA.portable.IDLEntity -{ - // _CHANGED_ - //public com.sun.org.omg.CORBA.StructMember members[] = null; - public org.omg.CORBA.StructMember members[] = null; - public String name = null; - - public Initializer () - { - } // ctor - - // _CHANGED_ - //public Initializer (com.sun.org.omg.CORBA.StructMember[] _members, String _name) - public Initializer (org.omg.CORBA.StructMember[] _members, String _name) - { - members = _members; - name = _name; - } // ctor - -} // class Initializer diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/InitializerHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/InitializerHelper.java deleted file mode 100644 index ea0605f4758..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/InitializerHelper.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/InitializerHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:44 AM PDT -*/ - -public final class InitializerHelper -{ - private static String _id = "IDL:omg.org/CORBA/Initializer:1.0"; - - public InitializerHelper() - { - } - - public static void insert (org.omg.CORBA.Any a, com.sun.org.omg.CORBA.Initializer that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static com.sun.org.omg.CORBA.Initializer extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - private static boolean __active = false; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - synchronized (org.omg.CORBA.TypeCode.class) - { - if (__typeCode == null) - { - if (__active) - { - return org.omg.CORBA.ORB.init().create_recursive_tc ( _id ); - } - __active = true; - org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [2]; - org.omg.CORBA.TypeCode _tcOf_members0 = null; - _tcOf_members0 = com.sun.org.omg.CORBA.StructMemberHelper.type (); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_sequence_tc (0, _tcOf_members0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.StructMemberSeqHelper.id (), "StructMemberSeq", _tcOf_members0); - _members0[0] = new org.omg.CORBA.StructMember ( - "members", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.IdentifierHelper.id (), "Identifier", _tcOf_members0); - _members0[1] = new org.omg.CORBA.StructMember ( - "name", - _tcOf_members0, - null); - __typeCode = org.omg.CORBA.ORB.init ().create_struct_tc (com.sun.org.omg.CORBA.InitializerHelper.id (), "Initializer", _members0); - __active = false; - } - } - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static com.sun.org.omg.CORBA.Initializer read (org.omg.CORBA.portable.InputStream istream) - { - com.sun.org.omg.CORBA.Initializer value = new com.sun.org.omg.CORBA.Initializer (); - value.members = com.sun.org.omg.CORBA.StructMemberSeqHelper.read (istream); - value.name = istream.read_string (); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.org.omg.CORBA.Initializer value) - { - com.sun.org.omg.CORBA.StructMemberSeqHelper.write (ostream, value.members); - ostream.write_string (value.name); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/InitializerSeqHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/InitializerSeqHelper.java deleted file mode 100644 index 2119a71d9a4..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/InitializerSeqHelper.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/InitializerSeqHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:44 AM PDT -*/ - -public final class InitializerSeqHelper -{ - private static String _id = "IDL:omg.org/CORBA/InitializerSeq:1.0"; - - public InitializerSeqHelper() - { - } - - public static void insert (org.omg.CORBA.Any a, com.sun.org.omg.CORBA.Initializer[] that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static com.sun.org.omg.CORBA.Initializer[] extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = com.sun.org.omg.CORBA.InitializerHelper.type (); - __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.InitializerSeqHelper.id (), "InitializerSeq", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static com.sun.org.omg.CORBA.Initializer[] read (org.omg.CORBA.portable.InputStream istream) - { - com.sun.org.omg.CORBA.Initializer value[] = null; - int _len0 = istream.read_long (); - value = new com.sun.org.omg.CORBA.Initializer[_len0]; - for (int _o1 = 0;_o1 < value.length; ++_o1) - value[_o1] = com.sun.org.omg.CORBA.InitializerHelper.read (istream); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.org.omg.CORBA.Initializer[] value) - { - ostream.write_long (value.length); - for (int _i0 = 0;_i0 < value.length; ++_i0) - com.sun.org.omg.CORBA.InitializerHelper.write (ostream, value[_i0]); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/OpDescriptionSeqHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/OpDescriptionSeqHelper.java deleted file mode 100644 index 6b531db4dde..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/OpDescriptionSeqHelper.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/OpDescriptionSeqHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:51 AM PDT -*/ - -public final class OpDescriptionSeqHelper -{ - private static String _id = "IDL:omg.org/CORBA/OpDescriptionSeq:1.0"; - - public OpDescriptionSeqHelper() - { - } - - public static void insert (org.omg.CORBA.Any a, com.sun.org.omg.CORBA.OperationDescription[] that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static com.sun.org.omg.CORBA.OperationDescription[] extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = com.sun.org.omg.CORBA.OperationDescriptionHelper.type (); - __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.OpDescriptionSeqHelper.id (), "OpDescriptionSeq", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static com.sun.org.omg.CORBA.OperationDescription[] read (org.omg.CORBA.portable.InputStream istream) - { - com.sun.org.omg.CORBA.OperationDescription value[] = null; - int _len0 = istream.read_long (); - value = new com.sun.org.omg.CORBA.OperationDescription[_len0]; - for (int _o1 = 0;_o1 < value.length; ++_o1) - value[_o1] = com.sun.org.omg.CORBA.OperationDescriptionHelper.read (istream); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.org.omg.CORBA.OperationDescription[] value) - { - ostream.write_long (value.length); - for (int _i0 = 0;_i0 < value.length; ++_i0) - com.sun.org.omg.CORBA.OperationDescriptionHelper.write (ostream, value[_i0]); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/OperationDescription.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/OperationDescription.java deleted file mode 100644 index 6ab6521b967..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/OperationDescription.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/OperationDescription.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:51 AM PDT -*/ - -public final class OperationDescription implements org.omg.CORBA.portable.IDLEntity -{ - public String name = null; - public String id = null; - public String defined_in = null; - public String version = null; - public org.omg.CORBA.TypeCode result = null; - public com.sun.org.omg.CORBA.OperationMode mode = null; - public String contexts[] = null; - public com.sun.org.omg.CORBA.ParameterDescription parameters[] = null; - public com.sun.org.omg.CORBA.ExceptionDescription exceptions[] = null; - - public OperationDescription () - { - } // ctor - - public OperationDescription (String _name, String _id, String _defined_in, String _version, org.omg.CORBA.TypeCode _result, com.sun.org.omg.CORBA.OperationMode _mode, String[] _contexts, com.sun.org.omg.CORBA.ParameterDescription[] _parameters, com.sun.org.omg.CORBA.ExceptionDescription[] _exceptions) - { - name = _name; - id = _id; - defined_in = _defined_in; - version = _version; - result = _result; - mode = _mode; - contexts = _contexts; - parameters = _parameters; - exceptions = _exceptions; - } // ctor - -} // class OperationDescription diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/OperationDescriptionHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/OperationDescriptionHelper.java deleted file mode 100644 index 49f052c991c..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/OperationDescriptionHelper.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/OperationDescriptionHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:51 AM PDT -*/ - -public final class OperationDescriptionHelper -{ - private static String _id = "IDL:omg.org/CORBA/OperationDescription:1.0"; - - public OperationDescriptionHelper() - { - } - - public static void insert (org.omg.CORBA.Any a, com.sun.org.omg.CORBA.OperationDescription that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static com.sun.org.omg.CORBA.OperationDescription extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - private static boolean __active = false; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - synchronized (org.omg.CORBA.TypeCode.class) - { - if (__typeCode == null) - { - if (__active) - { - return org.omg.CORBA.ORB.init().create_recursive_tc ( _id ); - } - __active = true; - org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [9]; - org.omg.CORBA.TypeCode _tcOf_members0 = null; - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.IdentifierHelper.id (), "Identifier", _tcOf_members0); - _members0[0] = new org.omg.CORBA.StructMember ( - "name", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.RepositoryIdHelper.id (), "RepositoryId", _tcOf_members0); - _members0[1] = new org.omg.CORBA.StructMember ( - "id", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.RepositoryIdHelper.id (), "RepositoryId", _tcOf_members0); - _members0[2] = new org.omg.CORBA.StructMember ( - "defined_in", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.VersionSpecHelper.id (), "VersionSpec", _tcOf_members0); - _members0[3] = new org.omg.CORBA.StructMember ( - "version", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_TypeCode); - _members0[4] = new org.omg.CORBA.StructMember ( - "result", - _tcOf_members0, - null); - _tcOf_members0 = com.sun.org.omg.CORBA.OperationModeHelper.type (); - _members0[5] = new org.omg.CORBA.StructMember ( - "mode", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.IdentifierHelper.id (), "Identifier", _tcOf_members0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.ContextIdentifierHelper.id (), "ContextIdentifier", _tcOf_members0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_sequence_tc (0, _tcOf_members0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.ContextIdSeqHelper.id (), "ContextIdSeq", _tcOf_members0); - _members0[6] = new org.omg.CORBA.StructMember ( - "contexts", - _tcOf_members0, - null); - _tcOf_members0 = com.sun.org.omg.CORBA.ParameterDescriptionHelper.type (); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_sequence_tc (0, _tcOf_members0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.ParDescriptionSeqHelper.id (), "ParDescriptionSeq", _tcOf_members0); - _members0[7] = new org.omg.CORBA.StructMember ( - "parameters", - _tcOf_members0, - null); - _tcOf_members0 = com.sun.org.omg.CORBA.ExceptionDescriptionHelper.type (); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_sequence_tc (0, _tcOf_members0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.ExcDescriptionSeqHelper.id (), "ExcDescriptionSeq", _tcOf_members0); - _members0[8] = new org.omg.CORBA.StructMember ( - "exceptions", - _tcOf_members0, - null); - __typeCode = org.omg.CORBA.ORB.init ().create_struct_tc (com.sun.org.omg.CORBA.OperationDescriptionHelper.id (), "OperationDescription", _members0); - __active = false; - } - } - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static com.sun.org.omg.CORBA.OperationDescription read (org.omg.CORBA.portable.InputStream istream) - { - com.sun.org.omg.CORBA.OperationDescription value = new com.sun.org.omg.CORBA.OperationDescription (); - value.name = istream.read_string (); - value.id = istream.read_string (); - value.defined_in = istream.read_string (); - value.version = istream.read_string (); - value.result = istream.read_TypeCode (); - value.mode = com.sun.org.omg.CORBA.OperationModeHelper.read (istream); - value.contexts = com.sun.org.omg.CORBA.ContextIdSeqHelper.read (istream); - value.parameters = com.sun.org.omg.CORBA.ParDescriptionSeqHelper.read (istream); - value.exceptions = com.sun.org.omg.CORBA.ExcDescriptionSeqHelper.read (istream); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.org.omg.CORBA.OperationDescription value) - { - ostream.write_string (value.name); - ostream.write_string (value.id); - ostream.write_string (value.defined_in); - ostream.write_string (value.version); - ostream.write_TypeCode (value.result); - com.sun.org.omg.CORBA.OperationModeHelper.write (ostream, value.mode); - com.sun.org.omg.CORBA.ContextIdSeqHelper.write (ostream, value.contexts); - com.sun.org.omg.CORBA.ParDescriptionSeqHelper.write (ostream, value.parameters); - com.sun.org.omg.CORBA.ExcDescriptionSeqHelper.write (ostream, value.exceptions); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/OperationMode.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/OperationMode.java deleted file mode 100644 index 6cef5535caf..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/OperationMode.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/OperationMode.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:50 AM PDT -*/ - -public class OperationMode implements org.omg.CORBA.portable.IDLEntity -{ - private int __value; - private static int __size = 2; - private static com.sun.org.omg.CORBA.OperationMode[] __array = new com.sun.org.omg.CORBA.OperationMode [__size]; - - public static final int _OP_NORMAL = 0; - public static final com.sun.org.omg.CORBA.OperationMode OP_NORMAL = new com.sun.org.omg.CORBA.OperationMode(_OP_NORMAL); - public static final int _OP_ONEWAY = 1; - public static final com.sun.org.omg.CORBA.OperationMode OP_ONEWAY = new com.sun.org.omg.CORBA.OperationMode(_OP_ONEWAY); - - public int value () - { - return __value; - } - - public static com.sun.org.omg.CORBA.OperationMode from_int (int value) - { - if (value >= 0 && value < __size) - return __array[value]; - else - throw new org.omg.CORBA.BAD_PARAM (); - } - - protected OperationMode (int value) - { - __value = value; - __array[__value] = this; - } -} // class OperationMode diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/OperationModeHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/OperationModeHelper.java deleted file mode 100644 index a819f948ead..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/OperationModeHelper.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/OperationModeHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:50 AM PDT -*/ - -public final class OperationModeHelper -{ - private static String _id = "IDL:omg.org/CORBA/OperationMode:1.0"; - - public OperationModeHelper() - { - } - - public static void insert (org.omg.CORBA.Any a, com.sun.org.omg.CORBA.OperationMode that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static com.sun.org.omg.CORBA.OperationMode extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_enum_tc (com.sun.org.omg.CORBA.OperationModeHelper.id (), "OperationMode", new String[] { "OP_NORMAL", "OP_ONEWAY"} ); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static com.sun.org.omg.CORBA.OperationMode read (org.omg.CORBA.portable.InputStream istream) - { - return com.sun.org.omg.CORBA.OperationMode.from_int (istream.read_long ()); - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.org.omg.CORBA.OperationMode value) - { - ostream.write_long (value.value ()); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ParDescriptionSeqHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/ParDescriptionSeqHelper.java deleted file mode 100644 index 947d68f2f0f..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ParDescriptionSeqHelper.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/ParDescriptionSeqHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:50 AM PDT -*/ - -public final class ParDescriptionSeqHelper -{ - private static String _id = "IDL:omg.org/CORBA/ParDescriptionSeq:1.0"; - - public ParDescriptionSeqHelper() - { - } - - public static void insert (org.omg.CORBA.Any a, com.sun.org.omg.CORBA.ParameterDescription[] that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static com.sun.org.omg.CORBA.ParameterDescription[] extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = com.sun.org.omg.CORBA.ParameterDescriptionHelper.type (); - __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.ParDescriptionSeqHelper.id (), "ParDescriptionSeq", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static com.sun.org.omg.CORBA.ParameterDescription[] read (org.omg.CORBA.portable.InputStream istream) - { - com.sun.org.omg.CORBA.ParameterDescription value[] = null; - int _len0 = istream.read_long (); - value = new com.sun.org.omg.CORBA.ParameterDescription[_len0]; - for (int _o1 = 0;_o1 < value.length; ++_o1) - value[_o1] = com.sun.org.omg.CORBA.ParameterDescriptionHelper.read (istream); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.org.omg.CORBA.ParameterDescription[] value) - { - ostream.write_long (value.length); - for (int _i0 = 0;_i0 < value.length; ++_i0) - com.sun.org.omg.CORBA.ParameterDescriptionHelper.write (ostream, value[_i0]); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ParameterDescription.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/ParameterDescription.java deleted file mode 100644 index 34f1e573eff..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ParameterDescription.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/ParameterDescription.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:50 AM PDT -*/ - -// This file has been _CHANGED_ - -public final class ParameterDescription implements org.omg.CORBA.portable.IDLEntity -{ - public String name = null; - public org.omg.CORBA.TypeCode type = null; - // _CHANGED_ - //public com.sun.org.omg.CORBA.IDLType type_def = null; - public org.omg.CORBA.IDLType type_def = null; - public com.sun.org.omg.CORBA.ParameterMode mode = null; - - public ParameterDescription () - { - } // ctor - - // _CHANGED_ - //public ParameterDescription (String _name, org.omg.CORBA.TypeCode _type, com.sun.org.omg.CORBA.IDLType _type_def, com.sun.org.omg.CORBA.ParameterMode _mode) - public ParameterDescription (String _name, org.omg.CORBA.TypeCode _type, org.omg.CORBA.IDLType _type_def, com.sun.org.omg.CORBA.ParameterMode _mode) - { - name = _name; - type = _type; - type_def = _type_def; - mode = _mode; - } // ctor - -} // class ParameterDescription diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ParameterDescriptionHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/ParameterDescriptionHelper.java deleted file mode 100644 index b5d37f0b9b4..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ParameterDescriptionHelper.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/ParameterDescriptionHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:50 AM PDT -*/ - -public final class ParameterDescriptionHelper -{ - private static String _id = "IDL:omg.org/CORBA/ParameterDescription:1.0"; - - public ParameterDescriptionHelper() - { - } - - public static void insert (org.omg.CORBA.Any a, com.sun.org.omg.CORBA.ParameterDescription that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static com.sun.org.omg.CORBA.ParameterDescription extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - private static boolean __active = false; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - synchronized (org.omg.CORBA.TypeCode.class) - { - if (__typeCode == null) - { - if (__active) - { - return org.omg.CORBA.ORB.init().create_recursive_tc ( _id ); - } - __active = true; - org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [4]; - org.omg.CORBA.TypeCode _tcOf_members0 = null; - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.IdentifierHelper.id (), "Identifier", _tcOf_members0); - _members0[0] = new org.omg.CORBA.StructMember ( - "name", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_TypeCode); - _members0[1] = new org.omg.CORBA.StructMember ( - "type", - _tcOf_members0, - null); - _tcOf_members0 = com.sun.org.omg.CORBA.IDLTypeHelper.type (); - _members0[2] = new org.omg.CORBA.StructMember ( - "type_def", - _tcOf_members0, - null); - _tcOf_members0 = com.sun.org.omg.CORBA.ParameterModeHelper.type (); - _members0[3] = new org.omg.CORBA.StructMember ( - "mode", - _tcOf_members0, - null); - __typeCode = org.omg.CORBA.ORB.init ().create_struct_tc (com.sun.org.omg.CORBA.ParameterDescriptionHelper.id (), "ParameterDescription", _members0); - __active = false; - } - } - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static com.sun.org.omg.CORBA.ParameterDescription read (org.omg.CORBA.portable.InputStream istream) - { - com.sun.org.omg.CORBA.ParameterDescription value = new com.sun.org.omg.CORBA.ParameterDescription (); - value.name = istream.read_string (); - value.type = istream.read_TypeCode (); - value.type_def = com.sun.org.omg.CORBA.IDLTypeHelper.read (istream); - value.mode = com.sun.org.omg.CORBA.ParameterModeHelper.read (istream); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.org.omg.CORBA.ParameterDescription value) - { - ostream.write_string (value.name); - ostream.write_TypeCode (value.type); - com.sun.org.omg.CORBA.IDLTypeHelper.write (ostream, value.type_def); - com.sun.org.omg.CORBA.ParameterModeHelper.write (ostream, value.mode); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ParameterMode.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/ParameterMode.java deleted file mode 100644 index 57645aff0de..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ParameterMode.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/ParameterMode.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:50 AM PDT -*/ - -public class ParameterMode implements org.omg.CORBA.portable.IDLEntity -{ - private int __value; - private static int __size = 3; - private static com.sun.org.omg.CORBA.ParameterMode[] __array = new com.sun.org.omg.CORBA.ParameterMode [__size]; - - public static final int _PARAM_IN = 0; - public static final com.sun.org.omg.CORBA.ParameterMode PARAM_IN = new com.sun.org.omg.CORBA.ParameterMode(_PARAM_IN); - public static final int _PARAM_OUT = 1; - public static final com.sun.org.omg.CORBA.ParameterMode PARAM_OUT = new com.sun.org.omg.CORBA.ParameterMode(_PARAM_OUT); - public static final int _PARAM_INOUT = 2; - public static final com.sun.org.omg.CORBA.ParameterMode PARAM_INOUT = new com.sun.org.omg.CORBA.ParameterMode(_PARAM_INOUT); - - public int value () - { - return __value; - } - - public static com.sun.org.omg.CORBA.ParameterMode from_int (int value) - { - if (value >= 0 && value < __size) - return __array[value]; - else - throw new org.omg.CORBA.BAD_PARAM (); - } - - protected ParameterMode (int value) - { - __value = value; - __array[__value] = this; - } -} // class ParameterMode diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ParameterModeHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/ParameterModeHelper.java deleted file mode 100644 index 639b7ba6e32..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ParameterModeHelper.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/ParameterModeHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:50 AM PDT -*/ - -public final class ParameterModeHelper -{ - private static String _id = "IDL:omg.org/CORBA/ParameterMode:1.0"; - - public ParameterModeHelper() - { - } - - public static void insert (org.omg.CORBA.Any a, com.sun.org.omg.CORBA.ParameterMode that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static com.sun.org.omg.CORBA.ParameterMode extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_enum_tc (com.sun.org.omg.CORBA.ParameterModeHelper.id (), "ParameterMode", new String[] { "PARAM_IN", "PARAM_OUT", "PARAM_INOUT"} ); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static com.sun.org.omg.CORBA.ParameterMode read (org.omg.CORBA.portable.InputStream istream) - { - return com.sun.org.omg.CORBA.ParameterMode.from_int (istream.read_long ()); - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.org.omg.CORBA.ParameterMode value) - { - ostream.write_long (value.value ()); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/Repository.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/Repository.java deleted file mode 100644 index 278200a9d95..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/Repository.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - -public interface Repository extends org.omg.CORBA.IRObject, org.omg.CORBA.portable.IDLEntity -{ -} // interface Repository diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/RepositoryHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/RepositoryHelper.java deleted file mode 100644 index 5541b07c208..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/RepositoryHelper.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - -public final class RepositoryHelper -{ - private static String _id = "IDL:com.sun.omg.org/CORBA/Repository:3.0"; - - public RepositoryHelper() - { - } - - public static void insert (org.omg.CORBA.Any a, Repository that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static Repository extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_string_tc (0); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.RepositoryHelper.id (), "Repository", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static Repository read (org.omg.CORBA.portable.InputStream istream) - { - String value = null; - value = istream.read_string (); - return null; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, Repository value) - { - ostream.write_string (null); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/RepositoryIdHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/RepositoryIdHelper.java deleted file mode 100644 index 1e760b9a295..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/RepositoryIdHelper.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/RepositoryIdHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:43 AM PDT -*/ - -public final class RepositoryIdHelper -{ - private static String _id = "IDL:omg.org/CORBA/RepositoryId:1.0"; - - public RepositoryIdHelper() - { - } - - public static void insert (org.omg.CORBA.Any a, String that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static String extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_string_tc (0); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.RepositoryIdHelper.id (), "RepositoryId", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static String read (org.omg.CORBA.portable.InputStream istream) - { - String value = null; - value = istream.read_string (); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, String value) - { - ostream.write_string (value); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/RepositoryIdSeqHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/RepositoryIdSeqHelper.java deleted file mode 100644 index bee221cfb4c..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/RepositoryIdSeqHelper.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/RepositoryIdSeqHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:51 AM PDT -*/ - -public final class RepositoryIdSeqHelper -{ - private static String _id = "IDL:omg.org/CORBA/RepositoryIdSeq:1.0"; - - public RepositoryIdSeqHelper() - { - } - - public static void insert (org.omg.CORBA.Any a, String[] that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static String[] extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_string_tc (0); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.RepositoryIdHelper.id (), "RepositoryId", __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.RepositoryIdSeqHelper.id (), "RepositoryIdSeq", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static String[] read (org.omg.CORBA.portable.InputStream istream) - { - String value[] = null; - int _len0 = istream.read_long (); - value = new String[_len0]; - for (int _o1 = 0;_o1 < value.length; ++_o1) - value[_o1] = com.sun.org.omg.CORBA.RepositoryIdHelper.read (istream); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, String[] value) - { - ostream.write_long (value.length); - for (int _i0 = 0;_i0 < value.length; ++_i0) - com.sun.org.omg.CORBA.RepositoryIdHelper.write (ostream, value[_i0]); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/StructMemberHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/StructMemberHelper.java deleted file mode 100644 index 68329e6bc44..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/StructMemberHelper.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/StructMemberHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:44 AM PDT -*/ - -// This file has been manually _CHANGED_ - -public final class StructMemberHelper -{ - private static String _id = "IDL:omg.org/CORBA/StructMember:1.0"; - - public StructMemberHelper() - { - } - - // _CHANGED_ - //public static void insert (org.omg.CORBA.Any a, com.sun.org.omg.CORBA.StructMember that) - public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.StructMember that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - // _CHANGED_ - //public static com.sun.org.omg.CORBA.StructMember extract (org.omg.CORBA.Any a) - public static org.omg.CORBA.StructMember extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - private static boolean __active = false; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - synchronized (org.omg.CORBA.TypeCode.class) - { - if (__typeCode == null) - { - if (__active) - { - return org.omg.CORBA.ORB.init().create_recursive_tc ( _id ); - } - __active = true; - org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [3]; - org.omg.CORBA.TypeCode _tcOf_members0 = null; - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.IdentifierHelper.id (), "Identifier", _tcOf_members0); - _members0[0] = new org.omg.CORBA.StructMember ( - "name", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_TypeCode); - _members0[1] = new org.omg.CORBA.StructMember ( - "type", - _tcOf_members0, - null); - _tcOf_members0 = com.sun.org.omg.CORBA.IDLTypeHelper.type (); - _members0[2] = new org.omg.CORBA.StructMember ( - "type_def", - _tcOf_members0, - null); - __typeCode = org.omg.CORBA.ORB.init ().create_struct_tc (com.sun.org.omg.CORBA.StructMemberHelper.id (), "StructMember", _members0); - __active = false; - } - } - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - // _CHANGED_ - //public static com.sun.org.omg.CORBA.StructMember read (org.omg.CORBA.portable.InputStream istream) - public static org.omg.CORBA.StructMember read (org.omg.CORBA.portable.InputStream istream) - { - // _CHANGED_ - //com.sun.org.omg.CORBA.StructMember value = new com.sun.org.omg.CORBA.StructMember (); - org.omg.CORBA.StructMember value = new org.omg.CORBA.StructMember (); - value.name = istream.read_string (); - value.type = istream.read_TypeCode (); - value.type_def = com.sun.org.omg.CORBA.IDLTypeHelper.read (istream); - return value; - } - - // _CHANGED_ - //public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.org.omg.CORBA.StructMember value) - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.StructMember value) - { - ostream.write_string (value.name); - ostream.write_TypeCode (value.type); - com.sun.org.omg.CORBA.IDLTypeHelper.write (ostream, value.type_def); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/StructMemberSeqHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/StructMemberSeqHelper.java deleted file mode 100644 index 6139d513d04..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/StructMemberSeqHelper.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/StructMemberSeqHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:44 AM PDT -*/ - -// This file has been _CHANGED_ - -public final class StructMemberSeqHelper -{ - private static String _id = "IDL:omg.org/CORBA/StructMemberSeq:1.0"; - - public StructMemberSeqHelper() - { - } - - // _CHANGED_ - //public static void insert (org.omg.CORBA.Any a, com.sun.org.omg.CORBA.StructMember[] that) - public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.StructMember[] that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - // _CHANGED_ - //public static com.sun.org.omg.CORBA.StructMember[] extract (org.omg.CORBA.Any a) - public static org.omg.CORBA.StructMember[] extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = com.sun.org.omg.CORBA.StructMemberHelper.type (); - __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.StructMemberSeqHelper.id (), "StructMemberSeq", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - // _CHANGED_ - //public static com.sun.org.omg.CORBA.StructMember[] read (org.omg.CORBA.portable.InputStream istream) - public static org.omg.CORBA.StructMember[] read (org.omg.CORBA.portable.InputStream istream) - { - // _CHANGED_ - //com.sun.org.omg.CORBA.StructMember value[] = null; - org.omg.CORBA.StructMember value[] = null; - int _len0 = istream.read_long (); - // _CHANGED_ - //value = new com.sun.org.omg.CORBA.StructMember[_len0]; - value = new org.omg.CORBA.StructMember[_len0]; - for (int _o1 = 0;_o1 < value.length; ++_o1) - value[_o1] = com.sun.org.omg.CORBA.StructMemberHelper.read (istream); - return value; - } - - // _CHANGED_ - //public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.org.omg.CORBA.StructMember[] value) - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.StructMember[] value) - { - ostream.write_long (value.length); - for (int _i0 = 0;_i0 < value.length; ++_i0) - com.sun.org.omg.CORBA.StructMemberHelper.write (ostream, value[_i0]); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ValueDefPackage/FullValueDescription.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/ValueDefPackage/FullValueDescription.java deleted file mode 100644 index 2be44feef6e..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ValueDefPackage/FullValueDescription.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA.ValueDefPackage; - - -/** -* com/sun/org/omg/CORBA/ValueDefPackage/FullValueDescription.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:52 AM PDT -*/ - -// This file has been manually _CHANGED_ - -public final class FullValueDescription implements org.omg.CORBA.portable.IDLEntity -{ - public String name = null; - public String id = null; - public boolean is_abstract = false; - public boolean is_custom = false; - public String defined_in = null; - public String version = null; - public com.sun.org.omg.CORBA.OperationDescription operations[] = null; - public com.sun.org.omg.CORBA.AttributeDescription attributes[] = null; - - // _CHANGED_ - //public com.sun.org.omg.CORBA.ValueMember members[] = null; - public org.omg.CORBA.ValueMember members[] = null; - - public com.sun.org.omg.CORBA.Initializer initializers[] = null; - public String supported_interfaces[] = null; - public String abstract_base_values[] = null; - public boolean is_truncatable = false; - public String base_value = null; - public org.omg.CORBA.TypeCode type = null; - - public FullValueDescription () - { - } // ctor - - // _CHANGED_ - //public FullValueDescription (String _name, String _id, boolean _is_abstract, boolean _is_custom, String _defined_in, String _version, com.sun.org.omg.CORBA.OperationDescription[] _operations, com.sun.org.omg.CORBA.AttributeDescription[] _attributes, com.sun.org.omg.CORBA.ValueMember[] _members, com.sun.org.omg.CORBA.Initializer[] _initializers, String[] _supported_interfaces, String[] _abstract_base_values, boolean _is_truncatable, String _base_value, org.omg.CORBA.TypeCode _type) - public FullValueDescription (String _name, String _id, boolean _is_abstract, boolean _is_custom, String _defined_in, String _version, com.sun.org.omg.CORBA.OperationDescription[] _operations, com.sun.org.omg.CORBA.AttributeDescription[] _attributes, org.omg.CORBA.ValueMember[] _members, com.sun.org.omg.CORBA.Initializer[] _initializers, String[] _supported_interfaces, String[] _abstract_base_values, boolean _is_truncatable, String _base_value, org.omg.CORBA.TypeCode _type) - { - name = _name; - id = _id; - is_abstract = _is_abstract; - is_custom = _is_custom; - defined_in = _defined_in; - version = _version; - operations = _operations; - attributes = _attributes; - members = _members; - initializers = _initializers; - supported_interfaces = _supported_interfaces; - abstract_base_values = _abstract_base_values; - is_truncatable = _is_truncatable; - base_value = _base_value; - type = _type; - } // ctor - -} // class FullValueDescription diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ValueDefPackage/FullValueDescriptionHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/ValueDefPackage/FullValueDescriptionHelper.java deleted file mode 100644 index 9d11d04989f..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ValueDefPackage/FullValueDescriptionHelper.java +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA.ValueDefPackage; - - -/** -* com/sun/org/omg/CORBA/ValueDefPackage/FullValueDescriptionHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:52 AM PDT -*/ - -public final class FullValueDescriptionHelper -{ - private static String _id = "IDL:omg.org/CORBA/ValueDef/FullValueDescription:1.0"; - - public FullValueDescriptionHelper() - { - } - - public static void insert (org.omg.CORBA.Any a, com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - private static boolean __active = false; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - synchronized (org.omg.CORBA.TypeCode.class) - { - if (__typeCode == null) - { - if (__active) - { - return org.omg.CORBA.ORB.init().create_recursive_tc ( _id ); - } - __active = true; - org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [15]; - org.omg.CORBA.TypeCode _tcOf_members0 = null; - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.IdentifierHelper.id (), "Identifier", _tcOf_members0); - _members0[0] = new org.omg.CORBA.StructMember ( - "name", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.RepositoryIdHelper.id (), "RepositoryId", _tcOf_members0); - _members0[1] = new org.omg.CORBA.StructMember ( - "id", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_boolean); - _members0[2] = new org.omg.CORBA.StructMember ( - "is_abstract", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_boolean); - _members0[3] = new org.omg.CORBA.StructMember ( - "is_custom", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.RepositoryIdHelper.id (), "RepositoryId", _tcOf_members0); - _members0[4] = new org.omg.CORBA.StructMember ( - "defined_in", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.VersionSpecHelper.id (), "VersionSpec", _tcOf_members0); - _members0[5] = new org.omg.CORBA.StructMember ( - "version", - _tcOf_members0, - null); - _tcOf_members0 = com.sun.org.omg.CORBA.OperationDescriptionHelper.type (); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_sequence_tc (0, _tcOf_members0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.OpDescriptionSeqHelper.id (), "OpDescriptionSeq", _tcOf_members0); - _members0[6] = new org.omg.CORBA.StructMember ( - "operations", - _tcOf_members0, - null); - _tcOf_members0 = com.sun.org.omg.CORBA.AttributeDescriptionHelper.type (); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_sequence_tc (0, _tcOf_members0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.AttrDescriptionSeqHelper.id (), "AttrDescriptionSeq", _tcOf_members0); - _members0[7] = new org.omg.CORBA.StructMember ( - "attributes", - _tcOf_members0, - null); - _tcOf_members0 = com.sun.org.omg.CORBA.ValueMemberHelper.type (); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_sequence_tc (0, _tcOf_members0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.ValueMemberSeqHelper.id (), "ValueMemberSeq", _tcOf_members0); - _members0[8] = new org.omg.CORBA.StructMember ( - "members", - _tcOf_members0, - null); - _tcOf_members0 = com.sun.org.omg.CORBA.InitializerHelper.type (); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_sequence_tc (0, _tcOf_members0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.InitializerSeqHelper.id (), "InitializerSeq", _tcOf_members0); - _members0[9] = new org.omg.CORBA.StructMember ( - "initializers", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.RepositoryIdHelper.id (), "RepositoryId", _tcOf_members0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_sequence_tc (0, _tcOf_members0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.RepositoryIdSeqHelper.id (), "RepositoryIdSeq", _tcOf_members0); - _members0[10] = new org.omg.CORBA.StructMember ( - "supported_interfaces", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.RepositoryIdHelper.id (), "RepositoryId", _tcOf_members0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_sequence_tc (0, _tcOf_members0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.RepositoryIdSeqHelper.id (), "RepositoryIdSeq", _tcOf_members0); - _members0[11] = new org.omg.CORBA.StructMember ( - "abstract_base_values", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_boolean); - _members0[12] = new org.omg.CORBA.StructMember ( - "is_truncatable", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.RepositoryIdHelper.id (), "RepositoryId", _tcOf_members0); - _members0[13] = new org.omg.CORBA.StructMember ( - "base_value", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_TypeCode); - _members0[14] = new org.omg.CORBA.StructMember ( - "type", - _tcOf_members0, - null); - __typeCode = org.omg.CORBA.ORB.init ().create_struct_tc (com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescriptionHelper.id (), "FullValueDescription", _members0); - __active = false; - } - } - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription read (org.omg.CORBA.portable.InputStream istream) - { - com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription value = new com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription (); - value.name = istream.read_string (); - value.id = istream.read_string (); - value.is_abstract = istream.read_boolean (); - value.is_custom = istream.read_boolean (); - value.defined_in = istream.read_string (); - value.version = istream.read_string (); - value.operations = com.sun.org.omg.CORBA.OpDescriptionSeqHelper.read (istream); - value.attributes = com.sun.org.omg.CORBA.AttrDescriptionSeqHelper.read (istream); - value.members = com.sun.org.omg.CORBA.ValueMemberSeqHelper.read (istream); - value.initializers = com.sun.org.omg.CORBA.InitializerSeqHelper.read (istream); - value.supported_interfaces = com.sun.org.omg.CORBA.RepositoryIdSeqHelper.read (istream); - value.abstract_base_values = com.sun.org.omg.CORBA.RepositoryIdSeqHelper.read (istream); - value.is_truncatable = istream.read_boolean (); - value.base_value = istream.read_string (); - value.type = istream.read_TypeCode (); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription value) - { - ostream.write_string (value.name); - ostream.write_string (value.id); - ostream.write_boolean (value.is_abstract); - ostream.write_boolean (value.is_custom); - ostream.write_string (value.defined_in); - ostream.write_string (value.version); - com.sun.org.omg.CORBA.OpDescriptionSeqHelper.write (ostream, value.operations); - com.sun.org.omg.CORBA.AttrDescriptionSeqHelper.write (ostream, value.attributes); - com.sun.org.omg.CORBA.ValueMemberSeqHelper.write (ostream, value.members); - com.sun.org.omg.CORBA.InitializerSeqHelper.write (ostream, value.initializers); - com.sun.org.omg.CORBA.RepositoryIdSeqHelper.write (ostream, value.supported_interfaces); - com.sun.org.omg.CORBA.RepositoryIdSeqHelper.write (ostream, value.abstract_base_values); - ostream.write_boolean (value.is_truncatable); - ostream.write_string (value.base_value); - ostream.write_TypeCode (value.type); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ValueMemberHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/ValueMemberHelper.java deleted file mode 100644 index dd0350829bd..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ValueMemberHelper.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/ValueMemberHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:44 AM PDT -*/ - -// This file has been _CHANGED_ - -public final class ValueMemberHelper -{ - private static String _id = "IDL:omg.org/CORBA/ValueMember:1.0"; - - public ValueMemberHelper() - { - } - - // _CHANGED_ - //public static void insert (org.omg.CORBA.Any a, com.sun.org.omg.CORBA.ValueMember that) - public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.ValueMember that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - // _CHANGED_ - //public static com.sun.org.omg.CORBA.ValueMember extract (org.omg.CORBA.Any a) - public static org.omg.CORBA.ValueMember extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - private static boolean __active = false; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - synchronized (org.omg.CORBA.TypeCode.class) - { - if (__typeCode == null) - { - if (__active) - { - return org.omg.CORBA.ORB.init().create_recursive_tc ( _id ); - } - __active = true; - org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [7]; - org.omg.CORBA.TypeCode _tcOf_members0 = null; - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.IdentifierHelper.id (), "Identifier", _tcOf_members0); - _members0[0] = new org.omg.CORBA.StructMember ( - "name", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.RepositoryIdHelper.id (), "RepositoryId", _tcOf_members0); - _members0[1] = new org.omg.CORBA.StructMember ( - "id", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.RepositoryIdHelper.id (), "RepositoryId", _tcOf_members0); - _members0[2] = new org.omg.CORBA.StructMember ( - "defined_in", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.VersionSpecHelper.id (), "VersionSpec", _tcOf_members0); - _members0[3] = new org.omg.CORBA.StructMember ( - "version", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_TypeCode); - _members0[4] = new org.omg.CORBA.StructMember ( - "type", - _tcOf_members0, - null); - _tcOf_members0 = com.sun.org.omg.CORBA.IDLTypeHelper.type (); - _members0[5] = new org.omg.CORBA.StructMember ( - "type_def", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_short); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.VisibilityHelper.id (), "Visibility", _tcOf_members0); - _members0[6] = new org.omg.CORBA.StructMember ( - "access", - _tcOf_members0, - null); - __typeCode = org.omg.CORBA.ORB.init ().create_struct_tc (com.sun.org.omg.CORBA.ValueMemberHelper.id (), "ValueMember", _members0); - __active = false; - } - } - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - // _CHANGED_ - //public static com.sun.org.omg.CORBA.ValueMember read (org.omg.CORBA.portable.InputStream istream) - public static org.omg.CORBA.ValueMember read (org.omg.CORBA.portable.InputStream istream) - { - // _CHANGED_ - //com.sun.org.omg.CORBA.ValueMember value = new com.sun.org.omg.CORBA.ValueMember (); - org.omg.CORBA.ValueMember value = new org.omg.CORBA.ValueMember (); - value.name = istream.read_string (); - value.id = istream.read_string (); - value.defined_in = istream.read_string (); - value.version = istream.read_string (); - value.type = istream.read_TypeCode (); - value.type_def = com.sun.org.omg.CORBA.IDLTypeHelper.read (istream); - value.access = istream.read_short (); - return value; - } - - // _CHANGED_ - //public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.org.omg.CORBA.ValueMember value) - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.ValueMember value) - { - ostream.write_string (value.name); - ostream.write_string (value.id); - ostream.write_string (value.defined_in); - ostream.write_string (value.version); - ostream.write_TypeCode (value.type); - com.sun.org.omg.CORBA.IDLTypeHelper.write (ostream, value.type_def); - ostream.write_short (value.access); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ValueMemberSeqHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/ValueMemberSeqHelper.java deleted file mode 100644 index cf759d32370..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/ValueMemberSeqHelper.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/ValueMemberSeqHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:44 AM PDT -*/ - -// This file has been _CHANGED_ - -public final class ValueMemberSeqHelper -{ - private static String _id = "IDL:omg.org/CORBA/ValueMemberSeq:1.0"; - - public ValueMemberSeqHelper() - { - } - - // _CHANGED_ - //public static void insert (org.omg.CORBA.Any a, com.sun.org.omg.CORBA.ValueMember[] that) - public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.ValueMember[] that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - // _CHANGED_ - //public static com.sun.org.omg.CORBA.ValueMember[] extract (org.omg.CORBA.Any a) - public static org.omg.CORBA.ValueMember[] extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = com.sun.org.omg.CORBA.ValueMemberHelper.type (); - __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.ValueMemberSeqHelper.id (), "ValueMemberSeq", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - // _CHANGED_ - //public static com.sun.org.omg.CORBA.ValueMember[] read (org.omg.CORBA.portable.InputStream istream) - public static org.omg.CORBA.ValueMember[] read (org.omg.CORBA.portable.InputStream istream) - { - // _CHANGED_ - //com.sun.org.omg.CORBA.ValueMember value[] = null; - org.omg.CORBA.ValueMember value[] = null; - int _len0 = istream.read_long (); - // _CHANGED_ - //value = new com.sun.org.omg.CORBA.ValueMember[_len0]; - value = new org.omg.CORBA.ValueMember[_len0]; - for (int _o1 = 0;_o1 < value.length; ++_o1) - value[_o1] = com.sun.org.omg.CORBA.ValueMemberHelper.read (istream); - return value; - } - - // _CHANGED_ - //public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.org.omg.CORBA.ValueMember[] value) - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.ValueMember[] value) - { - ostream.write_long (value.length); - for (int _i0 = 0;_i0 < value.length; ++_i0) - com.sun.org.omg.CORBA.ValueMemberHelper.write (ostream, value[_i0]); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/VersionSpecHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/VersionSpecHelper.java deleted file mode 100644 index ea3112e997a..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/VersionSpecHelper.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/VersionSpecHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:43 AM PDT -*/ - -public final class VersionSpecHelper -{ - private static String _id = "IDL:omg.org/CORBA/VersionSpec:1.0"; - - public VersionSpecHelper() - { - } - - public static void insert (org.omg.CORBA.Any a, String that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static String extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_string_tc (0); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.VersionSpecHelper.id (), "VersionSpec", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static String read (org.omg.CORBA.portable.InputStream istream) - { - String value = null; - value = istream.read_string (); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, String value) - { - ostream.write_string (value); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/VisibilityHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/VisibilityHelper.java deleted file mode 100644 index 24f526fba1e..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/VisibilityHelper.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/VisibilityHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:44 AM PDT -*/ - - -// orbos 98-01-18: Objects By Value -- begin -public final class VisibilityHelper -{ - private static String _id = "IDL:omg.org/CORBA/Visibility:1.0"; - - public VisibilityHelper() - { - } - - public static void insert (org.omg.CORBA.Any a, short that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static short extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_short); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.VisibilityHelper.id (), "Visibility", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static short read (org.omg.CORBA.portable.InputStream istream) - { - short value = (short)0; - value = istream.read_short (); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, short value) - { - ostream.write_short (value); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/_IDLTypeStub.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/_IDLTypeStub.java deleted file mode 100644 index e1a5b8635f9..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/_IDLTypeStub.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.CORBA; - - -/** -* com/sun/org/omg/CORBA/_IDLTypeStub.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* Thursday, May 6, 1999 1:51:45 AM PDT -*/ - -// This file has been manually _CHANGED_ - -// _CHANGED_ -//public class _IDLTypeStub extends org.omg.CORBA.portable.ObjectImpl implements com.sun.org.omg.CORBA.IDLType -public class _IDLTypeStub extends org.omg.CORBA.portable.ObjectImpl implements org.omg.CORBA.IDLType -{ - // Constructors - // NOTE: If the default constructor is used, the - // object is useless until _set_delegate (...) - // is called. - public _IDLTypeStub () - { - super (); - } - - public _IDLTypeStub (org.omg.CORBA.portable.Delegate delegate) - { - super (); - _set_delegate (delegate); - } - - public org.omg.CORBA.TypeCode type () - { - org.omg.CORBA.portable.InputStream _in = null; - try { - org.omg.CORBA.portable.OutputStream _out = _request ("_get_type", true); - _in = _invoke (_out); - org.omg.CORBA.TypeCode __result = _in.read_TypeCode (); - return __result; - } catch (org.omg.CORBA.portable.ApplicationException _ex) { - _in = _ex.getInputStream (); - String _id = _ex.getId (); - throw new org.omg.CORBA.MARSHAL (_id); - } catch (org.omg.CORBA.portable.RemarshalException _rm) { - return type (); - } finally { - _releaseReply (_in); - } - } // type - - - // read interface - // _CHANGED_ - //public com.sun.org.omg.CORBA.DefinitionKind def_kind () - public org.omg.CORBA.DefinitionKind def_kind () - { - org.omg.CORBA.portable.InputStream _in = null; - try { - org.omg.CORBA.portable.OutputStream _out = _request ("_get_def_kind", true); - _in = _invoke (_out); - // _CHANGED_ - //com.sun.org.omg.CORBA.DefinitionKind __result = com.sun.org.omg.CORBA.DefinitionKindHelper.read (_in); - org.omg.CORBA.DefinitionKind __result = com.sun.org.omg.CORBA.DefinitionKindHelper.read (_in); - return __result; - } catch (org.omg.CORBA.portable.ApplicationException _ex) { - _in = _ex.getInputStream (); - String _id = _ex.getId (); - throw new org.omg.CORBA.MARSHAL (_id); - } catch (org.omg.CORBA.portable.RemarshalException _rm) { - return def_kind (); - } finally { - _releaseReply (_in); - } - } // def_kind - - - // write interface - public void destroy () - { - org.omg.CORBA.portable.InputStream _in = null; - try { - org.omg.CORBA.portable.OutputStream _out = _request ("destroy", true); - _in = _invoke (_out); - } catch (org.omg.CORBA.portable.ApplicationException _ex) { - _in = _ex.getInputStream (); - String _id = _ex.getId (); - throw new org.omg.CORBA.MARSHAL (_id); - } catch (org.omg.CORBA.portable.RemarshalException _rm) { - destroy (); - } finally { - _releaseReply (_in); - } - } // destroy - - // Type-specific CORBA::Object operations - private static String[] __ids = { - "IDL:omg.org/CORBA/IDLType:1.0", - "IDL:omg.org/CORBA/IRObject:1.0"}; - - public String[] _ids () - { - return (String[])__ids.clone (); - } - - private void readObject (java.io.ObjectInputStream s) - { - try - { - String str = s.readUTF (); - org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init ().string_to_object (str); - org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate (); - _set_delegate (delegate); - } catch (java.io.IOException e) {} - } - - private void writeObject (java.io.ObjectOutputStream s) - { - try - { - String str = org.omg.CORBA.ORB.init ().object_to_string (this); - s.writeUTF (str); - } catch (java.io.IOException e) {} - } -} // class _IDLTypeStub diff --git a/src/java.corba/share/classes/com/sun/org/omg/CORBA/portable/ValueHelper.java b/src/java.corba/share/classes/com/sun/org/omg/CORBA/portable/ValueHelper.java deleted file mode 100644 index b34a0588818..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/CORBA/portable/ValueHelper.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.org.omg.CORBA.portable; - -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.portable.BoxedValueHelper; - -/** - * An interface that is implemented by valuetype helper classes. - * This interface appeared in CORBA 2.3 drafts but was removed from - * the published CORBA 2.3 specification. - * - * @deprecated Deprecated by CORBA 2.3. - */ -@Deprecated -public interface ValueHelper extends BoxedValueHelper { - Class get_class(); - String[] get_truncatable_base_ids(); - TypeCode get_type(); -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/SendingContext/CodeBase.java b/src/java.corba/share/classes/com/sun/org/omg/SendingContext/CodeBase.java deleted file mode 100644 index faa2ea08d3d..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/SendingContext/CodeBase.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.SendingContext; - - -/** -* com/sun/org/omg/SendingContext/CodeBase.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from rt.idl -* Thursday, May 6, 1999 1:52:08 AM PDT -*/ - -// Edited to leave RunTime in org.omg.CORBA - -public interface CodeBase extends CodeBaseOperations, org.omg.SendingContext.RunTime, org.omg.CORBA.portable.IDLEntity -{ -} // interface CodeBase diff --git a/src/java.corba/share/classes/com/sun/org/omg/SendingContext/CodeBaseHelper.java b/src/java.corba/share/classes/com/sun/org/omg/SendingContext/CodeBaseHelper.java deleted file mode 100644 index 666d7e33e81..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/SendingContext/CodeBaseHelper.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.SendingContext; - - -/** -* com/sun/org/omg/SendingContext/CodeBaseHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from rt.idl -* Thursday, May 6, 1999 1:52:08 AM PDT -*/ - -public final class CodeBaseHelper -{ - private static String _id = "IDL:omg.org/SendingContext/CodeBase:1.0"; - - public CodeBaseHelper() - { - } - - public static void insert (org.omg.CORBA.Any a, com.sun.org.omg.SendingContext.CodeBase that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static com.sun.org.omg.SendingContext.CodeBase extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (com.sun.org.omg.SendingContext.CodeBaseHelper.id (), "CodeBase"); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static com.sun.org.omg.SendingContext.CodeBase read (org.omg.CORBA.portable.InputStream istream) - { - return narrow (istream.read_Object (_CodeBaseStub.class)); - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.org.omg.SendingContext.CodeBase value) - { - ostream.write_Object ((org.omg.CORBA.Object) value); - } - - public static com.sun.org.omg.SendingContext.CodeBase narrow (org.omg.CORBA.Object obj) - { - if (obj == null) - return null; - else if (obj instanceof com.sun.org.omg.SendingContext.CodeBase) - return (com.sun.org.omg.SendingContext.CodeBase)obj; - else if (!obj._is_a (id ())) - throw new org.omg.CORBA.BAD_PARAM (); - else - { - org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate (); - return new com.sun.org.omg.SendingContext._CodeBaseStub (delegate); - } - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/SendingContext/CodeBaseOperations.java b/src/java.corba/share/classes/com/sun/org/omg/SendingContext/CodeBaseOperations.java deleted file mode 100644 index 71a656a96ca..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/SendingContext/CodeBaseOperations.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.SendingContext; - - -/** -* com/sun/org/omg/SendingContext/CodeBaseOperations.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from rt.idl -* Thursday, May 6, 1999 1:52:08 AM PDT -*/ - -// Edited to leave RunTime in org.omg.CORBA - -public interface CodeBaseOperations extends org.omg.SendingContext.RunTimeOperations -{ - - // Operation to obtain the IR from the sending context - com.sun.org.omg.CORBA.Repository get_ir (); - - // Operations to obtain a URL to the implementation code - String implementation (String x); - String[] implementations (String[] x); - - // the same information - com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription meta (String x); - com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription[] metas (String[] x); - - // information - String[] bases (String x); -} // interface CodeBaseOperations diff --git a/src/java.corba/share/classes/com/sun/org/omg/SendingContext/CodeBasePackage/URLHelper.java b/src/java.corba/share/classes/com/sun/org/omg/SendingContext/CodeBasePackage/URLHelper.java deleted file mode 100644 index 320ca0c4f6a..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/SendingContext/CodeBasePackage/URLHelper.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.SendingContext.CodeBasePackage; - - -/** -* com/sun/org/omg/SendingContext/CodeBasePackage/URLHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from rt.idl -* Thursday, May 6, 1999 1:52:08 AM PDT -*/ - -public final class URLHelper -{ - private static String _id = "IDL:omg.org/SendingContext/CodeBase/URL:1.0"; - - public URLHelper() - { - } - - public static void insert (org.omg.CORBA.Any a, String that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static String extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_string_tc (0); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.SendingContext.CodeBasePackage.URLHelper.id (), "URL", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static String read (org.omg.CORBA.portable.InputStream istream) - { - String value = null; - value = istream.read_string (); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, String value) - { - ostream.write_string (value); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/SendingContext/CodeBasePackage/URLSeqHelper.java b/src/java.corba/share/classes/com/sun/org/omg/SendingContext/CodeBasePackage/URLSeqHelper.java deleted file mode 100644 index 5b2494af151..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/SendingContext/CodeBasePackage/URLSeqHelper.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.SendingContext.CodeBasePackage; - - -/** -* com/sun/org/omg/SendingContext/CodeBasePackage/URLSeqHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from rt.idl -* Thursday, May 6, 1999 1:52:08 AM PDT -*/ - -public final class URLSeqHelper -{ - private static String _id = "IDL:omg.org/SendingContext/CodeBase/URLSeq:1.0"; - - public URLSeqHelper() - { - } - - public static void insert (org.omg.CORBA.Any a, String[] that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static String[] extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_string_tc (0); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.SendingContext.CodeBasePackage.URLHelper.id (), "URL", __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.SendingContext.CodeBasePackage.URLSeqHelper.id (), "URLSeq", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static String[] read (org.omg.CORBA.portable.InputStream istream) - { - String value[] = null; - int _len0 = istream.read_long (); - value = new String[_len0]; - for (int _o1 = 0;_o1 < value.length; ++_o1) - value[_o1] = com.sun.org.omg.SendingContext.CodeBasePackage.URLHelper.read (istream); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, String[] value) - { - ostream.write_long (value.length); - for (int _i0 = 0;_i0 < value.length; ++_i0) - com.sun.org.omg.SendingContext.CodeBasePackage.URLHelper.write (ostream, value[_i0]); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/SendingContext/CodeBasePackage/ValueDescSeqHelper.java b/src/java.corba/share/classes/com/sun/org/omg/SendingContext/CodeBasePackage/ValueDescSeqHelper.java deleted file mode 100644 index 2f832aac14f..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/SendingContext/CodeBasePackage/ValueDescSeqHelper.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.SendingContext.CodeBasePackage; - - -/** -* com/sun/org/omg/SendingContext/CodeBasePackage/ValueDescSeqHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from rt.idl -* Thursday, May 6, 1999 1:52:08 AM PDT -*/ - -public final class ValueDescSeqHelper -{ - private static String _id = "IDL:omg.org/SendingContext/CodeBase/ValueDescSeq:1.0"; - - public ValueDescSeqHelper() - { - } - - public static void insert (org.omg.CORBA.Any a, com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription[] that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription[] extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescriptionHelper.type (); - __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.SendingContext.CodeBasePackage.ValueDescSeqHelper.id (), "ValueDescSeq", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription[] read (org.omg.CORBA.portable.InputStream istream) - { - com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription value[] = null; - int _len0 = istream.read_long (); - value = new com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription[_len0]; - for (int _o1 = 0;_o1 < value.length; ++_o1) - value[_o1] = com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescriptionHelper.read (istream); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription[] value) - { - ostream.write_long (value.length); - for (int _i0 = 0;_i0 < value.length; ++_i0) - com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescriptionHelper.write (ostream, value[_i0]); - } - -} diff --git a/src/java.corba/share/classes/com/sun/org/omg/SendingContext/_CodeBaseImplBase.java b/src/java.corba/share/classes/com/sun/org/omg/SendingContext/_CodeBaseImplBase.java deleted file mode 100644 index 508f827589a..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/SendingContext/_CodeBaseImplBase.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.SendingContext; - - -/** -* com/sun/org/omg/SendingContext/_CodeBaseImplBase.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from rt.idl -* Thursday, May 6, 1999 1:52:08 AM PDT -*/ - -public abstract class _CodeBaseImplBase extends org.omg.CORBA.portable.ObjectImpl - implements com.sun.org.omg.SendingContext.CodeBase, org.omg.CORBA.portable.InvokeHandler -{ - - // Constructors - public _CodeBaseImplBase () - { - } - - private static java.util.Hashtable _methods = new java.util.Hashtable (); - static - { - _methods.put ("get_ir", new java.lang.Integer (0)); - _methods.put ("implementation", new java.lang.Integer (1)); - _methods.put ("implementations", new java.lang.Integer (2)); - _methods.put ("meta", new java.lang.Integer (3)); - _methods.put ("metas", new java.lang.Integer (4)); - _methods.put ("bases", new java.lang.Integer (5)); - } - - public org.omg.CORBA.portable.OutputStream _invoke (String method, - org.omg.CORBA.portable.InputStream in, - org.omg.CORBA.portable.ResponseHandler rh) - { - org.omg.CORBA.portable.OutputStream out = rh.createReply(); - java.lang.Integer __method = (java.lang.Integer)_methods.get (method); - if (__method == null) - throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE); - - switch (__method.intValue ()) - { - - // Operation to obtain the IR from the sending context - case 0: // SendingContext/CodeBase/get_ir - { - com.sun.org.omg.CORBA.Repository __result = null; - __result = this.get_ir (); - com.sun.org.omg.CORBA.RepositoryHelper.write (out, __result); - break; - } - - - // Operations to obtain a URL to the implementation code - case 1: // SendingContext/CodeBase/implementation - { - String x = com.sun.org.omg.CORBA.RepositoryIdHelper.read (in); - String __result = null; - __result = this.implementation (x); - out.write_string (__result); - break; - } - - case 2: // SendingContext/CodeBase/implementations - { - String x[] = com.sun.org.omg.CORBA.RepositoryIdSeqHelper.read (in); - String __result[] = null; - __result = this.implementations (x); - com.sun.org.omg.SendingContext.CodeBasePackage.URLSeqHelper.write (out, __result); - break; - } - - - // the same information - case 3: // SendingContext/CodeBase/meta - { - String x = com.sun.org.omg.CORBA.RepositoryIdHelper.read (in); - com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription __result = null; - __result = this.meta (x); - com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescriptionHelper.write (out, __result); - break; - } - - case 4: // SendingContext/CodeBase/metas - { - String x[] = com.sun.org.omg.CORBA.RepositoryIdSeqHelper.read (in); - com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription __result[] = null; - __result = this.metas (x); - com.sun.org.omg.SendingContext.CodeBasePackage.ValueDescSeqHelper.write (out, __result); - break; - } - - - // information - case 5: // SendingContext/CodeBase/bases - { - String x = com.sun.org.omg.CORBA.RepositoryIdHelper.read (in); - String __result[] = null; - __result = this.bases (x); - com.sun.org.omg.CORBA.RepositoryIdSeqHelper.write (out, __result); - break; - } - - default: - throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE); - } - - return out; - } // _invoke - - // Type-specific CORBA::Object operations - private static String[] __ids = { - "IDL:omg.org/SendingContext/CodeBase:1.0", - "IDL:omg.org/SendingContext/RunTime:1.0"}; - - public String[] _ids () - { - return (String[]) __ids.clone(); - } - - -} // class _CodeBaseImplBase diff --git a/src/java.corba/share/classes/com/sun/org/omg/SendingContext/_CodeBaseStub.java b/src/java.corba/share/classes/com/sun/org/omg/SendingContext/_CodeBaseStub.java deleted file mode 100644 index 23527eb73e5..00000000000 --- a/src/java.corba/share/classes/com/sun/org/omg/SendingContext/_CodeBaseStub.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.org.omg.SendingContext; - - -/** -* com/sun/org/omg/SendingContext/_CodeBaseStub.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from rt.idl -* Thursday, May 6, 1999 1:52:08 AM PDT -*/ - -public class _CodeBaseStub extends org.omg.CORBA.portable.ObjectImpl implements com.sun.org.omg.SendingContext.CodeBase -{ - // Constructors - // NOTE: If the default constructor is used, the - // object is useless until _set_delegate (...) - // is called. - public _CodeBaseStub () - { - super (); - } - - public _CodeBaseStub (org.omg.CORBA.portable.Delegate delegate) - { - super (); - _set_delegate (delegate); - } - - - // Operation to obtain the IR from the sending context - public com.sun.org.omg.CORBA.Repository get_ir () - { - org.omg.CORBA.portable.InputStream _in = null; - try { - org.omg.CORBA.portable.OutputStream _out = _request ("get_ir", true); - _in = _invoke (_out); - com.sun.org.omg.CORBA.Repository __result = com.sun.org.omg.CORBA.RepositoryHelper.read (_in); - return __result; - } catch (org.omg.CORBA.portable.ApplicationException _ex) { - _in = _ex.getInputStream (); - String _id = _ex.getId (); - throw new org.omg.CORBA.MARSHAL (_id); - } catch (org.omg.CORBA.portable.RemarshalException _rm) { - return get_ir (); - } finally { - _releaseReply (_in); - } - } // get_ir - - - // Operations to obtain a URL to the implementation code - public String implementation (String x) - { - org.omg.CORBA.portable.InputStream _in = null; - try { - org.omg.CORBA.portable.OutputStream _out = _request ("implementation", true); - com.sun.org.omg.CORBA.RepositoryIdHelper.write (_out, x); - _in = _invoke (_out); - String __result = com.sun.org.omg.SendingContext.CodeBasePackage.URLHelper.read (_in); - return __result; - } catch (org.omg.CORBA.portable.ApplicationException _ex) { - _in = _ex.getInputStream (); - String _id = _ex.getId (); - throw new org.omg.CORBA.MARSHAL (_id); - } catch (org.omg.CORBA.portable.RemarshalException _rm) { - return implementation (x); - } finally { - _releaseReply (_in); - } - } // implementation - - public String[] implementations (String[] x) - { - org.omg.CORBA.portable.InputStream _in = null; - try { - org.omg.CORBA.portable.OutputStream _out = _request ("implementations", true); - com.sun.org.omg.CORBA.RepositoryIdSeqHelper.write (_out, x); - _in = _invoke (_out); - String __result[] = com.sun.org.omg.SendingContext.CodeBasePackage.URLSeqHelper.read (_in); - return __result; - } catch (org.omg.CORBA.portable.ApplicationException _ex) { - _in = _ex.getInputStream (); - String _id = _ex.getId (); - throw new org.omg.CORBA.MARSHAL (_id); - } catch (org.omg.CORBA.portable.RemarshalException _rm) { - return implementations (x); - } finally { - _releaseReply (_in); - } - } // implementations - - - // the same information - public com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription meta (String x) - { - org.omg.CORBA.portable.InputStream _in = null; - try { - org.omg.CORBA.portable.OutputStream _out = _request ("meta", true); - com.sun.org.omg.CORBA.RepositoryIdHelper.write (_out, x); - _in = _invoke (_out); - com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription __result = com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescriptionHelper.read (_in); - return __result; - } catch (org.omg.CORBA.portable.ApplicationException _ex) { - _in = _ex.getInputStream (); - String _id = _ex.getId (); - throw new org.omg.CORBA.MARSHAL (_id); - } catch (org.omg.CORBA.portable.RemarshalException _rm) { - return meta (x); - } finally { - _releaseReply (_in); - } - } // meta - - public com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription[] metas (String[] x) - { - org.omg.CORBA.portable.InputStream _in = null; - try { - org.omg.CORBA.portable.OutputStream _out = _request ("metas", true); - com.sun.org.omg.CORBA.RepositoryIdSeqHelper.write (_out, x); - _in = _invoke (_out); - com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription __result[] = com.sun.org.omg.SendingContext.CodeBasePackage.ValueDescSeqHelper.read (_in); - return __result; - } catch (org.omg.CORBA.portable.ApplicationException _ex) { - _in = _ex.getInputStream (); - String _id = _ex.getId (); - throw new org.omg.CORBA.MARSHAL (_id); - } catch (org.omg.CORBA.portable.RemarshalException _rm) { - return metas (x); - } finally { - _releaseReply (_in); - } - } // metas - - - // information - public String[] bases (String x) - { - org.omg.CORBA.portable.InputStream _in = null; - try { - org.omg.CORBA.portable.OutputStream _out = _request ("bases", true); - com.sun.org.omg.CORBA.RepositoryIdHelper.write (_out, x); - _in = _invoke (_out); - String __result[] = com.sun.org.omg.CORBA.RepositoryIdSeqHelper.read (_in); - return __result; - } catch (org.omg.CORBA.portable.ApplicationException _ex) { - _in = _ex.getInputStream (); - String _id = _ex.getId (); - throw new org.omg.CORBA.MARSHAL (_id); - } catch (org.omg.CORBA.portable.RemarshalException _rm) { - return bases (x); - } finally { - _releaseReply (_in); - } - } // bases - - // Type-specific CORBA::Object operations - private static String[] __ids = { - "IDL:omg.org/SendingContext/CodeBase:1.0", - "IDL:omg.org/SendingContext/RunTime:1.0"}; - - public String[] _ids () - { - return (String[])__ids.clone (); - } - - private void readObject (java.io.ObjectInputStream s) - { - try - { - String str = s.readUTF (); - org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init ().string_to_object (str); - org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate (); - _set_delegate (delegate); - } catch (java.io.IOException e) {} - } - - private void writeObject (java.io.ObjectOutputStream s) - { - try - { - String str = org.omg.CORBA.ORB.init ().object_to_string (this); - s.writeUTF (str); - } catch (java.io.IOException e) {} - } -} // class _CodeBaseStub diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Arguments.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Arguments.java deleted file mode 100644 index 35a03442c70..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Arguments.java +++ /dev/null @@ -1,325 +0,0 @@ -/* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: -// -F46082.51 Remove -stateful option. "Stateful interfaces" obsolete. -// -D58319 Add -version option. Note that this may occur as the last -// argument on the command-line. -// -F60858.1 Add -corba [level] option. Accept IDL upto this level, and -// behave in a "proprietary manner" otherwise. -// -D62023 Add -noWarn option to supress warnings. - -import java.io.DataInputStream; -import java.io.IOException; -import java.util.Hashtable; -import java.util.Properties; -import java.util.Vector; -import java.util.StringTokenizer; -import java.lang.reflect.Modifier; -import java.lang.reflect.Field; - -import com.sun.tools.corba.se.idl.som.cff.FileLocator; - -/** - * This class is responsible for parsing the command line arguments to the - * compiler. To add new arguments to the compiler, this class must be extended - * and the parseOtherArgs method overridden. - **/ -public class Arguments -{ - /** - * Method parseOtherArgs() is called when the framework detects arguments - * which are unknown to it. The default implementation of this method simply - * throws an InvalidArgument exception. Any overriding implementation - * must check the arguments passed to it for validity and process the - * arguments appropriately. If it detects an invalid argument, it should - * throw an InvalidArgument exception. Arguments MUST be of the form - * {@code '/ []'} or {@code '- []'} where {@code } - * is optional (for example, -iC:\includes, 'C:\includes' is the qualifier - * for the argument 'i'). - * @param args The arguments which are unknown by the framework. - * @param properties Environment-style properties collected from the - * file idl.config. - * @exception idl.InvalidArgument if the argument is unknown. - **/ - protected void parseOtherArgs (String[] args, Properties properties) throws InvalidArgument - { - if (args.length > 0) - throw new InvalidArgument (args[0]); - } // parseOtherArgs - - - protected void setDebugFlags( String args ) - { - StringTokenizer st = new StringTokenizer( args, "," ) ; - while (st.hasMoreTokens()) { - String token = st.nextToken() ; - - // If there is a public boolean data member in this class - // named token + "DebugFlag", set it to true. - try { - Field fld = this.getClass().getField( token + "DebugFlag" ) ; - int mod = fld.getModifiers() ; - if (Modifier.isPublic( mod ) && !Modifier.isStatic( mod )) - if (fld.getType() == boolean.class) - fld.setBoolean( this, true ) ; - } catch (Exception exc) { - // ignore it - } - } - } - - /** - * Collect the command-line parameters. - **/ - void parseArgs (String[] args) throws InvalidArgument { - Vector unknownArgs = new Vector (); - int i = 0; - - try { - // Process command line parameters - for (i = 0; i < args.length - 1; ++i) { - String lcArg = args[i].toLowerCase (); - if (lcArg.charAt (0) != '-' && lcArg.charAt (0) != '/') - throw new InvalidArgument (args[i]); - if (lcArg.charAt (0) == '-' ) { - lcArg = lcArg.substring (1); - } - - // Include path - if (lcArg.equals ("i")) { - includePaths.addElement (args[++i]); - } else if (lcArg.startsWith ("i")) { - includePaths.addElement (args[i].substring (2)); - } else if (lcArg.equals ("v") || lcArg.equals ("verbose")) { - // Verbose mode - verbose = true; - } else if (lcArg.equals ("d")) { - // Define symbol - definedSymbols.put (args[++i], ""); - } else if (lcArg.equals( "debug" )) { - // Turn on debug flags - setDebugFlags( args[++i] ) ; - } else if (lcArg.startsWith ("d")) { - definedSymbols.put (args[i].substring (2), ""); - } else if (lcArg.equals ("emitall")) { - // Emit bindings for included sources - emitAll = true; - } else if (lcArg.equals ("keep")) { - // Keep old files - keepOldFiles = true; - } else if (lcArg.equals ("nowarn")) { - // Suppress warnings - noWarn = true; - } else if (lcArg.equals ("trace")) { - // Allow tracing. - Runtime.getRuntime ().traceMethodCalls (true); - } - // Remove -stateful feature. - //else if (lcArg.equals ("stateful")) - //{ - // Emit stateful bindings. - // parseStateful = true; - //} - // CPPModule - else if ( lcArg.equals ("cppmodule")) { - cppModule = true; - } else if (lcArg.equals ("version")) { - // Version - versionRequest = true; - } else if (lcArg.equals ("corba")) { - // CORBA level - if (i + 1 >= args.length) - throw new InvalidArgument (args[i]); - String level = args[++i]; - if (level.charAt (0) == '-') - throw new InvalidArgument (args[i - 1]); - try { - corbaLevel = new Float (level).floatValue (); - } catch (NumberFormatException e) { - throw new InvalidArgument (args[i]); - } - } else { - unknownArgs.addElement (args[i]); - ++i; - while (i < (args.length - 1) && - args[i].charAt (0) != '-' && - args[i].charAt (0) != '/') { - unknownArgs.addElement (args[i++]); - } - --i; - } - } - } catch (ArrayIndexOutOfBoundsException e) { - // If there is any array indexing problem, it is probably - // because the qualifier on the last argument is missing. - // Report that this last argument is invalid. - throw new InvalidArgument (args[args.length - 1]); - } - - // - // The last argument is the file argument or "-version", which may - // be specified without a file argument. - if (i == args.length - 1) { - if (args[i].toLowerCase ().equals ("-version")) - versionRequest = true; - else - file = args[i]; - } else - throw new InvalidArgument (); - - // Get and process the idl.config file. - Properties props = new Properties (); - try { - DataInputStream stream = FileLocator.locateFileInClassPath ("idl.config"); - props.load (stream); - addIncludePaths (props); - } catch (IOException e) { - } - - // Call parseOtherArgs. By default, if there are unknown args, - // InvalidArgument is called. A call to parseOtherArgs is useful - // only when this framework has been extended. - String[] otherArgs; - if (unknownArgs.size () > 0) { - otherArgs = new String[unknownArgs.size ()]; - unknownArgs.copyInto (otherArgs); - } else - otherArgs = new String[0]; - - parseOtherArgs (otherArgs, props); - } // parseArgs - - /** - * - **/ - private void addIncludePaths (Properties props) - { - String paths = props.getProperty ("includes"); - if (paths != null) - { - String separator = System.getProperty ("path.separator"); - int end = -separator.length (); // so the first pass paths == original paths - do - { - paths = paths.substring (end + separator.length ()); - end = paths.indexOf (separator); - if (end < 0) - end = paths.length (); - includePaths.addElement (paths.substring (0, end)); - } - while (end != paths.length ()); - } - } // addIncludePaths - - /** - * The name of the IDL file. - **/ - public String file = null; - - /** - * True if the user wishes to see processing remarks. - **/ - public boolean verbose = false; - - /** - * If this is true, then existing files should not be overwritten - * by the compiler. - **/ - public boolean keepOldFiles = false; - - /** - * If this is true, then the types in all included files are also emitted. - **/ - public boolean emitAll = false; - - // Remove -stateful feature. - ///** - // * If this is true, then stateful interfaces (for the Objects-by-Value - // * proposal) are allowed. This is not yet a standard, so it must - // * explicitly be called for by setting the -stateful argument to the - // * compiler. If -stateful does not appear on the command line, then - // * the IDL will be parsed according to the standards. - // **/ - //public boolean parseStateful = false; - /** - * A list of strings, each of which is a path from which included files - * are found. - **/ - public Vector includePaths = new Vector (); - - /** - * A table of defined symbols. The key is the symbol name; the value - * (if any) is the replacement value for the symbol. - **/ - public Hashtable definedSymbols = new Hashtable (); - - /** - * (f46082.46.01) True if new module entries are created for each - * re-opened module. - **/ - public boolean cppModule = false; - - /** - * -version option. - **/ - public boolean versionRequest = false; // - - // Specify the maximal level of the CORBA spec. the parser - // will support. - // - // NOTE: For BOSS 3.0, specify at 2.2. Raise to greater value in future - // releases. - /** - * -corba [level] option, where [level] is a floating-point number indicating - * the maximal level of CORBA IDL the parser framework can accept. - **/ - public float corbaLevel = 2.2f; - // - /** - * -noWarn option. Suppress warnings when true. - **/ - public boolean noWarn = false; // Issue warnings by default. - - // Currently defined debug flags. Any additions must be called xxxDebugFlag. - // All debug flags must be public boolean types. - // These are set by passing the flag -ORBDebug x,y,z in the ORB init args. - // Note that x,y,z must not contain spaces. - public boolean scannerDebugFlag = false ; - public boolean tokenDebugFlag = false ; - -} // class Arguments diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/AttributeEntry.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/AttributeEntry.java deleted file mode 100644 index 0ce15c334c0..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/AttributeEntry.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -/** - * This is the symbol table entry for attributes. An attribute is simply - * two methods with no exceptions or contexts: a get method and, if not - * readOnly, a set method. - **/ -public class AttributeEntry extends MethodEntry -{ - protected AttributeEntry () - { - super (); - } // ctor - - protected AttributeEntry (AttributeEntry that) - { - super (that); - _readOnly = that._readOnly; - } // ctor - - protected AttributeEntry (InterfaceEntry that, IDLID clone) - { - super (that, clone); - } // ctor - - public Object clone () - { - return new AttributeEntry (this); - } // clone - - /** Invoke the attribute generator. - @param symbolTable the symbol table is a hash table whose key is - a fully qualified type name and whose value is a SymtabEntry or - a subclass of SymtabEntry. - @param stream the stream to which the generator should sent its output. - @see SymtabEntry */ - public void generate (Hashtable symbolTable, PrintWriter stream) - { - attributeGen.generate (symbolTable, this, stream); - } // generate - - /** Access the attribute generator. - @return an object which implements the AttributeGen interface. - @see AttributeGen */ - public Generator generator () - { - return attributeGen; - } // generator - - /** if true, only a get method will be generated. */ - public boolean readOnly () - { - return _readOnly; - } // readOnly - - /** if true, only a get method will be generated. */ - public void readOnly (boolean readOnly) - { - _readOnly = readOnly; - } // readOnly - - static AttributeGen attributeGen; - - public boolean _readOnly = false; -} // class AttributeEntry diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/AttributeGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/AttributeGen.java deleted file mode 100644 index a0417799adc..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/AttributeGen.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -public interface AttributeGen extends Generator -{ - void generate (Hashtable symbolTable, AttributeEntry entry, PrintWriter stream); -} // interface AttributeGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Comment.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Comment.java deleted file mode 100644 index 698d29222d9..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Comment.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.io.IOException; -import java.util.StringTokenizer; - -public class Comment -{ - // Styles - static final int UNKNOWN = -1; - static final int JAVA_DOC = 0; - static final int C_BLOCK = 1; - static final int CPP_LINE = 2; - - // System-dependent line separator - private static String _eol = System.getProperty ("line.separator"); - - private String _text = new String (""); - private int _style = UNKNOWN; - - Comment () {_text = new String (""); _style = UNKNOWN;} // ctor - - Comment (String text) {_text = text; _style = style (_text);} // ctor - - /** Sets comment text */ - public void text (String string) {_text = string; _style = style (_text);} - - /** Returns comment text */ - public String text () {return _text;} - - /** Returns the comment style of a string. */ - private int style (String text) - { - if (text == null) - return UNKNOWN; - else if (text.startsWith ("/**") && text.endsWith ("*/")) - return JAVA_DOC; - else if (text.startsWith ("/*") && text.endsWith ("*/")) - return C_BLOCK; - else if (text.startsWith ("//")) - return CPP_LINE; - else - return UNKNOWN; - } // style - - /** Writes comment text to standard output (debug). */ - public void write () {System.out.println (_text);} - - /** Writes comment text to the specified print stream in the appropriate format. */ - public void generate (String indent, PrintWriter printStream) - { - if (_text == null || printStream == null) - return; - if (indent == null) - indent = new String (""); - switch (_style) - { - case JAVA_DOC: - //printJavaDoc (indent, printStream); - print (indent, printStream); - break; - case C_BLOCK: - //printCBlock (indent, printStream); - print (indent, printStream); - break; - case CPP_LINE: - //printCppLine (indent, printStream); - print (indent, printStream); - break; - default: - break; - } - } // generate - - /** Writes comment to the specified print stream without altering its format. - This routine does not alter vertical or horizontal spacing of comment text, - thus, it only works well for comments with a non-indented first line. */ - private void print (String indent, PrintWriter stream) - { - String text = _text.trim () + _eol; - String line = null; - - int iLineStart = 0; - int iLineEnd = text.indexOf (_eol); - int iTextEnd = text.length () - 1; - - stream.println (); - while (iLineStart < iTextEnd) - { - line = text.substring (iLineStart, iLineEnd); - stream.println (indent + line); - iLineStart = iLineEnd + _eol.length (); - iLineEnd = iLineStart + text.substring (iLineStart).indexOf (_eol); - } - } // print - - /* - * The following routines print formatted comments of differing styles. - * Each routine will alter the horizontal spacing of the comment text, - * but not the vertical spacing. - */ - - /** Writes comment in JavaDoc-style to the specified print stream. */ - private void printJavaDoc (String indent, PrintWriter stream) - { - // Strip surrounding "/**", "*/", and whitespace; append sentinel - String text = _text.substring (3, (_text.length () - 2)).trim () + _eol; - String line = null; - - int iLineStart = 0; - int iLineEnd = text.indexOf (_eol); - int iTextEnd = text.length () - 1; // index of last text character - - stream.println (_eol + indent + "/**"); - while (iLineStart < iTextEnd) - { - line = text.substring (iLineStart, iLineEnd).trim (); - if (line.startsWith ("*")) - // Strip existing "*" prefix - stream.println (indent + " * " + line.substring (1, line.length ()).trim ()); - else - stream.println (indent + " * " + line); - iLineStart = iLineEnd + _eol.length (); - iLineEnd = iLineStart + text.substring (iLineStart).indexOf (_eol); - } - stream.println (indent + " */"); - } // printJavaDoc - - /** Writes comment in c-block-style to the specified print stream. */ - private void printCBlock (String indent, PrintWriter stream) - { - // Strip surrounding "/*", "*/", and whitespace; append sentinel - String text = _text.substring (2, (_text.length () - 2)).trim () + _eol; - String line = null; - - int iLineStart = 0; - int iLineEnd = text.indexOf (_eol); - int iTextEnd = text.length () - 1; // index of last text character - - stream.println (indent + "/*"); - while (iLineStart < iTextEnd) - { - line = text.substring (iLineStart, iLineEnd).trim (); - if (line.startsWith ("*")) - // Strip existing "*[ws]" prefix - stream.println (indent + " * " + line.substring (1, line.length ()).trim ()); - else - stream.println (indent + " * " + line); - iLineStart = iLineEnd + _eol.length (); - iLineEnd = iLineStart + text.substring (iLineStart).indexOf (_eol); - } - stream.println (indent + " */"); - } // printCBlock - - /** Writes a line comment to the specified print stream. */ - private void printCppLine (String indent, PrintWriter stream) - { - stream.println (indent + "//"); - // Strip "//[ws]" prefix - stream.println (indent + "// " + _text.substring (2).trim ()); - stream.println (indent + "//"); - } // printCppLine -} // class Comment - - -/*================================================================================== - DATE ACTION - ---------------------------------------------------------------------------------- - 11aug1997 Initial version completed. - 18aug1997 Modified generate to write comment unformatted. - ==================================================================================*/ diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Compile.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Compile.java deleted file mode 100644 index a3e04732873..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Compile.java +++ /dev/null @@ -1,520 +0,0 @@ -/* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: -// -D56351 Update computation of RepositoryIDs to CORBA 2.3 (see spec.). -// -D58319 Display version info. for -version option. - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Vector; - -import com.sun.tools.corba.se.idl.constExpr.ExprFactory; -import com.sun.tools.corba.se.idl.constExpr.DefaultExprFactory; - -/** - * Compiler usage: - *

            - * - * {@code java com.sun.tools.corba.se.idl.toJava.compile [options] } - *

            - * - * where <idl file> is the name of a file containing IDL definitions, - * and [options] is any combination of the options listed below. The options - * and the idl file name can appear in any order. - *

            - * - * Options: - *

            - *
            {@code -i } - *
            By default, the current directory is scanned for included files. - * This option adds another directory. See also Note 1 below. - * - *
            {@code -d } - *
            This is equivalent to the following line in an IDL file: {@code #define } - * - *
            {@code -emitAll} - *
            Emit all types, including those found in #included files. - * - *
            {@code -v} - *
            Verbose mode. - *
            - * - * Note 1: If you have an include path or paths that you will always be using, - * it can get tedious putting these on the command with the -i option all the - * time. Instead, these can be placed into a config file called idl.config. - * This file must be in the CLASSPATH. The format of the includes line is: - * - *
            {@code
            - * includes=;;...;
            - * }
            - * - * Note that the path separator character, here shown as a semicolon, is - * machine dependent. For instance, on Windows 95 this character is a - * semicolon, on UNIX it is a colon. - * - *

            - * Note 2: If you are directly invoking the main method on this class (not - * a subclass), then it will only check that the IDL file is syntactically - * correct. It does not generate any files. Only extensions to this - * framework generate files, therefore an extension must be invoked if you - * want files to be generated. - *

            - * - * To Extend the compiler: - *

            - * - * You only need to extend the compiler if you want it to generate something - * other than what it currently generates. - *

            - * - * Step 1 - Implement the generator interfaces: - *

            - * - * Each generator interface defines one method: generate (Hashtable, XXXEntry, PrintWriter); - *
            - * - The Hashtable is the symbol table; each element is a SymtabEntry (or a - * subclass of SymtabEntry) and is keyed by its fully qualified name; - *
            - * - XXXEntry is the appropriate entry for the type to be generated. For - * example: AttributeGen defines generate (Hashtable, AttributeEntry, PrintWriter); - * ConstGen defines generate (Hashtable, ConstEntry, PrintWriter); etc. - *
            - * - The PrintWriter is a stream to the file being generated. For the - * generators called by the compiler framework, this will be null. The - * generator is responsible for creating and opening files. But for - * generators that are called by other generators - for instance, - * MethodGen.generate will most likely be called by InterfaceGen.generate - - * this parameter is provided so that the proper file can be written to. - *

            - * - * Step 2 - Implement the GenFactory interface: - *

            - * - * All of the generators implemented in Step 1 must be created somehow. There - * is an interface for a factory, GenFactory, which must be implemented. The - * name of this factory must be set in the extension to the Compile class (see - * Step 3, below). - *

            - * - * Step 3 - Extend com.sun.tools.corba.se.idl.Factories: - *

            - * - * Extend com.sun.tools.corba.se.idl.Factories and override the method genFactory. This - * method must return an instance of the factory which you implemented in - * step 2. Your extension of this class may also do more, this is only the - * minimum. See com.sun.tools.corba.se.idl.Factories for more information. - *

            - * - * Step 4 - Extend com.sun.tools.corba.se.idl.Compile: - *

            - * - * Your extension of com.sun.tools.corba.se.idl.Compile should contain a minimum of - * two methods: - *

            - *
            protected com.sun.tools.corba.se.idl.Factories () - *
            This method overrides com.sun.tools.corba.se.idl.Compile.factories and returns your - * extension from Step 3. - * - *
            public static void main (String[] args) - *
            This main method must instantiate this class and call its start method. - *
            - * - * Given that the extension of Factories is MyFactories, the extension of - * Compile could be: - * - *
            - * public class MyCompile extends com.sun.tools.corba.se.idl.Compile
            - * {
            - *   protected com.sun.tools.corba.se.idl.Factories factories ()
            - *   {
            - *     return new MyFactories ();
            - *   }
            - *   public static void main (String[] args)
            - *   {
            - *     MyCompile compile = new MyCompile ();
            - *     compile.start (args);
            - *   }
            - * }
            - * 
            - * - * If you would like a bit more control over the processing of the framework, - * you can replace compile.start with what it calls. But then you also have - * to handle the exceptions which start handles for you: - *
            - * public class MyCompile extends com.sun.tools.corba.se.idl.Compile
            - * {
            - *   ...
            - *
            - *   public static void main (String[] args)
            - *   {
            - *     MyCompile compile = new MyCompile ();
            - *     try
            - *     {
            - *       compile.init (args);
            - *       java.util.Enumeration emitList = compile.parse ();
            - *       compile.generate ();
            - *     }
            - *     catch (com.sun.tools.corba.se.idl.InvalidArgument e)
            - *     {
            - *       System.err.println (e);
            - *     }
            - *     catch (java.io.IOException e)
            - *     {
            - *       System.err.println (e);
            - *     }
            - *   }
            - * }
            - * 
            - * - * Note that compile.parse returns an enumeration. This enumerates the - * SymtabEntry's which should be generated. If the parse method detects - * errors, it returns null. Note that you do not have to check that - * `emitList' is valid before calling generate (that's done internally), but - * if you do any processing between parse and generate, emitList should be - * checked before executing that code. - *

            - **/ -public class Compile -{ - public Compile () - { - noPragma.init (preprocessor); - preprocessor.registerPragma (noPragma); - - // Reset static variables to allow parsing multiple sources. - // DO NOT reset SymtabEntry.maxKey because it crashes IDLC. - ParseException.detected = false; - SymtabEntry.includeStack = new java.util.Stack (); - SymtabEntry.setEmit = true; - //SymtabEntry.maxKey = -1; - Parser.repIDStack = new java.util.Stack (); // - } // ctor - - public static void main (String[] args) - { - (new Compile ()).start (args); - } // main - - protected Factories factories () - { - return new Factories (); - } // genFactoryName - - protected void registerPragma (PragmaHandler handler) - { - handler.init (preprocessor); - preprocessor.registerPragma (handler); - } // registerPragma - - /** - * Initialize the framework. - **/ - protected void init (String[] args) throws InvalidArgument - { - initFactories (); - arguments.parseArgs (args); - initGenerators (); - parser = new Parser (preprocessor, arguments, overrideNames, symbolTable, symtabFactory, exprFactory, keywords); - preprocessor.init (parser); - parser.includes = includes; - parser.includeEntries = includeEntries; - } // init - - /** - * Parse the IDL file and return an enumeration of the symbols to be - * generated. All elements of the Enumeration will be extensions of - * SymtabEntry. If any errors were encountered during parsing, null - * will be returned. - **/ - protected Enumeration parse () throws IOException - { - if (arguments.verbose) - System.out.println (Util.getMessage ("Compile.parsing", arguments.file)); - parser.parse (arguments.file); - if ( !ParseException.detected ) - { - parser.forwardEntryCheck(); - - // <46082.03> Revert to "IDL:"-style (i.e., regular) repository ID. - //parser.updateRepositoryIds(); - } - if (arguments.verbose) - System.out.println (Util.getMessage ("Compile.parseDone", arguments.file)); - if (ParseException.detected) - { - symbolTable = null; - emitList = null; - } - else - { - symbolTable = parser.symbolTable; - emitList = parser.emitList.elements (); - } - return emitList; - } // parse - - /** - * Invoke the generators. - **/ - protected void generate () throws IOException - { - /* - // print the symbol table - Enumeration v = parser.symbolTable.elements (); - Enumeration k = parser.symbolTable.keys (); - while (k.hasMoreElements ()) - System.out.println (k.nextElement () + ": " + v.nextElement ()); - */ - if (ParseException.detected) - emitList = null; - else - emitList = parser.emitList.elements (); - if (emitList != null) - { - // Emit the output files for all of the types in the IDL file - if (arguments.verbose) - System.out.println (); - while (emitList.hasMoreElements ()) - { - SymtabEntry entry = (SymtabEntry)emitList.nextElement (); - if (arguments.verbose) - if (entry.generator () instanceof Noop) - ; // Nothing will be generated, so don't say so. - else if (entry.module () . equals ("")) - System.out.println (Util.getMessage ("Compile.generating", entry.name ())); - else - System.out.println (Util.getMessage ("Compile.generating", entry.module () + '/' + entry.name ())); - entry.generate (symbolTable, null); - if (arguments.verbose) - if (entry.generator () instanceof Noop) - ; // Nothing will be generated, so don't say so. - else if (entry.module () . equals ("")) - System.out.println (Util.getMessage ("Compile.genDone", entry.name ())); - else - System.out.println (Util.getMessage ("Compile.genDone", entry.module () + '/' + entry.name ())); - } - } - } // generate - - /** - * Start the parse/code generation process. This method calls init, - * parse, generate. If more control is desired, rather than call start, - * those three methods could be called explicitly. - **/ - public void start (String[] args) - { - try - { - init (args); - if (arguments.versionRequest) // - displayVersion (); - else - { - parse (); - generate (); - } - } - catch (InvalidArgument e) - { - System.err.println (e); - } - catch (IOException e) - { - System.err.println (e); - } - } // start - - private void initFactories () - { - // Get the factories. - Factories factories = factories (); - if (factories == null) factories = new Factories (); - - // Get the argument processor from the factories. - Arguments tmpArgs = factories.arguments (); - if (tmpArgs == null) - arguments = new Arguments (); - else - arguments = tmpArgs; - - // Get the symbol table entry factory from the factories. - SymtabFactory tmpSTF = factories.symtabFactory (); - if (tmpSTF == null) - symtabFactory = new DefaultSymtabFactory (); - else - symtabFactory = tmpSTF; - - // Get the expression factory from the factories. - ExprFactory tmpExpF = factories.exprFactory (); - if (tmpExpF == null) - exprFactory = new DefaultExprFactory (); - else - exprFactory = tmpExpF; - - // Get the generator factory from the factories. - GenFactory tmpGenF = factories.genFactory (); - if (tmpGenF == null) - genFactory = noop; - else - genFactory = tmpGenF; - - // Get the language keywords. - keywords = factories.languageKeywords (); - if (keywords == null) - keywords = new String[0]; - } // initFactories - - private void initGenerators () - { - AttributeGen agen = genFactory.createAttributeGen (); - AttributeEntry.attributeGen = agen == null ? noop : agen; - - ConstGen cgen = genFactory.createConstGen (); - ConstEntry.constGen = cgen == null ? noop : cgen; - - EnumGen egen = genFactory.createEnumGen (); - EnumEntry.enumGen = egen == null ? noop : egen; - - ExceptionGen exgen = genFactory.createExceptionGen (); - ExceptionEntry.exceptionGen = exgen == null ? noop : exgen; - - ForwardGen fgen = genFactory.createForwardGen (); - ForwardEntry.forwardGen = fgen == null ? noop : fgen; - - ForwardValueGen fvgen = genFactory.createForwardValueGen (); - ForwardValueEntry.forwardValueGen = fvgen == null ? noop : fvgen; - - IncludeGen ingen = genFactory.createIncludeGen (); - IncludeEntry.includeGen = ingen == null ? noop : ingen; - - InterfaceGen igen = genFactory.createInterfaceGen (); - InterfaceEntry.interfaceGen = igen == null ? noop : igen; - - ValueGen vgen = genFactory.createValueGen (); - ValueEntry.valueGen = vgen == null ? noop : vgen; - - ValueBoxGen vbgen = genFactory.createValueBoxGen (); - ValueBoxEntry.valueBoxGen = vbgen == null ? noop : vbgen; - - MethodGen mgen = genFactory.createMethodGen (); - MethodEntry.methodGen = mgen == null ? noop : mgen; - - ModuleGen modgen = genFactory.createModuleGen (); - ModuleEntry.moduleGen = modgen == null ? noop : modgen; - - NativeGen ngen = genFactory.createNativeGen (); - NativeEntry.nativeGen = ngen == null ? noop : ngen; - - ParameterGen pgen = genFactory.createParameterGen (); - ParameterEntry.parameterGen = pgen == null ? noop : pgen; - - PragmaGen prgen = genFactory.createPragmaGen (); - PragmaEntry.pragmaGen = prgen == null ? noop : prgen; - - PrimitiveGen primgen = genFactory.createPrimitiveGen (); - PrimitiveEntry.primitiveGen = primgen == null ? noop : primgen; - - SequenceGen seqgen = genFactory.createSequenceGen (); - SequenceEntry.sequenceGen = seqgen == null ? noop : seqgen; - - StringGen strgen = genFactory.createStringGen (); - StringEntry.stringGen = strgen == null ? noop : strgen; - - StructGen sgen = genFactory.createStructGen (); - StructEntry.structGen = sgen == null ? noop : sgen; - - TypedefGen tgen = genFactory.createTypedefGen (); - TypedefEntry.typedefGen = tgen == null ? noop : tgen; - - UnionGen ugen = genFactory.createUnionGen (); - UnionEntry.unionGen = ugen == null ? noop : ugen; - } // initGenerators - - /** - * Write the version number of this compiler to standard out. - **/ - protected void displayVersion () - { - String message = Util.getMessage ("Version.product", Util.getMessage ("Version.number")); - System.out.println (message); - } - - /** - * This is the repository of emitter arguments. - **/ - public Arguments arguments = null; - /** - * This hashtable contains {@code } pairs. It is filled in by - * extenders in cases where they wish to override an IDL type name with - * some other name. For instance, when mapping to Java, there could be - * an overrideNames entry of {@code <"TRUE", "true">}. NOTE: Do NOT change this - * variable to a new Hash table. Just add elements to it. - **/ - protected Hashtable overrideNames = new Hashtable (); - /** - * This is the symbol table. It will be empty until the parse method - * executes. If errors are encountered, the state of the symbol table - * is undefined. - **/ - protected Hashtable symbolTable = new Hashtable (); - /** - * This is a vector of strings of the form {@code "IDLfile"} or {@code }. - * It is a list of the files included in the given IDL file. It will be empty - * until the parse method executes. If errors are encountered, the state - * of this vector is undefined. - **/ - protected Vector includes = new Vector (); - /** - * This is a vector of IncludeEntry's. It is a list of the files included - * in the given IDL file. It mirrors the includes vector. It will be empty - * until the parse method executes. If errors are encountered, the state of - * this vector is undefined. - **/ - protected Vector includeEntries = new Vector (); - static Noop noop = new Noop (); - private GenFactory genFactory = null; - private SymtabFactory symtabFactory = null; - private ExprFactory exprFactory = null; - private Parser parser = null; - Preprocessor preprocessor = new Preprocessor (); - private NoPragma noPragma = new NoPragma (); - private Enumeration emitList = null; - private String[] keywords = null; -} // class Compile diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ConstEntry.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ConstEntry.java deleted file mode 100644 index 5f395be021b..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ConstEntry.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.constExpr.Expression; - -/** - * This is the symbol table entry for constants. - **/ -public class ConstEntry extends SymtabEntry -{ - protected ConstEntry () - { - super (); - } // ctor - - protected ConstEntry (ConstEntry that) - { - super (that); - if (module ().equals ("")) - module (name ()); - else if (!name ().equals ("")) - module (module () + "/" + name ()); - _value = that._value; - } // ctor - - /** This is a shallow copy constructor. */ - protected ConstEntry (SymtabEntry that, IDLID clone) - { - super (that, clone); - if (module ().equals ("")) - module (name ()); - else if (!name ().equals ("")) - module (module () + "/" + name ()); - } // ctor - - /** This is a shallow copy clone. */ - public Object clone () - { - return new ConstEntry (this); - } // clone - - /** Invoke the constant generator. - @param symbolTable the symbol table is a hash table whose key is - a fully qualified type name and whose value is a SymtabEntry or - a subclass of SymtabEntry. - @param stream the stream to which the generator should sent its output. - @see SymtabEntry */ - public void generate (Hashtable symbolTable, PrintWriter stream) - { - constGen.generate (symbolTable, this, stream); - } // generate - - /** Access the constant generator. - @return an object which implements the ConstGen interface. - @see ConstGen */ - public Generator generator () - { - return constGen; - } // generator - - public Expression value () - { - return _value; - } // value - - public void value (Expression newValue) - { - _value = newValue; - } // value - - static ConstGen constGen; - private Expression _value = null; -} // class ConstEntry diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ConstGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ConstGen.java deleted file mode 100644 index 8dde99e5d71..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ConstGen.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -public interface ConstGen extends Generator -{ - void generate (Hashtable symbolTable, ConstEntry entry, PrintWriter stream); -} // interface ConstGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/DefaultSymtabFactory.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/DefaultSymtabFactory.java deleted file mode 100644 index f10d86f8e96..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/DefaultSymtabFactory.java +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -/** - * This factory constructs the default symbol table entries, namely, - * those declared within the package com.sun.tools.corba.se.idl. - **/ -public class DefaultSymtabFactory implements SymtabFactory -{ - public AttributeEntry attributeEntry () - { - return new AttributeEntry (); - } // attributeEntry - - public AttributeEntry attributeEntry (InterfaceEntry container, IDLID id) - { - return new AttributeEntry (container, id); - } // attributeEntry - - public ConstEntry constEntry () - { - return new ConstEntry (); - } // constEntry - - public ConstEntry constEntry (SymtabEntry container, IDLID id) - { - return new ConstEntry (container, id); - } // constEntry - - public NativeEntry nativeEntry () - { - return new NativeEntry (); - } // interfaceEntry - - public NativeEntry nativeEntry (SymtabEntry container, IDLID id) - { - return new NativeEntry (container, id); - } // interfaceEntry - - public EnumEntry enumEntry () - { - return new EnumEntry (); - } // enumEntry - - public EnumEntry enumEntry (SymtabEntry container, IDLID id) - { - return new EnumEntry (container, id); - } // enumEntry - - public ExceptionEntry exceptionEntry () - { - return new ExceptionEntry (); - } // exceptionEntry - - public ExceptionEntry exceptionEntry (SymtabEntry container, IDLID id) - { - return new ExceptionEntry (container, id); - } // exceptionEntry - - public ForwardEntry forwardEntry () - { - return new ForwardEntry (); - } // forwardEntry - - public ForwardEntry forwardEntry (ModuleEntry container, IDLID id) - { - return new ForwardEntry (container, id); - } // forwardEntry - - public ForwardValueEntry forwardValueEntry () - { - return new ForwardValueEntry (); - } // forwardValueEntry - - public ForwardValueEntry forwardValueEntry (ModuleEntry container, IDLID id) - { - return new ForwardValueEntry (container, id); - } // forwardValueEntry - - public IncludeEntry includeEntry () - { - return new IncludeEntry (); - } // includeEntry - - public IncludeEntry includeEntry (SymtabEntry container) - { - return new IncludeEntry (container); - } // includeEntry - - public InterfaceEntry interfaceEntry () - { - return new InterfaceEntry (); - } // interfaceEntry - - public InterfaceEntry interfaceEntry (ModuleEntry container, IDLID id) - { - return new InterfaceEntry (container, id); - } // interfaceEntry - - public ValueEntry valueEntry () - { - return new ValueEntry (); - } // valueEntry - - public ValueEntry valueEntry (ModuleEntry container, IDLID id) - { - return new ValueEntry (container, id); - } // valueEntry - - public ValueBoxEntry valueBoxEntry () - { - return new ValueBoxEntry (); - } // valueBoxEntry - - public ValueBoxEntry valueBoxEntry (ModuleEntry container, IDLID id) - { - return new ValueBoxEntry (container, id); - } // valueBoxEntry - - public MethodEntry methodEntry () - { - return new MethodEntry (); - } // methodEntry - - public MethodEntry methodEntry (InterfaceEntry container, IDLID id) - { - return new MethodEntry (container, id); - } // methodEntry - - public ModuleEntry moduleEntry () - { - return new ModuleEntry (); - } // moduleEntry - - public ModuleEntry moduleEntry (ModuleEntry container, IDLID id) - { - return new ModuleEntry (container, id); - } // moduleEntry - - public ParameterEntry parameterEntry () - { - return new ParameterEntry (); - } // parameterEntry - - public ParameterEntry parameterEntry (MethodEntry container, IDLID id) - { - return new ParameterEntry (container, id); - } // parameterEntry - - public PragmaEntry pragmaEntry () - { - return new PragmaEntry (); - } // pragmaEntry - - public PragmaEntry pragmaEntry (SymtabEntry container) - { - return new PragmaEntry (container); - } // pragmaEntry - - public PrimitiveEntry primitiveEntry () - { - return new PrimitiveEntry (); - } // primitiveEntry - - /** "name" can be, but is not limited to, the primitive idl type names: - 'char', 'octet', 'short', 'long', etc. The reason it is not limited - to these is that, as an extender, you may wish to override these names. - For instance, when generating Java code, octet translates to byte, so - there is an entry in Compile.overrideNames: {@code <"octet", "byte">} and a - PrimitiveEntry in the symbol table for "byte". */ - public PrimitiveEntry primitiveEntry (String name) - { - return new PrimitiveEntry (name); - } // primitiveEntry - - public SequenceEntry sequenceEntry () - { - return new SequenceEntry (); - } // sequenceEntry - - public SequenceEntry sequenceEntry (SymtabEntry container, IDLID id) - { - return new SequenceEntry (container, id); - } // sequenceEntry - - public StringEntry stringEntry () - { - return new StringEntry (); - } // stringEntry - - public StructEntry structEntry () - { - return new StructEntry (); - } // structEntry - - public StructEntry structEntry (SymtabEntry container, IDLID id) - { - return new StructEntry (container, id); - } // structEntry - - public TypedefEntry typedefEntry () - { - return new TypedefEntry (); - } // typedefEntry - - public TypedefEntry typedefEntry (SymtabEntry container, IDLID id) - { - return new TypedefEntry (container, id); - } // typedefEntry - - public UnionEntry unionEntry () - { - return new UnionEntry (); - } // unionEntry - - public UnionEntry unionEntry (SymtabEntry container, IDLID id) - { - return new UnionEntry (container, id); - } // unionEntry - -} // interface DefaultSymtabFactory diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/EnumEntry.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/EnumEntry.java deleted file mode 100644 index ef7c048ce9b..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/EnumEntry.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; -import java.util.Vector; - -/** - * This is the symbol table entry for enumerated types. - **/ -public class EnumEntry extends SymtabEntry -{ - protected EnumEntry () - { - super (); - } // ctor - - protected EnumEntry (EnumEntry that) - { - super (that); - _elements = (Vector)that._elements.clone (); - } // ctor - - protected EnumEntry (SymtabEntry that, IDLID clone) - { - super (that, clone); - - if (module ().equals ("")) - module (name ()); - else if (!name ().equals ("")) - module (module () + "/" + name ()); - } // ctor - - public Object clone () - { - return new EnumEntry (this); - } // clone - - /** Invoke the enumerator generator. - @param symbolTable the symbol table is a hash table whose key is - a fully qualified type name and whose value is a SymtabEntry or - a subclass of SymtabEntry. - @param stream the stream to which the generator should sent its output. - @see SymtabEntry */ - public void generate (Hashtable symbolTable, PrintWriter stream) - { - enumGen.generate (symbolTable, this, stream); - } // generate - - /** Access the enumerator generator. - @return an object which implements the EnumGen interface. - @see EnumGen */ - public Generator generator () - { - return enumGen; - } // generator - - /** Add an element to the list of elements. */ - public void addElement (String element) - { - _elements.addElement (element); - } // addElement - - /** Each element of the vector is a String. */ - public Vector elements () - { - return _elements; - } // elements - - static EnumGen enumGen; - private Vector _elements = new Vector (); -} // class EnumEntry diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/EnumGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/EnumGen.java deleted file mode 100644 index 7a05ea4da74..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/EnumGen.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.*; - -public interface EnumGen extends Generator -{ - void generate (Hashtable symbolTable, EnumEntry entry, PrintWriter stream); -} // interface EnumGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ExceptionEntry.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ExceptionEntry.java deleted file mode 100644 index a669b5d701c..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ExceptionEntry.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Vector; - -/** - * This is the symbol table entry for exceptions. An exception is simply - * a struct by a different name. - **/ -public class ExceptionEntry extends StructEntry -{ - protected ExceptionEntry () - { - super (); - } // ctor - - protected ExceptionEntry (ExceptionEntry that) - { - super (that); - } // ctor - - protected ExceptionEntry (SymtabEntry that, IDLID clone) - { - super (that, clone); - } // ctor - - public Object clone () - { - return new ExceptionEntry (this); - } // clone - - /** Invoke the exception generator. - @param symbolTable the symbol table is a hash table whose key is - a fully qualified type name and whose value is a SymtabEntry or - a subclass of SymtabEntry. - @param stream the stream to which the generator should sent its output. - @see SymtabEntry */ - public void generate (Hashtable symbolTable, PrintWriter stream) - { - exceptionGen.generate (symbolTable, this, stream); - } // generate - - /** Access the exception generator. - @return an object which implements the ExceptionGen interface. - @see ExceptionGen */ - public Generator generator () - { - return exceptionGen; - } // generator - - static ExceptionGen exceptionGen; -} // class ExceptionEntry diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ExceptionGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ExceptionGen.java deleted file mode 100644 index 52cbea87a90..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ExceptionGen.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.*; - -public interface ExceptionGen extends Generator -{ - void generate (Hashtable symbolTable, ExceptionEntry entry, PrintWriter stream); -} // interface ExceptionGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Factories.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Factories.java deleted file mode 100644 index de17dfad79d..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Factories.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -/** - * If the framework is being extended, this class must be extended. - * At very least, the genFactory method must be overridden to return - * the code generator extensions. The remaining methods may be overridden - * if necessary: - *
            - *
            symtabFactory - *
            If you wish to extend the symbol table entries, this method must return the factory which constructs those extensions. If you only want to extend a few of the symbol table entries, it may be useful to extend com.sun.tools.corba.se.idl.DefaultSymtabFactory and only override the pertinent methods. - *
            exprFactory - *
            If you wish to extend the expression classes, this method must return the factory which constructs those extensions. If you only want to extend a few of the expression classes, it may be useful to extend com.sun.tools.corba.se.idl.constExpr.DefaultSymtabFactory and only override the pertinent methods. - *
            arguments - *
            If you wish to add additional arguments to the base set of arguments, extend com.sun.tools.corba.se.idl.Arguments and override this method to return that class. - *
            languageKeywords - *
            If the language you are generating code in has keywords other than IDL keywords, these keywords should be returned by this method. The framework will prepend any IDL identifiers it encounters which are in this list with an underscore (`_') to avoid compilation errors. For instance, `catch' is a Java keyword. If the generators are emitting Java code for the following IDL, emitting `catch' as is will cause compile errors, so it is changed to `_catch': - *
            - * IDL: - *
            - * const long catch = 22; - *
            - * Possible generated code: - *
            - * public static final int _catch = 22; - *
            - **/ -public class Factories -{ - /** Return the implementation of the GenFactory interface. If this - returns null, then the compiler cannot generate anything. */ - public GenFactory genFactory () - { - return null; - } // genFactory - - /** Return the implementation of the SymtabFactory interface. If this - returns null, the default symbol table entries will be used. */ - public SymtabFactory symtabFactory () - { - return new DefaultSymtabFactory (); - } // symtabFactory - - /** Return the implementation of the ExprFactory interface. If this - returns null, the default expressions will be used. */ - public com.sun.tools.corba.se.idl.constExpr.ExprFactory exprFactory () - { - return new com.sun.tools.corba.se.idl.constExpr.DefaultExprFactory (); - } // exprFactory - - /** Return a subclass of the Arguments class. If this returns null, - the default will be used. */ - public Arguments arguments () - { - return new Arguments (); - } // arguments - - /** Return the list of keywords in the generated language. - Note that these keywords may contain the following wildcards: -
            -
            `*' -
            matches zero or more characters -
            `+' -
            matches one or more characters -
            `.' -
            matches any single character -
            */ - public String[] languageKeywords () - { - return null; - } // languageKeywords -} // interface Factories diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ForwardEntry.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ForwardEntry.java deleted file mode 100644 index a8da7685fd5..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ForwardEntry.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Vector; - -/** - * This is the symbol table entry for forward declarations of interfaces. - **/ -public class ForwardEntry extends SymtabEntry implements InterfaceType -{ - protected ForwardEntry () - { - super (); - } // ctor - - protected ForwardEntry (ForwardEntry that) - { - super (that); - } // ctor - - protected ForwardEntry (SymtabEntry that, IDLID clone) - { - super (that, clone); - if (module ().equals ("")) - module (name ()); - else if (!name ().equals ("")) - module (module () + "/" + name ()); - } // ctor - - public Object clone () - { - return new ForwardEntry (this); - } // clone - - /** Invoke the forward declaration generator. - @param symbolTable the symbol table is a hash table whose key is - a fully qualified type name and whose value is a SymtabEntry or - a subclass of SymtabEntry. - @param stream the stream to which the generator should sent its output. - @see SymtabEntry */ - public void generate (Hashtable symbolTable, PrintWriter stream) - { - forwardGen.generate (symbolTable, this, stream); - } // generate - - /** Access the interface generator. - @return an object which implements the InterfaceGen interface. - @see InterfaceGen */ - public Generator generator () - { - return forwardGen; - } // generator - - static boolean replaceForwardDecl (InterfaceEntry interfaceEntry) - { - boolean result = true; - try - { - ForwardEntry forwardEntry = - (ForwardEntry)Parser.symbolTable.get (interfaceEntry.fullName ()); - if ( forwardEntry != null ) - { - result = (interfaceEntry.getInterfaceType () == - forwardEntry.getInterfaceType ()); - forwardEntry.type (interfaceEntry); - - // If this interface has been forward declared, there are probably - // other interfaces which derive from a ForwardEntry. Replace - // those ForwardEntry's with this InterfaceEntry: - interfaceEntry.forwardedDerivers = forwardEntry.derivers; - for ( Enumeration derivers = forwardEntry.derivers.elements(); - derivers.hasMoreElements(); ) - ((InterfaceEntry)derivers.nextElement ()).replaceForwardDecl (forwardEntry, interfaceEntry); - - // Replace the entry's whose types are forward declarations: - for ( Enumeration types = forwardEntry.types.elements (); - types.hasMoreElements (); ) - ((SymtabEntry)types.nextElement ()).type (interfaceEntry); - } - } - catch (Exception exception) - {} - return result; - } // replaceForwardDecl - - /////////////// - // Implement interface InterfaceType - - public int getInterfaceType () - { - return _type; - } - - public void setInterfaceType (int type) - { - _type = type; - } - - static ForwardGen forwardGen; - Vector derivers = new Vector (); // Vector of InterfaceEntry's. - Vector types = new Vector (); // Vector of the entry's whose type is a forward declaration. - private int _type = InterfaceType.NORMAL; // interface type -} // class ForwardEntry diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ForwardGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ForwardGen.java deleted file mode 100644 index c136a26de6b..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ForwardGen.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.*; - -public interface ForwardGen extends Generator -{ - void generate (Hashtable symbolTable, ForwardEntry entry, PrintWriter stream); -} // interface ForwardGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ForwardValueEntry.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ForwardValueEntry.java deleted file mode 100644 index 45c1a9de711..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ForwardValueEntry.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Vector; - -/** - * This is the symbol table entry for forward declarations of values. - **/ -public class ForwardValueEntry extends ForwardEntry -{ - protected ForwardValueEntry () - { - super (); - } // ctor - - protected ForwardValueEntry (ForwardValueEntry that) - { - super (that); - } // ctor - - protected ForwardValueEntry (SymtabEntry that, IDLID clone) - { - super (that, clone); - } // ctor - - public Object clone () - { - return new ForwardValueEntry (this); - } // clone - - /** Invoke the forward value declaration generator. - @param symbolTable the symbol table is a hash table whose key is - a fully qualified type name and whose value is a SymtabEntry or - a subclass of SymtabEntry. - @param stream the stream to which the generator should sent its output. - @see SymtabEntry */ - public void generate (Hashtable symbolTable, PrintWriter stream) - { - forwardValueGen.generate (symbolTable, this, stream); - } // generate - - /** Access the interface generator. - @return an object which implements the ForwardValueGen interface. - @see ValueGen */ - public Generator generator () - { - return forwardValueGen; - } // generator - - static ForwardValueGen forwardValueGen; -} // class ForwardValueEntry diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ForwardValueGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ForwardValueGen.java deleted file mode 100644 index d4f85a6805a..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ForwardValueGen.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.*; - -public interface ForwardValueGen extends Generator -{ - void generate (Hashtable symbolTable, ForwardValueEntry entry, PrintWriter stream); -} // interface ForwardValueGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/GenFactory.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/GenFactory.java deleted file mode 100644 index 315b1fec3ee..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/GenFactory.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -/** - * To extend this compiler framework to generate something other than - * the default, this factory interface must be implemented and the name - * of it must be set in the main method (see idl.Compile). - *

            - * The implementation of each method should be quite simple. Take - * createAttributeGen, for instance. If the interface AttributeGen is - * implemented by a class called MyAttributeGen, then createAttributeGen - * will be the following: - *

            - * public AttributeGen createAttributeGen ()
            - * {
            - *   return new MyAttributeGen ();
            - * }
            - * 
            - *

            - * If it is desired that a generator do nothing, it is not necessary to - * implement one which does nothing; you may simply write that particular - * create method so that it returns null. - *

            - * Note that this class MUST have a public default constructor (one which - * takes no parameters). - **/ -public interface GenFactory -{ - public AttributeGen createAttributeGen (); - public ConstGen createConstGen (); - public EnumGen createEnumGen (); - public ExceptionGen createExceptionGen (); - public ForwardGen createForwardGen (); - public ForwardValueGen createForwardValueGen (); - public IncludeGen createIncludeGen (); - public InterfaceGen createInterfaceGen (); - public ValueGen createValueGen (); - public ValueBoxGen createValueBoxGen (); - public MethodGen createMethodGen (); - public ModuleGen createModuleGen (); - public NativeGen createNativeGen (); - public ParameterGen createParameterGen (); - public PragmaGen createPragmaGen (); - public PrimitiveGen createPrimitiveGen (); - public SequenceGen createSequenceGen (); - public StringGen createStringGen (); - public StructGen createStructGen (); - public TypedefGen createTypedefGen (); - public UnionGen createUnionGen (); -} // interface GenFactory diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/GenFileStream.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/GenFileStream.java deleted file mode 100644 index d4347c02951..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/GenFileStream.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.CharArrayWriter; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.io.PrintWriter; - -public class GenFileStream extends PrintWriter -{ - public GenFileStream (String filename) - { - // What I really want to do here is: - // super (byteStream = new ByteArrayOutputStream ()); - // but that isn't legal. The super constructor MUST - // be called before any instance variables are used. - // This implementation gets around that problem. - // - //super (tmpByteStream = new ByteArrayOutputStream ()); - //byteStream = tmpByteStream; - super (tmpCharArrayWriter = new CharArrayWriter()); - charArrayWriter = tmpCharArrayWriter; - name = filename; - } // ctor - - public void close () - { - File file = new File (name); - try - { - if (checkError ()) - throw new IOException (); - // - //FileOutputStream fileStream = new FileOutputStream (file); - //fileStream.write (byteStream.toByteArray ()); - //fileStream.close (); - FileWriter fileWriter = new FileWriter (file); - fileWriter.write (charArrayWriter.toCharArray ()); - fileWriter.close (); - } - catch (IOException e) - { - String[] parameters = {name, e.toString ()}; - System.err.println (Util.getMessage ("GenFileStream.1", parameters)); - } - super.close (); - } // close - - public String name () - { - return name; - } // name - - // - //private ByteArrayOutputStream byteStream; - //private static ByteArrayOutputStream tmpByteStream; - private CharArrayWriter charArrayWriter; - private static CharArrayWriter tmpCharArrayWriter; - private String name; -} // GenFileStream diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Generator.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Generator.java deleted file mode 100644 index 6eff7f7d1f1..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Generator.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -public interface Generator -{ -} // interface Generator diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/IDLID.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/IDLID.java deleted file mode 100644 index 6feb97d0249..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/IDLID.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -public class IDLID extends RepositoryID -{ - public IDLID () - { - _prefix = ""; - _name = ""; - _version = "1.0"; - } // ctor - - public IDLID (String prefix, String name, String version) - { - _prefix = prefix; - _name = name; - _version = version; - } // ctor - - public String ID () - { - if (_prefix.equals ("")) - return "IDL:" + _name + ':' + _version; - else - return "IDL:" + _prefix + '/' + _name + ':' + _version; - } // ID - - public String prefix () - { - return _prefix; - } // prefix - - void prefix (String prefix) - { - if (prefix == null) - _prefix = ""; - else - _prefix = prefix; - } // prefix - - public String name () - { - return _name; - } // name - - void name (String name) - { - if (name == null) - _name = ""; - else - _name = name; - } // name - - public String version () - { - return _version; - } // version - - void version (String version) - { - if (version == null) - _version = ""; - else - _version = version; - } // version - - void appendToName (String name) - { - if (name != null) - if (_name.equals ("")) - _name = name; - else - _name = _name + '/' + name; - } // appendToName - - void replaceName (String name) - { - if (name == null) - _name = ""; - else - { - int index = _name.lastIndexOf ('/'); - if (index < 0) - _name = name; - else - _name = _name.substring (0, index + 1) + name; - } - } // replaceName - - public Object clone () - { - return new IDLID (_prefix, _name, _version); - } // clone - - private String _prefix; - private String _name; - private String _version; -} // class IDLID diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/IncludeEntry.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/IncludeEntry.java deleted file mode 100644 index cfb3529f974..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/IncludeEntry.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; -import java.util.Vector; - -/** - * This is the symbol table entry for the #include statement. - **/ -public class IncludeEntry extends SymtabEntry -{ - protected IncludeEntry () - { - super (); - repositoryID (Util.emptyID); - } // ctor - - protected IncludeEntry (SymtabEntry that) - { - super (that, new IDLID ()); - module (that.name ()); - name (""); - } // ctor - - protected IncludeEntry (IncludeEntry that) - { - super (that); - } // ctor - - public Object clone () - { - return new IncludeEntry (this); - } // clone - - /** Invoke the Include type generator. - @param symbolTable the symbol table is a hash table whose key is - a fully qualified type name and whose value is a SymtabEntry or - a subclass of SymtabEntry. - @param stream the stream to which the generator should sent its output. - @see SymtabEntry */ - public void generate (Hashtable symbolTable, PrintWriter stream) - { - includeGen.generate (symbolTable, this, stream); - } // generate - - /** Access the Include type generator. - @return an object which implements the IncludeGen interface. - @see IncludeGen */ - public Generator generator () - { - return includeGen; - } // generator - - //d44810 - /** Set the fully-qualified file specification of this include file. */ - public void absFilename (String afn) - { - _absFilename = afn; - } - - //d44810 - /** Access the fully-qualified file specification of this include. - @return a string containing the path of the include file. */ - public String absFilename () - { - return _absFilename; - } - - /** Add an IncludeEntry to the list of files which this included - file includes. */ - public void addInclude (IncludeEntry entry) - { - includeList.addElement (entry); - } // addInclude - - /** Get the list of files which this file includes. */ - public Vector includes () - { - return includeList; - } // includes - - static IncludeGen includeGen; - /** List of files this file includes */ - private Vector includeList = new Vector (); - //d44810 - /** Absolute file name for .u file generation. */ - private String _absFilename = null; -} // class IncludeEntry diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/IncludeGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/IncludeGen.java deleted file mode 100644 index d97f60213c4..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/IncludeGen.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.*; - -public interface IncludeGen extends Generator -{ - void generate (Hashtable symbolTable, IncludeEntry entry, PrintWriter stream); -} // interface IncludeGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/InterfaceEntry.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/InterfaceEntry.java deleted file mode 100644 index a5b303cb743..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/InterfaceEntry.java +++ /dev/null @@ -1,355 +0,0 @@ -/* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Vector; - -/** - * This is the symbol table entry for interfaces. - **/ -public class InterfaceEntry extends SymtabEntry implements InterfaceType -{ - - protected InterfaceEntry () - { - super (); - } // ctor - - protected InterfaceEntry (InterfaceEntry that) - { - super (that); - _derivedFromNames = (Vector)that._derivedFromNames.clone (); - _derivedFrom = (Vector)that._derivedFrom.clone (); - _methods = (Vector)that._methods.clone (); - _allMethods = (Vector)that._allMethods.clone (); - forwardedDerivers = (Vector)that.forwardedDerivers.clone (); - _contained = (Vector)that._contained.clone (); - _interfaceType = that._interfaceType; - } // ctor - - protected InterfaceEntry (SymtabEntry that, IDLID clone) - { - super (that, clone); - if (module ().equals ("")) - module (name ()); - else if (!name ().equals ("")) - module (module () + "/" + name ()); - } // ctor - - public boolean isAbstract() - { - return _interfaceType == ABSTRACT ; - } - - public boolean isLocal() - { - return _interfaceType == LOCAL ; - } - - public boolean isLocalServant() - { - return _interfaceType == LOCALSERVANT ; - } - - public boolean isLocalSignature() - { - return _interfaceType == LOCAL_SIGNATURE_ONLY ; - } - - public Object clone () - { - return new InterfaceEntry (this); - } // clone - - /** Invoke the interface generator. - @param symbolTable the symbol table is a hash table whose key is - a fully qualified type name and whose value is a SymtabEntry or - a subclass of SymtabEntry. - @param stream the stream to which the generator should sent its output. - @see SymtabEntry */ - public void generate (Hashtable symbolTable, PrintWriter stream) - { - interfaceGen.generate (symbolTable, this, stream); - } // generate - - /** Access the interface generator. - @return an object which implements the InterfaceGen interface. - @see InterfaceGen */ - public Generator generator () - { - return interfaceGen; - } // generator - - /** Add an InterfaceEntry to the list of interfaces which this interface - is derivedFrom. During parsing, the parameter to this method COULD - be a ForwardEntry, but when parsing is complete, calling derivedFrom - will return a vector which only contains InterfaceEntry's. */ - public void addDerivedFrom (SymtabEntry derivedFrom) - { - _derivedFrom.addElement (derivedFrom); - } // addDerivedFrom - - /** This method returns a vector of InterfaceEntry's. */ - public Vector derivedFrom () - { - return _derivedFrom; - } // derivedFrom - - /** Add to the list of derivedFrom names. */ - public void addDerivedFromName (String name) - { - _derivedFromNames.addElement (name); - } // addDerivedFromName - - /** This method returns a vector of Strings, each of which is a fully - qualified name of an interface. This vector corresponds to the - derivedFrom vector. The first element of this vector is the name - of the first element of the derivedFrom vector, etc. */ - public Vector derivedFromNames () - { - return _derivedFromNames; - } // derivedFromNames - - /** Add a method/attribute to the list of methods. */ - public void addMethod (MethodEntry method) - { - _methods.addElement (method); - } // addMethod - - /** This is a vector of MethodEntry's. These are the methods and - attributes contained within this Interface. */ - public Vector methods () - { - return _methods; - } // methods - - /** Add a symbol table entry to this interface's contained vector. */ - public void addContained (SymtabEntry entry) - { - _contained.addElement (entry); - } // addContained - - /** This is a vector of SymtabEntry's. Valid entries in this vector are: - AttributeEntry, ConstEntry, EnumEntry, ExceptionEntry, MethodEntry, - StructEntry, NativeEntry, TypedefEntry, UnionEntry. - Note that the methods vector is a subset of this vector. */ - public Vector contained () - { - return _contained; - } // contained - - void methodsAddElement (MethodEntry method, Scanner scanner) - { - if (verifyMethod (method, scanner, false)) - { - addMethod (method); - _allMethods.addElement (method); - - // Add this method to the 'allMethods' list of any interfaces - // which may have inherited this one when it was a forward - // reference. - addToForwardedAllMethods (method, scanner); - } - } // methodsAddElement - - void addToForwardedAllMethods (MethodEntry method, Scanner scanner) - { - Enumeration e = forwardedDerivers.elements (); - while (e.hasMoreElements ()) - { - InterfaceEntry derived = (InterfaceEntry)e.nextElement (); - if (derived.verifyMethod (method, scanner, true)) - derived._allMethods.addElement (method); - } - } // addToForwardedAllMethods - - // Make sure a method by this name doesn't exist in this class or - // in this class's parents - private boolean verifyMethod (MethodEntry method, Scanner scanner, boolean clash) - { - boolean unique = true; - String lcName = method.name ().toLowerCase (); - Enumeration e = _allMethods.elements (); - while (e.hasMoreElements ()) - { - MethodEntry emethod = (MethodEntry)e.nextElement (); - - // Make sure the method doesn't exist either in its - // original name or in all lower case. In IDL, identifiers - // which differ only in case are collisions. - String lceName = emethod.name ().toLowerCase (); - if (method != emethod && lcName.equals (lceName)) - { - if (clash) - ParseException.methodClash (scanner, fullName (), method.name ()); - else - ParseException.alreadyDeclared (scanner, method.name ()); - unique = false; - break; - } - } - return unique; - } // verifyMethod - - void derivedFromAddElement (SymtabEntry e, Scanner scanner) - { - addDerivedFrom (e); - addDerivedFromName (e.fullName ()); - addParentType( e, scanner ); - } // derivedFromAddElement - - void addParentType (SymtabEntry e, Scanner scanner) - { - if (e instanceof ForwardEntry) - addToDerivers ((ForwardEntry)e); - else - { // e instanceof InterfaceEntry - InterfaceEntry derivedFrom = (InterfaceEntry)e; - - // Compare all of the parent's methods to the methods on this - // interface, looking for name clashes: - for ( Enumeration enumeration = derivedFrom._allMethods.elements (); - enumeration.hasMoreElements (); ) - { - MethodEntry method = (MethodEntry)enumeration.nextElement (); - if ( verifyMethod (method, scanner, true)) - _allMethods.addElement (method); - - // Add this method to the 'allMethods' list of any interfaces - // which may have inherited this one when it was a forward - // reference: - addToForwardedAllMethods (method, scanner); - } - - // If any of the parent's parents are forward entries, make - // sure this interface gets added to their derivers list so - // that when the forward entry is defined, the 'allMethods' - // list of this interface can be updated. - lookForForwardEntrys (scanner, derivedFrom); - } - } // addParentType - - private void lookForForwardEntrys (Scanner scanner, InterfaceEntry entry) - { - Enumeration parents = entry.derivedFrom ().elements (); - while (parents.hasMoreElements ()) - { - SymtabEntry parent = (SymtabEntry)parents.nextElement (); - if (parent instanceof ForwardEntry) - addToDerivers ((ForwardEntry)parent); - else if (parent == entry) - ParseException.selfInherit (scanner, entry.fullName ()); - else // it must be an InterfaceEntry - lookForForwardEntrys (scanner, (InterfaceEntry)parent); - } - } // lookForForwardEntrys - - public boolean replaceForwardDecl (ForwardEntry oldEntry, InterfaceEntry newEntry) - { - int index = _derivedFrom.indexOf( oldEntry ); - if ( index >= 0 ) - _derivedFrom.setElementAt( newEntry, index ); - return (index >= 0); - } // replaceForwardDecl - - private void addToDerivers (ForwardEntry forward) - { - // Add this interface to the derivers list on the forward entry - // so that when the forward entry is defined, the 'allMethods' - // list of this interface can be updated. - forward.derivers.addElement (this); - Enumeration e = forwardedDerivers.elements (); - while (e.hasMoreElements ()) - forward.derivers.addElement ((InterfaceEntry)e.nextElement ()); - } // addToDerivers - - /** This method returns a vector of the elements in the state block. - If it is null, this is not a stateful interface. If it is non-null, - but of zero length, then it is still stateful; it has no state - entries itself, but it has an ancestor which does. */ - public Vector state () - { - return _state; - } // state - - public void initState () - { - _state = new Vector (); - } // initState - - public void addStateElement (InterfaceState state, Scanner scanner) - { - if (_state == null) - _state = new Vector (); - String name = state.entry.name (); - for (Enumeration e = _state.elements (); e.hasMoreElements ();) - if (name.equals (((InterfaceState) e.nextElement ()).entry.name ())) - ParseException.duplicateState (scanner, name); - _state.addElement (state); - } // state - - public int getInterfaceType () - { - return _interfaceType; - } - - public void setInterfaceType (int type) - { - _interfaceType = type; - } - - /** Get the allMethods vector. */ - public Vector allMethods () - { - return _allMethods; - } - - private Vector _derivedFromNames = new Vector(); - private Vector _derivedFrom = new Vector(); - private Vector _methods = new Vector(); - Vector _allMethods = new Vector(); - Vector forwardedDerivers = new Vector(); - private Vector _contained = new Vector(); - private Vector _state = null; - private int _interfaceType = NORMAL; - - static InterfaceGen interfaceGen; -} // class InterfaceEntry diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/InterfaceGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/InterfaceGen.java deleted file mode 100644 index aee4d67ee49..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/InterfaceGen.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.*; - -public interface InterfaceGen extends Generator -{ - void generate (Hashtable symbolTable, InterfaceEntry entry, PrintWriter stream); -} // interface InterfaceGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/InterfaceState.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/InterfaceState.java deleted file mode 100644 index 282745697c0..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/InterfaceState.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -/** - * This class is only used within an InterfaceEntry. If the interface - * is stateful, then its state vector will contain one or more of these - * InterfaceStates. - **/ -public class InterfaceState -{ - public static final int Private = 0, - Protected = 1, - Public = 2; - - public InterfaceState (int m, TypedefEntry e) - { - modifier = m; - entry = e; - if (modifier < Private || modifier > Public) - modifier = Public; - } // ctor - - public int modifier = Public; - public TypedefEntry entry = null; -} // class InterfaceState diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/InterfaceType.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/InterfaceType.java deleted file mode 100644 index 4fb341895ed..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/InterfaceType.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.*; - -public interface InterfaceType -{ - public static final int NORMAL = 0 ; - public static final int ABSTRACT = 1 ; - - // LOCAL generates code according to the Local interfaces - // Here helper and holder classes are the only ones generated - public static final int LOCAL = 2 ; - - // intermediate solution to enable people to extend ServantLocatorPOA - // and ServantActivatorPOA for interoperability. This is until the - // POA is declared Local officially by OMG - public static final int LOCALSERVANT = 3 ; - - // generate only signature interfaces, no helper/holders are generated - public static final int LOCAL_SIGNATURE_ONLY = 4 ; - - public int getInterfaceType (); - - public void setInterfaceType( int type ) ; -} // interface InterfaceType diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/InvalidArgument.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/InvalidArgument.java deleted file mode 100644 index fa3e1bddcac..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/InvalidArgument.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -/** - * An invalid argument for the compiler has been encountered. - **/ -public class InvalidArgument extends Exception -{ - /** @param arg the invalid argument. */ - public InvalidArgument (String arg) - { - message = Util.getMessage ("InvalidArgument.1", arg) + "\n\n" + Util.getMessage ("usage"); - } // ctor - - public InvalidArgument () - { - message = Util.getMessage ("InvalidArgument.2") + "\n\n" + Util.getMessage ("usage"); - } // ctor - - public String getMessage () - { - return message; - } // getMessage - - private String message = null; -} // class InvalidArgument diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/InvalidCharacter.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/InvalidCharacter.java deleted file mode 100644 index 19932b284d6..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/InvalidCharacter.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: -// -D62023 Cast char to byte for JDK 1.2 compatability. - -import java.io.IOException; - -public class InvalidCharacter extends IOException -{ - public InvalidCharacter (String filename, String line, int lineNumber, int pos, char ch) - { - String pointer = "^"; - if (pos > 1) - { - byte[] bytes = new byte [pos - 1]; - for (int i = 0; i < pos - 1; ++i) - bytes[i] = (byte)' '; // - pointer = new String (bytes) + pointer; - } - String[] parameters = {filename, Integer.toString (lineNumber), "" + ch, Integer.toString ((int)ch), line, pointer}; - message = Util.getMessage ("InvalidCharacter.1", parameters); - } - - public String getMessage () - { - return message; - } // getMessage - - private String message = null; -} // class InvalidCharacter diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/MethodEntry.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/MethodEntry.java deleted file mode 100644 index f7acfa120c0..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/MethodEntry.java +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: -// - What does oneway mean? - -import java.io.PrintWriter; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Vector; - -/** - * This is the symbol table entry for methods. - **/ -public class MethodEntry extends SymtabEntry -{ - protected MethodEntry () - { - super (); - } // ctor - - protected MethodEntry (MethodEntry that) - { - super (that); - _exceptionNames = (Vector)that._exceptionNames.clone (); - _exceptions = (Vector)that._exceptions.clone (); - _contexts = (Vector)that._contexts.clone (); - _parameters = (Vector)that._parameters.clone (); - _oneway = that._oneway; - } // ctor - - protected MethodEntry (InterfaceEntry that, IDLID clone) - { - super (that, clone); - if (module ().equals ("")) - module (name ()); - else if (!name ().equals ("")) - module (module () + "/" + name ()); - } // ctor - - public Object clone () - { - return new MethodEntry (this); - } // clone - - /** Invoke the method generator. - @param symbolTable the symbol table is a hash table whose key is - a fully qualified type name and whose value is a SymtabEntry or - a subclass of SymtabEntry. - @param stream the stream to which the generator should sent its output. - @see SymtabEntry */ - public void generate (Hashtable symbolTable, PrintWriter stream) - { - methodGen.generate (symbolTable, this, stream); - } // generate - - /** Access the method generator. - @return an object which implements the MethodGen interface. - @see MethodGen */ - public Generator generator () - { - return methodGen; - } // generator - - public void type (SymtabEntry newType) - { - super.type (newType); - if (newType == null) - typeName ("void"); - } // type - - /** Add an exception to the exception list. */ - public void addException (ExceptionEntry exception) - { - _exceptions.addElement (exception); - } // addException - - /** This a a vector of the exceptions which this method raises. */ - public Vector exceptions () - { - return _exceptions; - } // exceptions - - /** Add an exception name to the list of exception names. */ - public void addExceptionName (String name) - { - _exceptionNames.addElement (name); - } // addExceptionName - - /** This is a vector of strings, each of which is the full name of an - exception which this method throws. This vector corresponds to the - exceptions vector. The first element of this vector is the name - of the first element of the exceptions vector, etc. */ - public Vector exceptionNames () - { - return _exceptionNames; - } // exceptionNames - - /* Add a context to the context list. */ - public void addContext (String context) - { - _contexts.addElement (context); - } // addContext - - /** This is a vector of strings, each of which is the name of a context. */ - public Vector contexts () - { - return _contexts; - } // contexts - - /** Add a parameter to the parameter list. */ - public void addParameter (ParameterEntry parameter) - { - _parameters.addElement (parameter); - } // addParameter - - /** This is a vector of ParameterEntry's. They are the parameters on - this method and their order in the vector is the order they appear - on the method. */ - public Vector parameters () - { - return _parameters; - } // parameters - - /** Is this a oneway method? */ - public void oneway (boolean yes) - { - _oneway = yes; - } // oneway - - /** Is this a oneway method? */ - public boolean oneway () - { - return _oneway; - } // oneway - - /** Is this a value method? */ - public void valueMethod (boolean yes) - { - _valueMethod = yes; - } // valueMethod - - /** Is this a value method? */ - public boolean valueMethod () - { - return _valueMethod; - } // valueMethod - - void exceptionsAddElement (ExceptionEntry e) - { - addException (e); - addExceptionName (e.fullName ()); - } // exceptionsAddElement - - private Vector _exceptionNames = new Vector (); - private Vector _exceptions = new Vector (); - private Vector _contexts = new Vector (); - private Vector _parameters = new Vector (); - private boolean _oneway = false; - private boolean _valueMethod = false; - - static MethodGen methodGen; -} // class MethodEntry diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/MethodGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/MethodGen.java deleted file mode 100644 index fab80447643..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/MethodGen.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.*; - -public interface MethodGen extends Generator -{ - void generate (Hashtable symbolTable, MethodEntry entry, PrintWriter stream); -} // interface MethodGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ModuleEntry.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ModuleEntry.java deleted file mode 100644 index 1dee7aa981e..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ModuleEntry.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; -import java.util.Vector; - -/** - * This is the symbol table entry for modules. - **/ -public class ModuleEntry extends SymtabEntry -{ - protected ModuleEntry () - { - super (); - } // ctor - - protected ModuleEntry (ModuleEntry that) - { - super (that); - _contained = (Vector)that._contained.clone (); - } // ctor - - protected ModuleEntry (SymtabEntry that, IDLID clone) - { - super (that, clone); - - if (module ().equals ("")) - module (name ()); - else if (!name ().equals ("")) - module (module () + "/" + name ()); - } // ctor - - public Object clone () - { - return new ModuleEntry (this); - } // clone - - /** Invoke the module generator. - @param symbolTable the symbol table is a hash table whose key is - a fully qualified type name and whose value is a SymtabEntry or - a subclass of SymtabEntry. - @param stream the stream to which the generator should sent its output. - @see SymtabEntry */ - public void generate (Hashtable symbolTable, PrintWriter stream) - { - moduleGen.generate (symbolTable, this, stream); - } // generate - - /** Access the module generator. - @return an object which implements the ModuleGen interface. - @see ModuleGen */ - public Generator generator () - { - return moduleGen; - } // generator - - /** alid entries in this vector are: TypedefEntry, ExceptionEntry, - StructEntry, UnionEntry, EnumEntry, ConstEntry, InterfaceEntry, - ModuleEntry. */ - public void addContained (SymtabEntry entry) - { - _contained.addElement (entry); - } // addContained - - /** This is a vector of SymtabEntry's. Valid entries in this vector are: - TypedefEntry, ExceptionEntry, StructEntry, UnionEntry, EnumEntry, - ConstEntry, InterfaceEntry, ModuleEntry. */ - public Vector contained () - { - return _contained; - } // contained - - private Vector _contained = new Vector (); - - static ModuleGen moduleGen; -} // class ModuleEntry diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ModuleGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ModuleGen.java deleted file mode 100644 index 90902d050fa..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ModuleGen.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.*; - -public interface ModuleGen extends Generator -{ - void generate (Hashtable symbolTable, ModuleEntry entry, PrintWriter stream); -} // interface ModuleGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/NativeEntry.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/NativeEntry.java deleted file mode 100644 index 7be0fa324b7..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/NativeEntry.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -/** - * This is the symbol table entry for constants. - **/ -public class NativeEntry extends SymtabEntry -{ - protected NativeEntry () - { - super (); - repositoryID (Util.emptyID); - } // ctor - - protected NativeEntry (SymtabEntry that, IDLID clone) - { - super (that, clone); - if (module ().equals ("")) - module (name ()); - else if (!name ().equals ("")) - module (module () + "/" + name ()); - } // ctor - - protected NativeEntry (NativeEntry that) - { - super (that); - } // ctor - - /** This is a shallow copy clone. */ - public Object clone () - { - return new NativeEntry (this); - } // clone - - /** Invoke the constant generator. - @param symbolTable the symbol table is a hash table whose key is - a fully qualified type name and whose value is a SymtabEntry or - a subclass of SymtabEntry. - @param stream the stream to which the generator should sent its output. - @see SymtabEntry */ - public void generate (Hashtable symbolTable, PrintWriter stream) - { - nativeGen.generate(symbolTable, this, stream); - } // generate - - /** Access the constant generator. - @return an object which implements the ConstGen interface. - @see ConstGen */ - public Generator generator () - { - return nativeGen; - } // generator - - static NativeGen nativeGen; -} // class NativeEntry diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/NativeGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/NativeGen.java deleted file mode 100644 index 91fb12c890e..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/NativeGen.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -public interface NativeGen extends Generator -{ - void generate (Hashtable symbolTable, NativeEntry entry, PrintWriter stream); -} // interface NativeGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/NoPragma.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/NoPragma.java deleted file mode 100644 index c8e6a70c4a3..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/NoPragma.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.IOException; - -class NoPragma extends PragmaHandler -{ - public boolean process (String pragma, String currentToken) throws IOException - { - parseException (Util.getMessage ("Preprocessor.unknownPragma", pragma)); - skipToEOL (); - return true; - } // process -} // class NoPragma diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Noop.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Noop.java deleted file mode 100644 index 87ae2ce5ccb..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Noop.java +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.constExpr.ExprFactory; - -public class Noop implements - AttributeGen, ConstGen, EnumGen, ExceptionGen, ForwardGen, - ForwardValueGen, IncludeGen, InterfaceGen, ValueGen, ValueBoxGen, - MethodGen, ModuleGen, NativeGen, ParameterGen, PragmaGen, - PrimitiveGen, SequenceGen, StringGen, StructGen, TypedefGen, - UnionGen, GenFactory -{ - public void generate (Hashtable symbolTable, AttributeEntry entry, PrintWriter stream) - { - } // generate - - public void generate (Hashtable symbolTable, ConstEntry entry, PrintWriter stream) - { - } // generate - - public void generate (Hashtable symbolTable, EnumEntry entry, PrintWriter stream) - { - } // generate - - public void generate (Hashtable symbolTable, ExceptionEntry entry, PrintWriter stream) - { - } // generate - - public void generate (Hashtable symbolTable, ForwardEntry entry, PrintWriter stream) - { - } // generate - - public void generate (Hashtable symbolTable, ForwardValueEntry entry, PrintWriter stream) - { - } // generate - - public void generate (Hashtable symbolTable, IncludeEntry entry, PrintWriter stream) - { - } // generate - - public void generate (Hashtable symbolTable, InterfaceEntry entry, PrintWriter stream) - { - } // generate - - public void generate (Hashtable symbolTable, ValueEntry entry, PrintWriter stream) - { - } // generate - - public void generate (Hashtable symbolTable, ValueBoxEntry entry, PrintWriter stream) - { - } // generate - - public void generate (Hashtable symbolTable, MethodEntry entry, PrintWriter stream) - { - } // generate - - public void generate (Hashtable symbolTable, ModuleEntry entry, PrintWriter stream) - { - } // generate - - public void generate (Hashtable symbolTable, ParameterEntry entry, PrintWriter stream) - { - } // generate - - public void generate (Hashtable symbolTable, PragmaEntry entry, PrintWriter stream) - { - } // generate - - public void generate (Hashtable symbolTable, PrimitiveEntry entry, PrintWriter stream) - { - } // generate - - public void generate (Hashtable symbolTable, SequenceEntry entry, PrintWriter stream) - { - } // generate - - public void generate (Hashtable symbolTable, StringEntry entry, PrintWriter stream) - { - } // generate - - public void generate (Hashtable symbolTable, StructEntry entry, PrintWriter stream) - { - } // generate - - public void generate (Hashtable symbolTable, TypedefEntry entry, PrintWriter stream) - { - } // generate - - public void generate (Hashtable symbolTable, UnionEntry entry, PrintWriter stream) - { - } // generate - - public void generate (Hashtable symbolTable, NativeEntry entry, PrintWriter stream) - { - } // generate - - // For GenFactory - public AttributeGen createAttributeGen () - { - return null; - } // createAttributeGen - - public ConstGen createConstGen () - { - return null; - } // createConstGen - - public EnumGen createEnumGen () - { - return null; - } // createEnumGen - - public ExceptionGen createExceptionGen () - { - return null; - } // createExceptionGen - - public ForwardGen createForwardGen () - { - return null; - } // createForwardGen - - public ForwardValueGen createForwardValueGen () - { - return null; - } // createForwardValueGen - - public IncludeGen createIncludeGen () - { - return null; - } // createIncludeGen - - public InterfaceGen createInterfaceGen () - { - return null; - } // createInterfaceGen - - public ValueGen createValueGen () - { - return null; - } // createValueGen - - public ValueBoxGen createValueBoxGen () - { - return null; - } // createValueBoxGen - - public MethodGen createMethodGen () - { - return null; - } // createMethodGen - - public ModuleGen createModuleGen () - { - return null; - } // createModuleGen - - public NativeGen createNativeGen () - { - return null; - } // createNativeGen - - public ParameterGen createParameterGen () - { - return null; - } // createParameterGen - - public PragmaGen createPragmaGen () - { - return null; - } // createPragmaGen - - public PrimitiveGen createPrimitiveGen () - { - return null; - } // createPrimitiveGen - - public SequenceGen createSequenceGen () - { - return null; - } // createSequenceGen - - public StringGen createStringGen () - { - return null; - } // createStringGen - - public StructGen createStructGen () - { - return null; - } // createStructGen - - public TypedefGen createTypedefGen () - { - return null; - } // createTypedefGen - - public UnionGen createUnionGen () - { - return null; - } // createUnionGen -} // class Noop diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ParameterEntry.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ParameterEntry.java deleted file mode 100644 index 0818c11580b..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ParameterEntry.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -/** - * This is the symbol table entry for parameters. - **/ -public class ParameterEntry extends SymtabEntry -{ - /** This is a set of class constants. A parameter can be passed - as one of In, Out, or Inout. */ - public static final int In = 0, - Inout = 1, - Out = 2; - - protected ParameterEntry () - { - super (); - } // ctor - - protected ParameterEntry (ParameterEntry that) - { - super (that); - _passType = that._passType; - } // ctor - - protected ParameterEntry (SymtabEntry that, IDLID clone) - { - super (that, clone); - if (module ().equals ("")) - module (name ()); - else if (!name ().equals ("")) - module (module () + "/" + name ()); - } // ctor - - public Object clone () - { - return new ParameterEntry (this); - } // clone - - /** Invoke the paramter generator. - @param symbolTable the symbol table is a hash table whose key is - a fully qualified type name and whose value is a SymtabEntry or - a subclass of SymtabEntry. - @param stream the stream to which the generator should sent its output. - @see SymtabEntry */ - public void generate (Hashtable symbolTable, PrintWriter stream) - { - parameterGen.generate (symbolTable, this, stream); - } // generate - - /** Access the parameter generator. - @return an object which implements the ParameterGen interface. - @see ParameterGen */ - public Generator generator () - { - return parameterGen; - } // generator - - /** This indicates the pass type of this parameter. */ - public void passType (int passType) - { - if (passType >= In && passType <= Out) - _passType = passType; - } // passType - - /** This indicates the pass type of this parameter. */ - public int passType () - { - return _passType; - } // passType - - private int _passType = In; - - static ParameterGen parameterGen; -} // class ParameterEntry diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ParameterGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ParameterGen.java deleted file mode 100644 index d61923f8ae9..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ParameterGen.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.*; - -public interface ParameterGen extends Generator -{ - void generate (Hashtable symbolTable, ParameterEntry entry, PrintWriter stream); -} // interface ParameterGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ParseException.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ParseException.java deleted file mode 100644 index d689f5bd2ab..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ParseException.java +++ /dev/null @@ -1,456 +0,0 @@ -/* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: -// -D56351 Update Prefix pragma directive to CORBA 2.3 (see spec.). -// -D57110 Update ID pragma directive to CORBA 2.3 (see spec.). -// -D46094 Prohibit exceptions from appearing wihtin structs, unions, exceptions. -// -D46094 Prohibit attributes from appearing as operation parameter types, -// operation return types, attribute types. -// -D59166 Prohibit identifiers form colliding with IDL keywords. -// -F60858.1 Add keyword collision warning. -// -F60942 Prohibit operations from appearing as operation parameter types. -// -D62023 Add deprecated keyword warning; cast char to byte for JDK 1.2 compatability. - -import java.io.IOException; - -/** - * - **/ -class ParseException extends Exception -{ - /** - * Constructor: print the supplied message to Standard.err - * and create a new ParseException - * @return a new ParseException. - **/ - ParseException (String message) - { - super (message); - System.err.println (message); - detected = true; - } // ctor - - /** - * Constructor: print the supplied message to Standard.err, if it - * is not a warning, and create a new ParseException. - * @return a new ParseException. - **/ - ParseException (String message, boolean onlyAWarning) - { - super (message); - System.err.println (message); - if (!onlyAWarning) - detected = true; - } - - static ParseException abstractValueBox (Scanner scanner) - { - return arg0 ("abstractValueBox", scanner); - } - - static ParseException alreadyDeclared (Scanner scanner, String type) - { - return arg1 ("alreadyDeclared", scanner, type); - } - - static ParseException declNotInSameFile( Scanner scanner, String type, - String firstFile ) - { - return arg2 ("declNotInSameFile", scanner, type, firstFile) ; - } - - static ParseException alreadyDefaulted (Scanner scanner) - { - return arg0 ("alreadydefaulted", scanner); - } - - static ParseException alreadyDerived (Scanner scanner, String derived, String iface) - { - return arg2 ("alreadyDerived", scanner, derived, iface); - } - - static ParseException alreadyRaised (Scanner scanner, String exception) - { - return arg1 ("alreadyRaised", scanner, exception); - } - - // - static ParseException attributeNotType (Scanner scanner, String attr) - { - return arg1 ("attributeNotType", scanner, attr); - } - - static ParseException badAbstract (Scanner scanner, String name) - { - return arg1 ("badAbstract", scanner, name); - } - - static ParseException badCustom (Scanner scanner) - { - return arg0 ("badCustom", scanner); - } - - // - static ParseException badRepIDAlreadyAssigned (Scanner scanner, String entry) - { - return arg1 ("badRepIDAlreadyAssigned", scanner, entry); - } - - // - static ParseException badRepIDForm (Scanner scanner, String entry) - { - return arg1 ("badRepIDForm", scanner, entry); - } - - // - static ParseException badRepIDPrefix (Scanner scanner, String entry, String expected, String got) - { - return arg3 ("badRepIDPrefix", scanner, entry, expected, got); - } - - static ParseException badState (Scanner scanner, String entry) - { - return arg1 ("badState", scanner, entry); - } - - static ParseException branchLabel (Scanner scanner, String label) - { - return arg1 ("branchLabel", scanner, label); - } - - static ParseException branchName (Scanner scanner, String name) - { - return arg1 ("branchName", scanner, name); - } - - static ParseException duplicateInit (Scanner scanner) - { - return arg0 ("duplicateInit", scanner); - } - - static ParseException duplicateState (Scanner scanner, String name) - { - return arg1 ("duplicateState", scanner, name); - } - - static ParseException elseNoIf (Scanner scanner) - { - return arg0 ("elseNoIf", scanner); - } - - static ParseException endNoIf (Scanner scanner) - { - return arg0 ("endNoIf", scanner); - } - - static ParseException evaluationError (Scanner scanner, String problem) - { - return arg1 ("evaluation", scanner, problem); - } - - static ParseException forwardEntry (Scanner scanner, String name) - { - return arg1 ("forwardEntry", scanner, name); - } - - // Cannot forward value boxes. - static ParseException forwardedValueBox (Scanner scanner, String name) - { - return arg1 ("forwardedValueBox", scanner, name); - } - - static ParseException generic (Scanner scanner, String message) - { - return arg1 ("generic", scanner, message); - } - - static ParseException illegalArray (Scanner scanner, String name) - { - return arg1 ("illegalArray", scanner, name); - } - - static ParseException illegalException (Scanner scanner, String name) - { - return arg1 ("illegalException", scanner, name); - } - - static ParseException invalidConst (Scanner scanner, String mustBe, String is) - { - return arg2 ("invalidConst1", scanner, mustBe, is); - } - - static ParseException invalidConst (Scanner scanner, String type) - { - return arg1 ("invalidConst2", scanner, type); - } - - // Non-escaped identifiers that collide with keywords are illegal. - static ParseException keywordCollision (Scanner scanner, String id) - { - return arg1 ("keywordCollision", scanner, id); - } - - // Warning for keywords that will be removed in a future version of IDL. - static ParseException deprecatedKeywordWarning (Scanner scanner, String id) - { - return arg1Warning ("deprecatedKeywordWarning", scanner, id); - } - - // Warning for above error. - static ParseException keywordCollisionWarning (Scanner scanner, String id) - { - return arg1Warning ("keywordCollisionWarning", scanner, id); - } - - static ParseException methodClash (Scanner scanner, String interf, String method) - { - return arg2 ("methodClash", scanner, interf, method); - } - - static ParseException moduleNotType (Scanner scanner, String module) - { - return arg1 ("moduleNotType", scanner, module); - } - - // - static ParseException nestedValueBox (Scanner scanner) - { - return arg0 ("nestedValueBox", scanner); - } - - static ParseException noDefault (Scanner scanner) - { - return arg0 ("noDefault", scanner); - } - - static ParseException nonAbstractParent (Scanner scanner, String baseClass, String parentClass) - { - return arg2 ("nonAbstractParent", scanner, baseClass, parentClass); - } - - static ParseException nonAbstractParent2 (Scanner scanner, String baseClass, String parentClass) - { - return arg2 ("nonAbstractParent2", scanner, baseClass, parentClass); - } - - static ParseException nonAbstractParent3 (Scanner scanner, String baseClass, String parentClass) - { - return arg2 ("nonAbstractParent3", scanner, baseClass, parentClass); - } - - static ParseException notANumber (Scanner scanner, String notNumber) - { - return arg1 ("notANumber", scanner, notNumber); - } - - static ParseException nothing (String filename) - { - return new ParseException (Util.getMessage ("ParseException.nothing", filename)); - } - - static ParseException notPositiveInt (Scanner scanner, String notPosInt) - { - return arg1 ("notPosInt", scanner, notPosInt); - } - - static ParseException oneway (Scanner scanner, String method) - { - return arg1 ("oneway", scanner, method); - } - - // - static ParseException operationNotType (Scanner scanner, String op) - { - return arg1 ("operationNotType", scanner, op); - } - - static ParseException outOfRange (Scanner scanner, String value, String type) - { - return arg2 ("outOfRange", scanner, value, type); - } - - static ParseException recursive (Scanner scanner, String type, String name) - { - return arg2 ("recursive", scanner, type, name); - } - - static ParseException selfInherit (Scanner scanner, String name) - { - return arg1 ("selfInherit", scanner, name); - } - - static ParseException stringTooLong (Scanner scanner, String str, String max) - { - return arg2 ("stringTooLong", scanner, str, max); - } - - static ParseException syntaxError (Scanner scanner, int expected, int got) - { - return arg2 ("syntax1", scanner, Token.toString (expected), Token.toString (got)); - } - - static ParseException syntaxError (Scanner scanner, String expected, String got) - { - return arg2 ("syntax1", scanner, expected, got); - } - - static ParseException syntaxError (Scanner scanner, int[] expected, int got) - { - return syntaxError (scanner, expected, Token.toString (got)); - } - - static ParseException syntaxError (Scanner scanner, int[] expected, String got) - { - String tokenList = ""; - for (int i = 0; i < expected.length; ++i) - tokenList += " `" + Token.toString (expected[i]) + "'"; - return arg2 ("syntax2", scanner, tokenList, got); - } - - static ParseException unclosedComment (String filename) - { - return new ParseException (Util.getMessage ("ParseException.unclosed", filename)); - } - - static ParseException undeclaredType (Scanner scanner, String undeclaredType) - { - return arg1 ("undeclaredType", scanner, undeclaredType); - } - - static ParseException warning (Scanner scanner, String message) - { - scannerInfo (scanner); - String[] parameters = { filename, Integer.toString (lineNumber), message, line, pointer }; - return new ParseException (Util.getMessage ("ParseException.warning", parameters), true); - } - - static ParseException wrongType (Scanner scanner, String name, String mustBe, String is) - { - scannerInfo (scanner); - String[] parameters = {filename, Integer.toString (lineNumber), name, is, mustBe, line, pointer}; - return new ParseException (Util.getMessage ("ParseException.wrongType", parameters)); - } - - static ParseException wrongExprType (Scanner scanner, String mustBe, String is) - { - scannerInfo (scanner); - String[] parameters = {filename, Integer.toString (lineNumber), - is, mustBe, line, pointer}; - return new ParseException (Util.getMessage ("ParseException.constExprType", - parameters)); - } - - static ParseException illegalForwardInheritance( Scanner scanner, String declName, - String baseName ) - { - scannerInfo( scanner ) ; - String[] parameters = { filename, Integer.toString(lineNumber), - declName, baseName, line, pointer } ; - return new ParseException (Util.getMessage( - "ParseException.forwardInheritance", parameters ) ) ; - } - - static ParseException illegalIncompleteTypeReference( Scanner scanner, - String declName ) - { - scannerInfo( scanner ) ; - String[] parameters = { filename, Integer.toString(lineNumber), - declName, line, pointer } ; - return new ParseException (Util.getMessage( - "ParseException.illegalIncompleteTypeReference", parameters ) ) ; - } - - private static void scannerInfo (Scanner scanner) - { - filename = scanner.filename (); - line = scanner.lastTokenLine (); - lineNumber = scanner.lastTokenLineNumber (); - int pos = scanner.lastTokenLinePosition (); - pointer = "^"; - if (pos > 1) - { - byte[] bytes = new byte[ pos - 1 ]; - for (int i = 0; i < pos - 1; ++i) - bytes[i] = (byte)' '; // - pointer = new String (bytes) + pointer; - } - } - - private static ParseException arg0 (String msgId, Scanner scanner) - { - scannerInfo (scanner); - String[] parameters = {filename, Integer.toString (lineNumber), line, pointer}; - return new ParseException (Util.getMessage ("ParseException." + msgId, parameters)); - } - - private static ParseException arg1 (String msgId, Scanner scanner, String arg1) - { - scannerInfo (scanner); - String[] parameters = {filename, Integer.toString (lineNumber), arg1, line, pointer}; - return new ParseException (Util.getMessage ("ParseException." + msgId, parameters)); - } - - // - private static ParseException arg1Warning (String msgId, Scanner scanner, String arg1) - { - scannerInfo (scanner); - String[] parameters = {filename, Integer.toString (lineNumber), arg1, line, pointer}; - return new ParseException (Util.getMessage ("ParseException." + msgId, parameters), true); - } - - private static ParseException arg2 (String msgId, Scanner scanner, String arg1, String arg2) - { - scannerInfo (scanner); - String[] parameters = {filename, Integer.toString (lineNumber), arg1, arg2, line, pointer}; - return new ParseException (Util.getMessage ("ParseException." + msgId, parameters)); - } - - private static ParseException arg3 (String msgId, Scanner scanner, String arg1, String arg2, String arg3) - { - scannerInfo (scanner); - String[] parameters = {filename, Integer.toString (lineNumber), arg1, arg2, arg3, line, pointer}; - return new ParseException (Util.getMessage ("ParseException." + msgId, parameters)); - } - - private static String filename = ""; - private static String line = ""; - private static int lineNumber = 0; - private static String pointer = "^"; - - static boolean detected = false; -} // class ParseException diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Parser.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Parser.java deleted file mode 100644 index ff424215bbc..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Parser.java +++ /dev/null @@ -1,3905 +0,0 @@ -/* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: -// -F46082.51 Remove -stateful feature. -// -D52042 Allow floating-point constants to be initialized with -// integral as well as floating-point literals. No other variations allowed. -// -D58058 Set index array type to long rather than array element type. -// -D56351 Update computation of RepositoryIDs to CORBA 2.3 (see spec.). -// -D57110 Provide method() to set/clear ability for scoped names to -// resolve to modules. Allows rep. ids to be assigned to modules. -// -D46094 Prohibit exceptions from appearing wihtin structs, unions, exceptions. -// -D46094 Prohibit attributes from appearing as operation parameter types, -// operation return types, attribute types. -// -D59067 Prohibit nested value boxes. -// -D59166 Prohibit collisions between keywords and non-escaped identifiers. -// -D59809 At Pigeonhole(), add map short name of CORBA types to long name -// (e.g., CORBA/StringValue --> org/omg/CORBA/StringValue), which allows fully- -// qualified CORBA type names to resolve successfully. -// -F60858.1 Support "-corba" option, level <= 2.2: issue warning for -// keyowrd collisions; -// -D60942 Prohibit operations from appearing within parameter types. -// -D61643 Repair pigeonhole() to correctly filter bad RepIDs. -// -D62023 Support -noWarn option; Issue warnings when tokens are -// deprecated keywords or keywords in greater release version. -// -D61919 Emit entries for modules originally opened in #include files -// appearing at global scope and then reopened in the main IDL file. Only -// types appearing in the main IDL source will be emitted. - -import java.io.EOFException; -import java.io.IOException; - -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Stack; -import java.util.Vector; -import java.util.List ; -import java.util.ArrayList ; -import java.util.Iterator ; - -import java.math.BigInteger; - -import com.sun.tools.corba.se.idl.constExpr.*; - -/** - * - **/ -class Parser -{ - /** - * - **/ - Parser (Preprocessor preprocessor, Arguments arguments, Hashtable overrides, - Hashtable symtab, SymtabFactory stFac, ExprFactory exprFac, String [] genKeywords) - { - this.arguments = arguments; - noWarn = arguments.noWarn; // - corbaLevel = arguments.corbaLevel; // - paths = arguments.includePaths; - symbols = arguments.definedSymbols; - verbose = arguments.verbose; - emitAll = arguments.emitAll; - // - cppModule = arguments.cppModule; - // Remove -stateful feature. - //parseStateful = arguments.parseStateful; - overrideNames = (overrides == null) ? new Hashtable () : overrides; - symbolTable = (symtab == null) ? new Hashtable () : symtab; - keywords = (genKeywords == null) ? new String [0] : genKeywords; - stFactory = stFac; - exprFactory = exprFac; - currentModule = topLevelModule = new ModuleEntry (); - prep = preprocessor; - repIDStack.push (new IDLID ()); - addPrimEntries (); - } // ctor - - /** - * - **/ - void parse (String file) throws IOException - { - IncludeEntry fileEntry = stFactory.includeEntry (); - fileEntry.name ('"' + file + '"'); - try - { - // Set absolute file path - fileEntry.absFilename (Util.getAbsolutePath (file, paths)); - } - catch (IOException ioe) - {} - - // Remove -stateful feature. - //scanner = new Scanner (fileEntry, keywords, verbose, parseStateful, emitAll); - // Support "-corba [level]" option. - //scanner = new Scanner (fileEntry, keywords, verbose, emitAll); - scanner = new Scanner (fileEntry, keywords, verbose, emitAll, corbaLevel, - arguments.scannerDebugFlag ); - topLevelModule.sourceFile (fileEntry); - - // Prime the pump... - // Match handles preprocessor directives, so use match to - // call scanner.getToken just in case the first token is - // such a directive. But match depends on the token - // already having a value, so fudge something. - token = new Token (0); - tokenHistory.insert (token); // Initialize look back buffer <26jul1997daz>. - try - { - match (0); - if (token.equals (Token.EOF)) - ParseException.nothing (file); - else - specification (topLevelModule); - } - catch (ParseException exception) // Match MIGHT throw this - { - // It has already been reported, just end. - } - catch (EOFException exception) // skipToSemicolon MIGHT throw this - { - // It has already been reported, just end. - } - } // parse - - /** - * - **/ - private void addPrimEntries () - { - symbolTable.put ("short", stFactory.primitiveEntry ("short")); - symbolTable.put ("long", stFactory.primitiveEntry ("long")); - symbolTable.put ("long long", stFactory.primitiveEntry ("long long")); - symbolTable.put ("unsigned short", stFactory.primitiveEntry ("unsigned short")); - symbolTable.put ("unsigned long", stFactory.primitiveEntry ("unsigned long")); - symbolTable.put ("unsigned long long", stFactory.primitiveEntry ("unsigned long long")); - symbolTable.put ("char", stFactory.primitiveEntry ("char")); - symbolTable.put ("wchar", stFactory.primitiveEntry ("wchar")); - symbolTable.put ("float", stFactory.primitiveEntry ("float")); - //Support fixed type: symbolTable.put ("fixed", stFactory.primitiveEntry ("fixed")); - symbolTable.put ("double", stFactory.primitiveEntry ("double")); - symbolTable.put ("boolean", stFactory.primitiveEntry ("boolean")); - symbolTable.put ("octet", stFactory.primitiveEntry ("octet")); - symbolTable.put ("any", stFactory.primitiveEntry ("any")); - - InterfaceEntry object = stFactory.interfaceEntry(); - object.name ("Object"); - symbolTable.put ("Object", object); - - ValueEntry valueBase = stFactory.valueEntry(); - valueBase.name ("ValueBase"); - symbolTable.put ("ValueBase", valueBase); - - // put these same entries in the lowercase symbol table - lcSymbolTable.put ("short", stFactory.primitiveEntry ("short")); - lcSymbolTable.put ("long", stFactory.primitiveEntry ("long")); - lcSymbolTable.put ("long long", stFactory.primitiveEntry ("long long")); - lcSymbolTable.put ("unsigned short", stFactory.primitiveEntry ("unsigned short")); - lcSymbolTable.put ("unsigned long", stFactory.primitiveEntry ("unsigned long")); - lcSymbolTable.put ("unsigned long long", stFactory.primitiveEntry ("unsigned long long")); - lcSymbolTable.put ("char", stFactory.primitiveEntry ("char")); - lcSymbolTable.put ("wchar", stFactory.primitiveEntry ("wchar")); - lcSymbolTable.put ("float", stFactory.primitiveEntry ("float")); - // Support fixed type: lcSymbolTable.put ("fixed", stFactory.primitiveEntry ("fixed")); - lcSymbolTable.put ("double", stFactory.primitiveEntry ("double")); - lcSymbolTable.put ("boolean", stFactory.primitiveEntry ("boolean")); - lcSymbolTable.put ("octet", stFactory.primitiveEntry ("octet")); - lcSymbolTable.put ("any", stFactory.primitiveEntry ("any")); - lcSymbolTable.put ("object", object); - lcSymbolTable.put ("valuebase", valueBase); - } // addPrimEntries - - /** - * - **/ - private void specification (ModuleEntry entry) throws IOException - { - while (!token.equals (Token.EOF)) - { - definition (entry); - addToEmitList (entry); - } - } // specification - - // ModuleEntry is the topLevelModule; add its contained types to the emit list. - /** - * - **/ - private void addToEmitList (ModuleEntry entry) - { - for (Enumeration e = entry.contained ().elements (); e.hasMoreElements();) - { - SymtabEntry emitEntry = (SymtabEntry)e.nextElement (); - if (emitEntry.emit ()) - { - emitList.addElement (emitEntry); - - // I think the absence of the following statement was an - // oversight. If module X.Y.Z first appears in an include file, then is - // reopened in the main IDL source, this statement guarantees that X.Y.Z - // definitions within the main IDL source are emitted. - ///--------------------------------------------------------------------- - // If any of this module's elements should be emitted, add - // this module to the emit list. - if (emitEntry instanceof ModuleEntry) - checkContained ((ModuleEntry)emitEntry); - if (emitEntry instanceof IncludeEntry) - { - includes.addElement (emitEntry.name ()); - includeEntries.addElement (emitEntry); - } - } - else - // If any of this module's elements should be emitted, add - // this module to the emit list. - if (emitEntry instanceof ModuleEntry) - checkContained ((ModuleEntry)emitEntry); - } - entry.contained ().removeAllElements (); - } // addToEmitList - - /** - * - **/ - private void checkContained (ModuleEntry entry) - { - // If any of this module's elements is to be emitted, - // then add the module to the emit list. - for (Enumeration e = entry.contained ().elements (); e.hasMoreElements ();) - { - SymtabEntry contained = (SymtabEntry)e.nextElement (); - if (contained instanceof ModuleEntry) - checkContained ((ModuleEntry)contained); - if (contained.emit ()) - { - if (!emitList.contains (entry)) - emitList.addElement (entry); - entry.emit (true); - break; - } - } - } // checkContained - - /** - * - **/ - private void definition (ModuleEntry entry) throws IOException - { - try - { - switch (token.type) - { - case Token.Typedef: - case Token.Struct: - case Token.Union: - case Token.Enum: - typeDcl (entry); - break; - case Token.Const: - constDcl (entry); - break; - case Token.Native: - nativeDcl (entry); - break; - case Token.Exception: - exceptDcl (entry); - break; - case Token.Interface: - interfaceProd (entry, InterfaceEntry.NORMAL); - break; - case Token.Local: - match( Token.Local ) ; - if (token.type == Token.Interface) - interfaceProd( entry, InterfaceEntry.LOCAL ) ; - else - throw ParseException.syntaxError( scanner, new int[] { - Token.Interface }, token.type ) ; - break ; - case Token.Module: - module (entry); - break; - case Token.Abstract: - match (Token.Abstract); - if (token.type == Token.Interface) - interfaceProd (entry, InterfaceEntry.ABSTRACT); - else if (token.type == Token.Valuetype) - valueProd (entry, true); - else - throw ParseException.syntaxError (scanner, new int[] { - Token.Interface, Token.Valuetype }, token.type); - break; - case Token.Custom: - case Token.Valuetype: - valueProd (entry, false); - break; - default: - throw ParseException.syntaxError (scanner, new int[] { - Token.Typedef, Token.Struct, Token.Union, Token.Enum, - Token.Const, Token.Exception, Token.Interface, Token.Valuetype, - Token.Module }, token.type); - } - match (Token.Semicolon); - } - catch (ParseException e) - { - skipToSemicolon (); - } - } // definition - - /** - * - **/ - private void module (ModuleEntry entry) throws IOException, ParseException - { - match (Token.Module); - repIDStack.push (((IDLID)repIDStack.peek ()).clone ()); - ModuleEntry newEntry = newModule (entry); - ((IDLID)repIDStack.peek ()).appendToName (newEntry.name ()); - // comment must immediately precede "module" keyword - newEntry.comment (tokenHistory.lookBack (1).comment); - currentModule = newEntry; - match (Token.Identifier); - prep.openScope (newEntry); - match (Token.LeftBrace); - definition (newEntry); - while (!token.equals (Token.EOF) && !token.equals (Token.RightBrace)) - definition (newEntry); - prep.closeScope (newEntry); - match (Token.RightBrace); - currentModule = entry; - repIDStack.pop (); - } // module - - /** - * - **/ - private void interfaceProd (ModuleEntry entry, int interfaceType) - throws IOException, ParseException - { - match (Token.Interface); - String name = token.name; - match (Token.Identifier); - interface2 (entry, name, interfaceType); - } // interfaceProd - - /** - * - **/ - private void interface2 (ModuleEntry module, String name, int interfaceType) - throws IOException, ParseException - { - if (token.type == Token.Colon || token.type == Token.LeftBrace) { - repIDStack.push (((IDLID)repIDStack.peek ()).clone ()); - InterfaceEntry entry = stFactory.interfaceEntry (module, - (IDLID)repIDStack.peek ()); - entry.sourceFile (scanner.fileEntry ()); - entry.name (name); - entry.setInterfaceType(interfaceType); - // Comment must immediately precede "[local | abstract] interface" keyword - entry.comment (tokenHistory.lookBack ( - entry.getInterfaceType() == InterfaceEntry.NORMAL ? 2 : 3).comment); - - if (!ForwardEntry.replaceForwardDecl (entry)) - ParseException.badAbstract (scanner, entry.fullName ()); - pigeonhole (module, entry); - ((IDLID)repIDStack.peek ()).appendToName (name); - currentModule = entry; - interfaceDcl (entry); - currentModule = module; - repIDStack.pop (); - } else { // This is a forward declaration - ForwardEntry entry = stFactory.forwardEntry (module, (IDLID)repIDStack.peek ()); - entry.sourceFile (scanner.fileEntry ()); - entry.name (name); - entry.setInterfaceType(interfaceType); - // comment must immediately precede "interface" keyword. - entry.comment (tokenHistory.lookBack ( - entry.getInterfaceType() == InterfaceEntry.NORMAL ? 2 : 3).comment); - pigeonhole (module, entry); - } - } // interface2 - - /** - * - **/ - private void interfaceDcl (InterfaceEntry entry) throws IOException, ParseException - { - if (token.type != Token.LeftBrace) - inheritanceSpec (entry); - else if (!entry.isAbstract ()) { - SymtabEntry objectEntry = qualifiedEntry ("Object"); - SymtabEntry realOEntry = typeOf (objectEntry); - if (objectEntry == null) - ; // qualifiedEntry already generated an error message - else if (!isInterface(realOEntry)) - ParseException.wrongType (scanner, overrideName ("Object"), - "interface", objectEntry.typeName ()); - else - entry.derivedFromAddElement (realOEntry, scanner); - } - - prep.openScope (entry); - match (Token.LeftBrace); - while (token.type != Token.RightBrace) - export (entry); - prep.closeScope (entry); - match (Token.RightBrace); - } // interfaceDcl - - /** - * - **/ - private void export (InterfaceEntry entry) throws IOException - { - try - { - switch (token.type) - { - case Token.Typedef: - case Token.Struct: - case Token.Union: - case Token.Enum: - typeDcl (entry); - break; - case Token.Const: - constDcl (entry); - break; - case Token.Native: - nativeDcl (entry); - break; - case Token.Exception: - exceptDcl (entry); - break; - case Token.Readonly: - case Token.Attribute: - attrDcl (entry); - break; - case Token.Oneway: - case Token.Float: - case Token.Double: - case Token.Long: - case Token.Short: - case Token.Unsigned: - case Token.Char: - case Token.Wchar: - case Token.Boolean: - case Token.Octet: - case Token.Any: - case Token.String: - case Token.Wstring: - case Token.Identifier: - case Token.Object: - // Value base type. - case Token.ValueBase: - case Token.DoubleColon: - case Token.Void: - opDcl (entry); - break; - // Remove -stateful feature. - //case Token.State: if (parseStateful) { - // stateDef (entry); - // break; } - default: - throw ParseException.syntaxError(scanner, new int [] { - Token.Typedef, Token.Struct, Token.Union, Token.Enum, - Token.Const, Token.Exception, Token.Readonly, Token.Attribute, - Token.Oneway, Token.Float, Token.Double, Token.Long, - Token.Short, Token.Unsigned, Token.Char, Token.Wchar, - Token.Boolean, Token.Octet, Token.Any, Token.String, - Token.Wstring, Token.Identifier, Token.DoubleColon, Token.Void, - Token.ValueBase }, token.type); - } - match (Token.Semicolon); - } - catch (ParseException exception) - { - skipToSemicolon (); - } - } // export - - private void inheritanceSpec (InterfaceEntry entry) throws IOException, ParseException - { - for (match (Token.Colon); ; match (Token.Comma)) { - SymtabEntry parent = scopedName (entry.container (), - stFactory.interfaceEntry ()); - SymtabEntry realParent = typeOf (parent); - - if (isInterfaceOnly (realParent)) { - boolean isInterface = (realParent instanceof InterfaceEntry); - if (entry.derivedFrom ().contains (realParent)) - ParseException.alreadyDerived (scanner, realParent.fullName (), entry.fullName ()); - else if (!entry.isAbstract () || - (((InterfaceType)realParent).getInterfaceType() == InterfaceType.ABSTRACT)) - entry.derivedFromAddElement (realParent, scanner); - else - ParseException.nonAbstractParent (scanner, entry.fullName (), parent.fullName ()); - } else if (isForward( realParent )) { - ParseException.illegalForwardInheritance( scanner, - entry.fullName(), parent.fullName() ) ; - } else - ParseException.wrongType (scanner, parent.fullName (), "interface", entryName (parent)); - - if ((parent instanceof InterfaceEntry) && (((InterfaceEntry)parent).state () != null)) - if (entry.state () == null) - entry.initState (); - else - throw ParseException.badState (scanner, entry.fullName ()); - - if (token.type != Token.Comma) - break; - } - } // inheritanceSpec - - // <57110> Member _moduleIsLegalType may be set by any feature to allow - // method scopedName() and any of its helper methods -- qualifiedName(), - // partlyQualifiedName(), and unqualifiedName() -- to return a ModuleEntry - // rather than a parse error in the event a name resolves to a module. The - // flag must be cleared (set to false) to resume normal parsing behavior. - // - // Currently, this is used only when preprocessing the ID pragma directive. - - private boolean _isModuleLegalType = false; - - /** - * - **/ - public boolean isModuleLegalType () - { - return _isModuleLegalType; - }; // moduleIsLegaType - - /** - * - **/ - public void isModuleLegalType (boolean b) - { - _isModuleLegalType = b; - }; // moduleIsLegalType - - /** - * - **/ - SymtabEntry scopedName (SymtabEntry container, - SymtabEntry expected) throws IOException, ParseException - { - return scopedName( container, expected, true ) ; - } - - SymtabEntry scopedName (SymtabEntry container, SymtabEntry expected, - boolean mustBeReferencable ) throws IOException, ParseException - { - boolean globalScope = false; - boolean partialScope = false; - String name = null; - if (token.type == Token.DoubleColon) - globalScope = true; - else - { - if (token.type == Token.Object) - { - name = "Object"; - match (Token.Object); - } - else if (token.type == Token.ValueBase) // - { - name = "ValueBase"; - match (Token.ValueBase); - } - else - { - name = token.name; - match (Token.Identifier); - } - } - while (token.type == Token.DoubleColon) - { - match (Token.DoubleColon); - partialScope = true; - if (name != null) - name += '/' + token.name; - else name = token.name; - match (Token.Identifier); - } - SymtabEntry entry = null; - if (globalScope) - entry = qualifiedEntry (name); - else if (partialScope) - entry = partlyQualifiedEntry (name, container); - else - entry = unqualifiedEntry (name, container); - - if (entry == null) - // Make the entry the expected entry. The generators will - // not be called now, since a semantic exception ocurred, but - // the parse has to finish and something valid has to be - // returned. - (entry = expected).name (name); - else if (!entry.isReferencable() && mustBeReferencable) - throw ParseException.illegalIncompleteTypeReference( scanner, name ) ; - - return entry; - } // scopedName - - private void valueProd (ModuleEntry entry, boolean isAbstract) throws IOException, ParseException - { - boolean isCustom = (token.type == Token.Custom); - if (isCustom) - match (Token.Custom); - match (Token.Valuetype); - String name = token.name; - match (Token.Identifier); - - switch (token.type) - { - case Token.LeftBrace: - case Token.Colon: - case Token.Supports: - value2 (entry, name, isAbstract, isCustom); - return; - case Token.Semicolon: - if (isCustom) - break; - valueForwardDcl (entry, name, isAbstract); - return; - } - if (isCustom) - throw ParseException.badCustom (scanner); - if (isAbstract) - throw ParseException.abstractValueBox (scanner); - valueBox (entry, name); - } // valueProd - - /** - * - **/ - private void value2 (ModuleEntry module, String name, boolean isAbstract, - boolean isCustom) throws IOException, ParseException - { - repIDStack.push (((IDLID)repIDStack.peek ()).clone ()); - // The 'actual' repository ID will be calculated at the end of the - // parsing phase, since it is based on the entire contents of the - // declaration, and needs to have all forward references resolved: - ValueEntry entry = stFactory.valueEntry (module, (IDLID)repIDStack.peek ()); - entry.sourceFile (scanner.fileEntry ()); - entry.name (name); - entry.setInterfaceType (isAbstract ? InterfaceType.ABSTRACT : InterfaceType.NORMAL); - entry.setCustom (isCustom); - // Comment must immediately precede "[abstract | custom] value" keyword - entry.comment (tokenHistory.lookBack ((isAbstract || isCustom) ? 3 : 2).comment); - // If this value has been forward declared, there are probably - // other values which derive from a ForwardValueEntry. Replace - // those ForwardValueEntry's with this ValueEntry: - if (!ForwardEntry.replaceForwardDecl (entry)) - ParseException.badAbstract (scanner, entry.fullName ()); - pigeonhole (module, entry); - ((IDLID)repIDStack.peek ()).appendToName (name); - currentModule = entry; - valueDcl (entry); - entry.tagMethods (); - currentModule = module; - repIDStack.pop (); - } // value2 - - /** - * - **/ - private void valueDcl (ValueEntry entry) throws IOException, ParseException - { - if (token.type == Token.Colon) - valueInheritanceSpec (entry); - else if (!entry.isAbstract ()) - { - SymtabEntry objectEntry = qualifiedEntry ("ValueBase"); - SymtabEntry realOEntry = typeOf (objectEntry); - if (objectEntry == null) - ; // qualifiedEntry already generated an error message - else if (!isValue (realOEntry)) - ParseException.wrongType (scanner, overrideName ("ValueBase"), "value", objectEntry.typeName ()); - else - entry.derivedFromAddElement (realOEntry, false, scanner); - } - if (token.type == Token.Supports) - valueSupportsSpec (entry); - prep.openScope (entry); - match (Token.LeftBrace); - while (token.type != Token.RightBrace) - { - valueElement (entry); - } - prep.closeScope (entry); - match (Token.RightBrace); - } // valueDcl - - /** - * - **/ - private void valueInheritanceSpec (ValueEntry entry) throws IOException, ParseException - { - match (Token.Colon); - boolean isTruncatable = (token.type == Token.Truncatable); - if (isTruncatable) - match (Token.Truncatable); - for (; ; match (Token.Comma), isTruncatable = false) { - SymtabEntry parent = scopedName (entry.container (), - stFactory.valueEntry ()); - SymtabEntry realParent = typeOf (parent); - if (isValue (realParent) && !(realParent instanceof ValueBoxEntry)) - entry.derivedFromAddElement (realParent, isTruncatable, - scanner); - else if (isForward(realParent)) - ParseException.illegalForwardInheritance( scanner, - entry.fullName(), parent.fullName() ) ; - else - ParseException.wrongType (scanner, - parent.fullName (), "value", entryName (parent)); - if (token.type != Token.Comma) - break; - } - } // valueInheritanceSpec - - /** - * - **/ - private void valueSupportsSpec (ValueEntry entry) throws IOException, ParseException - { - match (Token.Supports) ; - for (; ; match( Token.Comma ) ) { - SymtabEntry parent = scopedName (entry.container (), stFactory.interfaceEntry ()); - SymtabEntry realParent = typeOf (parent); - if (isInterface(realParent)) - entry.derivedFromAddElement (realParent, scanner); - else - ParseException.wrongType (scanner, parent.fullName (), "interface", - entryName (parent)); - - if (token.type != Token.Comma) - break; - } - } // valueSupportsSpec - - private void valueElement (ValueEntry entry) throws IOException, ParseException - { - if (entry.isAbstract ()) - export (entry); - else - switch (token.type) - { - case Token.Private: - case Token.Public: - valueStateMember (entry); - break; - case Token.Init: - case Token.Factory: // "factory" supplants "init" in 2.4RTF - initDcl (entry); - break; - case Token.Typedef: - case Token.Struct: - case Token.Union: - case Token.Enum: - case Token.Const: - case Token.Native: - case Token.Exception: - case Token.Readonly: - case Token.Attribute: - case Token.Oneway: - case Token.Float: - case Token.Double: - case Token.Long: - case Token.Short: - case Token.Unsigned: - case Token.Char: - case Token.Wchar: - case Token.Boolean: - case Token.Octet: - case Token.Any: - case Token.String: - case Token.Wstring: - case Token.Identifier: - case Token.Object: - case Token.ValueBase: - case Token.DoubleColon: - case Token.Void: - export (entry); - break; - default: - throw ParseException.syntaxError(scanner, new int[] { - Token.Private, Token.Public, Token.Init, Token.ValueBase, - Token.Typedef, Token.Struct, Token.Union, Token.Enum, - Token.Const, Token.Exception, Token.Readonly, Token.Attribute, - Token.Oneway, Token.Float, Token.Double, Token.Long, - Token.Short, Token.Unsigned, Token.Char, Token.Wchar, - Token.Boolean, Token.Octet, Token.Any, Token.String, - Token.Wstring, Token.Identifier, Token.DoubleColon, Token.Void }, - token.type); - } // switch - } // valueElement - - // - /** - * - **/ - private void valueStateMember (ValueEntry entry) throws IOException, ParseException - { - TypedefEntry typedefEntry = - stFactory.typedefEntry (entry, (IDLID)repIDStack.peek ()); - typedefEntry.sourceFile (scanner.fileEntry ()); - // comment must immediately precede "public", "private" keywords - typedefEntry.comment (token.comment); - boolean isPublic = (token.type == Token.Public); - if (isPublic) - match (Token.Public); - else - match (Token.Private); - // Add constructed types declared "inline" to the contained - // vector of this value entry. - boolean isConstTypeSpec = - (token.type == Token.Struct || token.type == Token.Union || token.type == Token.Enum); - // Make typedefEntry anonymous. If this line is removed, - // the entry will be named incorrectly. See . - typedefEntry.name (""); - typedefEntry.type (typeSpec (typedefEntry)); - addDeclarators (entry, typedefEntry, isPublic); - // - if (isConstTypeSpec) - entry.addContained (typedefEntry); - match (Token.Semicolon); - } // valueStateMember - - - private void addDeclarators (ValueEntry entry, TypedefEntry typedefEntry, - boolean isPublic) throws IOException, ParseException - { - int modifier = isPublic ? InterfaceState.Public : InterfaceState.Private; - try - { - Vector typedefList = new Vector (); - declarators (typedefEntry, typedefList); - for (Enumeration e = typedefList.elements (); e.hasMoreElements ();) - entry.addStateElement ( - new InterfaceState (modifier, (TypedefEntry)e.nextElement ()), scanner); - } - catch (ParseException exception) - { - skipToSemicolon (); - } - } // addDeclarators - - /** - * - **/ - private void initDcl (ValueEntry entry) throws IOException, ParseException - { - MethodEntry method = stFactory.methodEntry (entry, (IDLID)repIDStack.peek ()); - method.sourceFile (scanner.fileEntry ()); - // Comment must immediately precede "init" keyword: - method.comment (token.comment); - repIDStack.push (((IDLID)repIDStack.peek ()).clone ()); - ((IDLID)repIDStack.peek ()).appendToName (token.name); - - // In 2.3 prelim, ::= "init" "(" ... - if (token.type == Token.Init) - { - method.name ("init"); - match (Token.Init); - match (Token.LeftParen); - } - else // In 2.4rtf, ::= "factory" "(" ... - { - match (Token.Factory); - method.name (token.name); - if (token.type == Token.MacroIdentifier) - match (Token.MacroIdentifier); // "(" already consumed. - else - { - match (Token.Identifier); - match (Token.LeftParen); - } - } - - if (token.type != Token.RightParen) - for (;;) - { - initParamDcl (method); - if (token.type == Token.RightParen) - break; - match (Token.Comma); - } - entry.initializersAddElement (method, scanner); - match (Token.RightParen); - match (Token.Semicolon); - repIDStack.pop (); - } // initDcl - - /** - * - **/ - private void initParamDcl (MethodEntry entry) throws IOException, ParseException - { - ParameterEntry parmEntry = stFactory.parameterEntry (entry, (IDLID)repIDStack.peek ()); - parmEntry.sourceFile (scanner.fileEntry()); - // Comment must immediately precede parameter attribute - parmEntry.comment (token.comment); - match (Token.In); - parmEntry.passType (ParameterEntry.In); - parmEntry.type (paramTypeSpec (entry)); - parmEntry.name (token.name); - match (Token.Identifier); - if (isntInList (entry.parameters (), parmEntry.name ())) - entry.addParameter (parmEntry); - } // initParamDcl - - /** - * - **/ - private void valueBox (ModuleEntry module, String name) throws IOException, ParseException - { - repIDStack.push (((IDLID)repIDStack.peek ()).clone ()); - // Note: The 'actual' repository ID will be calculated at the end of - // the parsing phase, since it is based on the entire contents of the - // declaration, and needs to have all forward references resolved: - ValueEntry entry = stFactory.valueBoxEntry (module, (IDLID)repIDStack.peek ()); - entry.sourceFile (scanner.fileEntry ()); - entry.name (name); - // comment must immediately precede "value" keyword - entry.comment (tokenHistory.lookBack (2).comment); - // Value boxes may not be forwarded. - // If this value has been forward declared, there are probably - // other values which derive from a ForwardValueEntry. - // Replace those ForwardValueEntry's with this ValueEntry: - //if (!ForwardValueEntry.replaceForwardDecl (entry)) - // ParseException.badAbstract (scanner, entry.fullName()); - SymtabEntry valueForward = (SymtabEntry)Parser.symbolTable.get (entry.fullName ()); - if (valueForward != null && valueForward instanceof ForwardEntry) - ParseException.forwardedValueBox (scanner, entry.fullName ()); - pigeonhole (module, entry); - ((IDLID)repIDStack.peek ()).appendToName (name); - currentModule = entry; - TypedefEntry typedefEntry = stFactory.typedefEntry (entry, (IDLID)repIDStack.peek ()); - typedefEntry.sourceFile (scanner.fileEntry ()); - typedefEntry.comment (token.comment); - // Workaround to place typedefEntry in the _contained vector of - // this value box entry ONLY when is a constructed type declared - // at this point (i.e., not an identifier that resolves to a constructed - // type), so that emitters may generate bindings for it. - boolean isConstTypeSpec = - token.type == Token.Struct || token.type == Token.Union || token.type == Token.Enum; - // Make typedefEntry anonymous. If this line is removed, the - // entry will be named incorrectly. - typedefEntry.name (""); - typedefEntry.type (typeSpec (typedefEntry)); - // Value boxes cannot be nested. - if (typedefEntry.type () instanceof ValueBoxEntry) - ParseException.nestedValueBox (scanner); - //typedefEntry.name (""); - entry.addStateElement (new InterfaceState (InterfaceState.Public, typedefEntry), scanner); - if (isConstTypeSpec) - entry.addContained (typedefEntry); - currentModule = module; - repIDStack.pop (); - } // valueBox - - /** - * - **/ - private void valueForwardDcl (ModuleEntry module, String name, boolean isAbstract) - throws IOException, ParseException - { - ForwardValueEntry entry = stFactory.forwardValueEntry (module, (IDLID)repIDStack.peek ()); - entry.sourceFile (scanner.fileEntry ()); - entry.name (name); - entry.setInterfaceType(isAbstract ? InterfaceType.ABSTRACT : InterfaceType.NORMAL ); - // Comment must immediately precede "[abstract] value" keyword[s] - entry.comment (tokenHistory.lookBack (isAbstract? 3 : 2).comment); - pigeonhole (module, entry); - } // valueForwardDcl - - private void nativeDcl (SymtabEntry entry) throws IOException, ParseException - { - match (Token.Native); - NativeEntry nativeEntry = stFactory.nativeEntry (entry, (IDLID)repIDStack.peek ()); - nativeEntry.sourceFile (scanner.fileEntry ()); - // Comment must immediately precede "native" keyword - nativeEntry.comment (tokenHistory.lookBack (1).comment); - nativeEntry.name (token.name); - match (Token.Identifier); - pigeonhole (entry, nativeEntry); - } // nativeDcl - /** - * - **/ - private void constDcl (SymtabEntry entry) throws IOException, ParseException - { - match (Token.Const); - ConstEntry constEntry = stFactory.constEntry (entry, (IDLID)repIDStack.peek ()); - constEntry.sourceFile (scanner.fileEntry ()); - // Comment must immediately precede "const" keyword - constEntry.comment (tokenHistory.lookBack (1).comment); - constType (constEntry); - constEntry.name (token.name); - match (Token.Identifier); - match (Token.Equal); - constEntry.value (constExp (constEntry)); - verifyConstType (constEntry.value (), typeOf (constEntry.type ())); - pigeonhole (entry, constEntry); - } // constDcl - - /** - * - **/ - private void constType (SymtabEntry entry) throws IOException, ParseException - { - switch (token.type) - { - case Token.Octet: - entry.type( octetType()) ; - break ; - case Token.Long: - case Token.Short: - case Token.Unsigned: - entry.type (integerType (entry)); - break; - case Token.Char: - case Token.Wchar: - entry.type (charType ()); - break; - case Token.Boolean: - entry.type (booleanType ()); - break; - case Token.Float: - case Token.Double: - entry.type (floatingPtType ()); - break; - case Token.String: - case Token.Wstring: - entry.type (stringType (entry)); - break; - case Token.Identifier: - case Token.DoubleColon: - entry.type (scopedName (entry.container (), stFactory.primitiveEntry ())); - if (hasArrayInfo (entry.type ())) - ParseException.illegalArray (scanner, "const"); - SymtabEntry entryType = typeOf (entry.type ()); - if (!((entryType instanceof PrimitiveEntry) || (entryType instanceof StringEntry))) - { - ParseException.wrongType(scanner, entry.fullName (), "primitive or string", entryName (entry.type ())); - entry.type (qualifiedEntry ("long")); - } - else if (entryType instanceof PrimitiveEntry) - { - String any = overrideName ("any"); - if (entryType.name().equals (any)) - { - ParseException.wrongType (scanner, entry.fullName (), "primitive or string (except " + any + ')', any); - entry.type (qualifiedEntry ("long")); - } - } - break; - default: - throw ParseException.syntaxError (scanner, new int [] { - Token.Long, Token.Short, Token.Unsigned, Token.Char, - Token.Wchar, Token.Boolean, Token.Float, Token.Double, - Token.String, Token.Wstring, Token.Identifier, - Token.DoubleColon }, token.type); - } - } // constType - - /** - * - **/ - private boolean hasArrayInfo (SymtabEntry entry) - { - while (entry instanceof TypedefEntry) - { - if (((TypedefEntry)entry).arrayInfo ().size () != 0) - return true; - entry = entry.type (); - } - return false; - } // hasArrayInfo - - /** - * - **/ - public static String overrideName (String string) - { - String name = (String)overrideNames.get (string); - return (name == null) ? string : name; - } // overrideName - - // If entry is boolean, expression value must be boolean - // If entry is float/double, expression value must be float/double - // If entry is integral, expression value must be integral - // If entry is string, expression value must be string - - /** - * - **/ - private void verifyConstType (Expression e, SymtabEntry t) - { - Object value = e.value (); - if (value instanceof BigInteger) - verifyIntegral ((Number)value, t); - else if (value instanceof String) - verifyString (e, t); - else if (value instanceof Boolean) - verifyBoolean (t); - else if (value instanceof Character) - verifyCharacter (e, t); - else if (value instanceof Float || value instanceof Double) - verifyFloat((Number)value, t); - else if (value instanceof ConstEntry) - verifyConstType (((ConstEntry)value).value (), t); - else - ParseException.wrongExprType (scanner, t.fullName (), - (value == null) ? "" : value.toString ()); - } // verifyConstType - - private static final int MAX_SHORT = 32767; - private static final int MIN_SHORT = -32768; - private static final int MAX_USHORT = 65535; - - /** - * - **/ - private void verifyIntegral (Number n, SymtabEntry t) - { - boolean outOfRange = false; - //KEEP: Useful for debugging com.sun.tools.corba.se.idl.constExpr package - //System.out.println ("verifyIntegral, n = " + n.toString ()); - - if (t == qualifiedEntry( "octet" )) { - if ((n.longValue() > 255) || (n.longValue() < 0)) - outOfRange = true ; - } else if (t == qualifiedEntry ("long")) { - if (n.longValue () > Integer.MAX_VALUE || n.longValue() < Integer.MIN_VALUE) - outOfRange = true; - } else if (t == qualifiedEntry ("short")) { - if (n.intValue () > Short.MAX_VALUE || n.intValue () < Short.MIN_VALUE) - outOfRange = true; - } else if (t == qualifiedEntry ("unsigned long")) { - if (n.longValue () > (long)Integer.MAX_VALUE*2+1 || n.longValue() < 0) - outOfRange = true; - } else if (t == qualifiedEntry ("unsigned short")) { - if (n.intValue () > (int) Short.MAX_VALUE*2+1 || n.intValue () < 0) - outOfRange = true; - } else if (t == qualifiedEntry ("long long")) { - // BigInteger required because value being compared may exceed - // java.lang.Long.MAX_VALUE/MIN_VALUE: - BigInteger llMax = BigInteger.valueOf (Long.MAX_VALUE); - BigInteger llMin = BigInteger.valueOf (Long.MIN_VALUE); - if (((BigInteger)n).compareTo (llMax) > 0 || - ((BigInteger)n).compareTo (llMin) < 0) - outOfRange = true; - } else if (t == qualifiedEntry ("unsigned long long")) { - BigInteger ullMax = BigInteger.valueOf (Long.MAX_VALUE). - multiply (BigInteger.valueOf (2)). - add (BigInteger.valueOf (1)); - BigInteger ullMin = BigInteger.valueOf (0); - if (((BigInteger)n).compareTo (ullMax) > 0 || - ((BigInteger)n).compareTo (ullMin) < 0) - outOfRange = true; - } else { - String got = null; - // THIS MUST BE CHANGED; BIGINTEGER IS ALWAYS THE CONTAINER - /* - if (n instanceof Short) - got = "short"; - else if (n instanceof Integer) - got = "long"; - else - got = "long long"; - */ - got = "long"; - ParseException.wrongExprType (scanner, t.fullName (), got); - } - - if (outOfRange) - ParseException.outOfRange (scanner, n.toString (), t.fullName ()); - } // verifyIntegral - - /** - * - **/ - private void verifyString (Expression e, SymtabEntry t) - { - String string = (String)(e.value()) ; - if (!(t instanceof StringEntry)) { - ParseException.wrongExprType (scanner, t.fullName (), e.type() ); - } else if (((StringEntry)t).maxSize () != null) { - Expression maxExp = ((StringEntry)t).maxSize (); - try { - Number max = (Number)maxExp.value (); - if (string.length () > max.intValue ()) - ParseException.stringTooLong (scanner, string, max.toString ()); - } catch (Exception exception) { - // If the above statement is not valid and throws an - // exception, then an error occurred and was reported - // earlier. Move on. - } - } - - if (!e.type().equals( t.name())) { - // cannot mix strings and wide strings - ParseException.wrongExprType (scanner, t.name(), e.type() ) ; - } - } // verifyString - - /** - * - **/ - private void verifyBoolean (SymtabEntry t) - { - if (!t.name ().equals (overrideName ("boolean"))) - ParseException.wrongExprType(scanner, t.name(), "boolean"); - } // verifyBoolean - - /** - * - **/ - private void verifyCharacter (Expression e, SymtabEntry t) - { - // Bug fix 4382578: Can't compile a wchar literal. - // Allow a Character to be either a char or a wchar. - if (!t.name ().equals (overrideName ("char")) && - !t.name ().equals (overrideName ("wchar")) || - !t.name().equals(e.type()) ) - ParseException.wrongExprType (scanner, t.fullName(), e.type() ) ; - } // verifyCharacter - - /** - * - **/ - private void verifyFloat (Number f, SymtabEntry t) - { - // Added range checking for floats. - //if (!(t.name ().equals (overrideName ("float")) || - // t.name ().equals (overrideName ("double")))) - // ParseException.wrongExprType (scanner, - // t.fullName (), (f instanceof Float) ? "float" : "double"); - //KEEP: Useful for debugging com.sun.tools.corba.se.idl.constExpr package - //System.out.println ("verifyFloat, f = " + f.toString ()); - boolean outOfRange = false; - if (t.name ().equals (overrideName ("float"))) - { - double absVal = (f.doubleValue () < 0.0) ? - f.doubleValue () * -1.0 : f.doubleValue (); - if ((absVal != 0.0) && - (absVal > Float.MAX_VALUE || absVal < Float.MIN_VALUE)) - outOfRange = true; - } - else if (t.name ().equals (overrideName ("double"))) - { - // Cannot check range of double until BigDecimal is the basis - // of all floating-point types. Currently, it is Double. The - // parser will fail when instantiating a Double with an exception. - } - else - { - ParseException.wrongExprType (scanner, t.fullName (), - (f instanceof Float) ? "float" : "double"); - } - if (outOfRange) - ParseException.outOfRange (scanner, f.toString (), t.fullName ()); - } // verifyFloat - - /** - * - **/ - Expression constExp (SymtabEntry entry) throws IOException, ParseException - { - // Parse the expression. - Expression expr = orExpr (null, entry); - - // Set its target type. - if (expr.type() == null) - expr.type (entry.typeName ()); - // Compute its value and coerce it to the target type. - try - { - expr.evaluate (); - - // Coerces integral value to Double if an integer literal - // was used to initialize a floating-point constant expression. - if (expr instanceof Terminal && - expr.value () instanceof BigInteger && - (overrideName (expr.type ()).equals ("float") || - overrideName (expr.type ()).indexOf ("double") >= 0)) - { - expr.value (new Double (((BigInteger)expr.value ()).doubleValue ())); - } - } - catch (EvaluationException exception) - { - ParseException.evaluationError (scanner, exception.toString ()); - } - return expr; - } // constExp - - /** - * - **/ - private Expression orExpr (Expression e, SymtabEntry entry) throws IOException, ParseException - { - if (e == null) - e = xorExpr (null, entry); - else - { - BinaryExpr b = (BinaryExpr)e; - b.right (xorExpr (null, entry)); - e.rep (e.rep () + b.right ().rep ()); - } - if (token.equals (Token.Bar)) - { - match (token.type); - Or or = exprFactory.or (e, null); - or.type (entry.typeName ()); - or.rep (e.rep () + " | "); - return orExpr (or, entry); - } - return e; - } // orExpr - - /** - * - **/ - private Expression xorExpr (Expression e, SymtabEntry entry) throws IOException, ParseException - { - if (e == null) - e = andExpr (null, entry); - else - { - BinaryExpr b = (BinaryExpr)e; - b.right (andExpr (null, entry)); - e.rep (e.rep () + b.right ().rep ()); - } - if (token.equals (Token.Carat)) - { - match (token.type); - Xor xor = exprFactory.xor (e, null); - xor.rep (e.rep () + " ^ "); - xor.type (entry.typeName ()); - return xorExpr (xor, entry); - } - return e; - } // xorExpr - - /** - * - **/ - private Expression andExpr (Expression e, SymtabEntry entry) throws IOException, ParseException - { - if (e == null) - e = shiftExpr (null, entry); - else - { - BinaryExpr b = (BinaryExpr)e; - b.right (shiftExpr (null, entry)); - e.rep (e.rep () + b.right ().rep ()); - } - if (token.equals (Token.Ampersand)) - { - match (token.type); - And and = exprFactory.and (e, null); - and.rep(e.rep () + " & "); - and.type (entry.typeName ()); - return andExpr (and, entry); - } - return e; - } // andExpr - - /** - * - **/ - private Expression shiftExpr (Expression e, SymtabEntry entry) throws IOException, ParseException - { - if (e == null) - e = addExpr (null, entry); - else - { - BinaryExpr b = (BinaryExpr)e; - b.right (addExpr (null, entry)); - e.rep (e.rep () + b.right ().rep ()); - } - if (token.equals (Token.ShiftLeft)) - { - match (token.type); - ShiftLeft sl = exprFactory.shiftLeft (e, null); - sl.type (entry.typeName ()); - sl.rep (e.rep () + " << "); - return shiftExpr (sl, entry); - } - if (token.equals (Token.ShiftRight)) - { - match (token.type); - ShiftRight sr = exprFactory.shiftRight (e, null); - sr.type (entry.typeName ()); - sr.rep (e.rep () + " >> "); - return shiftExpr (sr, entry); - } - return e; - } // shiftExpr - - /** - * - **/ - private Expression addExpr (Expression e, SymtabEntry entry) throws IOException, ParseException - { - if (e == null) - e = multExpr (null, entry); - else - { - BinaryExpr b = (BinaryExpr)e; - b.right (multExpr (null, entry)); - e.rep (e.rep () + b.right ().rep ()); - } - if (token.equals (Token.Plus)) - { - match (token.type); - Plus p = exprFactory.plus (e, null); - p.type (entry.typeName ()); - p.rep (e.rep () + " + "); - return addExpr (p, entry); - } - if (token.equals (Token.Minus)) - { - match (token.type); - Minus m = exprFactory.minus (e, null); - m.type (entry.typeName ()); - m.rep (e.rep () + " - "); - return addExpr (m, entry); - } - return e; - } // addExpr - - /** - * - **/ - private Expression multExpr (Expression e, SymtabEntry entry) throws IOException, ParseException - { - if (e == null) - e = unaryExpr (entry); - else - { - BinaryExpr b = (BinaryExpr)e; - b.right (unaryExpr (entry)); - e.rep (e.rep () + b.right ().rep ()); - } - if (token.equals (Token.Star)) - { - match (token.type); - Times t = exprFactory.times (e, null); - t.type (entry.typeName ()); - t.rep (e.rep () + " * "); - return multExpr (t, entry); - } - if (token.equals (Token.Slash)) - { - match (token.type); - Divide d = exprFactory.divide (e, null); - d.type (entry.typeName ()); - d.rep (e.rep () + " / "); - return multExpr (d, entry); - } - if (token.equals (Token.Percent)) - { - match (token.type); - Modulo m = exprFactory.modulo (e, null); - m.type (entry.typeName ()); - m.rep (e.rep () + " % "); - return multExpr (m, entry); - } - return e; - } // multExpr - - /** - * - **/ - private Expression unaryExpr (SymtabEntry entry) throws IOException, ParseException - { - if (token.equals (Token.Plus)) - { - match (token.type); - Expression e = primaryExpr (entry); - Positive pos = exprFactory.positive (e); - pos.type (entry.typeName()); - pos.rep ('+' + e.rep()); - return pos; - } - if (token.equals (Token.Minus)) - { - match (token.type); - Expression e = primaryExpr (entry); - Negative neg = exprFactory.negative (e); - neg.type (entry.typeName()); - neg.rep ('-' + e.rep()); - return neg; - } - if (token.equals (Token.Tilde)) - { - match (token.type); - Expression e = primaryExpr (entry); - Not not = exprFactory.not (e); - not.type (entry.typeName()); - not.rep ('~' + e.rep()); - return not; - } - return primaryExpr (entry); - } // unaryExpr - - /** - * - **/ - private Expression primaryExpr (SymtabEntry entry) - throws IOException, ParseException - { - Expression primary = null; - if (parsingConditionalExpr) - { - prep.token = token; // Give current token to preprocessor - primary = prep.primaryExpr (entry); - token = prep.token; // Get the current token from preprocessor - } - else - switch (token.type) - { - case Token.Identifier: - case Token.DoubleColon: - ConstEntry expectedC = stFactory.constEntry (); - expectedC.value (exprFactory.terminal ("1", BigInteger.valueOf (1))); - SymtabEntry ref = scopedName (entry.container (), expectedC); - if (!(ref instanceof ConstEntry)) - { - ParseException.invalidConst (scanner, ref.fullName ()); - // An error occurred. Just give it some bogus value. - //primary = exprFactory.terminal ("1", new Long (1)); - primary = exprFactory.terminal ("1", BigInteger.valueOf (1)); - } - else - primary = exprFactory.terminal ((ConstEntry)ref); - break; - case Token.BooleanLiteral: - case Token.CharacterLiteral: - case Token.IntegerLiteral: - case Token.FloatingPointLiteral: - case Token.StringLiteral: - primary = literal (entry); - break; - case Token.LeftParen: - match (Token.LeftParen); - primary = constExp (entry); - match (Token.RightParen); - primary.rep ('(' + primary.rep () + ')'); - break; - default: - throw ParseException.syntaxError (scanner, new int [] { - Token.Identifier, Token.DoubleColon, Token.Literal, Token.LeftParen}, - token.type); - } - return primary; - } // primaryExpr - - /** - * - **/ - Expression literal (SymtabEntry entry) throws IOException, ParseException - { - String string = token.name; - Expression literal = null; - switch (token.type) - { - case Token.IntegerLiteral: - match (Token.IntegerLiteral); - try - { - literal = exprFactory.terminal (string, parseString (string)); - literal.type (entry.typeName ()); - } - catch (NumberFormatException exception) - { - ParseException.notANumber (scanner, string); - literal = exprFactory.terminal ("0", BigInteger.valueOf (0)); - } - break; - case Token.CharacterLiteral: - boolean isWide = token.isWide(); - match (Token.CharacterLiteral); - literal = exprFactory.terminal ("'" + string.substring (1) + "'", - new Character (string.charAt (0)), isWide ); - break; - case Token.FloatingPointLiteral: - match (Token.FloatingPointLiteral); - try - { - literal = exprFactory.terminal (string, new Double (string)); - literal.type (entry.typeName ()); - } - catch (NumberFormatException e) - { - ParseException.notANumber (scanner, string); - } - break; - case Token.BooleanLiteral: - literal = booleanLiteral (); - break; - case Token.StringLiteral: - literal = stringLiteral (); - break; - default: - throw ParseException.syntaxError (scanner, Token.Literal,token.type); - } - return literal; - } // literal - - /** - * - **/ - private BigInteger parseString (String string) throws NumberFormatException - { - int radix = 10; - if (string.length() > 1) - if (string.charAt (0) == '0') - if (string.charAt (1) == 'x' || string.charAt (1) == 'X') - { - string = string.substring (2); - radix = 16; - } - else - radix = 8; - return new BigInteger (string, radix); - } // parseString - - /** - * - **/ - private Terminal booleanLiteral () throws IOException, ParseException - { - Boolean bool = null; - if (token.name.equals ("TRUE")) - bool = new Boolean (true); - else if (token.name.equals ("FALSE")) - bool = new Boolean (false); - else - { - ParseException.invalidConst (scanner, token.name); - bool = new Boolean (false); - } - String name = token.name; - match (Token.BooleanLiteral); - return exprFactory.terminal (name, bool); - } // booleanLiteral - - /** - * - **/ - private Expression stringLiteral () throws IOException, ParseException - { - // If string literals appear together, concatenate them. Ie: - // "Twas " "brillig " "and " "the " "slithy " "toves" - // becomes - // "Twas brillig and the slithy toves" - boolean isWide = token.isWide() ; - String literal = ""; - do - { - literal += token.name; - match (Token.StringLiteral); - } while (token.equals (Token.StringLiteral)); - Expression stringExpr = exprFactory.terminal (literal, isWide ); - stringExpr.rep ('"' + literal + '"'); - return stringExpr; - } // stringLiteral - - /** - * - **/ - private Expression positiveIntConst (SymtabEntry entry) throws IOException, ParseException - { - Expression e = constExp (entry); - Object value = e.value (); - while (value instanceof ConstEntry) - value = ((ConstEntry)value).value ().value (); - if (!(value instanceof Number) || value instanceof Float || value instanceof Double) - { - ParseException.notPositiveInt (scanner, e.rep ()); - //e = exprFactory.terminal ("1", new Long (1)); - e = exprFactory.terminal ("1", BigInteger.valueOf (1)); - } - //else if (((Number)value).longValue () <= 0) { - // ParseException.notPositiveInt (scanner, value.toString ()); - // e = exprFactory.terminal ("1", new Long (1)); } - else if (((BigInteger)value).compareTo (BigInteger.valueOf (0)) <= 0) - { - ParseException.notPositiveInt (scanner, value.toString ()); - //e = exprFactory.terminal ("1", new Long (1)); - e = exprFactory.terminal ("1", BigInteger.valueOf (1)); - } - return e; - } // positiveIntConst - - /** - * - **/ - private SymtabEntry typeDcl (SymtabEntry entry) throws IOException, ParseException - { - switch (token.type) - { - case Token.Typedef: - match (Token.Typedef); - return typeDeclarator (entry); - case Token.Struct: - return structType (entry); - case Token.Union: - return unionType (entry); - case Token.Enum: - return enumType (entry); - default: - throw ParseException.syntaxError (scanner, new int [] { - Token.Typedef, Token.Struct, Token.Union, Token.Enum}, token.type); - } - } // typeDcl - - /** - * - **/ - private TypedefEntry typeDeclarator (SymtabEntry entry) throws IOException, ParseException - { - TypedefEntry typedefEntry = stFactory.typedefEntry (entry, (IDLID)repIDStack.peek ()); - typedefEntry.sourceFile (scanner.fileEntry ()); - // Comment must immediately precede "typedef" keyword - typedefEntry.comment (tokenHistory.lookBack (1).comment); - typedefEntry.type (typeSpec (entry)); - Vector typedefList = new Vector (); - declarators (typedefEntry, typedefList); - for (Enumeration e = typedefList.elements(); e.hasMoreElements();) - pigeonhole (entry, (SymtabEntry)e.nextElement ()); - return typedefEntry; - } // typeDeclarator - - /** - * - **/ - private SymtabEntry typeSpec (SymtabEntry entry) throws IOException, ParseException - { - return ((token.type == Token.Struct) || - (token.type == Token.Union) || - (token.type == Token.Enum)) - ? constrTypeSpec (entry) - : simpleTypeSpec (entry, true); - } // typeSpec - - /** - * - **/ - private SymtabEntry simpleTypeSpec (SymtabEntry entry, - boolean mustBeReferencable ) throws IOException, ParseException - { - // - //if ((token.type == Token.Identifier) || - // (token.type == Token.DoubleColon) || - // (token.type == Token.Object)) { - if ((token.type == Token.Identifier) || - (token.type == Token.DoubleColon) || - (token.type == Token.Object) || - (token.type == Token.ValueBase)) - { - SymtabEntry container = ((entry instanceof InterfaceEntry) || - (entry instanceof ModuleEntry) || - (entry instanceof StructEntry) || - (entry instanceof UnionEntry)) - ? entry - : entry.container (); - return scopedName (container, stFactory.primitiveEntry (), - mustBeReferencable); - } - return ((token.type == Token.Sequence) || - (token.type == Token.String) || - (token.type == Token.Wstring)) - ? templateTypeSpec (entry) - : baseTypeSpec (entry); - } // simpleTypeSpec - - /** - * - **/ - private SymtabEntry baseTypeSpec (SymtabEntry entry) throws IOException, ParseException - { - switch (token.type) - { - case Token.Float: - case Token.Double: - return floatingPtType (); - case Token.Long: - case Token.Short: - case Token.Unsigned: - return integerType (entry); - case Token.Char: - case Token.Wchar: - return charType (); - case Token.Boolean: - return booleanType (); - case Token.Octet: - return octetType (); - case Token.Any: - return anyType (); - // NOTE: Object and ValueBase are s, but both - // are processed at simpleTypeSpec(), not here. parmTypeSpec() - // directly checks for these types. Could make baseTypeSpec() do - // the same - default: - throw ParseException.syntaxError (scanner, new int [] { - Token.Float, Token.Double, Token.Long, Token.Short, - Token.Unsigned, Token.Char, Token.Wchar, Token.Boolean, - Token.Octet, Token.Any}, token.type); - } - } // baseTypeSpec - - /** - * - **/ - private SymtabEntry templateTypeSpec (SymtabEntry entry) throws IOException, ParseException - { - switch (token.type) - { - case Token.Sequence: - return sequenceType (entry); - case Token.String: - case Token.Wstring: - return stringType (entry); - } - throw ParseException.syntaxError (scanner, new int [] {Token.Sequence, Token.String, Token.Wstring}, token.type); - } // templateTypeSpec - - /** - * - **/ - private SymtabEntry constrTypeSpec (SymtabEntry entry) throws IOException, ParseException - { - switch (token.type) - { - case Token.Struct: - return structType (entry); - case Token.Union: - return unionType (entry); - case Token.Enum: - return enumType (entry); - } - throw ParseException.syntaxError (scanner, new int [] {Token.Struct, Token.Union, Token.Enum}, token.type); - } // constrTypeSpec - - /** - * - **/ - private void declarators (TypedefEntry entry, Vector list) throws IOException, ParseException - { - for (; ; match (Token.Comma)) - { - TypedefEntry newEntry = (TypedefEntry)entry.clone (); - declarator (newEntry); - if (isntInList (list, newEntry.name ())) - list.addElement (newEntry); - if (token.type != Token.Comma) - break; - } - } // declarators - - /** - * - **/ - private void declarator (TypedefEntry entry) throws IOException, ParseException - { - entry.name (token.name); - // If the declarator is commented then override the comment cloned from the parent - // entry. <08aug1997daz> - if (!token.comment.text ().equals ("")) - entry.comment (token.comment); - match (Token.Identifier); - while (token.type == Token.LeftBracket) - fixedArraySize (entry); - } // declarator - - /** - * - **/ - private PrimitiveEntry floatingPtType () throws IOException, ParseException - { - String name = "double"; - if (token.type == Token.Float) - { - match (Token.Float); - name = "float"; - } - else if (token.type == Token.Double) - match (Token.Double); - else - { - int [] expected = {Token.Float, Token.Double}; - ParseException.syntaxError (scanner, new int [] {Token.Float, Token.Double }, token.type); - } - PrimitiveEntry ret = null; - try - { - ret = (PrimitiveEntry)qualifiedEntry (name); - } - catch (ClassCastException exception) - { - ParseException.undeclaredType (scanner, name); - } - return ret; - } // floatingPtType - - /** - * - **/ - private PrimitiveEntry integerType (SymtabEntry entry) throws IOException, ParseException - { - String name = ""; - if (token.type == Token.Unsigned) - { - match (Token.Unsigned); - name = "unsigned "; - } - name += signedInt(); - PrimitiveEntry ret = null; - try - { - ret = (PrimitiveEntry) qualifiedEntry (name); - } - catch (ClassCastException exception) - { - ParseException.undeclaredType (scanner, name); - } - return ret; - } // integerType - - /** - * - **/ - private String signedInt () throws IOException, ParseException - { - String ret = "long"; - if (token.type == Token.Long) - { - match (Token.Long); - // ::= "long" | e - if (token.type == Token.Long) - { - ret = "long long"; - match (Token.Long); - } - } - else if (token.type == Token.Short) - { - ret = "short"; - match (Token.Short); - } - else - ParseException.syntaxError (scanner, new int [] {Token.Long, Token.Short}, token.type); - return ret; - } // signedInt - - /** - * - **/ - private PrimitiveEntry charType () throws IOException, ParseException - { - String tokenName; - if (token.type == Token.Char) - { - match (Token.Char); - tokenName = "char"; - } - else - { - match (Token.Wchar); - tokenName = "wchar"; - } - PrimitiveEntry ret = null; - try - { - ret = (PrimitiveEntry) qualifiedEntry (tokenName); - } - catch (ClassCastException exception) - { - ParseException.undeclaredType (scanner, overrideName (tokenName)); - } - return ret; - } // charType - - /** - * - **/ - private PrimitiveEntry booleanType () throws IOException, ParseException - { - PrimitiveEntry ret = null; - match (Token.Boolean); - try - { - ret = (PrimitiveEntry) qualifiedEntry ("boolean"); - } - catch (ClassCastException exception) - { - ParseException.undeclaredType (scanner, overrideName ("boolean")); - } - return ret; - } // booleanType - - /** - * - **/ - private PrimitiveEntry octetType () throws IOException, ParseException - { - PrimitiveEntry ret = null; - match (Token.Octet); - try - { - ret = (PrimitiveEntry) qualifiedEntry ("octet"); - } - catch (ClassCastException exception) - { - ParseException.undeclaredType (scanner, overrideName ("octet")); - } - return ret; - } // octetType - - /** - * - **/ - private SymtabEntry anyType () throws IOException, ParseException - { - match (Token.Any); - try - { - return qualifiedEntry ("any"); - } - catch (ClassCastException exception) - { - ParseException.undeclaredType (scanner, overrideName ("any")); - return null; - } - } // anyType - - /** - * - **/ - private StructEntry structType (SymtabEntry entry) throws IOException, - ParseException - { - match (Token.Struct); - String name = token.name; - match (Token.Identifier); - StructEntry structEntry = null ; - - if (token.type == Token.LeftBrace) { - repIDStack.push(((IDLID)repIDStack.peek ()).clone ()) ; - structEntry = makeStructEntry( name, entry, false ) ; - ((IDLID)repIDStack.peek ()).appendToName (name); - prep.openScope (structEntry); - match (Token.LeftBrace) ; - member (structEntry) ; - memberList2 (structEntry) ; - prep.closeScope (structEntry); - match (Token.RightBrace) ; - repIDStack.pop() ; - } else if (token.equals( Token.Semicolon )) { - structEntry = makeStructEntry( name, entry, true ) ; - } else { - throw ParseException.syntaxError (scanner, - new int[] { Token.Semicolon, Token.LeftBrace }, token.type); - } - return structEntry; - } // structType - - private StructEntry makeStructEntry( String name, SymtabEntry entry, - boolean isForward ) - { - StructEntry structEntry = stFactory.structEntry (entry, - (IDLID)repIDStack.peek () ); - structEntry.isReferencable( !isForward ) ; - structEntry.sourceFile (scanner.fileEntry ()); - structEntry.name (name); - // Comment must immediately preceed "struct" keyword - structEntry.comment (tokenHistory.lookBack (1).comment); - pigeonhole( entry, structEntry ) ; - return structEntry ; - } - - /** - * - **/ - private void memberList2 (StructEntry entry) throws IOException - { - while (token.type != Token.RightBrace) - member (entry); - } // memberList2 - - /** - * - **/ - private void member (StructEntry entry) throws IOException - { - TypedefEntry newEntry = stFactory.typedefEntry(entry, (IDLID)repIDStack.peek()); - newEntry.sourceFile (scanner.fileEntry ()); - // comment must immediately precede lexeme - newEntry.comment (token.comment); - try - { - newEntry.type (typeSpec (entry)); - if (newEntry.type () == entry) - throw ParseException.recursive (scanner, entry.fullName (), - (token.name == null) ? "" : token.name); - // Exception cannot appear within a struct, union, or exception - if (typeOf (newEntry) instanceof ExceptionEntry) - throw ParseException.illegalException (scanner, entryName (entry)); - declarators (newEntry, entry.members ()); - match (Token.Semicolon); - } - catch (ParseException exception) - { - skipToSemicolon (); - } - } // member - - /** - * - **/ - private final boolean isConstTypeSpec (Token t) - { - return (t.type == Token.Struct || t.type == Token.Union || t.type == Token.Enum); - } // isConstTypeSpec - - /** - * - **/ - private UnionEntry unionType (SymtabEntry entry) throws IOException, ParseException - { - match (Token.Union) ; - String name = token.name ; - match (Token.Identifier) ; - UnionEntry unionEntry = null ; - - if (token.type == Token.Switch) { - repIDStack.push (((IDLID)repIDStack.peek ()).clone ()); - unionEntry = makeUnionEntry( name, entry, false ) ; - ((IDLID)repIDStack.peek ()).appendToName (name); - match (Token.Switch); - match (Token.LeftParen); - unionEntry.type (switchTypeSpec (unionEntry)); - match (Token.RightParen); - prep.openScope (unionEntry); - match (Token.LeftBrace); - switchBody (unionEntry); - verifyUnion (unionEntry); - prep.closeScope (unionEntry); - match (Token.RightBrace); - repIDStack.pop (); - } else if (token.equals( Token.Semicolon )) { - unionEntry = makeUnionEntry( name, entry, true ) ; - } else { - throw ParseException.syntaxError (scanner, - new int[] { Token.Semicolon, Token.Switch }, token.type); - } - - return unionEntry ; - } // unionType - - private UnionEntry makeUnionEntry( String name, SymtabEntry entry, - boolean isForward ) - { - UnionEntry unionEntry = stFactory.unionEntry (entry, - (IDLID)repIDStack.peek () ); - unionEntry.isReferencable( !isForward ) ; - unionEntry.sourceFile (scanner.fileEntry ()); - unionEntry.name (name); - // Comment must immediately preceed "union" keyword - unionEntry.comment (tokenHistory.lookBack (1).comment); - pigeonhole( entry, unionEntry ) ; - return unionEntry ; - } - - /** - * - **/ - private void verifyUnion (UnionEntry u) - { - if (u.typeName ().equals (overrideName ("boolean"))) - { - if (caseCount (u) > 2) - ParseException.noDefault (scanner); - } - else if (u.type () instanceof EnumEntry) - { - if (caseCount (u) > ((EnumEntry)u.type ()).elements ().size ()) - ParseException.noDefault (scanner); - } - } // verifyUnion - - /** - * - **/ - private long caseCount (UnionEntry u) - { - long cases = 0; - Enumeration branches = u.branches ().elements (); - while (branches.hasMoreElements ()) - { - UnionBranch branch = (UnionBranch)branches.nextElement (); - cases += branch.labels.size (); - if (branch.isDefault) - ++cases; - } - return cases; - } // caseCount - - /** - * - **/ - private SymtabEntry switchTypeSpec (UnionEntry entry) throws IOException, ParseException - { - SymtabEntry ret = null; - switch (token.type) - { - case Token.Long: - case Token.Short: - case Token.Unsigned: - return integerType (entry); - case Token.Char: - case Token.Wchar: - return charType(); - case Token.Boolean: - return booleanType(); - case Token.Enum: - return enumType (entry); - case Token.Identifier: - case Token.DoubleColon: - ret = scopedName (entry, stFactory.primitiveEntry ()); - if (hasArrayInfo (entry.type ())) - ParseException.illegalArray (scanner, "switch"); - SymtabEntry retType = typeOf (ret); - if (!(retType instanceof EnumEntry || retType instanceof PrimitiveEntry)) - ParseException.wrongType (scanner, ret.fullName (), - "long, unsigned long, short, unsigned short, char, boolean, enum", - entryName (ret.type ())); - else if (ret instanceof PrimitiveEntry) - { - SymtabEntry octet = qualifiedEntry ("octet"); - SymtabEntry flt = qualifiedEntry ("float"); - SymtabEntry dbl = qualifiedEntry ("double"); - if (retType == octet || retType == flt || retType == dbl) - ParseException.wrongType (scanner, ret.fullName(), - "long, unsigned long, short, unsigned short, char, boolean, enum", - entryName(ret.type ())); - } - break; - default: - throw ParseException.syntaxError (scanner, new int [] { - Token.Long, Token.Short, Token.Unsigned, Token.Char, - Token.Boolean, Token.Enum, Token.Identifier, - Token.DoubleColon }, token.type); - } - return ret; - } // switchTypeSpec - - // This is only used by the union methods - UnionBranch defaultBranch = null; - - /** - * - **/ - private void switchBody (UnionEntry entry) throws IOException, ParseException - { - caseProd (entry); - while (!token.equals (Token.RightBrace)) - caseProd (entry); - entry.defaultBranch ((defaultBranch == null) ? null : defaultBranch.typedef); - defaultBranch = null; - } // switchBody - - /** - * - **/ - private void caseProd (UnionEntry entry) throws IOException, ParseException - { - UnionBranch branch = new UnionBranch (); - entry.addBranch (branch); - caseLabel (entry, branch); - while (token.equals (Token.Case) || token.equals (Token.Default)) - caseLabel (entry, branch); - elementSpec (entry, branch); - match (Token.Semicolon); - } // caseProd - - /** - * - **/ - private void caseLabel (UnionEntry entry, UnionBranch branch) throws IOException, ParseException - { - if (token.type == Token.Case) - { - match (Token.Case); - ConstEntry tmpEntry = stFactory.constEntry (entry, (IDLID)repIDStack.peek ()); - tmpEntry.sourceFile (scanner.fileEntry ()); - tmpEntry.type (entry); - - Expression label; - SymtabEntry type = typeOf (entry.type ()); - if (type instanceof EnumEntry) - label = matchEnum ((EnumEntry)type); - else - { - label = constExp (tmpEntry); - verifyConstType (label, type); - } - if (entry.has (label)) - ParseException.branchLabel (scanner, label.rep ()); - branch.labels.addElement (label); - match (Token.Colon); - } - else if (token.type == Token.Default) - { - match (Token.Default); - match (Token.Colon); - if (entry.defaultBranch () != null) - ParseException.alreadyDefaulted (scanner); - branch.isDefault = true; - defaultBranch = branch; - } - else - throw ParseException.syntaxError (scanner, new int [] { Token.Case, Token.Default }, token.type); - } // caselabel - - /** - * - **/ - private Expression matchEnum (EnumEntry entry) throws IOException, ParseException - { - // Get the symbol table entry for the case label based on the - // scope of the EnumEntry, NOT the UnionEntry (the union could be - // in a different scope than the enum). Given - // module M { enum E {A, B, C, D}; }; - // a case label for A could be one of the following: - // case A: - // case M::A: - // case ::M::A: - SymtabEntry label = scopedName (entry.container(), new SymtabEntry ()); - return exprFactory.terminal (label.name (), false); - } // matchEnum - - /** - * - **/ - private void elementSpec (UnionEntry entry, UnionBranch branch) throws IOException, ParseException - { - TypedefEntry typedef = stFactory.typedefEntry (entry, (IDLID)repIDStack.peek ()); - typedef.sourceFile (scanner.fileEntry ()); - // Comment must immediately precede lexeme - typedef.comment (token.comment); - typedef.type (typeSpec (entry)); - if (typedef.type () == entry) - throw ParseException.recursive (scanner, entry.fullName (), (token.name == null)? "" : token.name); - // Exception cannot appear within a struct, union, or exception - if (typeOf (typedef) instanceof ExceptionEntry) - throw ParseException.illegalException (scanner, entryName (entry)); - declarator (typedef); - branch.typedef = typedef; - // Ensure a branch with the same name doesn't already exist. - if (entry.has (typedef)) - ParseException.branchName (scanner, typedef.name ()); - } // elementSpec - - /** - * - **/ - private EnumEntry enumType (SymtabEntry entry) throws IOException, ParseException - { - match (Token.Enum); - EnumEntry enumEntry = newEnumEntry (entry); - // comment must immediately precede "enum" keyword - enumEntry.comment (tokenHistory.lookBack (1).comment); - enumEntry.name (token.name); - match (Token.Identifier); - prep.openScope (enumEntry); - match (Token.LeftBrace); - if (isntInStringList (enumEntry.elements (), token.name)) - { - enumEntry.addElement (token.name); - SymtabEntry element = new SymtabEntry (entry, (IDLID)repIDStack.peek ()); - // if block taken from EnumEntry ctor - if (element.module ().equals ("")) - element.module (element.name ()); - else if (!element.name ().equals ("")) - element.module (element.module () + "/" + element.name ()); - element.name (token.name); - // Place the SymtabEntry representing this enumeration - // contant into the SymtabEntry defining its scope (e.g., InterfaceEntry, - // ValueEntry, etc.) rather than the SymtabEntry passed in, which - // may not define the contant's scope (e.g., TypedefEntry). - //pigeonhole (entry, element); } - pigeonhole (enumEntry.container (), element); - } - match (Token.Identifier); - enumType2 (enumEntry); - prep.closeScope (enumEntry); - match (Token.RightBrace); - return enumEntry; - } // enumType - - /** - * - **/ - private void enumType2 (EnumEntry entry) throws IOException, ParseException - { - while (token.type == Token.Comma) - { - match (Token.Comma); - String name = token.name; - match (Token.Identifier); - if (isntInStringList (entry.elements (), name)) - { - entry.addElement (name); - SymtabEntry element = new SymtabEntry (entry.container (), (IDLID)repIDStack.peek ()); - // if block taken from EnumEntry ctor: - if (element.module ().equals ("")) - element.module (element.name ()); - else if (!element.name().equals ("")) - element.module (element.module () + "/" + element.name ()); - element.name (name); - pigeonhole (entry.container (), element); - } - } - } // enumType2 - - /** - * - **/ - private SequenceEntry sequenceType (SymtabEntry entry) throws IOException, ParseException - { - match (Token.Sequence); - match (Token.LessThan); - - SequenceEntry newEntry = newSequenceEntry (entry); - SymtabEntry tsentry = simpleTypeSpec (newEntry, false ); - newEntry.type (tsentry); - if (!tsentry.isReferencable()) { - // This is a sequence type that is referencing an - // incomplete forward declaration of a struct or - // union. Save the sequence in a list for later - // backpatching. - try { - List fwdTypes = (List)tsentry.dynamicVariable( ftlKey ) ; - if (fwdTypes == null) { - fwdTypes = new ArrayList() ; - tsentry.dynamicVariable( ftlKey, fwdTypes ) ; - } - fwdTypes.add( newEntry ) ; - } catch (NoSuchFieldException exc) { - throw new IllegalStateException() ; - } - } - - if (token.type == Token.Comma) - { - match (Token.Comma); - ConstEntry tmpEntry = stFactory.constEntry (newEntry, (IDLID)repIDStack.peek ()); - tmpEntry.sourceFile (scanner.fileEntry ()); - tmpEntry.type (qualifiedEntry ("long")); - newEntry.maxSize (positiveIntConst (tmpEntry)); - verifyConstType (newEntry.maxSize(), qualifiedEntry ("long")); - } - match (Token.GreaterThan); - return newEntry; - } // sequenceType - - /** - * - **/ - private StringEntry stringType (SymtabEntry entry) throws IOException, ParseException - { - StringEntry string = stFactory.stringEntry (); - if (token.type == Token.String) - { - string.name (overrideName ("string")); - match (Token.String); - } - else - { - string.name (overrideName ("wstring")); - match (Token.Wstring); - } - string.maxSize (stringType2 (entry)); - return string; - } // stringType - - /** - * - **/ - private Expression stringType2 (SymtabEntry entry) throws IOException, ParseException - { - if (token.type == Token.LessThan) - { - match (Token.LessThan); - - // START IBM.11417 failure in the IDL compiler - //Expression maxSize = positiveIntConst (entry); IBM.11417 - - ConstEntry tmpEntry = stFactory.constEntry (entry, (IDLID)repIDStack.peek -()); - tmpEntry.sourceFile (scanner.fileEntry ()); - tmpEntry.type (qualifiedEntry ("long")); - Expression maxSize = positiveIntConst (tmpEntry); - - // END IBM.11417 - - verifyConstType (maxSize, qualifiedEntry ("long")); - match (Token.GreaterThan); - return maxSize; - } - return null; - } // stringType2 - - /** - * - **/ - private void fixedArraySize (TypedefEntry entry) throws IOException, ParseException - { - match (Token.LeftBracket); - ConstEntry tmpEntry = stFactory.constEntry (entry, (IDLID)repIDStack.peek ()); - tmpEntry.sourceFile (scanner.fileEntry ()); - // Set type of tmpExpr to "long", which is the array index type. - // Previously, this type was erroneously set to the array element type. - //tmpEntry.type (entry.type ()); - tmpEntry.type (qualifiedEntry ("long")); - Expression expr = positiveIntConst (tmpEntry); - entry.addArrayInfo (expr); - verifyConstType (expr, qualifiedEntry ("long")); - match (Token.RightBracket); - } // fixedArraySize - - /** - * - **/ - private void attrDcl (InterfaceEntry entry) throws IOException, ParseException - { - AttributeEntry attribute = stFactory.attributeEntry (entry, (IDLID)repIDStack.peek ()); - attribute.sourceFile (scanner.fileEntry ()); - // Comment must immediately precede the "attribute" keyword. Save the - // comment preceding the declaration for use below. - attribute.comment (token.comment); - Comment dclComment = attribute.comment (); - - if (token.type == Token.Readonly) - { - match (Token.Readonly); - attribute.readOnly (true); - } - match (Token.Attribute); - attribute.type (paramTypeSpec (attribute)); - attribute.name (token.name); - // Override declaration comment if attribute identifier is commented - if (!token.comment.text ().equals ("")) - attribute.comment (token.comment); - entry.methodsAddElement (attribute, scanner); - pigeonholeMethod (entry, attribute); - // Declaration comment was overriden: - if (!token.comment.text ().equals ("")) - { - // Create a temporary attribute with declaration comment so cloning in - // attrdcl2() can use declaration comment as default. - AttributeEntry attributeClone = (AttributeEntry) attribute.clone (); - attributeClone.comment (dclComment); - - match (Token.Identifier); - attrDcl2 (entry, attributeClone); - } - else - { - match (Token.Identifier); - attrDcl2 (entry, attribute); - } - //match (Token.Identifier); - //attrDcl2 (entry, attribute); - } // attrDcl - - /** - * - **/ - private void attrDcl2 (InterfaceEntry entry, AttributeEntry clone) - throws IOException, ParseException - { - while (token.type == Token.Comma) - { - match (Token.Comma); - AttributeEntry attribute = (AttributeEntry)clone.clone (); - attribute.name (token.name); - // Override the declaration comment (i.e., that preceding the - // "attribute" keyword) if the attribute identifier is commented. - if (!token.comment.text ().equals ("")) - attribute.comment (token.comment); - entry.methodsAddElement (attribute, scanner); - pigeonholeMethod (entry, attribute); - match (Token.Identifier); - } - } // attrDcl2 - - /** - * - **/ - private void exceptDcl (SymtabEntry entry) throws IOException, ParseException - { - match (Token.Exception); - repIDStack.push (((IDLID)repIDStack.peek ()).clone ()); - ExceptionEntry exceptEntry = stFactory.exceptionEntry (entry, (IDLID)repIDStack.peek ()); - ((IDLID)repIDStack.peek ()).appendToName (token.name); - exceptEntry.sourceFile (scanner.fileEntry ()); - // Comment must immediately precede "exception" keyword - exceptEntry.comment (tokenHistory.lookBack (1).comment); - exceptEntry.name (token.name); - match (Token.Identifier); - pigeonhole (entry, exceptEntry); - if (token.equals (Token.LeftBrace)) - { - prep.openScope (exceptEntry); - match (Token.LeftBrace); - memberList2 (exceptEntry); - prep.closeScope (exceptEntry); - match (Token.RightBrace); - repIDStack.pop (); - } - else - throw ParseException.syntaxError (scanner, Token.LeftBrace,token.type); - } // exceptDcl - - /** - * - **/ - private void opDcl (InterfaceEntry entry) throws IOException, ParseException - { - MethodEntry method = stFactory.methodEntry (entry, (IDLID)repIDStack.peek ()); - method.sourceFile (scanner.fileEntry ()); - // Comment must immediately precede "oneway" keyword or - method.comment (token.comment); - if (token.type == Token.Oneway) - { - match (Token.Oneway); - method.oneway (true); - } - method.type (opTypeSpec (method)); - repIDStack.push (((IDLID)repIDStack.peek ()).clone ()); - ((IDLID)repIDStack.peek ()).appendToName (token.name); - method.name (token.name); - entry.methodsAddElement (method, scanner); - pigeonholeMethod (entry, method); - opDcl2 (method); - if (method.oneway ()) - checkIfOpLegalForOneway (method); - repIDStack.pop (); - } // opDcl - - /** - * - **/ - private void checkIfOpLegalForOneway (MethodEntry method) - { - boolean notLegal = false; - if ((method.type() != null) || - (method.exceptions().size() != 0)) notLegal = true; - else - { - for (Enumeration e = method.parameters().elements(); e.hasMoreElements();) - { - if (((ParameterEntry)e.nextElement ()).passType () != ParameterEntry.In) - { - notLegal = true; - break; - } - } - } - if (notLegal) - ParseException.oneway (scanner, method.name ()); - } // checkifOpLegalForOneway - - /** - * - **/ - private void opDcl2 (MethodEntry method) throws IOException, ParseException - { - if (token.equals (Token.MacroIdentifier)) - { - match (Token.MacroIdentifier); - parameterDcls2 (method); - } - else - { - match (Token.Identifier); - parameterDcls (method); - } - opDcl3 (method); - } // opDcl2 - - /** - * - **/ - private void opDcl3 (MethodEntry entry) throws IOException, ParseException - { - if (token.type != Token.Semicolon) - { - if (!token.equals (Token.Raises) && !token.equals (Token.Context)) - throw ParseException.syntaxError (scanner, new int [] { - Token.Raises, Token.Context, Token.Semicolon }, token.type); - if (token.type == Token.Raises) - raisesExpr (entry); - if (token.type == Token.Context) - contextExpr (entry); - } - } // opDcl3 - - /** - * - **/ - private SymtabEntry opTypeSpec (SymtabEntry entry) throws IOException, ParseException - { - SymtabEntry ret = null; - if (token.type == Token.Void) - match (Token.Void); - else - ret = paramTypeSpec (entry); - return ret; - } // opTypeSpec - - /** - * - **/ - private void parameterDcls (MethodEntry entry) throws IOException, ParseException - { - match (Token.LeftParen); - parameterDcls2 (entry); - } // parameterDcls - - /** - * - **/ - private void parameterDcls2 (MethodEntry entry) throws IOException, ParseException - { - if (token.type == Token.RightParen) - match (Token.RightParen); - else - { - paramDcl (entry); - while (token.type == Token.Comma) - { - match (Token.Comma); - paramDcl (entry); - } - match (Token.RightParen); - } - } // paraneterDcls2 - - /** - * - **/ - private void paramDcl (MethodEntry entry) throws IOException, ParseException - { - ParameterEntry parmEntry = stFactory.parameterEntry (entry, (IDLID)repIDStack.peek ()); - parmEntry.sourceFile (scanner.fileEntry ()); - // Comment must immeiately precede the parameter attribute - parmEntry.comment (token.comment); - paramAttribute (parmEntry); - parmEntry.type (paramTypeSpec (entry)); - parmEntry.name (token.name); - match (Token.Identifier); - if (isntInList (entry.parameters (), parmEntry.name ())) - entry.addParameter (parmEntry); - } // paramDcl - - /** - * - **/ - private void paramAttribute (ParameterEntry entry) throws IOException, ParseException - { - if (token.type == Token.In) - { - entry.passType (ParameterEntry.In); - match (Token.In); - } - else if (token.type == Token.Out) - { - entry.passType (ParameterEntry.Out); - match (Token.Out); - } - else if (token.type == Token.Inout) - { - entry.passType (ParameterEntry.Inout); - match (Token.Inout); - } - else - throw ParseException.syntaxError (scanner, new int [] { - Token.In, Token.Out, Token.Inout }, token.type); - } // paramAttribute - - /** - * - **/ - private void raisesExpr (MethodEntry entry) throws IOException, ParseException - { - match (Token.Raises); - match (Token.LeftParen); - // Comment must immediately precede for exception - Comment tempComment = token.comment; - SymtabEntry exception = scopedName(entry.container (), stFactory.exceptionEntry ()); - if (typeOf (exception) instanceof ExceptionEntry) - { - // Comment must immediately precede for exception - exception.comment (tempComment); - if (isntInList (entry.exceptions (), exception)) - entry.exceptionsAddElement ((ExceptionEntry) exception); - } - else - ParseException.wrongType (scanner, exception.fullName(), - "exception", entryName (exception.type ())); - raisesExpr2 (entry); - match (Token.RightParen); - } // raisesExpr - - /** - * - **/ - private void raisesExpr2 (MethodEntry entry) throws IOException, ParseException - { - while (token.type == Token.Comma) - { - match (Token.Comma); - // Comment must immediately precede of exception - Comment tempComment = token.comment; - SymtabEntry exception = scopedName (entry.container (), stFactory.exceptionEntry ()); - if (typeOf (exception) instanceof ExceptionEntry) - { - // Comment must immediately precede of exception - exception.comment (tempComment); - if (isntInList (entry.exceptions (), exception)) - entry.addException ((ExceptionEntry)exception); - } - else - ParseException.wrongType (scanner, exception.fullName (), - "exception", entryName (exception.type ())); - } - } // raisesExpr2 - - /** - * - **/ - private void contextExpr (MethodEntry entry) throws IOException, ParseException - { - match (Token.Context); - match (Token.LeftParen); - String stringLit = (String)stringLiteral ().value (); - if (isntInStringList (entry.contexts (), stringLit)) - entry.addContext (stringLit); - contextExpr2 (entry); - match (Token.RightParen); - } // contextExpr - - - private void contextExpr2 (MethodEntry entry) throws IOException, ParseException - { - while (token.type == Token.Comma) - { - match (Token.Comma); - String stringLit = (String)stringLiteral ().value (); - if (isntInStringList (entry.contexts (), stringLit)) - entry.addContext (stringLit); - } - } // contextExpr2 - - /** - * - **/ - private SymtabEntry paramTypeSpec (SymtabEntry entry) throws IOException, ParseException - { - SymtabEntry ret = null; - switch (token.type) - { - case Token.Float: - case Token.Double: - case Token.Long: - case Token.Short: - case Token.Unsigned: - case Token.Char: - case Token.Wchar: - case Token.Boolean: - case Token.Octet: - case Token.Any: - return baseTypeSpec (entry); - case Token.String: - case Token.Wstring: - return stringType (entry); - case Token.Identifier: - case Token.Object: - // - case Token.ValueBase: - case Token.DoubleColon: - ret = scopedName (entry.container (), stFactory.primitiveEntry ()); - if (typeOf (ret) instanceof AttributeEntry) - //ParseException.attributeParamType (scanner); - ParseException.attributeNotType (scanner, ret.name ()); - else // - if (typeOf (ret) instanceof MethodEntry) - ParseException.operationNotType (scanner, ret.name ()); - - //if (!(returnType instanceof PrimitiveEntry || - // returnType instanceof StringEntry)) - //ParseException.wrongType (scanner, ret.fullName(), - // "primitive or string", entryName (ret.type())); - break; - default: - throw ParseException.syntaxError (scanner, new int [] { - Token.Float, Token.Double, Token.Long, Token.Short, - Token.Unsigned, Token.Char, Token.Wchar, Token.Boolean, - Token.Octet, Token.Any, Token.String, Token.Wstring, - Token.Identifier, Token.DoubleColon, Token.ValueBase }, token.type); - } - return ret; - } // paramTypeSpec - - /** - * - **/ - private void match (int type) throws IOException, ParseException - { - ParseException exception = null; - if (!token.equals (type)) - { - exception = ParseException.syntaxError (scanner, type, token.type); - // Missing a semicolon is a common error. If a semicolon was expected, - // assume it exists and keep the current token (don't get the next one). - // BEWARE!!! THIS HAS THE POTENTIAL FOR AN INFINITE LOOP! - if (type == Token.Semicolon) - return; - } - // Unecessary due to new valueElement() algorithm. - //if (!tokenStack.empty()) - //{ - // token = (Token)tokenStack.pop (); - // return; - //} - - // Fetch the next token. - token = scanner.getToken (); - - // Issue warnings about tokens. - issueTokenWarnings (); - - // Maintain history of most recent tokens. - tokenHistory.insert (token); - - // Identifiers that collide with keywords are illegal. Note - // that escaped identifers never collide! - /* - if (token.collidesWithKeyword ()) - { - // Issue a warning only - if (corbaLevel <= 2.2f) - ParseException.keywordCollisionWarning (scanner, token.name); - else - exception = ParseException.keywordCollision (scanner, token.name); - } - */ - - while (token.isDirective ()) - token = prep.process (token); - - // If the token is a defined thingy, scan the defined string - // instead of the input stream for a while. - if (token.equals (Token.Identifier) || token.equals (Token.MacroIdentifier)) - { - String string = (String)symbols.get (token.name); - if (string != null && !string.equals ("")) - { - // If this is a macro, parse the macro - if (macros.contains (token.name)) - { - scanner.scanString (prep.expandMacro (string, token)); - match (token.type); - } - else // This is just a normal define. - { - scanner.scanString (string); - match (token.type); - } - } - } - if (exception != null) - throw exception; - } // match - - // - /** - * Issue warnings according to attributes of current Token. - **/ - private void issueTokenWarnings () - { - if (noWarn) - return; - - if ((token.equals (Token.Identifier) || token.equals (Token.MacroIdentifier)) - && !token.isEscaped ()) - { - // Identifier collision with keyword in another release. - // Identifier collision with keyword in letter, but not in case. - if (token.collidesWithKeyword ()) - ParseException.warning (scanner, Util.getMessage ("Migration.keywordCollision", token.name)); - } - // Deprecated keyword. - if (token.isKeyword () && token.isDeprecated ()) - ParseException.warning (scanner, Util.getMessage ("Deprecated.keyword", token.toString ())); - } // issueTokenWarnings - - /** - * - **/ - private ModuleEntry newModule (ModuleEntry oldEntry) - { - ModuleEntry entry = stFactory.moduleEntry (oldEntry, (IDLID)repIDStack.peek ()); - entry.sourceFile (scanner.fileEntry ()); - entry.name (token.name); - // If this named module already exists, just reopen it. - /* <46082.46.01> if cppModule, always create new module entry */ - SymtabEntry prevEntry = (SymtabEntry) symbolTable.get (entry.fullName ()); - if (!cppModule && prevEntry != null && prevEntry instanceof ModuleEntry) - { - // A module has been reopened, return that ModuleEntry. - entry = (ModuleEntry) prevEntry; - if (oldEntry == topLevelModule) - { - // Do a little checking: - if (!entry.emit ()) - // The entry module is being reopened to put new stuff into it. - // The module itself is not marked as "emit", but the new stuff - // may be, so put the module on the emitList (add it to topLevelModule). - addToContainer (oldEntry, entry); - else if (!oldEntry.contained().contains (entry)) - // The entry module being reopened is to be emitted, but - // will not be placed on the emitList! I.E., it was not added to - // topLevelModule. Occurs when a generator manually inserts - // ModuleEntrys into the symbol table (e.g., org; see preParse() - // in ...idl.toJava.Compile). - addToContainer (oldEntry, entry); - } - } - else - pigeonhole (oldEntry, entry); - return entry; - } // newModule - - /** - * - **/ - private EnumEntry newEnumEntry (SymtabEntry oldEntry) - { - EnumEntry entry = stFactory.enumEntry (oldEntry, (IDLID)repIDStack.peek ()); - entry.sourceFile (scanner.fileEntry ()); - entry.name (token.name); - pigeonhole (oldEntry, entry); - return entry; - } // newEnumEntry - - /** - * - **/ - private SequenceEntry newSequenceEntry (SymtabEntry oldEntry) - { - SequenceEntry entry = stFactory.sequenceEntry (oldEntry, (IDLID)repIDStack.peek ()); - entry.sourceFile (scanner.fileEntry ()); - entry.name (""); - pigeonhole (oldEntry, entry); - return entry; - } // newSequenceEntry - - private void updateSymbolTable( String fullName, SymtabEntry entry, boolean lcCheck ) - { - // Check for case-insensitive collision (IDL error). - String lcFullName = fullName.toLowerCase(); - if (lcCheck) - if (lcSymbolTable.get (lcFullName) != null) { - ParseException.alreadyDeclared (scanner, fullName); - } - symbolTable.put (fullName, entry); - lcSymbolTable.put (lcFullName, entry); - // Allow fully-qualified CORBA types to be resolved by mapping - // short name (e.g., CORBA/StringValue) to long name, actual name. - String omgPrefix = "org/omg/CORBA" ; - if (fullName.startsWith (omgPrefix)) { - overrideNames.put ( - "CORBA" + fullName.substring (omgPrefix.length()), fullName); - } - } - - private void pigeonhole (SymtabEntry container, SymtabEntry entry) - { - if (entry.name().equals ("")) - entry.name (unknownNamePrefix + ++sequence); - - // If this object is not in the overrides list, then it is - // ok to put it in the table (if it IS in the overrides list, - // it is already in the table under a different name). - String fullName = entry.fullName(); - if (overrideNames.get (fullName) == null) { - addToContainer (container, entry); - - // It is an error is this name already exists in the symbol - // table, unless this is a redefinition of a forward decl. - // Re-opening a module is also legal, but not handled here. - SymtabEntry oldEntry = (SymtabEntry) symbolTable.get (fullName); - - if (oldEntry == null) { - updateSymbolTable( fullName, entry, true ) ; - } else if (oldEntry instanceof ForwardEntry && - entry instanceof InterfaceEntry) { - - String repIDPrefix = ((IDLID)entry.repositoryID ()).prefix (); - String oldRepIDPrefix = ((IDLID)oldEntry.repositoryID ()).prefix (); - if (repIDPrefix.equals (oldRepIDPrefix)) { - updateSymbolTable( fullName, entry, false ) ; - } else { - ParseException.badRepIDPrefix (scanner, fullName, - oldRepIDPrefix, repIDPrefix); - } - } else if (entry instanceof ForwardEntry && - (oldEntry instanceof InterfaceEntry || - oldEntry instanceof ForwardEntry)) { - if (oldEntry instanceof ForwardEntry && - entry.repositoryID () instanceof IDLID && - oldEntry.repositoryID () instanceof IDLID) { - - String repIDPrefix = - ((IDLID)entry.repositoryID ()).prefix (); - String oldRepIDPrefix = - ((IDLID)oldEntry.repositoryID ()).prefix (); - - if (!(repIDPrefix.equals (oldRepIDPrefix))) { - // Disallow multiple ForwardEntry's having same Repository - // ID prefixes (CORBA 2.3). - ParseException.badRepIDPrefix (scanner, fullName, - oldRepIDPrefix, repIDPrefix); - } - } - } else if (cppModule && entry instanceof ModuleEntry && - oldEntry instanceof ModuleEntry) { - // Allow multiple ModuleEntrys when user submits - // the -cppModule flag. - } else if (fullName.startsWith ("org/omg/CORBA") || - fullName.startsWith ("CORBA")) { - // Ignore CORBA PIDL types entered at preParse() by generator. - } else if (isForwardable( oldEntry, entry )) { - // Both oldEntry and entry are structs or unions. - // Legality depends on isReferencable on the two entries: - // oldEntry Entry - // T T ERROR alreadyDeclared - // T F legal fwd decl - // F T if defined in same file legal, - // otherwise ERROR - // F F legal fwd decl - if (oldEntry.isReferencable() && entry.isReferencable()) - ParseException.alreadyDeclared (scanner, fullName); - - if (entry.isReferencable()) { - String firstFile = - oldEntry.sourceFile().absFilename() ; - String defFile = - entry.sourceFile().absFilename() ; - if (!firstFile.equals( defFile )) - ParseException.declNotInSameFile( scanner, - fullName, firstFile ) ; - else { - updateSymbolTable( fullName, entry, false ) ; - - List oldRefList ; - - try { - oldRefList = (List)oldEntry.dynamicVariable( - ftlKey ) ; - } catch (NoSuchFieldException exc) { - throw new IllegalStateException() ; - } - - if (oldRefList != null) { - // Update entries in backpatch list - Iterator iter = oldRefList.iterator() ; - while (iter.hasNext()) { - SymtabEntry elem = (SymtabEntry)iter.next() ; - elem.type( entry ) ; - } - } - } - } - } else { - ParseException.alreadyDeclared (scanner, fullName); - } - } - } // pigeonhole - - private boolean isForwardable( SymtabEntry oldEntry, - SymtabEntry entry ) - { - return ((oldEntry instanceof StructEntry) && - (entry instanceof StructEntry)) || - ((oldEntry instanceof UnionEntry) && - (entry instanceof UnionEntry)) ; - } - - // pigeonhole checks to see if this entry is already in the symbol - // table and generates an error if it is. Methods must be checked - // not only against the symbol table but also against their - // interface's parent's methods. This is done in InterfaceEntry. - // verifyMethod, so no checking need be done here. - - /** - * - **/ - private void pigeonholeMethod (InterfaceEntry container, MethodEntry entry) - { - if (entry.name ().equals ("")) - entry.name (unknownNamePrefix + ++sequence); - - // If this object is not in the overrides list, then it is - // ok to put it in the table (if it IS in the overrides list, - // it is already in the table under a different name). - String fullName = entry.fullName (); - if (overrideNames.get (fullName) == null) - { - addToContainer (container, entry); - String lcFullName = fullName.toLowerCase (); - symbolTable.put (fullName, entry); - lcSymbolTable.put (lcFullName, entry); - // Allow fully-qualified CORBA types to be resolved by mapping - // short name (e.g., CORBA/StringValue) to long name, actual name. - if (fullName.startsWith ("org/omg/CORBA")) - overrideNames.put ("CORBA" + fullName.substring (13), fullName); - } - } // pigeonholeMethod - - /** - * - **/ - private void addToContainer (SymtabEntry container, SymtabEntry contained) - { - if (container instanceof ModuleEntry) - ((ModuleEntry)container).addContained (contained); - else if (container instanceof InterfaceEntry) - ((InterfaceEntry)container).addContained (contained); - else if (container instanceof StructEntry) - ((StructEntry)container).addContained (contained); - else if (container instanceof UnionEntry) - ((UnionEntry)container).addContained (contained); - else if (container instanceof SequenceEntry) - ((SequenceEntry)container).addContained (contained); - } // addToContainer - - // NOTE: qualifiedEntry/partlyQualifiedEntry/unqualifiedEntry and - // their court could probably use some performance improvements, - // but I'm scared to touch anything. It's the most complex bit of - // code in this parser. - - // The qualified named type is searched for in the following order: - // 1. OverrideNames - // 2. Global scope - // 3. Inheritance scope (if container is an interface) - // A qualified name is one which begins with :: or is assumed to be - // in the global scope (like long, short, etc). - - /** - * - **/ - SymtabEntry qualifiedEntry (String typeName) - { - SymtabEntry type = recursiveQualifiedEntry (typeName); - if (type == null) - // Then it's not anywhere, report the error. - ParseException.undeclaredType (scanner, typeName); - - // Relax this retriction when parsing ID pragma directive, e.g.. - //else if (type instanceof ModuleEntry) { - else if (type instanceof ModuleEntry && !_isModuleLegalType) - { - // Module's are not valid types. - ParseException.moduleNotType (scanner, typeName); - type = null; - } - return type; - } // qualifiedEntry - - /** - * - **/ - SymtabEntry recursiveQualifiedEntry (String typeName) - { - SymtabEntry type = null; - if (typeName != null && !typeName.equals ("void")) - { - int index = typeName.lastIndexOf ('/'); - if (index >= 0) - { - // Figure out if the container of this thing exists, converting any typedefs to interfaces if necessary. - type = recursiveQualifiedEntry (typeName.substring (0, index)); - if (type == null) - return null; - else if (type instanceof TypedefEntry) - typeName = typeOf (type).fullName () + typeName.substring (index); - } - - // If we got this far, a container exists, start over looking - // for the thing itself (this is the meat of the method): - type = searchOverrideNames (typeName); - if (type == null) - type = (SymtabEntry) symbolTable.get (typeName); // search global scope: - if (type == null) - type = searchGlobalInheritanceScope (typeName); - } - return type; - } // recursiveQualifiedEntry - - // A partially qualified name is of the form ::. - // First the scope is defined (meaning it is fully qualified); - // Then the name is searched for in the scope. - - /** - * - **/ - SymtabEntry partlyQualifiedEntry (String typeName, SymtabEntry container) - { - // This is the simple logic of this method: - // type = searchModuleScope (typeName.substring (0, typeName.lastIndexOf ('/')), container); - // type = qualifiedEntry (type.fullName () + typeName.substring (typeName.lastIndexOf ('/'))); - // But searchModuleScope only finds the first module that fits. - // The name might not be in that module but in one further out - // in the module scope. Should others be searched? - SymtabEntry type = null; - if (typeName != null) - { - int index = typeName.lastIndexOf ('/'); - - // Figure out if the container of this thing exists, converting any - // typedefs to interfaces if necessary: - type = recursivePQEntry (typeName.substring (0, index), container); - if (type instanceof TypedefEntry) - typeName = typeOf (type).fullName () + typeName.substring (index); - - // If we got this far, a container exists, start over looking - // for the thing itself. - - if (container != null) - type = searchModuleScope (typeName.substring (0, typeName.lastIndexOf ('/')), container); - if (type == null) - type = qualifiedEntry (typeName); - else - type = qualifiedEntry (type.fullName () + typeName.substring (typeName.lastIndexOf ('/'))); - } - return type; - } // partlyQualifiedEntry - - // partlyQualifiedEntry and recursivePQEntry are almost identical. - // They are different because when the recursive one is looking for - // the existence of containers, the error check for a module type - // must not occur (this check is done in qualifiedEntry). Only - // when the full partly qualified name is being processed must this - // check be performed. - - /** - * - **/ - SymtabEntry recursivePQEntry (String typeName, SymtabEntry container) - { - SymtabEntry type = null; - if (typeName != null) - { - int index = typeName.lastIndexOf ('/'); - if (index < 0) - type = searchModuleScope (typeName, container); - else - { - // Figure out if the container of this thing exists, converting any - // typedefs to interfaces if necessary: - type = recursivePQEntry (typeName.substring (0, index), container); - if (type == null) - return null; - else if (type instanceof TypedefEntry) - typeName = typeOf (type).fullName () + typeName.substring (index); - - // If we got this far, a container exists, start over, looking - // for the thing itself (This is the meat of the method): - if (container != null) - type = searchModuleScope (typeName.substring (0, typeName.lastIndexOf ('/')), container); - if (type == null) - recursiveQualifiedEntry (typeName); - else - type = recursiveQualifiedEntry (type.fullName () + typeName.substring (typeName.lastIndexOf ('/'))); - } - } - return type; - } // recursivePQEntry - - // The named type is searched for in the following order: - // 1. Local scope - // 2. Inheritance scope - // 3. OverrideNames - // 4. Module scope - - /** - * - **/ - SymtabEntry unqualifiedEntry (String typeName, SymtabEntry container) - { - SymtabEntry type = unqualifiedEntryWMod (typeName, container); - - // Relax this retriction in special cases, e.g., when - // parsing a ID pragma directive. - //if (type instanceof ModuleEntry) { - if (type instanceof ModuleEntry && !_isModuleLegalType) - { - // Module's are not valid types: - ParseException.moduleNotType (scanner, typeName); - type = null; - } - return type; - } // unqualifiedEntry - - /** - * - **/ - SymtabEntry unqualifiedEntryWMod (String typeName, SymtabEntry container) - { - SymtabEntry type = null; - if ((typeName != null) && !typeName.equals ("void")) - { - // Search local scope: - type = (SymtabEntry)symbolTable.get (container.fullName () + '/' + typeName); - if (type == null) - type = searchLocalInheritanceScope (typeName, container); - if (type == null) - type = searchOverrideNames (typeName); - if ((type == null) && (container != null)) - type = searchModuleScope (typeName, container); - if (type == null) - type = searchParentInheritanceScope (typeName, container); - } - if (type == null) - // Then it's not anywhere, report the error: - ParseException.undeclaredType (scanner, typeName); - return type; - } // unqualifiedEntryWMod - - /** - * Walks up the enclosing scopes until it finds an interface type. Then, - * searches up that interface inheritance tree for the type definition. - * - * @param name type name to be searched for. - * @param ptype parent type entry. - **/ - SymtabEntry searchParentInheritanceScope(String name, SymtabEntry ptype) { - - String cname = ptype.fullName(); - - while ((ptype != null) && !(cname.equals ("")) && - !(ptype instanceof InterfaceEntry)) { - int index = cname.lastIndexOf ('/'); - if (index < 0) { - cname = ""; - } else { - cname = cname.substring (0, index); - ptype = (SymtabEntry) symbolTable.get(cname); - } - } - - if ((ptype == null) || !(ptype instanceof InterfaceEntry)) { - return null; // could not find an enclosing interface type - give up. - } - - // check if the enclosing interface supports the type definition. - String fullName = ptype.fullName () + '/' + name; - SymtabEntry type = (SymtabEntry) symbolTable.get (fullName); - if (type != null) { - return type; // found type definition. - } - - // search up the interface inheritance tree. - return searchLocalInheritanceScope(name, ptype); - } - - /** - * - **/ - SymtabEntry searchGlobalInheritanceScope (String name) - { - // See if the container of this named object is an interface: - int index = name.lastIndexOf ('/'); - SymtabEntry entry = null; - if (index >= 0) - { - String containerName = name.substring (0, index); - entry = (SymtabEntry)symbolTable.get (containerName); - entry = (entry instanceof InterfaceEntry) - // It's an interface, now look in its inheritance scope: - ? searchLocalInheritanceScope (name.substring (index + 1), entry) - : null; - } - return entry; - } // searchGlobalInheritanceScope - - /** - * - **/ - SymtabEntry searchLocalInheritanceScope (String name, SymtabEntry container) - { - return (container instanceof InterfaceEntry) - ? searchDerivedFrom (name, (InterfaceEntry) container) - : null; - } // searchLocalInheritanceScope - - /** - * - **/ - SymtabEntry searchOverrideNames (String name) - { - String overrideName = (String)overrideNames.get (name); - return (overrideName != null) - ? (SymtabEntry)symbolTable.get (overrideName) - : null; - } // searchOverrideNames - - /** - * - **/ - SymtabEntry searchModuleScope (String name, SymtabEntry container) - { - String module = container.fullName (); - String fullName = module + '/' + name; - SymtabEntry type = (SymtabEntry)symbolTable.get (fullName); - while ((type == null) && !module.equals ("")) - { - int index = module.lastIndexOf ('/'); - if (index < 0) - module = ""; - else - { - module = module.substring (0, index); - fullName = module + '/' + name; - type = (SymtabEntry)symbolTable.get (fullName); - } - } - return (type == null) ? (SymtabEntry)symbolTable.get (name) : type; - } // searchModuleScope - - /** - * - **/ - SymtabEntry searchDerivedFrom (String name, InterfaceEntry i) - { - for (Enumeration e = i.derivedFrom ().elements (); e.hasMoreElements ();) - { - SymtabEntry tmp = (SymtabEntry)e.nextElement (); - if (tmp instanceof InterfaceEntry) - { - InterfaceEntry parent = (InterfaceEntry)tmp; - String fullName = parent.fullName () + '/' + name; - SymtabEntry type = (SymtabEntry)symbolTable.get (fullName); - if (type != null) - return type; - type = searchDerivedFrom (name, parent); - if (type != null) - return type; - } - // else it is a ForwardEntry and nothing can be done at this point. - } - return null; - } // searchDerivedFrom - - /** - * - **/ - String entryName (SymtabEntry entry) - { - if (entry instanceof AttributeEntry) - return "attribute"; - if (entry instanceof ConstEntry) - return "constant"; - if (entry instanceof EnumEntry) - return "enumeration"; - if (entry instanceof ExceptionEntry) - return "exception"; - if (entry instanceof ValueBoxEntry) - return "value box"; - if (entry instanceof ForwardValueEntry || entry instanceof ValueEntry) - return "value"; - if (entry instanceof ForwardEntry || entry instanceof InterfaceEntry) - return "interface"; - if (entry instanceof MethodEntry) - return "method"; - if (entry instanceof ModuleEntry) - return "module"; - if (entry instanceof ParameterEntry) - return "parameter"; - if (entry instanceof PrimitiveEntry) - return "primitive"; - if (entry instanceof SequenceEntry) - return "sequence"; - if (entry instanceof StringEntry) - return "string"; - if (entry instanceof StructEntry) - return "struct"; - if (entry instanceof TypedefEntry) - return "typedef"; - if (entry instanceof UnionEntry) - return "union"; - return "void"; - } // entryName - - /** - * - **/ - private boolean isInterface (SymtabEntry entry) - { - return entry instanceof InterfaceEntry || (entry instanceof ForwardEntry - && !(entry instanceof ForwardValueEntry)) ; - } - - private boolean isValue (SymtabEntry entry) - { - return entry instanceof ValueEntry ; // || entry instanceof ForwardValueEntry; - } - - private boolean isInterfaceOnly (SymtabEntry entry) - { - return entry instanceof InterfaceEntry ; - } - - private boolean isForward(SymtabEntry entry) - { - return entry instanceof ForwardEntry ; - } - - // list must be a vector of Strings. - /** - * - **/ - private boolean isntInStringList (Vector list, String name) - { - boolean isnt = true; - Enumeration e = list.elements (); - while (e.hasMoreElements ()) - if (name.equals ((String)e.nextElement ())) - { - ParseException.alreadyDeclared (scanner, name); - isnt = false; - break; - } - return isnt; - } // isntInStringList - - // list must be a vector of SymtabEntry's. - /** - * - **/ - private boolean isntInList (Vector list, String name) - { - boolean isnt = true; - for (Enumeration e = list.elements (); e.hasMoreElements ();) - if (name.equals (((SymtabEntry)e.nextElement ()).name ())) - { - ParseException.alreadyDeclared (scanner, name); - isnt = false; - break; - } - return isnt; - } // isntInList - - // list must be a vector of SymtabEntry's. - /** - * - **/ - private boolean isntInList (Vector list, SymtabEntry entry) - { - boolean isnt = true; - for (Enumeration e = list.elements (); e.hasMoreElements ();) - { - SymtabEntry eEntry = (SymtabEntry)e.nextElement (); - if (entry == eEntry) // && entry.fullName().equals (eEntry.fullName())) - { - ParseException.alreadyDeclared (scanner, entry.fullName ()); - isnt = false; - break; - } - } - return isnt; - } // isntInList - - /** - * - **/ - public static SymtabEntry typeOf (SymtabEntry entry) - { - while (entry instanceof TypedefEntry) - entry = entry.type (); - return entry; - } // typeOf - - /** - * - **/ - void forwardEntryCheck () - { - for (Enumeration e = symbolTable.elements (); e.hasMoreElements ();) - { - SymtabEntry entry = (SymtabEntry)e.nextElement (); - if (entry instanceof ForwardEntry) - ParseException.forwardEntry (scanner, entry.fullName ()); - } - } // forwardEntryCheck - - // <46082.03> Revert to "IDL:"-style (i.e., regular) repository ID. - /* - void updateRepositoryIds () { - for (Enumeration e = symbolTable.elements(); e.hasMoreElements();) { - SymtabEntry entry = (SymtabEntry) e.nextElement(); - if (entry instanceof ValueEntry) - ((ValueEntry) entry).calcRepId(); - } - } // updateRepositoryIds - */ - - //////////////////// - // Error Handling Methods - - // A syntax error occurred. Skip until a semicolon is encountered. - // Ignore semicolons within {...} blocks - /** - * - **/ - private void skipToSemicolon () throws IOException - { - while (!token.equals (Token.EOF) && !token.equals (Token.Semicolon)) - { - if (token.equals (Token.LeftBrace)) - skipToRightBrace(); - try - { - match (token.type); - } - catch (ParseException exception) - { - // The error has already been reported... - } - } - if (token.equals (Token.EOF)) - throw new EOFException (); - try - { - match (Token.Semicolon); - } - catch (Exception exception) - { - } - } // skipToSemicolon - - /** - * - **/ - private void skipToRightBrace () throws IOException - { - boolean firstTime = true; - while (!token.equals (Token.EOF) && !token.equals (Token.RightBrace)) - { - if (firstTime) - firstTime = false; - else if (token.equals (Token.LeftBrace)) - skipToRightBrace (); - try - { - match (token.type); - } - catch (ParseException exception) - { - // The error has already been reported... - } - } - if (token.equals (Token.EOF)) - throw new EOFException(); - } // skipToRightBrace - - // Error Handling Methods - //////////////////// - - // In CORBA 2.3, an IDL file provides a new scope for Repository IDs. - // The following methods provide a means for other classes in the framework - // to manage this scoping (see Preprocessor and Scanner). - - // public static int nPush = 0; - // public static int nPop = 0; - - /** - * - **/ - public static void enteringInclude () - { - repIDStack.push (new IDLID ()); - } // enteringInclude - - /** - * - **/ - public static void exitingInclude () - { - repIDStack.pop (); - } // exitingInclude - - - public static final String unknownNamePrefix = "uN__"; - - static Hashtable symbolTable; - Hashtable lcSymbolTable = new Hashtable (); - static Hashtable overrideNames; - Vector emitList = new Vector (); - boolean emitAll; - // - boolean cppModule; - // - boolean noWarn; - Scanner scanner; - // No longer necessary due to new valueElement() algorithm. - // Stack tokenStack = new Stack(); - Hashtable symbols; - Vector macros = new Vector (); - Vector paths; - - // Only needed for the pragma directive - SymtabEntry currentModule = null; - - // Static field necessary to allow Scanner access to enterind/exiting - // Include() methods. Must reset in Compile class, too! - // Stack repIDStack = new Stack (); - static Stack repIDStack = new Stack (); - - // Dynamic variable key used for forward type lists. - // A struct or union X entry may have this attached, - // which always contains a List. - // The elements are entries E such that E.type() == X. - // This list must be resolved in pigeonhole when the - // type is finally defined. This is similar to - // ForwardEntry.replaceForwardDecl. - private static int ftlKey = SymtabEntry.getVariableKey() ; - - int sequence = 0; - Vector includes; - Vector includeEntries; - - // Only needed in primaryExpr. Set in Preprocessor.booleanConstExpr. - boolean parsingConditionalExpr = false; - - Token token; - ModuleEntry topLevelModule; - private Preprocessor prep; - private boolean verbose; - SymtabFactory stFactory; - ExprFactory exprFactory; - private String[] keywords; - // Remove -stateful feature. - //private boolean parseStateful = false; - - // Circular buffer containing most recent tokens, including the current token. - private TokenBuffer tokenHistory = new TokenBuffer (); - protected float corbaLevel; // - private Arguments arguments; - -} // class Parser diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/PragmaEntry.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/PragmaEntry.java deleted file mode 100644 index f0f3aa2fca9..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/PragmaEntry.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -/** - * This is the symbol table entry for the #pragma statement. - **/ -public class PragmaEntry extends SymtabEntry -{ - protected PragmaEntry () - { - super (); - repositoryID (Util.emptyID); - } // ctor - - protected PragmaEntry (SymtabEntry that) - { - super (that, new IDLID ()); - module (that.name ()); - name (""); - } // ctor - - protected PragmaEntry (PragmaEntry that) - { - super (that); - } // ctor - - public Object clone () - { - return new PragmaEntry (this); - } // clone - - /** Invoke the Include type generator. - @param symbolTable the symbol table is a hash table whose key is - a fully qualified type name and whose value is a SymtabEntry or - a subclass of SymtabEntry. - @param stream the stream to which the generator should sent its output. - @see SymtabEntry */ - public void generate (Hashtable symbolTable, PrintWriter stream) - { - pragmaGen.generate (symbolTable, this, stream); - } // generate - - /** Access the Include type generator. - @return an object which implements the IncludeGen interface. - @see IncludeGen */ - public Generator generator () - { - return pragmaGen; - } // generator - - public String data () - { - return _data; - } // data - - public void data (String newData) - { - _data = newData; - } // data - - static PragmaGen pragmaGen; - - private String _data = null; -} // class PragmaEntry diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/PragmaGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/PragmaGen.java deleted file mode 100644 index 12c46f59a21..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/PragmaGen.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.*; - -public interface PragmaGen extends Generator -{ - void generate (Hashtable symbolTable, PragmaEntry entry, PrintWriter stream); -} // interface PragmaGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/PragmaHandler.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/PragmaHandler.java deleted file mode 100644 index 0af3af5e531..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/PragmaHandler.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: -// - Add openScope and closeScope. - -import java.io.IOException; - -public abstract class PragmaHandler -{ - public abstract boolean process (String pragma, String currentToken) throws IOException; - - void init (Preprocessor p) - { - preprocessor = p; - } // init - - // Utility methods. - - /** Get the current token. */ - protected String currentToken () - { - return preprocessor.currentToken (); - } // currentToken - - /** This method, given an entry name, returns the entry with that name. - It can take fully or partially qualified names and returns the - appropriate entry defined within the current scope. If no entry - exists, null is returned. */ - protected SymtabEntry getEntryForName (String string) - { - return preprocessor.getEntryForName (string); - } // getEntryForName - - /** This method returns a string of all of the characters from the input - file from the current position up to, but not including, the end-of-line - character(s). */ - protected String getStringToEOL () throws IOException - { - return preprocessor.getStringToEOL (); - } // getStringToEOL - - /** This method returns a string of all of the characters from the input - file from the current position up to, but not including, the given - character. It encapsulates parenthesis and quoted strings, meaning - it does not stop if the given character is found within parentheses - or quotes. For instance, given the input of `start(inside)end', - getUntil ('n') will return "start(inside)e" */ - protected String getUntil (char c) throws IOException - { - return preprocessor.getUntil (c); - } // getUntil - - /** This method returns the next token String from the input file. */ - protected String nextToken () throws IOException - { - return preprocessor.nextToken (); - } // nextToken - - /** This method assumes that the current token marks the beginning - of a scoped name. It then parses the subsequent identifier and - double colon tokens, builds the scoped name, and finds the symbol - table entry with that name. */ - protected SymtabEntry scopedName () throws IOException - { - return preprocessor.scopedName (); - } // scopedName - - /** Skip to the end of the line. */ - protected void skipToEOL () throws IOException - { - preprocessor.skipToEOL (); - } // skipToEOL - - /** This method skips the data in the input file until the specified - character is encountered, then it returns the next token. */ - protected String skipUntil (char c) throws IOException - { - return preprocessor.skipUntil (c); - } // skipUntil - - /** This method displays a Parser Exception complete with line number - and position information with the given message string. */ - protected void parseException (String message) - { - preprocessor.parseException (message); - } // parseException - - /** This method is called when the parser encounters a left curly brace. - An extender of PragmaHandler may find scope information useful. - For example, the prefix pragma takes effect as soon as it is - encountered and stays in effect until the current scope is closed. - If a similar pragma extension is desired, then the openScope and - closeScope methods are available for overriding. - @param entry the symbol table entry whose scope has just been opened. - Be aware that, since the scope has just been entered, this entry is - incomplete at this point. */ - protected void openScope (SymtabEntry entry) - { - } // openScope - - /** This method is called when the parser encounters a right curly brace. - An extender of PragmaHandler may find scope information useful. - For example, the prefix pragma takes effect as soon as it is - encountered and stays in effect until the current scope is closed. - If a similar pragma extension is desired, then the openScope and - closeScope methods are available for overriding. - @param entry the symbol table entry whose scope has just been closed. */ - protected void closeScope (SymtabEntry entry) - { - } // closeScope - - private Preprocessor preprocessor = null; -} // class PragmaHandler diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Preprocessor.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Preprocessor.java deleted file mode 100644 index a75b59efcf8..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Preprocessor.java +++ /dev/null @@ -1,1431 +0,0 @@ -/* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: -// -D57110 Allow ID pragma directive to be applied to modules and update -// feature in accordance to CORBA 2.3. -// -D59165 Enable escaped identifiers when processing pragmas. -// -f60858.1 Support -corba option, level = 2.2: Accept identifiers that -// collide with keywords, in letter but not case, and issue a warning. -// -d62023 support -noWarn option; suppress inappropriate warnings when -// parsing IBM-specific pragmas (#meta abstract). - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.math.BigInteger; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Stack; -import java.util.Vector; - -import com.sun.tools.corba.se.idl.RepositoryID; - -import com.sun.tools.corba.se.idl.constExpr.*; - -/** - * This class should be extended if new pragmas are desired. If the - * preprocessor encounters a pragma name which it doesn't recognize - * (anything other than ID, prefix, or version), it calls the method - * otherPragmas. This is the only method which need be overridden. - * The Preprocessor base class has a number of utility-like methods - * which can be used by the overridden otherPragmas method. - **/ -public class Preprocessor -{ - /** - * Public zero-argument constructor. - **/ - Preprocessor () - { - } // ctor - - /** - * - **/ - void init (Parser p) - { - parser = p; - symbols = p.symbols; - macros = p.macros; - } // init - - /** - * - **/ - protected Object clone () - { - return new Preprocessor (); - } // clone - - /** - * - **/ - Token process (Token t) throws IOException, ParseException - { - token = t; - scanner = parser.scanner; - // Deactivate escaped identifier processing in Scanner while - // preprocessing. - //scanner.underscoreOK = true; - scanner.escapedOK = false; - try - { - switch (token.type) - { - case Token.Include: - include (); - break; - case Token.If: - ifClause (); - break; - case Token.Ifdef: - ifdef (false); - break; - case Token.Ifndef: - ifdef (true); - break; - case Token.Else: - if (alreadyProcessedABranch.empty ()) - throw ParseException.elseNoIf (scanner); - else if (((Boolean)alreadyProcessedABranch.peek ()).booleanValue ()) - skipToEndif (); - else - { - alreadyProcessedABranch.pop (); - alreadyProcessedABranch.push (new Boolean (true)); - token = scanner.getToken (); - } - break; - case Token.Elif: - elif (); - break; - case Token.Endif: - if (alreadyProcessedABranch.empty ()) - throw ParseException.endNoIf (scanner); - else - { - alreadyProcessedABranch.pop (); - token = scanner.getToken (); - break; - } - case Token.Define: - define (); - break; - case Token.Undef: - undefine (); - break; - case Token.Pragma: - pragma (); - break; - case Token.Unknown: - if (!parser.noWarn) - ParseException.warning (scanner, Util.getMessage ("Preprocessor.unknown", token.name)); - case Token.Error: - case Token.Line: - case Token.Null: - // ignore - default: - scanner.skipLineComment (); - token = scanner.getToken (); - } - } - catch (IOException e) - { - // Underscore may now precede any identifier, so underscoreOK - // is vestigal. The Preprocessor must reset escapedOK so that Scanner - // will process escaped identifiers according to specification. - //scanner.underscoreOK = false; - scanner.escapedOK = true; - throw e; - } - catch (ParseException e) - { - // See above. - //scanner.underscoreOK = false; - scanner.escapedOK = true; - throw e; - } - // See above. - //scanner.underscoreOK = false; - scanner.escapedOK = true; - return token; - } // process - - /** - * - **/ - private void include () throws IOException, ParseException - { - match (Token.Include); - IncludeEntry include = parser.stFactory.includeEntry (parser.currentModule); - include.sourceFile (scanner.fileEntry ()); - scanner.fileEntry ().addInclude (include); - if (token.type == Token.StringLiteral) - include2 (include); - else if (token.type == Token.LessThan) - include3 (include); - else - { - int[] expected = {Token.StringLiteral, Token.LessThan}; - throw ParseException.syntaxError (scanner, expected, token.type); - } - if (parser.currentModule instanceof ModuleEntry) - ((ModuleEntry)parser.currentModule).addContained (include); - else if (parser.currentModule instanceof InterfaceEntry) - ((InterfaceEntry)parser.currentModule).addContained (include); - } // include - - /** - * - **/ - private void include2 (IncludeEntry include) throws IOException, ParseException - { - include.name ('"' + token.name + '"'); - include4 (include, token.name); - match (Token.StringLiteral); - } // include2 - - /** - * - **/ - private void include3 (IncludeEntry include) throws IOException, ParseException - { - if (token.type != Token.LessThan) - // match will throw an exception - match (Token.LessThan); - else - { - try - { - String includeFile = getUntil ('>'); - token = scanner.getToken (); - include.name ('<' + includeFile + '>'); - include4 (include, includeFile); - match (Token.GreaterThan); - } - catch (IOException e) - { - throw ParseException.syntaxError (scanner, ">", "EOF"); - } - } - } // include3 - - /** - * - **/ - private void include4 (IncludeEntry include, String filename) throws IOException, ParseException - { - try - { - // If the #include is at the global scope, it is treated as - // an import statement. If it is within some other scope, it - // is treated as a normal #include. - boolean includeIsImport = parser.currentModule == parser.topLevelModule; - //daz - include.absFilename (Util.getAbsolutePath (filename, parser.paths)); - scanner.scanIncludedFile (include, getFilename (filename), includeIsImport); - } - catch (IOException e) - { - ParseException.generic (scanner, e.toString ()); - } - } // include4 - - /** - * - **/ - private void define () throws IOException, ParseException - { - match (Token.Define); - if (token.equals (Token.Identifier)) - { - String symbol = scanner.getStringToEOL (); - symbols.put (token.name, symbol.trim ()); - match (Token.Identifier); - } - else if (token.equals (Token.MacroIdentifier)) - { - symbols.put (token.name, '(' + scanner.getStringToEOL () . trim ()); - macros.addElement (token.name); - match (Token.MacroIdentifier); - } - else - throw ParseException.syntaxError (scanner, Token.Identifier, token.type); - } // define - - /** - * - **/ - private void undefine () throws IOException, ParseException - { - match (Token.Undef); - if (token.equals (Token.Identifier)) - { - symbols.remove (token.name); - macros.removeElement (token.name); - match (Token.Identifier); - } - else - throw ParseException.syntaxError (scanner, Token.Identifier, token.type); - } // undefine - - /** - * - **/ - private void ifClause () throws IOException, ParseException - { - match (Token.If); - constExpr (); - } // ifClause - - /** - * - **/ - private void constExpr () throws IOException, ParseException - { - SymtabEntry dummyEntry = new SymtabEntry (parser.currentModule); - dummyEntry.container (parser.currentModule); - parser.parsingConditionalExpr = true; - Expression boolExpr = booleanConstExpr (dummyEntry); - parser.parsingConditionalExpr = false; - boolean expr; - if (boolExpr.value () instanceof Boolean) - expr = ((Boolean)boolExpr.value ()).booleanValue (); - else - expr = ((Number)boolExpr.value ()).longValue () != 0; - alreadyProcessedABranch.push (new Boolean (expr)); - if (!expr) - skipToEndiforElse (); - } // constExpr - - /** - * - **/ - Expression booleanConstExpr (SymtabEntry entry) throws IOException, ParseException - { - Expression expr = orExpr (null, entry); - try - { - expr.evaluate (); - } - catch (EvaluationException e) - { - ParseException.evaluationError (scanner, e.toString ()); - } - return expr; - } // booleanConstExpr - - /** - * - **/ - private Expression orExpr (Expression e, SymtabEntry entry) throws IOException, ParseException - { - if (e == null) - e = andExpr (null, entry); - else - { - BinaryExpr b = (BinaryExpr)e; - b.right (andExpr (null, entry)); - e.rep (e.rep () + b.right ().rep ()); - } - if (token.equals (Token.DoubleBar)) - { - match (token.type); - BooleanOr or = parser.exprFactory.booleanOr (e, null); - or.rep (e.rep () + " || "); - return orExpr (or, entry); - } - else - return e; - } // orExpr - - /** - * - **/ - private Expression andExpr (Expression e, SymtabEntry entry) throws IOException, ParseException - { - if (e == null) - e = notExpr (entry); - else - { - BinaryExpr b = (BinaryExpr)e; - b.right (notExpr (entry)); - e.rep (e.rep () + b.right ().rep ()); - } - if (token.equals (Token.DoubleAmpersand)) - { - match (token.type); - BooleanAnd and = parser.exprFactory.booleanAnd (e, null); - and.rep (e.rep () + " && "); - return andExpr (and, entry); - } - else - return e; - } // andExpr - - /** - * - **/ - private Expression notExpr (/*boolean alreadySawExclamation, */SymtabEntry entry) throws IOException, ParseException - { - Expression e; - if (token.equals (Token.Exclamation)) - { - match (Token.Exclamation); - e = parser.exprFactory.booleanNot (definedExpr (entry)); - e.rep ("!" + ((BooleanNot)e).operand ().rep ()); - } - else - e = definedExpr (entry); - return e; - } // notExpr - - /** - * - **/ - private Expression definedExpr (SymtabEntry entry) throws IOException, ParseException - { - if (token.equals (Token.Identifier) && token.name.equals ("defined")) - match (Token.Identifier); - return equalityExpr (null, entry); - } // definedExpr - - /** - * - **/ - private Expression equalityExpr (Expression e, SymtabEntry entry) throws IOException, ParseException - { - if (e == null) - { - parser.token = token; // Since parser to parse, give it this token - e = parser.constExp (entry); - token = parser.token; // Since parser last parsed, get its token - } - else - { - BinaryExpr b = (BinaryExpr)e; - parser.token = token; // Since parser to parse, give it this token - Expression constExpr = parser.constExp (entry); - token = parser.token; // Since parser last parsed, get its token - b.right (constExpr); - e.rep (e.rep () + b.right ().rep ()); - } - if (token.equals (Token.DoubleEqual)) - { - match (token.type); - Equal eq = parser.exprFactory.equal (e, null); - eq.rep (e.rep () + " == "); - return equalityExpr (eq, entry); - } - else if (token.equals (Token.NotEqual)) - { - match (token.type); - NotEqual n = parser.exprFactory.notEqual (e, null); - n.rep (e.rep () + " != "); - return equalityExpr (n, entry); - } - else if (token.equals (Token.GreaterThan)) - { - match (token.type); - GreaterThan g = parser.exprFactory.greaterThan (e, null); - g.rep (e.rep () + " > "); - return equalityExpr (g, entry); - } - else if (token.equals (Token.GreaterEqual)) - { - match (token.type); - GreaterEqual g = parser.exprFactory.greaterEqual (e, null); - g.rep (e.rep () + " >= "); - return equalityExpr (g, entry); - } - else if (token.equals (Token.LessThan)) - { - match (token.type); - LessThan l = parser.exprFactory.lessThan (e, null); - l.rep (e.rep () + " < "); - return equalityExpr (l, entry); - } - else if (token.equals (Token.LessEqual)) - { - match (token.type); - LessEqual l = parser.exprFactory.lessEqual (e, null); - l.rep (e.rep () + " <= "); - return equalityExpr (l, entry); - } - else - return e; - } // equalityExpr - - /** - * - **/ - Expression primaryExpr (SymtabEntry entry) throws IOException, ParseException - { - Expression primary = null; - switch (token.type) - { - case Token.Identifier: - // If an identifier gets this far, it means that no - // preprocessor variable was defined with that name. - // Generate a FALSE boolean expr. - //daz primary = parser.exprFactory.terminal ("0", new Long (0)); - primary = parser.exprFactory.terminal ("0", BigInteger.valueOf (0)); - token = scanner.getToken (); - break; - case Token.BooleanLiteral: - case Token.CharacterLiteral: - case Token.IntegerLiteral: - case Token.FloatingPointLiteral: - case Token.StringLiteral: - //daz primary = parser.literal (); - primary = parser.literal (entry); - token = parser.token; - break; - case Token.LeftParen: - match (Token.LeftParen); - primary = booleanConstExpr (entry); - match (Token.RightParen); - primary.rep ('(' + primary.rep () + ')'); - break; - default: - int[] expected = {Token.Literal, Token.LeftParen}; - throw ParseException.syntaxError (scanner, expected, token.type); - } - return primary; - } // primaryExpr - - /** - * - **/ - private void ifDefine (boolean inParens, boolean not) throws IOException, ParseException - { - if (token.equals (Token.Identifier)) - if ((not && symbols.containsKey (token.name)) || (!not && !symbols.containsKey (token.name))) - { - alreadyProcessedABranch.push (new Boolean (false)); - skipToEndiforElse (); - } - else - { - alreadyProcessedABranch.push (new Boolean (true)); - match (Token.Identifier); - if (inParens) - match (Token.RightParen); - } - else - throw ParseException.syntaxError (scanner, Token.Identifier, token.type); - } // ifDefine - - /** - * - **/ - private void ifdef (boolean not) throws IOException, ParseException - { - if (not) - match (Token.Ifndef); - else - match (Token.Ifdef); - if (token.equals (Token.Identifier)) - if ((not && symbols.containsKey (token.name)) || (!not && !symbols.containsKey (token.name))) - { - alreadyProcessedABranch.push (new Boolean (false)); - skipToEndiforElse (); - } - else - { - alreadyProcessedABranch.push (new Boolean (true)); - match (Token.Identifier); - } - else - throw ParseException.syntaxError (scanner, Token.Identifier, token.type); - } // ifdef - - /** - * - **/ - private void elif () throws IOException, ParseException - { - if (alreadyProcessedABranch.empty ()) - throw ParseException.elseNoIf (scanner); - else if (((Boolean)alreadyProcessedABranch.peek ()).booleanValue ()) - skipToEndif (); - else - { - match (Token.Elif); - constExpr (); - } - } // elif - - /** - * - **/ - private void skipToEndiforElse () throws IOException, ParseException - { - while (!token.equals (Token.Endif) && !token.equals (Token.Else) && !token.equals (Token.Elif)) - { - if (token.equals (Token.Ifdef) || token.equals (Token.Ifndef)) - { - alreadyProcessedABranch.push (new Boolean (true)); - skipToEndif (); - } - else - token = scanner.skipUntil ('#'); - } - process (token); - } // skipToEndiforElse - - /** - * - **/ - private void skipToEndif () throws IOException, ParseException - { - while (!token.equals (Token.Endif)) - { - token = scanner.skipUntil ('#'); - if (token.equals (Token.Ifdef) || token.equals (Token.Ifndef)) - { - alreadyProcessedABranch.push (new Boolean (true)); - skipToEndif (); - } - } - alreadyProcessedABranch.pop (); - match (Token.Endif); - } // skipToEndif - - /////////////// - // For Pragma - - /** - * - **/ - private void pragma () throws IOException, ParseException - { - match (Token.Pragma); - String pragmaType = token.name; - - // Enable escaped identifiers while processing pragma internals. - // Don't enable until scanning pragma name! - scanner.escapedOK = true; - match (Token.Identifier); - - // Add pragma entry to container - PragmaEntry pragmaEntry = parser.stFactory.pragmaEntry (parser.currentModule); - pragmaEntry.name (pragmaType); - pragmaEntry.sourceFile (scanner.fileEntry ()); - pragmaEntry.data (scanner.currentLine ()); - if (parser.currentModule instanceof ModuleEntry) - ((ModuleEntry)parser.currentModule).addContained (pragmaEntry); - else if (parser.currentModule instanceof InterfaceEntry) - ((InterfaceEntry)parser.currentModule).addContained (pragmaEntry); - - // If the token was an identifier, then pragmaType WILL be non-null. - if (pragmaType.equals ("ID")) - idPragma (); - else if (pragmaType.equals ("prefix")) - prefixPragma (); - else if (pragmaType.equals ("version")) - versionPragma (); - - // we are adding extensions to the Sun's idlj compiler to - // handle correct code generation for local Objects, where - // the OMG is taking a long time to formalize stuff. Good - // example of this is poa.idl. Two proprietory pragmas - // sun_local and sun_localservant are defined. sun_local - // generates only Holder and Helper classes, where read - // and write methods throw marshal exceptions. sun_localservant - // is to generate Helper, Holder, and only Skel with _invoke - // throwing an exception, since it does not make sense for - // local objects. - - else if (pragmaType.equals ("sun_local")) - localPragma(); - else if (pragmaType.equals ("sun_localservant")) - localServantPragma(); - else - { - otherPragmas (pragmaType, tokenToString ()); - token = scanner.getToken (); - } - - scanner.escapedOK = false; // Disable escaped identifiers. - } // pragma - - // Pragma ID can be appiled to modules and it is an error to - // name a type in more than one ID pragma directive. - - private Vector PragmaIDs = new Vector (); - - private void localPragma () throws IOException, ParseException - { - // Before I can use a parser method, I must make sure it has the current token. - parser.token = token; - // this makes sense only for interfaces, if specified for modules, - // parser should throw an error - SymtabEntry anErrorOccurred = new SymtabEntry (); - SymtabEntry entry = parser.scopedName (parser.currentModule, anErrorOccurred); - // Was the indicated type found in the symbol table? - if (entry == anErrorOccurred) - { - System.out.println("Error occured "); - // Don't have to generate an error, scopedName already has. - scanner.skipLineComment (); - token = scanner.getToken (); - } - else - { - // by this time we have already parsed the ModuleName and the - // pragma type, therefore setInterfaceType - if (entry instanceof InterfaceEntry) { - InterfaceEntry ent = (InterfaceEntry) entry; - ent.setInterfaceType (InterfaceEntry.LOCAL_SIGNATURE_ONLY); - } - token = parser.token; - String string = token.name; - match (Token.StringLiteral); - // for non-interfaces it doesn't make sense, so just ignore it - } - } // localPragma - - private void localServantPragma () throws IOException, ParseException - { - // Before I can use a parser method, I must make sure it has the current token. - parser.token = token; - // this makes sense only for interfaces, if specified for modules, - // parser should throw an error - SymtabEntry anErrorOccurred = new SymtabEntry (); - SymtabEntry entry = parser.scopedName (parser.currentModule, anErrorOccurred); - - // Was the indicated type found in the symbol table? - if (entry == anErrorOccurred) - { - // Don't have to generate an error, scopedName already has. - scanner.skipLineComment (); - token = scanner.getToken (); - System.out.println("Error occured "); - } - else - { - // by this time we have already parsed the ModuleName and the - // pragma type, therefore setInterfaceType - if (entry instanceof InterfaceEntry) { - InterfaceEntry ent = (InterfaceEntry) entry; - ent.setInterfaceType (InterfaceEntry.LOCALSERVANT); - } - token = parser.token; - String string = token.name; - match (Token.StringLiteral); - // for non-interfaces it doesn't make sense, so just ignore it - } - } // localServantPragma - - - /** - * - **/ - private void idPragma () throws IOException, ParseException - { - // Before I can use a parser method, I must make sure it has the current token. - parser.token = token; - - // This flag will relax the restriction that the scopedNamed - // in this ID pragma directive cannot resolve to a module. - parser.isModuleLegalType (true); - SymtabEntry anErrorOccurred = new SymtabEntry (); - SymtabEntry entry = parser.scopedName (parser.currentModule, anErrorOccurred); - parser.isModuleLegalType (false); // <57110> - - // Was the indicated type found in the symbol table? - if (entry == anErrorOccurred) - { - // Don't have to generate an error, scopedName already has. - scanner.skipLineComment (); - token = scanner.getToken (); - } - // - //else if (PragmaIDs.contains (entry)) - //{ - // ParseException.badRepIDAlreadyAssigned (scanner, entry.name ()); - // scanner.skipLineComment (); - // token = scanner.getToken (); - //} - else - { - token = parser.token; - String string = token.name; - // Do not match token until after raise exceptions, otherwise - // incorrect messages will be emitted! - if (PragmaIDs.contains (entry)) // - { - ParseException.badRepIDAlreadyAssigned (scanner, entry.name ()); - } - else if (!RepositoryID.hasValidForm (string)) // - { - ParseException.badRepIDForm (scanner, string); - } - else - { - entry.repositoryID (new RepositoryID (string)); - PragmaIDs.addElement (entry); // - } - match (Token.StringLiteral); - } - } // idPragma - - /** - * - **/ - private void prefixPragma () throws IOException, ParseException - { - String string = token.name; - match (Token.StringLiteral); - ((IDLID)parser.repIDStack.peek ()).prefix (string); - ((IDLID)parser.repIDStack.peek ()).name (""); - } // prefixPragma - - /** - * - **/ - private void versionPragma () throws IOException, ParseException - { - // Before I can use a parser method, I must make sure it has the current token. - parser.token = token; - // This flag will relax the restriction that the scopedNamed - // in this Version pragma directive cannot resolve to a module. - parser.isModuleLegalType (true); - SymtabEntry anErrorOccurred = new SymtabEntry (); - SymtabEntry entry = parser.scopedName (parser.currentModule, anErrorOccurred); - // reset the flag to original value - parser.isModuleLegalType (false); - if (entry == anErrorOccurred) - { - // Don't have to generate an error, scopedName already has. - scanner.skipLineComment (); - token = scanner.getToken (); - } - else - { - token = parser.token; - String string = token.name; - match (Token.FloatingPointLiteral); - if (entry.repositoryID () instanceof IDLID) - ((IDLID)entry.repositoryID ()).version (string); - } - } // versionPragma - - private Vector pragmaHandlers = new Vector (); - - /** - * - **/ - void registerPragma (PragmaHandler handler) - { - pragmaHandlers.addElement (handler); - } // registerPragma - - /** - * - **/ - private void otherPragmas (String pragmaType, String currentToken) throws IOException - { - for (int i = pragmaHandlers.size () - 1; i >= 0; --i) - { - PragmaHandler handler = (PragmaHandler)pragmaHandlers.elementAt (i); - if (handler.process (pragmaType, currentToken)) - break; - } - } // otherPragmas - - /* - * These protected methods are used by extenders, by the code - * which implements otherPragma. - */ - - /** - * Get the current token. - **/ - String currentToken () - { - return tokenToString (); - } // currentToken - - /** - * This method, given an entry name, returns the entry with that name. - * It can take fully or partially qualified names and returns the - * appropriate entry defined within the current scope. If no entry - * exists, null is returned. - **/ - SymtabEntry getEntryForName (String string) - { - boolean partialScope = false; - boolean globalScope = false; - - // Change all ::'s to /'s - if (string.startsWith ("::")) - { - globalScope = true; - string = string.substring (2); - } - int index = string.indexOf ("::"); - while (index >= 0) - { - partialScope = true; - string = string.substring (0, index) + '/' + string.substring (index + 2); - index = string.indexOf ("::"); - } - - // Get the entry for that string - SymtabEntry entry = null; - if (globalScope) - entry = parser.recursiveQualifiedEntry (string); - else if (partialScope) - entry = parser.recursivePQEntry (string, parser.currentModule); - else - entry = parser.unqualifiedEntryWMod (string, parser.currentModule); - return entry; - } // getEntryForName - - /** - * This method returns a string of all of the characters from the - * input file from the current position up to, but not including, - * the end-of-line character(s). - **/ - String getStringToEOL () throws IOException - { - return scanner.getStringToEOL (); - } // getStringToEOL - - /** - * This method returns a string of all of the characters from the - * input file from the current position up to, but not including, - * the given character. It encapsulates parenthesis and quoted strings, - * meaning it does not stop if the given character is found within - * parentheses or quotes. For instance, given the input of - * `start(inside)end', getUntil ('n') will return "start(inside)e" - **/ - String getUntil (char c) throws IOException - { - return scanner.getUntil (c); - } // getUntil - - private boolean lastWasMacroID = false; - - /** - * - **/ - private String tokenToString () - { - if (token.equals (Token.MacroIdentifier)) - { - lastWasMacroID = true; - return token.name; - } - else if (token.equals (Token.Identifier)) - return token.name; - else - return token.toString (); - } // tokenToString - - /** - * This method returns the next token String from the input file. - **/ - String nextToken () throws IOException - { - if (lastWasMacroID) - { - lastWasMacroID = false; - return "("; - } - else - { - token = scanner.getToken (); - return tokenToString (); - } - } // nextToken - - /** - * This method assumes that the current token marks the beginning - * of a scoped name. It then parses the subsequent identifier and - * double colon tokens, builds the scoped name, and finds the symbol - * table entry with that name. - **/ - SymtabEntry scopedName () throws IOException - { - boolean globalScope = false; - boolean partialScope = false; - String name = null; - SymtabEntry entry = null; - try - { - if (token.equals (Token.DoubleColon)) - globalScope = true; - else - { - if (token.equals (Token.Object)) - { - name = "Object"; - match (Token.Object); - } - else if (token.type == Token.ValueBase) - { - name = "ValueBase"; - match (Token.ValueBase); - } - else - { - name = token.name; - match (Token.Identifier); - } - } - while (token.equals (Token.DoubleColon)) - { - match (Token.DoubleColon); - partialScope = true; - if (name != null) - name = name + '/' + token.name; - else - name = token.name; - match (Token.Identifier); - } - if (globalScope) - entry = parser.recursiveQualifiedEntry (name); - else if (partialScope) - entry = parser.recursivePQEntry (name, parser.currentModule); - else - entry = parser.unqualifiedEntryWMod (name, parser.currentModule); - } - catch (ParseException e) - { - entry = null; - } - return entry; - } // scopedName - - /** - * Skip to the end of the line. - **/ - void skipToEOL () throws IOException - { - scanner.skipLineComment (); - } // skipToEOL - - /** - * This method skips the data in the input file until the specified - * character is encountered, then it returns the next token. - **/ - String skipUntil (char c) throws IOException - { - if (!(lastWasMacroID && c == '(')) - token = scanner.skipUntil (c); - return tokenToString (); - } // skipUntil - - /** - * This method displays a Parser Exception complete with line number - * and position information with the given message string. - **/ - void parseException (String message) - { - // Suppress warnings - if (!parser.noWarn) - ParseException.warning (scanner, message); - } // parseException - - // For Pragma - /////////////// - // For macro expansion - - /** - * - **/ - String expandMacro (String macroDef, Token t) throws IOException, ParseException - { - token = t; - // Get the parameter values from the macro 'call' - Vector parmValues = getParmValues (); - - // Get the parameter names from the macro definition - // NOTE: a newline character is appended here so that when - // getStringToEOL is called, it stops scanning at the end - // of this string. - scanner.scanString (macroDef + '\n'); - Vector parmNames = new Vector (); - macro (parmNames); - - if (parmValues.size () < parmNames.size ()) - throw ParseException.syntaxError (scanner, Token.Comma, Token.RightParen); - else if (parmValues.size () > parmNames.size ()) - throw ParseException.syntaxError (scanner, Token.RightParen, Token.Comma); - - macroDef = scanner.getStringToEOL (); - for (int i = 0; i < parmNames.size (); ++i) - macroDef = replaceAll (macroDef, (String)parmNames.elementAt (i), (String)parmValues.elementAt (i)); - return removeDoublePound (macroDef); - } // expandMacro - - // This method is only used by the macro expansion methods. - /** - * - **/ - private void miniMatch (int type) throws ParseException - { - // A normal production would now execute: - // match (type); - // But match reads the next token. I don't want to do that now. - // Just make sure the current token is a 'type'. - if (!token.equals (type)) - throw ParseException.syntaxError (scanner, type, token.type); - } // miniMatch - - /** - * - **/ - private Vector getParmValues () throws IOException, ParseException - { - Vector values = new Vector (); - if (token.equals (Token.Identifier)) - { - match (Token.Identifier); - miniMatch (Token.LeftParen); - } - else if (!token.equals (Token.MacroIdentifier)) - throw ParseException.syntaxError (scanner, Token.Identifier, token.type); - - if (!token.equals (Token.RightParen)) - { - values.addElement (scanner.getUntil (',', ')').trim ()); - token = scanner.getToken (); - macroParmValues (values); - } - return values; - } // getParmValues - - /** - * - **/ - private void macroParmValues (Vector values) throws IOException, ParseException - { - while (!token.equals (Token.RightParen)) - { - miniMatch (Token.Comma); - values.addElement (scanner.getUntil (',', ')').trim ()); - token = scanner.getToken (); - } - } // macroParmValues - - /** - * - **/ - private void macro (Vector parmNames) throws IOException, ParseException - { - match (token.type); - match (Token.LeftParen); - macroParms (parmNames); - miniMatch (Token.RightParen); - } // macro - - /** - * - **/ - private void macroParms (Vector parmNames) throws IOException, ParseException - { - if (!token.equals (Token.RightParen)) - { - parmNames.addElement (token.name); - match (Token.Identifier); - macroParms2 (parmNames); - } - } // macroParms - - /** - * - **/ - private void macroParms2 (Vector parmNames) throws IOException, ParseException - { - while (!token.equals (Token.RightParen)) - { - match (Token.Comma); - parmNames.addElement (token.name); - match (Token.Identifier); - } - } // macroParms2 - - /** - * - **/ - private String replaceAll (String string, String from, String to) - { - int index = 0; - while (index != -1) - { - index = string.indexOf (from, index); - if (index != -1) - { - if (!embedded (string, index, index + from.length ())) - if (index > 0 && string.charAt(index) == '#') - string = string.substring (0, index) + '"' + to + '"' + string.substring (index + from.length ()); - else - string = string.substring (0, index) + to + string.substring (index + from.length ()); - index += to.length (); - } - } - return string; - } // replaceAll - - /** - * - **/ - private boolean embedded (String string, int index, int endIndex) - { - // Don't replace if found substring is not an independent id. - // For example, don't replace "thither".indexOf ("it", 0) - boolean ret = false; - char preCh = index == 0 ? ' ' : string.charAt (index - 1); - char postCh = endIndex >= string.length () - 1 ? ' ' : string.charAt (endIndex); - if ((preCh >= 'a' && preCh <= 'z') || (preCh >= 'A' && preCh <= 'Z')) - ret = true; - else if ((postCh >= 'a' && postCh <= 'z') || (postCh >= 'A' && postCh <= 'Z') || (postCh >= '0' && postCh <= '9') || postCh == '_') - ret = true; - else - ret = inQuotes (string, index); - return ret; - } // embedded - - /** - * - **/ - private boolean inQuotes (String string, int index) - { - int quoteCount = 0; - for (int i = 0; i < index; ++i) - if (string.charAt (i) == '"') ++quoteCount; - // If there are an odd number of quotes before this region, - // then this region is within quotes - return quoteCount % 2 != 0; - } // inQuotes - - /** - * Remove any occurrences of ##. - **/ - private String removeDoublePound (String string) - { - int index = 0; - while (index != -1) - { - index = string.indexOf ("##", index); - if (index != -1) - { - int startSkip = index - 1; - int stopSkip = index + 2; - if (startSkip < 0) - startSkip = 0; - if (stopSkip >= string.length ()) - stopSkip = string.length () - 1; - while (startSkip > 0 && - (string.charAt (startSkip) == ' ' || - string.charAt (startSkip) == '\t')) - --startSkip; - while (stopSkip < string.length () - 1 && - (string.charAt (stopSkip) == ' ' || - string.charAt (stopSkip) == '\t')) - ++stopSkip; - string = string.substring (0, startSkip + 1) + string.substring (stopSkip); - } - } - return string; - } // removeDoublePound - - // For macro expansion - /////////////// - - /** - * - **/ - private String getFilename (String name) throws FileNotFoundException - { - String fullName = null; - File file = new File (name); - if (file.canRead ()) - fullName = name; - else - { - Enumeration pathList = parser.paths.elements (); - while (!file.canRead () && pathList.hasMoreElements ()) - { - fullName = (String)pathList.nextElement () + File.separatorChar + name; - file = new File (fullName); - } - if (!file.canRead ()) - throw new FileNotFoundException (name); - } - return fullName; - } // getFilename - - /** - * - **/ - private void match (int type) throws IOException, ParseException - { - if (!token.equals (type)) - throw ParseException.syntaxError (scanner, type, token.type); - token = scanner.getToken (); - - // Added for convenience, but commented-out because there is - // no reason to issue warnings for tokens scanned during preprocessing. - // See issueTokenWarnings(). - //issueTokenWarnings (); - - //System.out.println ("Preprocessor.match token = " + token.type); - //if (token.equals (Token.Identifier) || token.equals (Token.MacroIdentifier)) - // System.out.println ("Preprocessor.match token name = " + token.name); - - // If the token is a defined thingy, scan the defined string - // instead of the input stream for a while. - if (token.equals (Token.Identifier) || token.equals (Token.MacroIdentifier)) - { - String string = (String)symbols.get (token.name); - if (string != null && !string.equals ("")) - // If this is a macro, parse the macro - if (macros.contains (token.name)) - { - scanner.scanString (expandMacro (string, token)); - token = scanner.getToken (); - } - // else this is just a normal define - else - { - scanner.scanString (string); - token = scanner.getToken (); - } - } - } // match - - // - /** - * Issue warnings about tokens scanned during preprocessing. - **/ - private void issueTokenWarnings () - { - if (parser.noWarn) - return; - - // There are no keywords defined for preprocessing (only directives), so: - // - // 1.) Do not issue warnings for identifiers known to be keywords in - // another level of IDL. - // 2.) Do not issue warnings for identifiers that collide with keywords - // in letter, but not case. - // 3.) Do not issue warnings for deprecated keywords. - // - // Should we warn when a macro identifier replaces a keyword? Hmmm. - - // Deprecated directives? None to date. - //if (token.isDirective () && token.isDeprecated ()) - // ParseException.warning (scanner, Util.getMesage ("Deprecated.directive", token.name)); - } // issueTokenWarnings - - /** - * This method is called when the parser encounters a left curly brace. - * An extender of PragmaHandler may find scope information useful. - * For example, the prefix pragma takes effect as soon as it is - * encountered and stays in effect until the current scope is closed. - * If a similar pragma extension is desired, then the openScope and - * closeScope methods are available for overriding. - * @param entry the symbol table entry whose scope has just been opened. - * Be aware that, since the scope has just been entered, this entry is - * incomplete at this point. - **/ - void openScope (SymtabEntry entry) - { - for (int i = pragmaHandlers.size () - 1; i >= 0; --i) - { - PragmaHandler handler = (PragmaHandler)pragmaHandlers.elementAt (i); - handler.openScope (entry); - } - } // openScope - - /** - * This method is called when the parser encounters a right curly brace. - * An extender of PragmaHandler may find scope information useful. - * For example, the prefix pragma takes effect as soon as it is - * encountered and stays in effect until the current scope is closed. - * If a similar pragma extension is desired, then the openScope and - * closeScope methods are available for overriding. - * @param entry the symbol table entry whose scope has just been closed. - **/ - void closeScope (SymtabEntry entry) - { - for (int i = pragmaHandlers.size () - 1; i >= 0; --i) - { - PragmaHandler handler = (PragmaHandler)pragmaHandlers.elementAt (i); - handler.closeScope (entry); - } - } // closeScope - - private Parser parser; - private Scanner scanner; - private Hashtable symbols; - private Vector macros; - - // The logic associated with this stack is scattered above. - // A concise map of the logic is: - // case #if false, #ifdef false, #ifndef true - // push (false); - // skipToEndifOrElse (); - // case #if true, #ifdef true, #ifndef false - // push (true); - // case #elif - // if (top == true) - // skipToEndif (); - // else if (conditional == true) - // pop (); - // push (true); - // else if (conditional == false) - // skipToEndifOrElse (); - // case #else - // if (top == true) - // skipToEndif (); - // else - // pop (); - // push (true); - // case #endif - // pop (); - private Stack alreadyProcessedABranch = new Stack (); - Token token; - - private static String indent = ""; -} diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/PrimitiveEntry.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/PrimitiveEntry.java deleted file mode 100644 index 0bbaadc5910..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/PrimitiveEntry.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -/** - * This is the symbol table entry for primitive types: octet, char, - * short, long, long long (and unsigned versions), float, double, string. - **/ -public class PrimitiveEntry extends SymtabEntry -{ - protected PrimitiveEntry () - { - super (); - repositoryID (Util.emptyID); - } // ctor - - protected PrimitiveEntry (String name) - { - name (name); - module (""); - repositoryID (Util.emptyID); - } // ctor - - protected PrimitiveEntry (PrimitiveEntry that) - { - super (that); - } // ctor - - public Object clone () - { - return new PrimitiveEntry (this); - } // clone - - /** Invoke the primitive type generator. - @param symbolTable the symbol table is a hash table whose key is - a fully qualified type name and whose value is a SymtabEntry or - a subclass of SymtabEntry. - @param stream the stream to which the generator should sent its output. - @see SymtabEntry */ - public void generate (Hashtable symbolTable, PrintWriter stream) - { - primitiveGen.generate (symbolTable, this, stream); - } // generate - - /** Access the primitive type generator. - @return an object which implements the PrimitiveGen interface. - @see PrimitiveGen */ - public Generator generator () - { - return primitiveGen; - } // generator - - static PrimitiveGen primitiveGen; -} // class PrimitiveEntry diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/PrimitiveGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/PrimitiveGen.java deleted file mode 100644 index 601cddc8b8e..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/PrimitiveGen.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.*; - -public interface PrimitiveGen extends Generator -{ - void generate (Hashtable symbolTable, PrimitiveEntry entry, PrintWriter stream); -} // interface PrimitiveGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/RepositoryID.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/RepositoryID.java deleted file mode 100644 index 7282ab02c1a..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/RepositoryID.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: -// -D57110 Add method to verify format (CORBA 2.3). - -public class RepositoryID -{ - public RepositoryID () - { - _id = ""; - } // ctor - - public RepositoryID (String id) - { - _id = id; - } // ctor - - public String ID () - { - return _id; - } // ID - - public Object clone () - { - return new RepositoryID (_id); - } // clone - - public String toString () - { - return ID (); - } // toString - - /** - * Determine is a supplied string meets the minimal format requirement - * for a Repository ID. - * @return true if supplied string has form {@code ':'}, where - * {@code } is any non-empty string not containing ':'. - **/ - public static boolean hasValidForm (String string) - { - return string != null && string.indexOf (':') > 0; - } // hasValidForm - - private String _id; -} // class RepositoryID diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ResourceBundleUtil.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ResourceBundleUtil.java deleted file mode 100644 index 9a39cbfc290..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ResourceBundleUtil.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: -// -capitalize and parseTypeModifier should probably be in the -// generators package. -// -D58319 Add version() method. - -import java.util.ResourceBundle; -import java.text.MessageFormat; -import java.util.Hashtable; - -public class ResourceBundleUtil -{ - // - /** - * Fetch the version number of this build of the IDL Parser Framework. - * This method may be called before or after the framework has been - * initialized. If the framework is inititialized, the version information - * is extracted from the message properties object; otherwise, it is extracted - * from the indicated resouce bundle. - * @return the version number. - **/ - public static String getVersion () - { - String version = getMessage ("Version.product", getMessage ("Version.number")); - return version; - } // getVersion - - - ////////////// - // Message-related methods - - public static String getMessage (String key) - { - return fBundle.getString(key); - } // getMessage - - public static String getMessage (String key, String fill) - { - Object[] args = { fill }; - return MessageFormat.format(fBundle.getString(key), args); - } // getMessage - - public static String getMessage (String key, String[] fill) - { - return MessageFormat.format(fBundle.getString(key), fill); - } // getMessage - - - /** Register a ResourceBundle. This file will be searched for - in the CLASSPATH. */ - public static void registerResourceBundle (ResourceBundle bundle) - { - if (bundle != null) - fBundle = bundle; - } // registerResourceBundle - - - /** Gets the current ResourceBundle. */ - public static ResourceBundle getResourceBundle () - { - return fBundle; - } // getResourceBundle - - private static ResourceBundle fBundle; - static - { - // get the resource bundle for the locale on this machine - fBundle = ResourceBundle.getBundle("com.sun.tools.corba.se.idl.idl"); - } - -} // class ResourceBundleUtil diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Scanner.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Scanner.java deleted file mode 100644 index e1e23e1e3f1..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Scanner.java +++ /dev/null @@ -1,1615 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: -// -F46082.51 Remove -stateful feature. -// -D56351 Update computation of RepositoryIDs to CORBA 2.3 (see spec.). -// -D59166 Add escaped-id. info. to identifiers. -// -F60858.1 Add support for -corba option, levels 2.2 and 2.3: accept 2.3 -// keywords as ids.; accept ids. that match keywords in letter, but not in case. -// -D62023 Add support for -corba option, level 2.4: see keyword checking. - -import java.io.EOFException; -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.PushbackInputStream; - -import java.util.Enumeration; -import java.util.Stack; -import java.util.StringTokenizer; -import java.util.Vector; - -/** - * - **/ -class Scanner -{ - // -Remove stateful feature. - //Scanner (IncludeEntry file, String[] keywords, boolean vbose, boolean scanStateful, boolean emitAllIncludes) throws IOException - // - //Scanner (IncludeEntry file, String[] keywords, boolean vbose, boolean emitAllIncludes) throws IOException - /** - * - **/ - Scanner (IncludeEntry file, String[] keywords, boolean vbose, - boolean emitAllIncludes, float cLevel, boolean debug) throws IOException - { - readFile (file); - verbose = vbose; - // - //stateful = scanStateful; - emitAll = emitAllIncludes; - sortKeywords (keywords); - corbaLevel = cLevel; - this.debug = debug ; - } // ctor - - /** - * - **/ - void sortKeywords (String[] keywords) - { - for (int i = 0; i < keywords.length; ++i) - if (wildcardAtEitherEnd (keywords[i])) - this.openEndedKeywords.addElement (keywords[i]); - else if (wildcardsInside (keywords[i])) - this.wildcardKeywords.addElement (keywords[i]); - else - this.keywords.addElement (keywords[i]); - } // sortKeywords - - /** - * - **/ - private boolean wildcardAtEitherEnd (String string) - { - return string.startsWith ("*") || - string.startsWith ("+") || - string.startsWith (".") || - string.endsWith ("*") || - string.endsWith ("+") || - string.endsWith ("."); - } // wildcardAtEitherEnd - - /** - * - **/ - private boolean wildcardsInside (String string) - { - return string.indexOf ("*") > 0 || - string.indexOf ("+") > 0 || - string.indexOf (".") > 0; - } // wildcardsInside - - /** - * - **/ - void readFile (IncludeEntry file) throws IOException - { - String filename = file.name (); - filename = filename.substring (1, filename.length () - 1); - readFile (file, filename); - } // readFile - - /** - * - **/ - void readFile (IncludeEntry file, String filename) throws IOException - { - data.fileEntry = file; - data.filename = filename; - // - //FileInputStream stream = new FileInputStream (data.filename); - //data.fileBytes = new byte [stream.available ()]; - //stream.read (data.fileBytes); - //stream.close (); - File idlFile = new File (data.filename); - int len = (int)idlFile.length (); - FileReader fileReader = new FileReader (idlFile); - // data.fileBytes = new char [len]; - final String EOL = System.getProperty ("line.separator"); - data.fileBytes = new char [len + EOL.length ()]; - - fileReader.read (data.fileBytes, 0, len); - fileReader.close (); - - // - for (int i = 0; i < EOL.length (); i++) - data.fileBytes[len + i] = EOL.charAt (i); - - readChar (); - } // readFile - - /** - * - **/ - Token getToken () throws IOException - { - //System.out.println ("Scanner.getToken char = |" + data.ch + "| (ASCII " + (int)data.ch + ")."); - - // The token could be null if the next set of characters - // is not a token: white space, comments, ignored preprocessor - // commands. - Token token = null; - String commentText = new String (""); - - while (token == null) - try - { - data.oldIndex = data.fileIndex; - data.oldLine = data.line; - if (data.ch <= ' ') { - skipWhiteSpace (); - continue; - } - - // Special case for wchar and wstring literals. - // The values are preceded by an L. - // - // Bug fix 4382578: Can't compile a wchar literal. - // - // REVISIT. This maps wchar/wstring literals to - // our char/string literal types. Eventually, we - // need to write stronger checking to be spec - // compliant in negative cases such as leaving the - // L off of a wide string or putting it on a string. - if (data.ch == 'L') { - // Check to see if the next character is an - // apostrophe. - readChar(); - // Note: This doesn't allow for space between - // the L and the apostrophe or quote. - if (data.ch == '\'') { - // It was a wchar literal. Get the value - // and return the token. - token = getCharacterToken(true); - readChar(); - continue; - } else - if (data.ch == '"') { - // It was a wstring literal. - // - // getUntil assumes we've already passed the - // first quote. - readChar (); - token = new Token (Token.StringLiteral, getUntil ('"'), true); - readChar (); - continue; - } else { - // It must not have been a wchar literal. - // Push the input back into the buffer, and - // fall to the next if case. - unread(data.ch); - unread('L'); - readChar(); - } - } - - if ((data.ch >= 'a' && data.ch <= 'z') || - (data.ch >= 'A' && data.ch <= 'Z') || - // Escaped identifier; see data member comments. - //(data.ch == '_' && underscoreOK) || - (data.ch == '_') || - Character.isLetter (data.ch)) { - token = getString (); - } else - if ((data.ch >= '0' && data.ch <= '9') || data.ch == '.') { - token = getNumber (); - } else { - switch (data.ch) - { - case ';': - token = new Token (Token.Semicolon); - break; - case '{': - token = new Token (Token.LeftBrace); - break; - case '}': - token = new Token (Token.RightBrace); - break; - case ':': - readChar (); - if (data.ch == ':') - token = new Token (Token.DoubleColon); - else - { - unread (data.ch); - token = new Token (Token.Colon); - } - break; - case ',': - token = new Token (Token.Comma); - break; - case '=': - readChar (); - if (data.ch == '=') - token = new Token (Token.DoubleEqual); - else - { - unread (data.ch); - token = new Token (Token.Equal); - } - break; - case '+': - token = new Token (Token.Plus); - break; - case '-': - token = new Token (Token.Minus); - break; - case '(': - token = new Token (Token.LeftParen); - break; - case ')': - token = new Token (Token.RightParen); - break; - case '<': - readChar (); - if (data.ch == '<') - token = new Token (Token.ShiftLeft); - else if (data.ch == '=') - token = new Token (Token.LessEqual); - else - { - unread (data.ch); - token = new Token (Token.LessThan); - } - break; - case '>': - readChar (); - if (data.ch == '>') - token = new Token (Token.ShiftRight); - else if (data.ch == '=') - token = new Token (Token.GreaterEqual); - else - { - unread (data.ch); - token = new Token (Token.GreaterThan); - } - break; - case '[': - token = new Token (Token.LeftBracket); - break; - case ']': - token = new Token (Token.RightBracket); - break; - case '\'': - token = getCharacterToken(false); - break; - case '"': - readChar (); - token = new Token (Token.StringLiteral, getUntil ('"', false, false, false)); - break; - case '\\': - readChar (); - // If this is at the end of a line, then it is the - // line continuation character - treat it as white space - if (data.ch == '\n' || data.ch == '\r') - token = null; - else - token = new Token (Token.Backslash); - break; - case '|': - readChar (); - if (data.ch == '|') - token = new Token (Token.DoubleBar); - else - { - unread (data.ch); - token = new Token (Token.Bar); - } - break; - case '^': - token = new Token (Token.Carat); - break; - case '&': - readChar (); - if (data.ch == '&') - token = new Token (Token.DoubleAmpersand); - else - { - unread (data.ch); - token = new Token (Token.Ampersand); - } - break; - case '*': - token = new Token (Token.Star); - break; - case '/': - readChar (); - // <21jul1997daz> Extract comments rather than skipping them. - // Preserve only the comment immediately preceding the next token. - if (data.ch == '/') - //skipLineComment (); - commentText = getLineComment(); - else if (data.ch == '*') - //skipBlockComment (); - commentText = getBlockComment(); - else - { - unread (data.ch); - token = new Token (Token.Slash); - } - break; - case '%': - token = new Token (Token.Percent); - break; - case '~': - token = new Token (Token.Tilde); - break; - - // The period token is recognized in getNumber. - // The period is only valid in a floating ponit number. - //case '.': - // token = new Token (Token.Period); - // break; - - case '#': - token = getDirective (); - break; - case '!': - readChar (); - if (data.ch == '=') - token = new Token (Token.NotEqual); - else - { - unread (data.ch); - token = new Token (Token.Exclamation); - } - break; - case '?': - try - { - token = replaceTrigraph (); - break; - } - catch (InvalidCharacter e) {} - default: - throw new InvalidCharacter (data.filename, currentLine (), currentLineNumber (), currentLinePosition (), data.ch); - } - readChar (); - } - } - catch (EOFException e) - { - token = new Token (Token.EOF); - } - - // Transfer comment to parser via token. 21jul1997 - token.comment = new Comment( commentText ); - - //System.out.println ("Scanner.getToken returning token.type = " + token.type); - //if (token.type == Token.Identifier || token.type == Token.MacroIdentifier || (token.type >= Token.BooleanLiteral && token.type <= Token.StringLiteral)) - // System.out.println ("Scanner.getToken returns token.name = " + token.name); - - if (debug) - System.out.println( "Token: " + token ) ; - - return token; - } // getToken - - /** - * - **/ - void scanString (String string) - { - dataStack.push (data); - - data = new ScannerData (data); - - data.fileIndex = 0; - data.oldIndex = 0; - // data.fileBytes = string.getBytes (); - int strLen = string.length(); - data.fileBytes = new char[strLen]; - string.getChars (0, strLen, data.fileBytes, 0); - - data.macrodata = true; - - try {readChar ();} catch (IOException e) {} - } // scanString - - /** - * - **/ - void scanIncludedFile (IncludeEntry file, String filename, boolean includeIsImport) throws IOException - { - dataStack.push (data); - data = new ScannerData (); - data.indent = ((ScannerData)dataStack.peek ()).indent + ' '; - data.includeIsImport = includeIsImport; - try - { - readFile (file, filename); - if (!emitAll && includeIsImport) - SymtabEntry.enteringInclude (); - // As of CORBA 2.3, include files define new scope for Repository - // ID prefixes. The previous Rep. ID is just below the top of the stack and - // must be restored when the contents of this include file are parsed (see readCh()). - Parser.enteringInclude (); - - if (verbose) - System.out.println (data.indent + Util.getMessage ("Compile.parsing", filename)); - } - catch (IOException e) - { - data = (ScannerData)dataStack.pop (); - throw e; - } - } // scanIncludedFile - - /** - * - **/ - private void unread (char ch) - { - if (ch == '\n' && !data.macrodata) --data.line; - --data.fileIndex; - } // unread - - /** - * - **/ - void readChar () throws IOException - { - if (data.fileIndex >= data.fileBytes.length) - if (dataStack.empty ()) - throw new EOFException (); - else - { - // Indicate end-of-scope for include file to parser. - //Parser.exitingInclude (); - - // IBM.11666 - begin - //if (!emitAll && data.includeIsImport && !data.macrodata) - //{ - //SymtabEntry.exitingInclude (); - //Parser.exitingInclude (); // - //} - if (!data.macrodata) - { - if (!emitAll && data.includeIsImport) - SymtabEntry.exitingInclude(); - Parser.exitingInclude(); - } // IBM.11666 - end - - if (verbose && !data.macrodata) - System.out.println (data.indent + Util.getMessage ("Compile.parseDone", data.filename)); - data = (ScannerData)dataStack.pop (); - } - else - { - data.ch = (char)(data.fileBytes[data.fileIndex++] & 0x00ff); - if (data.ch == '\n' && !data.macrodata) ++data.line; - } - } // readChar - - /** - * Starting at a quote, reads a string with possible - * unicode or octal values until an end quote. Doesn't - * handle line feeds or comments. - */ - private String getWString() throws IOException - { - readChar(); - StringBuffer result = new StringBuffer(); - - while (data.ch != '"') { - if (data.ch == '\\') { - // Could be a \ooo octal or - // unicode hex - readChar(); - if (data.ch == 'u') { - // Unicode hex - int num = getNDigitHexNumber(4); - System.out.println("Got num: " + num); - System.out.println("Which is: " + (int)(char)num); - result.append((char)num); - // result.append((char)getNDigitHexNumber(4)); - // getNDigitHexNumber reads the next - // character, so loop without reading another - continue; - } else - if (data.ch >= '0' && data.ch <= '7') { - // Octal - result.append((char)get3DigitOctalNumber()); - // get3DigitOctalNumber reads the next - // character, so loop without reading another - continue; - } else { - // Wasn't either, so just append the - // slash and current character. - result.append('\\'); - result.append(data.ch); - } - } else { - // Just append the character - result.append(data.ch); - } - - // Advance to the next character - readChar(); - } - - return result.toString(); - } - - /** - * - **/ - private Token getCharacterToken(boolean isWide) throws IOException - { - // The token name returned contains a string with two elements: - // first the character appears, then the representation of the - // character. These are typically the same, but they CAN be - // different, for example "O\117" - Token token = null; - readChar (); - if ( data.ch == '\\' ) - { - readChar (); - if ((data.ch == 'x') || (data.ch == 'u')) - { - char charType = data.ch; - int hexNum = getNDigitHexNumber ((charType == 'x') ? 2 : 4); - return new Token (Token.CharacterLiteral, - ((char)hexNum) + "\\" + charType + Integer.toString (hexNum, 16), isWide ); - } - if ((data.ch >= '0') && (data.ch <= '7')) - { - int octNum = get3DigitOctalNumber (); - return new Token (Token.CharacterLiteral, - ((char)octNum) + "\\" + Integer.toString (octNum, 8), isWide ); - } - return singleCharEscapeSequence (isWide); - } - token = new Token (Token.CharacterLiteral, "" + data.ch + data.ch, isWide ); - readChar (); - return token; - } // getCharacterToken - - /** - * - **/ - private Token singleCharEscapeSequence (boolean isWide) throws IOException - { - Token token; - if (data.ch == 'n') - // newline - token = new Token (Token.CharacterLiteral, "\n\\n", isWide); - else if (data.ch == 't') - // horizontal tab - token = new Token (Token.CharacterLiteral, "\t\\t", isWide); - else if (data.ch == 'v') - // vertical tab - token = new Token (Token.CharacterLiteral, "\013\\v", isWide); - else if (data.ch == 'b') - // backspace - token = new Token (Token.CharacterLiteral, "\b\\b", isWide); - else if (data.ch == 'r') - // carriage return - token = new Token (Token.CharacterLiteral, "\r\\r", isWide); - else if (data.ch == 'f') - // form feed - token = new Token (Token.CharacterLiteral, "\f\\f", isWide); - else if (data.ch == 'a') - // alert - token = new Token (Token.CharacterLiteral, "\007\\a", isWide); - else if (data.ch == '\\') - // backslash - token = new Token (Token.CharacterLiteral, "\\\\\\", isWide); - else if (data.ch == '?') - // question mark - token = new Token (Token.CharacterLiteral, "?\\?", isWide); - else if (data.ch == '\'') - // single quote - token = new Token (Token.CharacterLiteral, "'\\'", isWide); - else if (data.ch == '"') - // double quote - token = new Token (Token.CharacterLiteral, "\"\\\"", isWide); - else - throw new InvalidCharacter (data.filename, currentLine (), currentLineNumber (), currentLinePosition (), data.ch); - readChar (); - return token; - } // singleCharEscapeSequence - - private Token getString () throws IOException - { - StringBuffer sbuf = new StringBuffer() ; - boolean escaped = false; // - boolean[] collidesWithKeyword = { false } ; // - - // An escaped id. begins with '_', which is followed by a normal - // identifier. Disallow prefixes of '_' having length > 1. - if (data.ch == '_') { - sbuf.append( data.ch ) ; - readChar (); - if (escaped = escapedOK) - if (data.ch == '_') - throw new InvalidCharacter (data.filename, currentLine (), - currentLineNumber (), currentLinePosition (), data.ch); - } - - // Build up the string of valid characters until a non-string - // character is encountered. - while (Character.isLetterOrDigit( data.ch ) || (data.ch == '_')) { - sbuf.append( data.ch ) ; - readChar() ; - } - - String string = sbuf.toString() ; - - // Escaped identifiers - If identifier has '_' prefix, ignore - // keyword check and strip '_'; otherwise, perform keyword check. - - if (!escaped) { // Escaped id ==> ignore keyword check - Token result = Token.makeKeywordToken( string, corbaLevel, escapedOK, - collidesWithKeyword ) ; - if (result != null) - return result ; - } - - // At this point the string is an identifier. If it is a - // string which is also a Java keyword, prepend an underscore - // so that it doesn't generate a compiler error. - string = getIdentifier (string); - - // If a left paren immediately follows, this could be a - // macro definition, return a MacroIdentifier - if (data.ch == '(') { - readChar (); - return new Token (Token.MacroIdentifier, string, escaped, - collidesWithKeyword[0], false); - } else - return new Token (Token.Identifier, string, escaped, - collidesWithKeyword[0], false); - } - - // Wildcard values - static final int Star = 0, Plus = 1, Dot = 2, None = 3; - - /** - * - **/ - private boolean matchesClosedWildKeyword (String string) - { - boolean found = true; - String tmpString = string; - Enumeration e = wildcardKeywords.elements (); - while (e.hasMoreElements ()) - { - int wildcard = None; - StringTokenizer tokens = new StringTokenizer ((String)e.nextElement (), "*+.", true); - if (tokens.hasMoreTokens ()) - { - String token = tokens.nextToken (); - if (tmpString.startsWith (token)) - { - tmpString = tmpString.substring (token.length ()); - while (tokens.hasMoreTokens () && found) - { - token = tokens.nextToken (); - if (token.equals ("*")) - wildcard = Star; - else if (token.equals ("+")) - wildcard = Plus; - else if (token.equals (".")) - wildcard = Dot; - else if (wildcard == Star) - { - int index = tmpString.indexOf (token); - if (index >= 0) - tmpString = tmpString.substring (index + token.length ()); - else - found = false; - } - else if (wildcard == Plus) - { - int index = tmpString.indexOf (token); - if (index > 0) - tmpString = tmpString.substring (index + token.length ()); - else - found = false; - } - else if (wildcard == Dot) - { - int index = tmpString.indexOf (token); - if (index == 1) - tmpString = tmpString.substring (1 + token.length ()); - else - found = false; - } - } - if (found && tmpString.equals ("")) - break; - } - } - } - return found && tmpString.equals (""); - } // matchesClosedWildKeyword - - /** - * - **/ - private String matchesOpenWildcard (String string) - { - Enumeration e = openEndedKeywords.elements (); - String prepend = ""; - while (e.hasMoreElements ()) - { - int wildcard = None; - boolean found = true; - String tmpString = string; - StringTokenizer tokens = new StringTokenizer ((String)e.nextElement (), "*+.", true); - while (tokens.hasMoreTokens () && found) - { - String token = tokens.nextToken (); - if (token.equals ("*")) - wildcard = Star; - else if (token.equals ("+")) - wildcard = Plus; - else if (token.equals (".")) - wildcard = Dot; - else if (wildcard == Star) - { - wildcard = None; - int index = tmpString.lastIndexOf (token); - if (index >= 0) - tmpString = blankOutMatch (tmpString, index, token.length ()); - else - found = false; - } - else if (wildcard == Plus) - { - wildcard = None; - int index = tmpString.lastIndexOf (token); - if (index > 0) - tmpString = blankOutMatch (tmpString, index, token.length ()); - else - found = false; - } - else if (wildcard == Dot) - { - wildcard = None; - int index = tmpString.lastIndexOf (token); - if (index == 1) - tmpString = blankOutMatch (tmpString, 1, token.length ()); - else - found = false; - } - else if (wildcard == None) - if (tmpString.startsWith (token)) - tmpString = blankOutMatch (tmpString, 0, token.length ()); - else - found = false; - } - - // Make sure that, if the last character of the keyword is a - // wildcard, that the string matches what the wildcard - // requires. - if (found) - { - if (wildcard == Star) - ; - else if (wildcard == Plus && tmpString.lastIndexOf (' ') != tmpString.length () - 1) - ; - else if (wildcard == Dot && tmpString.lastIndexOf (' ') == tmpString.length () - 2) - ; - else if (wildcard == None && tmpString.lastIndexOf (' ') == tmpString.length () - 1) - ; - else - found = false; - } - // If found, then prepend an underscore. But also try matching - // again after leading and trailing blanks are removed from - // tmpString. This isn't quite right, but it solves a problem - // which surfaced in the Java mapping. For example: - // openEndedKeywords = {"+Helper", "+Holder", "+Package"}; - // string = fooHelperPackage. - // Given the mechanics of the Java mapping, _fooHelperPackage - // COULD have a conflict, so for each occurance of a keyword, - // an underscore is added, so this would cause two underscores: - // __fooHelperPackage. To accomplish this, the first time thru - // tmpString is "fooHelper " at this point, strip off the - // trailing blanks and try matching "fooHelper". This also - // matches, so two underscores are prepended. - if (found) - { - prepend = prepend + "_" + matchesOpenWildcard (tmpString.trim ()); - break; - } - } - return prepend; - } // matchesOpenWildcard - - /** - * - **/ - private String blankOutMatch (String string, int start, int length) - { - char[] blanks = new char [length]; - for (int i = 0; i < length; ++i) - blanks[i] = ' '; - return string.substring (0, start) + new String (blanks) + string.substring (start + length); - } // blankOutMatch - - /** - * - **/ - private String getIdentifier (String string) - { - if (keywords.contains (string)) - // string matches a non-wildcard keyword - string = '_' + string; - else - { - // Check to see if string matches any wildcard keywords that - // aren't open ended (don't have a wildcard as the first or - // last character. - String prepend = ""; - if (matchesClosedWildKeyword (string)) - prepend = "_"; - else - // string did not match any closed wildcard keywords (that - // is, keywords with wildcards anywhere but at the beginning - // or end of the word). - // Now check for * + or . at the beginning or end. - // These require special handling because they could match - // more than one keyword. prepend an underscore for each - // matched keyword. - prepend = matchesOpenWildcard (string); - string = prepend + string; - } - return string; - } // getIdentifier - - /** - * - **/ - private Token getDirective () throws IOException - { - readChar (); - String string = new String (); - while ((data.ch >= 'a' && data.ch <= 'z') || (data.ch >= 'A' && data.ch <= 'Z')) - { - string = string + data.ch; - readChar (); - } - unread (data.ch); - for (int i = 0; i < Token.Directives.length; ++i) - if (string.equals (Token.Directives[i])) - return new Token (Token.FirstDirective + i); - // If it got this far, it is an unknown preprocessor directive. - return new Token (Token.Unknown, string); - } // getDirective - - /** - * - **/ - private Token getNumber () throws IOException - { - if (data.ch == '.') - return getFractionNoInteger (); - else if (data.ch == '0') - return isItHex (); - else // the only other possibliities are 1..9 - return getInteger (); - } // getNumber - - /** - * - **/ - private Token getFractionNoInteger () throws IOException - { - readChar (); - if (data.ch >= '0' && data.ch <= '9') - return getFraction ("."); - else - return new Token (Token.Period); - } // getFractionNoInteger - - /** - * - **/ - private Token getFraction (String string) throws IOException - { - while (data.ch >= '0' && data.ch <= '9') - { - string = string + data.ch; - readChar (); - } - if (data.ch == 'e' || data.ch == 'E') - return getExponent (string + 'E'); - else - return new Token (Token.FloatingPointLiteral, string); - } // getFraction - - /** - * - **/ - private Token getExponent (String string) throws IOException - { - readChar (); - if (data.ch == '+' || data.ch == '-') - { - string = string + data.ch; - readChar (); - } - else if (data.ch < '0' || data.ch > '9') - throw new InvalidCharacter (data.filename, currentLine (), currentLineNumber (), currentLinePosition (), data.ch); - while (data.ch >= '0' && data.ch <= '9') - { - string = string + data.ch; - readChar (); - } - return new Token (Token.FloatingPointLiteral, string); - } // getExponent - - /** - * - **/ - private Token isItHex () throws IOException - { - readChar (); - if (data.ch == '.') - { - readChar (); - return getFraction ("0."); - } - else if (data.ch == 'x' || data.ch == 'X') - return getHexNumber ("0x"); - else if (data.ch == '8' || data.ch == '9') - throw new InvalidCharacter (data.filename, currentLine (), currentLineNumber (), currentLinePosition (), data.ch); - else if (data.ch >= '0' && data.ch <= '7') - return getOctalNumber (); - else if (data.ch == 'e' || data.ch == 'E') - return getExponent ("0E"); - else - return new Token (Token.IntegerLiteral, "0"); - } // isItHex - - /** - * - **/ - private Token getOctalNumber () throws IOException - { - String string = "0" + data.ch; - readChar (); - while ((data.ch >= '0' && data.ch <= '9')) - { - if (data.ch == '8' || data.ch == '9') - throw new InvalidCharacter (data.filename, currentLine (), currentLineNumber (), currentLinePosition (), data.ch); - string = string + data.ch; - readChar (); - } - return new Token (Token.IntegerLiteral, string); - } // getOctalNumber - - /** - * - **/ - private Token getHexNumber (String string) throws IOException - { - readChar (); - if ((data.ch < '0' || data.ch > '9') && (data.ch < 'a' || data.ch > 'f') && (data.ch < 'A' || data.ch > 'F')) - throw new InvalidCharacter (data.filename, currentLine (), currentLineNumber (), currentLinePosition (), data.ch); - else - while ((data.ch >= '0' && data.ch <= '9') || (data.ch >= 'a' && data.ch <= 'f') || (data.ch >= 'A' && data.ch <= 'F')) - { - string = string + data.ch; - readChar (); - } - return new Token (Token.IntegerLiteral, string); - } // getHexNumber - - /** - * - **/ - private int getNDigitHexNumber (int n) throws IOException - { - readChar (); - if (!isHexChar (data.ch)) - throw new InvalidCharacter (data.filename, currentLine (), - currentLineNumber (), currentLinePosition (), data.ch); - String string = "" + data.ch; - readChar (); - for (int i = 2; i <= n; i++) - { - if (!isHexChar( data.ch)) - break; - string += data.ch; - readChar (); - } - try - { - return Integer.parseInt (string, 16); - } - catch (NumberFormatException e) - { - } - return 0; - } // getNDigitHexNumber - - /** - * - **/ - private boolean isHexChar ( char hex ) - { - return ((data.ch >= '0') && (data.ch <= '9')) || - ((data.ch >= 'a') && (data.ch <= 'f')) || - ((data.ch >= 'A') && (data.ch <= 'F')); - } - - /** - * - **/ - private int get3DigitOctalNumber () throws IOException - { - char firstDigit = data.ch; - String string = "" + data.ch; - readChar (); - if (data.ch >= '0' && data.ch <= '7') - { - string = string + data.ch; - readChar (); - if (data.ch >= '0' && data.ch <= '7') - { - string = string + data.ch; - if (firstDigit > '3') - // This is a 3-digit number bigger than 377 - throw new InvalidCharacter (data.filename, currentLine (), currentLineNumber (), currentLinePosition (), firstDigit); - readChar (); - } - } - int ret = 0; - try - { - ret = Integer.parseInt (string, 8); - } - catch (NumberFormatException e) - { - throw new InvalidCharacter (data.filename, currentLine (), currentLineNumber (), currentLinePosition (), string.charAt (0)); - } - return ret; - } // get3DigitOctalNumber - - /** - * - **/ - private Token getInteger () throws IOException - { - String string = "" + data.ch; - readChar (); - if (data.ch == '.') - { - readChar (); - return getFraction (string + '.'); - } - else if (data.ch == 'e' || data.ch == 'E') - return getExponent (string + 'E'); - else if (data.ch >= '0' && data.ch <= '9') - while (data.ch >= '0' && data.ch <= '9') - { - string = string + data.ch; - readChar (); - if (data.ch == '.') - { - readChar (); - return getFraction (string + '.'); - } - } - return new Token (Token.IntegerLiteral, string); - } // getInteger - - /** - * - **/ - private Token replaceTrigraph () throws IOException - { - readChar (); - if (data.ch == '?') - { - readChar (); - if (data.ch == '=') - data.ch = '#'; - else if (data.ch == '/') - data.ch = '\\'; - else if (data.ch == '\'') - data.ch = '^'; - else if (data.ch == '(') - data.ch = '['; - else if (data.ch == ')') - data.ch = ']'; - else if (data.ch == '!') - data.ch = '|'; - else if (data.ch == '<') - data.ch = '{'; - else if (data.ch == '>') - data.ch = '}'; - else if (data.ch == '-') - data.ch = '~'; - else - { - unread (data.ch); - unread ('?'); - throw new InvalidCharacter (data.filename, currentLine (), currentLineNumber (), currentLinePosition (), data.ch); - } - return getToken (); - } - else - { - unread ('?'); - throw new InvalidCharacter (data.filename, currentLine (), currentLineNumber (), currentLinePosition (), data.ch); - } - } // replaceTrigraph - - /** - * - **/ - void skipWhiteSpace () throws IOException - { - while (data.ch <= ' ') - readChar (); - } // skipWhiteSpace - - /** - * - **/ - private void skipBlockComment () throws IOException - { - try - { - boolean done = false; - readChar (); - while (!done) - { - while (data.ch != '*') - readChar (); - readChar (); - if (data.ch == '/') - done = true; - } - } - catch (EOFException e) - { - ParseException.unclosedComment (data.filename); - throw e; - } - } // skipBlockComment - - /** - * - **/ - void skipLineComment () throws IOException - { - while (data.ch != '\n') - readChar (); - } // skipLineComment - - // The following two routines added to extract comments rather - // than ignore them. - - /** - * Extract a line comment from the input buffer. - **/ - private String getLineComment () throws IOException - { - StringBuffer sb = new StringBuffer( "/" ); - while (data.ch != '\n') - { - if (data.ch != '\r') - sb.append (data.ch); - readChar (); - } - return sb.toString(); - } // getLineComment - - /** - * Extract a block comment from the input buffer. - **/ - private String getBlockComment () throws IOException - { - StringBuffer sb = new StringBuffer ("/*"); - try - { - boolean done = false; - readChar (); - sb.append (data.ch); - while (!done) - { - while (data.ch != '*') - { - readChar (); - sb.append (data.ch); - } - readChar (); - sb.append (data.ch); - if (data.ch == '/') - done = true; - } - } - catch (EOFException e) - { - ParseException.unclosedComment (data.filename); - throw e; - } - return sb.toString (); - } // getBlockComment - - /** - * - **/ - Token skipUntil (char c) throws IOException - { - while (data.ch != c) - { - if (data.ch == '/') - { - readChar (); - if (data.ch == '/') - { - skipLineComment (); - // If this is skipping until the newline, skipLineComment - // reads past the newline, so it won't be seen by the - // while loop conditional check. - if (c == '\n') break; - } - else if (data.ch == '*') - skipBlockComment (); - } - else - readChar (); - } - return getToken (); - } // skipUntil - - // getUntil is used for macro definitions and to get quoted - // strings, so characters within "("...")" and '"'...'"' are - // ignored. Ie getUntil ',' on (,,,,),X will return (,,,,) - - String getUntil (char c) throws IOException - { - return getUntil (c, true, true, true); - } - - String getUntil (char c, boolean allowQuote, boolean allowCharLit, boolean allowComment) throws IOException - { - String string = ""; - while (data.ch != c) - string = appendToString (string, allowQuote, allowCharLit, allowComment); - return string; - } // getUntil - - /** - * - **/ - String getUntil (char c1, char c2) throws IOException - { - String string = ""; - while (data.ch != c1 && data.ch != c2) - string = appendToString (string, false, false, false); - return string; - } // getUntil - - /** - * - **/ - private String appendToString (String string, boolean allowQuote, boolean allowCharLit, boolean allowComment) throws IOException - { - // Ignore any comments if they are allowed - if (allowComment && data.ch == '/') - { - readChar (); - if (data.ch == '/') - skipLineComment (); - else if (data.ch == '*') - skipBlockComment (); - else - string = string + '/'; - } - // Handle line continuation character - else if (data.ch == '\\') - { - readChar (); - if (data.ch == '\n') - readChar (); - else if (data.ch == '\r') - { - readChar (); - if (data.ch == '\n') - readChar (); - } - else - { - string = string + '\\' + data.ch; - readChar (); - } - } - // characters within "("...")" and '"'...'"' are ignored. - // Ie getUntil ',' on (,,,,),X will return (,,,) - else - { - if (allowCharLit && data.ch == '"') - { - readChar (); - string = string + '"'; - while (data.ch != '"') - string = appendToString (string, true, false, allowComment); - } - else if (allowQuote && allowCharLit && data.ch == '(') - { - readChar (); - string = string + '('; - while (data.ch != ')') - string = appendToString (string, false, false, allowComment); - } - else if (allowQuote && data.ch == '\'') - { - readChar (); - string = string + "'"; - while (data.ch != '\'') - string = appendToString (string, false, true, allowComment); - } - string = string + data.ch; - readChar (); - } - return string; - } // appendToString - - /** - * - **/ - String getStringToEOL () throws IOException - { - String string = new String (); - while (data.ch != '\n') - { - if (data.ch == '\\') - { - readChar (); - if (data.ch == '\n') - readChar (); - else if (data.ch == '\r') - { - readChar (); - if (data.ch == '\n') - readChar (); - } - else - { - string = string + data.ch; - readChar (); - } - } - else - { - string = string + data.ch; - readChar (); - } - } - return string; - } // getStringToEOL - - /** - * - **/ - String filename () - { - return data.filename; - } // filename - - /** - * - **/ - IncludeEntry fileEntry () - { - return data.fileEntry; - } // fileEntry - - /** - * - **/ - int currentLineNumber () - { - return data.line; - } // currentLineNumber - - /** - * - **/ - int lastTokenLineNumber () - { - return data.oldLine; - } // lastTokenLineNumber - - private int BOL; // Beginning Of Line - - /** - * - **/ - String currentLine () - { - BOL = data.fileIndex - 1; - try - { - // If the current position is at the end of the line, - // set BOL to before the end of the line so the whole - // line is returned. - if (data.fileBytes[BOL - 1] == '\r' && data.fileBytes[BOL] == '\n') - BOL -= 2; - else if (data.fileBytes[BOL] == '\n') - --BOL; - while (data.fileBytes[BOL] != '\n') - --BOL; - } - catch (ArrayIndexOutOfBoundsException e) - { - BOL = -1; - } - ++BOL; // Go to the first character AFTER the newline - int EOL = data.fileIndex - 1; - try - { - while (data.fileBytes[EOL] != '\n' && data.fileBytes[EOL] != '\r') - ++EOL; - } - catch (ArrayIndexOutOfBoundsException e) - { - EOL = data.fileBytes.length; - } - if (BOL < EOL) - return new String (data.fileBytes, BOL, EOL - BOL); - else - return ""; - } // currentLine - - /** - * - **/ - String lastTokenLine () - { - int saveFileIndex = data.fileIndex; - data.fileIndex = data.oldIndex; - String ret = currentLine (); - data.fileIndex = saveFileIndex; - return ret; - } // lastTokenLine - - /** - * - **/ - int currentLinePosition () - { - return data.fileIndex - BOL; - } // currentLinePosition - - /** - * - **/ - int lastTokenLinePosition () - { - return data.oldIndex - BOL; - } // lastTokenLinePosition - - // The scanner data is moved to a separate class so that all of the - // data can easily be pushed and popped to a stack. - - // The data must be stackable for macros and #included files. When - // a macro is encountered: the current stack data is reserved on - // the stack; the stack is loaded with the macro info; processing - // proceeds with this data. The same is true for #included files. - - // It may seem that the entire Scanner should be put on a stack in - // the Parser since all the scanner data is stackable. But that - // would mean instantiating a new scanner. The scanner must - // continue from where it left off; when certain things cross file - // boundaries, they must be handled by the scanner, not the parser, - // things like: block comments, quoted strings, tokens. - private ScannerData data = new ScannerData (); - private Stack dataStack = new Stack (); - private Vector keywords = new Vector (); - private Vector openEndedKeywords = new Vector (); - private Vector wildcardKeywords = new Vector (); - private boolean verbose; - // Identifiers starting with '_' are considered "Escaped", - // except when scanned during preprocessing. Class Preprocessor is - // responsible to modify the escapedOK flag accordingly. Since preceding - // underscores are now legal when scanning identifiers as well as - // macro identifier, underscoreOK is obsolete. - // - // boolean underscoreOK = false; - boolean escapedOK = true; - // Remove -stateful feature. - // boolean stateful; - private boolean emitAll; - private float corbaLevel; - private boolean debug ; -} // class Scanner - -// This is a dumb class, really just a struct. It contains all of the -// scanner class's data in one place so that that data can be easily -// pushed and popped to a stack. - -/** - * - **/ -class ScannerData -{ - /** - * - **/ - public ScannerData () - { - } // ctor - - /** - * - **/ - public ScannerData (ScannerData that) - { - indent = that.indent; - fileEntry = that.fileEntry; - filename = that.filename; - fileBytes = that.fileBytes; - fileIndex = that.fileIndex; - oldIndex = that.oldIndex; - ch = that.ch; - line = that.line; - oldLine = that.oldLine; - macrodata = that.macrodata; - includeIsImport = that.includeIsImport; - } // copy ctor - - String indent = ""; - IncludeEntry fileEntry = null; - String filename = ""; - - // fileBytes is a byte array rather than a char array. This is - // safe because OMG IDL is specified to be ISO Latin-1 whose high- - // order byte is always 0x0. Converted from byte[] to char[] - // to employ Reader classes, which have Character encoding features. - //byte[] fileBytes = null; - char[] fileBytes = null; - int fileIndex = 0; - int oldIndex = 0; - char ch; - int line = 1; - int oldLine = 1; - boolean macrodata = false; - boolean includeIsImport = false; -} // class ScannerData diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/SequenceEntry.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/SequenceEntry.java deleted file mode 100644 index 78b20f3a3dc..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/SequenceEntry.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; -import java.util.Vector; - -import com.sun.tools.corba.se.idl.constExpr.Expression; - -/** - * This is the symbol table entry for sequences. - **/ -public class SequenceEntry extends SymtabEntry -{ - protected SequenceEntry () - { - super (); - repositoryID (Util.emptyID); - } // ctor - - protected SequenceEntry (SequenceEntry that) - { - super (that); - _maxSize = that._maxSize; - } // ctor - - protected SequenceEntry (SymtabEntry that, IDLID clone) - { - super (that, clone); - if (!(that instanceof SequenceEntry)) - // If that is a SequenceEntry, then it is a container of this sequence, but it is not a module of this sequence. It's name doesn't belong in the module name. - if (module ().equals ("")) - module (name ()); - else if (!name ().equals ("")) - module (module () + "/" + name ()); - repositoryID (Util.emptyID); - } // ctor - - public Object clone () - { - return new SequenceEntry (this); - } // clone - - public boolean isReferencable() - { - // A sequence is referencable if its component - // type is. - return type().isReferencable() ; - } - - public void isReferencable( boolean value ) - { - // NO-OP: this cannot be set for a sequence. - } - - /** Invoke the sequence generator. - @param symbolTable the symbol table is a hash table whose key is - a fully qualified type name and whose value is a SymtabEntry or - a subclass of SymtabEntry. - @param stream the stream to which the generator should sent its output. - @see SymtabEntry */ - public void generate (Hashtable symbolTable, PrintWriter stream) - { - sequenceGen.generate (symbolTable, this, stream); - } // generate - - /** Access the sequence generator. - @return an object which implements the SequenceGen interface. - @see SequenceGen */ - public Generator generator () - { - return sequenceGen; - } // generator - - /** the constant expression defining the maximum size of the sequence. - If it is null, then the sequence is unbounded. */ - public void maxSize (Expression expr) - { - _maxSize = expr; - } // maxSize - - /** the constant expression defining the maximum size of the sequence. - If it is null, then the sequence is unbounded. */ - public Expression maxSize () - { - return _maxSize; - } // maxSize - - /** Only sequences can be contained within sequences. */ - public void addContained (SymtabEntry entry) - { - _contained.addElement (entry); - } // addContained - - /** Only sequences can be contained within sequences. */ - public Vector contained () - { - return _contained; - } // contained - - static SequenceGen sequenceGen; - - private Expression _maxSize = null; - private Vector _contained = new Vector (); -} // class SequenceEntry diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/SequenceGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/SequenceGen.java deleted file mode 100644 index b26fefa817d..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/SequenceGen.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.*; - -public interface SequenceGen extends Generator -{ - void generate (Hashtable symbolTable, SequenceEntry entry, PrintWriter stream); -} // interface SequenceGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/StringEntry.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/StringEntry.java deleted file mode 100644 index 1283be83356..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/StringEntry.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.constExpr.Expression; - -public class StringEntry extends SymtabEntry -{ - protected StringEntry () - { - super (); - String override = (String)Parser.overrideNames.get ("string"); - if (override == null) - name ("string"); - else - name (override); - repositoryID (Util.emptyID); - } // ctor - - protected StringEntry (StringEntry that) - { - super (that); - _maxSize = that._maxSize; - } // ctor - - protected StringEntry (SymtabEntry that, IDLID clone) - { - super (that, clone); - module (""); - - String override = (String)Parser.overrideNames.get ("string"); - if (override == null) - name ("string"); - else - name (override); - repositoryID (Util.emptyID); - } // ctor - - public Object clone () - { - return new StringEntry (this); - } // clone - - /** Invoke the string type generator. - @param symbolTable the symbol table is a hash table whose key is - a fully qualified type name and whose value is a SymtabEntry or - a subclass of SymtabEntry. - @param stream the stream to which the generator should sent its output. - @see SymtabEntry */ - public void generate (Hashtable symbolTable, PrintWriter stream) - { - stringGen.generate (symbolTable, this, stream); - } // generate - - /** Access the primitive type generator. - @return an object which implements the PrimitiveGen interface. - @see PrimitiveGen */ - public Generator generator () - { - return stringGen; - } // generator - - /** The constant expression defining the maximum size of the string. - If it is null, then the string is unbounded. */ - public void maxSize (Expression expr) - { - _maxSize = expr; - } // maxSize - - /** The constant expression defining the maximum size of the string. - If it is null, then the string is unbounded. */ - public Expression maxSize () - { - return _maxSize; - } // maxSize - - static StringGen stringGen; - - private Expression _maxSize = null; -} // class StringEntry diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/StringGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/StringGen.java deleted file mode 100644 index ef9b422b178..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/StringGen.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.*; - -public interface StringGen extends Generator -{ - void generate (Hashtable symbolTable, StringEntry entry, PrintWriter stream); -} // interface StringGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/StructEntry.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/StructEntry.java deleted file mode 100644 index 3e500927bd5..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/StructEntry.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Vector; - -/** - * This is the symbol table entry for structs. - **/ -public class StructEntry extends SymtabEntry -{ - protected StructEntry () - { - super (); - } // ctor - - protected StructEntry (StructEntry that) - { - super (that); - if (!name ().equals ("")) - { - module (module () + name ()); - name (""); - } - _members = (Vector)that._members.clone (); - _contained = (Vector)that._contained.clone (); - } // ctor - - protected StructEntry (SymtabEntry that, IDLID clone) - { - super (that, clone); - if (module ().equals ("")) - module (name ()); - else if (!name ().equals ("")) - module (module () + "/" + name ()); - } // ctor - - public Object clone () - { - return new StructEntry (this); - } // clone - - /** Invoke the struct generator. - @param symbolTable the symbol table is a hash table whose key is - a fully qualified type name and whose value is a SymtabEntry or - a subclass of SymtabEntry. - @param stream the stream to which the generator should sent its output. - @see SymtabEntry */ - public void generate (Hashtable symbolTable, PrintWriter stream) - { - structGen.generate (symbolTable, this, stream); - } // generate - - /** Access the struct generator. - @return an object which implements the StructGen interface. - @see StructGen */ - public Generator generator () - { - return structGen; - } // generator - - /** Add a member to the member list. */ - public void addMember (TypedefEntry member) - { - _members.addElement (member); - } // addMember - - /** This is a vector of TypedefEntry's. In this context, only the name, - type, and arrayInfo fields hold any meaning. */ - public Vector members () - { - return _members; - } // members - - public void addContained (SymtabEntry entry) - { - _contained.addElement (entry); - } // addContained - - /** This is a vector of SymtabEntry's. It itemizes any types which - this struct contains. It is different than the member list. - For example: -

            -      struct A
            -      {
            -        long x;
            -        Struct B
            -        {
            -          long a;
            -          long b;
            -        } y;
            -      }
            -      
            - Struct B is contained within struct A. - The members vector will contain entries for x and y. */ - public Vector contained () - { - return _contained; - } // contained - - private Vector _members = new Vector (); - private Vector _contained = new Vector (); - - static StructGen structGen; -} // class StructEntry diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/StructGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/StructGen.java deleted file mode 100644 index cb03c722f6c..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/StructGen.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.*; - -public interface StructGen extends Generator -{ - void generate (Hashtable symbolTable, StructEntry entry, PrintWriter stream); -} // interface StructGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/SymtabEntry.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/SymtabEntry.java deleted file mode 100644 index ed1772ce228..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/SymtabEntry.java +++ /dev/null @@ -1,375 +0,0 @@ -/* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; - -import java.util.Hashtable; -import java.util.Stack; -import java.util.Vector; - -/** - * This is the base class for all symbol table entries. - * @see AttributeEntry - * @see ConstEntry - * @see EnumEntry - * @see ExceptionEntry - * @see IncludeEntry - * @see InterfaceEntry - * @see MethodEntry - * @see ModuleEntry - * @see ParameterEntry - * @see PragmaEntry - * @see PrimitiveEntry - * @see SequenceEntry - * @see StructEntry - * @see TypedefEntry - * @see UnionEntry - **/ -public class SymtabEntry -{ - public SymtabEntry () - { - initDynamicVars (); - } // ctor - - SymtabEntry (SymtabEntry that, IDLID clone) - { - _module = that._module; - _name = that._name; - _type = that._type; - _typeName = that._typeName; - _sourceFile = that._sourceFile; - _info = that._info; - _repID = (RepositoryID)clone.clone (); - ((IDLID)_repID).appendToName (_name); - if (that instanceof InterfaceEntry || that instanceof ModuleEntry || that instanceof StructEntry || that instanceof UnionEntry || (that instanceof SequenceEntry && this instanceof SequenceEntry)) - _container = that; - else - _container = that._container; - initDynamicVars (); - _comment = that._comment; // <21jul1997daz> - } // ctor - - /** This is a shallow copy constructor */ - SymtabEntry (SymtabEntry that) - { - _module = that._module; - _name = that._name; - _type = that._type; - _typeName = that._typeName; - _sourceFile = that._sourceFile; - _info = that._info; - _repID = (RepositoryID)that._repID.clone (); - _container = that._container; - - if (_type instanceof ForwardEntry) - ((ForwardEntry)_type).types.addElement (this); - - initDynamicVars (); - // <21JUL1997> - _comment = that._comment; - } // ctor - - void initDynamicVars () - { - _dynamicVars = new Vector (maxKey + 1); - for (int i = 0; i <= maxKey; ++i) - _dynamicVars.addElement (null); - } // initDynamicVars - - /** This is a shallow copy clone */ - public Object clone () - { - return new SymtabEntry (this); - } // clone - - /** @return the concatenation of the module and the name, delimited by '/'. */ - public final String fullName () - { - return _module.equals ("") ? _name : _module + '/' + _name; - } // fullName - - /** Get the name of this entry's module. If there are modules within - modules, each module name is separated by '/'. - @return this entry's module name. */ - public String module () - { - return _module; - } // module - - /** Set the module for this entry. - @param newName the new name of the module. */ - public void module (String newName) - { - if (newName == null) - _module = ""; - else - _module = newName; - } // module - - /** @return the name of this entry. */ - public String name () - { - return _name; - } // name - - /** Set the name. - @param newName the new name. */ - public void name (String newName) - { - if (newName == null) - _name = ""; - else - _name = newName; - - // Update the RepositoryID - if (_repID instanceof IDLID) - ((IDLID)_repID).replaceName (newName); - } // name - - /** @return the type name of this entry. */ - public String typeName () - { - return _typeName; - } // typeName - - protected void typeName (String typeName) - { - _typeName = typeName; - } // typeName - - /** @return the type entry of this entry */ - public SymtabEntry type () - { - return _type; - } // type - - public void type (SymtabEntry newType) - { - if (newType == null) - typeName (""); - else - typeName (newType.fullName ()); - _type = newType; - - if (_type instanceof ForwardEntry) - ((ForwardEntry)_type).types.addElement (this); - } // type - - /** The file name in which this entry was defined. */ - public IncludeEntry sourceFile () - { - return _sourceFile; - } // sourceFile - - /** The file name in which this entry was defined. */ - public void sourceFile (IncludeEntry file) - { - _sourceFile = file; - } // sourceFile - - /** This must be either an InterfaceEntry or a ModuleEntry. - It can be nothing else. */ - public SymtabEntry container () - { - return _container; - } // container - - /** This must be either an InterfaceEntry or a ModuleEntry. - It can be nothing else. */ - public void container (SymtabEntry newContainer) - { - if (newContainer instanceof InterfaceEntry || newContainer instanceof ModuleEntry) - _container = newContainer; - } // container - - /** @return the repository ID for this entry. */ - public RepositoryID repositoryID () - { - return _repID; - } // repositoryID - - /** Set the repository ID for this entry. - @param id the new repository ID. */ - public void repositoryID (RepositoryID id) - { - _repID = id; - } // repositoryID - - /** Should this type be emitted? */ - public boolean emit () - { - return _emit && _isReferencable ; - } // emit - - public void emit (boolean emit) - { - _emit = emit; - } // emit - - /* <21jul1997daz> Accessors for comment */ - - public Comment comment() - { - return _comment; - } - - public void comment( Comment comment ) - { - _comment = comment; - } - - public boolean isReferencable() - { - return _isReferencable ; - } - - public void isReferencable( boolean value ) - { - _isReferencable = value ; - } - - static Stack includeStack = new Stack (); - - static void enteringInclude () - { - includeStack.push (new Boolean (setEmit)); - setEmit = false; - } // enteringInclude - - static void exitingInclude () - { - setEmit = ((Boolean)includeStack.pop ()).booleanValue (); - } // exitingInclude - - /** Other variables besides the default ones can be dynamically placed - into SymTabEntry (and therefore on all symbol table entries) by - extenders. Before such a variable can exist, its key must be - obtained by calling getVariableKey. */ - public static int getVariableKey () - { - return ++maxKey; - } // dynamicVariable - - /** Other variables besides the default ones can be dynamically placed - into SymTabEntry (and therefore on all symbol table entries) by - extenders. This method assigns the value to the variable of the - given key. A valid key must be obtained by calling the method - getVariableKey. If the key is invalid, NoSuchFieldException is - thrown. */ - public void dynamicVariable (int key, Object value) throws NoSuchFieldException - { - if (key > maxKey) - throw new NoSuchFieldException (Integer.toString (key)); - else - { - if (key >= _dynamicVars.size ()) - growVars (); - _dynamicVars.setElementAt (value, key); - } - } // dynamicVariable - - /** Other variables besides the default ones can be dynamically placed - into SymTabEntry (and therefore on all symbol table entries) by - extenders. This method gets the value of the variable of the - given key. A valid key must be obtained by calling the method - getVariableKey. If the key is invalid, NoSuchFieldException is - thrown. */ - public Object dynamicVariable (int key) throws NoSuchFieldException - { - if (key > maxKey) - throw new NoSuchFieldException (Integer.toString (key)); - else - { - if (key >= _dynamicVars.size ()) - growVars (); - return _dynamicVars.elementAt (key); - } - } // dynamicVariable - - void growVars () - { - int diff = maxKey - _dynamicVars.size () + 1; - for (int i = 0; i < diff; ++i) - _dynamicVars.addElement (null); - } // growVars - - /** Invoke a generator. A call to this method is only meaningful - for subclasses of SymtabEntry. If called on this class, it - is a no-op. - @param symbolTable the symbol table is a hash table whose key is - a fully qualified type name and whose value is a SymtabEntry or - a subclass of SymtabEntry. - @param stream the stream to which the generator should sent its output. */ - public void generate (Hashtable symbolTable, PrintWriter stream) - { - } // generate - - /** Access a generator. A call to this method is only meaningful - for subclasses of SymtabEntry. If called on this class, it - is a no-op. - @return an object which implements the Generator interface. */ - public Generator generator () - { - return null; - } // generator - - static boolean setEmit = true; - static int maxKey = -1; - - private SymtabEntry _container = null; - private String _module = ""; - private String _name = ""; - private String _typeName = ""; - private SymtabEntry _type = null; - private IncludeEntry _sourceFile = null; - private Object _info = null; - private RepositoryID _repID = new IDLID ("", "", "1.0"); - private boolean _emit = setEmit; - private Comment _comment = null; - private Vector _dynamicVars; - private boolean _isReferencable = true ; -} // class SymtabEntry - -/*======================================================================================= - DATE ACTION - --------------------------------------------------------------------------------------- - 21jul1997 Added _comment data member to afford transferring comments from source - file to target; added acessor methods for comment. - =======================================================================================*/ diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/SymtabFactory.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/SymtabFactory.java deleted file mode 100644 index e41d9931aef..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/SymtabFactory.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -/** - * Each entry must have three ways in which it can be instantiated: - *
              - *
            • with no parameters; - *
            • cloned from a copy of itself; - *
            • the normal-use instantiation (usually with 2 parameters: the container and the id of the container). - *
            - **/ -public interface SymtabFactory -{ - AttributeEntry attributeEntry (); - AttributeEntry attributeEntry (InterfaceEntry container, IDLID id); - - ConstEntry constEntry (); - ConstEntry constEntry (SymtabEntry container, IDLID id); - - NativeEntry nativeEntry (); - NativeEntry nativeEntry (SymtabEntry container, IDLID id); - - EnumEntry enumEntry (); - EnumEntry enumEntry (SymtabEntry container, IDLID id); - - ExceptionEntry exceptionEntry (); - ExceptionEntry exceptionEntry (SymtabEntry container, IDLID id); - - ForwardEntry forwardEntry (); - ForwardEntry forwardEntry (ModuleEntry container, IDLID id); - - ForwardValueEntry forwardValueEntry (); - ForwardValueEntry forwardValueEntry (ModuleEntry container, IDLID id); - - IncludeEntry includeEntry (); - IncludeEntry includeEntry (SymtabEntry container); - - InterfaceEntry interfaceEntry (); - InterfaceEntry interfaceEntry (ModuleEntry container, IDLID id); - - ValueEntry valueEntry (); - ValueEntry valueEntry (ModuleEntry container, IDLID id); - - ValueBoxEntry valueBoxEntry (); - ValueBoxEntry valueBoxEntry (ModuleEntry container, IDLID id); - - MethodEntry methodEntry (); - MethodEntry methodEntry (InterfaceEntry container, IDLID id); - - ModuleEntry moduleEntry (); - ModuleEntry moduleEntry (ModuleEntry container, IDLID id); - - ParameterEntry parameterEntry (); - ParameterEntry parameterEntry (MethodEntry container, IDLID id); - - PragmaEntry pragmaEntry (); - PragmaEntry pragmaEntry (SymtabEntry container); - - PrimitiveEntry primitiveEntry (); - /** name can be, but is not limited to, the primitive idl type names: - char, octet, short, long, etc. The reason it is not limited to - these is that, as an extender, you may wish to override these names. - For instance, when generating Java code, octet translates to byte, - so there is an entry in Compile.overrideNames: {@code <"octet", "byte">} - and a PrimitiveEntry in the symbol table for "byte". */ - PrimitiveEntry primitiveEntry (String name); - - SequenceEntry sequenceEntry (); - SequenceEntry sequenceEntry (SymtabEntry container, IDLID id); - - StringEntry stringEntry (); - - StructEntry structEntry (); - StructEntry structEntry (SymtabEntry container, IDLID id); - - TypedefEntry typedefEntry (); - TypedefEntry typedefEntry (SymtabEntry container, IDLID id); - - UnionEntry unionEntry (); - UnionEntry unionEntry (SymtabEntry container, IDLID id); -} // interface SymtabFactory diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Token.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Token.java deleted file mode 100644 index c758a56ebfc..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Token.java +++ /dev/null @@ -1,689 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: -// -F46082.51 Remove -stateful feature. -// -D59166 Add support for keyword/identifier collision detection. This -// feature is implemented here, rather than class Scanner, to allow the Parser -// to handle the problem. -// -F60858.1 Support -corba option, level <= 2.2: identify 2.3 keywords. -// -D62023 Support -corba option, level <= 2.3, identify 2.4 keywords. -// KMC Support -corba, level <= 3.0. Added 3.0 keywords. -// -// Should escaped Identifier should be a type rather than an attribute? -// - -/** - * Class Token represents a lexeme appearing within an IDL source. Every - * Token has a type. Depending on its type and on the supported version - * of IDL, a Token will have other associated attributes, such as a name - * (identifier, e.g.), and whether it is escaped, deprecated, or is a type - * that is known to be in a future version of IDL. - **/ -class Token -{ - /////////////// - // Available types - - static final int // Keywords - Any = 0, // 2.2 - Attribute = 1, // | - Boolean = 2, // . - Case = 3, // . - Char = 4, // . - Const = 5, - Context = 6, - Default = 7, - Double = 8, - Enum = 9, - Exception = 10, - FALSE = 11, - Fixed = 12, // New addition - Float = 13, - In = 14, - Inout = 15, - Interface = 16, - Long = 17, - Module = 18, - Native = 19, // New addition - Object = 20, - Octet = 21, - Oneway = 22, - Out = 23, - Raises = 24, - Readonly = 25, - Sequence = 26, - Short = 27, - String = 28, - Struct = 29, - Switch = 30, - TRUE = 31, - Typedef = 32, - Unsigned = 33, // . - Union = 34, // . - Void = 35, // . - Wchar = 36, // | - Wstring = 37, // 2.2 - // New OBV keywords... - // In 2.4rtf, "factory" is synonymous to "init" in 2.3 - Init = 38, // 2.3 only - Abstract = 39, // 2.3 2.4rtf - Custom = 40, // | | - Private = 41, // | | - Public = 42, // | | - Supports = 43, // | | - Truncatable = 44, // | | - ValueBase = 45, // | | - Valuetype = 46, // 2.3 2.4rtf - Factory = 47, // 2.4rtf only - - // Keywords in CORBA 3.0 - Component = 48, - Consumes = 49, - Emits = 50, - Finder = 51, - GetRaises = 52, - Home = 53, - Import = 54, - Local = 55, - Manages = 56, - Multiple = 57, - PrimaryKey = 58, - Provides = 59, - Publishes = 60, - SetRaises = 61, - TypeId = 62, - TypePrefix = 63, - Uses = 64, - - Identifier = 80, // Identifier - MacroIdentifier = 81, // Macro Identifier - - Semicolon = 100, // Symbols - LeftBrace = 101, - RightBrace = 102, - Colon = 103, - Comma = 104, - Equal = 105, - Plus = 106, - Minus = 107, - LeftParen = 108, - RightParen = 109, - LessThan = 110, - GreaterThan = 111, - LeftBracket = 112, - RightBracket = 113, - Apostrophe = 114, - Quote = 115, - Backslash = 116, - Bar = 117, - Carat = 118, - Ampersand = 119, - Star = 120, - Slash = 121, - Percent = 122, - Tilde = 123, - DoubleColon = 124, - ShiftLeft = 125, - ShiftRight = 126, - Period = 127, - Hash = 128, - Exclamation = 129, - DoubleEqual = 130, - NotEqual = 131, - GreaterEqual = 132, - LessEqual = 133, - DoubleBar = 134, - DoubleAmpersand = 135, - - BooleanLiteral = 200, // Literals - CharacterLiteral = 201, - IntegerLiteral = 202, - FloatingPointLiteral = 203, - StringLiteral = 204, - Literal = 205, - - Define = 300, // Directives - Undef = 301, - If = 302, - Ifdef = 303, - Ifndef = 304, - Else = 305, - Elif = 306, - Include = 307, - Endif = 308, - Line = 309, - Error = 310, - Pragma = 311, - Null = 312, - Unknown = 313, - - Defined = 400, - - // Keyword identifiers. - //Abstract = 500, - //Custom = 501, - //Init = 502, - //Private2 = 503, - //Public2 = 504, - //Supports = 505, - //Truncatable = 506, - //ValueBase = 507, - //Valuetype = 508, - - EOF = 999; // End of Input - - // Available types - /////////////// - // Keywords - - static final String [] Keywords = { - "any", "attribute", "boolean", - "case", "char", "const", - "context", "default", "double", - "enum", "exception", "FALSE", "fixed", - "float", "in", "inout", - "interface", "long", "module", "native", - "Object", "octet", "oneway", - "out", "raises", "readonly", - "sequence", "short", "string", - "struct", "switch", "TRUE", - "typedef", "unsigned", "union", - "void", "wchar", "wstring", - "init", // In 2.3 only - "abstract", "custom", "private", // 2.3 and 2.4rtf - "public", "supports", "truncatable", - "ValueBase", "valuetype", - "factory", // In 2.4rtf only - // CORBA 3.0 keywords - "component", "consumes", "emits", - "finder", "getRaises", "home", - "import", "local", "manages", - "multiple", "primaryKey", "provides", - "publishes", "setRaises", "supports", - "typeId", "typePrefix", "uses" } ; - - // Remove keyword identifiers. - //static final int - // FirstKeywordIdentifier = 500, - // LastKeywordIdentifier = Valuetype; - // - //static final String[] KeywordIdentifiers = { - // "abstract", "custom", "init", - // "private", "public", "supports", - // "truncatable", "valueBase", "valuetype"}; - - /** - * Determine whether this token is a keyword. - * @return true iff this token is a keyword. - **/ - boolean isKeyword () - { - return type >= FirstKeyword && type <= LastKeyword; - } // isKeyword - - private static final int - FirstKeyword = Any, // 0 - LastKeyword = Uses; - - // Keywords in CORBA 2.2 that we support. - private static final int - First22Keyword = Any, // 0 - Last22Keyword = Wstring; - - // New keywords in CORBA 2.3 (preliminary) that we support. - private static final int - First23Keyword = Init, - Last23Keyword = Valuetype; - - // New keywords in CORBA 2.4rtf (accepted 2.3) that we support. - // Note that "factory" replaces "init". Scanner must account for this in - // keyword scan. - private static final int - First24rtfKeyword = Abstract, - Last24rtfKeyword = Factory; - - // New keywords in CORBA 3.0 (from CORBA components v. 1) - private static final int - First30Keyword = Component, - Last30Keyword = Uses; - - // Current valid CORBA levels: - // 2.2 (or <2.3): the default: no OBV support - // 2.3: add OBV with init - // >2.3: OBV with init replcaed by factory - // 3.0: adds components, attr exceptions, local interfaces, type repository - // decls. - - private static final int CORBA_LEVEL_22 = 0 ; - private static final int CORBA_LEVEL_23 = 1 ; - private static final int CORBA_LEVEL_24RTF = 2 ; - private static final int CORBA_LEVEL_30 = 3 ; - - // Do the conversion from a floating point CORBA level to an int - private static int getLevel( float cLevel ) - { - if (cLevel < 2.3f) - return CORBA_LEVEL_22 ; - if (Util.absDelta( cLevel, 2.3f ) < 0.001f) - return CORBA_LEVEL_23 ; - if (cLevel < 3.0f) - return CORBA_LEVEL_24RTF ; - return CORBA_LEVEL_30 ; - } - - // Return the last keyword corresponding to a particular CORBA level - private static int getLastKeyword( int level ) - { - if (level == CORBA_LEVEL_22) - return Last22Keyword ; - if (level == CORBA_LEVEL_23) - return Last23Keyword ; - if (level == CORBA_LEVEL_24RTF) - return Last24rtfKeyword ; - return Last30Keyword ; - } - - /** Create a keyword token from a string. - * Determines whether the string is an IDL keyword based on the corbaLevel. - * Strings that are keywords at higher CORBA levels than the corbaLevel - * argument create identifier tokens that are marked as "collidesWithKeyword", unless - * escapedOK is FALSE, which is the case only when preprocessing is taking place. - * In the case of the "init" keyword, which was only defined in CORBA 2.3, init is - * marked deprecated in CORBA 2.3 since it is not supported in higher levels. - * @param String string The string we are converting to a token. - * @param float corbaLevel The CORBA level, currently in the interval [2.2, 3.0]. - * @param boolean escapedOK Flag set true if _ is used to escape an IDL keyword for use - * as an identifier. - * @param boolean[] collidesWithKeyword is an array containing one value: a flag - * representing whether this string is an identifier that collides with a keyword. - * This is set by this method. - * @return Token The resulting Token corresponding to string. - */ - public static Token makeKeywordToken( - String string, float corbaLevel, boolean escapedOK, boolean[] collision ) - { - int level = getLevel( corbaLevel ) ; - int lastKeyword = getLastKeyword( level ) ; - boolean deprecated = false ; - collision[0] = false ; - - // If the string is a keyword token, return that token - for (int i = Token.FirstKeyword; i <= Token.LastKeyword; ++i) { - if (string.equals (Token.Keywords[i])) { - // Return identifier if lexeme is a keyword in a - // greater CORBA level; collect attributes indicating future keyword/ - // identifier collision and deprecations. - - // Init is really a funny case. I don't want to mark it as - // a keyword collision in the 2.2 case, since it was only - // defined to be a keyword briefly in 2.3. - if (i == Token.Init) { - if (level == CORBA_LEVEL_23) - deprecated = true ; - else - break ; - } - - if (i > lastKeyword) { - collision[0] |= escapedOK; // escapedOK true iff not preprocessing - break ; - } - - if (string.equals ("TRUE") || string.equals ("FALSE")) - return new Token (Token.BooleanLiteral, string) ; - else - return new Token (i, deprecated); - } else if (string.equalsIgnoreCase (Token.Keywords[i])) { - // PU! This will go away in a future release, because - // case-insensitive keyword checking will be standard. For now, - // indicate that a keyword collision has occurred. - collision[0] |= true; - break; - } - } // for i <= lastKeyword - - return null ; - } // makeKeywordToken - - // Keywords - /////////////// - // Symbols - - static final int - FirstSymbol = 100, - LastSymbol = 199; - - static final String [] Symbols = { - ";", "{", "}", ":", ",", "=", "+", "-", - "(", ")", "<", ">", "[", "]", "'", "\"", - "\\", "|", "^", "&", "*", "/", "%", "~", - "::", "<<", ">>", ".", "#", "!", "==", "!=", - ">=", "<=", "||", "&&"}; - - // Symbols - /////////////// - // Literals - - static final int - FirstLiteral = 200, - LastLiteral = 299; - - static final String [] Literals = { - Util.getMessage ("Token.boolLit"), - Util.getMessage ("Token.charLit"), - Util.getMessage ("Token.intLit"), - Util.getMessage ("Token.floatLit"), - Util.getMessage ("Token.stringLit"), - Util.getMessage ("Token.literal")}; - - // Literals - /////////////// - // Directives - - /** - * Determine whether this token is a preprocessor directive. - * @return true iff this token is a preprocessor directive. - **/ - boolean isDirective () - { - return type >= FirstDirective && type <= LastDirective; - } // isDirective - - static final int - FirstDirective = 300, - LastDirective = 399; - - static final String [] Directives = { - "define", "undef", "if", - "ifdef", "ifndef", "else", - "elif", "include","endif", - "line", "error", "pragma", - ""}; - - // Directives - /////////////// - // Specials - - static final int - FirstSpecial = 400, - LastSpecial = 499; - - static final String [] Special = { - "defined"}; - - // Specials - /////////////// - - /** - * Constructor. - * @return a Token of the supplied type. - **/ - Token (int tokenType) - { - type = tokenType; - } // ctor - - // - /** - * Constructor. - * @return a Token having the supplied attributes. - **/ - Token (int tokenType, boolean deprecated) - { - this.type = tokenType; - this.isDeprecated = deprecated; - } // ctor - - /** - * Constructor. - * @return a Token having the supplied attributes. - **/ - Token (int tokenType, String tokenName) - { - type = tokenType; - name = tokenName; - } // ctor - - /** - * Constructor. - * @return a Token having the supplied attribtues. - * having - **/ - Token (int tokenType, String tokenName, boolean isWide) - { - this (tokenType, tokenName); - this.isWide = isWide; - } // ctor - - - // - /** - * Constructor. - * @return a Token having the supplied attributes. - **/ - Token (int tokenType, String tokenName, boolean escaped, - boolean collision, boolean deprecated) - { - this (tokenType, tokenName); - this.isEscaped = escaped; - this.collidesWithKeyword = collision; - this.isDeprecated = deprecated; - } // ctor - - // Remove keyword identifiers. - ///** - // * Constructor. - // * @return a Token having the supplied attributes. - // **/ - //Token (int tokenType, int tokenSubType, String tokenName) - //{ - // type = tokenType; - // subType = tokenSubType; - // name = tokenName; - //} // ctor - - /** - * Get the String representation of this Token. - * @return a String containing representation of this Token. - **/ - public String toString () - { - if (type == Identifier) - return name; - if (type == MacroIdentifier) - return name + '('; - return Token.toString (type); - } // toString - - /** - * Get the String representation of a supplied Token type. - * @return A String containing the name of the supplied Token type. - **/ - static String toString (int type) - { - if (type <= LastKeyword) - return Keywords[type]; - // Remove keyword identifiers. - //if ( (type >= FirstKeywordIdentifier) && (type <= LastKeywordIdentifier) ) - // return KeywordIdentifiers[ type - FirstKeywordIdentifier ]; - if (type == Identifier || type == MacroIdentifier) - return Util.getMessage ("Token.identifier"); - if (type <= LastSymbol) - return Symbols[type - FirstSymbol]; - if (type <= LastLiteral) - return Literals[type - FirstLiteral]; - if (type <= LastDirective) - return Directives[type - FirstDirective]; - if (type <= LastSpecial) - return Special[type - FirstSpecial]; - if (type == EOF) - return Util.getMessage ("Token.endOfFile"); - return Util.getMessage ("Token.unknown"); - } // toString - - /////////////// - // Accessors and Predicates - - /** - * Determine whether this token equals a supplied token. - * @return true iff the types and names of this and the supplied - * Token are equal. - **/ - boolean equals (Token that) - { - if (this.type == that.type) - if (this.name == null) - return that.name == null; - else - return this.name.equals (that.name); - return false; - } // equals - - /** - * Determine whether the this token is of a supplied type. - * @return true iff the type of this Token equals that supplied. - **/ - boolean equals (int type) - { - return this.type == type; - } // equals - - /** - * Determine whether this identifier has the supplied name. - * @return true iff this Token is an identifier having the supplied name. - **/ - boolean equals (String name) - { - return (this.type == Identifier && this.name.equals (name)); - } // equals - - // Although isEscaped is an independent attribute, it may be true only - // when type is Identifer. - /** - * Accessor. - * @return true iff this token is an escaped identifier. - **/ - public boolean isEscaped () - { - return type == Identifier && isEscaped; - } // isEscaped - - // - /** - * Accessor. - * @return true iff this token is an identifier having a name matching - * a keyword in a version of CORBA greater than the specified CORBA level, - * or iff it matches a keyword in letter, but note case. - **/ - public boolean collidesWithKeyword () - { - return collidesWithKeyword; - } // collidesWithKeyword - - // Storing deprecation information in a token seems a natural - // means to notify the parser about deprecated types. - /** - * Accessor. - * @return true iff this token is a deprecated lexeme or lexical type with - * respect to the specified CORBA level. - **/ - public boolean isDeprecated () - { - return isDeprecated; - } - // isDeprecated - - public boolean isWide() - { - return isWide ; - } - - // It's more efficient if Scanner determines this attribute. - /** - * Determine whether this token collides with an IDL keyword. - **/ - //public boolean collidesWithKeyword () - //{ - // if (name != null && type == Identifier && !isEscaped) - // { - // String lcName = name.toLowerCase (); - // for (int i = FirstKeyword; i <= LastKeyword; ++i) - // if (lcName.equals (Token.Keywords [i].toLowerCase ())) - // return true; - // } - // return false; - //} // collidesWithKeyword - - // Accessors and Predicates - /////////////// - - /** - * Code identifying the lexical class to which this token belongs, e.g., - * Keyword, Identifier, ... - **/ - int type; - /** - * Lexeme extracted from the source for this token. - **/ - String name = null; - /** - * Source comment associated with this token. - **/ - Comment comment = null; - /** - * True iff this token is an escaped identifier. - **/ - boolean isEscaped = false; // - /** - * True iff this token is an identifier that is known to be a keyword - * in another version of CORBA or matches a keyword in letter, but not case. - **/ - boolean collidesWithKeyword = false; // - /** - * True iff this token is deprecated. - **/ - boolean isDeprecated = false; // - // Remove keyword identifier implementation. - ///** - // * Non-zero only when type = [Macro]Identifier - // **/ - //int subType = 0; - - boolean isWide = false ; // Only for string and char literals: indicates that this is - // a wide string or char. -} // class Token diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/TokenBuffer.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/TokenBuffer.java deleted file mode 100644 index 6e153ae5910..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/TokenBuffer.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -class TokenBuffer -{ - private final int DEFAULT_SIZE = 10; - - private int _size = 0; - private Token _buffer [] = null; - private int _currPos = -1; - - TokenBuffer () - { - _size = DEFAULT_SIZE; - _buffer = new Token [_size]; - _currPos = -1; - } // ctor - - TokenBuffer (int size) throws Exception - { - _size = size; // _size == 0 is legal, but useless and problematic - _buffer = new Token [_size]; - _currPos = -1; - } // ctor - - /** Inserts a token at the head of the buffer. */ - void insert (Token token) - { - // _size == 0 ==> ArithmeticException: divide by zero - _currPos = ++_currPos % _size; - _buffer [_currPos] = token; - } - - /** Returns the token residing "i" elements from the head of the buffer. */ - Token lookBack (int i) - { - // Beware: i > _size ==> idx < 0 ==> ArrayOutOfBoundsException - return _buffer [(_currPos - i) >= 0 ? _currPos - i : _currPos - i + _size]; - } - - /** Return the token most recently inserted into the buffer (i.e., the head of the buffer.) */ - Token current () - { - // Beware: _buffer empty || _size == 0 ==> ArrayOutOfBoundsException - return _buffer [_currPos]; - } -} // class TokenBuffer - - -/*================================================================================== - DATE ACTION - ---------------------------------------------------------------------------------- - 11aug1997 Initial version completed. Buffer used to maintain history of - comments extracted from source file during parse. - ==================================================================================*/ diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/TypedefEntry.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/TypedefEntry.java deleted file mode 100644 index 9a617b57bdc..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/TypedefEntry.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; -import java.util.Vector; - -import com.sun.tools.corba.se.idl.constExpr.Expression; - -/** - * This is the symbol table entry for typedefs. - **/ -public class TypedefEntry extends SymtabEntry -{ - protected TypedefEntry () - { - super (); - } // ctor - - protected TypedefEntry (TypedefEntry that) - { - super (that); - _arrayInfo = (Vector)that._arrayInfo.clone (); - } // ctor - - protected TypedefEntry (SymtabEntry that, IDLID clone) - { - super (that, clone); - if (module ().equals ("")) - module (name ()); - else if (!name ().equals ("")) - module (module () + "/" + name ()); - } // ctor - - /** This method returns a vector of Expressions, each expression - represents a dimension in an array. A zero-length vector indicates - no array information.*/ - public Vector arrayInfo () - { - return _arrayInfo; - } // arrayInfo - - public void addArrayInfo (Expression e) - { - _arrayInfo.addElement (e); - } // addArrayInfo - - public Object clone () - { - return new TypedefEntry (this); - } // clone - - /** Invoke the typedef generator. - @param symbolTable the symbol table is a hash table whose key is - a fully qualified type name and whose value is a SymtabEntry or - a subclass of SymtabEntry. - @param stream the stream to which the generator should sent its output. - @see SymtabEntry */ - public void generate (Hashtable symbolTable, PrintWriter stream) - { - typedefGen.generate (symbolTable, this, stream); - } // generate - - public boolean isReferencable() - { - // A typedef is referencable if its component - // type is. - return type().isReferencable() ; - } - - public void isReferencable( boolean value ) - { - // NO-OP: this cannot be set for a typedef. - } - - /** Access the typedef generator. - @return an object which implements the TypedefGen interface. - @see TypedefGen */ - public Generator generator () - { - return typedefGen; - } // generator - - private Vector _arrayInfo = new Vector (); - - static TypedefGen typedefGen; -} // class TypedefEntry diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/TypedefGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/TypedefGen.java deleted file mode 100644 index c451292f48c..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/TypedefGen.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.*; - -public interface TypedefGen extends Generator -{ - void generate (Hashtable symbolTable, TypedefEntry entry, PrintWriter stream); -} // interface TypedefGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/UnionBranch.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/UnionBranch.java deleted file mode 100644 index 55a7aa434e1..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/UnionBranch.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.util.Vector; - -import com.sun.tools.corba.se.idl.TypedefEntry; - -/** - * This class encapsulates one branch of a union. Here are some examples - * of what it may contain: - *
            - *
            - * {@code case 1: short x;} - *
            {@code , false>} - *
            - * {@code case 0:}
            - * {@code case 8:}
            - * {@code case 2: long x;} - *
            {@code , false>} - *
            - * {@code default: long x;} - *
            {@code , true>} - *
            - * {@code case 0:}
            - * {@code case 2:}
            - * {@code default: char c;} - *
            {@code , true>} - *
            - **/ -public class UnionBranch -{ - /** The type definition for the branch. */ - public TypedefEntry typedef; - /** A vector of Expression's, one for each label in the order in which - they appear in the IDL file. The default branch has no label. */ - public Vector labels = new Vector (); - /** true if this is the default branch. */ - public boolean isDefault = false; -} // class UnionBranch diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/UnionEntry.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/UnionEntry.java deleted file mode 100644 index 0d438a6f9d4..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/UnionEntry.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Vector; - -import com.sun.tools.corba.se.idl.constExpr.Expression; - -/** - * This is the symbol table entry for unions. - **/ -public class UnionEntry extends SymtabEntry -{ - protected UnionEntry () - { - super (); - } // ctor - - protected UnionEntry (UnionEntry that) - { - super (that); - if (!name ().equals ("")) - { - module (module () + name ()); - name (""); - } - _branches = (Vector)that._branches.clone (); - _defaultBranch = that._defaultBranch; - _contained = that._contained; - } // ctor - - protected UnionEntry (SymtabEntry that, IDLID clone) - { - super (that, clone); - if (module ().equals ("")) - module (name ()); - else if (!name ().equals ("")) - module (module () + "/" + name ()); - } // ctor - - public Object clone () - { - return new UnionEntry (this); - } // clone - - /** Invoke the union generator. - @param symbolTable the symbol table is a hash table whose key is - a fully qualified type name and whose value is a SymtabEntry or - a subclass of SymtabEntry. - @param stream the stream to which the generator should sent its output. - @see SymtabEntry */ - public void generate (Hashtable symbolTable, PrintWriter stream) - { - unionGen.generate (symbolTable, this, stream); - } // generate - - /** Access the union generator. - @return an object which implements the UnionGen interface. - @see UnionGen */ - public Generator generator () - { - return unionGen; - } // generator - - public void addBranch (UnionBranch branch) - { - _branches.addElement (branch); - } // addBranch - - /** This is a vector of UnionBranch's. */ - public Vector branches () - { - return _branches; - } // branches - - /** This TypedefEntry describes the type and name for the default branch. - Like the entries in the branches vector, only the type and name fields - are pertinent. */ - public void defaultBranch (TypedefEntry branch) - { - _defaultBranch = branch; - } // defaultBranch - - /** This TypedefEntry describes the type and name for the default branch. - Like the entries in the branches vector, only the type and name fields - are pertinent. */ - public TypedefEntry defaultBranch () - { - return _defaultBranch; - } // defaultBranch - - public void addContained (SymtabEntry entry) - { - _contained.addElement (entry); - } // addContained - - /** This is a vector of SymtabEntry's. It itemizes any types which - this union contains. For example: - -
            -      union A
            -      switch (long)
            -      {
            -        case 0: long x;
            -        case 1:
            -          Struct B
            -          {
            -            long a;
            -            long b;
            -          } y;
            -      }
            -      
            - Struct B is contained within union A. */ - public Vector contained () - { - return _contained; - } // contained - - boolean has (Expression label) - { - Enumeration eBranches = _branches.elements (); - while (eBranches.hasMoreElements ()) - { - Enumeration eLabels = ((UnionBranch)eBranches.nextElement ()).labels.elements (); - while (eLabels.hasMoreElements ()) - { - Expression exp = (Expression)eLabels.nextElement (); - if (exp.equals (label) || exp.value ().equals (label.value ())) - return true; - } - } - return false; - } // has - - boolean has (TypedefEntry typedef) - { - Enumeration e = _branches.elements (); - while (e.hasMoreElements ()) - { - UnionBranch branch = (UnionBranch)e.nextElement (); - if (!branch.typedef.equals (typedef) && branch.typedef.name ().equals (typedef.name ())) - return true; - } - return false; - } // has - - /** A vector of UnionBranch's. */ - private Vector _branches = new Vector (); - private TypedefEntry _defaultBranch = null; - private Vector _contained = new Vector (); - - static UnionGen unionGen; -} // class UnionEntry diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/UnionGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/UnionGen.java deleted file mode 100644 index fc009a4750d..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/UnionGen.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.*; - -public interface UnionGen extends Generator -{ - void generate (Hashtable symtab, UnionEntry entry, PrintWriter stream); -} // interface UnionGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Util.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Util.java deleted file mode 100644 index 7621859151a..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Util.java +++ /dev/null @@ -1,379 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: -// -capitalize and parseTypeModifier should probably be in the -// generators package. -// -D58319 Add version() method. -// -D62023 Add absDelta() method to support float computations. - -import java.io.DataInputStream; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; - -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Properties; -import java.util.Vector; - -import com.sun.tools.corba.se.idl.som.cff.FileLocator; - -public class Util -{ - // - /** - * Fetch the version number of this build of the IDL Parser Framework - * from the appropriate properties file. - * @return the version number contained within the appropriate properties - * file, which indicates the build of this IDL Parser Framework. - **/ - public static String getVersion () - { - return getVersion ("com/sun/tools/corba/se/idl/idl.prp"); - } // getVersion - - /** - * Fetch the version number of this build of the IDL Parser Framework. - * This method may be called before or after the framework has been - * initialized. If the framework is inititialized, the version information - * is extracted from the message properties object; otherwise, it is extracted - * from the indicated messages file. - * @return the version number. - **/ - public static String getVersion (String filename) - { - String version = ""; - if (messages == null) // Use supplied file - { - Vector oldMsgFiles = msgFiles; - if (filename == null || filename.equals ("")) - filename = "com/sun/tools/corba/se/idl/idl.prp"; - filename = filename.replace ('/', File.separatorChar); - registerMessageFile (filename); - version = getMessage ("Version.product", getMessage ("Version.number")); - msgFiles = oldMsgFiles; - messages = null; - } - else - { - version = getMessage ("Version.product", getMessage ("Version.number")); - } - return version; - } // getVersion - - public static boolean isAttribute (String name, Hashtable symbolTable) - { - SymtabEntry entry = (SymtabEntry)symbolTable.get (name); - return entry == null ? false : entry instanceof AttributeEntry; - } // isAttribute - - public static boolean isConst (String name, Hashtable symbolTable) - { - SymtabEntry entry = (SymtabEntry)symbolTable.get (name); - return entry == null ? false : entry instanceof ConstEntry; - } // isConst - - public static boolean isEnum (String name, Hashtable symbolTable) - { - SymtabEntry entry = (SymtabEntry)symbolTable.get (name); - return entry == null ? false : entry instanceof EnumEntry; - } // isEnum - - public static boolean isException (String name, Hashtable symbolTable) - { - SymtabEntry entry = (SymtabEntry)symbolTable.get (name); - return entry == null ? false : entry instanceof ExceptionEntry; - } // isException - - public static boolean isInterface (String name, Hashtable symbolTable) - { - SymtabEntry entry = (SymtabEntry)symbolTable.get (name); - return entry == null ? false : entry instanceof InterfaceEntry; - } // isInterface - - public static boolean isMethod (String name, Hashtable symbolTable) - { - SymtabEntry entry = (SymtabEntry)symbolTable.get (name); - return entry == null ? false : entry instanceof MethodEntry; - } // isMethod - - public static boolean isModule (String name, Hashtable symbolTable) - { - SymtabEntry entry = (SymtabEntry)symbolTable.get (name); - return entry == null ? false : entry instanceof ModuleEntry; - } // isModule - - public static boolean isParameter (String name, Hashtable symbolTable) - { - SymtabEntry entry = (SymtabEntry)symbolTable.get (name); - return entry == null ? false : entry instanceof ParameterEntry; - } // isParameter - - public static boolean isPrimitive (String name, Hashtable symbolTable) - { - // Distinguish "string" because the name could be something like: - // string(25 + 1) - SymtabEntry entry = (SymtabEntry)symbolTable.get (name); - if (entry == null) - { - // If it is null then it may be of the form string(). - // Don't just check for string because the name "string" may - // have been overridden. - int parenIndex = name.indexOf ('('); - if (parenIndex >= 0) - entry = (SymtabEntry)symbolTable.get (name.substring (0, parenIndex)); - } - return entry == null ? false : entry instanceof PrimitiveEntry; - } // isPrimitive - - public static boolean isSequence (String name, Hashtable symbolTable) - { - SymtabEntry entry = (SymtabEntry)symbolTable.get (name); - return entry == null ? false : entry instanceof SequenceEntry; - } // isSequence - - public static boolean isStruct (String name, Hashtable symbolTable) - { - SymtabEntry entry = (SymtabEntry)symbolTable.get (name); - return entry == null ? false : entry instanceof StructEntry; - } // isStruct - - public static boolean isString (String name, Hashtable symbolTable) - { - SymtabEntry entry = (SymtabEntry)symbolTable.get (name); - return entry == null ? false : entry instanceof StringEntry; - } // isString - - public static boolean isTypedef (String name, Hashtable symbolTable) - { - SymtabEntry entry = (SymtabEntry)symbolTable.get (name); - return entry == null ? false : entry instanceof TypedefEntry; - } // isTypedef - - public static boolean isUnion (String name, Hashtable symbolTable) - { - SymtabEntry entry = (SymtabEntry)symbolTable.get (name); - return entry == null ? false : entry instanceof UnionEntry; - } // isUnion - - ////////////// - // Message-related methods - - public static String getMessage (String key) - { - if (messages == null) - readMessages (); - String message = messages.getProperty (key); - if (message == null) - message = getDefaultMessage (key); - return message; - } // getMessage - - public static String getMessage (String key, String fill) - { - if (messages == null) - readMessages (); - String message = messages.getProperty (key); - if (message == null) - message = getDefaultMessage (key); - else - { - int index = message.indexOf ("%0"); - if (index >= 0) - message = message.substring (0, index) + fill + message.substring (index + 2); - } - return message; - } // getMessage - - public static String getMessage (String key, String[] fill) - { - if (messages == null) - readMessages (); - String message = messages.getProperty (key); - if (message == null) - message = getDefaultMessage (key); - else - for (int i = 0; i < fill.length; ++i) - { - int index = message.indexOf ("%" + i); - if (index >= 0) - message = message.substring (0, index) + fill[i] + message.substring (index + 2); - } - return message; - } // getMessage - - private static String getDefaultMessage (String keyNotFound) - { - String message = messages.getProperty (defaultKey); - int index = message.indexOf ("%0"); - if (index > 0) - message = message.substring (0, index) + keyNotFound; - return message; - } // getDefaultMessage - - /* - findFile is no longer used now that FileLocator has been provided - by Larry Raper of the Shasta team. - - static File findFile (String name) throws FileNotFoundException - { - String classpath = System.getProperty ("java.class.path"); - String separator = System.getProperty ("path.separator"); - int end = -separator.length (); // so the first pass classpath == original classpath - File file; - do - { - classpath = classpath.substring (end + separator.length ()); - end = classpath.indexOf (separator); - if (end < 0) end = classpath.length (); - file = new File (classpath.substring (0, end) + File.separator + "com" + File.separator + "ibm" + File.separator + "idl" + File.separator + name); - } while (!file.exists () && end != classpath.length ()); - if (!file.exists ()) throw new FileNotFoundException (); - return file; - } // findFile - */ - - private static void readMessages () - { - messages = new Properties (); - Enumeration fileList = msgFiles.elements (); - DataInputStream stream; - while (fileList.hasMoreElements ()) - try - { - stream = FileLocator.locateLocaleSpecificFileInClassPath ((String)fileList.nextElement ()); - messages.load (stream); - } - catch (IOException e) - { - } - if (messages.size () == 0) - messages.put (defaultKey, "Error reading Messages File."); - } // readMessages - - /** Register a message file. This file will be searched for - in the CLASSPATH. */ - public static void registerMessageFile (String filename) - { - if (filename != null) - if (messages == null) - msgFiles.addElement (filename); - else - try - { - DataInputStream stream = FileLocator.locateLocaleSpecificFileInClassPath (filename); - messages.load (stream); - } - catch (IOException e) - { - } - } // registerMessageFile - - private static Properties messages = null; - private static String defaultKey = "default"; - private static Vector msgFiles = new Vector (); - static - { - msgFiles.addElement ("com/sun/tools/corba/se/idl/idl.prp"); - } - - // Message-related methods - /////////////// - - public static String capitalize (String lc) - { - String first = new String (lc.substring (0, 1)); - first = first.toUpperCase (); - return first + lc.substring (1); - } // capitalize - - /////////////// - // General file methods - - /** Searches the current user directory and a list of directories for - a given short file name and returns its absolute file specification. - @return Absolute file name of a given short filename - @throws FileNotFoundException The file does not exist in the - current user or specified directories. - @see java.io.File.getAbsolutePath */ - public static String getAbsolutePath (String filename, Vector includePaths) throws FileNotFoundException - { - String filepath = null; - File file = new File (filename); - if (file.canRead ()) - filepath = file.getAbsolutePath (); - else - { - String fullname = null; - Enumeration pathList = includePaths.elements (); - while (!file.canRead () && pathList.hasMoreElements ()) - { - fullname = (String)pathList.nextElement () + File.separatorChar + filename; - file = new File (fullname); - } - if (file.canRead ()) - filepath = file.getPath (); - else - throw new FileNotFoundException (filename); - } - return filepath; - } // getAbsolutePath - - // General file methods - /////////////// - - /////////////// - // Numeric computations - - // - /** - * Compute the absolute value of the difference between two floating-point - * numbers having single precision. - * @return the absolute value of the difference between two floats. - **/ - public static float absDelta (float f1, float f2) - { - double delta = f1 - f2; - return (float)((delta < 0) ? delta * -1.0 : delta); - } // absDelta - - // Numeric computations - /////////////// - - static RepositoryID emptyID = new RepositoryID (); -} // class Util diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ValueBoxEntry.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ValueBoxEntry.java deleted file mode 100644 index 9a231e42391..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ValueBoxEntry.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -/** - * This is the symbol table entry for valuesBoxes. - **/ -public class ValueBoxEntry extends ValueEntry -{ - protected ValueBoxEntry () - { - super (); - } // ctor - - protected ValueBoxEntry (ValueBoxEntry that) - { - super (that); - } // ctor - - protected ValueBoxEntry (SymtabEntry that, IDLID clone) - { - super (that, clone); - } // ctor - - public Object clone () - { - return new ValueBoxEntry (this); - } // clone - - /** Invoke the interface generator. - @param symbolTable the symbol table is a hash table whose key is a fully - qualified type name and whose value is a SymtabEntry or a subclass of - SymtabEntry. - @param stream the stream to which the generator should sent its output. - @see SymtabEntry */ - public void generate (Hashtable symbolTable, PrintWriter stream) - { - valueBoxGen.generate (symbolTable, this, stream); - } // generate - - /** Access the value generator. - @return an object which implements the ValueGen interface. - @see ValueGen */ - public Generator generator () - { - return valueBoxGen; - } // generator - - static ValueBoxGen valueBoxGen; -} // class ValueEntry diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ValueBoxGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ValueBoxGen.java deleted file mode 100644 index e8317b06f9d..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ValueBoxGen.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; -import com.sun.tools.corba.se.idl.*; - -public interface ValueBoxGen extends Generator -{ - void generate (Hashtable symbolTable, ValueBoxEntry entry, PrintWriter stream); -} // interface ValueBoxGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ValueEntry.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ValueEntry.java deleted file mode 100644 index 093ee990c43..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ValueEntry.java +++ /dev/null @@ -1,414 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Vector; -import com.sun.tools.corba.se.idl.constExpr.Expression; -// import com.sun.tools.corba.se.idl.som.idlemit.TypeCode; - -/** -* This is the symbol table entry for values. -**/ -public class ValueEntry extends InterfaceEntry -{ - protected ValueEntry () - { - super (); - } // ctor - - protected ValueEntry (ValueEntry that) - { - super (that); - _supportsNames = (Vector)that._supportsNames.clone (); - _supports = (Vector)that._supports.clone (); - _initializers = (Vector)that._initializers.clone (); - _custom = that._custom; - _isSafe = that._isSafe; - } // ctor - - protected ValueEntry (SymtabEntry that, IDLID clone) - { - super (that, clone); - } // ctor - - public Object clone () - { - return new ValueEntry (this); - } // clone - - /** Invoke the interface generator. - @param symbolTable The symbol table is a hash table whose key is - a fully qualified type name and whose value is a SymtabEntry or - a subclass of SymtabEntry. - @param stream The stream to which the generator should sent its output. - @see SymtabEntry */ - public void generate (Hashtable symbolTable, PrintWriter stream) - { - valueGen.generate (symbolTable, this, stream); - } // generate - - /** Access the value generator. - @return an object which implements the ValueGen interface. - @see ValueGen */ - public Generator generator () - { - return valueGen; - } // generator - - /** Add an InterfaceEntry to the list of interfaces which this value - supports. During parsing, the parameter to this method COULD be a - ForwardEntry, but when parsing is complete, calling supports will - return a vector which only contains InterfaceEntry's. */ - public void addSupport (SymtabEntry supports) - { - _supports.addElement (supports); - } // addSupport - - /** This method returns a vector of InterfaceEntry's. */ - public Vector supports () - { - return _supports; - } // supports - - /** Add to the list of support names. */ - public void addSupportName (String name) - { - _supportsNames.addElement (name); - } // addSupportName - - /** This method returns a vector of Strings, each of which is a fully - qualified name of an interface. This vector corresponds to the - supports vector. The first element of this vector is the name of - the first element of the supports vector, etc. */ - public Vector supportsNames () - { - return _supportsNames; - } // supportsNames - - /** Add a parent value type to the list of parent types for the value. - This method: -
              -
            • Allows only the first added class to be concrete if the receiver is - concrete. -
            • Does not allow any added classes to be concrete if the receiver is - abstract. -
            • Does not allow duplicate classes to be added. -
            */ - void derivedFromAddElement (SymtabEntry e, boolean isSafe, Scanner scanner) - { - if (((InterfaceType)e).getInterfaceType() != InterfaceType.ABSTRACT) { - if (isAbstract ()) - ParseException.nonAbstractParent2 (scanner, fullName (), e.fullName ()); - else if (derivedFrom ().size () > 0) - ParseException.nonAbstractParent3 (scanner, fullName (), e.fullName ()); - } - - if (derivedFrom ().contains (e)) - ParseException.alreadyDerived (scanner, e.fullName (), fullName ()); - - if (isSafe) - _isSafe = true; - - addDerivedFrom (e); - addDerivedFromName (e.fullName ()); - addParentType (e, scanner); - } // derivedFromAddElement - - void derivedFromAddElement (SymtabEntry e, Scanner scanner) - { - // This code must check for duplicate interfaces being supported... - addSupport (e); - addSupportName (e.fullName ()); - addParentType (e, scanner); - } // derivedFromAddElement - - public boolean replaceForwardDecl (ForwardEntry oldEntry, InterfaceEntry newEntry) - { - if (super.replaceForwardDecl (oldEntry, newEntry)) - return true; - int index = _supports.indexOf (oldEntry); - if ( index >= 0) - _supports.setElementAt (newEntry, index); - return (index >= 0); - } - - void initializersAddElement (MethodEntry method, Scanner scanner) - { - // Check to see if the parameter signature is a duplicate: - Vector params = method.parameters (); - int args = params.size (); - for (Enumeration e = _initializers.elements (); e.hasMoreElements ();) - { - Vector params2 = ( (MethodEntry) e.nextElement ()).parameters (); - if (args == params2.size ()) - { - int i = 0; - for (; i < args; i++) - if (!((ParameterEntry)params.elementAt (i)).type ().equals ( - ((ParameterEntry)params2.elementAt (i)).type ())) - break; - if (i >= args) - ParseException.duplicateInit (scanner); - } - } - _initializers.addElement (method); - } // initializersAddElement - - public Vector initializers () - { - return _initializers; - } - - /** Tag all methods introduced by the value type as 'value methods' so - they can be differentiated in the emitters from any interface methods - that the value type supports. */ - public void tagMethods () - { - for (Enumeration e = methods ().elements (); e.hasMoreElements ();) - ((MethodEntry)e.nextElement ()).valueMethod (true); - } - - // <46082.03> Revert to "IDL:"-style (i.e., regular) repository ID. - - /** Calculate the 'repository ID' for the value. This method should not be - called before the complete value type has been parsed, since it computes - the repository ID by computing hashcodes using all information contained - in the value type definition, not just the value type's fully qualified - name.*/ - /* - public void calcRepId () - { - ValueRepositoryId repId = new ValueRepositoryId (); - repId.addType (this); - calcRepId (repId); - String scopedName = fullName (); - // KLR - following switched to new format 8/26/98 per Simon's request - repositoryID (new RepositoryID ( "H:" + repId.getHashcode() + ":" + scopedName)); - } // calcRepId - */ - - /* - public void calcRepId (ValueRepositoryId repId) - { - Vector baseClasses = derivedFrom (); - if (baseClasses.size () >= 1) - ((ValueEntry)baseClasses.elementAt (0)).calcRepId (repId); - Vector state = state (); - if (state != null) - for (Enumeration e = state.elements (); e.hasMoreElements ();) - calcTypedefType (((InterfaceState)e.nextElement ()).entry, repId); - } // calcRepId - - private void calcValueType (ValueEntry entry, ValueRepositoryId repId) - { - if (repId.isNewType (entry)) - { - // repId.addValue (TypeCode.tk_value); - repId.addValue (org.omg.CORBA.TCKind._tk_value); - entry.calcRepId (repId); - } - } // calcValueType - - private void calcValueBoxType (ValueBoxEntry entry, ValueRepositoryId repId) - { - if (repId.isNewType (entry)) - { - // repId.addValue (TypeCode.tk_value_box); - repId.addValue (org.omg.CORBA.TCKind._tk_value_box); - entry.calcRepId (repId); - } - } // calcValueBoxType - - private void calcTypedefType (TypedefEntry entry, ValueRepositoryId repId) - { - if (repId.isNewType (entry)) - { - Vector arrayInfo = entry.arrayInfo (); - if (arrayInfo.size () > 0) - { - // repId.addValue (TypeCode.tk_array); - repId.addValue (org.omg.CORBA.TCKind._tk_array); - for (Enumeration e = arrayInfo.elements (); e.hasMoreElements ();) - repId.addValue (((Number)((Expression)e.nextElement ()).value ()).intValue ()); - } - calcType (entry.type (), repId); - } - } // calcTypedefType - - private void calcType (SymtabEntry entry, ValueRepositoryId repId) - { - if (entry instanceof TypedefEntry) - calcTypedefType ((TypedefEntry)entry, repId); - else if (entry instanceof PrimitiveEntry) - calcPrimitiveType (entry, repId); - else if (entry instanceof InterfaceEntry) - // repId.addValue (TypeCode._tk_objref); - repId.addValue (org.omg.CORBA.TCKind._tk_objref); - else if (entry instanceof EnumEntry) - // repId.addValue (TypeCode._tk_enum); - repId.addValue (org.omg.CORBA.TCKind._tk_enum); - else if (entry instanceof StringEntry) - calcStringType ( (StringEntry) entry, repId); - else if (entry instanceof SequenceEntry) - calcSequenceType ( (SequenceEntry) entry, repId); - else if (entry instanceof StructEntry) - calcStructType ( (StructEntry) entry, repId); - else if (entry instanceof UnionEntry) - calcUnionType ( (UnionEntry) entry, repId); - else if (entry instanceof ValueBoxEntry) - calcValueBoxType ( (ValueBoxEntry) entry, repId); - else if (entry instanceof ValueEntry) - calcValueType ( (ValueEntry) entry, repId); - } // calcType - - private static Hashtable primTypes; - - private void calcPrimitiveType (SymtabEntry entry, ValueRepositoryId repId) - { - if (primTypes == null) - { - primTypes = new Hashtable (); - // primTypes.put ("short", new Integer (TypeCode.tk_short )); - primTypes.put ("short", new Integer (org.omg.CORBA.TCKind._tk_short )); - // primTypes.put ("long", new Integer (TypeCode.tk_long )); - primTypes.put ("long", new Integer (org.omg.CORBA.TCKind._tk_long )); - // primTypes.put ("unsigned short", new Integer (TypeCode.tk_ushort )); - primTypes.put ("unsigned short", new Integer (org.omg.CORBA.TCKind._tk_ushort )); - // primTypes.put ("unsigned long", new Integer (TypeCode.tk_ulong )); - primTypes.put ("unsigned long", new Integer (org.omg.CORBA.TCKind._tk_ulong )); - // primTypes.put ("char", new Integer (TypeCode.tk_char )); - primTypes.put ("char", new Integer (org.omg.CORBA.TCKind._tk_char )); - // primTypes.put ("wchar", new Integer (TypeCode.tk_wchar )); - primTypes.put ("wchar", new Integer (org.omg.CORBA.TCKind._tk_wchar )); - // primTypes.put ("float", new Integer (TypeCode.tk_float )); - primTypes.put ("float", new Integer (org.omg.CORBA.TCKind._tk_float )); - // primTypes.put ("double", new Integer (TypeCode.tk_double )); - primTypes.put ("double", new Integer (org.omg.CORBA.TCKind._tk_double )); - // primTypes.put ("boolean", new Integer (TypeCode.tk_boolean)); - primTypes.put ("boolean", new Integer (org.omg.CORBA.TCKind._tk_boolean)); - // primTypes.put ("octet", new Integer (TypeCode.tk_octet )); - primTypes.put ("octet", new Integer (org.omg.CORBA.TCKind._tk_octet )); - // primTypes.put ("any", new Integer (TypeCode.tk_any )); } - primTypes.put ("any", new Integer (org.omg.CORBA.TCKind._tk_any )); - } - repId.addValue (((Integer)primTypes.get (entry.name ())).intValue ()); - } // calcPrimitiveType - - private void calcStringType (StringEntry entry, ValueRepositoryId repId) - { - repId.addValue (entry.name ().equals (Parser.overrideName ("string")) ? - // TypeCode.tk_string: - org.omg.CORBA.TCKind._tk_string : - // TypeCode.tk_wstring); - org.omg.CORBA.TCKind._tk_wstring); - if (entry.maxSize () != null) - try - { - repId.addValue ( ( (Number) (entry.maxSize ()).value ()). intValue ()); - } - catch (Exception exception) - {} - } // calcStringType - - private void calcSequenceType (SequenceEntry entry, ValueRepositoryId repId) - { - // repId.addValue (TypeCode.tk_sequence); - repId.addValue (org.omg.CORBA.TCKind._tk_sequence); - if (entry.maxSize () != null) - try - { - repId.addValue (((Number)(entry.maxSize ()).value ()).intValue ()); - } - catch (Exception exception) - {} - } // calcSequenceType - - private void calcStructType (StructEntry entry, ValueRepositoryId repId) - { - if (repId.isNewType (entry)) - { - // repId.addValue (TypeCode.tk_struct); - repId.addValue (org.omg.CORBA.TCKind._tk_struct); - for (Enumeration e = entry.members ().elements (); e.hasMoreElements ();) - calcTypedefType ( (TypedefEntry) e.nextElement (), repId); - } - } // calcStructType - - private void calcUnionType (UnionEntry entry, ValueRepositoryId repId) - { - if (repId.isNewType (entry)) - { - // repId.addValue (TypeCode.tk_union); - repId.addValue (org.omg.CORBA.TCKind._tk_union); - calcType (entry.type (), repId); - for (Enumeration e = entry.branches ().elements (); e.hasMoreElements ();) - calcTypedefType ( ( (UnionBranch) e.nextElement ()).typedef, repId); - } - } // calcUnionType -*/ - - /** Get the 'custom' marshaling property. */ - public boolean isCustom () - { - return _custom; - } - - /** Set the 'custom' marshaling property. */ - public void setCustom (boolean isCustom) - { - _custom = isCustom; - } - - /** Return whether or not the value type can be "safely" truncated to - its concrete parent type. */ - public boolean isSafe () - { - return _isSafe; - } - - private Vector _supportsNames = new Vector (); - private Vector _supports = new Vector (); - private Vector _initializers = new Vector (); - private boolean _custom = false; - private boolean _isSafe = false; - - static ValueGen valueGen; -} // class ValueEntry diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ValueGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ValueGen.java deleted file mode 100644 index 0af03985b87..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ValueGen.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; -import com.sun.tools.corba.se.idl.*; - -public interface ValueGen extends Generator { - void generate ( Hashtable symbolTable, ValueEntry entry, PrintWriter stream); -} // interface ValueGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ValueRepositoryId.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ValueRepositoryId.java deleted file mode 100644 index 0aaeb0d744a..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ValueRepositoryId.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl; - -// NOTES: - -import java.security.MessageDigest; -import java.util.Hashtable; - -/** - * - **/ -public class ValueRepositoryId -{ - private MessageDigest sha; // Message digest used to compute SHA-1 - private int index; // Current index in the 'logical' sequence - private Hashtable types; // Already processed types - private String hashcode; // The computed hashcode - - public ValueRepositoryId () - { - try - { - sha = MessageDigest.getInstance ("SHA-1"); - } - catch (Exception exception) - {} - index = 0; - types = new Hashtable (); - hashcode = null; - } // ctor - - /**Add a value to the hashcode being computed. - @param value the value to be added to the value RepositoryID. */ - public void addValue (int value) - { - sha.update ((byte)((value >> 24) & 0x0F)); - sha.update ((byte)((value >> 16) & 0x0F)); - sha.update ((byte)((value >> 8) & 0x0F)); - sha.update ((byte)(value & 0x0F)); - index++; - } // addValue - - /** Add a type to the list of types which have already been included. - Note that the type should be added prior to its value. - @param entry the type to be added to the value RepositoryID. */ - public void addType (SymtabEntry entry) - { - types.put (entry, new Integer (index)); - } - - /** Check to see if a specified type has already been processed. If so, - add the appropriate 'previously processed' code (0xFFFFFFFF) and - sequence offset, and return false; otherwise add the symbol table entry - and current offset to the hashtable and return false. - @param entry the type to be checked - @return true if the symbol table entry has not been previously added; - and false otherwise. */ - public boolean isNewType (SymtabEntry entry) - { - Object index = types.get (entry); - if (index == null) - { - addType (entry); - return true; - } - addValue (0xFFFFFFFF); - addValue (((Integer)index).intValue ()); - return false; - } // isNewType - - /** Get the hashcode computed for the value type. This method MUST not be - called until all fields have been added, since it computes the hash - code from the values entered for each field. - @return the 64 bit hashcode for the value type represented as a - 16 character hexadecimal string. */ - public String getHashcode () - { - if (hashcode == null) - { - byte [] digest = sha.digest (); - hashcode = hexOf (digest[0]) + hexOf (digest[1]) + - hexOf (digest[2]) + hexOf (digest[3]) + - hexOf (digest[4]) + hexOf (digest[5]) + - hexOf (digest[6]) + hexOf (digest[7]); - } - return hashcode; - } // getHashCode - - // Convert a byte to a two character hex string: - private static String hexOf (byte value) - { - int d1 = (value >> 4) & 0x0F; - int d2 = value & 0x0F; - return "0123456789ABCDEF".substring (d1, d1 + 1) + - "0123456789ABCDEF".substring (d2, d2 + 1); - } // hexOf -} // class ValueRepositoryId diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/And.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/And.java deleted file mode 100644 index d382eb73e3a..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/And.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import com.sun.tools.corba.se.idl.Util; -import java.math.BigInteger; - -public class And extends BinaryExpr -{ - protected And (Expression leftOperand, Expression rightOperand) - { - super ("&", leftOperand, rightOperand); - } // ctor - - public Object evaluate () throws EvaluationException - { - try - { - Number l = (Number)left ().evaluate (); - Number r = (Number)right ().evaluate (); - - if (l instanceof Float || l instanceof Double || r instanceof Float || r instanceof Double) - { - String[] parameters = {Util.getMessage ("EvaluationException.and"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - else - { - // Arithmetic and (&) - //daz value (new Long (l.longValue () & r.longValue ())); - BigInteger uL = (BigInteger)coerceToTarget ((BigInteger)l); - BigInteger uR = (BigInteger)coerceToTarget ((BigInteger)r); - value (uL.and (uR)); - } - } - catch (ClassCastException e) - { - String[] parameters = {Util.getMessage ("EvaluationException.and"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - return value (); - } // evaluate -} // class And diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/BinaryExpr.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/BinaryExpr.java deleted file mode 100644 index 4d4206a33bd..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/BinaryExpr.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import com.sun.tools.corba.se.idl.Util; -import java.math.BigInteger; - -public abstract class BinaryExpr extends Expression -{ - public BinaryExpr (String operation, Expression leftOperand, Expression rightOperand) - { - _op = operation; - _left = leftOperand; - _right = rightOperand; - } // ctor - - public void op (String op) {_op = (op == null)? "": op;} - public String op () {return _op;} - - public void left (Expression left) {_left = left;} - public Expression left () {return _left;} - - public void right (Expression right) {_right = right;} - public Expression right () {return _right;} - - private String _op = ""; - private Expression _left = null; - private Expression _right = null; -} // class BinaryExpr diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/BooleanAnd.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/BooleanAnd.java deleted file mode 100644 index 79b11f639d3..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/BooleanAnd.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import com.sun.tools.corba.se.idl.Util; -import java.math.BigInteger; - -public class BooleanAnd extends BinaryExpr -{ - protected BooleanAnd (Expression leftOperand, Expression rightOperand) - { - super ("&&", leftOperand, rightOperand); - } // ctor - - public Object evaluate () throws EvaluationException - { - try - { - Object tmpL = left ().evaluate (); - Object tmpR = right ().evaluate (); - Boolean l; - Boolean r; - - //daz if (tmpL instanceof Number) - // l = new Boolean (((Number)tmpL).longValue () != 0); - // else - // l = (Boolean)tmpL; - if (tmpL instanceof Number) - { - if (tmpL instanceof BigInteger) - l = new Boolean (((BigInteger)tmpL).compareTo (BigInteger.valueOf (0)) != 0); - else - l = new Boolean (((Number)tmpL).longValue () != 0); - } - else - l = (Boolean)tmpL; - //daz if (tmpR instanceof Number) - // r = new Boolean (((Number)tmpR).longValue () != 0); - // else - // r = (Boolean)tmpR; - if (tmpR instanceof Number) - { - if (tmpR instanceof BigInteger) - r = new Boolean (((BigInteger)tmpR).compareTo (zero) != 0); - else - r = new Boolean (((Number)tmpR).longValue () != 0); - } - else - r = (Boolean)tmpR; - - value (new Boolean (l.booleanValue () && r.booleanValue ())); - } - catch (ClassCastException e) - { - String[] parameters = {Util.getMessage ("EvaluationException.booleanAnd"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - return value (); - } // evaluate -} // class BooleanAnd diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/BooleanNot.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/BooleanNot.java deleted file mode 100644 index 5c15a445648..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/BooleanNot.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import com.sun.tools.corba.se.idl.Util; -import java.math.BigInteger; - -public class BooleanNot extends UnaryExpr -{ - protected BooleanNot (Expression operand) - { - super ("!", operand); - } // ctor - - public Object evaluate () throws EvaluationException - { - try - { - Object tmp = operand ().evaluate (); - Boolean op; - //daz if (tmp instanceof Number) - // op = new Boolean (((Number)tmp).longValue () != 0); - // else - // op = (Boolean)tmp; - if (tmp instanceof Number) - { - if (tmp instanceof BigInteger) - op = new Boolean (((BigInteger)tmp).compareTo (zero) != 0); - else - op = new Boolean (((Number)tmp).longValue () != 0); - } - else - op = (Boolean)tmp; - - value (new Boolean (!op.booleanValue ())); - } - catch (ClassCastException e) - { - String[] parameters = {Util.getMessage ("EvaluationException.booleanNot"), operand ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.2", parameters)); - } - return value (); - } // evaluate -} // class BooleanNot diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/BooleanOr.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/BooleanOr.java deleted file mode 100644 index d225e7528ea..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/BooleanOr.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import com.sun.tools.corba.se.idl.Util; -import java.math.BigInteger; - -public class BooleanOr extends BinaryExpr -{ - protected BooleanOr (Expression leftOperand, Expression rightOperand) - { - super ("||", leftOperand, rightOperand); - } // ctor - - public Object evaluate () throws EvaluationException - { - try - { - Object tmpL = left ().evaluate (); - Object tmpR = right ().evaluate (); - Boolean l; - Boolean r; - - //daz if (tmpL instanceof Number) - // l = new Boolean (((Number)tmpL).longValue () != 0); - // else - // l = (Boolean)tmpL; - if (tmpL instanceof Number) - { - if (tmpL instanceof BigInteger) - l = new Boolean (((BigInteger)tmpL).compareTo (zero) != 0); - else - l = new Boolean (((Number)tmpL).longValue () != 0); - } - else - l = (Boolean)tmpL; - //daz if (tmpR instanceof Number) - // r = new Boolean (((Number)tmpR).longValue () != 0); - // else - // r = (Boolean)tmpR; - if (tmpR instanceof Number) - { - if (tmpR instanceof BigInteger) - r = new Boolean (((BigInteger)tmpR).compareTo (BigInteger.valueOf (0)) != 0); - else - r = new Boolean (((Number)tmpR).longValue () != 0); - } - else - r = (Boolean)tmpR; - value (new Boolean (l.booleanValue () || r.booleanValue ())); - } - catch (ClassCastException e) - { - String[] parameters = {Util.getMessage ("EvaluationException.booleanOr"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - return value (); - } // evaluate -} // class BooleanOr diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/DefaultExprFactory.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/DefaultExprFactory.java deleted file mode 100644 index d6984c0eb7c..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/DefaultExprFactory.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import com.sun.tools.corba.se.idl.ConstEntry; -import java.math.BigInteger; - -public class DefaultExprFactory implements ExprFactory -{ - public And and (Expression left, Expression right) - { - return new And (left, right); - } // and - - public BooleanAnd booleanAnd (Expression left, Expression right) - { - return new BooleanAnd (left, right); - } // booleanAnd - - public BooleanNot booleanNot (Expression operand) - { - return new BooleanNot (operand); - } // booleanNot - - public BooleanOr booleanOr (Expression left, Expression right) - { - return new BooleanOr (left, right); - } // booleanOr - - public Divide divide (Expression left, Expression right) - { - return new Divide (left, right); - } // divide - - public Equal equal (Expression left, Expression right) - { - return new Equal (left, right); - } // equal - - public GreaterEqual greaterEqual (Expression left, Expression right) - { - return new GreaterEqual (left, right); - } // greaterEqual - - public GreaterThan greaterThan (Expression left, Expression right) - { - return new GreaterThan (left, right); - } // greaterThan - - public LessEqual lessEqual (Expression left, Expression right) - { - return new LessEqual (left, right); - } // lessEqual - - public LessThan lessThan (Expression left, Expression right) - { - return new LessThan (left, right); - } // lessThan - - public Minus minus (Expression left, Expression right) - { - return new Minus (left, right); - } // minus - - public Modulo modulo (Expression left, Expression right) - { - return new Modulo (left, right); - } // modulo - - public Negative negative (Expression operand) - { - return new Negative (operand); - } // negative - - public Not not (Expression operand) - { - return new Not (operand); - } // not - - public NotEqual notEqual (Expression left, Expression right) - { - return new NotEqual (left, right); - } // notEqual - - public Or or (Expression left, Expression right) - { - return new Or (left, right); - } // or - - public Plus plus (Expression left, Expression right) - { - return new Plus (left, right); - } // plus - - public Positive positive (Expression operand) - { - return new Positive (operand); - } // positive - - public ShiftLeft shiftLeft (Expression left, Expression right) - { - return new ShiftLeft (left, right); - } // shiftLeft - - public ShiftRight shiftRight (Expression left, Expression right) - { - return new ShiftRight (left, right); - } // shiftRight - - public Terminal terminal (String representation, Character charValue, - boolean isWide ) - { - return new Terminal (representation, charValue, isWide ); - } // ctor - - public Terminal terminal (String representation, Boolean booleanValue) - { - return new Terminal (representation, booleanValue); - } // ctor - - // Support long long - public Terminal terminal (String representation, BigInteger bigIntegerValue) - { - return new Terminal (representation, bigIntegerValue); - } // ctor - - //daz public Terminal terminal (String representation, Long longValue) - // { - // return new Terminal (representation, longValue); - // } // ctor - - public Terminal terminal (String representation, Double doubleValue) - { - return new Terminal (representation, doubleValue); - } // ctor - - public Terminal terminal (String stringValue, boolean isWide ) - { - return new Terminal (stringValue, isWide); - } // ctor - - public Terminal terminal (ConstEntry constReference) - { - return new Terminal (constReference); - } // ctor - - public Times times (Expression left, Expression right) - { - return new Times (left, right); - } // times - - public Xor xor (Expression left, Expression right) - { - return new Xor (left, right); - } // xor -} // class DefaultExprFactory diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Divide.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Divide.java deleted file mode 100644 index ab02e967ba7..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Divide.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: -// -D52042 Added protypical code for computing mixed-operand binary -// expressions, which promotes result to Double only when the target type -// is floating-point. Code violates spec, but may be usable at some future -// time. - -import com.sun.tools.corba.se.idl.Util; -import java.math.BigInteger; - -/** - * - **/ -public class Divide extends BinaryExpr -{ - /** - * Constructor: set operation and operands. - **/ - protected Divide (Expression leftOperand, Expression rightOperand) - { - super ("/", leftOperand, rightOperand); - } // ctor - - /** - * - **/ - public Object evaluate () throws EvaluationException - { - try - { - Number l = (Number)left ().evaluate (); - Number r = (Number)right ().evaluate (); - - boolean lIsNonInteger = l instanceof Float || l instanceof Double; - boolean rIsNonInteger = r instanceof Float || r instanceof Double; - - if (lIsNonInteger && rIsNonInteger) - value (new Double (l.doubleValue () / r.doubleValue ())); - else if (lIsNonInteger || rIsNonInteger) - { - String[] parameters = {Util.getMessage ("EvaluationException.divide"), - left ().value ().getClass ().getName (), - right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - else - { - BigInteger tmpL = (BigInteger)l, tmpR = (BigInteger)r; - value (tmpL.divide (tmpR)); - } - // Allow evaluation over mixed operands. Supplant code above. - /* - Number l = (Number)left ().evaluate (); - Number r = (Number)right ().evaluate (); - - boolean lIsNonInteger = l instanceof Float || l instanceof Double; - boolean rIsNonInteger = r instanceof Float || r instanceof Double; - - // Floating-point operands. - if (lIsNonInteger && rIsNonInteger) - { - value (new Double (l.doubleValue () / r.doubleValue ())); - } - // Integral operands. - else if (!(lIsNonInteger || rIsNonInteger)) - { - BigInteger tmpL = (BigInteger)l, tmpR = (BigInteger)r; - value (tmpL.divide (tmpR)); - } - // Mixed operands: one operand is floating-point, the other is integral. - else - { - // Legal over floating-point types only. - if (type ().equals ("float") || - type ().equals ("double")) - { - value (new Double (l.doubleValue () / r.doubleValue ())); - } - else - { - String[] parameters = {Util.getMessage ("EvaluationException.divide"), - left ().value ().getClass ().getName (), - right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - } - */ - } - catch (ClassCastException e) - { - String[] parameters = {Util.getMessage ("EvaluationException.divide"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - return value (); - } // evaluate -} // class Divide diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Equal.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Equal.java deleted file mode 100644 index c43c010c0cf..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Equal.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import com.sun.tools.corba.se.idl.Util; -import java.math.BigInteger; - -public class Equal extends BinaryExpr -{ - protected Equal (Expression leftOperand, Expression rightOperand) - { - super ("==", leftOperand, rightOperand); - } // ctor - - public Object evaluate () throws EvaluationException - { - try - { - Object left = left ().evaluate (); - if (left instanceof Boolean) - { - Boolean l = (Boolean)left; - Boolean r = (Boolean)right ().evaluate (); - value (new Boolean (l.booleanValue () == r.booleanValue())); - } - else - { - Number l = (Number)left; - Number r = (Number)right ().evaluate (); - if (l instanceof Float || l instanceof Double || r instanceof Float || r instanceof Double) - value (new Boolean (l.doubleValue () == r.doubleValue ())); - else - //daz value (new Boolean (l.longValue () == r.longValue ())); - value (new Boolean (((BigInteger)l).equals ((BigInteger)r))); - } - } - catch (ClassCastException e) - { - String[] parameters = {Util.getMessage ("EvaluationException.equal"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - return value (); - } // evaluate -} // class Equal diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/EvaluationException.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/EvaluationException.java deleted file mode 100644 index c04fa34594b..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/EvaluationException.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -public class EvaluationException extends Exception -{ - public EvaluationException (String message) - { - super (message); - } // ctor -} // class EvaluationException diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/ExprFactory.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/ExprFactory.java deleted file mode 100644 index f017a644075..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/ExprFactory.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import com.sun.tools.corba.se.idl.ConstEntry; -import java.math.BigInteger; - -public interface ExprFactory -{ - And and (Expression left, Expression right); - BooleanAnd booleanAnd (Expression left, Expression right); - BooleanNot booleanNot (Expression operand); - BooleanOr booleanOr (Expression left, Expression right); - Divide divide (Expression left, Expression right); - Equal equal (Expression left, Expression right); - GreaterEqual greaterEqual (Expression left, Expression right); - GreaterThan greaterThan (Expression left, Expression right); - LessEqual lessEqual (Expression left, Expression right); - LessThan lessThan (Expression left, Expression right); - Minus minus (Expression left, Expression right); - Modulo modulo (Expression left, Expression right); - Negative negative (Expression operand); - Not not (Expression operand); - NotEqual notEqual (Expression left, Expression right); - Or or (Expression left, Expression right); - Plus plus (Expression left, Expression right); - Positive positive (Expression operand); - ShiftLeft shiftLeft (Expression left, Expression right); - ShiftRight shiftRight (Expression left, Expression right); - Terminal terminal (String representation, Character charValue, - boolean isWide ); - Terminal terminal (String representation, Boolean booleanValue); - //daz Terminal terminal (String representation, Long longValue); - Terminal terminal (String representation, Double doubleValue); - Terminal terminal (String representation, BigInteger bigIntegerValue); - Terminal terminal (String stringValue, boolean isWide ); - Terminal terminal (ConstEntry constReference); - Times times (Expression left, Expression right); - Xor xor (Expression left, Expression right); -} // interface ExprFactory diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Expression.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Expression.java deleted file mode 100644 index 84a1873609d..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Expression.java +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import java.math.BigInteger; - -public abstract class Expression -{ - /** - * Compute the value of this expression. - **/ - public abstract Object evaluate () throws EvaluationException; - - /** - * Set the value of this expression. - **/ - public void value (Object value) - { - _value = value; - } - /** - * Get the value of this expression. - **/ - public Object value () - { - return _value; - } - - /** - * Set the representation of this expression. - **/ - public void rep (String rep) - { - _rep = rep; - } - /** - * Get the representation of this expression. - **/ - public String rep () - { - return _rep; - } - - /** - * Set the target type of this expression. - **/ - public void type (String type) - { - _type = type; - } - /** - * Get the target type of this expression. - **/ - public String type () - { - return _type; - } - - /** - * Return the default computation type for the given target type. - **/ - protected static String defaultType (String targetType) - { - return (targetType == null) ? new String ("") : targetType; - } // defaultType - - // BigInteger is a multi-precision number whose representation contains - // a signum (sign-number = 1, -1) and a magnitude. To support "long long", - // all integer expressions are now performed over BigInteger and stored as - // such. During the evaluation of an integer expression, the signum of its - // value may toggle, which may cause the value of an expression to conflict - // with its target type: [Case 1] If the resulting value is negative - // (signum=-1) and the target type is unsigned; or [Case 2] if the resulting - // value is positive (signum=1) and greater than 2**(target-type-length - 1), - // and the target type is signed, then the resulting value will be out of - // range. However, this value is correct and must be coerced to the target - // type. E.G., After appying "not" to a BigInteger, the result is - // a BigInteger that represents its 2's-complement (~5 => -6 in a byte-space). - // In this example, the signum toggles and the magnatude is 6. If the target - // type of this value were unsigned short, it must be coerced to a positive - // number whose bits truly represent -6 in 2's-complement (250 in a byte-space). - // - // Also, floating types may now be intialized with any integer expression. - // The result must be coerced to Double. - // - // Use the following routines to coerce this expression's value to its - // "target" type. - - /** - * Coerces a number to the target type of this expression. - * @param obj The number to coerce. - * @return the value of number coerced to the (target) type of - * this expression. - **/ - public Object coerceToTarget (Object obj) - { - if (obj instanceof BigInteger) - { - if (type ().indexOf ("unsigned") >= 0) - return toUnsignedTarget ((BigInteger)obj); - else - return toSignedTarget ((BigInteger)obj); - } - return obj; - } // coerceToTarget - - /** - * Coerces an integral value (BigInteger) to its corresponding unsigned - * representation, if the target type of this expression is unsigned. - * @param b The BigInteger to be coerced. - * @return the value of an integral type coerced to its corresponding - * unsigned integral type, if the target type of this expression is - * unsigned. - **/ - protected BigInteger toUnsignedTarget (BigInteger b) - { - if (type ().equals ("unsigned short")) // target type of this expression - { - if (b != null && b.compareTo (zero) < 0) // error if value < min = -(2**(l-1)). - return b.add (twoPow16); - } - else if (type ().equals ("unsigned long")) - { - if (b != null && b.compareTo (zero) < 0) - return b.add (twoPow32); - } - else if (type ().equals ("unsigned long long")) - { - if (b != null && b.compareTo (zero) < 0) - return b.add (twoPow64); - } - return b; - } // toUnsignedTarget - - /** - * Coerces an integral value (BigInteger) to its corresponding signed - * representation, if the target type of this expression is signed. - * @param b The BigInteger to be coerced. - * @return the value of an integral type coerced to its corresponding - * signed integral type, if the target type of this expression is - * signed. - **/ - protected BigInteger toSignedTarget (BigInteger b) - { - if (type ().equals ("short")) - { - if (b != null && b.compareTo (sMax) > 0) - return b.subtract (twoPow16); - } - else if (type ().equals ("long")) - { - if (b != null && b.compareTo (lMax) > 0) - return b.subtract (twoPow32); - } - else if (type ().equals ("long long")) - { - if (b != null && b.compareTo (llMax) > 0) - return b.subtract (twoPow64); - } - return b; - } // toSignedTarget - - /** - * Return the unsigned value of a BigInteger. - **/ - protected BigInteger toUnsigned (BigInteger b) - { - if (b != null && b.signum () == -1) - if (type ().equals ("short")) - return b.add (twoPow16); - else if (type ().equals ("long")) - return b.add (twoPow32); - else if (type ().equals ("long long")) - return b.add (twoPow64); - return b; - } - - // Integral-type boundaries. - - public static final BigInteger negOne = BigInteger.valueOf (-1); - public static final BigInteger zero = BigInteger.valueOf (0); - public static final BigInteger one = BigInteger.valueOf (1); - public static final BigInteger two = BigInteger.valueOf (2); - - public static final BigInteger twoPow15 = two.pow (15); - public static final BigInteger twoPow16 = two.pow (16); - public static final BigInteger twoPow31 = two.pow (31); - public static final BigInteger twoPow32 = two.pow (32); - public static final BigInteger twoPow63 = two.pow (63); - public static final BigInteger twoPow64 = two.pow (64); - - public static final BigInteger sMax = BigInteger.valueOf (Short.MAX_VALUE); - public static final BigInteger sMin = BigInteger.valueOf (Short.MAX_VALUE); - - public static final BigInteger usMax = sMax.multiply (two).add (one); - public static final BigInteger usMin = zero; - - public static final BigInteger lMax = BigInteger.valueOf (Integer.MAX_VALUE); - public static final BigInteger lMin = BigInteger.valueOf (Integer.MAX_VALUE); - - public static final BigInteger ulMax = lMax.multiply (two).add (one); - public static final BigInteger ulMin = zero; - - public static final BigInteger llMax = BigInteger.valueOf (Long.MAX_VALUE); - public static final BigInteger llMin = BigInteger.valueOf (Long.MIN_VALUE); - - public static final BigInteger ullMax = llMax.multiply (two).add (one); - public static final BigInteger ullMin = zero; - - /** - * Value of this expression: Boolean, Char, Byte, BigInteger, Double, - * String, Expression, ConstEntry. - **/ - private Object _value = null; - /** - * String representation of this expression. - **/ - private String _rep = null; - /** - * Computation type of this (sub)expression = Target type for now. - **/ - private String _type = null; -} // abstract class Expression diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/GreaterEqual.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/GreaterEqual.java deleted file mode 100644 index 729eb6df6a5..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/GreaterEqual.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import com.sun.tools.corba.se.idl.Util; -import java.math.BigInteger; - -public class GreaterEqual extends BinaryExpr -{ - protected GreaterEqual (Expression leftOperand, Expression rightOperand) - { - super (">=", leftOperand, rightOperand); - } // ctor - - public Object evaluate () throws EvaluationException - { - try - { - Object left = left ().evaluate (); - Object right = right ().evaluate (); - if (left instanceof Boolean) - { - String[] parameters = {Util.getMessage ("EvaluationException.greaterEqual"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - else - { - Number l = (Number)left; - Number r = (Number)right ().evaluate (); - if (l instanceof Float || l instanceof Double || r instanceof Float || r instanceof Double) - value (new Boolean (l.doubleValue () >= r.doubleValue ())); - else - //daz value (new Boolean (l.longValue () >= r.longValue ())); - value (new Boolean ( ((BigInteger)l).compareTo ((BigInteger)r) >= 0)); - } - } - catch (ClassCastException e) - { - String[] parameters = {Util.getMessage ("EvaluationException.greaterEqual"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - return value (); - } // evaluate -} // class GreaterEqual diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/GreaterThan.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/GreaterThan.java deleted file mode 100644 index bcc2b19d288..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/GreaterThan.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import com.sun.tools.corba.se.idl.Util; -import java.math.BigInteger; - -public class GreaterThan extends BinaryExpr -{ - protected GreaterThan (Expression leftOperand, Expression rightOperand) - { - super (">", leftOperand, rightOperand); - } // ctor - - public Object evaluate () throws EvaluationException - { - try - { - Object left = left ().evaluate (); - Object right = right ().evaluate (); - if (left instanceof Boolean) - { - String[] parameters = {Util.getMessage ("EvaluationException.greaterThan"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - else - { - Number l = (Number)left; - Number r = (Number)right ().evaluate (); - if (l instanceof Float || l instanceof Double || r instanceof Float || r instanceof Double) - value (new Boolean (l.doubleValue () > r.doubleValue ())); - else - //daz value (new Boolean (l.longValue () > r.longValue ())); - value (new Boolean ( ((BigInteger)l).compareTo ((BigInteger)r) > 0)); - } - } - catch (ClassCastException e) - { - String[] parameters = {Util.getMessage ("EvaluationException.greaterThan"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - return value (); - } // evaluate -} // class GreaterThan diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/LessEqual.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/LessEqual.java deleted file mode 100644 index 6d4f305a0aa..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/LessEqual.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import com.sun.tools.corba.se.idl.Util; -import java.math.BigInteger; - -public class LessEqual extends BinaryExpr -{ - protected LessEqual (Expression leftOperand, Expression rightOperand) - { - super ("<=", leftOperand, rightOperand); - } // ctor - - public Object evaluate () throws EvaluationException - { - try - { - Object left = left ().evaluate (); - Object right = right ().evaluate (); - if (left instanceof Boolean) - { - String[] parameters = {Util.getMessage ("EvaluationException.lessEqual"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - else - { - Number l = (Number)left; - Number r = (Number)right ().evaluate (); - if (l instanceof Float || l instanceof Double || r instanceof Float || r instanceof Double) - value (new Boolean (l.doubleValue () <= r.doubleValue ())); - else - //daz value (new Boolean (l.longValue () <= r.longValue ())); - value (new Boolean ( ((BigInteger)l).compareTo ((BigInteger)r) <= 0)); - } - } - catch (ClassCastException e) - { - String[] parameters = {Util.getMessage ("EvaluationException.lessEqual"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - return value (); - } // evaluate -} // class LessEqual diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/LessThan.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/LessThan.java deleted file mode 100644 index 40eed045789..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/LessThan.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import com.sun.tools.corba.se.idl.Util; -import java.math.BigInteger; - -public class LessThan extends BinaryExpr -{ - protected LessThan (Expression leftOperand, Expression rightOperand) - { - super ("<", leftOperand, rightOperand); - } // ctor - - public Object evaluate () throws EvaluationException - { - try - { - Object left = left ().evaluate (); - Object right = right ().evaluate (); - if (left instanceof Boolean) - { - String[] parameters = {Util.getMessage ("EvaluationException.lessThan"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - else - { - Number l = (Number)left; - Number r = (Number)right ().evaluate (); - if (l instanceof Float || l instanceof Double || r instanceof Float || r instanceof Double) - value (new Boolean (l.doubleValue () < r.doubleValue ())); - else - //daz value (new Boolean (l.longValue () < r.longValue ())); - value (new Boolean (((BigInteger)l).compareTo ((BigInteger)r) < 0)); - } - } - catch (ClassCastException e) - { - String[] parameters = {Util.getMessage ("EvaluationException.lessThan"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - return value (); - } // evaluate -} // class LessThan diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Minus.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Minus.java deleted file mode 100644 index 6c5af1a70d2..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Minus.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import com.sun.tools.corba.se.idl.Util; -import java.math.BigInteger; - -public class Minus extends BinaryExpr -{ - protected Minus (Expression leftOperand, Expression rightOperand) - { - super ("-", leftOperand, rightOperand); - } // ctor - - public Object evaluate () throws EvaluationException - { - try - { - Number l = (Number)left ().evaluate (); - Number r = (Number)right ().evaluate (); - - boolean lIsNonInteger = l instanceof Float || l instanceof Double; - boolean rIsNonInteger = r instanceof Float || r instanceof Double; - - if (lIsNonInteger && rIsNonInteger) - value (new Double (l.doubleValue () - r.doubleValue ())); - else if (lIsNonInteger || rIsNonInteger) - { - String[] parameters = {Util.getMessage ("EvaluationException.minus"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - else - { - // Subtraction (-) - BigInteger tmpL = (BigInteger)l, tmpR = (BigInteger)r; - value (tmpL.subtract (tmpR)); - //daz value (new Long (l.longValue () - r.longValue ())); - } - } - catch (ClassCastException e) - { - String[] parameters = {Util.getMessage ("EvaluationException.minus"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - return value (); - } // evaluate -} // class Minus diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Modulo.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Modulo.java deleted file mode 100644 index 53b2eef2d56..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Modulo.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import com.sun.tools.corba.se.idl.Util; -import java.math.BigInteger; - -public class Modulo extends BinaryExpr -{ - protected Modulo (Expression leftOperand, Expression rightOperand) - { - super ("%", leftOperand, rightOperand); - } // ctor - - public Object evaluate () throws EvaluationException - { - try - { - Number l = (Number)left ().evaluate (); - Number r = (Number)right ().evaluate (); - - if (l instanceof Float || l instanceof Double || r instanceof Float || r instanceof Double) - { - String[] parameters = {Util.getMessage ("EvaluationException.mod"), left().value ().getClass ().getName (), right().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - else - { - // Modulo (%) - BigInteger tmpL = (BigInteger)l, tmpR = (BigInteger)r; - value (tmpL.remainder (tmpR)); - //daz value (tmpL.mod (tmpR)); Requires positive modulus; not required by IDL. - //daz value (new Long (l.longValue () % r.longValue ())); - } - } - catch (ClassCastException e) - { - String[] parameters = {Util.getMessage ("EvaluationException.mod"), left().value ().getClass ().getName (), right().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - return value (); - } // evaluate -} // class Modulo diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Negative.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Negative.java deleted file mode 100644 index 1cc949106ac..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Negative.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import com.sun.tools.corba.se.idl.Util; -import java.math.BigInteger; - -public class Negative extends UnaryExpr -{ - protected Negative (Expression operand) - { - super ("-", operand); - } // ctor - - public Object evaluate () throws EvaluationException - { - try - { - Number op = (Number)operand ().evaluate (); - - if (op instanceof Float || op instanceof Double) - value (new Double (-op.doubleValue ())); - else - { - // Multiply by -1 - //daz value (new Long (-op.longValue ())); - BigInteger tmpOp = (BigInteger)op; - value (tmpOp.multiply (BigInteger.valueOf (-1))); - } - } - catch (ClassCastException e) - { - String[] parameters = {Util.getMessage ("EvaluationException.neg"), operand ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.2", parameters)); - } - return value (); - } // evaluate -} // class Negative diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Not.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Not.java deleted file mode 100644 index 007b1e1f3ca..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Not.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import com.sun.tools.corba.se.idl.Util; -import java.math.BigInteger; - -public class Not extends UnaryExpr -{ - protected Not (Expression operand) - { - super ("~", operand); - } // ctor - - public Object evaluate () throws EvaluationException - { - try - { - Number op = (Number)operand ().evaluate (); - - if (op instanceof Float || op instanceof Double) - { - String[] parameters = {Util.getMessage ("EvaluationException.not"), operand ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.2", parameters)); - } - else - { - // Complement (~) - //daz value (new Long (~op.longValue ())); - BigInteger b = (BigInteger)coerceToTarget((BigInteger)op); - - // Compute according to CORBA 2.1 specifications for specified type. - if (type ().equals ("short") || type ().equals ("long") || type ().equals ("long long")) - value (b.add (one).multiply (negOne)); - else if (type ().equals("unsigned short")) - // "short" not CORBA compliant, but necessary for logical operations--size matters! - value (twoPow16.subtract (one).subtract (b)); - else if (type ().equals ("unsigned long")) - value (twoPow32.subtract (one).subtract (b)); - else if (type ().equals ("unsigned long long")) - value (twoPow64.subtract (one).subtract (b)); - else - value (b.not ()); // Should never execute... - } - } - catch (ClassCastException e) - { - String[] parameters = {Util.getMessage ("EvaluationException.not"), operand ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.2", parameters)); - } - return value (); - } // evaluate -} // class Not diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/NotEqual.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/NotEqual.java deleted file mode 100644 index 5ce0d68705c..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/NotEqual.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import com.sun.tools.corba.se.idl.Util; -import java.math.BigInteger; - -public class NotEqual extends BinaryExpr -{ - protected NotEqual (Expression leftOperand, Expression rightOperand) - { - super ("!=", leftOperand, rightOperand); - } // ctor - - public Object evaluate () throws EvaluationException - { - try - { - Object left = left ().evaluate (); - if (left instanceof Boolean) - { - Boolean l = (Boolean)left; - Boolean r = (Boolean)right ().evaluate (); - value (new Boolean (l.booleanValue () != r.booleanValue())); - } - else - { - Number l = (Number)left; - Number r = (Number)right ().evaluate (); - - if (l instanceof Float || l instanceof Double || r instanceof Float || r instanceof Double) - value (new Boolean (l.doubleValue () != r.doubleValue ())); - else - //daz value (new Boolean (l.longValue () != r.longValue ())); - value (new Boolean (!((BigInteger)l).equals ((BigInteger)r))); - } - } - catch (ClassCastException e) - { - String[] parameters = {Util.getMessage ("EvaluationException.notEqual"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - return value (); - } // evaluate -} // class NotEqual diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Or.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Or.java deleted file mode 100644 index b5906b13488..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Or.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import com.sun.tools.corba.se.idl.Util; -import java.math.BigInteger; - -public class Or extends BinaryExpr -{ - protected Or (Expression leftOperand, Expression rightOperand) - { - super ("|", leftOperand, rightOperand); - } // ctor - - public Object evaluate () throws EvaluationException - { - try - { - Number l = (Number)left ().evaluate (); - Number r = (Number)right ().evaluate (); - - if (l instanceof Float || l instanceof Double || r instanceof Float || r instanceof Double) - { - String[] parameters = {Util.getMessage ("EvaluationException.or"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - else - { - // or - //daz value (new Long (l.longValue () | r.longValue ())); - BigInteger uL = (BigInteger)toUnsigned((BigInteger)l); - BigInteger uR = (BigInteger)toUnsigned((BigInteger)r); - value((BigInteger)coerceToTarget(uL.or (uR))); - } - } - catch (ClassCastException e) - { - String[] parameters = {Util.getMessage ("EvaluationException.or"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - return value (); - } // evaluate -} // class Or diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Plus.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Plus.java deleted file mode 100644 index d9365016259..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Plus.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import com.sun.tools.corba.se.idl.Util; -import java.math.BigInteger; - -public class Plus extends BinaryExpr -{ - protected Plus (Expression leftOperand, Expression rightOperand) - { - super ("+", leftOperand, rightOperand); - } // ctor - - public Object evaluate () throws EvaluationException - { - try - { - Number l = (Number)left ().evaluate (); - Number r = (Number)right ().evaluate (); - - boolean lIsNonInteger = l instanceof Float || l instanceof Double; - boolean rIsNonInteger = r instanceof Float || r instanceof Double; - - if (lIsNonInteger && rIsNonInteger) - value (new Double (l.doubleValue () + r.doubleValue ())); - else if (lIsNonInteger || rIsNonInteger) - { - String[] parameters = {Util.getMessage ("EvaluationException.plus"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - else - { - // Addition (+) - BigInteger tmpL = (BigInteger)l, tmpR = (BigInteger)r; - value (tmpL.add (tmpR)); - //daz value (new Long (l.longValue () + r.longValue ())); - } - } - catch (ClassCastException e) - { - String[] parameters = {Util.getMessage ("EvaluationException.plus"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - return value (); - } // evaluate -} // class Plus diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Positive.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Positive.java deleted file mode 100644 index dbc822bc241..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Positive.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import com.sun.tools.corba.se.idl.Util; -import java.math.BigInteger; - -public class Positive extends UnaryExpr -{ - protected Positive (Expression operand) - { - super ("+", operand); - } // ctor - - public Object evaluate () throws EvaluationException - { - try - { - Number op = (Number)operand ().evaluate (); - - if (op instanceof Float || op instanceof Double) - value (new Double (+op.doubleValue ())); - else - { - // Multiply by sign - //daz value (new Long (+op.longValue ())); - value (((BigInteger)op).multiply (BigInteger.valueOf (((BigInteger)op).signum ()))); - //promote (); - } - } - catch (ClassCastException e) - { - String[] parameters = {Util.getMessage ("EvaluationException.pos"), operand ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.2", parameters)); - } - return value (); - } // evaluate -} // class Positive diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/ShiftLeft.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/ShiftLeft.java deleted file mode 100644 index 8ebb7dd7899..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/ShiftLeft.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import com.sun.tools.corba.se.idl.Util; -import java.math.BigInteger; - -public class ShiftLeft extends BinaryExpr -{ - protected ShiftLeft (Expression leftOperand, Expression rightOperand) - { - super ("<<", leftOperand, rightOperand); - } // ctor - - public Object evaluate () throws EvaluationException - { - try - { - Number l = (Number)left ().evaluate (); - Number r = (Number)right ().evaluate (); - - if (l instanceof Float || l instanceof Double || r instanceof Float || r instanceof Double) - { - String[] parameters = {Util.getMessage ("EvaluationException.left"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - else - { - // Shift left (<<) - //daz value (new Long (l.longValue () << r.longValue ())); - BigInteger bL = (BigInteger)coerceToTarget (l); - BigInteger bR = (BigInteger)r; - - BigInteger ls = bL.shiftLeft (bR.intValue ()); - - if (type ().indexOf ("short") >= 0) - ls = ls.mod (twoPow16); - else if (type ().indexOf ("long") >= 0) - ls = ls.mod (twoPow32); - else if (type ().indexOf ("long long") >= 0) - ls = ls.mod (twoPow64); - - value (coerceToTarget (ls)); - } - } - catch (ClassCastException e) - { - String[] parameters = {Util.getMessage ("EvaluationException.left"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - return value (); - } // evaluate -} // class ShiftLeft diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/ShiftRight.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/ShiftRight.java deleted file mode 100644 index f832738f12b..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/ShiftRight.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import com.sun.tools.corba.se.idl.Util; -import java.math.BigInteger; - -public class ShiftRight extends BinaryExpr -{ - protected ShiftRight (Expression leftOperand, Expression rightOperand) - { - super (">>", leftOperand, rightOperand); - } // ctor - - public Object evaluate () throws EvaluationException - { - try - { - Number l = (Number)left ().evaluate (); - Number r = (Number)right ().evaluate (); - - if (l instanceof Float || l instanceof Double || r instanceof Float || r instanceof Double) - { - String[] parameters = {Util.getMessage ("EvaluationException.right"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - else - { - // Shift right (>>) - //daz value (new Long (l.longValue () >> r.longValue ())); - BigInteger bL = (BigInteger)coerceToTarget ((BigInteger)l); - BigInteger bR = (BigInteger)r; - - // Change signed to unsigned (Clear sign bit--can be done when setting bL!) - if (bL.signum () == -1) - if (type ().equals ("short")) - bL = bL.add (twoPow16); - else if (type ().equals ("long")) - bL = bL.add (twoPow32); - else if (type ().equals ("long long")) - bL = bL.add (twoPow64); - - value (bL.shiftRight (bR.intValue ())); - } - } - catch (ClassCastException e) - { - String[] parameters = {Util.getMessage ("EvaluationException.right"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - return value (); - } // evaluate -} // class ShiftRight diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Terminal.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Terminal.java deleted file mode 100644 index ebe3fd22e62..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Terminal.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import com.sun.tools.corba.se.idl.ConstEntry; -import java.math.BigInteger; - -/** - * This class contains values. Objects of this class are the terminal - * nodes of an expression tree. - *

            - * Note that there is a constructor for Double values, but not Float. - * CORBA defines that all floating point expressions are evaluated as - * double, and that the result is coerced back to float if necessary. - *

            - * Note also that there is a constructor for long values, but not for - * int or short. CORBA defines that all integral expressions are evaluated - * as unsigned long. A CORBA long is a Java int. There is no unsigned int - * in Java, so the next larger type, long, is used. - **/ -public class Terminal extends Expression -{ - protected Terminal (String representation, Character charValue, - boolean isWide) - { - rep (representation); - value (charValue); - if (isWide) - type( "wchar" ) ; - else - type( "char" ) ; - } // ctor - - protected Terminal (String representation, Boolean booleanValue) - { - rep (representation); - value (booleanValue); - } // ctor - - // Support long long - protected Terminal (String representation, BigInteger bigIntegerValue) - { - rep (representation); - value (bigIntegerValue); - } // ctor - - protected Terminal (String representation, Long longValue) - { - long lv = longValue.longValue (); - rep (representation); - if (lv > Integer.MAX_VALUE || lv < Integer.MIN_VALUE) - value (longValue); - else - value (new Integer (longValue.intValue ())); - } // ctor - - protected Terminal (String representation, Double doubleValue) - { - rep (representation); - value (doubleValue); - } // ctor - - protected Terminal (String stringValue, boolean isWide ) - { - rep (stringValue); - value (stringValue); - if (isWide) - type( "wstring" ) ; - else - type( "string" ) ; - } // ctor - - protected Terminal (ConstEntry constReference) - { - rep (constReference.fullName ()); - value (constReference); - } // ctor - - ///// INSTANCE METHODS - public Object evaluate () throws EvaluationException - { - if (value () instanceof ConstEntry) - return ((ConstEntry)value ()).value ().evaluate (); - else - return value (); - } // evaluate -} // class Terminal diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Times.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Times.java deleted file mode 100644 index 77c4ce84e1e..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Times.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import com.sun.tools.corba.se.idl.Util; -import java.math.BigInteger; - -public class Times extends BinaryExpr -{ - protected Times (Expression leftOperand, Expression rightOperand) - { - super ("*", leftOperand, rightOperand); - } // ctor - - public Object evaluate () throws EvaluationException - { - try - { - Number l = (Number)left ().evaluate (); - Number r = (Number)right ().evaluate (); - - boolean lIsNonInteger = l instanceof Float || l instanceof Double; - boolean rIsNonInteger = r instanceof Float || r instanceof Double; - - if (lIsNonInteger && rIsNonInteger) - value (new Double (l.doubleValue () * r.doubleValue ())); - else if (lIsNonInteger || rIsNonInteger) - { - String[] parameters = {Util.getMessage ("EvaluationException.times"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - else - { - // Multiplication (*) - BigInteger tmpL = (BigInteger)l, tmpR = (BigInteger)r; - value (tmpL.multiply (tmpR)); - //daz value (new Long (l.longValue () * r.longValue ())); - } - } - catch (ClassCastException e) - { - String[] parameters = {Util.getMessage ("EvaluationException.times"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - return value (); - } // evaluate -} // class Times diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/UnaryExpr.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/UnaryExpr.java deleted file mode 100644 index 06fdc6c1424..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/UnaryExpr.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import com.sun.tools.corba.se.idl.Util; -import java.math.BigInteger; - -public abstract class UnaryExpr extends Expression -{ - public UnaryExpr (String operation, Expression unaryOperand) - { - _op = operation; - _operand = unaryOperand; - } // ctor - - public void op (String op) {_op = (op == null)? "": op;} - public String op () {return _op;} - - public void operand (Expression operand) {_operand = operand;} - public Expression operand () {return _operand;} - - private String _op = ""; - private Expression _operand = null; -} // class UnaryExpr diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Xor.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Xor.java deleted file mode 100644 index 6cb49135201..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Xor.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.constExpr; - -// NOTES: - -import com.sun.tools.corba.se.idl.Util; -import java.math.BigInteger; - -public class Xor extends BinaryExpr -{ - protected Xor (Expression leftOperand, Expression rightOperand) - { - super ("^", leftOperand, rightOperand); - } // ctor - - public Object evaluate () throws EvaluationException - { - try - { - Number l = (Number)left ().evaluate (); - Number r = (Number)right ().evaluate (); - - if (l instanceof Float || l instanceof Double || r instanceof Float || r instanceof Double) - { - String[] parameters = {Util.getMessage ("EvaluationException.xor"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - else - { - // Xor (^) - //daz value (new Long (l.longValue () ^ r.longValue ())); - //BigInteger uL = (BigInteger)toUnsigned((BigInteger)l); - //BigInteger uR = (BigInteger)toUnsigned((BigInteger)r); - //value (coerceToTarget(uL.xor (uR))); - BigInteger uL = (BigInteger)coerceToTarget((BigInteger)l); - BigInteger uR = (BigInteger)coerceToTarget((BigInteger)r); - value (uL.xor (uR)); - } - } - catch (ClassCastException e) - { - String[] parameters = {Util.getMessage ("EvaluationException.xor"), left ().value ().getClass ().getName (), right ().value ().getClass ().getName ()}; - throw new EvaluationException (Util.getMessage ("EvaluationException.1", parameters)); - } - return value (); - } // evaluate -} // class Xor diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/first.set b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/first.set deleted file mode 100644 index ff7f96692dc..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/first.set +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * 5639-D57, (C) COPYRIGHT International Business Machines Corp., 1997, 1998 - * - */ - -CORBA IDL ---------------- - - typedef, struct, union, enum, const, exception, interface, module - - , typedef, struct, union, enum, const, exception, interface, module - - typedef, struct, union, enum, const, exception, interface, module - - module - - typedef, struct, union, enum, const, exception, interface, module - - typedef, struct, union, enum, const, exception, interface, module, - - interface - - , :, { - - :, { - - typedef, struct, union, enum, const, exception, readonly, attribute, oneway, float, double, long, short, unsigned, char, boolean, octet, any, string, id, ::, void, state - - , typedef, struct, union, enum, const, exception, readonly, attribute, oneway, float, double, long, short, unsigned, char, boolean, octet, any, string, id, ::, void, state - - typedef, struct, union, enum, const, exception, readonly, attribute, oneway, float, double, long, short, unsigned, char, boolean, octet, any, string, id, ::, void, state - - state - - private, protected, public, float, double, long, short, unsigned, char, boolean, octet, any, sequence, string, id, ::, struct, union, enum, - - private, protected, public, float, double, long, short, unsigned, char, boolean, octet, any, sequence, string, id, ::, struct, union, enum - - private, protected, public - - : - - , "," - - id, :: - - , :: - - const - - long, short, unsigned, char, boolean, float, double, string, id, :: - - -, +, ~, id, ::, literal, ( - - -, +, ~, id, ::, literal, ( - - , | - - -, +, ~, id, ::, literal, ( - - , ^ - - -, +, ~, id, ::, literal, ( - - , & - - -, +, ~, id, ::, literal, ( - - , >>, << - - -, +, ~, id, ::, literal, ( - - , +, - - - -, +, ~, id, ::, literal, ( - - , *, /, % - - -, +, ~, id, ::, literal, ( - - -, +, ~ - - id, ::, literal, ( - - literals - - -, +, ~, id, ::, literal, ( - - typedef, struct, union, enum - - float, double, long, short, unsigned, char, boolean, octet, any, sequence, string, id, ::, struct, union, enum - - float, double, long, short, unsigned, char, boolean, octet, any, sequence, string, id, ::, struct, union, enum - - float, double, long, short, unsigned, char, boolean, octet, any, sequence, string, id, :: - - float, double, long, short, unsigned, char, boolean, octet, any - - sequence, string - - struct, union, enum - - id - - , "," - - id - - , [ - - float, double - - long, short, unsigned - - long, short - - unsigned - - char - - boolean - - octet - - any - - struct - - float, double, long, short, unsigned, char, boolean, octet, any, sequence, string, id, ::, struct, union, enum - - , float, double, long, short, unsigned, char, boolean, octet, any, sequence, string, id, ::, struct, union, enum - - float, double, long, short, unsigned, char, boolean, octet, any, sequence, string, id, ::, struct, union, enum - - union - - long, short, unsigned, char, boolean, enum, id, :: - - case, default - - , case, default - - case, default - - , case, default - - case, default - - float, double, long, short, unsigned, char, boolean, octet, any, sequence, string, id, ::, struct, union, enum - - enum - - , "," - - sequence - - ",", > - - string - - , < - - [ - - readonly, attribute - - , "," - - exception - - , float, double, long, short, unsigned, char, boolean, octet, any, sequence, string, id, ::, struct, union, enum - - oneway, float, double, long, short, unsigned, char, boolean, octet, any, string, id, ::, void - - id, macroID - - , raises, context, ; - - , context - - oneway - - float, double, long, short, unsigned, char, boolean, octet, any, string, id, ::, void - - ( - - in, out, inout, ) - - , "," - - in, out, inout - - in, out, inout - - raises - - , "," - - context - - , "," - - float, double, long, short, unsigned, char, boolean, octet, any, string, id, :: - diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/follow.set b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/follow.set deleted file mode 100644 index bdd1d576a90..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/follow.set +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * 5639-D57, (C) COPYRIGHT International Business Machines Corp., 1997, 1998 - * - */ - -CORBA IDL ------------------ - - EOF - - EOF - - EOF, typedef, struct, union, enum, const, exception, interface, module, } - - ; - - } - - } - - ; - - ; - - ; - - } - - } - - typedef, struct, union, enum, const, exception, readonly, attribute, oneway, float, double, long, short, unsigned, char, boolean, octet, any, string, id, ::, void, state, } - - typedef, struct, union, enum, const, exception, readonly, attribute, oneway, float, double, long, short, unsigned, char, boolean, octet, any, string, id, ::, void, state, } - - } - - private, protected, public, float, double, long, short, unsigned, char, boolean, octet, any, sequence, string, id, ::, struct, union, enum, } - - float, double, long, short, unsigned, char, boolean, octet, any, sequence, string, id, ::, struct, union, enum - - { - - { - - ",", {, id, ::, literal, (, >, ), macroID - - ",", {, id, ::, literal, (, >, ), macroID - - ; - - id - - ;, ), >, ], : - - ;, ), >, ], : - - ;, ), >, ], : - - |, ;, ), >, ], : - - | ;, ), >, ], : - - ^, |, ;, ), >, ], : - - ^, |, ;, ), >, ], : - - &, ^, |, ;, ), >, ], : - - &, ^, |, ;, ), >, ], : - - >>, <<, &, ^, |, ;, ), >, ], : - - >>, <<, &, ^, |, ;, ), >, ], : - - >>, <<, &, ^, |, ;, ), >, ], : - - +, -, >>, <<, &, ^, |, ;, ), >, ], : - - *, /, %, +, -, >>, <<, &, ^, |, ;, ), >, ], : - - id, ::, literal, ( - - *, /, %, +, -, >>, <<, &, ^, |, ;, ), >, ], : - - *, /, %, +, -, >>, <<, &, ^, |, ;, ), >, ], : (and , for string literal in ) - - >, ] - - ; - - ; - - id - - id, ",", > - - id, ",", >, macroID - - id, ",", > - - id - - ; - - ; - - ",", ; - - ",", ; - - id, ",", >, macroID - - id, ",", >, macroID, ) - - id, ",", >, macroID, ) - - id, ",", >, macroID, ) - - id, ",", >, macroID, ) - - id, ",", >, macroID, ) - - id, ",", >, macroID - - id, ",", >, macroID - - ;, id - - } - - } - - float, double, long, short, unsigned, char, boolean, octet, any, sequence, string, id, ::, struct, union, enum, } - - ;, id - - ) - - } - - } - - case, default, } - - float, double, long, short, unsigned, char, boolean, octet, any, sequence, string, id, ::, struct, union, enum - - case, default, float, double, long, short, unsigned, char, boolean, octet, any, sequence, string, id, ::, struct, union, enum - - ; - - ;, id, ) - - } - - id, ",", > - - id, ",", > - - id, ",", >, macroID - - id, ",", >, macroID - - [, ",", ; - - ; - - ; - - ; - - } - - ; - - ; - - ; - - ; - - float, double, long, short, unsigned, char, boolean, octet, any, string, id, ::, void - - id, macroID - - raises, context, ; - - raises, context, ; - - ) - - , ) - - float, double, long, short, unsigned, char, boolean, octet, any, string, id, :: - - context, ; - - ) - - ; - - ) - - id, macroID - diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/grammar.idl b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/grammar.idl deleted file mode 100644 index 3848083833b..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/grammar.idl +++ /dev/null @@ -1,422 +0,0 @@ -/* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * 5639-D57, (C) COPYRIGHT International Business Machines Corp., 1997, 1998 - * - */ - -CORBA 2.3 IDL ---------------- - -(1) - -(1) e - - -(2) ";" - ";" - ";" - ";" - ";" - ";" - -(3) "module" "{" "}" - -(3) - -(3) - e - -(4) - - -(5) "{" "}" - -(6) "abstract" "interface" - "interface" - -(7) "abstract" "interface" - "interface" - -(7) e - - -(8) - -(8) e - - -(9) ";" - ";" - ";" - ";" - ";" - - - -(10) ":" - -(10) e - "," - -(12) - "::" - -(12) e - "::" - -(13) - - - - -(14) "abstract" "valuetype" - "valuetype" - -(15) "valuetype" - -(16) "abstract" "valuetype" "{" "}" - "abstract" "valuetype" "{" "}" - -(16) e - - -(17) "{" "}" - -(17) e - - -(18) "custom" "valuetype" - "valuetype" - "custom" "valuetype" - "valuetype" - -(19) - -(19) e - ":" "truncatable" - ":" - -(19) e - "," - -(19) e - "supports" - -(19) e - "," - -(20) - -(21) - - - -(22) "public" ";" - "private" ";" - -(23) "factory" "(" ")" - "factory" "(" ")" - -(24) - "," - -(25) - -(26) "in" - -(27) "const" "=" - -(28) - - - - - - - - - -(29) - -(30) - -(30) e - "|" - -(31) - -(31) e - "^" - -(32) - -(32) e - "&" - -(33) - -(33) e - ">>" - "<<" - -(34) - -(34) e - "+" - "-" - -(35) - -(35) e - "*" - "/" - "%" - -(36) - - -(37) "-" - "+" - "~" - -(38) - - "(" ")" - -(39) <> - <>> - <>> - <> - <> - <> - <> - <> - -(40) "TRUE" - "FALSE" - -(41) - -(42) "typedef" - - - - "native" - -(43) - -(44) - - -(45) - - - -(46) - - - - - - - - - -(47) - - - - -(48) - - - -(49) - -(49) e - "," - -(50) - - -(51) - -(52) - -(53) "float" - "double" - "long" "double" - -(54) - - -(55) "long" - "short" - "long" "long" - -// 56-58 omitted - -(59) "unsigned" - -// 60-62 omitted - -(63) "char" - -(64) "wchar" - -(65) "boolean" - -(66) "octet" - -(67) "any" - -(68) "Object" - -(69) "struct" "{" "}" - -(70) - -(70) e - - -(71) ";" - -(72) "union" "switch" "(" ")" "{" "}" - -(73) - - - - - -(74) - -(74) e - - -(75) ";" - -(75) e - - -(76) "case" ":" - "default" ":" - -(77) - -(78) "enum" "{" "}" - -(78) e - "," - -// 79 omitted - -(80) "sequence" "<" - -(80) "," ">" - ">" - -(81) "string" - "string" "<" ">" - -(82) "wstring" - "wstring" "<" ">" - -(83) - -(84) "[" "]" - -(85) "readonly" "attribute" - "attribute" - -(85) e - "," - -(86) "exception" "{" "}" - -(86) e - - -(87) - - -(87) - - -(87) e - - - - -(88) "oneway" - -(89) - "void" - -(90) "(" - -(90) ")" - ")" - -(90) e - "," - -(91) - -(92) "in" - "out" - "inout" - -(93) "raises" "(" ")" - -(93) e - "," - -(94) "context" "(" ")" - -(94) e - "," - -(95) - - - - -(96) "fixed" "<" "," ">" - -(97) "fixed" - -(98) "ValueBase" - -NOTES: - -- #define id(id, id, ...) token-string is a macro definition. There can be no space between the first id and the left paren. Since id( must be treated as a token and id( can also appear in op_dcl, see that production for the effect of this token. - diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/grammar3.idl b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/grammar3.idl deleted file mode 100644 index e009e42048d..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/grammar3.idl +++ /dev/null @@ -1,539 +0,0 @@ -/* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * COMPONENT_NAME: idl.parser - * - * ORIGINS: 27 - * - * 5639-D57, (C) COPYRIGHT International Business Machines Corp., 1997, 1998 - * - */ - -(1) // CORBA3 - -(1) e // CORBA3 - // CORBA3 - -(1) "import" ";" // CORBA3 - -(1) // CORBA3 - // CORBA3 - -(1) e - - -(2) ";" - ";" - ";" - ";" - ";" - ";" - ";" // CORBA3 - ";" // CORBA3 - ";" // CORBA3 - ";" // CORBA3 - -(2) "typeId" // CORBA3 - -(2) "typePrefix" // CORBA3 - -(3) "module" "{" "}" - -(3) - -(3) - e - -(4) - - -(5) "{" "}" - -(6) "abstract" "interface" - "local" "interface" // CORBA3 - "interface" - -(7) "abstract" "interface" - "local" "interface" // CORBA3 - "interface" - -(7) e - - -(8) - -(8) e - - -(9) ";" - ";" - ";" - ";" - ";" - ";" // CORBA3 - ";" // CORBA3 - -(10) ":" - -(10) e - "," - -(12) - "::" - -(12) e - "::" - -(13) - - - - -(14) "abstract" "valuetype" - "valuetype" - -(15) "valuetype" - -(16) "abstract" "valuetype" "{" "}" - "abstract" "valuetype" "{" "}" - -(16) e - - -(17) "{" "}" - -(17) e - - -(18) "custom" "valuetype" - "valuetype" - "custom" "valuetype" - "valuetype" - -(19) - -(19) e - ":" "truncatable" - ":" - -(19) e - "," - -(19) e - "supports" - -(19) e - "," - -(20) - -(21) - - - -(22) "public" ";" - "private" ";" - -(23) "factory" "(" ")" - "factory" "(" ")" - -(24) - "," - -(25) - -(26) "in" - -(27) "const" "=" - -(28) - - - - - - - - - -(29) - -(30) - -(30) e - "|" - -(31) - -(31) e - "^" - -(32) - -(32) e - "&" - -(33) - -(33) e - ">>" - "<<" - -(34) - -(34) e - "+" - "-" - -(35) - -(35) e - "*" - "/" - "%" - -(36) - - -(37) "-" - "+" - "~" - -(38) - - "(" ")" - -(39) <> - <>> - <>> - <> - <> - <> - <> - <> - -(40) "TRUE" - "FALSE" - -(41) - -(42) "typedef" - - - - "native" - -(43) - -(44) - - -(45) - - - -(46) - - - - - - - - - -(47) - - - - -(48) - - - -(49) - -(49) e - "," - -(50) - - -(51) - -(52) - -(53) "float" - "double" - "long" "double" - -(54) - - -(55) "long" - "short" - "long" "long" - -// 56-58 omitted - -(59) "unsigned" - -// 60-62 omitted - -(63) "char" - -(64) "wchar" - -(65) "boolean" - -(66) "octet" - -(67) "any" - -(68) "Object" - -(69) "struct" "{" "}" - -(70) - -(70) e - - -(71) ";" - -(72) "union" "switch" "(" ")" "{" "}" - -(73) - - - - - -(74) - -(74) e - - -(75) ";" - -(75) e - - -(76) "case" ":" - "default" ":" - -(77) - -(78) "enum" "{" "}" - -(78) e - "," - -// 79 omitted - -(80) "sequence" "<" - -(80) "," ">" - ">" - -(81) "string" - "string" "<" ">" - -(82) "wstring" - "wstring" "<" ">" - -(83) - -(84) "[" "]" - -(85) // CORBA3 - // CORBA3 - -(85) // CORBA3 - -(85) "readonly" "attribute" // CORBA3 - -(85) // CORBA3 - // CORBA3 - -(85) e // CORBA3 - // CORBA3 - -(85) "attribute" // CORBA3 - -(85) // CORBA3 - // CORBA3 - -(85) // CORBA3 - // CORBA3 - // CORBA3 - -(85) "getRaises" // CORBA3 - -(85) "setRaises" // CORBA3 - -(85) "(" ")" // CORBA3 - -(85) e // CORBA3 - "," // CORBA3 - -(86) "exception" "{" "}" - -(86) e - - -(87) - - -(87) - - -(87) e - - - - -(88) "oneway" - -(89) - "void" - -(90) "(" - -(90) ")" - ")" - -(90) e - "," - -(91) - -(92) "in" - "out" - "inout" - -(93) "raises" "(" ")" - -(93) e - "," - -(94) "context" "(" ")" - -(94) e - "," - -(95) - - - - -(96) "fixed" "<" "," ">" - -(97) "fixed" - -(98) "ValueBase" - -// CORBA3 Component and Home IDL - -(200) - - -(201) "component" - -(202) "{" "}" - -(203) "component" - "component" - "component" - "component" - -(204) "supports" - -(204) e - "," - -(205) ":" - -(206) - -(206) e - - -(207) ";" - ";" - ";" - ";" - ";" - ";" - -(208) "provides" - -(209) - "Object" - -(210) "uses" - "uses" "multiple" - -(211) "emits" - -(212) "publishes" - -(213) "consumes" - -(214) - -(215) "home" "manages" - "home" "manages" - "home" "manages" - "home" "manages" - -(216) ":" - -(217) "primaryKey" - -(218) "{" "}" - -(218) e - - -(219) - ";" - ";" - -(220) "factory" "(" ")" - "factory" "(" ")" - "factory" "(" ")" - "factory" "(" ")" - -(221) "finder" "(" ")" - "finder" "(" ")" - "finder" "(" ")" - "finder" "(" ")" - -NOTES: - -- #define id(id, id, ...) token-string is a macro definition. There can be no space between the first id and the left paren. Since id( must be treated as a token and id( can also appear in op_dcl, see that production for the effect of this token. - diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/idl.prp b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/idl.prp deleted file mode 100644 index a07db3fbbae..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/idl.prp +++ /dev/null @@ -1,195 +0,0 @@ -# -# Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# -# COMPONENT_NAME: idl.parser -# -# ORIGINS: 27 -# -# Licensed Materials - Property of IBM -# 5639-D57 (C) COPYRIGHT International Business Machines Corp., 1997, 1999 -# RMI-IIOP v1.0 -# - -# Translator: Each line below is of the form "=". -# The keys are NOT to be translated. -# The messages ARE to be translated. -# -# DO NOT translate the following: -# ASCII -# #else -# #endif -# IDL -# -# %0, %1, etc. are postional parameters to the message. Do not -# translate these. The number order is the order they are given to -# the message writer. It is OK to change their order in the message -# if the language grammar so dictates. -# -# Lines of the form "%0 (line %1): \n%x\n%y" are error -# messages: %0 is a filename; %1 is a line number; %x is line %1 from -# %0; %y is the error marker. So the message comes out looking like: -# (line xxx): -# Line xxx from where the carat points to the error -# ^ -# So the first two and the last two parameters of these messages must -# remain in their positions. -# -# A backslash (\) at the end of a line is a line continuation -# character. A backslash at the beginning of a line means don't -# ignore leading blanks (they normally are). These backslashes -# should remain in the message. -# -# Translator: Start Translating - -Compile.parsing=Parsing %0 -Compile.parseDone=done - %0 -Compile.generating=Generating %0 -Compile.genDone=done - %0 -Deprecated.keyword=WARNING: Keyword `%0' is deprecated. -EvaluationException.1=Operands of %0 operator are inconsistent: %1 and %2. -EvaluationException.2=Operand of %0 operator must be a number, not a %1. -EvaluationException.or=bitwise or -EvaluationException.xor=bitwise xor -EvaluationException.and=bitwise and -EvaluationException.plus=addition -EvaluationException.minus=subtraction -EvaluationException.left=left shift -EvaluationException.right=right shift -EvaluationException.times=multiplication -EvaluationException.divide=division -EvaluationException.mod=modulo -EvaluationException.pos=unary positive -EvaluationException.neg=unary negation -EvaluationException.not=bitwise not -EvaluationException.booleanNot=boolean not -EvaluationException.booleanAnd=boolean and -EvaluationException.booleanOr=boolean or -EvaluationException.equal=equal -EvaluationException.notEqual=not equal -EvaluationException.greaterThan=greater than -EvaluationException.lessThan=less than -EvaluationException.greaterEqual=greater than or equal -EvaluationException.lessEqual=less than or equal -GenFileStream.1=%0 could not be generated: %1 -InvalidArgument.1=Invalid argument: %0. -InvalidArgument.2=No IDL file was specified. -InvalidCharacter.1=%0 (line %1): invalid character: %2 (ASCII %3).\n%4\n%5 -Migration.futureKeyword=WARNING: Identifier `%0' collides with a keyword; use an escaped identifier to ensure future compatibility. -Migration.keywordCollision=WARNING: Identifier `%0' collides with a keyword; use an escaped identifier to ensure future compatibility. -ParseException.abstractValueBox=%0 (line %1): A value box cannot be declared abstract.\n%2\n%3 -ParseException.alreadyDeclared=%0 (line %1): %2 has already been declared.\n%3\n%4 -ParseException.declNotInSameFile=%0 (line %1): %2 was declared previously in a forward declaration in file %3.\n%4\n%5 -ParseException.alreadyDerived=%0 (line %1): %2 has already been declared as a parent of %3.\n%4\n%5 -ParseException.alreadyDefaulted=%0 (line %1): The default branch has already been encountered.\n%2\n%3 -ParseException.alreadyRaised=%0 (line %1): %2 already specified in raises clause.\n%3\n%4 -ParseException.attributeNotType=%0 (line %1): %2 is an attribute. It cannot be used as a type.\n%3\n%4 -ParseException.badAbstract=%0 (line %1): The forward and actual declaration of %2 is inconsistent. One is abstract and the other is not.\n%3\n%4 -ParseException.badCustom=%0 (line %1): A forward value declaration cannot be declared custom.\n%2\n%3 -ParseException.badRepIDAlreadyAssigned=%0 (line %1): Type %2 has already been assigned a Repository ID in a previous ID pragma directive.\n%3\n%4 -ParseException.badRepIDForm=%0 (line %1): Repository ID '%2' should have form ':'.\n%3\n%4 -ParseException.badRepIDPrefix=%0 (line %1): Interface %2 should have Repository ID prefix `%3', not '%4'.\n%5\n%6 -ParseException.badState=%0 (line %1): %2 cannot be a stateful interface; it has more than one stateful parent.\n%3\n%4 -ParseException.branchLabel=%0 (line %1): case %2 has already been declared.\n%3\n%4 -ParseException.branchName=%0 (line %1): A branch named %2 has already been declared.\n%3\n%4 -ParseException.duplicateInit=%0 (line %1): An initializer has the same signature as a previous initializer.\n%2\n%3 -ParseException.duplicateState=%0 (line %1): The data member %2 has the same name as a previous data member.\n%3\n%4 -ParseException.elseNoIf=%0 (line %1): #else encountered without a matching #if.\n%2\n%3 -ParseException.endNoIf=%0 (line %1): #endif encountered without a matching #if.\n%2\n%3 -ParseException.evaluation=%0 (line %1): %2\n%3\n%4 -ParseException.forwardEntry=%0 (line %1): There is a forward reference to %2, but it is not defined.\n%3\n%4 -ParseException.forwardedValueBox=%0 (line %1): %2 has a forward declaration. A value box cannot be forward declared.\n%3\n%4 -ParseException.forwardInheritance=%0 (line %1): It is illegal for %2 to inherit from the incomplete forward declaration of %3.\n%4\n%5 -ParseException.generic=%0 (line %1): %2\n%3\n%4 -ParseException.illegalArray=%0 (line %1): An array is not a legal type in a %2.\n%3\n%4 -ParseException.illegalException=%0 (line %1): Exceptions cannot appear within %2s.\n%3\n%4 -ParseException.invalidConst1=%0 (line %1): Constant expression must be of type %2, not %3.\n%4\n%5 -ParseException.invalidConst2=%0 (line %1): Identifiers in constant expressions must be constants, not %2.\n%3\n%4 -ParseException.keywordCollision=%0 (line %1): Identifier `%2' collides with keyword; use escaped identifier if necessary.\n%3\n%4 -ParseException.methodClash=%0 (line %1): Method name clash in interface %2: %3.\n%4\n%5 -ParseException.moduleNotType=%0 (line %1): %2 is a module. It cannot be used as a type.\n%3\n%4 -ParseException.nestedValueBox=%0 (line %1): Value boxes cannot be nested.\n%2\n%3 -ParseException.noDefault=%0 (line %1): A default branch is not allowed when all possible cases are fully covered.\n%2\n%3 -ParseException.nonAbstractParent=%0 (line %1): The abstract interface %2 cannot inherit from the non-abstract interface %3.\n%4\n%5 -ParseException.nonAbstractParent2=%0 (line %1): The abstract value %2 cannot inherit from the non-abstract value %3.\n%4\n%5 -ParseException.nonAbstractParent3=%0 (line %1): The value %2 cannot inherit from the non-abstract value %3 as specified.\n%4\n%5 -ParseException.notANumber=%0 (line %1): A number was expected. %2 is not a valid number.\n%3\n%4 -ParseException.nothing=%0 is empty. There is nothing to compile. -ParseException.notPosInt=%0 (line %1): Expected a positive integer constant, not %2.\n%3\n%4 -ParseException.oneway=%0 (line %1): %2 is declared to be oneway. Oneway methods must: return void; have only in parameters; raise no exceptions.\n%3\n%4 -ParseException.operationNotType=%0 (line %1): %2 is an operation. It cannot be used as a type.\n%3\n%4 -ParseException.outOfRange=%0 (line %1): The value of the constant expression, %2, is out of range for type %3.\n%4\n%5 -ParseException.recursive=%0 (line %1): The only legal recursive definition is: sequence<%2> %3.\n%4\n%5 -ParseException.selfInherit=%0 (line %1): %2 cannot inherit from itself.\n%3\n%4 -ParseException.stringTooLong=%0 (line %1): "%2" cannot be more than %3 characters long.\n%4\n%5 -ParseException.syntax1=%0 (line %1): Expected `%2'; encountered `%3'.\n%4\n%5 -ParseException.syntax2=%0 (line %1): Expected one of%2; encountered `%3'.\n%4\n%5 -ParseException.unclosed=%0: Unexpected end of file encountered in comment. -ParseException.undeclaredType=%0 (line %1): %2 is an undeclared type.\n%3\n%4 -ParseException.warning=%0 (line %1): %2\n%3\n%4 -ParseException.constExprType=%0 (line %1): The type of the constant expression is %2, but it should be %3.\n%4\n%5 -ParseException.wrongType=%0 (line %1): The type of %2 is %3, but it should be %4.\n%5\n%6 -ParseException.illegalIncompleteTypeReference=%0 (line %1): Illegal reference to incomplete forward declaration of type %2.\n%3\n%4 -Preprocessor.unknown=Unknown preprocessor directive, `%0'. Line ignored. -Preprocessor.unknownPragma=Unknown pragma `%0'. Line ignored. -Preprocessor.undefinedName=Undefined type name for pragma %0: %1. Line ignored. -Token.boolLit= -Token.charLit= -Token.intLit= -Token.floatLit= -Token.stringLit= -Token.literal= -Token.identifier= -Token.endOfFile=EOF -Token.unknown=? -Util.cantCreatePkg=Cannot create the package %0. -Version.product=IDL Parser Framework, version "%0" -Version.number=3.2 -default=Error! A message was requested which does not exist. The messages file does not contain the key: %0. - -# Translator: In the list of options below, do not translate: -# -i, -d, -keep, -emitAll, -noWarn, -v, -verbose, -version, #define -# Do not translate the string "java com.sun.tools.corba.se.idl.Compile" - -usage=Compiler Usage:\n\ -\ java com.sun.tools.corba.se.idl.Compile [options] \n\ -where is the name of a file containing IDL definitions, and\n\ -[options] is any combination of the options listed below. The options\n\ -are optional and may appear in any order; is required and\n\ -must appear last.\n\ -\ \n\ -Options:\n\ - -d This is equivalent to the following line in an\n\ -\ IDL file: #define \n\ - -emitAll Emit all types, including those found in #included\n\ -\ files.\n\ - -i By default, the current directory is scanned for\n\ -\ included files. This option adds another directory.\n\ - -keep If a file to be generated already exists, do not\n\ -\ overwrite it. By default it is overwritten.\n\ - -noWarn Suppress warnings.\n\ - -v, -verbose Verbose mode.\n\ - -version Display the version number.\n - diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/idl_ja.prp b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/idl_ja.prp deleted file mode 100644 index 47ba5c633ff..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/idl_ja.prp +++ /dev/null @@ -1,177 +0,0 @@ -# -# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# -# COMPONENT_NAME: idl.parser -# -# ORIGINS: 27 -# -# Licensed Materials - Property of IBM -# 5639-D57 (C) COPYRIGHT International Business Machines Corp., 1997, 1999 -# RMI-IIOP v1.0 -# - -# Translator: Each line below is of the form "=". -# The keys are NOT to be translated. -# The messages ARE to be translated. -# -# DO NOT translate the following: -# ASCII -# #else -# #endif -# IDL -# -# %0, %1, etc. are postional parameters to the message. Do not -# translate these. The number order is the order they are given to -# the message writer. It is OK to change their order in the message -# if the language grammar so dictates. -# -# Lines of the form "%0 (line %1): \n%x\n%y" are error -# messages: %0 is a filename; %1 is a line number; %x is line %1 from -# %0; %y is the error marker. So the message comes out looking like: -# (line xxx): -# Line xxx from where the carat points to the error -# ^ -# So the first two and the last two parameters of these messages must -# remain in their positions. -# -# A backslash (\) at the end of a line is a line continuation -# character. A backslash at the beginning of a line means don't -# ignore leading blanks (they normally are). These backslashes -# should remain in the message. -# -# Translator: Start Translating - -Compile.parsing=%0\u306E\u89E3\u6790\u4E2D -Compile.parseDone=\u5B8C\u4E86 - %0 -Compile.generating=%0\u306E\u751F\u6210\u4E2D -Compile.genDone=\u5B8C\u4E86 - %0 -Deprecated.keyword=\u8B66\u544A: \u30AD\u30FC\u30EF\u30FC\u30C9`%0'\u306F\u975E\u63A8\u5968\u3067\u3059\u3002 -EvaluationException.1=%0\u6F14\u7B97\u5B50\u306E\u30AA\u30DA\u30E9\u30F3\u30C9\u306B\u4E00\u8CAB\u6027\u304C\u3042\u308A\u307E\u305B\u3093: %1\u304A\u3088\u3073%2\u3002 -EvaluationException.2=%0\u6F14\u7B97\u5B50\u306E\u30AA\u30DA\u30E9\u30F3\u30C9\u306F\u3001%1\u3067\u306F\u306A\u304F\u6570\u5024\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 -EvaluationException.or=\u30D3\u30C3\u30C8\u5358\u4F4D\u306EOR\u6F14\u7B97 -EvaluationException.xor=\u30D3\u30C3\u30C8\u5358\u4F4D\u306EXOR\u6F14\u7B97 -EvaluationException.and=\u30D3\u30C3\u30C8\u5358\u4F4D\u306EAND\u6F14\u7B97 -EvaluationException.plus=\u52A0\u7B97 -EvaluationException.minus=\u6E1B\u7B97 -EvaluationException.left=\u5DE6\u30B7\u30D5\u30C8 -EvaluationException.right=\u53F3\u30B7\u30D5\u30C8 -EvaluationException.times=\u4E57\u7B97 -EvaluationException.divide=\u9664\u7B97 -EvaluationException.mod=\u3079\u304D\u4E57 -EvaluationException.pos=\u5358\u9805\u30D7\u30E9\u30B9 -EvaluationException.neg=\u5358\u9805\u30DE\u30A4\u30CA\u30B9 -EvaluationException.not=\u30D3\u30C3\u30C8\u5358\u4F4D\u306ENOT\u6F14\u7B97 -EvaluationException.booleanNot=boolean NOT -EvaluationException.booleanAnd=boolean AND -EvaluationException.booleanOr=boolean OR -EvaluationException.equal=\u6B21\u3068\u7B49\u3057\u3044 -EvaluationException.notEqual=\u6B21\u3068\u7B49\u3057\u304F\u306A\u3044 -EvaluationException.greaterThan=\u304C\u6B21\u306E\u5024\u3088\u308A\u5927\u304D\u3044 -EvaluationException.lessThan=\u304C\u6B21\u306E\u5024\u3088\u308A\u5C0F\u3055\u3044 -EvaluationException.greaterEqual=\u304C\u6B21\u306E\u5024\u4EE5\u4E0A -EvaluationException.lessEqual=\u304C\u6B21\u306E\u5024\u4EE5\u4E0B -GenFileStream.1=%0\u3092\u751F\u6210\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: %1 -InvalidArgument.1=\u5F15\u6570\u304C\u7121\u52B9\u3067\u3059: %0\u3002 -InvalidArgument.2=IDL\u30D5\u30A1\u30A4\u30EB\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 -InvalidCharacter.1=%0 (\u884C%1): \u6587\u5B57\u304C\u7121\u52B9\u3067\u3059: %2 (ASCII %3)\u3002\n%4\n%5 -Migration.futureKeyword=\u8B66\u544A: \u8B58\u5225\u5B50`%0'\u304C\u30AD\u30FC\u30EF\u30FC\u30C9\u3068\u7AF6\u5408\u3057\u3066\u3044\u307E\u3059\u3002\u5C06\u6765\u306E\u4E92\u63DB\u6027\u306E\u305F\u3081\u306B\u3001\u30A8\u30B9\u30B1\u30FC\u30D7\u3055\u308C\u305F\u8B58\u5225\u5B50\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002 -Migration.keywordCollision=\u8B66\u544A: \u8B58\u5225\u5B50`%0'\u304C\u30AD\u30FC\u30EF\u30FC\u30C9\u3068\u7AF6\u5408\u3057\u3066\u3044\u307E\u3059\u3002\u5C06\u6765\u306E\u4E92\u63DB\u6027\u306E\u305F\u3081\u306B\u3001\u30A8\u30B9\u30B1\u30FC\u30D7\u3055\u308C\u305F\u8B58\u5225\u5B50\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002 -ParseException.abstractValueBox=%0 (\u884C%1): \u5024\u30DC\u30C3\u30AF\u30B9\u306Fabstract\u3068\u3057\u3066\u5BA3\u8A00\u3067\u304D\u307E\u305B\u3093\u3002\n%2\n%3 -ParseException.alreadyDeclared=%0 (\u884C%1): %2\u306F\u3059\u3067\u306B\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059\u3002\n%3\n%4 -ParseException.declNotInSameFile=%0 (\u884C%1): %2\u306F\u30D5\u30A1\u30A4\u30EB%3\u306Eforward\u5BA3\u8A00\u3067\u4EE5\u524D\u306B\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059\u3002\n%4\n%5 -ParseException.alreadyDerived=%0 (\u884C%1): %2\u306F%3\u306E\u89AA\u3068\u3057\u3066\u3059\u3067\u306B\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059\u3002\n%4\n%5 -ParseException.alreadyDefaulted=%0 (\u884C%1): \u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u5206\u5C90\u306F\u3059\u3067\u306B\u691C\u51FA\u3055\u308C\u3066\u3044\u307E\u3059\u3002\n%2\n%3 -ParseException.alreadyRaised=%0 (\u884C%1): %2\u306Fraises\u53E5\u3067\u3059\u3067\u306B\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002\n%3\n%4 -ParseException.attributeNotType=%0 (\u884C%1): %2\u306F\u5C5E\u6027\u3067\u3059\u3002\u578B\u3068\u3057\u3066\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002\n%3\n%4 -ParseException.badAbstract=%0 (\u884C%1): %2\u306Eforward\u5BA3\u8A00\u3068\u5B9F\u969B\u306E\u5BA3\u8A00\u306B\u4E00\u8CAB\u6027\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u4E00\u65B9\u306Fabstract\u3067\u3059\u304C\u3001\u3082\u3046\u4E00\u65B9\u306Fabstract\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\n%3\n%4 -ParseException.badCustom=%0 (\u884C%1): forward\u5024\u5BA3\u8A00\u306Fcustom\u3068\u3057\u3066\u5BA3\u8A00\u3067\u304D\u307E\u305B\u3093\u3002\n%2\n%3 -ParseException.badRepIDAlreadyAssigned=%0 (\u884C%1): \u578B%2\u306B\u306F\u3001\u524D\u306EID\u30D7\u30E9\u30B0\u30DE\u30FB\u30C7\u30A3\u30EC\u30AF\u30C6\u30A3\u30D6\u306E\u30EA\u30DD\u30B8\u30C8\u30EAID\u304C\u3059\u3067\u306B\u5272\u308A\u5F53\u3066\u3089\u308C\u3066\u3044\u307E\u3059\u3002\n%3\n%4 -ParseException.badRepIDForm=%0 (\u884C%1): \u30EA\u30DD\u30B8\u30C8\u30EAID '%2'\u306E\u5F62\u5F0F\u306F':'\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n%3\n%4 -ParseException.badRepIDPrefix=%0 (\u884C%1): \u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9%2\u306B\u306F\u3001'%4'\u3067\u306F\u306A\u304F\u30EA\u30DD\u30B8\u30C8\u30EAID\u63A5\u982D\u8F9E`%3'\u304C\u5FC5\u8981\u3067\u3059\u3002\n%5\n%6 -ParseException.badState=%0 (\u884C%1): %2\u306F\u30B9\u30C6\u30FC\u30C8\u30D5\u30EB\u30FB\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306B\u3067\u304D\u307E\u305B\u3093\u3002\u8907\u6570\u306E\u30B9\u30C6\u30FC\u30C8\u30D5\u30EB\u89AA\u304C\u3042\u308A\u307E\u3059\u3002\n%3\n%4 -ParseException.branchLabel=%0 (\u884C%1): case %2\u306F\u3059\u3067\u306B\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059\u3002\n%3\n%4 -ParseException.branchName=%0 (\u884C%1): %2\u3068\u3044\u3046\u540D\u524D\u306E\u5206\u5C90\u306F\u3059\u3067\u306B\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059\u3002\n%3\n%4 -ParseException.duplicateInit=%0 (\u884C%1): \u521D\u671F\u5316\u5B50\u306B\u306F\u524D\u306E\u521D\u671F\u5316\u5B50\u3068\u540C\u3058\u30B7\u30B0\u30CD\u30C1\u30E3\u304C\u3042\u308A\u307E\u3059\u3002\n%2\n%3 -ParseException.duplicateState=%0 (\u884C%1): \u30C7\u30FC\u30BF\u30FB\u30E1\u30F3\u30D0\u30FC%2\u306E\u540D\u524D\u304C\u524D\u306E\u30C7\u30FC\u30BF\u30FB\u30E1\u30F3\u30D0\u30FC\u3068\u540C\u3058\u3067\u3059\u3002\n%3\n%4 -ParseException.elseNoIf=%0 (\u884C%1): \u4E00\u81F4\u3059\u308B#if\u304C\u306A\u3044#else\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002\n%2\n%3 -ParseException.endNoIf=%0 (\u884C%1): \u4E00\u81F4\u3059\u308B#if\u304C\u306A\u3044#endif\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002\n%2\n%3 -ParseException.evaluation=%0 (\u884C%1): %2\n%3\n%4 -ParseException.forwardEntry=%0 (\u884C%1): %2\u3078\u306E\u524D\u65B9\u53C2\u7167\u304C\u3042\u308A\u307E\u3059\u304C\u3001\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\n%3\n%4 -ParseException.forwardedValueBox=%0 (\u884C%1): %2\u306B\u306Fforward\u5BA3\u8A00\u304C\u3042\u308A\u307E\u3059\u3002\u5024\u30DC\u30C3\u30AF\u30B9\u306Fforward\u3068\u3057\u3066\u5BA3\u8A00\u3067\u304D\u307E\u305B\u3093\u3002\n%3\n%4 -ParseException.forwardInheritance=%0 (\u884C%1): %3\u306E\u4E0D\u5B8C\u5168\u306Aforward\u5BA3\u8A00\u304B\u3089\u306E%2\u306E\u7D99\u627F\u306F\u7121\u52B9\u3067\u3059\u3002\n%4\n%5 -ParseException.generic=%0 (\u884C%1): %2\n%3\n%4 -ParseException.illegalArray=%0 (\u884C%1): \u914D\u5217\u306F%2\u306E\u6B63\u3057\u3044\u578B\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\n%3\n%4 -ParseException.illegalException=%0 (\u884C%1): \u4F8B\u5916\u3092%2s\u5185\u306B\u8868\u793A\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002\n%3\n%4 -ParseException.invalidConst1=%0 (\u884C%1): \u5B9A\u6570\u5F0F\u306F%3\u578B\u3067\u306F\u306A\u304F%2\u578B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n%4\n%5 -ParseException.invalidConst2=%0 (\u884C%1): \u5B9A\u6570\u5F0F\u306E\u8B58\u5225\u5B50\u306F\u3001%2\u3067\u306F\u306A\u304F\u5B9A\u6570\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n%3\n%4 -ParseException.keywordCollision=%0 (\u884C%1): \u8B58\u5225\u5B50`%2'\u304C\u30AD\u30FC\u30EF\u30FC\u30C9\u3068\u7AF6\u5408\u3057\u3066\u3044\u307E\u3059\u3002\u5FC5\u8981\u306A\u5834\u5408\u306F\u30A8\u30B9\u30B1\u30FC\u30D7\u3055\u308C\u305F\u8B58\u5225\u5B50\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n%3\n%4 -ParseException.methodClash=%0 (\u884C%1): \u30E1\u30BD\u30C3\u30C9\u540D\u304C\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9%2\u3067\u7AF6\u5408\u3057\u3066\u3044\u307E\u3059: %3\u3002\n%4\n%5 -ParseException.moduleNotType=%0 (\u884C%1): %2\u306F\u30E2\u30B8\u30E5\u30FC\u30EB\u3067\u3059\u3002\u578B\u3068\u3057\u3066\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002\n%3\n%4 -ParseException.nestedValueBox=%0 (\u884C%1): \u5024\u30DC\u30C3\u30AF\u30B9\u306F\u30CD\u30B9\u30C8\u3067\u304D\u307E\u305B\u3093\u3002\n%2\n%3 -ParseException.noDefault=%0 (\u884C%1): \u8003\u3048\u3089\u308C\u308B\u3059\u3079\u3066\u306Ecase\u304C\u5B8C\u5168\u306B\u9069\u7528\u3055\u308C\u308B\u5834\u5408\u3001\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u5206\u5C90\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002\n%2\n%3 -ParseException.nonAbstractParent=%0 (\u884C%1): abstract\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9%2\u306F\u975Eabstract\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9%3\u304B\u3089\u7D99\u627F\u3067\u304D\u307E\u305B\u3093\u3002\n%4\n%5 -ParseException.nonAbstractParent2=%0 (\u884C%1): abstract\u5024%2\u306F\u975Eabstract\u5024%3\u304B\u3089\u7D99\u627F\u3067\u304D\u307E\u305B\u3093\u3002\n%4\n%5 -ParseException.nonAbstractParent3=%0 (\u884C%1): \u5024%2\u306F\u6307\u5B9A\u3069\u304A\u308A\u306B\u975Eabstract\u5024%3\u304B\u3089\u7D99\u627F\u3067\u304D\u307E\u305B\u3093\u3002\n%4\n%5 -ParseException.notANumber=%0 (\u884C%1): \u6570\u5024\u304C\u5FC5\u8981\u3067\u3059\u3002%2\u306F\u6709\u52B9\u306A\u6570\u5024\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\n%3\n%4 -ParseException.nothing=%0\u306F\u7A7A\u3067\u3059\u3002\u30B3\u30F3\u30D1\u30A4\u30EB\u3059\u308B\u3082\u306E\u304C\u3042\u308A\u307E\u305B\u3093\u3002 -ParseException.notPosInt=%0 (\u884C%1): %2\u3067\u306F\u306A\u304F\u6B63\u306E\u6574\u6570\u306E\u5B9A\u6570\u304C\u5FC5\u8981\u3067\u3059\u3002\n%3\n%4 -ParseException.oneway=%0 (\u884C%1): %2\u306Foneway\u306B\u306A\u308B\u3088\u3046\u306B\u5BA3\u8A00\u3055\u308C\u307E\u3059\u3002oneway\u30E1\u30BD\u30C3\u30C9\u306F\u3001void\u3092\u8FD4\u3057\u3001\u30D1\u30E9\u30E1\u30FC\u30BF\u5185\u3067\u306E\u307F\u4F7F\u7528\u3057\u3001\u4F8B\u5916\u3092\u767A\u751F\u3057\u306A\u3044\u3088\u3046\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n%3\n%4 -ParseException.operationNotType=%0 (\u884C%1): %2\u306F\u64CD\u4F5C\u3067\u3059\u3002\u578B\u3068\u3057\u3066\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002\n%3\n%4 -ParseException.outOfRange=%0 (\u884C%1): \u5B9A\u6570\u5F0F\u306E\u5024%2\u304C\u578B%3\u306E\u7BC4\u56F2\u3092\u8D85\u3048\u3066\u3044\u307E\u3059\u3002\n%4\n%5 -ParseException.recursive=%0 (\u884C%1): \u552F\u4E00\u306E\u6B63\u3057\u3044\u518D\u5E30\u7684\u5B9A\u7FA9\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059: \u30B7\u30FC\u30B1\u30F3\u30B9<%2> %3\u3002\n%4\n%5 -ParseException.selfInherit=%0 (\u884C%1): %2\u3092\u305D\u308C\u81EA\u4F53\u304B\u3089\u7D99\u627F\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002\n%3\n%4 -ParseException.stringTooLong=%0 (\u884C%1): "%2"\u306F%3\u6587\u5B57\u4EE5\u5185\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n%4\n%5 -ParseException.syntax1=%0 (\u884C%1): `%2'\u304C\u5FC5\u8981\u3067\u3059\u304C\u3001`%3'\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002\n%4\n%5 -ParseException.syntax2=%0 (\u884C%1): %2\u306E1\u3064\u304C\u5FC5\u8981\u3067\u3059\u304C\u3001`%3'\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002\n%4\n%5 -ParseException.unclosed=%0: \u30B3\u30E1\u30F3\u30C8\u3067\u4E88\u671F\u3057\u306A\u3044\u30D5\u30A1\u30A4\u30EB\u306E\u7D42\u308F\u308A\u3092\u691C\u51FA\u3057\u307E\u3057\u305F\u3002 -ParseException.undeclaredType=%0 (\u884C%1): %2\u306F\u5BA3\u8A00\u3055\u308C\u3066\u3044\u306A\u3044\u578B\u3067\u3059\u3002\n%3\n%4 -ParseException.warning=%0 (\u884C%1): %2\n%3\n%4 -ParseException.constExprType=%0 (\u884C%1): \u5B9A\u6570\u5F0F\u306E\u578B\u306F%2\u3067\u3059\u304C\u3001%3\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n%4\n%5 -ParseException.wrongType=%0 (\u884C%1): %2\u306E\u578B\u306F%3\u3067\u3059\u304C\u3001%4\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n%5\n%6 -ParseException.illegalIncompleteTypeReference=%0 (\u884C%1): %2\u578B\u306E\u4E0D\u5B8C\u5168\u306Aforward\u5BA3\u8A00\u3078\u306E\u7121\u52B9\u306A\u53C2\u7167\u3067\u3059\u3002\n%3\n%4 -Preprocessor.unknown=\u4E0D\u660E\u306A\u30D7\u30EA\u30D7\u30ED\u30BB\u30C3\u30B5\u30FB\u30C7\u30A3\u30EC\u30AF\u30C6\u30A3\u30D6`%0'\u3067\u3059\u3002\u884C\u306F\u7121\u8996\u3055\u308C\u307E\u3057\u305F\u3002 -Preprocessor.unknownPragma=\u4E0D\u660E\u306A\u30D7\u30E9\u30B0\u30DE`%0'\u3067\u3059\u3002\u884C\u306F\u7121\u8996\u3055\u308C\u307E\u3057\u305F\u3002 -Preprocessor.undefinedName=\u30D7\u30E9\u30B0\u30DE%0\u306E\u578B\u540D\u304C\u672A\u5B9A\u7FA9\u3067\u3059: %1\u3002\u884C\u306F\u7121\u8996\u3055\u308C\u307E\u3057\u305F\u3002 -Token.boolLit= -Token.charLit= -Token.intLit= -Token.floatLit= -Token.stringLit= -Token.literal= -Token.identifier= -Token.endOfFile=EOF -Token.unknown=? -Util.cantCreatePkg=\u30D1\u30C3\u30B1\u30FC\u30B8%0\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3002 -Version.product=IDL\u30D1\u30FC\u30B5\u30FC\u30FB\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF\u3001\u30D0\u30FC\u30B8\u30E7\u30F3"%0" -Version.number=3.2 -default=\u30A8\u30E9\u30FC\u3002\u5B58\u5728\u3057\u306A\u3044\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u30EA\u30AF\u30A8\u30B9\u30C8\u3055\u308C\u307E\u3057\u305F\u3002\u30E1\u30C3\u30BB\u30FC\u30B8\u30FB\u30D5\u30A1\u30A4\u30EB\u306B\u30AD\u30FC\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u305B\u3093: %0\u3002 - -# Translator: In the list of options below, do not translate: -# -i, -d, -keep, -emitAll, -noWarn, -v, -verbose, -version, #define -# Do not translate the string "java com.sun.tools.corba.se.idl.Compile" - -usage=\u30B3\u30F3\u30D1\u30A4\u30E9\u306E\u4F7F\u7528\u65B9\u6CD5:\n java com.sun.tools.corba.se.idl.Compile [options] \n\u306FIDL\u5B9A\u7FA9\u3092\u542B\u3080\u30D5\u30A1\u30A4\u30EB\u306E\u540D\u524D\u3067\u3001\n[options]\u306F\u6B21\u306B\u30EA\u30B9\u30C8\u3059\u308B\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u7D44\u5408\u305B\u3067\u3059\u3002\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\n\u7701\u7565\u53EF\u80FD\u3067\u3001\u4EFB\u610F\u306E\u9806\u5E8F\u3067\u8868\u793A\u3055\u308C\u307E\u3059\u3002\u306F\u5FC5\u9808\u3067\u3001\n\u6700\u5F8C\u306B\u8868\u793A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n \n\u30AA\u30D7\u30B7\u30E7\u30F3:\n-d IDL\u30D5\u30A1\u30A4\u30EB\u306E\u6B21\u306E\u884C\u3068\n \u540C\u3058\u3067\u3059: #define \n-emitAll #included\u30D5\u30A1\u30A4\u30EB\u3067\u898B\u3064\u304B\u3063\u305F\u30BF\u30A4\u30D7\u3092\u542B\u3080\u3001\u3059\u3079\u3066\u306E\u30BF\u30A4\u30D7\u3092\n \u767A\u884C\u3057\u307E\u3059\u3002\n-i \u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u3001\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30A4\u30F3\u30AF\u30EB\u30FC\u30C9\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB\u304C\n \u30B9\u30AD\u30E3\u30F3\u3055\u308C\u307E\u3059\u3002\u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u5225\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u8FFD\u52A0\u3057\u307E\u3059\u3002\n-keep \u751F\u6210\u3055\u308C\u308B\u30D5\u30A1\u30A4\u30EB\u304C\u3059\u3067\u306B\u5B58\u5728\u3059\u308B\u5834\u5408\u306F\u3001\u4E0A\u66F8\u304D\n \u3057\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u4E0A\u66F8\u304D\u3055\u308C\u307E\u3059\u3002\n-noWarn \u8B66\u544A\u3092\u51FA\u3055\u306A\u3044\u3088\u3046\u306B\u3057\u307E\u3059\u3002\n-v, -verbose \u8A73\u7D30\u30E2\u30FC\u30C9\u3002\n-version \u30D0\u30FC\u30B8\u30E7\u30F3\u756A\u53F7\u3092\u8868\u793A\u3057\u307E\u3059\u3002\n - diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/idl_zh_CN.prp b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/idl_zh_CN.prp deleted file mode 100644 index aa2279cc099..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/idl_zh_CN.prp +++ /dev/null @@ -1,177 +0,0 @@ -# -# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# -# COMPONENT_NAME: idl.parser -# -# ORIGINS: 27 -# -# Licensed Materials - Property of IBM -# 5639-D57 (C) COPYRIGHT International Business Machines Corp., 1997, 1999 -# RMI-IIOP v1.0 -# - -# Translator: Each line below is of the form "=". -# The keys are NOT to be translated. -# The messages ARE to be translated. -# -# DO NOT translate the following: -# ASCII -# #else -# #endif -# IDL -# -# %0, %1, etc. are postional parameters to the message. Do not -# translate these. The number order is the order they are given to -# the message writer. It is OK to change their order in the message -# if the language grammar so dictates. -# -# Lines of the form "%0 (line %1): \n%x\n%y" are error -# messages: %0 is a filename; %1 is a line number; %x is line %1 from -# %0; %y is the error marker. So the message comes out looking like: -# (line xxx): -# Line xxx from where the carat points to the error -# ^ -# So the first two and the last two parameters of these messages must -# remain in their positions. -# -# A backslash (\) at the end of a line is a line continuation -# character. A backslash at the beginning of a line means don't -# ignore leading blanks (they normally are). These backslashes -# should remain in the message. -# -# Translator: Start Translating - -Compile.parsing=\u6B63\u5728\u89E3\u6790 %0 -Compile.parseDone=\u5B8C\u6210 - %0 -Compile.generating=\u6B63\u5728\u751F\u6210 %0 -Compile.genDone=\u5B8C\u6210 - %0 -Deprecated.keyword=\u8B66\u544A: \u5173\u952E\u5B57 `%0' \u5DF2\u8FC7\u65F6\u3002 -EvaluationException.1=%0 \u8FD0\u7B97\u7B26\u7684\u64CD\u4F5C\u6570\u4E0D\u4E00\u81F4: %1 \u548C %2\u3002 -EvaluationException.2=%0 \u8FD0\u7B97\u7B26\u7684\u64CD\u4F5C\u6570\u5FC5\u987B\u662F\u6570\u5B57, \u800C\u4E0D\u662F %1\u3002 -EvaluationException.or=\u6309\u4F4D\u6216 -EvaluationException.xor=\u6309\u4F4D\u5F02\u6216 -EvaluationException.and=\u6309\u4F4D\u4E0E -EvaluationException.plus=\u6DFB\u52A0 -EvaluationException.minus=\u51CF\u6CD5 -EvaluationException.left=\u5411\u5DE6\u79FB\u4F4D -EvaluationException.right=\u5411\u53F3\u79FB\u4F4D -EvaluationException.times=\u4E58\u6CD5 -EvaluationException.divide=\u9664\u6CD5 -EvaluationException.mod=\u53D6\u6A21 -EvaluationException.pos=\u4E00\u5143\u6B63\u6570 -EvaluationException.neg=\u4E00\u5143\u8D1F\u6570 -EvaluationException.not=\u6309\u4F4D\u975E -EvaluationException.booleanNot=\u5E03\u5C14\u975E -EvaluationException.booleanAnd=\u5E03\u5C14\u4E0E -EvaluationException.booleanOr=\u5E03\u5C14\u6216 -EvaluationException.equal=\u7B49\u4E8E -EvaluationException.notEqual=\u4E0D\u7B49\u4E8E -EvaluationException.greaterThan=\u5927\u4E8E -EvaluationException.lessThan=\u5C0F\u4E8E -EvaluationException.greaterEqual=\u5927\u4E8E\u7B49\u4E8E -EvaluationException.lessEqual=\u5C0F\u4E8E\u7B49\u4E8E -GenFileStream.1=\u65E0\u6CD5\u751F\u6210%0: %1 -InvalidArgument.1=\u53C2\u6570\u65E0\u6548: %0\u3002 -InvalidArgument.2=\u672A\u6307\u5B9A IDL \u6587\u4EF6\u3002 -InvalidCharacter.1=%0 (\u884C %1): \u5B57\u7B26\u65E0\u6548: %2 (ASCII %3)\u3002\n%4\n%5 -Migration.futureKeyword=\u8B66\u544A: \u6807\u8BC6\u7B26 `%0' \u4E0E\u5173\u952E\u5B57\u51B2\u7A81; \u8BF7\u4F7F\u7528\u8F6C\u4E49\u6807\u8BC6\u7B26\u4EE5\u786E\u4FDD\u5C06\u6765\u517C\u5BB9\u3002 -Migration.keywordCollision=\u8B66\u544A: \u6807\u8BC6\u7B26 `%0' \u4E0E\u5173\u952E\u5B57\u51B2\u7A81; \u8BF7\u4F7F\u7528\u8F6C\u4E49\u6807\u8BC6\u7B26\u4EE5\u786E\u4FDD\u5C06\u6765\u517C\u5BB9\u3002 -ParseException.abstractValueBox=%0 (\u884C %1): \u4E0D\u80FD\u5C06\u503C\u6846\u58F0\u660E\u4E3A\u62BD\u8C61\u3002\n%2\n%3 -ParseException.alreadyDeclared=%0 (\u884C %1): %2\u5DF2\u58F0\u660E\u3002\n%3\n%4 -ParseException.declNotInSameFile=%0 (\u884C %1): %2\u4EE5\u524D\u66FE\u5728\u6587\u4EF6%3\u7684\u524D\u5411\u58F0\u660E\u4E2D\u58F0\u660E\u3002\n%4\n%5 -ParseException.alreadyDerived=%0 (\u884C %1): %2\u5DF2\u58F0\u660E\u4E3A%3\u7684\u7236\u7EA7\u3002\n%4\n%5 -ParseException.alreadyDefaulted=%0 (\u884C %1): \u5DF2\u9047\u5230\u9ED8\u8BA4\u5206\u652F\u3002\n%2\n%3 -ParseException.alreadyRaised=%0 (\u884C %1): %2\u5DF2\u5728 raise \u5B50\u53E5\u4E2D\u6307\u5B9A\u3002\n%3\n%4 -ParseException.attributeNotType=%0 (\u884C %1): %2 \u662F\u5C5E\u6027\u3002\u4E0D\u80FD\u5C06\u5176\u7528\u4F5C\u7C7B\u578B\u3002\n%3\n%4 -ParseException.badAbstract=%0 (\u884C %1): %2\u7684\u524D\u5411\u58F0\u660E\u548C\u5B9E\u9645\u58F0\u660E\u4E0D\u4E00\u81F4\u3002\u4E00\u4E2A\u662F\u62BD\u8C61\u7684, \u800C\u53E6\u4E00\u4E2A\u4E0D\u662F\u62BD\u8C61\u7684\u3002\n%3\n%4 -ParseException.badCustom=%0 (\u884C %1): \u65E0\u6CD5\u5C06\u524D\u5411\u503C\u58F0\u660E\u58F0\u660E\u4E3A\u5B9A\u5236\u3002\n%2\n%3 -ParseException.badRepIDAlreadyAssigned=%0 (\u884C %1): \u5DF2\u5728\u4E0A\u4E00\u4E2A ID \u7F16\u8BD1\u6307\u793A\u6307\u4EE4\u4E2D\u4E3A\u7C7B\u578B%2\u5206\u914D\u4E86\u8D44\u6599\u6863\u6848\u5E93 ID\u3002\n%3\n%4 -ParseException.badRepIDForm=%0 (\u884C %1): \u8D44\u6599\u6863\u6848\u5E93 ID '%2' \u7684\u683C\u5F0F\u5E94\u4E3A ':'\u3002\n%3\n%4 -ParseException.badRepIDPrefix=%0 (\u884C %1): \u63A5\u53E3 %2 \u7684\u8D44\u6599\u6863\u6848\u5E93 ID \u524D\u7F00\u5E94\u4E3A `%3', \u800C\u975E '%4'\u3002\n%5\n%6 -ParseException.badState=%0 (\u884C %1): %2 \u4E0D\u80FD\u662F\u6709\u72B6\u6001\u63A5\u53E3; \u5B83\u5305\u542B\u591A\u4E2A\u6709\u72B6\u6001\u7236\u7EA7\u3002\n%3\n%4 -ParseException.branchLabel=%0 (\u884C %1): case %2\u5DF2\u58F0\u660E\u3002\n%3\n%4 -ParseException.branchName=%0 (\u884C %1): \u540D\u4E3A%2\u7684\u5206\u652F\u5DF2\u58F0\u660E\u3002\n%3\n%4 -ParseException.duplicateInit=%0 (\u884C %1): \u67D0\u4E2A\u521D\u59CB\u5316\u7A0B\u5E8F\u4E0E\u4E0A\u4E00\u4E2A\u521D\u59CB\u5316\u7A0B\u5E8F\u5177\u6709\u76F8\u540C\u7684\u7B7E\u540D\u3002\n%2\n%3 -ParseException.duplicateState=%0 (\u884C %1): \u6570\u636E\u6210\u5458 %2 \u4E0E\u4E0A\u4E00\u4E2A\u6570\u636E\u6210\u5458\u5177\u6709\u76F8\u540C\u7684\u540D\u79F0\u3002\n%3\n%4 -ParseException.elseNoIf=%0 (\u884C %1): \u9047\u5230\u4E86 #else, \u4F46\u6CA1\u6709\u5339\u914D\u7684 #if\u3002\n%2\n%3 -ParseException.endNoIf=%0 (\u884C %1): \u9047\u5230\u4E86 #endif, \u4F46\u6CA1\u6709\u5339\u914D\u7684 #if\u3002\n%2\n%3 -ParseException.evaluation=%0 (\u884C %1): %2\n%3\n%4 -ParseException.forwardEntry=%0 (\u884C %1): \u5B58\u5728\u9488\u5BF9%2\u7684\u524D\u5411\u5F15\u7528, \u4F46\u5B83\u5C1A\u672A\u5B9A\u4E49\u3002\n%3\n%4 -ParseException.forwardedValueBox=%0 (\u884C %1): %2 \u5177\u6709\u524D\u5411\u58F0\u660E\u3002\u4E0D\u80FD\u5BF9\u503C\u6846\u8FDB\u884C\u524D\u5411\u58F0\u660E\u3002\n%3\n%4 -ParseException.forwardInheritance=%0 (\u884C %1): \u5BF9\u4E8E%2, \u4ECE%3\u7684\u4E0D\u5B8C\u6574\u524D\u5411\u58F0\u660E\u8FDB\u884C\u7EE7\u627F\u662F\u975E\u6CD5\u7684\u3002\n%4\n%5 -ParseException.generic=%0 (\u884C %1): %2\n%3\n%4 -ParseException.illegalArray=%0 (\u884C %1): %2\u4E2D\u67D0\u4E2A\u6570\u7EC4\u7684\u7C7B\u578B\u975E\u6CD5\u3002\n%3\n%4 -ParseException.illegalException=%0 (\u884C %1): %2s \u4E2D\u4E0D\u80FD\u51FA\u73B0\u5F02\u5E38\u9519\u8BEF\u3002\n%3\n%4 -ParseException.invalidConst1=%0 (\u884C %1): \u5E38\u91CF\u8868\u8FBE\u5F0F\u7684\u7C7B\u578B\u5FC5\u987B\u662F%2, \u800C\u4E0D\u80FD\u662F%3\u3002\n%4\n%5 -ParseException.invalidConst2=%0 (\u884C %1): \u5E38\u91CF\u8868\u8FBE\u5F0F\u4E2D\u7684\u6807\u8BC6\u7B26\u5FC5\u987B\u662F\u5E38\u91CF, \u800C\u4E0D\u80FD\u662F%2\u3002\n%3\n%4 -ParseException.keywordCollision=%0 (\u884C %1): \u6807\u8BC6\u7B26 `%2' \u4E0E\u5173\u952E\u5B57\u51B2\u7A81; \u5982\u6709\u5FC5\u8981, \u8BF7\u4F7F\u7528\u8F6C\u4E49\u6807\u8BC6\u7B26\u3002\n%3\n%4 -ParseException.methodClash=%0 (\u884C %1): \u63A5\u53E3 %2 \u4E2D\u7684\u65B9\u6CD5\u540D\u51B2\u7A81: %3\u3002\n%4\n%5 -ParseException.moduleNotType=%0 (\u884C %1): %2 \u662F\u6A21\u5757\u3002\u4E0D\u80FD\u5C06\u5176\u7528\u4F5C\u7C7B\u578B\u3002\n%3\n%4 -ParseException.nestedValueBox=%0 (\u884C %1): \u503C\u6846\u4E0D\u80FD\u5D4C\u5957\u3002\n%2\n%3 -ParseException.noDefault=%0 (\u884C %1): \u5F53\u5B8C\u5168\u6D89\u53CA\u6240\u6709\u53EF\u80FD\u7684 case \u65F6, \u4E0D\u5141\u8BB8\u4F7F\u7528\u9ED8\u8BA4\u5206\u652F\u3002\n%2\n%3 -ParseException.nonAbstractParent=%0 (\u884C %1): \u62BD\u8C61\u63A5\u53E3 %2 \u4E0D\u80FD\u4ECE\u975E\u62BD\u8C61\u63A5\u53E3 %3 \u7EE7\u627F\u3002\n%4\n%5 -ParseException.nonAbstractParent2=%0 (\u884C %1): \u62BD\u8C61\u503C %2 \u4E0D\u80FD\u4ECE\u975E\u62BD\u8C61\u503C %3 \u7EE7\u627F\u3002\n%4\n%5 -ParseException.nonAbstractParent3=%0 (\u884C %1): \u503C %2 \u4E0D\u80FD\u6839\u636E\u6307\u5B9A\u4ECE\u975E\u62BD\u8C61\u503C %3 \u7EE7\u627F\u3002\n%4\n%5 -ParseException.notANumber=%0 (\u884C %1): \u5E94\u4E3A\u6570\u5B57\u3002%2\u4E0D\u662F\u6709\u6548\u7684\u6570\u5B57\u3002\n%3\n%4 -ParseException.nothing=%0\u4E3A\u7A7A\u3002\u6CA1\u6709\u8981\u7F16\u8BD1\u7684\u5BF9\u8C61\u3002 -ParseException.notPosInt=%0 (\u884C %1): \u5E94\u4E3A\u6B63\u6574\u6570\u5E38\u91CF, \u800C\u975E%2\u3002\n%3\n%4 -ParseException.oneway=%0 (\u884C %1): %2\u5DF2\u58F0\u660E\u4E3A\u5355\u5411\u3002\u5355\u5411\u65B9\u6CD5\u5FC5\u987B: \u8FD4\u56DE\u7A7A\u503C; \u53EA\u6709 in \u53C2\u6570; \u4E0D\u5F15\u53D1\u5F02\u5E38\u9519\u8BEF\u3002\n%3\n%4 -ParseException.operationNotType=%0 (\u884C %1): %2\u662F\u8FD0\u7B97\u3002\u4E0D\u80FD\u5C06\u5176\u7528\u4F5C\u7C7B\u578B\u3002\n%3\n%4 -ParseException.outOfRange=%0 (\u884C %1): \u5E38\u91CF\u8868\u8FBE\u5F0F %2 \u7684\u503C\u8D85\u51FA\u4E86\u7C7B\u578B%3\u7684\u8303\u56F4\u3002\n%4\n%5 -ParseException.recursive=%0 (\u884C %1): \u552F\u4E00\u7684\u5408\u6CD5\u9012\u5F52\u5B9A\u4E49\u662F: sequence<%2> %3\u3002\n%4\n%5 -ParseException.selfInherit=%0 (\u884C %1): %2 \u4E0D\u80FD\u4ECE\u81EA\u8EAB\u7EE7\u627F\u3002\n%3\n%4 -ParseException.stringTooLong=%0 (\u884C %1): "%2" \u7684\u957F\u5EA6\u4E0D\u80FD\u8D85\u8FC7 %3 \u4E2A\u5B57\u7B26\u3002\n%4\n%5 -ParseException.syntax1=%0 (\u884C %1): \u5E94\u4E3A `%2'; \u4F46\u9047\u5230 `%3'\u3002\n%4\n%5 -ParseException.syntax2=%0 (\u884C %1): \u5E94\u4E3A %2 \u4E4B\u4E00; \u4F46\u9047\u5230 `%3'\u3002\n%4\n%5 -ParseException.unclosed=%0: \u5728\u6CE8\u91CA\u4E2D\u9047\u5230\u610F\u5916\u7684\u6587\u4EF6\u7ED3\u5C3E\u3002 -ParseException.undeclaredType=%0 (\u884C %1): %2 \u662F\u672A\u58F0\u660E\u7684\u7C7B\u578B\u3002\n%3\n%4 -ParseException.warning=%0 (\u884C %1): %2\n%3\n%4 -ParseException.constExprType=%0 (\u884C %1): \u5E38\u91CF\u8868\u8FBE\u5F0F\u7684\u7C7B\u578B\u4E3A %2, \u4F46\u5E94\u4E3A %3\u3002\n%4\n%5 -ParseException.wrongType=%0 (\u884C %1): %2\u7684\u7C7B\u578B\u4E3A%3, \u4F46\u5E94\u4E3A%4\u3002\n%5\n%6 -ParseException.illegalIncompleteTypeReference=%0 (\u884C %1): \u5BF9\u7C7B\u578B%2\u7684\u4E0D\u5B8C\u6574\u524D\u5411\u58F0\u660E\u7684\u5F15\u7528\u975E\u6CD5\u3002\n%3\n%4 -Preprocessor.unknown=\u672A\u77E5\u7684\u9884\u5904\u7406\u7A0B\u5E8F\u6307\u4EE4 `%0'\u3002\u5DF2\u5FFD\u7565\u884C\u3002 -Preprocessor.unknownPragma=\u672A\u77E5\u7684\u7F16\u8BD1\u6307\u793A\u6307\u4EE4 `%0'\u3002\u5DF2\u5FFD\u7565\u884C\u3002 -Preprocessor.undefinedName=\u7F16\u8BD1\u6307\u793A %0 \u7684\u672A\u5B9A\u4E49\u7C7B\u578B\u540D: %1\u3002\u5DF2\u5FFD\u7565\u884C\u3002 -Token.boolLit=<\u5E03\u5C14\u6587\u5B57> -Token.charLit=<\u5B57\u7B26\u6587\u5B57> -Token.intLit=<\u6574\u578B\u6587\u5B57> -Token.floatLit=<\u6D6E\u70B9\u6587\u5B57> -Token.stringLit=<\u5B57\u7B26\u4E32\u6587\u5B57> -Token.literal=<\u6587\u5B57> -Token.identifier=<\u6807\u8BC6\u7B26> -Token.endOfFile=EOF -Token.unknown=? -Util.cantCreatePkg=\u65E0\u6CD5\u521B\u5EFA\u7A0B\u5E8F\u5305%0\u3002 -Version.product=IDL \u89E3\u6790\u5668\u6846\u67B6, \u7248\u672C "%0" -Version.number=3.2 -default=\u9519\u8BEF! \u8BF7\u6C42\u4E86\u4E0D\u5B58\u5728\u7684\u6D88\u606F\u3002\u6D88\u606F\u6587\u4EF6\u672A\u5305\u542B\u5173\u952E\u5B57: %0\u3002 - -# Translator: In the list of options below, do not translate: -# -i, -d, -keep, -emitAll, -noWarn, -v, -verbose, -version, #define -# Do not translate the string "java com.sun.tools.corba.se.idl.Compile" - -usage=\u7F16\u8BD1\u5668\u7528\u6CD5:\n java com.sun.tools.corba.se.idl.Compile [\u9009\u9879] \n\u5176\u4E2D, \u662F\u5305\u542B IDL \u5B9A\u4E49\u7684\u6587\u4EF6\u7684\u540D\u79F0, \u800C\n[\u9009\u9879] \u662F\u4E0B\u5217\u9009\u9879\u7684\u4EFB\u610F\u7EC4\u5408\u3002\u8FD9\u4E9B\u9009\u9879\n\u662F\u53EF\u9009\u7684, \u5E76\u4E14\u663E\u793A\u987A\u5E8F\u5E76\u4E0D\u56FA\u5B9A; \u662F\u5FC5\u9700\u7684\n\u5E76\u4E14\u5FC5\u987B\u663E\u793A\u5728\u6700\u540E\u3002\n \n\u9009\u9879:\n-d <\u7B26\u53F7> \u8FD9\u7B49\u540C\u4E8E IDL \u6587\u4EF6\u4E2D\u7684\n \u4E0B\u9762\u4E00\u884C: #define <\u7B26\u53F7>\n-emitAll \u53D1\u51FA\u6240\u6709\u7C7B\u578B, \u5305\u62EC\u5728 #included\n \u6587\u4EF6\u4E2D\u627E\u5230\u7684\u7C7B\u578B\u3002\n-i <\u5305\u542B\u8DEF\u5F84> \u9ED8\u8BA4\u60C5\u51B5\u4E0B, \u5C06\u5728\u5F53\u524D\u76EE\u5F55\u4E2D\u626B\u63CF\n \u5305\u542B\u7684\u6587\u4EF6\u3002\u6B64\u9009\u9879\u5C06\u6DFB\u52A0\u53E6\u4E00\u4E2A\u76EE\u5F55\u3002\n-keep \u5982\u679C\u8981\u751F\u6210\u7684\u6587\u4EF6\u5DF2\u5B58\u5728, \u8BF7\u4E0D\u8981\n \u8986\u76D6\u5B83\u3002\u9ED8\u8BA4\u60C5\u51B5\u4E0B\u4F1A\u8986\u76D6\u5B83\u3002\n-noWarn \u9690\u85CF\u8B66\u544A\u3002\n-v, -verbose \u8BE6\u7EC6\u6A21\u5F0F\u3002\n-version \u663E\u793A\u7248\u672C\u53F7\u3002\n - diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ir.idl b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ir.idl deleted file mode 100644 index 921a7cf9d77..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ir.idl +++ /dev/null @@ -1,778 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * This file contains OMG IDL from CORBA V2.0, July 1995. - * It also contains the TypeCode creation APIs in CORBA::ORB - **/ - -#pragma prefix "omg.org" - -module CORBA { - typedef string Identifier; - typedef string ScopedName; - typedef string RepositoryId; - - enum DefinitionKind { - dk_none, dk_all, - dk_Attribute, dk_Constant, dk_Exception, dk_Interface, - dk_Module, dk_Operation, dk_Typedef, - dk_Alias, dk_Struct, dk_Union, dk_Enum, - dk_Primitive, dk_String, dk_Sequence, dk_Array, - dk_Repository, - dk_Wstring, dk_Fixed, - dk_Value, dk_ValueBox, dk_ValueMember, // orbos 98-01-18: Objects By Value - dk_Native - }; - - - interface IRObject - /** - An IRObject IDL interface represents the most generic interface - from which all other Interface Repository interfaces are derived, - even the Repository itself. - */ - { - // read interface - readonly attribute DefinitionKind def_kind; - - // write interface - void destroy (); - }; - - - - typedef string VersionSpec; - - interface Contained; - interface Repository; - interface Container; - - interface Contained : IRObject - /** - The Contained Interface is inherited by all Interface Repository - interfaces that are contained by other objects. - */ - { - // read/write interface - - attribute RepositoryId id; - attribute Identifier name; - attribute VersionSpec version; - - // read interface - - readonly attribute Container defined_in; - readonly attribute ScopedName absolute_name; - readonly attribute Repository containing_repository; - - struct Description { - DefinitionKind kind; - any value; - }; - - Description describe (); - - // write interface - - void move ( - in Container new_container, - in Identifier new_name, - in VersionSpec new_version - ); - }; - - - interface ModuleDef; - interface ConstantDef; - interface IDLType; - interface StructDef; - interface UnionDef; - interface EnumDef; - interface AliasDef; - interface InterfaceDef; - interface ExceptionDef; - interface ValueDef; // orbos 98-01-18: Objects By Value - interface ValueMemberDef; // orbos 98-01-18: Objects By Value - interface ValueBoxDef; // orbos 98-01-18: Objects By Value - interface NativeDef; - - - typedef sequence InterfaceDefSeq; - - - typedef sequence ContainedSeq; - - struct StructMember { - Identifier name; - TypeCode type; - IDLType type_def; - }; - typedef sequence StructMemberSeq; - - struct UnionMember { - Identifier name; - any label; - TypeCode type; - IDLType type_def; - }; - typedef sequence UnionMemberSeq; - - - typedef sequence EnumMemberSeq; - - // orbos 98-01-18: Objects By Value -- begin - typedef short Visibility; - const Visibility PRIVATE_MEMBER = 0; - const Visibility PUBLIC_MEMBER = 1; - - struct ValueMember { - Identifier name; - RepositoryId id; - RepositoryId defined_in; - VersionSpec version; - TypeCode type; - IDLType type_def; - Visibility access; - }; - typedef sequence ValueMemberSeq; - - struct Initializer { - StructMemberSeq members; - }; - typedef sequence InitializerSeq; - - typedef sequence ValueDefSeq; - - // orbos 98-01-18: Objects By Value -- end - - - interface Container : IRObject - /** - The Container interface is used to form a containment hierarchy - in the Interface Repository. A Container can contain any number - of objects derived from the Contained interface. - */ - { - // read interface - - Contained lookup ( in ScopedName search_name); - - ContainedSeq contents ( - in DefinitionKind limit_type, - in boolean exclude_inherited - ); - - ContainedSeq lookup_name ( - in Identifier search_name, - in long levels_to_search, - in DefinitionKind limit_type, - in boolean exclude_inherited - ); - - struct Description { - Contained contained_object; - DefinitionKind kind; - any value; - }; - - typedef sequence DescriptionSeq; - - DescriptionSeq describe_contents ( - in DefinitionKind limit_type, - in boolean exclude_inherited, - in long max_returned_objs - ); - - // write interface - - ModuleDef create_module ( - in RepositoryId id, - in Identifier name, - in VersionSpec version - ); - - ConstantDef create_constant ( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in IDLType type, - in any value - ); - - StructDef create_struct ( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in StructMemberSeq members - ); - - UnionDef create_union ( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in IDLType discriminator_type, - in UnionMemberSeq members - ); - - EnumDef create_enum ( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in EnumMemberSeq members - ); - - AliasDef create_alias ( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in IDLType original_type - ); - - ExceptionDef create_exception ( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in StructMemberSeq members - ); - - - InterfaceDef create_interface ( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in boolean is_abstract, - in InterfaceDefSeq base_interfaces - ); - - // orbos 98-01-18: Objects By Value - ValueDef create_value( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in boolean is_custom, - in boolean is_abstract, - in octet flags, // must be 0 - in ValueDef base_value, - in boolean has_safe_base, - in ValueDefSeq abstract_base_values, - in InterfaceDefSeq supported_interfaces, - in InitializerSeq initializers - ); - - // orbos 98-01-18: Objects By Value - ValueBoxDef create_value_box( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in IDLType original_type_def - ); - - NativeDef create_native( - in RepositoryId id, - in Identifier name, - in VersionSpec version - ); - - }; - - - - interface IDLType : IRObject - /** - The IDLType interface is an abstract interface inherited by all - IR objects that represent the OMG IDL types. It provides access - to the TypeCode describing the type, and is used in defining the - other interfaces wherever definitions of IDLType must be referenced. - */ - { - readonly attribute TypeCode type; - }; - - - - interface PrimitiveDef; - interface StringDef; - interface SequenceDef; - interface ArrayDef; - - enum PrimitiveKind { - pk_null, pk_void, pk_short, pk_long, pk_ushort, pk_ulong, - pk_float, pk_double, pk_boolean, pk_char, pk_octet, - pk_any, pk_TypeCode, pk_Principal, pk_string, pk_objref - }; - - interface Repository : Container - /** - Repository is an interface that provides global access to the - Interface Repository. Repository objects can contain constants, - typedefs, exceptions, interfaces, and modules. - */ - { - // read interface - - Contained lookup_id (in RepositoryId search_id); - - PrimitiveDef get_primitive (in PrimitiveKind kind); - - // write interface - - StringDef create_string (in unsigned long bound); - - SequenceDef create_sequence ( - in unsigned long bound, - in IDLType element_type - ); - - ArrayDef create_array ( - in unsigned long length, - in IDLType element_type - ); - }; - - - interface ModuleDef : Container, Contained - /** - A ModuleDef can contain constants, typedefs, exceptions, interfaces, - and other module objects. - */ - { - }; - - struct ModuleDescription { - Identifier name; - RepositoryId id; - RepositoryId defined_in; - VersionSpec version; - }; - - - interface ConstantDef : Contained - /** - A ConstantDef object defines a named constant. - */ - { - readonly attribute TypeCode type; - attribute IDLType type_def; - attribute any value; - }; - - struct ConstantDescription { - Identifier name; - RepositoryId id; - RepositoryId defined_in; - VersionSpec version; - TypeCode type; - any value; - }; - - - interface TypedefDef : Contained, IDLType - /** - TypedefDef is an abstract interface used as a base interface for - all named non-object types(structures, unions, enumerations, - aliases). The TypedefDef interface is not inherited by the definition - objects for the primitive or anonymous types. - */ - { - }; - - struct TypeDescription { - Identifier name; - RepositoryId id; - RepositoryId defined_in; - VersionSpec version; - TypeCode type; - }; - - - interface StructDef : TypedefDef, Container - /** - A StructDef represents an OMG IDL structure definition. - */ - { - attribute StructMemberSeq members; - }; - - - interface UnionDef : TypedefDef, Container - /** - A UnionDef represents an OMG IDL union definition. - */ - { - readonly attribute TypeCode discriminator_type; - attribute IDLType discriminator_type_def; - attribute UnionMemberSeq members; - }; - - - interface EnumDef : TypedefDef - /** - A EnumDef represents an OMG IDL enum definition. - */ - { - attribute EnumMemberSeq members; - }; - - - interface AliasDef : TypedefDef - /** - An AliasDef represents an OMG IDL typedef that aliases other - definition. - */ - { - attribute IDLType original_type_def; - }; - - - interface PrimitiveDef: IDLType - /** - A PrimitiveDef represents one of the IDL primitive types. As - primitive types are unnamed, this interface is not derived from - TypedefDef or Contained. - */ - { - readonly attribute PrimitiveKind kind; - }; - - - interface StringDef : IDLType - /** - A StringDef represents an OMG IDL string type. As string - types are anonymous, this interface is not derived from TypedefDef - or Contained. - */ - { - attribute unsigned long bound; - }; - - - interface SequenceDef : IDLType - /** - A SequenceDef represents an OMG IDL sequence type. As sequence - types are anonymous, this interface is not derived from TypedefDef - or Contained. - */ - { - attribute unsigned long bound; - readonly attribute TypeCode element_type; - attribute IDLType element_type_def; - }; - - interface ArrayDef : IDLType - /** - An ArrayDef represents an OMG IDL array type. As array - types are anonymous, this interface is not derived from TypedefDef - or Contained. - */ - { - attribute unsigned long length; - readonly attribute TypeCode element_type; - attribute IDLType element_type_def; - }; - - - interface ExceptionDef : Contained, Container - /** - An ExceptionDef represents an exception definition. - */ - { - readonly attribute TypeCode type; - attribute StructMemberSeq members; - }; - struct ExceptionDescription { - Identifier name; - RepositoryId id; - RepositoryId defined_in; - VersionSpec version; - TypeCode type; - }; - - - - enum AttributeMode {ATTR_NORMAL, ATTR_READONLY}; - - interface AttributeDef : Contained - /** - An AttributeDef represents the information that defines an - attribute of an interface. - */ - { - readonly attribute TypeCode type; - attribute IDLType type_def; - attribute AttributeMode mode; - }; - - struct AttributeDescription { - Identifier name; - RepositoryId id; - RepositoryId defined_in; - VersionSpec version; - TypeCode type; - AttributeMode mode; - }; - - - - enum OperationMode {OP_NORMAL, OP_ONEWAY}; - - enum ParameterMode {PARAM_IN, PARAM_OUT, PARAM_INOUT}; - struct ParameterDescription { - Identifier name; - TypeCode type; - IDLType type_def; - ParameterMode mode; - }; - typedef sequence ParDescriptionSeq; - - typedef Identifier ContextIdentifier; - typedef sequence ContextIdSeq; - - typedef sequence ExceptionDefSeq; - typedef sequence ExcDescriptionSeq; - - interface OperationDef : Contained - /** - An OperationDef represents the information that defines an - operation of an interface. - */ - { - readonly attribute TypeCode result; - attribute IDLType result_def; - attribute ParDescriptionSeq params; - attribute OperationMode mode; - attribute ContextIdSeq contexts; - attribute ExceptionDefSeq exceptions; - }; - - struct OperationDescription { - Identifier name; - RepositoryId id; - RepositoryId defined_in; - VersionSpec version; - TypeCode result; - OperationMode mode; - ContextIdSeq contexts; - ParDescriptionSeq parameters; - ExcDescriptionSeq exceptions; - }; - - - - typedef sequence RepositoryIdSeq; - typedef sequence OpDescriptionSeq; - typedef sequence AttrDescriptionSeq; - - interface InterfaceDef : Container, Contained, IDLType - /** - An InterfaceDef object represents an interface definition. It can - contains constants, typedefs, exceptions, operations, and - attributes. - */ - { - // read/write interface - - attribute InterfaceDefSeq base_interfaces; - attribute boolean is_abstract; - - // read interface - - boolean is_a (in RepositoryId interface_id); - - struct FullInterfaceDescription { - Identifier name; - RepositoryId id; - RepositoryId defined_in; - VersionSpec version; - boolean is_abstract; - OpDescriptionSeq operations; - AttrDescriptionSeq attributes; - RepositoryIdSeq base_interfaces; - TypeCode type; - }; - - FullInterfaceDescription describe_interface(); - - // write interface - - AttributeDef create_attribute ( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in IDLType type, - in AttributeMode mode - ); - - OperationDef create_operation ( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in IDLType result, - in OperationMode mode, - in ParDescriptionSeq params, - in ExceptionDefSeq exceptions, - in ContextIdSeq contexts - ); - }; - - struct InterfaceDescription { - Identifier name; - RepositoryId id; - RepositoryId defined_in; - VersionSpec version; - RepositoryIdSeq base_interfaces; - }; - - - // orbos 98-01-18: Objects By Value -- begin - - interface ValueMemberDef : Contained - - /** A ValueMemberDef object represents the public - and private data member definition of a Value type - */ - - { - readonly attribute TypeCode type; - attribute IDLType type_def; - attribute Visibility access; - }; - - interface ValueDef : Container, Contained, IDLType - /** - A ValueDef object represents the definition of the - Value object used to pass the object state - between hosts - */ - - { - // read/write interface - attribute InterfaceDefSeq supported_interfaces; - attribute InitializerSeq initializers; - attribute ValueDef base_value; - attribute ValueDefSeq abstract_base_values; - attribute boolean is_abstract; - attribute boolean is_custom; - attribute octet flags; // always 0 - attribute boolean has_safe_base; - - // read interface - boolean is_a(in RepositoryId value_id); - - struct FullValueDescription { - Identifier name; - RepositoryId id; - boolean is_abstract; - boolean is_custom; - octet flags; // always 0 - RepositoryId defined_in; - VersionSpec version; - OpDescriptionSeq operations; - AttrDescriptionSeq attributes; - ValueMemberSeq members; - InitializerSeq initializers; - RepositoryIdSeq supported_interfaces; - RepositoryIdSeq abstract_base_values; - boolean has_safe_base; - RepositoryId base_value; - TypeCode type; - }; - - FullValueDescription describe_value(); - - // write interface - - ValueMemberDef create_value_member( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in IDLType type_def, - in Visibility access - ); - - AttributeDef create_attribute( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in IDLType type, - in AttributeMode mode - ); - - OperationDef create_operation( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in IDLType result, - in OperationMode mode, - in ParDescriptionSeq params, - in ExceptionDefSeq exceptions, - in ContextIdSeq contexts - ); - }; - struct ValueDescription { - Identifier name; - RepositoryId id; - boolean is_abstract; - boolean is_custom; - octet flags; // always 0 - RepositoryId defined_in; - VersionSpec version; - RepositoryIdSeq supported_interfaces; - RepositoryIdSeq abstract_base_values; - boolean has_safe_base; - RepositoryId base_value; - }; - - interface ValueBoxDef : IDLType - - /** ValueBoxDef is an interface that reresents a value type with - a single data member inside its state section and no - inheritance or methods. For example, when transmitting a - string or sequence as an actual parameter on an interface - operation or as a data member of a value type that is an - actual parameter, it may be important to preserve any sharing - of the string or sequence within the object graph being - transmitted. Because current IDL data types do not preserve - referential integrity in this way, this requirement is - conveniently handled by using a value type. Value types also - support the transmission of nulls (as a distinguished value), - whereas IDL data types such as string and sequence (which are - mapped to empty strings and sequences) do not. The Java to IDL - mapping requires both preservation of referential integrity - and transmission of nulls. Because it would be cumbersome to - require the full IDL syntax for a value type for this specific - usage, this shorthand notation is introduced to cover this use - of value types for simple containment of a single data member. - */ - -{ - attribute IDLType original_type_def; - }; - - // orbos 98-01-18: Objects By Value -- end - - interface NativeDef : TypedefDef { - }; -}; diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/keywords b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/keywords deleted file mode 100644 index fddd6f2a540..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/keywords +++ /dev/null @@ -1,81 +0,0 @@ -IDL Tokens: - -Grouping: ( ) [ ] { } -Separators: : :: ; -Operators: % & * + , - / < << = > >> ^ | ~ - -Keywords: - CORBA 2.2 or earlier: - any - attribute - boolean - case - char - const - context - default - double - enum - exception - FALSE - float - in - inout - interface - long - module - Object - octet - oneway - out - raises - readonly - sequence - short - string - struct - switch - TRUE - typedef - unsigned - union - void - wchar - wstring - - CORBA 2.3 only: - init (replaced by factory) - - CORBA 2.3 and 2.4rtf: - abstract - custom - private - public - truncatable - ValueBase - valuetype - factory - - CORBA 2.3, not supported by IBM compiler - native - fixed - - CORBA 3.0: - component - consumes - emits - finder - getRaises - home - import - local - manages - multiple - primaryKey - provides - publishes - setRaises - supports - typeId - typePrefix - uses diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/orb.idl b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/orb.idl deleted file mode 100644 index 81ed1af8ed2..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/orb.idl +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -// IDL not generated by rmic, do not edit -// These are all in IDL module CORBA -// The Java classes are in the package org.omg.CORBA -// See ValueType Semantics:Standard Value Box Definitions (5.3) in CORBA 2.3 spec - -#ifndef __org_omg_CORBA__ -#define __org_omg_CORBA__ - -#pragma prefix "omg.org" - -module CORBA{ - - valuetype StringValue string; - valuetype WStringValue wstring; - -}; - -#include "ir.idl" - -#pragma prefix "" - -#endif diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/som/cff/FileLocator.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/som/cff/FileLocator.java deleted file mode 100644 index d6e00e9797d..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/som/cff/FileLocator.java +++ /dev/null @@ -1,418 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997,1998 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.som.cff; - -import java.lang.Exception; -import java.lang.String; -import java.lang.System; -import java.io.BufferedInputStream; -import java.io.DataInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; -import java.io.IOException; -import java.util.Locale; -import java.util.NoSuchElementException; -import java.util.Properties; -import java.util.StringTokenizer; -import java.util.zip.*; - -/** - * FileLocator is an abstract class (one that cannot be instantiated) that - * provides class methods for finding files in the directories or zip - * archives that make up the CLASSPATH. - * - * @author Larry K. Raper - */ -public abstract class FileLocator extends Object { - - /* Class variables */ - - - static final Properties pp = System.getProperties (); - static final String classPath = pp.getProperty ("java.class.path", "."); - static final String pathSeparator = pp.getProperty ("path.separator", ";"); - - /* Instance variables */ - - /* [None, no instances of this class are ever instantiated.] */ - - /** - * locateClassFile returns a DataInputStream with mark/reset - * capability that can be used to read the requested class file. The - * CLASSPATH is used to locate the class. - * - * @param classFileName The name of the class to locate. The class name - * should be given in fully-qualified form, for example: - *

            -     *     java.lang.Object
            -     *     java.io.DataInputStream
            -     * 
            - * - * @exception java.io.FileNotFoundException The requested class file - * could not be found. - * @exception java.io.IOException The requested class file - * could not be opened. - */ - public static DataInputStream locateClassFile (String classFileName) - throws FileNotFoundException, IOException { - - boolean notFound = true; - StringTokenizer st; - String path = ""; - String pathNameForm; - File cf = null; - NamedDataInputStream result; - - st = new StringTokenizer (classPath, pathSeparator, false); - pathNameForm = classFileName.replace ('.', File.separatorChar) + - ".class"; - - while (st.hasMoreTokens () && notFound) { - - try {path = st.nextToken ();} - catch (NoSuchElementException nse) {break;} - int pLen = path.length (); - String pathLast4 = pLen > 3 ? path.substring (pLen - 4) : ""; - if (pathLast4.equalsIgnoreCase (".zip") || - pathLast4.equalsIgnoreCase (".jar")) { - - try { - - result = locateInZipFile (path, classFileName, true, true); - if (result == null) - continue; - return (DataInputStream) result; - - } catch (ZipException zfe) { - continue; - } catch (IOException ioe) { - continue; - } - - } else { - try {cf = new File (path + File.separator + pathNameForm); - } catch (NullPointerException npe) { continue; } - if ((cf != null) && cf.exists ()) - notFound = false; - } - } - - if (notFound) { - - /* Make one last attempt to find the file in the current - * directory - */ - - int lastdot = classFileName.lastIndexOf ('.'); - String simpleName = - (lastdot >= 0) ? classFileName.substring (lastdot+1) : - classFileName; - - result = new NamedDataInputStream (new BufferedInputStream ( - new FileInputStream (simpleName + ".class")), - simpleName + ".class", false); - return (DataInputStream) result; - } - - result = new NamedDataInputStream (new BufferedInputStream ( - new FileInputStream (cf)), path + File.separator + pathNameForm, - false); - return (DataInputStream) result; - - } - - /** - * locateLocaleSpecificFileInClassPath returns a DataInputStream that - * can be used to read the requested file, but the name of the file is - * determined using information from the current locale and the supplied - * file name (which is treated as a "base" name, and is supplemented with - * country and language related suffixes, obtained from the current - * locale). The CLASSPATH is used to locate the file. - * - * @param fileName The name of the file to locate. The file name - * may be qualified with a partial path name, using '/' as the separator - * character or using separator characters appropriate for the host file - * system, in which case each directory or zip file in the CLASSPATH will - * be used as a base for finding the fully-qualified file. - * Here is an example of how the supplied fileName is used as a base - * for locating a locale-specific file: - * - *
            -     *     Supplied fileName: a/b/c/x.y,  current locale: US English
            -     *
            -     *                     Look first for: a/b/c/x_en_US.y
            -     *     (if that fails) Look next for:  a/b/c/x_en.y
            -     *     (if that fails) Look last for:  a/b/c/x.y
            -     *
            -     *     All elements of the class path are searched for each name,
            -     *     before the next possible name is tried.
            -     * 
            - * - * @exception java.io.FileNotFoundException The requested class file - * could not be found. - * @exception java.io.IOException The requested class file - * could not be opened. - */ - public static DataInputStream locateLocaleSpecificFileInClassPath ( - String fileName) throws FileNotFoundException, IOException { - - String localeSuffix = "_" + Locale.getDefault ().toString (); - int lastSlash = fileName.lastIndexOf ('/'); - int lastDot = fileName.lastIndexOf ('.'); - String fnFront, fnEnd; - DataInputStream result = null; - boolean lastAttempt = false; - - if ((lastDot > 0) && (lastDot > lastSlash)) { - fnFront = fileName.substring (0, lastDot); - fnEnd = fileName.substring (lastDot); - } else { - fnFront = fileName; - fnEnd = ""; - } - - while (true) { - if (lastAttempt) - result = locateFileInClassPath (fileName); - else try { - result = locateFileInClassPath (fnFront + localeSuffix + fnEnd); - } catch (Exception e) { /* ignore */ } - if ((result != null) || lastAttempt) - break; - int lastUnderbar = localeSuffix.lastIndexOf ('_'); - if (lastUnderbar > 0) - localeSuffix = localeSuffix.substring (0, lastUnderbar); - else - lastAttempt = true; - } - return result; - - } - - /** - * locateFileInClassPath returns a DataInputStream that can be used - * to read the requested file. The resource is located in the java.corba - * module or if not found, then the CLASSPATH is searched. - * - * @param fileName The name of the file to locate. The file name - * may be qualified with a partial path name, using '/' as the separator - * character or using separator characters appropriate for the host file - * system, in which case each directory or zip file in the CLASSPATH will - * be used as a base for finding the fully-qualified file. - * - * @exception java.io.FileNotFoundException The requested class file - * could not be found. - * @exception java.io.IOException The requested class file - * could not be opened. - */ - public static DataInputStream locateFileInClassPath (String fileName) - throws FileNotFoundException, IOException { - - // The resource should be in the java.corba module - InputStream in = FileLocator.class.getResourceAsStream("/" + fileName); - if (in != null) { - return new DataInputStream(in); - } - - boolean notFound = true; - StringTokenizer st; - String path = ""; - File cf = null; - NamedDataInputStream result; - - String zipEntryName = File.separatorChar == '/' ? fileName : - fileName.replace (File.separatorChar, '/'); - - String localFileName = File.separatorChar == '/' ? fileName : - fileName.replace ('/', File.separatorChar); - - st = new StringTokenizer (classPath, pathSeparator, false); - - while (st.hasMoreTokens () && notFound) { - - try {path = st.nextToken ();} - catch (NoSuchElementException nse) {break;} - int pLen = path.length (); - String pathLast4 = pLen > 3 ? path.substring (pLen - 4) : ""; - if (pathLast4.equalsIgnoreCase (".zip") || - pathLast4.equalsIgnoreCase (".jar")) { - - try { - - result = locateInZipFile (path, zipEntryName, false, false); - if (result == null) - continue; - return (DataInputStream) result; - - } catch (ZipException zfe) { - continue; - } catch (IOException ioe) { - continue; - } - - } else { - try {cf = new File (path + File.separator + localFileName); - } catch (NullPointerException npe) { continue; } - if ((cf != null) && cf.exists ()) - notFound = false; - } - } - - if (notFound) { - - /* Make one last attempt to find the file in the current - * directory - */ - - int lastpart = localFileName.lastIndexOf (File.separator); - String simpleName = - (lastpart >= 0) ? localFileName.substring (lastpart+1) : - localFileName; - - result = new NamedDataInputStream (new BufferedInputStream ( - new FileInputStream (simpleName)), simpleName, false); - return (DataInputStream) result; - } - - result = new NamedDataInputStream (new BufferedInputStream ( - new FileInputStream (cf)), path + File.separator + localFileName, - false); - return (DataInputStream) result; - - } - - /** - * Returns the fully qualified file name associated with the passed - * DataInputStream if the DataInputStream was created using one - * of the static locate methods supplied with this class, otherwise - * returns a zero length string. - */ - public static String getFileNameFromStream (DataInputStream ds) { - - if (ds instanceof NamedDataInputStream) - return ((NamedDataInputStream) ds).fullyQualifiedFileName; - return ""; - - } - - /** - * Returns an indication of whether the passed DataInputStream is - * associated with a member of a zip file if the DataInputStream was - * created using one of the static locate methods supplied with this - * class, otherwise returns false. - */ - public static boolean isZipFileAssociatedWithStream (DataInputStream ds) { - - if (ds instanceof NamedDataInputStream) - return ((NamedDataInputStream) ds).inZipFile; - return false; - - } - - private static NamedDataInputStream locateInZipFile (String zipFileName, - String fileName, boolean wantClass, boolean buffered) - throws ZipException, IOException { - - ZipFile zf; - ZipEntry ze; - zf = new ZipFile (zipFileName); - - if (zf == null) - return null; - String zeName = wantClass ? - fileName.replace ('.', '/') + ".class" : - fileName; - - // This code works with JDK 1.0 level SUN zip classes - // - - // ze = zf.get (zeName); - // if (ze == null) - // return null; - // return new NamedDataInputStream ( - // new BufferedInputStream (new ZipInputStream (ze)), - // zipFileName + '(' +zeName + ')', true); - - // This code works with JDK 1.0.2 and JDK 1.1 level SUN zip classes - // - - ze = zf.getEntry (zeName); - if (ze == null) { - zf.close(); // D55355, D56419 - zf = null; - return null; - } - InputStream istream = zf.getInputStream(ze); - if (buffered) - istream = new BufferedInputStream(istream); - return new NamedDataInputStream (istream, - zipFileName + '(' + zeName + ')', true); - - } - -} - -/** - * This class is used to associate a filename with a DataInputStream - * The host platform's file naming conventions are assumed for the filename. - * - * @author Larry K. Raper - * - */ -/* default access */ class NamedDataInputStream extends DataInputStream { - - /* Instance variables */ - - /** - * The name of the file associated with the DataInputStream. - */ - public String fullyQualifiedFileName; - - /** - * Indicates whether or not the file is contained in a .zip file. - */ - public boolean inZipFile; - - /* Constructors */ - - protected NamedDataInputStream (InputStream in, String fullyQualifiedName, - boolean inZipFile) { - - super (in); - this.fullyQualifiedFileName = fullyQualifiedName; - this.inZipFile = inZipFile; - - } - -} diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/som/cff/Messages.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/som/cff/Messages.java deleted file mode 100644 index 60dd7c3b72d..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/som/cff/Messages.java +++ /dev/null @@ -1,356 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997,1998 - * RMI-IIOP v1.0 - * - * Defect History - * - * #26964 LKR 11/25/96 \u0020 at end-of-message not handled properly by Java. - * #31840 LKR 06/05/97 Replace \n in templates with Java's line separator. - * - */ - -package com.sun.tools.corba.se.idl.som.cff; - -import java.io.IOException; -import java.util.Enumeration; -import java.util.Properties; -import java.lang.String; -import java.lang.System; - -/** - * This class provides messaging services for accessing, and merging - * parameters into, translatable message text. The text is presumed - * to reside in a .properties file. A "cff.properties" file that - * contains all of the message text needed for the CFF framework itself - * is loaded during class initialization. All of the messages in the - * cff.properties file that are needed by the CFF framework contain keys - * that begin with the string "cff.". - *

            - * The static method Messages.msgLoad may be used to merge additional - * message text .properties files needed by other frameworks or user - * programs. - * - * @see com.sun.tools.corba.se.idl.som.cff.Messages#msgLoad - * - * @author Larry K. Raper - */ - -public abstract class Messages { - - /* Class variables */ - - - /* Metasymbol for leading or trailing blank */ - private static final String LTB = "%B"; - /* Metasymbol for line separator */ - private static final char NL = '\n'; - - private static final String lineSeparator = - System.getProperty ("line.separator"); - - private static final Properties m = new Properties (); - private static boolean loadNeeded = true; - - /* Class methods for message loading and formatting */ - - private static final synchronized void loadDefaultProperties () { - - if (!loadNeeded) - return; - try { - m.load (FileLocator.locateLocaleSpecificFileInClassPath ( - "com/sun/tools/corba/se/idl/som/cff/cff.properties")); - } catch (IOException ioe) { } - fixMessages (m); /* #26964 Replace any metasymbols */ - loadNeeded = false; - - } - - /** - * This method was introduced to fix defect #26964. For Java 1.0.2 - * on Win NT, the escape sequence \u0020 was not being handled - * correctly by the Java Properties class when it was the final - * character of a line. Instead the trailing blank was dropped - * and the next line was swallowed as a continuation. To work - * around the problem, we introduced our own metasymbol to represent - * a trailing blank. Hence: - * - * Performs substitution for any metasymbols in the message - * templates. So far only %B is needed. This was introduced - * to make it more convenient for .properties files to - * contain message templates with leading or trailing blanks - * (although %B may actually occur anywhere in a template). - * Subsequently, checking for '\n' has also been added. Now, - * wherever '\n' occurs in a message template, it is replaced - * with the value of System.getProperty ("line.separator"). - */ - private static final void fixMessages (Properties p) { - - Enumeration keys = p.keys (); - Enumeration elems = p.elements (); - while (keys.hasMoreElements ()) { - String key = (String) keys.nextElement (); - String elem = (String) elems.nextElement (); - int i = elem.indexOf (LTB); - boolean changed = false; - while (i != -1) { - if (i == 0) - elem = " " + elem.substring (2); - else - elem = elem.substring (0, i) + " " + elem.substring (i+2); - changed = true; - i = elem.indexOf (LTB); - } - int lsIncr = lineSeparator.length () - 1; - for (i=0; i - * If the msgkey cannot be found, its value is used as the - * message text. - */ - public static final String msg (String msgkey, String parm) { - - if (loadNeeded) - loadDefaultProperties (); - String msgtext = m.getProperty (msgkey, msgkey); - int i = msgtext.indexOf ("%1"); - if (i >= 0) { - String ending = ""; - if ((i+2) < msgtext.length ()) - ending = msgtext.substring (i+2); - return msgtext.substring (0, i) + parm + ending; - } else - msgtext += " " + parm; - return msgtext; - - } - - /** - * Returns the message text corresponding to the passed msgkey - * string. The message text is assumed to require the insertion - * of a single argument, supplied by the "parm" parameter. - * If the message text does not contain the meta characters "%1" - * that indicate where to place the argument, the passed argument - * is appended at the end of the message text. - *

            - * If the msgkey cannot be found, its value is used as the - * message text. - */ - public static final String msg (String msgkey, int parm) { - - return msg (msgkey, String.valueOf (parm)); - - } - - /** - * Returns the message text corresponding to the passed msgkey - * string. The message text is assumed to require the insertion - * of two arguments, supplied by the "parm1" and "parm2" parameters. - * If the message text does not contain the meta characters "%1" and - * "%2" that indicate where to place the arguments, the passed arguments - * are appended at the end of the message text. - *

            - * If the msgkey cannot be found, its value is used as the - * message text. - */ - public static final String msg (String msgkey, String parm1, String parm2) { - - if (loadNeeded) - loadDefaultProperties (); - String result = m.getProperty (msgkey, msgkey); - String ending = ""; - int i = result.indexOf ("%1"); - if (i >= 0) { - if ((i+2) < result.length ()) - ending = result.substring (i+2); - result = result.substring (0, i) + parm1 + ending; - } else - result += " " + parm1; - i = result.indexOf ("%2"); - if (i >= 0) { - ending = ""; - if ((i+2) < result.length ()) - ending = result.substring (i+2); - result = result.substring (0, i) + parm2 + ending; - } else - result += " " + parm2; - return result; - - } - - /** - * Returns the message text corresponding to the passed msgkey - * string. The message text is assumed to require the insertion - * of two arguments, supplied by the "parm1" and "parm2" parameters. - * If the message text does not contain the meta characters "%1" and - * "%2" that indicate where to place the arguments, the passed arguments - * are appended at the end of the message text. - *

            - * If the msgkey cannot be found, its value is used as the - * message text. - */ - public static final String msg (String msgkey, int parm1, String parm2) { - - return msg (msgkey, String.valueOf (parm1), parm2); - - } - - /** - * Returns the message text corresponding to the passed msgkey - * string. The message text is assumed to require the insertion - * of two arguments, supplied by the "parm1" and "parm2" parameters. - * If the message text does not contain the meta characters "%1" and - * "%2" that indicate where to place the arguments, the passed arguments - * are appended at the end of the message text. - *

            - * If the msgkey cannot be found, its value is used as the - * message text. - */ - public static final String msg (String msgkey, String parm1, int parm2) { - - return msg (msgkey, parm1, String.valueOf (parm2)); - - } - - /** - * Returns the message text corresponding to the passed msgkey - * string. The message text is assumed to require the insertion - * of two arguments, supplied by the "parm1" and "parm2" parameters. - * If the message text does not contain the meta characters "%1" and - * "%2" that indicate where to place the arguments, the passed arguments - * are appended at the end of the message text. - *

            - * If the msgkey cannot be found, its value is used as the - * message text. - */ - public static final String msg (String msgkey, int parm1, int parm2) { - - return msg (msgkey, String.valueOf (parm1), String.valueOf (parm2)); - - } - - - /** - * Returns the message text corresponding to the passed msgkey - * string. The message text is assumed to require the insertion - * of three arguments, supplied by the "parm1", "parm2" and "parm3" - * parameters. - * If the message text does not contain the meta characters "%1" and - * "%2" that indicate where to place the arguments, the passed arguments - * are appended at the end of the message text. - *

            - * If the msgkey cannot be found, its value is used as the - * message text. - */ - public static final String msg (String msgkey, String parm1, - String parm2, String parm3) { - if (loadNeeded) - loadDefaultProperties (); - String result = m.getProperty (msgkey, msgkey); - result = substituteString(result, 1, parm1); - result = substituteString(result, 2, parm2); - result = substituteString(result, 3, parm3); - - return result; - } - - /* helper function for string substition. - @return the substituted string, it substitution is possible. - Otherwise, return a new string with subst at the end. - @orig: original string - @paramNum the parameter number to search. For example, - paramNam == 1 means search for "%1". - @subst: string for the substitution. - */ - private static String substituteString(String orig, int paramNum, - String subst){ - String result = orig; - String paramSubst = "%"+ paramNum; - int len = paramSubst.length(); - int index = result.indexOf (paramSubst); - String ending = ""; - if (index >= 0) { - if ((index+len) < result.length ()) - ending = result.substring (index+len); - result = result.substring (0, index) + subst + ending; - } - else result += " " + subst; - - return result; - } - - -} diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/som/idlemit/MetaPragma.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/som/idlemit/MetaPragma.java deleted file mode 100644 index 262a2d2e6f3..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/som/idlemit/MetaPragma.java +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: shasta - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997,1998,1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.som.idlemit; -import java.util.Vector; -import com.sun.tools.corba.se.idl.som.cff.Messages; -/** - * This is an implementation that handles - * #pragma meta scoped_name string - * where - *

              - *
            • scoped_name == "::" separated scoped name - *
            • string == separated identifiers, such as "localonly", - * "abstract", or "init". - * D59407: NOTE: any non-white-space is grouped - * as part of the identifier. - *
            - * - * This pragma handler places a vector of Strings into the dynamicVariable() - * part of the SymtabEntry. The key to access the dynamicVariable() - * is com.sun.tools.corba.se.idl.som.idlemit.MetaPragma.metaKey - * - * It is possible to associate a meta pragma with a forward entry. - * At some point after the parser has completed, - * the method processForward(ForwardEntry entry) should be called - * for each ForwardEntry so that the meta information can be folded from - * the ForwardEntry into the corresponding InterfaceEntry. - */ -public class MetaPragma extends com.sun.tools.corba.se.idl.PragmaHandler { - /* Class variables */ - - /* key to access the Cached meta info in com.sun.tools.corba.se.idl.SymtabEntry */ - public static int metaKey = com.sun.tools.corba.se.idl.SymtabEntry.getVariableKey(); - - - /** - * Main entry point for the MetaPragma handler - * @param pragma string for pragma name - * @param currentToken next token in the input stream. - * @return true if this is a meta pragma. - */ - public boolean process(String pragma, String currentToken) { - if ( !pragma.equals("meta")) - return false; - - com.sun.tools.corba.se.idl.SymtabEntry entry ; - String msg; - try { - entry = scopedName(); - if ( entry == null){ - /* scoped name not found */ - parseException(Messages.msg("idlemit.MetaPragma.scopedNameNotFound")); - skipToEOL(); - } - else { - msg = (currentToken()+ getStringToEOL()); -// System.out.println(entry + ": " + msg); - Vector v; - v = (Vector) entry.dynamicVariable(metaKey); - if ( v== null){ - v = new Vector(); - entry.dynamicVariable(metaKey, v); - } - parseMsg(v, msg); - } - } catch(Exception e){ -// System.out.println("exception in MetaPragma"); - } - return true; - } - - - /** - * Fold the meta info from the forward entry into its corresponding - * interface entry. - * @param forwardEntry the forward entry to process - */ - static public void processForward(com.sun.tools.corba.se.idl.ForwardEntry forwardEntry){ - - Vector forwardMeta; - try { - forwardMeta = (Vector)forwardEntry.dynamicVariable(metaKey); - } catch (Exception e){ - forwardMeta = null; - } - com.sun.tools.corba.se.idl.SymtabEntry forwardInterface = forwardEntry.type(); - if (forwardMeta != null && forwardInterface!= null) { - Vector interfaceMeta; - try { - interfaceMeta= (Vector)forwardInterface.dynamicVariable(metaKey); - } catch ( Exception e){ - interfaceMeta = null; - } - - if ( interfaceMeta == null) { - /* set */ - try { - forwardInterface.dynamicVariable(MetaPragma.metaKey, forwardMeta); - } catch(Exception e){}; - } - else if (interfaceMeta != forwardMeta) { - /* The above check is needed because sometimes - a forward entry is processed more the once. - Not sure why */ - /* merge */ - for (int i=0; i < forwardMeta.size(); i++){ - try { - Object obj = forwardMeta.elementAt(i); - interfaceMeta.addElement(obj); - } catch (Exception e){}; - } - } - } - } - - /** - * parse pragma message and place into vector v. - * @param v: vector to add message - * @param msg: string of comma separated message, perhaps with comment. - * This is implemented as a state machine as follows: - * - * State token next action - * ----------------------------------------------------- - * initial whitespace initial - * initial SlashStar comment - * initial SlashSlash final - * initial no more final - * initial text text add to text buffer - * initial StarSlash initial - * comment StarSlash initial - * comment SlashStar comment - * comment whitespace comment - * comment SlashSlash comment - * comment text comment - * comment no more final - * text text text add to buffer - * text SlashStar comment put in vector - * text whitespace initial put in vector - * text SlashSlash final put in vector - * text StarSlash initial put in vector - * text no more final put in vector - * - */ - private static int initialState = 0; - private static int commentState = 1; - private static int textState = 2; - private static int finalState =3; - - private void parseMsg(Vector v, String msg){ - int state = initialState; - String text = ""; - int index = 0; - while ( state != finalState ){ - boolean isNoMore = index >= msg.length(); - char ch = ' '; - boolean isSlashStar = false; - boolean isSlashSlash = false; - boolean isWhiteSpace = false; - boolean isStarSlash = false; - boolean isText = false; - if (!isNoMore ){ - ch = msg.charAt(index); - if (ch == '/' && index+1 < msg.length()){ - if (msg.charAt(index+1) == '/'){ - isSlashSlash = true; - index++; - } - else if (msg.charAt(index+1) == '*'){ - isSlashStar= true; - index++; - } else isText = true; - } - else if (ch == '*' && index+1 < msg.length() ){ - if (msg.charAt(index+1) == '/'){ - isStarSlash = true; - index++; - } else isText = true; - } - else if ( Character.isSpace(ch) || (ch == ',') // 59601 - || (ch == ';') ) // 59683 - isWhiteSpace = true; - else isText = true; - } - - if (state == initialState){ - if (isSlashStar){ - state = commentState; - } - else if (isSlashSlash || isNoMore){ - state = finalState; - } - else if (isText){ - state = textState; - text = text+ ch; - } - } - else if (state == commentState){ - if (isNoMore){ - state = finalState; - } - else if ( isStarSlash){ - state = initialState; - } - } - else if (state == textState){ - if (isNoMore || isStarSlash || isSlashSlash || - isSlashStar || isWhiteSpace ){ - if (!text.equals("")) { - v.addElement(text); -// System.err.println("adding " + text); - text = ""; - } - if (isNoMore) - state = finalState; - else if (isSlashStar) - state = commentState; - else state = initialState; - } - else if (isText){ - text = text+ch; - } - } - index++; - } - } - -} diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Arguments.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Arguments.java deleted file mode 100644 index 6620608e8aa..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Arguments.java +++ /dev/null @@ -1,342 +0,0 @@ -/* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: -// -09/23/98 Ported -td option to change output directory -// -09/23/98 Ported -m option to generate make dependencies -// -F46082.51 Transferred -m, -mmin, mall, -mdepend options to com.sun.tools.corba.se.idl.toJava -// since these are IBM-specific (see f46838); cleaned-out dead code. -// -D57482 Added method setDefaultEmitter so could be overridden. -// -F60858.1 Set corba level to 2.3. - -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Properties; -import java.util.Vector; -import java.io.File; - -import com.sun.tools.corba.se.idl.InvalidArgument; - -/** - * - **/ -public class Arguments extends com.sun.tools.corba.se.idl.Arguments -{ - /** - * Public, zero-argument constructor. - **/ - public Arguments () - { - super (); - corbaLevel = 2.4f; - } // ctor - - /** - * - **/ - protected void parseOtherArgs (String[] args, - Properties properties) throws InvalidArgument - { - String skeletonPattern = null ; - String tiePattern = null ; - - // Get package prefixes from user's properties file. - packages.put ("CORBA", "org.omg"); // klr - always needed - packageFromProps (properties); - - // Now get package prefixes from command line (along with other args). - // This order has the effect of making command line packages - // supercede any idl.config file packages. - try - { - Vector unknownArgs = new Vector (); - - // Process command line parameters - for (int i = 0; i < args.length; ++i) - { - String lcArg = args[i].toLowerCase (); - - if (lcArg.charAt (0) != '-' && lcArg.charAt (0) != '/') - throw new InvalidArgument (args[i]); - if (lcArg.charAt (0) == '-' ) { - lcArg = lcArg.substring (1); - } - - // Proxy options; default is -fclient. - if (lcArg.startsWith ("f")) - { - // If the command line had '-f client', make it '-fclient' - if (lcArg.equals ("f")) - lcArg = 'f' + args[++i].toLowerCase (); - - // Determine whether to emit bindings for client, server or both; and - // whether to emit delegate-style (TIE) rather than derived-style - // skeletons, which are the default. - - if (lcArg.equals ("fclient")) - { - emit = ((emit == Server || emit == All) ? All : Client); - } - else if (lcArg.equals ("fserver")) - { - emit = ((emit == Client || emit == All) ? All : Server); - TIEServer = false; - } - else if (lcArg.equals ("fall")) - { - emit = All; - TIEServer = false; - //Should be removed and incorporated in the clause below - // POAServer = true; - } - else if (lcArg.equals ("fservertie")) - { - emit = ((emit == Client || emit == All) ? All : Server); - TIEServer = true; - } - else if (lcArg.equals ("falltie")) - { - emit = All; - TIEServer = true; - } - else - i = collectUnknownArg (args, i, unknownArgs); - } - else if (lcArg.equals ("pkgtranslate")) - { - if (i + 2 >= args.length) - throw new InvalidArgument( args[i] ) ; - - String orig = args[++i] ; - String trans = args[++i] ; - checkPackageNameValid( orig ) ; - checkPackageNameValid( trans ) ; - if (orig.equals( "org" ) || orig.startsWith( "org.omg" )) - throw new InvalidArgument( args[i] ) ; - orig = orig.replace( '.', '/' ) ; - trans = trans.replace( '.', '/' ) ; - packageTranslation.put( orig, trans ) ; - } - // Package prefix - else if (lcArg.equals ("pkgprefix")) - { - if (i + 2 >= args.length) - throw new InvalidArgument (args[i]); - - String type = args[++i]; - String pkg = args[++i]; - checkPackageNameValid( type ) ; - checkPackageNameValid( pkg ) ; - packages.put (type, pkg); - } - // Target directory - else if (lcArg.equals ("td")) // - { - if (i + 1 >= args.length) - throw new InvalidArgument (args[i]); - String trgtDir = args[++i]; - if (trgtDir.charAt (0) == '-') - throw new InvalidArgument (args[i - 1]); - else - { - targetDir = trgtDir.replace ('/', File.separatorChar); - if (targetDir.charAt (targetDir.length () - 1) != File.separatorChar) - targetDir = targetDir + File.separatorChar; - } - } - // Separator - else if (lcArg.equals ("sep")) - { - if (i + 1 >= args.length) - throw new InvalidArgument (args[i]); - separator = args[++i]; - } - // POA flag ? - else if (lcArg.equals ("oldimplbase")){ - POAServer = false; - } - else if (lcArg.equals("skeletonname")){ - if (i + 1 >= args.length) - throw new InvalidArgument (args[i]); - skeletonPattern = args[++i]; - } - else if (lcArg.equals("tiename")){ - if (i + 1 >= args.length) - throw new InvalidArgument (args[i]); - tiePattern = args[++i]; - } - else if (lcArg.equals("localoptimization")) { - LocalOptimization = true; - } - else i = collectUnknownArg (args, i, unknownArgs); - } - - // Encountered unknown arguments? - if (unknownArgs.size () > 0) - { - String [] otherArgs = new String [unknownArgs.size ()]; - unknownArgs.copyInto (otherArgs); - // Throws InvalidArgument by default - super.parseOtherArgs (otherArgs, properties); - } - - setDefaultEmitter(); // d57482 - setNameModifiers( skeletonPattern, tiePattern ) ; - } - catch (ArrayIndexOutOfBoundsException e) - { - // If there is any array indexing problem, it is probably - // because the qualifier on the last argument is missing. - // Report that this last argument is invalid. - throw new InvalidArgument (args[args.length - 1]); - } - } // parseOtherArgs - - /** - * - **/ - protected int collectUnknownArg (String[] args, int i, Vector unknownArgs) - { - unknownArgs.addElement (args [i]); - ++i; - while (i < args.length && args[i].charAt (0) != '-' && args[i].charAt (0) != '/') - unknownArgs.addElement (args[i++]); - return --i; - } // collectUnknownArg - - /** - * - **/ - // XXX Either generalize this facility or remove it completely. - protected void packageFromProps (Properties props) throws InvalidArgument - { - Enumeration propsEnum = props.propertyNames (); - while (propsEnum.hasMoreElements ()) - { - String prop = (String)propsEnum.nextElement (); - if (prop.startsWith ("PkgPrefix.")) - { - String type = prop.substring (10); - String pkg = props.getProperty (prop); - checkPackageNameValid( pkg ) ; - checkPackageNameValid( type ) ; - packages.put (type, pkg); - } - } - } // packageFromProps - - /** - * d57482 (klr) method added so default emitter check could be overriden. - **/ - protected void setDefaultEmitter () { - // If the flag -fclient was not found, assume it. - if (emit == None) emit = Client; - } - - protected void setNameModifiers( String skeletonPattern, - String tiePattern ) { - if (emit>Client) { - String tp ; - String sp ; - - if (skeletonPattern != null) - sp = skeletonPattern ; - else if (POAServer) - sp = "%POA" ; - else - sp = "_%ImplBase" ; - - if (tiePattern != null) - tp = tiePattern ; - else if (POAServer) - tp = "%POATie" ; - else - tp = "%_Tie" ; - - skeletonNameModifier = new NameModifierImpl( sp ) ; - tieNameModifier = new NameModifierImpl( tp ) ; - } - } - - /** - * - **/ - private void checkPackageNameValid (String name) throws InvalidArgument - { - if (name.charAt (0) == '.') - throw new InvalidArgument (name); - for (int i = 0; i < name.length ();++i) - if (name.charAt (i) == '.') - { - if (i == name.length () - 1 || !Character.isJavaIdentifierStart (name.charAt (++i))) - throw new InvalidArgument (name); - } - else if (!Character.isJavaIdentifierPart (name.charAt (i))) - throw new InvalidArgument (name); - } // validatePackageName - - // <46082.03><46838> Modified access restrictions from protected to public. - - // This is a hash table whose keys are top-level typenames and - // whose values are the package prefixes to those types. - // For instance, <"CORBA", "org.omg"> is a possible entry. - public Hashtable packages = new Hashtable (); - - public String separator = null; - - public static final int - None = 0, - Client = 1, - Server = 2, - All = 3; - public int emit = None; - public boolean TIEServer = false; - public boolean POAServer = true; - // By default we do not generate Locally Optimized stub because of an - // unresolved PI problem. We will generate only if -localOptimization flag - // is passed - public boolean LocalOptimization = false; - public NameModifier skeletonNameModifier = null ; - public NameModifier tieNameModifier = null ; - - // Key is original package name; value is translated package name. - // Note that this translation happens AFTER prefixes are added in the - // packages table. - public Hashtable packageTranslation = new Hashtable() ; - - public String targetDir = ""; // -} // class Arguments diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/AttributeGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/AttributeGen.java deleted file mode 100644 index 6e7c7b17626..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/AttributeGen.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Enumeration; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.AttributeEntry; -import com.sun.tools.corba.se.idl.InterfaceEntry; -import com.sun.tools.corba.se.idl.MethodEntry; -import com.sun.tools.corba.se.idl.ParameterEntry; -import com.sun.tools.corba.se.idl.SymtabEntry; - -/** - * - **/ -public class AttributeGen extends MethodGen implements com.sun.tools.corba.se.idl.AttributeGen -{ - /** - * Public zero-argument constructor. - **/ - public AttributeGen () - { - } // ctor - - /** - * - **/ - private boolean unique (InterfaceEntry entry, String name) - { - // Compare the name to the methods of this interface - Enumeration methods = entry.methods ().elements (); - while (methods.hasMoreElements ()) - { - SymtabEntry method = (SymtabEntry)methods.nextElement (); - if (name.equals (method.name ())) - return false; - } - - // Recursively call unique on each derivedFrom interface - Enumeration derivedFrom = entry.derivedFrom ().elements (); - while (derivedFrom.hasMoreElements ()) - if (!unique ((InterfaceEntry)derivedFrom.nextElement (), name)) - return false; - - // If the name isn't in any method, nor in any method of the - // derivedFrom interfaces, then the name is unique. - return true; - } // unique - - /** - * Method generate() is not used in MethodGen. They are replaced by the - * more granular interfaceMethod, stub, skeleton, dispatchSkeleton. - **/ - public void generate (Hashtable symbolTable, AttributeEntry m, PrintWriter stream) - { - } // generate - - /** - * - **/ - protected void interfaceMethod (Hashtable symbolTable, MethodEntry m, PrintWriter stream) - { - AttributeEntry a = (AttributeEntry)m; - - // Generate for the get method - super.interfaceMethod (symbolTable, a, stream); - - // Generate for the set method if the attribute is not readonly - if (!a.readOnly ()) - { - setupForSetMethod (); - super.interfaceMethod (symbolTable, a, stream); - clear (); - } - } // interfaceMethod - - /** - * - **/ - protected void stub (String className, boolean isAbstract, Hashtable symbolTable, MethodEntry m, PrintWriter stream, int index) - { - AttributeEntry a = (AttributeEntry)m; - - // Generate for the get method - super.stub (className, isAbstract, symbolTable, a, stream, index); - - // Generate for the set method if the attribute is not readonly - if (!a.readOnly ()) - { - setupForSetMethod (); - super.stub (className, isAbstract, symbolTable, a, stream, index + 1); - clear (); - } - } // stub - - /** - * - **/ - protected void skeleton (Hashtable symbolTable, MethodEntry m, PrintWriter stream, int index) - { - AttributeEntry a = (AttributeEntry)m; - - // Generate for the get method - super.skeleton (symbolTable, a, stream, index); - - // Generate for the set method if the attribute is not readonly - if (!a.readOnly ()) - { - setupForSetMethod (); - super.skeleton (symbolTable, a, stream, index + 1); - clear (); - } - } // skeleton - - /** - * - **/ - protected void dispatchSkeleton (Hashtable symbolTable, MethodEntry m, PrintWriter stream, int index) - { - AttributeEntry a = (AttributeEntry)m; - - // Generate for the get method - super.dispatchSkeleton (symbolTable, a, stream, index); - - // Generate for the set method if the attribute is not readonly - if (!a.readOnly ()) - { - setupForSetMethod (); - super.dispatchSkeleton (symbolTable, m, stream, index + 1); - clear (); - } - } // dispatchSkeleton - - private SymtabEntry realType = null; - - /** - * - **/ - protected void setupForSetMethod () - { - ParameterEntry parm = Compile.compiler.factory.parameterEntry (); - parm.type (m.type ()); - parm.name ("new" + Util.capitalize (m.name ())); - m.parameters ().addElement (parm); - realType = m.type (); - m.type (null); - } // setupForSetMethod - - /** - * - **/ - protected void clear () - { - // Set back to normal - m.parameters ().removeAllElements (); - m.type (realType); - } // clear -} // class AttributeGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/AttributeGen24.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/AttributeGen24.java deleted file mode 100644 index a06904311e9..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/AttributeGen24.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: -// -D62023 New file to implement CORBA 2.4 RTF -// REVISIT: These changes should be folded into AttributeGen. - -import java.io.PrintWriter; - -import java.util.Enumeration; -import java.util.Vector; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.InterfaceEntry; -import com.sun.tools.corba.se.idl.MethodEntry; -import com.sun.tools.corba.se.idl.ParameterEntry; -import com.sun.tools.corba.se.idl.SymtabEntry; -import com.sun.tools.corba.se.idl.AttributeEntry; - -/** - * - **/ -public class AttributeGen24 extends MethodGenClone24 -{ - /** - * Public zero-argument constructor. - **/ - public AttributeGen24 () - { - } // ctor - - /** - * (d62023-klr) Added for 2.4 RTF - **/ - protected void abstractMethod (Hashtable symbolTable, MethodEntry m, PrintWriter stream) - { - AttributeEntry a = (AttributeEntry)m; - - // Generate for the get method - super.abstractMethod (symbolTable, a, stream); - - // Generate for the set method if the attribute is not readonly - if (!a.readOnly ()) - { - setupForSetMethod (); - super.abstractMethod (symbolTable, a, stream); - clear (); - } - } // abstractMethod - - /** - * (d62023-klr) Added for 2.4 RTF - **/ - protected void interfaceMethod (Hashtable symbolTable, MethodEntry m, PrintWriter stream) - { - AttributeEntry a = (AttributeEntry)m; - - // Generate for the get method - super.interfaceMethod (symbolTable, a, stream); - - // Generate for the set method if the attribute is not readonly - if (!a.readOnly ()) - { - setupForSetMethod (); - super.interfaceMethod (symbolTable, a, stream); - clear (); - } - } // interfaceMethod - -} // class AttributeGen24 diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/AuxGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/AuxGen.java deleted file mode 100644 index d9071cadb49..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/AuxGen.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: - -/** - * - **/ -public interface AuxGen -{ - void generate (java.util.Hashtable symbolTable, com.sun.tools.corba.se.idl.SymtabEntry entry); -} // interface AuxGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Compile.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Compile.java deleted file mode 100644 index 08aecd1dac5..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Compile.java +++ /dev/null @@ -1,430 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: -// -09/23/98 KLR Ported -m updates (F46838.1-3) -// -f46082.51 Transferred makefile list generation (for ODE delta-builds, -// see f46838) to toJava; cleaned-out dead code. -// -D58319 Display version info. for -version option. -// -D58951 Modify to allow QuickTest to build. -// -D49526 Remove "TypeCode" symbol from preParse(). -// -D58591 Publicise _factories and compile for QuickTest. Need to revert -// t0 private and add accessor methods. -// -D59437 Fill typename information for value boxes. - -import java.io.File; -import java.io.IOException; -import java.io.BufferedWriter; -import java.io.FileWriter; -import java.io.PrintWriter; - -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Vector; - -import com.sun.tools.corba.se.idl.GenFileStream; -import com.sun.tools.corba.se.idl.SymtabFactory; -import com.sun.tools.corba.se.idl.IncludeEntry; -import com.sun.tools.corba.se.idl.InterfaceEntry; -import com.sun.tools.corba.se.idl.InterfaceState; -import com.sun.tools.corba.se.idl.ModuleEntry; -import com.sun.tools.corba.se.idl.PrimitiveEntry; -import com.sun.tools.corba.se.idl.SequenceEntry; -import com.sun.tools.corba.se.idl.StructEntry; -import com.sun.tools.corba.se.idl.SymtabEntry; -import com.sun.tools.corba.se.idl.TypedefEntry; -import com.sun.tools.corba.se.idl.UnionBranch; -import com.sun.tools.corba.se.idl.UnionEntry; -import com.sun.tools.corba.se.idl.ValueEntry; -import com.sun.tools.corba.se.idl.ValueBoxEntry; -import com.sun.tools.corba.se.idl.InvalidArgument; - -/** - * Compiler usage: - *

            - * - * java com.sun.tools.corba.se.idl.toJavaPortable.Compile [options] <idl file> - *

            - * - * where <idl file> is the name of a file containing IDL definitions, - * and [options] is any combination of the options listed below. The options - * may appear in any order. - *

            - * - * Options: - *
            - *
            {@code -i } - *
            By default, the current directory is scanned for included files. - * This option adds another directory. See also the note below. - * - *
            {@code -d } - *
            This is equivalent to the following line in an IDL file: - * {@code #define } - * - *
            {@code -f } - *
            Defines what bindings to emit. {@code } is one of client, server, all, - * serverTIE, allTIE. serverTIE and allTIE cause delegate model skeletons - * to be emitted. If this flag is not used, -fclient is assumed. - * allPOA has the same effect as all, except for generation POA type skeletons. - * - *
            {@code -keep} - *
            If a file to be generated already exists, do not overwrite it. By - * default it is overwritten. - * - *
            {@code -sep } - *
            Only valid with -m. Replace the file separator character with - * {@code } in the file names listed in the .u file. - * - *
            {@code -emitAll} - *
            Emit all types, including those found in #included files. - * - *
            {@code -v} - *
            Verbose mode. - * - *
            {@code -pkgPrefix } - *
            Whereever {@code } is encountered, make sure it resides within - * {@code } in all generated files. {@code } is a fully - * qualified, java-style name. - *
            - * - * Note: If you have an include path or paths that you will always - * be using, it can get tedious putting these on the command with the -i - * option all the time. Instead, these can be placed into a config file - * called idl.config. This file must be in the CLASSPATH. The format of - * the includes line is: - * - *
            {@code
            - * includes=;;...;
            - * }
            - * - * Note that the path separator character, here shown as a semicolon, - * is machine dependent. For instance, on Windows 95 this character - * is a semicolon, on UNIX it is a colon. - **/ -public class Compile extends com.sun.tools.corba.se.idl.Compile -{ - /** - * - **/ - public static void main (String[] args) - { - compiler = new Compile (); - compiler.start (args); - } // main - - /** - * - **/ - public void start (String[] args) - { - try - { - // Use generator-specific messages file. - //Util.registerMessageFile ("com/sun/corba/se/idl/toJavaPortable/toJava.prp"); - Util.registerMessageFile ("com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable.prp"); - init (args); - if (arguments.versionRequest) - displayVersion (); - else - { - preParse (); - Enumeration e = parse (); - if (e != null) - { - preEmit (e); - generate (); - // Move ODE delta-build support to toJava - //if (((Arguments)arguments).genMakefileLists) - // generateMakefileLists (); - } - } - } - catch (InvalidArgument e) - { - System.err.println (e); - } - catch (IOException e) - { - System.err.println (e); - } - } // start - - /** - * - **/ - protected Compile () - { - factory = factories ().symtabFactory (); - } // ctor - - // _factories was made public for QuickTest to operate correctly, - // but the code needs to be changed to this: - //private Factories _factories = null; - //protected com.sun.tools.corba.se.idl.Factories factories () - //{ - // if (_factories == null) - // _factories = new Factories (); - // return _factories; - //} // factories - - public Factories _factories = new Factories (); // 58974 - changed for quicktest - protected com.sun.tools.corba.se.idl.Factories factories () - { - return _factories; - } // factories - - - ModuleEntry org; - ModuleEntry omg; - ModuleEntry corba; - InterfaceEntry object; - - /** - * - **/ - protected void preParse () - { - Util.setSymbolTable (symbolTable); - Util.setPackageTranslation( ((Arguments)arguments).packageTranslation ) ; - - // Need modules for the predefined objects - org = factory.moduleEntry (); - // Suppress generation of this module. If the parser reopens it - // while parsing the main IDL source, any definitions appearing in the module - // -- and not appearing in a global-scope include file -- will be added to - // the emit list with emit=true for eventual generation. - org.emit (false); - org.name ("org"); - org.container (null); - omg = factory.moduleEntry (); - omg.emit (false); // - omg.name ("omg"); - omg.module ("org"); - omg.container (org); - org.addContained (omg); - corba = factory.moduleEntry (); - corba.emit (false); // - corba.name ("CORBA"); - corba.module ("org/omg"); - corba.container (omg); - omg.addContained (corba); - symbolTable.put ("org", org); - symbolTable.put ("org/omg", omg); - symbolTable.put ("org/omg/CORBA", corba); - - // Add CORBA::Object to symbol table. - object = (InterfaceEntry)symbolTable.get ("Object"); - object.module ("org/omg/CORBA"); - object.container (corba); - symbolTable.put ("org/omg/CORBA/Object", object); - - // Add PIDL type (primitive) CORBA::TypeCode to symbol table. - PrimitiveEntry pEntry = factory.primitiveEntry (); - pEntry.name ("TypeCode"); - pEntry.module ("org/omg/CORBA"); - pEntry.container (corba); - symbolTable.put ("org/omg/CORBA/TypeCode", pEntry); - symbolTable.put ("CORBA/TypeCode", pEntry); // - overrideNames.put ("CORBA/TypeCode", "org/omg/CORBA/TypeCode"); // - overrideNames.put ("org/omg/CORBA/TypeCode", "CORBA/TypeCode"); // - // Allow user to specify types named "TypeCode" - //symbolTable.put ("TypeCode", pEntry); - //overrideNames.put ("TypeCode", "org/omg/CORBA/TypeCode"); - - // CORBA::Principal is deprecated! - // Add PIDL type (primitive) CORBA::Principal to symbol table. - pEntry = factory.primitiveEntry (); - pEntry.name ("Principal"); - pEntry.module ("org/omg/CORBA"); - pEntry.container (corba); - symbolTable.put ("org/omg/CORBA/Principle", pEntry); - symbolTable.put ("CORBA/Principal", pEntry); - overrideNames.put ("CORBA/Principal", "org/omg/CORBA/Principal"); - overrideNames.put ("org/omg/CORBA/Principal", "CORBA/Principal"); - - // Add PIDL type (interface) CORBA::Current to symbol table. - //InterfaceEntry iEntry = factory.interfaceEntry (); - //iEntry.name ("Current"); - //iEntry.module ("org/omg/CORBA"); - //iEntry.container (corba); - //symbolTable.put ("org/omg/CORBA/Current", iEntry); - //symbolTable.put ("CORBA/Current", iEntry); - //overrideNames.put ("CORBA/Current", "org/omg/CORBA/Current"); - //overrideNames.put ("org/omg/CORBA/Current", "CORBA/Current"); - - overrideNames.put ("TRUE", "true"); - overrideNames.put ("FALSE", "false"); - //overrideNames.put ("any", "org/omg/CORBA/Any"); - - // Add CORBA module to symbol table - symbolTable.put ("CORBA", corba); // 55699 - overrideNames.put ("CORBA", "org/omg/CORBA"); // - overrideNames.put ("org/omg/CORBA", "CORBA"); // - } // preParse - - - protected void preEmit (Enumeration emitList) - { - typedefInfo = SymtabEntry.getVariableKey (); - Hashtable tempST = (Hashtable)symbolTable.clone (); - - for (Enumeration e = tempST.elements (); e.hasMoreElements ();) - { - SymtabEntry element = (SymtabEntry)e.nextElement (); - - // Any other symbolTable processing? - preEmitSTElement (element); - } - - // Do this processing AFTER any other processing to get the - // correct names. - Enumeration elements = symbolTable.elements (); - while (elements.hasMoreElements ()) - { - // Find all TypedefEntry's and fill in the SymtabEntry.info - // field with it's real type , including [][]... with const - // exprs. - SymtabEntry element = (SymtabEntry)elements.nextElement (); - if (element instanceof TypedefEntry || element instanceof SequenceEntry) - Util.fillInfo (element); - - // Members of constructed types may now be value boxes, and value - // boxes may contain types that are directly defined rather than typedef-ed - // (e.g., "valuetype vb sequence ;"). If member resolves to a value - // box, then check and fillInfo() for value box and its content type BEFORE - // doing fillInfo() on member; otherwise, could get an exception. There's - // code in fillInfo() that performs this check, so it does not appear here. - - else if (element instanceof StructEntry) - { - Enumeration members = ((StructEntry)element).members ().elements (); - while (members.hasMoreElements ()) - Util.fillInfo ((SymtabEntry)members.nextElement ()); - } - else if (element instanceof InterfaceEntry && ((InterfaceEntry)element).state () != null) - { - Enumeration members = ((InterfaceEntry)element).state ().elements (); - while (members.hasMoreElements ()) - Util.fillInfo (((InterfaceState)members.nextElement ()).entry); - } - else if (element instanceof UnionEntry) - { - Enumeration branches = ((UnionEntry)element).branches ().elements (); - while (branches.hasMoreElements ()) - Util.fillInfo (((UnionBranch)branches.nextElement ()).typedef); - } - - // For each type that is at the top level that is NOT a module - // or IncludeEntry, add it to the imports list. If there are - // types within modules which refer to these, their types must - // be explicitly stated in an import statement. - if (element.module ().equals ("") && !(element instanceof ModuleEntry || element instanceof IncludeEntry || element instanceof PrimitiveEntry)) - importTypes.addElement (element); - } - - while (emitList.hasMoreElements ()) - { - SymtabEntry entry = (SymtabEntry)emitList.nextElement (); - - // Any other emitList processing: - preEmitELElement (entry); - } - } // preEmit - - /** - * This method is called by preEmit once for each symbol table entry. - * It can be called by extenders. - **/ - protected void preEmitSTElement (SymtabEntry entry) - { - // If the -package argument was used, search the packages list - // for the given type name and prepend the package to it. - Hashtable packages = ((Arguments)arguments).packages; - if (packages.size () > 0) - { - String substr = (String)packages.get (entry.fullName ()); - if (substr != null) - { - String pkg = null; - ModuleEntry mod = null; - ModuleEntry prev = null; - while (substr != null) - { - int dot = substr.indexOf ('.'); - if (dot < 0) - { - pkg = substr; - substr = null; - } - else - { - pkg = substr.substring (0, dot); - substr = substr.substring (dot + 1); - } - - String fullName = prev == null ? pkg : prev.fullName () + '/' + pkg; - mod = (ModuleEntry)symbolTable.get (fullName); - if (mod == null) - { - mod = factory.moduleEntry (); - mod.name (pkg); - mod.container (prev); - if (prev != null) mod.module (prev.fullName ()); - symbolTable.put (pkg, mod); - } - prev = mod; - } - entry.module (mod.fullName ()); - entry.container (mod); - } - } - } // preEmitSTElement - - /** - * This method is called by preEmit once for each emitList entry. - * It can be called by extenders. - **/ - protected void preEmitELElement (SymtabEntry entry) - { - } // preEmitELElement - - public Vector importTypes = new Vector (); - public SymtabFactory factory; - public static int typedefInfo; - public Hashtable list = new Hashtable (); - public static Compile compiler = null; // -} // class Compile diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ConstGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ConstGen.java deleted file mode 100644 index b6a38083415..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ConstGen.java +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: - -import java.io.File; -import java.io.PrintWriter; -import java.util.Hashtable; -import java.util.Vector; - -import com.sun.tools.corba.se.idl.GenFileStream; -import com.sun.tools.corba.se.idl.ConstEntry; -import com.sun.tools.corba.se.idl.ModuleEntry; -import com.sun.tools.corba.se.idl.PrimitiveEntry; -import com.sun.tools.corba.se.idl.StringEntry; -import com.sun.tools.corba.se.idl.SymtabEntry; -import com.sun.tools.corba.se.idl.TypedefEntry; - -/** - * - **/ -public class ConstGen implements com.sun.tools.corba.se.idl.ConstGen -{ - /** - * Public zero-argument constructor. - **/ - public ConstGen () - { - } // ctor - - /** - * Generate Java code for an IDL constant. A constant is written to - * a new class only when it is not a member of an interface; otherwise - * it written to the interface class in which it resides. - **/ - public void generate (Hashtable symbolTable, ConstEntry c, PrintWriter s) - { - this.symbolTable = symbolTable; - this.c = c; - this.stream = s; - init (); - - if (c.container () instanceof ModuleEntry) - generateConst (); - else if (stream != null) - writeConstExpr (); - } // generate - - /** - * Initialize members unique to this generator. - **/ - protected void init () - { - } // init - - /** - * Generate the class defining the constant. - **/ - protected void generateConst () - { - openStream (); - if (stream == null) - return; - writeHeading (); - writeBody (); - writeClosing (); - closeStream (); - } // generateConst - - /** - * Open a new print stream only if the constant is not a member - * of an interface. - **/ - protected void openStream () - { - stream = Util.stream (c, ".java"); - } // openStream - - /** - * Write the heading for the class defining the constant. - **/ - protected void writeHeading () - { - Util.writePackage (stream, c); - Util.writeProlog (stream, ((GenFileStream)stream).name ()); - stream.println ("public interface " + c.name ()); - // should not be done according to the mapping - // + " extends org.omg.CORBA.portable.IDLEntity"); - stream.println ("{"); - } // writeHeading - - /** - * Write the constant expression and any comment, if present. - **/ - protected void writeBody () - { - writeConstExpr (); - } // writeBody - - /** - * Write the entire constant expression and any comment, if present. - **/ - protected void writeConstExpr () - { - if (c.comment () != null) - c.comment ().generate (" ", stream); - if (c.container () instanceof ModuleEntry) { - - stream.print (" public static final " + Util.javaName (c.type ()) + " value = "); - } else { - stream.print (" public static final " + Util.javaName (c.type ()) + ' ' + c.name () + " = "); - } - writeConstValue (c.type ()); - } // writeConstExpr - - /** - * Write the constant's value according to its type. - **/ - private void writeConstValue (SymtabEntry type) - { - if (type instanceof PrimitiveEntry) - stream.println ('(' + Util.javaName (type) + ")(" + Util.parseExpression (c.value ()) + ");"); - else if (type instanceof StringEntry) - stream.println (Util.parseExpression (c.value ()) + ';'); - else if (type instanceof TypedefEntry) - { - while (type instanceof TypedefEntry) - type = type.type (); - writeConstValue (type); - } - else - stream.println (Util.parseExpression (c.value ()) + ';'); - } // writeValue - - /** - * Generate any last words and close the class. - **/ - protected void writeClosing () - { - stream.println ("}"); - } // writeClosing - - /** - * Close the print stream, causing the file to be written. - **/ - protected void closeStream () - { - stream.close (); - } // closeStream - - protected java.util.Hashtable symbolTable = null; - protected ConstEntry c = null; - protected PrintWriter stream = null; -} // class ConstGen - - -/*======================================================================================= - DATE-AUTHOR ACTION - --------------------------------------------------------------------------------------- - 11sep1997daz Return when print stream is null and container is NOT a module. Fixes - -keep option, which causes null print stream to be sent to ConstGen. - 31jul1997daz Write source comment immediately preceding constant declaration. - =======================================================================================*/ diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/DefaultFactory.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/DefaultFactory.java deleted file mode 100644 index ee1dd2935cc..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/DefaultFactory.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: -// -D62023 klr new class - -import java.io.PrintWriter; -import java.util.Vector; - -import com.sun.tools.corba.se.idl.GenFileStream; -import com.sun.tools.corba.se.idl.SymtabEntry; -import com.sun.tools.corba.se.idl.MethodEntry; -import com.sun.tools.corba.se.idl.ValueEntry; - -/** - * - **/ -public class DefaultFactory implements AuxGen -{ - /** - * Public zero-argument constructor. - **/ - public DefaultFactory () - { - } // ctor - - /** - * Generate the default value factory class. Provides general algorithm for - * auxiliary binding generation: - * 1.) Initialize symbol table and symbol table entry members, - * common to all generators. - * 2.) Initialize members unique to this generator. - * 3.) Open print stream - * 4.) Write class heading (package, prologue, source comment, class - * statement, open curly - * 5.) Write class body (member data and methods) - * 6.) Write class closing (close curly) - * 7.) Close the print stream - **/ - public void generate (java.util.Hashtable symbolTable, com.sun.tools.corba.se.idl.SymtabEntry entry) - { - this.symbolTable = symbolTable; - this.entry = entry; - init (); - openStream (); - if (stream == null) - return; - writeHeading (); - writeBody (); - writeClosing (); - closeStream (); - } // generate - - /** - * Initialize variables unique to this generator. - **/ - protected void init () - { - factoryClass = entry.name () + "DefaultFactory"; - factoryInterface = entry.name () + "ValueFactory"; - factoryType = Util.javaName (entry); - implType = entry.name () + "Impl"; // default implementation class - } // init - - /** - * @return true if entry has any factory methods declared - **/ - protected boolean hasFactoryMethods () - { - Vector init = ((ValueEntry)entry).initializers (); - if (init != null && init.size () > 0) - return true; - else - return false; - } // hasFactoryMethods - - /** - * Open the print stream for subsequent output. - **/ - protected void openStream () - { - stream = Util.stream (entry, "DefaultFactory.java"); - } // openStream - - /** - * Generate the heading, including the package, imports, - * source comment, class statement, and left curly. - **/ - protected void writeHeading () - { - Util.writePackage (stream, entry, Util.TypeFile); // REVISIT - same as interface? - Util.writeProlog (stream, stream.name ()); - if (entry.comment () != null) - entry.comment ().generate ("", stream); - stream.print ("public class " + factoryClass + " implements "); - if (hasFactoryMethods ()) - stream.print (factoryInterface); - else - stream.print ("org.omg.CORBA.portable.ValueFactory"); - stream.println (" {"); - } // writeHeading - - /** - * Generate the contents of this class - **/ - protected void writeBody () - { - writeFactoryMethods (); - stream.println (); - writeReadValue (); - } // writeBody - - /** - * Generate members of this class. - **/ - protected void writeFactoryMethods () - { - Vector init = ((ValueEntry)entry).initializers (); - if (init != null) - { - for (int i = 0; i < init.size (); i++) - { - MethodEntry element = (MethodEntry) init.elementAt (i); - element.valueMethod (true); //tag value method if not tagged previously - ((MethodGen24) element.generator ()).defaultFactoryMethod (symbolTable, element, stream); - } - } - } // writeFactoryMethods - - /** - * Generate default read_value - **/ - protected void writeReadValue () - { - stream.println (" public java.io.Serializable read_value (org.omg.CORBA_2_3.portable.InputStream is)"); - stream.println (" {"); - stream.println (" return is.read_value(new " + implType + " ());"); - stream.println (" }"); - } // writeReadValue - - /** - * Generate the closing statements. - **/ - protected void writeClosing () - { - stream.println ('}'); - } // writeClosing - - /** - * Write the stream to file by closing the print stream. - **/ - protected void closeStream () - { - stream.close (); - } // closeStream - - protected java.util.Hashtable symbolTable; - protected com.sun.tools.corba.se.idl.SymtabEntry entry; - protected GenFileStream stream; - - // Unique to this generator - protected String factoryClass; - protected String factoryInterface; - protected String factoryType; - protected String implType; -} // class Holder diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/EnumGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/EnumGen.java deleted file mode 100644 index de0725741b8..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/EnumGen.java +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: -// -D61056 Use Util.helperName - -import java.io.File; -import java.io.PrintWriter; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Vector; - -import com.sun.tools.corba.se.idl.GenFileStream; -import com.sun.tools.corba.se.idl.EnumEntry; -import com.sun.tools.corba.se.idl.SymtabEntry; - -/** - * - **/ -public class EnumGen implements com.sun.tools.corba.se.idl.EnumGen, JavaGenerator -{ - /** - * Public zero-argument constructor. - **/ - public EnumGen () - { - } // ctor - - /** - * Generate the Java code for an IDL enumeration. - **/ - public void generate (Hashtable symbolTable, EnumEntry e, PrintWriter s) - { - this.symbolTable = symbolTable; - this.e = e; - init (); - - openStream (); - if (stream == null) return; - generateHolder (); - generateHelper (); - writeHeading (); - writeBody (); - writeClosing (); - closeStream (); - } // generate - - /** - * Initialize members unique to this generator. - **/ - protected void init () - { - className = e.name (); - fullClassName = Util.javaName (e); - } - - /** - * Open the print stream to which to write the enumeration class. - **/ - protected void openStream () - { - stream = Util.stream (e, ".java"); - } - - /** - * Generate the holder class for this enumeration. - **/ - protected void generateHolder () - { - ((Factories)Compile.compiler.factories ()).holder ().generate (symbolTable, e); - } - - /** - * Generate the helper class for this enumeration. - **/ - protected void generateHelper () - { - ((Factories)Compile.compiler.factories ()).helper ().generate (symbolTable, e); - } - - /** - * Write the heading of the enumeration class, including the package, - * imports, class statement, and open curly. - **/ - protected void writeHeading () - { - Util.writePackage (stream, e); - Util.writeProlog (stream, ((GenFileStream)stream).name ()); - if (e.comment () != null) - e.comment ().generate ("", stream); - stream.println ("public class " + className + " implements org.omg.CORBA.portable.IDLEntity"); - stream.println ("{"); - } - - /** - * Write the members of enumeration class. - **/ - protected void writeBody () - { - stream.println (" private int __value;"); - stream.println (" private static int __size = " + (e.elements ().size ()) + ';'); - stream.println (" private static " + fullClassName + "[] __array = new " + fullClassName + " [__size];"); - stream.println (); - for (int i = 0; i < e.elements ().size (); ++i) - { - String label = (String)e.elements ().elementAt (i); - stream.println (" public static final int _" + label + " = " + i + ';'); - stream.println (" public static final " + fullClassName + ' ' + label + " = new " + fullClassName + "(_" + label + ");"); - } - stream.println (); - writeValue (); - writeFromInt (); - writeCtors (); - } - - /** - * Write the value method for the enumeration class. - **/ - protected void writeValue () - { - stream.println (" public int value ()"); - stream.println (" {"); - stream.println (" return __value;"); - stream.println (" }"); - stream.println (); - } // writeValue - - /** - * Write the from_int method for the enumeration class. - **/ - protected void writeFromInt () - { - stream.println (" public static " + fullClassName + " from_int (int value)"); - stream.println (" {"); - stream.println (" if (value >= 0 && value < __size)"); - stream.println (" return __array[value];"); - stream.println (" else"); - stream.println (" throw new org.omg.CORBA.BAD_PARAM ();"); - stream.println (" }"); - stream.println (); - } - - /** - * Write the protected constructor for the enumeration class. - **/ - protected void writeCtors () - { - stream.println (" protected " + className + " (int value)"); - stream.println (" {"); - stream.println (" __value = value;"); - stream.println (" __array[__value] = this;"); - stream.println (" }"); - } - - /** - * Close the enumeration class. - **/ - protected void writeClosing () - { - stream.println ("} // class " + className); - } - - /** - * Close the print stream, which writes the stream to file. - **/ - protected void closeStream () - { - stream.close (); - } - - /////////////// - // From JavaGenerator - - public int helperType (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) - { - tcoffsets.set (entry); - EnumEntry enumEntry = (EnumEntry)entry; - StringBuffer emit = new StringBuffer ("new String[] { "); - Enumeration e = enumEntry.elements ().elements (); - boolean firstTime = true; - while (e.hasMoreElements ()) - { - if (firstTime) - firstTime = false; - else - emit.append (", "); - emit.append ('"' + Util.stripLeadingUnderscores ((String)e.nextElement ()) + '"'); - } - emit.append ("} "); - stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_enum_tc (" - + Util.helperName (enumEntry, true) + ".id (), \"" // <54697> // -// + "_id, \"" <54697> - + Util.stripLeadingUnderscores (entry.name ()) + "\", " - + new String (emit) + ");"); - return index + 1; - - } // helperType - - public int type (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) { - stream.println (indent + name + " = " + Util.helperName (entry, true) + ".type ();"); // - return index; - } // type - - public void helperRead (String entryName, SymtabEntry entry, PrintWriter stream) - { - stream.println (" return " + Util.javaQualifiedName (entry) + ".from_int (istream.read_long ());"); - } // helperRead - - public void helperWrite (SymtabEntry entry, PrintWriter stream) - { - stream.println (" ostream.write_long (value.value ());"); - } // helperWrite - - public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - stream.println (indent + name + " = " + Util.javaQualifiedName (entry) + ".from_int (istream.read_long ());"); - return index; - } // read - - public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - stream.println (indent + "ostream.write_long (" + name + ".value ());"); - return index; - } // write - - // From JavaGenerator - /////////////// - - protected Hashtable symbolTable = null; - protected EnumEntry e = null; - protected PrintWriter stream = null; - - // Member data unique to this generator - String className = null; - String fullClassName = null; -} // class EnumGen - - -/*============================================================================ - DATE ACTION - ---------------------------------------------------------------------------- - 31jul1997 Modified to write comment immediately preceding class defining - enumeration declaration. - 12dec1998 D55971 - omg 98-11-03 Java 2.4 RTF - make subclassable - ===========================================================================*/ diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ExceptionGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ExceptionGen.java deleted file mode 100644 index 2ad09089eec..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ExceptionGen.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: - -import java.io.PrintWriter; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.ExceptionEntry; - -/** - * - **/ -public class ExceptionGen extends StructGen implements com.sun.tools.corba.se.idl.ExceptionGen -{ - /** - * Public zero-argument constructor. - **/ - public ExceptionGen () - { - super (true); - } // ctor - - /** - * - **/ - public void generate (Hashtable symbolTable, ExceptionEntry entry, PrintWriter stream) - { - super.generate (symbolTable, entry, stream); - } // generate -} // class ExceptionGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Factories.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Factories.java deleted file mode 100644 index a8fa3e828b9..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Factories.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: -// -D62023 Add corbaLevel=2.4 - -/** - * - **/ -public class Factories extends com.sun.tools.corba.se.idl.Factories -{ - public com.sun.tools.corba.se.idl.GenFactory genFactory () - { - return new GenFactory (); - } // genFactory - - public com.sun.tools.corba.se.idl.Arguments arguments () - { - return new Arguments (); - } // arguments - - public String[] languageKeywords () - { - // These are Java keywords that are not also IDL keywords. - return keywords; - } // languageKeywords - - static String[] keywords = - {"abstract", "break", "byte", - "catch", "class", "continue", - "do", "else", "extends", - "false", "final", "finally", - "for", "goto", "if", - "implements", "import", "instanceof", - "int", "interface", "native", - "new", "null", "operator", - "outer", "package", "private", - "protected", "public", "return", - "static", "super", "synchronized", - "this", "throw", "throws", - "transient", "true", "try", - "volatile", "while", -// Special reserved suffixes: - "+Helper", "+Holder", "+Package", -// These following are not strictly keywords. They -// are methods on java.lang.Object and, as such, must -// not have conflicts with methods defined on IDL -// interfaces. Treat them the same as keywords. - "clone", "equals", "finalize", - "getClass", "hashCode", "notify", - "notifyAll", "toString", "wait"}; - - /////////////// - // toJava-specific factory methods - - private Helper _helper = null; // <62023> - public Helper helper () - { - if (_helper == null) - if (Util.corbaLevel (2.4f, 99.0f)) // - _helper = new Helper24 (); // - else - _helper = new Helper (); - return _helper; - } // helper - - private ValueFactory _valueFactory = null; // <62023> - public ValueFactory valueFactory () - { - if (_valueFactory == null) - if (Util.corbaLevel (2.4f, 99.0f)) // - _valueFactory = new ValueFactory (); // - // else return null since shouldn't be used - return _valueFactory; - } // valueFactory - - private DefaultFactory _defaultFactory = null; // <62023> - public DefaultFactory defaultFactory () - { - if (_defaultFactory == null) - if (Util.corbaLevel (2.4f, 99.0f)) // - _defaultFactory = new DefaultFactory (); // - // else return null since shouldn't be used - return _defaultFactory; - } // defaultFactory - - private Holder _holder = new Holder (); - public Holder holder () - { - return _holder; - } // holder - - private Skeleton _skeleton = new Skeleton (); - public Skeleton skeleton () - { - return _skeleton; - } // skeleton - - private Stub _stub = new Stub (); - public Stub stub () - { - return _stub; - } // stub - - // toJava-specific factory methods - /////////////// -} // class Factories diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ForwardValueGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ForwardValueGen.java deleted file mode 100644 index a8498483cfd..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ForwardValueGen.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: -// -D61056 Use Util.helperName - -import java.io.File; -import java.io.PrintWriter; -import java.util.Hashtable; -import java.util.Enumeration; -import java.util.Vector; - -import com.sun.tools.corba.se.idl.GenFileStream; -import com.sun.tools.corba.se.idl.InterfaceEntry; -import com.sun.tools.corba.se.idl.SymtabEntry; -import com.sun.tools.corba.se.idl.TypedefEntry; -import com.sun.tools.corba.se.idl.ForwardValueEntry; -import com.sun.tools.corba.se.idl.InterfaceState; -import com.sun.tools.corba.se.idl.MethodEntry; - -/** - * - **/ -public class ForwardValueGen implements com.sun.tools.corba.se.idl.ForwardValueGen, JavaGenerator -{ - /** - * Public zero-argument constructor. - **/ - public ForwardValueGen () - { - } // ctor - - /** - * - **/ - public void generate (Hashtable symbolTable, ForwardValueEntry v, PrintWriter str) - { - this.symbolTable = symbolTable; - this.v = v; - - openStream (); - if (stream == null) - return; - generateHelper (); - generateHolder (); - generateStub (); - writeHeading (); - writeBody (); - writeClosing (); - closeStream (); - } // generate - - /** - * - **/ - protected void openStream () - { - stream = Util.stream (v, ".java"); - } // openStream - - /** - * - **/ - protected void generateHelper () - { - ((Factories)Compile.compiler.factories ()).helper ().generate (symbolTable, v); - } // generateHelper - - /** - * - **/ - protected void generateHolder () - { - ((Factories)Compile.compiler.factories ()).holder ().generate (symbolTable, v); - } // generateHolder - - /** - * - **/ - protected void generateStub () - { - } // generateStub - - /** - * - **/ - protected void writeHeading () - { - Util.writePackage (stream, v); - Util.writeProlog (stream, ((GenFileStream)stream).name ()); - - if (v.comment () != null) - v.comment ().generate ("", stream); - - stream.print ("public class " + v.name () + " implements org.omg.CORBA.portable.IDLEntity"); - // There should ALWAYS be at least one: ValueBase - - stream.println ("{"); - } // writeHeading - - /** - * - **/ - protected void writeBody () - { - } // writeBody - - /** - * - **/ - protected void writeClosing () - { - stream.println ("} // class " + v.name ()); - } // writeClosing - - /** - * - **/ - protected void closeStream () - { - stream.close (); - } // closeStream - - /////////////// - // From JavaGenerator - - public int helperType (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) - { - return index; - } // helperType - - public int type (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) { - stream.println (indent + name + " = " + Util.helperName (entry, true) + ".type ();"); // - return index; - } // type - - public void helperRead (String entryName, SymtabEntry entry, PrintWriter stream) - { - stream.println (" " + entryName + " value = new " + entryName + " ();"); - read (0, " ", "value", entry, stream); - stream.println (" return value;"); - } // helperRead - - public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - return index; - } // read - - public void helperWrite (SymtabEntry entry, PrintWriter stream) - { - write (0, " ", "value", entry, stream); - } // helperWrite - - public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - return index; - } // write - - // From JavaGenerator - /////////////// - - /** - * - **/ - protected void writeAbstract () - { - } // writeAbstract - - protected Hashtable symbolTable = null; - protected ForwardValueEntry v = null; - protected PrintWriter stream = null; -} // class ForwardValueGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/GenFactory.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/GenFactory.java deleted file mode 100644 index d7b1132e817..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/GenFactory.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: - -/** - * - **/ -public class GenFactory implements com.sun.tools.corba.se.idl.GenFactory -{ - - public com.sun.tools.corba.se.idl.AttributeGen createAttributeGen () - { - if (Util.corbaLevel (2.4f, 99.0f)) // - return new AttributeGen24 (); - else - return new AttributeGen (); - } // createAttributeGen - - public com.sun.tools.corba.se.idl.ConstGen createConstGen () - { - return new ConstGen (); - } // createConstGen - - public com.sun.tools.corba.se.idl.NativeGen createNativeGen () - { - return new NativeGen (); - } // createNativeGen - - public com.sun.tools.corba.se.idl.EnumGen createEnumGen () - { - return new EnumGen (); - } // createEnumGen - - public com.sun.tools.corba.se.idl.ExceptionGen createExceptionGen () - { - return new ExceptionGen (); - } // createExceptionGen - - public com.sun.tools.corba.se.idl.ForwardGen createForwardGen () - { - return null; - } // createForwardGen - - public com.sun.tools.corba.se.idl.ForwardValueGen createForwardValueGen () - { - return null; - } // createForwardValueGen - - public com.sun.tools.corba.se.idl.IncludeGen createIncludeGen () - { - return null; - } // createIncludeGen - - public com.sun.tools.corba.se.idl.InterfaceGen createInterfaceGen () - { - return new InterfaceGen (); - } // createInterfaceGen - - public com.sun.tools.corba.se.idl.ValueGen createValueGen () - { - if (Util.corbaLevel (2.4f, 99.0f)) // - return new ValueGen24 (); - else - return new ValueGen (); - } // createValueGen - - public com.sun.tools.corba.se.idl.ValueBoxGen createValueBoxGen () - { - if (Util.corbaLevel (2.4f, 99.0f)) // - return new ValueBoxGen24 (); - else - return new ValueBoxGen (); - } // createValueBoxGen - - public com.sun.tools.corba.se.idl.MethodGen createMethodGen () - { - if (Util.corbaLevel (2.4f, 99.0f)) // - return new MethodGen24 (); - else - return new MethodGen (); - } // createMethodGen - - public com.sun.tools.corba.se.idl.ModuleGen createModuleGen () - { - return new ModuleGen (); - } // createModuleGen - - public com.sun.tools.corba.se.idl.ParameterGen createParameterGen () - { - return null; - } // createParameterGen - - public com.sun.tools.corba.se.idl.PragmaGen createPragmaGen () - { - return null; - } // createPragmaGen - - public com.sun.tools.corba.se.idl.PrimitiveGen createPrimitiveGen () - { - return new PrimitiveGen (); - } // createPrimitiveGen - - public com.sun.tools.corba.se.idl.SequenceGen createSequenceGen () - { - return new SequenceGen (); - } // createSequenceGen - - public com.sun.tools.corba.se.idl.StringGen createStringGen () - { - return new StringGen (); - } // createSequenceGen - - public com.sun.tools.corba.se.idl.StructGen createStructGen () - { - return new StructGen (); - } // createStructGen - - public com.sun.tools.corba.se.idl.TypedefGen createTypedefGen () - { - return new TypedefGen (); - } // createTypedefGen - - public com.sun.tools.corba.se.idl.UnionGen createUnionGen () - { - return new UnionGen (); - } // createUnionGen -} // class GenFactory diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Helper.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Helper.java deleted file mode 100644 index 664fba93932..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Helper.java +++ /dev/null @@ -1,699 +0,0 @@ -/* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: -// -F46082.51 Remove -stateful feature. -// -D57118 Fix "narrow" in helper for abstract interface -// -D58889 re-Fix "narrow" in helper for abstract interface -// -D59383 'get_class' in value helper returns value class, not helper. -// -D59413 Remove Helper interface references for non-value types. -// -D59435 Remove read_Object, write_Object completely. -// -D59418 Move read_Value, write_Value to generator's helperRead. - -import java.io.PrintWriter; - -import java.util.Enumeration; -import java.util.Vector; - -import com.sun.tools.corba.se.idl.GenFileStream; -import com.sun.tools.corba.se.idl.InterfaceEntry; -import com.sun.tools.corba.se.idl.MethodEntry; -import com.sun.tools.corba.se.idl.ParameterEntry; -import com.sun.tools.corba.se.idl.SymtabEntry; -import com.sun.tools.corba.se.idl.ValueEntry; -import com.sun.tools.corba.se.idl.ValueBoxEntry; -import com.sun.tools.corba.se.idl.TypedefEntry; -import com.sun.tools.corba.se.idl.InterfaceState; -import com.sun.tools.corba.se.idl.PrimitiveEntry; -import com.sun.tools.corba.se.idl.StructEntry; - -/** - * - **/ -public class Helper implements AuxGen -{ - /** - * Public zero-argument constructor. - **/ - public Helper () - { - } // ctor - - /** - * Generate the helper class. Provides general algorithm - * for auxiliary binding generation: - * - * 1.) Initialize symbol table and symbol table entry members, - * common to all generators. - * 2.) Initialize members unique to this generator. - * 3.) Open print stream - * 4.) Write class heading: package, prologue, class statement, open curly - * 5.) Write class body: member data and methods - * 6.) Write class closing: close curly - * 7.) Close the print stream - **/ - public void generate (java.util.Hashtable symbolTable, com.sun.tools.corba.se.idl.SymtabEntry entry) - { - this.symbolTable = symbolTable; - this.entry = entry; - init (); - - openStream (); - if (stream == null) - return; - writeHeading (); - writeBody (); - writeClosing (); - closeStream (); - } // generate - - /** - * Initialize variables unique to this generator. - **/ - protected void init () - { - helperClass = entry.name () + "Helper"; - if (entry instanceof ValueBoxEntry) - { - ValueBoxEntry v = (ValueBoxEntry) entry; - TypedefEntry member = ((InterfaceState) v.state ().elementAt (0)).entry; - SymtabEntry mType = member.type (); - - if (mType instanceof PrimitiveEntry) - helperType = Util.javaName (entry); - else - helperType = Util.javaName (mType); - } - else - helperType = Util.javaName (entry); - } // init - - /** - * Open the print stream for subsequent output. - **/ - protected void openStream () - { - stream = Util.stream (entry, "Helper.java"); - } // openStream - - /** - * Generate the heading, including package, imports, class statements, - * and open curly. - **/ - protected void writeHeading () - { - Util.writePackage (stream, entry, Util.HelperFile); - Util.writeProlog (stream, stream.name ()); - - // Transfer comment to target <30jul1997daz>. - if (entry.comment () != null) - entry.comment ().generate ("", stream); - - stream.print ("public final class " + helperClass); - if (entry instanceof ValueEntry) - stream.println (" implements org.omg.CORBA.portable.ValueHelper"); - else - stream.println (); - stream.println ('{'); - } - - /** - * Generate members of this class. - **/ - protected void writeBody () - { - writeInstVars (); - writeCtors (); - writeInsert (); - writeExtract (); - writeType (); - writeID (); - writeRead (); - writeWrite (); - if (entry instanceof InterfaceEntry && !(entry instanceof ValueEntry)) { - writeNarrow (); - writeUncheckedNarrow (); - } - writeHelperInterface (); - if (entry instanceof ValueEntry) - writeValueHelperInterface (); - } // writeBody - - /** - * Generate members of the Helper interface. - **/ - protected void writeHelperInterface () - { - } // writeHelperInterface - - /** - * Generate members of the ValueHelper interface. - **/ - protected void writeValueHelperInterface () - { - writeGetID (); // moved for - writeGetType (); // moved for - writeGetInstance (); // not in ValueHelper interface - writeGetClass (); - writeGetSafeBaseIds (); - } // writeHelperInterface - - /** - * Generate the closing statements. - **/ - protected void writeClosing () - { - stream.println ('}'); - } - - /** - * Write the stream to file by closing the print stream. - **/ - protected void closeStream () - { - stream.close (); - } - - /** - * Generate the instance variables. - **/ - protected void writeInstVars () - { - stream.println (" private static String _id = \"" + Util.stripLeadingUnderscoresFromID (entry.repositoryID ().ID ()) + "\";"); - if (entry instanceof ValueEntry) - { - stream.println (); - stream.println (" private static " + helperClass + " helper = new " + helperClass + " ();"); - stream.println (); - stream.println (" private static String[] _truncatable_ids = {"); - stream.print (" _id"); - - // Any safe ValueEntry must have a concete value parent. - // The topmost parent cannot be safe since it doesn't have - // a concrete parent. - ValueEntry child = (ValueEntry) entry; - while (child.isSafe ()) - { - stream.println(","); - ValueEntry parent = (ValueEntry)child.derivedFrom ().elementAt (0); - stream.print(" \"" + Util.stripLeadingUnderscoresFromID (parent.repositoryID ().ID ()) + "\""); - child = parent; - } - stream.println(" };"); - } - stream.println (); - } // writeInstVars - - /** - * Generate the constructors. - **/ - protected void writeCtors () - { - stream.println (" public " + helperClass + "()"); - stream.println (" {"); - stream.println (" }"); - stream.println (); - } // writeCtors - - /** - * Generate the insert method. - **/ - protected void writeInsert () - { - stream.println (" public static void insert (org.omg.CORBA.Any a, " + helperType + " that)"); - stream.println (" {"); - stream.println (" org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();"); - stream.println (" a.type (type ());"); - stream.println (" write (out, that);"); - stream.println (" a.read_value (out.create_input_stream (), type ());"); - stream.println (" }"); - stream.println (); - } // writeInsert - - /** - * Generate the extract method. - **/ - protected void writeExtract () - { - stream.println (" public static " + helperType + " extract (org.omg.CORBA.Any a)"); - stream.println (" {"); - stream.println (" return read (a.create_input_stream ());"); - stream.println (" }"); - stream.println (); - } // writeExtract - - /** - * Generate the typecode variable and type method. - **/ - protected void writeType () - { - boolean canRecurse = entry instanceof ValueEntry - || entry instanceof ValueBoxEntry - || entry instanceof StructEntry; - stream.println (" private static org.omg.CORBA.TypeCode __typeCode = null;"); - if (canRecurse) - stream.println (" private static boolean __active = false;"); - stream.println (" synchronized public static org.omg.CORBA.TypeCode type ()"); - stream.println (" {"); - stream.println (" if (__typeCode == null)"); - stream.println (" {"); - if (canRecurse) { - stream.println (" synchronized (org.omg.CORBA.TypeCode.class)"); - stream.println (" {"); - stream.println (" if (__typeCode == null)"); - stream.println (" {"); - stream.println (" if (__active)"); - stream.println (" {"); - stream.println (" return org.omg.CORBA.ORB.init().create_recursive_tc ( _id );"); - stream.println (" }"); - stream.println (" __active = true;"); - ((JavaGenerator)entry.generator ()).helperType (0, " ", new TCOffsets (), "__typeCode", entry, stream); - } - else - ((JavaGenerator)entry.generator ()).helperType (0, " ", new TCOffsets (), "__typeCode", entry, stream); - - // Generate body of type() method - - if (canRecurse) { - stream.println (" __active = false;"); - stream.println (" }"); - stream.println (" }"); - } - stream.println (" }"); - stream.println (" return __typeCode;"); - stream.println (" }"); - stream.println (); - } // writeType - - /** - * Generate the ID method. - **/ - protected void writeID () - { - stream.println (" public static String id ()"); - stream.println (" {"); - stream.println (" return _id;"); - stream.println (" }"); - stream.println (); - } // writeID - - /** - * Generate the read method. - **/ - protected void writeRead () - { - - boolean isLocalInterface = false; - - if (entry instanceof InterfaceEntry) { - InterfaceEntry ie = (InterfaceEntry) entry; - - // for #pragma sun_local or sun_localservant, or actual local - // local interface, set the flag by checking on both - isLocalInterface = ie.isLocal() | ie.isLocalServant(); - } - - stream.println (" public static " + helperType + " read (org.omg.CORBA.portable.InputStream istream)"); - stream.println (" {"); - if ( !isLocalInterface ) { // nonLocal Interface and other types - ((JavaGenerator)entry.generator ()).helperRead (helperType, entry, stream); - } else { //Local interface should throw exception - stream.println (" throw new org.omg.CORBA.MARSHAL ();"); - } - stream.println (" }"); - stream.println (); - } // writeRead - - /** - * Generate the write method. - **/ - protected void writeWrite () - { - - boolean isLocalInterface = false; - - if (entry instanceof InterfaceEntry) { - InterfaceEntry ie = (InterfaceEntry) entry; - - // for #pragma sun_local or sun_localservant, or actual local - // local interface, set the flag by checking on both - isLocalInterface = ie.isLocal() | ie.isLocalServant(); - } - - stream.println (" public static void write (org.omg.CORBA.portable.OutputStream ostream, " + helperType + " value)"); - stream.println (" {"); - if ( !isLocalInterface ) { // nonLocal Interface and other types - ((JavaGenerator)entry.generator ()).helperWrite (entry, stream); - } else { //Local interface should throw exception - stream.println (" throw new org.omg.CORBA.MARSHAL ();"); - } - stream.println (" }"); - stream.println (); - } // writeWrite - - - /** - * Generate the narrow method. - **/ - protected void writeNarrow () - { - writeRemoteNarrow (); - stream.println (); - } - - /** - * Write the narrow() method for a remotable object. - **/ - protected void writeRemoteNarrow () - { - InterfaceEntry ie = (InterfaceEntry) entry; - - // narrow for LocalObject interface - if (ie.isLocal ()) { - writeRemoteNarrowForLocal (false); - return; - } - - // narrow for Abstract interface - if (ie.isAbstract ()) { - writeRemoteNarrowForAbstract (false); - return; - } else { - // Determine if the non-abstract interface has any abstract parents - for (int i = 0; i < ie.derivedFrom ().size (); i++) { - SymtabEntry parent = (SymtabEntry) ie.derivedFrom ().elementAt (i); - if (((InterfaceEntry) parent).isAbstract ()) { - writeRemoteNarrowForAbstract (true); - break; - } - } - } - - stream.println (" public static " + helperType + " narrow (org.omg.CORBA.Object obj)"); - stream.println (" {"); - stream.println (" if (obj == null)"); - stream.println (" return null;"); - stream.println (" else if (obj instanceof " + helperType + ')'); - stream.println (" return (" + helperType + ")obj;"); - stream.println (" else if (!obj._is_a (id ()))"); - stream.println (" throw new org.omg.CORBA.BAD_PARAM ();"); - stream.println (" else"); - stream.println (" {"); - stream.println (" org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();"); - String stubNameofEntry = stubName ((InterfaceEntry)entry); - stream.println (" " + stubNameofEntry + " stub = new " + stubNameofEntry + " ();"); - stream.println (" stub._set_delegate(delegate);"); - stream.println (" return stub;"); - stream.println (" }"); - stream.println (" }"); - } // writeRemoteNarrow - - /** - * Write the narrow() method for local interface. - **/ - private void writeRemoteNarrowForLocal (boolean hasAbstractParent) - { - stream.println (" public static " + helperType + " narrow (org.omg.CORBA.Object obj)"); - stream.println (" {"); - stream.println (" if (obj == null)"); - stream.println (" return null;"); - stream.println (" else if (obj instanceof " + helperType + ')'); - stream.println (" return (" + helperType + ")obj;"); - stream.println (" else"); - stream.println (" throw new org.omg.CORBA.BAD_PARAM ();"); - stream.println (" }"); - } // writeRemoteNarrowForLocal - - /** - * Write the narrow() method for abstract interface. - **/ - private void writeRemoteNarrowForAbstract (boolean hasAbstractParent) - { - stream.print (" public static " + helperType + " narrow (java.lang.Object obj)"); - stream.println (" {"); - stream.println (" if (obj == null)"); - stream.println (" return null;"); - if (hasAbstractParent) - { - stream.println (" else if (obj instanceof org.omg.CORBA.Object)"); - stream.println (" return narrow ((org.omg.CORBA.Object) obj);"); - } - else - { - stream.println (" else if (obj instanceof " + helperType + ')'); - stream.println (" return (" + helperType + ")obj;"); - } - - // If hasAbstractParent is false, then THIS entry must be abstract. - // This method is also called in case THIS entry is not abstract, but - // there is an abstract parent. If this entry is not abstract, - // it can never narrow to a CORBA object reference. - if (!hasAbstractParent) { // - String stubNameofEntry = stubName ((InterfaceEntry)entry); - - stream.println (" else if ((obj instanceof org.omg.CORBA.portable.ObjectImpl) &&"); - stream.println (" (((org.omg.CORBA.Object)obj)._is_a (id ()))) {"); - stream.println (" org.omg.CORBA.portable.ObjectImpl impl = (org.omg.CORBA.portable.ObjectImpl)obj ;" ) ; - stream.println (" org.omg.CORBA.portable.Delegate delegate = impl._get_delegate() ;" ) ; - stream.println (" " + stubNameofEntry + " stub = new " + stubNameofEntry + " ();"); - stream.println (" stub._set_delegate(delegate);"); - stream.println (" return stub;" ) ; - stream.println (" }" ) ; - }; - // end - - stream.println (" throw new org.omg.CORBA.BAD_PARAM ();"); - stream.println (" }"); - stream.println (); - } // writeRemoteNarrowForAbstract - - - /** - * Generate the unchecked narrow method. - **/ - protected void writeUncheckedNarrow () - { - writeUncheckedRemoteNarrow (); - stream.println (); - } - - /** - * Write the unchecked narrow() method for a remotable object. - **/ - protected void writeUncheckedRemoteNarrow () - { - InterfaceEntry ie = (InterfaceEntry) entry; - - // unchecked narrow for LocalObject interface - if (ie.isLocal ()) { - writeRemoteUncheckedNarrowForLocal (false); - return; - } - - // unchecked narrow for Abstract interface - if (ie.isAbstract ()) { - writeRemoteUncheckedNarrowForAbstract (false); - return; - } else { - // Determine if the non-abstract interface has any abstract parents - for (int i = 0; i < ie.derivedFrom ().size (); i++) { - SymtabEntry parent = (SymtabEntry) ie.derivedFrom ().elementAt (i); - if (((InterfaceEntry) parent).isAbstract ()) { - writeRemoteUncheckedNarrowForAbstract (true); - break; - } - } - } - - stream.println (" public static " + helperType + " unchecked_narrow (org.omg.CORBA.Object obj)"); - stream.println (" {"); - stream.println (" if (obj == null)"); - stream.println (" return null;"); - stream.println (" else if (obj instanceof " + helperType + ')'); - stream.println (" return (" + helperType + ")obj;"); - stream.println (" else"); - stream.println (" {"); - stream.println (" org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();"); - String stubNameofEntry = stubName ((InterfaceEntry)entry); - stream.println (" " + stubNameofEntry + " stub = new " + stubNameofEntry + " ();"); - stream.println (" stub._set_delegate(delegate);"); - stream.println (" return stub;"); - stream.println (" }"); - stream.println (" }"); - } // writeUncheckedRemoteNarrow - - /** - * Write the unchecked narrow() method for local interface. - **/ - private void writeRemoteUncheckedNarrowForLocal (boolean hasAbstractParent) - { - stream.println (" public static " + helperType + " unchecked_narrow (org.omg.CORBA.Object obj)"); - stream.println (" {"); - stream.println (" if (obj == null)"); - stream.println (" return null;"); - stream.println (" else if (obj instanceof " + helperType + ')'); - stream.println (" return (" + helperType + ")obj;"); - stream.println (" else"); - stream.println (" throw new org.omg.CORBA.BAD_PARAM ();"); - stream.println (" }"); - } // writeRemoteUncheckedNarrowForLocal - - /** - * Write the unchecked narrow() method for abstract interface. - **/ - private void writeRemoteUncheckedNarrowForAbstract (boolean hasAbstractParent) - { - stream.print (" public static " + helperType + " unchecked_narrow (java.lang.Object obj)"); - stream.println (" {"); - stream.println (" if (obj == null)"); - stream.println (" return null;"); - if (hasAbstractParent) - { - stream.println (" else if (obj instanceof org.omg.CORBA.Object)"); - stream.println (" return unchecked_narrow ((org.omg.CORBA.Object) obj);"); - } - else - { - stream.println (" else if (obj instanceof " + helperType + ')'); - stream.println (" return (" + helperType + ")obj;"); - } - - if (!hasAbstractParent) { - String stubNameofEntry = stubName ((InterfaceEntry)entry); - - stream.println (" else if (obj instanceof org.omg.CORBA.portable.ObjectImpl) {"); - stream.println (" org.omg.CORBA.portable.ObjectImpl impl = (org.omg.CORBA.portable.ObjectImpl)obj ;" ) ; - stream.println (" org.omg.CORBA.portable.Delegate delegate = impl._get_delegate() ;" ) ; - stream.println (" " + stubNameofEntry + " stub = new " + stubNameofEntry + " ();"); - stream.println (" stub._set_delegate(delegate);"); - stream.println (" return stub;" ) ; - stream.println (" }" ) ; - }; - - stream.println (" throw new org.omg.CORBA.BAD_PARAM ();"); - stream.println (" }"); - stream.println (); - } // writeRemoteUncheckedNarrowForAbstract - - - /** - * Generate the GetID method. - **/ - protected void writeGetID () - { - if ( !Util.IDLEntity (entry)) - return; - stream.println (" public String get_id ()"); - stream.println (" {"); - stream.println (" return _id;"); - stream.println (" }"); - stream.println (); - } // writeGetID - - /** - * Generate the GetType method. - **/ - protected void writeGetType () - { - if ( !Util.IDLEntity (entry)) - return; - stream.println (" public org.omg.CORBA.TypeCode get_type ()"); - stream.println (" {"); - stream.println (" return type ();"); - stream.println (" }"); - stream.println (); - } // writeGetID - - /** - * Generate the get_class method. - **/ - protected void writeGetClass () - { - stream.println (" public Class get_class ()"); - stream.println (" {"); - stream.println (" return " + helperType + ".class;"); // - stream.println (" }"); - stream.println (); - } // writeGetClass - - /** - * Generate the get_instance method. - **/ - protected void writeGetInstance () - { - stream.println (" public static org.omg.CORBA.portable.ValueHelper get_instance ()"); - stream.println (" {"); - stream.println (" return helper;"); - stream.println (" }"); - stream.println (); - } // writeGetInstance - - /** - * Generate the GetSafeBaseIds method. - **/ - protected void writeGetSafeBaseIds () - { - stream.println (" public String[] get_truncatable_base_ids ()"); - stream.println (" {"); - stream.println (" return _truncatable_ids;"); - stream.println (" }"); - stream.println (); - } // writeGetSafeBaseIds - - /** - * Return the stub name for the interface entry. - **/ - protected String stubName (InterfaceEntry entry) - { - String name; - if (entry.container ().name ().equals ("")) - name = '_' + entry.name () + "Stub"; - else - { - name = Util.containerFullName (entry.container ()) + "._" + entry.name () + "Stub"; - } - return name.replace ('/', '.'); - } // stubName - - protected java.util.Hashtable symbolTable; - protected com.sun.tools.corba.se.idl.SymtabEntry entry; - protected GenFileStream stream; - - // Unique to this generator - protected String helperClass; - protected String helperType; -} // class Helper diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Helper24.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Helper24.java deleted file mode 100644 index 0079b1413e8..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Helper24.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: -// -D62023 New file to implement CORBA 2.4 RTF - -import java.io.PrintWriter; - -import java.util.Enumeration; -import java.util.Vector; - -import com.sun.tools.corba.se.idl.GenFileStream; -import com.sun.tools.corba.se.idl.InterfaceEntry; -import com.sun.tools.corba.se.idl.MethodEntry; -import com.sun.tools.corba.se.idl.ParameterEntry; -import com.sun.tools.corba.se.idl.SymtabEntry; -import com.sun.tools.corba.se.idl.ValueEntry; -import com.sun.tools.corba.se.idl.ValueBoxEntry; -import com.sun.tools.corba.se.idl.TypedefEntry; -import com.sun.tools.corba.se.idl.InterfaceState; -import com.sun.tools.corba.se.idl.PrimitiveEntry; -import com.sun.tools.corba.se.idl.StructEntry; - -/** - * - **/ -public class Helper24 extends Helper -{ - /** - * Public zero-argument constructor. - **/ - public Helper24 () - { - } // ctor - - /** - * Generate the heading, including package, imports, class statements, - * and open curly. - * d62023 - don't implement ValueHelper, make non-boxed helpers abstract - **/ - protected void writeHeading () - { - Util.writePackage (stream, entry, Util.HelperFile); - Util.writeProlog (stream, stream.name ()); - - // Transfer comment to target <30jul1997daz>. - if (entry.comment () != null) - entry.comment ().generate ("", stream); - - if (entry instanceof ValueBoxEntry) { - stream.print ("public final class " + helperClass); - stream.println (" implements org.omg.CORBA.portable.BoxedValueHelper"); - } - else - stream.println ("abstract public class " + helperClass); - stream.println ('{'); - } - - /** - * Generate the instance variables. - *
            -   * d62023 - no helper instance except for boxed valuetypes;
            -   *        - move truncatable_ids to mapped class.
            -   * 
            - **/ - protected void writeInstVars () - { - stream.println (" private static String _id = \"" + Util.stripLeadingUnderscoresFromID (entry.repositoryID ().ID ()) + "\";"); - if (entry instanceof ValueEntry) - { - stream.println (); - if (entry instanceof ValueBoxEntry) { - stream.println (" private static " + helperClass + " _instance = new " + helperClass + " ();"); - stream.println (); - } - } - stream.println (); - } // writeInstVars - - /** - * d62023 - generate members of BoxedValueHelper interface if boxed - * - * d62023 - hook in here to write factory methods for non-boxed ValueTypes - * into Helper. - **/ - protected void writeValueHelperInterface () - { - if (entry instanceof ValueBoxEntry) { - writeGetID (); - } else if (entry instanceof ValueEntry) { - writeHelperFactories (); - } - } // writeValueHelperInterface - - /** - * - **/ - protected void writeHelperFactories () - { - Vector init = ((ValueEntry)entry).initializers (); - if (init != null) - { - stream.println (); - for (int i = 0; i < init.size (); i++) - { - MethodEntry element = (MethodEntry) init.elementAt (i); - element.valueMethod (true); //tag value method if not tagged previously - ((MethodGen24) element.generator ()). helperFactoryMethod (symbolTable, element, entry, stream); - } - } - } // writeHelperFactories - - /** - * d62023 - generate constructors only for boxed valuetype helpers. - * All other helpers are abstract. - **/ - protected void writeCtors () - { - if (entry instanceof ValueBoxEntry) { - stream.println (" public " + helperClass + "()"); - stream.println (" {"); - stream.println (" }"); - stream.println (); - } - } // writeCtors -} diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Holder.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Holder.java deleted file mode 100644 index d35670587da..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Holder.java +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: -// -D61056 Use Util.helperName - -import java.io.PrintWriter; - -import com.sun.tools.corba.se.idl.GenFileStream; -import com.sun.tools.corba.se.idl.SymtabEntry; -import com.sun.tools.corba.se.idl.ValueBoxEntry; -import com.sun.tools.corba.se.idl.InterfaceState; -import com.sun.tools.corba.se.idl.TypedefEntry; -import com.sun.tools.corba.se.idl.StringEntry; -import com.sun.tools.corba.se.idl.PrimitiveEntry; - -/** - * - **/ -public class Holder implements AuxGen -{ - /** - * Public zero-argument constructor. - **/ - public Holder () - { - } // ctor - - /** - * Generate the holder class. Provides general algorithm for - * auxiliary binding generation: - * 1.) Initialize symbol table and symbol table entry members, - * common to all generators. - * 2.) Initialize members unique to this generator. - * 3.) Open print stream - * 4.) Write class heading (package, prologue, source comment, class - * statement, open curly - * 5.) Write class body (member data and methods) - * 6.) Write class closing (close curly) - * 7.) Close the print stream - **/ - public void generate (java.util.Hashtable symbolTable, com.sun.tools.corba.se.idl.SymtabEntry entry) - { - this.symbolTable = symbolTable; - this.entry = entry; - init (); - - openStream (); - if (stream == null) - return; - writeHeading (); - writeBody (); - writeClosing (); - closeStream (); - } // generate - - /** - * Initialize variables unique to this generator. - **/ - protected void init () - { - holderClass = entry.name () + "Holder"; - helperClass = Util.helperName (entry, true); // - if (entry instanceof ValueBoxEntry) - { - ValueBoxEntry v = (ValueBoxEntry) entry; - TypedefEntry member = ((InterfaceState) v.state ().elementAt (0)).entry; - SymtabEntry mType = member.type (); - holderType = Util.javaName (mType); - } - else - holderType = Util.javaName (entry); - } // init - - /** - * Open the print stream for subsequent output. - **/ - protected void openStream () - { - stream = Util.stream (entry, "Holder.java"); - } // openStream - - /** - * Generate the heading, including the package, imports, - * source comment, class statement, and left curly. - **/ - protected void writeHeading () - { - Util.writePackage (stream, entry, Util.HolderFile); - Util.writeProlog (stream, stream.name ()); - if (entry.comment () != null) - entry.comment ().generate ("", stream); - stream.println ("public final class " + holderClass + " implements org.omg.CORBA.portable.Streamable"); - stream.println ('{'); - } // writeHeading - - /** - * Generate members of this class. - **/ - protected void writeBody () - { - if (entry instanceof ValueBoxEntry) - stream.println (" public " + holderType + " value;"); - else - Util.writeInitializer (" public ", "value", "", entry, stream); - stream.println (); - writeCtors (); - writeRead (); - writeWrite (); - writeType (); - } // writeBody - - /** - * Generate the closing statements. - **/ - protected void writeClosing () - { - stream.println ('}'); - } // writeClosing - - /** - * Write the stream to file by closing the print stream. - **/ - protected void closeStream () - { - stream.close (); - } // closeStream - - /** - * Generate the constructors. - **/ - protected void writeCtors () - { - stream.println (" public " + holderClass + " ()"); - stream.println (" {"); - stream.println (" }"); - stream.println (); - stream.println (" public " + holderClass + " (" + holderType + " initialValue)"); - stream.println (" {"); - stream.println (" value = initialValue;"); - stream.println (" }"); - stream.println (); - } // writeCtors - - /** - * Generate the _read method. - **/ - protected void writeRead () - { - stream.println (" public void _read (org.omg.CORBA.portable.InputStream i)"); - stream.println (" {"); - if (entry instanceof ValueBoxEntry) - { - TypedefEntry member = ((InterfaceState) ((ValueBoxEntry) entry).state ().elementAt (0)).entry; - SymtabEntry mType = member.type (); - if (mType instanceof StringEntry) - stream.println (" value = i.read_string ();"); - - else if (mType instanceof PrimitiveEntry) - stream.println (" value = " + helperClass + ".read (i).value;"); - - else - stream.println (" value = " + helperClass + ".read (i);"); - } - else - stream.println (" value = " + helperClass + ".read (i);"); - stream.println (" }"); - stream.println (); - } // writeRead - - /** - * Generate the _write method. - **/ - protected void writeWrite () - { - stream.println (" public void _write (org.omg.CORBA.portable.OutputStream o)"); - stream.println (" {"); - if (entry instanceof ValueBoxEntry) - { - TypedefEntry member = ((InterfaceState) ((ValueBoxEntry) entry).state ().elementAt (0)).entry; - SymtabEntry mType = member.type (); - if (mType instanceof StringEntry) - stream.println (" o.write_string (value);"); - - else if (mType instanceof PrimitiveEntry) - { - String name = entry.name (); - stream.println (" " + name + " vb = new " + name + " (value);"); - stream.println (" " + helperClass + ".write (o, vb);"); - } - - else - stream.println (" " + helperClass + ".write (o, value);"); - } - else - stream.println (" " + helperClass + ".write (o, value);"); - stream.println (" }"); - stream.println (); - } // writeWrite - - /** - * Generate the _type method. - **/ - protected void writeType () - { - stream.println (" public org.omg.CORBA.TypeCode _type ()"); - stream.println (" {"); - stream.println (" return " + helperClass + ".type ();"); - stream.println (" }"); - stream.println (); - } // writeType - - protected java.util.Hashtable symbolTable; - protected com.sun.tools.corba.se.idl.SymtabEntry entry; - protected GenFileStream stream; - - // Unique to this generator - protected String holderClass; - protected String helperClass; - protected String holderType; -} // class Holder diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/InterfaceGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/InterfaceGen.java deleted file mode 100644 index 2667b9ee63b..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/InterfaceGen.java +++ /dev/null @@ -1,864 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: -// -The ctor should really throw an exception, but then it must have a -// throws clause. How much of a ripple effect is this? -// -F46082.51 Remove -stateful feature. -// -D60929 Update for RTF2.4 changes -// -D61056 Use Util.helperName -// -D62014 Move const definitions from signature to operations interf. -// -D62310 Fix declaration of interfaces extending abstract intf. -// -D62023 Move const definitions back from operations to signature. - -import java.io.PrintWriter; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Vector; - -import com.sun.tools.corba.se.idl.GenFileStream; -import com.sun.tools.corba.se.idl.ConstEntry; -import com.sun.tools.corba.se.idl.InterfaceEntry; -import com.sun.tools.corba.se.idl.InterfaceState; -import com.sun.tools.corba.se.idl.MethodEntry; -import com.sun.tools.corba.se.idl.PrimitiveEntry; -import com.sun.tools.corba.se.idl.SequenceEntry; -import com.sun.tools.corba.se.idl.StringEntry; -import com.sun.tools.corba.se.idl.SymtabEntry; -import com.sun.tools.corba.se.idl.TypedefEntry; - -/** - * - **/ -public class InterfaceGen implements com.sun.tools.corba.se.idl.InterfaceGen, JavaGenerator -{ - /** - * Public zero-argument constructor. - **/ - public InterfaceGen () - { - //emit = ((Arguments)Compile.compiler.arguments).emit; - //factories = (Factories)Compile.compiler.factories (); - } // ctor - - /** - * Generate the interface and all the files associated with it. - * Provides general algorithm for binding generation: - * 1.) Initialize symbol table and symbol table entry members, common to all generators. - * 2.) Generate the skeleton if required by calling generateSkeletn () - * 3.) Generate the holder by calling generateHolder () - * 4.) Generate the helper by calling generateHelper () - * 5.) Generate the stub if required by calling generateStub () - * 6.) Generate the interface by calling generateInterface () - **/ - public void generate (Hashtable symbolTable, InterfaceEntry i, PrintWriter stream) - { - if (!isPseudo(i)) - { - this.symbolTable = symbolTable; - this.i = i; - init (); - - // for sun_local pragma, just generate the signature and operations interfaces - // for sun_localservant pragma, generate the Local Stubs, and Skel, should not - // have _invoke defined. - // for local (is_local()) case, generate only Helpers and Holder, where they - // have been modified to throw appropriate exceptions for read and write, and - // narrow is modified to not invoke _is_a - - if (! (i.isLocalSignature())) { - // generate the stubs and skeletons for non-local interfaces - if (! (i.isLocal())) { - // for local servant case just generate the skeleton, but - // for others generate the stubs also - generateSkeleton (); - - // _REVISIT_, Whenever there is time restructure the code to - // encapsulate stub and skeleton generation. - - // If the option is -fallTie then generate the Tie class first - // and then generate the ImplBase class to make the generation - // complete for the Hierarchy. - Arguments theArguments = (Arguments)Compile.compiler.arguments; - if( (theArguments.TIEServer == true ) - &&(theArguments.emit == theArguments.All ) ) - { - theArguments.TIEServer = false; - // Generate the ImplBase class - generateSkeleton (); - // Revert in case file contains multiple interfaces - theArguments.TIEServer = true; - } - generateStub (); - } - generateHolder (); - generateHelper (); - } - intfType = SIGNATURE; - generateInterface (); - intfType = OPERATIONS; - generateInterface (); - intfType = 0; - } - } // generate - - /** - * Initialize members unique to this generator. - **/ - protected void init () - { - emit = ((Arguments)Compile.compiler.arguments).emit; - factories = (Factories)Compile.compiler.factories (); - } // init - - /** - * Generate a Skeleton when the user does not want just the client-side code. - **/ - protected void generateSkeleton () - { - // Remove -stateful feature. - // The Skeleton is generated only when the user doesn't want - // JUST the client code OR when the interface is stateful - //if (emit != Arguments.Client || i.state () != null) - // factories.skeleton ().generate (symbolTable, i); - if (emit != Arguments.Client) - factories.skeleton ().generate (symbolTable, i); - } // generateSkeleton - - /** - * Generate a Stub when the user does not want just the server-side code. - **/ - protected void generateStub () - { - // According to Simon on 10/28/98, we should generate stubs for - // abstract interfaces too. - if (emit != Arguments.Server /* && !i.isAbstract () */) - factories.stub ().generate (symbolTable, i); - } // generateStub - - /** - * Generate a Helper when the user does not want just the server-side code. - **/ - protected void generateHelper () - { - if (emit != Arguments.Server) - factories.helper ().generate (symbolTable, i); - } // generateHelper - - /** - * Generate a Holder when the user does not want just the server-side code. - **/ - protected void generateHolder () - { - if (emit != Arguments.Server) - factories.holder ().generate (symbolTable, i); - } // generateHolder - - /** - * Generate the interface. Provides general algorithm for binding generation: - *
              - *
            1. Initialize members unique to this generator - init()
            2. - *
            3. Open print stream - openStream()
            4. - *
            5. Write class heading (package, prologue, class statement, open curly - writeHeading()
            6. - *
            7. Write class body (member data and methods) - write*Body()
            8. - *
            9. Write class closing (close curly) - writeClosing()
            10. - *
            11. Close the print stream - closeStream ()
            12. - *
            - * - * For CORBA 2.3, interfaces are mapped to Operations and Signature - * interfaces. The Operations interface contains the method definitions. - * The Signature interface extends the Operations interface and adds - * CORBA::Object. (klr) - **/ - protected void generateInterface () - { - init (); - openStream (); - if (stream == null) - return; - writeHeading (); - if (intfType == OPERATIONS) - writeOperationsBody (); - if (intfType == SIGNATURE) - writeSignatureBody (); - writeClosing (); - closeStream (); - } // generateInterface - - /** - * - **/ - protected void openStream () - { - if (i.isAbstract () || intfType == SIGNATURE) - stream = Util.stream (i, ".java"); - else if (intfType == OPERATIONS) - stream = Util.stream (i, "Operations.java"); - } // openStream - - /** - * - **/ - protected void writeHeading () - { - Util.writePackage (stream, i, Util.TypeFile); - Util.writeProlog (stream, ((GenFileStream)stream).name ()); - - // Transfer interface comment to target <31jul1997>. - if (i.comment () != null) - i.comment ().generate ("", stream); - - String className = i.name (); -// if (((Arguments)Compile.compiler.arguments).TIEServer) -// { -// // For the delegate model, don't make interface a subclass of CORBA.Object -// stream.print ("public interface " + className); -// boolean firstTime = true; -// for (int ii = 0; ii < i.derivedFrom ().size (); ++ii) -// { -// SymtabEntry parent = (SymtabEntry)i.derivedFrom ().elementAt (ii); -// if (!parent.fullName ().equals ("org/omg/CORBA/Object")) -// { -// if (firstTime) -// { -// firstTime = false; -// stream.print (" extends "); -// } -// else -// stream.print (", "); -// stream.print (Util.javaName (parent)); -// } -// } -// if (i.derivedFrom ().size () > 0) -// stream.print (", "); -// stream.print ("org.omg.CORBA.portable.IDLEntity "); -// } -// -// else -// { - if (intfType == SIGNATURE) - writeSignatureHeading (); - else if (intfType == OPERATIONS) - writeOperationsHeading (); -// } - - stream.println (); - stream.println ('{'); - } // writeHeading - - /** - * - **/ - protected void writeSignatureHeading () - { - String className = i.name (); - stream.print ("public interface " + className + " extends " + className + "Operations, "); - boolean firstTime = true; - boolean hasNonAbstractParent = false; // - for (int k = 0; k < i.derivedFrom ().size (); ++k) - { - if (firstTime) - firstTime = false; - else - stream.print (", "); - InterfaceEntry parent = (InterfaceEntry)i.derivedFrom ().elementAt (k); - stream.print (Util.javaName (parent)); - if (! parent.isAbstract ()) // - hasNonAbstractParent = true; // - } - // - begin - // If this interface extends only abstract interfaces, - // it should extend both org.omg.CORBA.Object and IDLEntity. - if (!hasNonAbstractParent) { - stream.print (", org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity "); - } - else { - // - end - // extends IDLEntity if there's only one default parent - CORBA.Object - if (i.derivedFrom ().size () == 1) - stream.print (", org.omg.CORBA.portable.IDLEntity "); - } - } // writeSignatureHeading - - /** - * - **/ - protected void writeOperationsHeading () - { - stream.print ("public interface " + i.name ()); - if ( !i.isAbstract ()) - stream.print ("Operations "); - else { - // - base abstract interfaces extend AbstractBase - // changed to IDLEntity by SCN per latest spec... - if (i.derivedFrom ().size () == 0) - stream.print (" extends org.omg.CORBA.portable.IDLEntity"); - } - - boolean firstTime = true; - for (int k = 0; k < i.derivedFrom ().size (); ++k) - { - InterfaceEntry parent = (InterfaceEntry) i.derivedFrom ().elementAt (k); - String parentName = Util.javaName (parent); - - // ignore the default parent - CORBA.Object - if (parentName.equals ("org.omg.CORBA.Object")) - continue; - - if (firstTime) - { - firstTime = false; - stream.print (" extends "); - } - else - stream.print (", "); - - // Don't append suffix Operations to the parents of abstract interface - // or to the abstract parents of regular interface - if (parent.isAbstract () || i.isAbstract ()) - stream.print (parentName); - else - stream.print (parentName + "Operations"); - } - } // writeOperationsHeading - - - /** - * - **/ - protected void writeOperationsBody () - { - // Generate everything but constants - Enumeration e = i.contained ().elements (); - while (e.hasMoreElements ()) - { - SymtabEntry contained = (SymtabEntry)e.nextElement (); - if (contained instanceof MethodEntry) - { - MethodEntry element = (MethodEntry)contained; - ((MethodGen)element.generator ()).interfaceMethod (symbolTable, element, stream); - } - else - if ( !(contained instanceof ConstEntry)) - contained.generate (symbolTable, stream); - } - } // writeOperationsBody - - /** - * - **/ - protected void writeSignatureBody () - { - // Generate only constants - Enumeration e = i.contained ().elements (); - while (e.hasMoreElements ()) - { - SymtabEntry contained = (SymtabEntry)e.nextElement (); - if (contained instanceof ConstEntry) - contained.generate (symbolTable, stream); - } - } // writeSignatureBody - - /** - * - **/ - protected void writeClosing () - { - String intfName = i.name (); - if ( !i.isAbstract () && intfType == OPERATIONS) - intfName = intfName + "Operations"; - stream.println ("} // interface " + intfName); - } // writeClosing - - /** - * - **/ - protected void closeStream () - { - stream.close (); - } // closeStream - - /////////////// - // From JavaGenerator - - // Remove -stateful feature. - /* - public int helperType (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) - { - InterfaceEntry i = (InterfaceEntry)entry; - if (i.state () != null && i.state ().size () > 0) - index = structHelperType (index, indent, tcoffsets, name, entry, stream); - else - { - tcoffsets.set (entry); - if (entry.fullName ().equals ("org/omg/CORBA/Object")) - stream.println (indent + name - + " = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_objref);"); - else - stream.println (indent + name - // <54697> - //+ " = org.omg.CORBA.ORB.init ().create_interface_tc (_id, " - + " = org.omg.CORBA.ORB.init ().create_interface_tc (" + Util.helperName (i, true) + ".id (), " // - + '\"' + Util.stripLeadingUnderscores (entry.name ()) + "\");"); - } - return index; - } // helperType - */ - public int helperType (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) - { - InterfaceEntry i = (InterfaceEntry)entry; - tcoffsets.set (entry); - if (entry.fullName ().equals ("org/omg/CORBA/Object")) - stream.println (indent + name - + " = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_objref);"); - else - stream.println (indent + name - // <54697> - //+ " = org.omg.CORBA.ORB.init ().create_interface_tc (_id, " - + " = org.omg.CORBA.ORB.init ().create_interface_tc (" + Util.helperName (i, true) + ".id (), " // - + '\"' + Util.stripLeadingUnderscores (entry.name ()) + "\");"); - return index; - } // helperType - - public int type (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) { - stream.println (indent + name + " = " + Util.helperName (entry, true) + ".type ();"); // - return index; - } // type - - // Remove -stateful feature. - /* - public void helperRead (String entryName, SymtabEntry entry, PrintWriter stream) - { - InterfaceEntry i = (InterfaceEntry)entry; - if (i.state () != null) - structHelperRead (entryName, i, stream); - else - { - if (i.isAbstract ()) - stream.println (" return narrow (((org.omg.CORBA_2_3.portable.InputStream)istream).read_abstract_interface (_" + i.name () + "Stub.class));"); // - else - stream.println (" return narrow (istream.read_Object (_" + i.name () + "Stub.class));"); - } - } // helperRead - - */ - public void helperRead (String entryName, SymtabEntry entry, PrintWriter stream) - { - InterfaceEntry i = (InterfaceEntry)entry; - if (i.isAbstract ()) - stream.println (" return narrow (((org.omg.CORBA_2_3.portable.InputStream)istream).read_abstract_interface (_" + i.name () + "Stub.class));"); // - else - stream.println (" return narrow (istream.read_Object (_" + i.name () + "Stub.class));"); - } // helperRead - - // Remove -stateful feature. - /* - public void helperWrite (SymtabEntry entry, PrintWriter stream) - { - InterfaceEntry i = (InterfaceEntry)entry; - if (i.state () != null) - structHelperWrite (entry, stream); - else - write (0, " ", "value", entry, stream); - } // helperWrite - */ - public void helperWrite (SymtabEntry entry, PrintWriter stream) - { - write (0, " ", "value", entry, stream); - } // helperWrite - - // Remove -stateful feature. - /* - public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - InterfaceEntry i = (InterfaceEntry)entry; - if (i.state () != null) - index = structRead (index, indent, name, i, stream); - else - { - if (entry.fullName ().equals ("org/omg/CORBA/Object")) - stream.println (indent + name + " = istream.read_Object (_" + i.name () + "Stub.class);"); - else - stream.println (indent + name + " = " + Util.helperName (entry, false) + ".narrow (istream.read_Object (_" + i.name () + "Stub.class));"); // - } - return index; - } // read - */ - public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - InterfaceEntry i = (InterfaceEntry)entry; - if (entry.fullName ().equals ("org/omg/CORBA/Object")) - stream.println (indent + name + " = istream.read_Object (_" + i.name () + "Stub.class);"); - else - stream.println (indent + name + " = " + Util.helperName (entry, false) + ".narrow (istream.read_Object (_" + i.name () + "Stub.class));"); // - return index; - } // read - - // Remove -stateful feature. - /* - public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - InterfaceEntry i = (InterfaceEntry)entry; - if (i.state () != null) - index = structWrite (index, indent, name, entry, stream); - else - { - if (i.isAbstract ()) - stream.println (indent + "((org.omg.CORBA_2_3.portable.OutputStream)ostream).write_abstract_interface ((java.lang.Object) " + name + ");"); // - else - stream.println (indent + "ostream.write_Object ((org.omg.CORBA.Object) " + name + ");"); - } - return index; - } // write - */ - public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - InterfaceEntry i = (InterfaceEntry)entry; - if (i.isAbstract ()) - stream.println (indent + "((org.omg.CORBA_2_3.portable.OutputStream)ostream).write_abstract_interface ((java.lang.Object) " + name + ");"); // - else - stream.println (indent + "ostream.write_Object ((org.omg.CORBA.Object) " + name + ");"); - return index; - } // write - - // Remove -stateful feature. - /* - // These methods are cobbled from StructGen. Stateful interfaces - // are sent across the wire as if they were structs, with the first - // element being a string - the Java name of the class. - - public int structHelperType (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) - { - TCOffsets innerOffsets = new TCOffsets (); - innerOffsets.set (entry); - int offsetForStruct = innerOffsets.currentOffset (); - InterfaceEntry i = (InterfaceEntry)entry; - String membersName = "_members" + index++; - Vector state = i.state (); - stream.println (indent + "org.omg.CORBA.StructMember[] " + membersName + " = new org.omg.CORBA.StructMember [" + (state.size () + 1) + "];"); - String tcOfMembers = "_tcOf" + membersName; - stream.println (indent + "org.omg.CORBA.TypeCode " + tcOfMembers + ';'); - - // The name string is the first element of the struct - String memberName = "_name"; - StringEntry stringEntry = Compile.compiler.factory.stringEntry (); - index = ((JavaGenerator)stringEntry.generator ()).helperType (index, indent, innerOffsets, tcOfMembers, stringEntry, stream); - stream.println (indent + membersName + "[0] = new org.omg.CORBA.StructMember ("); - stream.println (indent + " \"" + memberName + "\","); - stream.println (indent + " " + tcOfMembers + ','); - stream.println (indent + " null);"); - int offsetSoFar = innerOffsets.currentOffset (); - innerOffsets = new TCOffsets (); - innerOffsets.set (entry); - innerOffsets.bumpCurrentOffset (offsetSoFar - offsetForStruct); - - for (int idx = 0; idx < state.size (); ++idx) - { - TypedefEntry member = ((InterfaceState)state.elementAt (idx)).entry; - memberName = member.name (); - index = ((JavaGenerator)member.generator ()).helperType (index, indent, innerOffsets, tcOfMembers, member, stream); - stream.println (indent + membersName + '[' + (idx + 1) + "] = new org.omg.CORBA.StructMember ("); - stream.println (indent + " \"" + memberName + "\","); - stream.println (indent + " " + tcOfMembers + ','); - stream.println (indent + " null);"); - offsetSoFar = innerOffsets.currentOffset (); - innerOffsets = new TCOffsets (); - innerOffsets.set (entry); - innerOffsets.bumpCurrentOffset (offsetSoFar - offsetForStruct); - } - tcoffsets.bumpCurrentOffset (innerOffsets.currentOffset ()); - stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_struct_tc (id (), \"" + entry.name () + "\", " + membersName + ");"); - return index; - } // structHelperType - - public void structHelperRead (String entryName, InterfaceEntry entry, PrintWriter stream) - { - String impl = implName ((InterfaceEntry)entry); - stream.println (" " + Util.javaStatefulName (entry) + " value = null;"); - structRead (0, " ", "value", entry, stream); - stream.println (" return value;"); - } // structHelperRead - - private String implName (InterfaceEntry entry) - { - String name; - if (entry.container ().name ().equals ("")) - name = '_' + entry.name () + "Impl"; - else - name = Util.containerFullName (entry.container ()) + "._" + entry.name () + "Impl"; - return name.replace ('/', '.'); - } // implName - - public int structRead (int index, String indent, String name, InterfaceEntry entry, PrintWriter stream) - { - // The first element will be the name of the Java implementation class. - String stringName = "_name" + index++; - stream.println (indent + "String " + stringName + " = istream.read_string ();"); - stream.println (indent + "try"); - stream.println (indent + "{"); - stream.println (indent + " " + name + " = (" + Util.javaStatefulName (entry) + ")com.sun.CORBA.iiop.ORB.getImpl (" + stringName + ".replace ('/', '.'));"); - stream.println (indent + "}"); - stream.println (indent + "catch (Exception e)"); - stream.println (indent + "{"); - stream.println (indent + " " + name + " = null;"); - stream.println (indent + "}"); - stream.println (indent + "if (" + name + " == null)"); - stream.println (indent + " throw new org.omg.CORBA.NO_IMPLEMENT (0, org.omg.CORBA.CompletionStatus.COMPLETED_NO);"); - stream.println (); - - stream.println (indent + "if (!" + stringName + ".equals (\"" + entry.fullName () + "\"))"); - stream.println (indent + '{'); - stream.println (indent + " Class _cls = " + name + ".getClass ();"); - stream.println (indent + " boolean _found = false;"); - stream.println (indent + " while (!_found && _cls != null)"); - stream.println (indent + " {"); - stream.println (indent + " Class[] interfaces = _cls.getInterfaces ();"); - stream.println (indent + " for (int i = 0; i < interfaces.length; ++i)"); - stream.println (indent + " if (interfaces[i].getName ().indexOf (\"State\") > 0)"); - stream.println (indent + " {"); - stream.println (indent + " _cls = interfaces[i];"); - stream.println (indent + " _found = true;"); - stream.println (indent + " break;"); - stream.println (indent + " }"); - stream.println (indent + " if (!_found)"); - stream.println (indent + " _cls = _cls.getSuperclass ();"); - stream.println (indent + " }"); - stream.println (indent + " if (_cls == null)"); - stream.println (indent + " throw new org.omg.CORBA.NO_IMPLEMENT (0, org.omg.CORBA.CompletionStatus.COMPLETED_NO);"); - stream.println (); - stream.println (indent + " String _className = _cls.getName ();"); - stream.println (indent + " int _index = _className.lastIndexOf ('.');"); - stream.println (indent + " String _helperName = _className.substring (0, _index + 1) + _className.substring (_index + 2, _className.length () - 5) + \"Helper\"; // 5 == \"State\".length"); - stream.println (indent + " try"); - stream.println (indent + " {"); - stream.println (indent + " Class _helperClass = Class.forName (_helperName);"); - stream.println (indent + " Class[] _formalParms = new Class [1];"); - stream.println (indent + " _formalParms[0] = Class.forName (\"org.omg.CORBA.portable.InputStream\");"); - stream.println (indent + " java.lang.reflect.Method _read = _helperClass.getMethod (\"read\", _formalParms);"); - stream.println (indent + " Object[] _actualParms = new Object [1];"); - stream.println (indent + " _actualParms[0] = istream;"); - stream.println (indent + " " + name + " = (" + Util.javaStatefulName (entry) + ")_read.invoke (null, _actualParms);"); - stream.println (indent + " }"); - stream.println (indent + " catch (Exception e)"); - stream.println (indent + " {"); - stream.println (indent + " throw new org.omg.CORBA.NO_IMPLEMENT (0, org.omg.CORBA.CompletionStatus.COMPLETED_NO);"); - stream.println (indent + " }"); - stream.println (indent + '}'); - - // instantiate an implementation - stream.println (indent + "else"); - stream.println (indent + '{'); - - // Load the state - readState (index, indent, name, (InterfaceEntry)entry, stream); - - stream.println (indent + '}'); - return index; - } // structRead - - private void readState (int index, String indent, String name, InterfaceEntry entry, PrintWriter stream) - { - // First write the state from all parents - Enumeration e = entry.derivedFrom ().elements (); - while (e.hasMoreElements ()) - { - InterfaceEntry parent = (InterfaceEntry)e.nextElement (); - if (parent.state () != null) - { - if (parent.state ().size () > 0) - readState (index, indent, name, parent, stream); - break; - } - } - - // Now write the state for the local entry - e = entry.state ().elements (); - while (e.hasMoreElements ()) - { - TypedefEntry member = ((InterfaceState)e.nextElement ()).entry; - String tmpName = '_' + member.name () + "Tmp"; - Util.writeInitializer (indent + " ", tmpName, "", member, stream); - if (!member.arrayInfo ().isEmpty () || member.type () instanceof SequenceEntry || member.type () instanceof PrimitiveEntry || member.type () instanceof StringEntry) - index = ((JavaGenerator)member.generator ()).read (index, indent + " ", tmpName, member, stream); - else - stream.println (indent + " " + tmpName + " = " + Util.helperName (member.type (), true) + ".read (istream);"); // - stream.println (indent + " " + name + '.' + member.name () + " (" + tmpName + ");"); - } - } // readState - - public void structHelperWrite (SymtabEntry entry, PrintWriter stream) - { - structWrite (0, " ", "value", entry, stream); - } // structHelperWrite - - public int structWrite (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - // The first element of the struct must be the name of the real interface. - stream.println (indent + "Class _cls = " + name + ".getClass ();"); - stream.println (indent + "boolean _found = false;"); - stream.println (indent + "while (!_found && _cls != null)"); - stream.println (indent + "{"); - stream.println (indent + " Class[] interfaces = _cls.getInterfaces ();"); - stream.println (indent + " for (int i = 0; i < interfaces.length; ++i)"); - stream.println (indent + " if (interfaces[i].getName ().indexOf (\"State\") > 0)"); - stream.println (indent + " {"); - stream.println (indent + " _cls = interfaces[i];"); - stream.println (indent + " _found = true;"); - stream.println (indent + " break;"); - stream.println (indent + " }"); - stream.println (indent + " if (!_found)"); - stream.println (indent + " _cls = _cls.getSuperclass ();"); - stream.println (indent + '}'); - stream.println (); - stream.println (indent + "if (_cls == null)"); - stream.println (indent + " throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_NO);"); - stream.println (); - stream.println (indent + "String _className = _cls.getName ();"); - stream.println (indent + "int _index = _className.lastIndexOf ('.');"); - stream.println (indent + "String _interfaceName = _className.substring (0, _index + 1) + _className.substring (_index + 2, _className.length () - 5); // 5 == \"State\".length"); - stream.println (indent + "ostream.write_string (_interfaceName.replace ('.', '/'));"); - - // If _className != Util.javaName (entry), then call that class's helper class. - stream.println (); - stream.println (indent + "if (!_interfaceName.equals (\"" + Util.javaName (entry) + "\"))"); - stream.println (indent + '{'); - stream.println (indent + " try"); - stream.println (indent + " {"); - stream.println (indent + " Class _helperClass = Class.forName (_interfaceName + \"Helper\");"); - stream.println (indent + " Class[] _formalParms = new Class [2];"); - stream.println (indent + " _formalParms[0] = Class.forName (\"org.omg.CORBA.portable.OutputStream\");"); - stream.println (indent + " _formalParms[1] = _cls;"); - stream.println (indent + " java.lang.reflect.Method _write = _helperClass.getMethod (\"write\", _formalParms);"); - stream.println (indent + " Object[] _actualParms = new Object [2];"); - stream.println (indent + " _actualParms[0] = ostream;"); - stream.println (indent + " _actualParms[1] = " + name + ';'); - stream.println (indent + " _write.invoke (null, _actualParms);"); - stream.println (indent + " }"); - stream.println (indent + " catch (Exception e)"); - stream.println (indent + " {"); - stream.println (indent + " throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_NO);"); - stream.println (indent + " }"); - stream.println (indent + '}'); - - stream.println (indent + "else"); - stream.println (indent + '{'); - - writeState (index, indent, name, (InterfaceEntry)entry, stream); - - stream.println (indent + '}'); - return index; - } // structWrite - - private void writeState (int index, String indent, String name, InterfaceEntry entry, PrintWriter stream) - { - // First write the state from all parents - Enumeration e = entry.derivedFrom ().elements (); - while (e.hasMoreElements ()) - { - InterfaceEntry parent = (InterfaceEntry)e.nextElement (); - if (parent.state () != null) - { - if (parent.state ().size () > 0) - writeState (index, indent, name, parent, stream); - break; - } - } - - // Now write the state for the local entry - Vector members = entry.state (); - for (int i = 0; i < members.size (); ++i) - { - TypedefEntry member = ((InterfaceState)members.elementAt (i)).entry; - if (!member.arrayInfo ().isEmpty () || member.type () instanceof SequenceEntry || member.type () instanceof PrimitiveEntry || member.type () instanceof StringEntry) - index = ((JavaGenerator)member.generator ()).write (index, indent + " ", name + '.' + member.name () + "()", member, stream); - else - stream.println (indent + " " + Util.helperName (member.type (), true) + ".write (ostream, " + name + '.' + member.name () + " ());"); // - } - } // writeState - */ - - /** - * @return true if the entry is for a CORBA pseudo-object. - **/ - private boolean isPseudo(InterfaceEntry i) { - java.lang.String fullname = i.fullName(); - if (fullname.equalsIgnoreCase("CORBA/TypeCode")) - return true; - if (fullname.equalsIgnoreCase("CORBA/Principal")) - return true; - if (fullname.equalsIgnoreCase("CORBA/ORB")) - return true; - if (fullname.equalsIgnoreCase("CORBA/Any")) - return true; - if (fullname.equalsIgnoreCase("CORBA/Context")) - return true; - if (fullname.equalsIgnoreCase("CORBA/ContextList")) - return true; - if (fullname.equalsIgnoreCase("CORBA/DynamicImplementation")) - return true; - if (fullname.equalsIgnoreCase("CORBA/Environment")) - return true; - if (fullname.equalsIgnoreCase("CORBA/ExceptionList")) - return true; - if (fullname.equalsIgnoreCase("CORBA/NVList")) - return true; - if (fullname.equalsIgnoreCase("CORBA/NamedValue")) - return true; - if (fullname.equalsIgnoreCase("CORBA/Request")) - return true; - if (fullname.equalsIgnoreCase("CORBA/ServerRequest")) - return true; - if (fullname.equalsIgnoreCase("CORBA/UserException")) - return true; - return false; - } - - // From JavaGenerator - /////////////// - - protected int emit = 0; - protected Factories factories = null; - - protected Hashtable symbolTable = null; - protected InterfaceEntry i = null; - protected PrintWriter stream = null; - - // Modify access to protected. - protected static final int SIGNATURE = 1; - protected static final int OPERATIONS = 2; - protected int intfType = 0; -} // class InterfaceGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/JavaGenerator.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/JavaGenerator.java deleted file mode 100644 index 69a2f6ee0ff..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/JavaGenerator.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: - -import java.io.PrintWriter; - -import com.sun.tools.corba.se.idl.SymtabEntry; - -/** - * - **/ -public interface JavaGenerator -{ - // The helper methods print the specific helper method. - // The helper read/write methods call the read/write methods. - - int helperType (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream); - - void helperRead (String entryName, SymtabEntry entry, PrintWriter stream); - - void helperWrite (SymtabEntry entry, PrintWriter stream); - - // The read/write methods print the streaming of the type. - // This printed code is found in the helper method but it is only - // that code that is concerned with streaming itself. - - int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream); - - int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream); - - int type (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream); - -} // interface JavaGenerator diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/MethodGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/MethodGen.java deleted file mode 100644 index 155d27c58a1..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/MethodGen.java +++ /dev/null @@ -1,1091 +0,0 @@ -/* - * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: -// -After demarshalling an IOR, think about how to deal with the exceptions. -// -catching Exception throws a string which should be in a properties file. -// -30jul1997 Modified to write comment immediately preceding method signature. -// -07May1998 Modified to support RMI Portable Stub -// -26Aug1998 Modified to pass helper instance to read_Value. -// -F46082.51 Remove -stateful feature; javaStatefulName() obsolete. -// -D56554 Port bounded string checks from toJava to toJavaPortable -// -D58549 bounded string checks on in/inout parms throw BAD_PARAM -// -D57112 Valuetype initializers map to ctor, regardless of name, and -// "void _init(...)" methods now mapped correctly. -// -D59297 pass context parm when Remarshalling -// -D59560 call read/write_Context -// -D60929 Update for RTF2.4 changes -// -D61056 Use Util.helperName -// -D61650 Remove '\n' from generated strings; use println()'s. - -import java.io.PrintWriter; -import java.util.Enumeration; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.EnumEntry; -import com.sun.tools.corba.se.idl.ExceptionEntry; -import com.sun.tools.corba.se.idl.InterfaceEntry; -import com.sun.tools.corba.se.idl.MethodEntry; -import com.sun.tools.corba.se.idl.ParameterEntry; -import com.sun.tools.corba.se.idl.PrimitiveEntry; -import com.sun.tools.corba.se.idl.StringEntry; -import com.sun.tools.corba.se.idl.SymtabEntry; -import com.sun.tools.corba.se.idl.SequenceEntry; -import com.sun.tools.corba.se.idl.ValueEntry; -import com.sun.tools.corba.se.idl.ValueBoxEntry; -import com.sun.tools.corba.se.idl.InterfaceState; -import com.sun.tools.corba.se.idl.TypedefEntry; -import com.sun.tools.corba.se.idl.AttributeEntry; - -import com.sun.tools.corba.se.idl.constExpr.Expression; - -/** - * - **/ -public class MethodGen implements com.sun.tools.corba.se.idl.MethodGen -{ - private static final String ONE_INDENT = " "; - private static final String TWO_INDENT = " "; - private static final String THREE_INDENT = " "; - private static final String FOUR_INDENT = " "; - private static final String FIVE_INDENT = " "; - // This is the length of _get_ and _set_ - private static final int ATTRIBUTE_METHOD_PREFIX_LENGTH = 5; - /** - * Public zero-argument constructor. - **/ - public MethodGen () - { - } // ctor - - /** - * Method generate() is not used in MethodGen. They are replaced by the - * more granular interfaceMethod, stub, skeleton, dispatchSkeleton. - **/ - public void generate (Hashtable symbolTable, MethodEntry m, PrintWriter stream) - { - } // generate - - /** - * - **/ - protected void interfaceMethod (Hashtable symbolTable, MethodEntry m, PrintWriter stream) - { - this.symbolTable = symbolTable; - this.m = m; - this.stream = stream; - if (m.comment () != null) - m.comment ().generate ("", stream); - stream.print (" "); - SymtabEntry container = (SymtabEntry)m.container (); - boolean isAbstract = false; - boolean valueContainer = false; - if (container instanceof ValueEntry) - { - isAbstract = ((ValueEntry)container).isAbstract (); - valueContainer = true; - } - if (valueContainer && !isAbstract) - stream.print ("public "); - writeMethodSignature (); - if (valueContainer && !isAbstract) - { - stream.println (); - stream.println (" {"); - stream.println (" }"); - stream.println (); - } - else - stream.println (";"); - } // interfaceMethod - - /** - * - **/ - protected void stub (String className, boolean isAbstract, - Hashtable symbolTable, MethodEntry m, PrintWriter stream, int index) - { - localOptimization = - ((Arguments)Compile.compiler.arguments).LocalOptimization; - this.isAbstract = isAbstract; - this.symbolTable = symbolTable; - this.m = m; - this.stream = stream; - this.methodIndex = index; - if (m.comment () != null) - m.comment ().generate (" ", stream); - stream.print (" public "); - writeMethodSignature (); - stream.println (); - stream.println (" {"); - writeStubBody ( className ); - stream.println (" } // " + m.name ()); - stream.println (); - } // stub - - /** - * - **/ - protected void localstub (Hashtable symbolTable, MethodEntry m, PrintWriter stream, int index, InterfaceEntry i) - { - this.symbolTable = symbolTable; - this.m = m; - this.stream = stream; - this.methodIndex = index; - if (m.comment () != null) - m.comment ().generate (" ", stream); - stream.print (" public "); - writeMethodSignature (); - stream.println (); - stream.println (" {"); - writeLocalStubBody (i); - stream.println (" } // " + m.name ()); - stream.println (); - } // stub - /** - * - **/ - protected void skeleton (Hashtable symbolTable, MethodEntry m, PrintWriter stream, int index) - { - this.symbolTable = symbolTable; - this.m = m; - this.stream = stream; - this.methodIndex = index; - if (m.comment () != null) - m.comment ().generate (" ", stream); - stream.print (" public "); - writeMethodSignature (); - stream.println (); - stream.println (" {"); - writeSkeletonBody (); - stream.println (" } // " + m.name ()); - } // skeleton - - /** - * - **/ - protected void dispatchSkeleton (Hashtable symbolTable, MethodEntry m, PrintWriter stream, int index) - { - this.symbolTable = symbolTable; - this.m = m; - this.stream = stream; - this.methodIndex = index; - if (m.comment () != null) - m.comment ().generate (" ", stream); - writeDispatchCall (); - } // dispatchSkeleton - - // - /** - * Determine whether method entry m is a valuetype initializer. - * @return true if is m is valuetype initializer, false otherwise. - **/ - protected boolean isValueInitializer () - { - MethodEntry currentInit = null; - if ((m.container () instanceof ValueEntry)) - { - Enumeration e = ((ValueEntry)m.container ()).initializers ().elements (); - while (currentInit != m && e.hasMoreElements ()) - currentInit = (MethodEntry)e.nextElement (); - } - return (currentInit == m) && (null != m); // True ==> yes, false ==> no. - } // isValueInitializer - - /** - * - **/ - protected void writeMethodSignature () - { - boolean isValueInitializer = isValueInitializer (); // - - // Step 0. Print the return type and name. - // A return type of null indicates the "void" return type. If m is a - // Valuetype intitializer, it has name "init" and a null return type, - // but it maps to a ctor. - // - //if (m.type () == null) - //{ - // if (m.name ().compareTo ("init") != 0) - // stream.print ("void"); - //} - if (m.type () == null) - { - if (!isValueInitializer) - stream.print ("void"); - } - else - { - // Remove -stateful feature; javaStatefulName() obsolete. - //stream.print (Util.javaStatefulName (m.type ())); - stream.print (Util.javaName (m.type ())); - } - // Value initializers map to constructors. - // If the value has an 'init' method with a return type, handle - // the method like other regular methods - //if (m.valueMethod () && m.name ().compareTo ("init") == 0 && - // m.type () == null) - if (isValueInitializer) - stream.print (' ' + m.container ().name () + " ("); - else - stream.print (' ' + m.name () + " ("); - - // Step 1. Print the parameter list. - boolean firstTime = true; - Enumeration e = m.parameters ().elements (); - while (e.hasMoreElements ()) - { - if (firstTime) - firstTime = false; - else - stream.print (", "); - ParameterEntry parm = (ParameterEntry)e.nextElement (); - - writeParmType (parm.type (), parm.passType ()); - - // Print parm name - stream.print (' ' + parm.name ()); - } - - // Step 2. Add the context parameter if necessary. - if (m.contexts ().size () > 0) - { - if (!firstTime) - stream.print (", "); - stream.print ("org.omg.CORBA.Context $context"); - } - - // Step 3. Print the throws clause (if necessary). - if (m.exceptions ().size () > 0) - { - stream.print (") throws "); - e = m.exceptions ().elements (); - firstTime = true; - while (e.hasMoreElements ()) - { - if (firstTime) - firstTime = false; - else - stream.print (", "); - stream.print (Util.javaName ((SymtabEntry)e.nextElement ())); - } - } - else - stream.print (')'); - } // writeMethodSignature - - /** - * - **/ - protected void writeParmType (SymtabEntry parm, int passType) - { - if (passType != ParameterEntry.In) - { - parm = Util.typeOf (parm); - stream.print (Util.holderName (parm)); - } - else // passType is `in' - // Remove -stateful feature; javaStatefulName() obsolete. - //stream.print (Util.javaStatefulName (parm)); - stream.print (Util.javaName (parm)); - } // writeParmType - - /** - * - **/ - protected void writeDispatchCall () - { - String indent = " "; - String fullMethodName = m.fullName (); - if (m instanceof AttributeEntry) - { - // determine the index at which the attribute name starts in the full name - int index = fullMethodName.lastIndexOf ('/') + 1; - if (m.type () == null) // if it's a modifier - fullMethodName = fullMethodName.substring (0, index) + "_set_" + m.name (); - else - fullMethodName = fullMethodName.substring (0, index) + "_get_" + m.name (); - } - stream.println (indent + "case " + methodIndex + ": // " + fullMethodName); - stream.println (indent + "{"); - indent = indent + " "; - if (m.exceptions ().size () > 0) - { - stream.println (indent + "try {"); - indent = indent + " "; - } - - // Step 1 Read arguments from the input stream - SymtabEntry mtype = Util.typeOf (m.type ()); - Enumeration parms = m.parameters ().elements (); - parms = m.parameters ().elements (); - while (parms.hasMoreElements ()) - { - ParameterEntry parm = (ParameterEntry) parms.nextElement (); - String name = parm.name (); - String anyName = '_' + name; - SymtabEntry type = parm.type (); - int passType = parm.passType (); - - if (passType == ParameterEntry.In) - Util.writeInitializer (indent, name, "", type, writeInputStreamRead ("in", type), stream); - - else // the parm is a holder - { - String holderName = Util.holderName (type); - stream.println (indent + holderName + ' ' + name + " = new " + holderName + " ();"); - if (passType == ParameterEntry.Inout) - { - if (type instanceof ValueBoxEntry) - { - ValueBoxEntry v = (ValueBoxEntry) type; - TypedefEntry member = ((InterfaceState) v.state ().elementAt (0)).entry; - SymtabEntry mType = member.type (); - if (mType instanceof PrimitiveEntry) - stream.println (indent + name + ".value = (" + writeInputStreamRead ("in", parm.type ()) + ").value;"); - else - stream.println (indent + name + ".value = " + writeInputStreamRead ("in", parm.type ()) + ";"); - } - else - stream.println (indent + name + ".value = " + writeInputStreamRead ("in", parm.type ()) + ";"); - } - } - } - - // Step 1a. Read the context parameter if necessary. - if (m.contexts ().size () > 0) - { - stream.println (indent + "org.omg.CORBA.Context $context = in.read_Context ();"); - } - - // Step 2 Load return if necessary - if (mtype != null) - Util.writeInitializer (indent, "$result", "", mtype, stream); - - // Step 3 Call the method with the list of parameters - writeMethodCall (indent); - - parms = m.parameters ().elements (); - boolean firstTime = true; - while (parms.hasMoreElements ()) - { - ParameterEntry parm = (ParameterEntry)parms.nextElement (); - if (firstTime) - firstTime = false; - else - stream.print (", "); - stream.print (parm.name ()); - } - - // Step 3a. Add the context parameter if necessary. - if (m.contexts ().size () > 0) - { - if (!firstTime) - stream.print (", "); - stream.print ("$context"); - } - - stream.println (");"); - - //Step 3b. Create reply; - writeCreateReply (indent); - - // Step 4 Write method's result to the output stream - if (mtype != null) - { - writeOutputStreamWrite (indent, "out", "$result", mtype, stream); - } - - // Step 5 Write inout/out value to the output stream - parms = m.parameters ().elements (); - while (parms.hasMoreElements ()) - { - ParameterEntry parm = (ParameterEntry)parms.nextElement (); - int passType = parm.passType (); - if (passType != ParameterEntry.In) - { - writeOutputStreamWrite (indent, "out", parm.name () + ".value", parm.type (), stream); - } - } - - // Step 6 Handle exception - if (m.exceptions ().size () > 0) - { - Enumeration exceptions = m.exceptions ().elements (); - while (exceptions.hasMoreElements ()) - { - indent = " "; - ExceptionEntry exc = (ExceptionEntry) exceptions.nextElement (); - String fullName = Util.javaQualifiedName (exc); - stream.println (indent + "} catch (" + fullName + " $ex) {"); - indent = indent + " "; - stream.println (indent + "out = $rh.createExceptionReply ();"); - stream.println (indent + Util.helperName (exc, true) + ".write (out, $ex);"); // - } - - indent = " "; - stream.println (indent + "}"); - } - - stream.println (" break;"); - stream.println (" }"); - stream.println (); - } // writeDispatchCall - - /** - * - **/ - protected void writeStubBody ( String className ) - { - // Step 1 Create a request - String methodName = Util.stripLeadingUnderscores (m.name ()); - if (m instanceof AttributeEntry) - { - if (m.type () == null) // if it's a modifier - methodName = "_set_" + methodName; - else - methodName = "_get_" + methodName; - } - if( localOptimization && !isAbstract ) { - stream.println (ONE_INDENT + "while(true) {" ); - stream.println(TWO_INDENT + "if(!this._is_local()) {" ); - } - stream.println(THREE_INDENT + - "org.omg.CORBA.portable.InputStream $in = null;"); - stream.println(THREE_INDENT + "try {"); - stream.println(FOUR_INDENT + "org.omg.CORBA.portable.OutputStream $out =" + - " _request (\"" + methodName + "\", " + !m.oneway() + ");"); - - // Step 1.b. Check string bounds - // begin in/inout string bounds check - Enumeration parms = m.parameters ().elements (); - while (parms.hasMoreElements ()) - { - ParameterEntry parm = (ParameterEntry)parms.nextElement (); - SymtabEntry parmType = Util.typeOf (parm.type ()); - if (parmType instanceof StringEntry) - if ((parm.passType () == ParameterEntry.In) || - (parm.passType () == ParameterEntry.Inout)) - { - StringEntry string = (StringEntry)parmType; - if (string.maxSize () != null) - { - stream.print (THREE_INDENT + "if (" + parm.name ()); - if (parm.passType () == ParameterEntry.Inout) - stream.print (".value"); // get from holder - stream.print (" == null || " + parm.name ()); - if (parm.passType () == ParameterEntry.Inout) - stream.print (".value"); // get from holder - stream.println (".length () > (" + - Util.parseExpression (string.maxSize ()) + "))"); - stream.println (THREE_INDENT + - "throw new org.omg.CORBA.BAD_PARAM (0," + - " org.omg.CORBA.CompletionStatus.COMPLETED_NO);"); - } - } - } - // end in/inout string bounds check - - // Step 2 Load the parameters into the outputStream - parms = m.parameters ().elements (); - while (parms.hasMoreElements ()) - { - ParameterEntry parm = (ParameterEntry)parms.nextElement (); - if (parm.passType () == ParameterEntry.In) - writeOutputStreamWrite(FOUR_INDENT, "$out", parm.name (), parm.type (), - stream); - else if (parm.passType () == ParameterEntry.Inout) - writeOutputStreamWrite(FOUR_INDENT, "$out", parm.name () + ".value", - parm.type (), stream); - } - - // Step 2a. Write the context parameter if necessary. - if (m.contexts ().size () > 0) - { - stream.println(FOUR_INDENT + "org.omg.CORBA.ContextList $contextList =" + - "_orb ().create_context_list ();"); - - for (int cnt = 0; cnt < m.contexts ().size (); cnt++) - { - stream.println(FOUR_INDENT + - "$contextList.add (\"" + m.contexts (). elementAt (cnt) + "\");"); - } - stream.println(FOUR_INDENT + - "$out.write_Context ($context, $contextList);"); - } - - // Step 3 Invoke the method with the output stream - stream.println (FOUR_INDENT + "$in = _invoke ($out);"); - - SymtabEntry mtype = m.type (); - if (mtype != null) - Util.writeInitializer (FOUR_INDENT, "$result", "", mtype, - writeInputStreamRead ("$in", mtype), stream); - - // Step 4 Read the inout/out values - parms = m.parameters ().elements (); - while (parms.hasMoreElements ()) - { - ParameterEntry parm = (ParameterEntry)parms.nextElement (); - if (parm.passType () != ParameterEntry.In) - { - if (parm.type () instanceof ValueBoxEntry) - { - ValueBoxEntry v = (ValueBoxEntry) parm.type (); - TypedefEntry member = - ((InterfaceState) v.state ().elementAt (0)).entry; - SymtabEntry mType = member.type (); - if (mType instanceof PrimitiveEntry) - stream.println(FOUR_INDENT + parm.name () + - ".value = (" + writeInputStreamRead ("$in", parm.type ()) + - ").value;"); - else - stream.println(FOUR_INDENT + parm.name () + - ".value = " + writeInputStreamRead ("$in", parm.type ()) +";"); - } - else - stream.println (FOUR_INDENT + parm.name () + ".value = " + - writeInputStreamRead ("$in", parm.type ()) + ";"); - } - } - // Step 4.b. Check string bounds - // begin out/inout/return string bounds check - parms = m.parameters ().elements (); - while (parms.hasMoreElements ()) - { - ParameterEntry parm = (ParameterEntry)parms.nextElement (); - SymtabEntry parmType = Util.typeOf (parm.type ()); - if (parmType instanceof StringEntry) - if ((parm.passType () == ParameterEntry.Out) || - (parm.passType () == ParameterEntry.Inout)) - { - StringEntry string = (StringEntry)parmType; - if (string.maxSize () != null) - { - stream.print (FOUR_INDENT + "if (" + parm.name () + - ".value.length ()"); - stream.println (" > (" + - Util.parseExpression (string.maxSize ()) + "))"); - stream.println (FIVE_INDENT + "throw new org.omg.CORBA.MARSHAL(0,"+ - "org.omg.CORBA.CompletionStatus.COMPLETED_NO);"); - } - } - } - if (mtype instanceof StringEntry) - { - StringEntry string = (StringEntry)mtype; - if (string.maxSize () != null) - { - stream.println(FOUR_INDENT + "if ($result.length () > (" + - Util.parseExpression (string.maxSize ()) + "))"); - stream.println (FIVE_INDENT + "throw new org.omg.CORBA.MARSHAL (0," + - " org.omg.CORBA.CompletionStatus.COMPLETED_NO);"); - } - } - // end out/inout/return string bounds check - - // Step 5 Handle return if necessary - if (mtype != null) { - stream.println(FOUR_INDENT + "return $result;"); - } else { - stream.println(FOUR_INDENT + "return;"); - } - - // Step 6 Handle exceptions - stream.println(THREE_INDENT + - "} catch (org.omg.CORBA.portable.ApplicationException " + "$ex) {"); - stream.println(FOUR_INDENT + "$in = $ex.getInputStream ();"); - stream.println(FOUR_INDENT + "String _id = $ex.getId ();"); - - if (m.exceptions ().size () > 0) - { - Enumeration exceptions = m.exceptions ().elements (); - boolean firstExc = true; - while (exceptions.hasMoreElements ()) - { - ExceptionEntry exc = (ExceptionEntry)exceptions.nextElement (); - if (firstExc) - { - stream.print(FOUR_INDENT + "if "); - firstExc = false; - } - else - stream.print(FOUR_INDENT + "else if "); - - stream.println( "(_id.equals (\"" + exc.repositoryID ().ID () + "\"))"); - stream.println (FIVE_INDENT + "throw " + - Util.helperName ((SymtabEntry)exc, false) + ".read ($in);"); - } - stream.println(FOUR_INDENT + "else"); - stream.println(FIVE_INDENT + "throw new org.omg.CORBA.MARSHAL (_id);"); - } - else - stream.println(FOUR_INDENT + "throw new org.omg.CORBA.MARSHAL (_id);"); - - stream.println(THREE_INDENT + - "} catch (org.omg.CORBA.portable.RemarshalException $rm) {"); - stream.print( FOUR_INDENT ); - if (m.type () != null) // not a void method - stream.print ("return "); - stream.print (m.name () + " ("); - { - // write parm names - boolean firstTime = true; - Enumeration e = m.parameters ().elements (); - while (e.hasMoreElements ()) - { - if (firstTime) - firstTime = false; - else - stream.print (", "); - ParameterEntry parm = (ParameterEntry)e.nextElement (); - stream.print (parm.name ()); - } - // Step 2. Add the context parameter if necessary. - if (m.contexts ().size () > 0) - { - if (!firstTime) - stream.print (", "); - stream.print ("$context"); - } - } - stream.println (TWO_INDENT + ");"); - stream.println (THREE_INDENT + "} finally {"); - stream.println (FOUR_INDENT + "_releaseReply ($in);"); - stream.println (THREE_INDENT + "}"); - if( localOptimization && !isAbstract ) { - stream.println (TWO_INDENT + "}"); - writeStubBodyForLocalInvocation( className, methodName ); - } - - } // writeStubBody - - - /** - * This method writes the else part of the stub method invocation to - * enable local invocation in case of collocation. - * NOTE: This will only be invoked from writeStubBody. - */ - private void writeStubBodyForLocalInvocation( String className, - String methodName ) - { - stream.println (TWO_INDENT + "else {" ); - stream.println (THREE_INDENT + - "org.omg.CORBA.portable.ServantObject _so ="); - stream.println (FOUR_INDENT + "_servant_preinvoke(\"" + methodName + - "\", _opsClass);" ); - stream.println(THREE_INDENT + "if (_so == null ) {"); - stream.println(FOUR_INDENT + "continue;" ); - stream.println(THREE_INDENT + "}"); - stream.println(THREE_INDENT + className + "Operations _self =" ); - stream.println(FOUR_INDENT + "(" + className + "Operations) _so.servant;"); - stream.println(THREE_INDENT + "try {" ); - Enumeration parms = m.parameters ().elements (); - if (m instanceof AttributeEntry) - { - // Local Method Name should drop _get_ or _set_ prefix for attribute - // entry - methodName = methodName.substring( ATTRIBUTE_METHOD_PREFIX_LENGTH ); - } - boolean voidReturnType = (this.m.type() == null); - if ( !voidReturnType ) { - stream.println (FOUR_INDENT + Util.javaName (this.m.type ()) + - " $result;"); - } - if( !isValueInitializer() ) { - if ( voidReturnType ) { - stream.print(FOUR_INDENT + "_self." + methodName + "( " ); - } else { - stream.print(FOUR_INDENT + "$result = _self." + - methodName + "( " ); - } - while (parms.hasMoreElements ()) { - ParameterEntry param = (ParameterEntry)parms.nextElement (); - if( parms.hasMoreElements( ) ) { - stream.print( " " + param.name() + "," ); - } else { - stream.print( " " + param.name() ); - } - } - stream.print( ");" ); - stream.println( " " ); - if( voidReturnType ) { - stream.println(FOUR_INDENT + "return;" ); - } else { - stream.println(FOUR_INDENT + "return $result;" ); - } - } - stream.println(" "); - stream.println (THREE_INDENT + "}" ); - stream.println (THREE_INDENT + "finally {" ); - stream.println (FOUR_INDENT + "_servant_postinvoke(_so);" ); - stream.println (THREE_INDENT + "}" ); - stream.println (TWO_INDENT + "}" ); - stream.println (ONE_INDENT + "}" ); - } - - - protected void writeLocalStubBody (InterfaceEntry i) - { - // Step 1 Create a request - String methodName = Util.stripLeadingUnderscores (m.name ()); - if (m instanceof AttributeEntry) - { - if (m.type () == null) // if it's a modifier - methodName = "_set_" + methodName; - else - methodName = "_get_" + methodName; - } - //stream.println (" while(true) {"); - stream.println (" org.omg.CORBA.portable.ServantObject $so = " + - "_servant_preinvoke (\"" + methodName + "\", " + "_opsClass);"); - //stream.println (" if ($so == null) {"); - //stream.println (" continue;"); - //stream.println (" }"); - String opsName = i.name() + "Operations"; - stream.println (" " + opsName + " $self = " + "(" + opsName + ") " + "$so.servant;"); - stream.println (); - stream.println (" try {"); - stream.print (" "); - if (m.type () != null) // not a void method - stream.print ("return "); - stream.print ("$self." + m.name () + " ("); - { - // write parm names - boolean firstTime = true; - Enumeration e = m.parameters ().elements (); - while (e.hasMoreElements ()) - { - if (firstTime) - firstTime = false; - else - stream.print (", "); - ParameterEntry parm = (ParameterEntry)e.nextElement (); - stream.print (parm.name ()); - } - // Step 2. Add the context parameter if necessary. - if (m.contexts ().size () > 0) - { - if (!firstTime) - stream.print (", "); - stream.print ("$context"); - } - } - stream.println (");"); - //stream.println (" } catch (org.omg.CORBA.portable.RemarshalException $rm) {"); - //stream.println (" continue; "); - stream.println (" } finally {"); - stream.println (" _servant_postinvoke ($so);"); - stream.println (" }"); - //stream.println (" }"); - - } // writeLocalStubBody - - - - /** - * - **/ - private void writeInsert (String indent, String target, String source, SymtabEntry type, PrintWriter stream) - { - String typeName = type.name (); - if (type instanceof PrimitiveEntry) - { - // RJB does something have to be done with TC offsets? - if (typeName.equals ("long long")) - stream.println (indent + source + ".insert_longlong (" + target + ");"); - else if (typeName.equals ("unsigned short")) - stream.println (indent + source + ".insert_ushort (" + target + ");"); - else if (typeName.equals ("unsigned long")) - stream.println (indent + source + ".insert_ulong (" + target + ");"); - else if (typeName.equals ("unsigned long long")) - stream.println (indent + source + ".insert_ulonglong (" + target + ");"); - else - stream.println (indent + source + ".insert_" + typeName + " (" + target + ");"); - } - else if (type instanceof StringEntry) - stream.println (indent + source + ".insert_" + typeName + " (" + target + ");"); - else - stream.println (indent + Util.helperName (type, true) + ".insert (" + source + ", " + target + ");"); // - } // writeInsert - - /** - * - **/ - private void writeType (String indent, String name, SymtabEntry type, PrintWriter stream) - { - if (type instanceof PrimitiveEntry) - { - // RJB does something have to be done with TC offsets? - if (type.name ().equals ("long long")) - stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_longlong));"); - else if (type.name ().equals ("unsigned short")) - stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ushort));"); - else if (type.name ().equals ("unsigned long")) - stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ulong));"); - else if (type.name ().equals ("unsigned long long")) - stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ulonglong));"); - else - stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_" + type.name () + "));"); - } - else if (type instanceof StringEntry) - { - StringEntry s = (StringEntry)type; - Expression e = s.maxSize (); - if (e == null) - stream.println (indent + name + " (org.omg.CORBA.ORB.init ().create_" + type.name () + "_tc (" + Util.parseExpression (e) + "));"); - else - stream.println (indent + name + " (org.omg.CORBA.ORB.init ().create_" + type.name () + "_tc (0));"); - } - else - stream.println (indent + name + '(' + Util.helperName (type, true) + ".type ());"); // - } // writeType - - /** - * - **/ - private void writeExtract (String indent, String target, String source, SymtabEntry type, PrintWriter stream) - { - if (type instanceof PrimitiveEntry) - { - if (type.name ().equals ("long long")) - stream.println (indent + target + " = " + source + ".extract_longlong ();"); - else if (type.name ().equals ("unsigned short")) - stream.println (indent + target + " = " + source + ".extract_ushort ();"); - else if (type.name ().equals ("unsigned long")) - stream.println (indent + target + " = " + source + ".extract_ulong ();"); - else if (type.name ().equals ("unsigned long long")) - stream.println (indent + target + " = " + source + ".extract_ulonglong ();"); - else - stream.println (indent + target + " = " + source + ".extract_" + type.name () + " ();"); - } - else if (type instanceof StringEntry) - stream.println (indent + target + " = " + source + ".extract_" + type.name () + " ();"); - else - stream.println (indent + target + " = " + Util.helperName (type, true) + ".extract (" + source + ");"); // - } // writeExtract - - /** - * - **/ - private String writeExtract (String source, SymtabEntry type) - { - String extract; - if (type instanceof PrimitiveEntry) - { - if (type.name ().equals ("long long")) - extract = source + ".extract_longlong ()"; - else if (type.name ().equals ("unsigned short")) - extract = source + ".extract_ushort ()"; - else if (type.name ().equals ("unsigned long")) - extract = source + ".extract_ulong ()"; - else if (type.name ().equals ("unsigned long long")) - extract = source + ".extract_ulonglong ()"; - else - extract = source + ".extract_" + type.name () + " ()"; - } - else if (type instanceof StringEntry) - extract = source + ".extract_" + type.name () + " ()"; - else - extract = Util.helperName (type, true) + ".extract (" + source + ')'; // - return extract; - } // writeExtract - - /** - * - **/ - private void writeSkeletonBody () - { - SymtabEntry mtype = Util.typeOf (m.type ()); - - // If there is a return value, increment the appropriate counter - stream.print (" "); - if (mtype != null) - stream.print ("return "); - stream.print ("_impl." + m.name () + '('); - - // Load the parameters - Enumeration parms = m.parameters ().elements (); - boolean first = true; - while (parms.hasMoreElements ()) - { - ParameterEntry parm = (ParameterEntry)parms.nextElement (); - if (first) - first = false; - else - stream.print (", "); - stream.print (parm.name ()); - } - if (m.contexts ().size () != 0) - { - if (!first) - stream.print (", "); - stream.print ("$context"); - } - - stream.println (");"); - } // writeSkeletonBody - - /** - * - **/ - protected String passType (int passType) - { - String type; - switch (passType) - { - case ParameterEntry.Inout: - type = "org.omg.CORBA.ARG_INOUT.value"; - break; - case ParameterEntry.Out: - type = "org.omg.CORBA.ARG_OUT.value"; - break; - case ParameterEntry.In: - default: - type = "org.omg.CORBA.ARG_IN.value"; - break; - } - return type; - } // passType - - /** - * This is only used by AttributeGen. The java mapping says - * the names should be getXXX and setXXX, but CORBA says they - * should be _get_XXX and _set_XXX. this.name () will be - * getXXX. realName is set by AttributeGen to _get_XXX. - **/ - protected void serverMethodName (String name) - { - realName = (name == null) ? "" : name; - } // serverMethodName - - /** - * - **/ - private void writeOutputStreamWrite (String indent, String oStream, String name, SymtabEntry type, PrintWriter stream) - { - String typeName = type.name (); - stream.print (indent); - if (type instanceof PrimitiveEntry) - { - if (typeName.equals ("long long")) - stream.println (oStream + ".write_longlong (" + name +");"); - else if (typeName.equals ("unsigned short")) - stream.println (oStream + ".write_ushort (" + name + ");"); - else if (typeName.equals ("unsigned long")) - stream.println (oStream + ".write_ulong (" + name + ");"); - else if (typeName.equals ("unsigned long long")) - stream.println (oStream + ".write_ulonglong (" + name + ");"); - else - stream.println (oStream + ".write_" + typeName + " (" + name + ");"); - } - else if (type instanceof StringEntry) - stream.println (oStream + ".write_" + typeName + " (" + name + ");"); - else if (type instanceof SequenceEntry) - stream.println (oStream + ".write_" + type.type().name() + " (" + name + ");"); - else if (type instanceof ValueBoxEntry) - { - ValueBoxEntry v = (ValueBoxEntry) type; - TypedefEntry member = ((InterfaceState) v.state ().elementAt (0)).entry; - SymtabEntry mType = member.type (); - - // if write value to the boxed holder indicated by the name ending with ".value" - if (mType instanceof PrimitiveEntry && name.endsWith (".value")) - stream.println (Util.helperName (type, true) + ".write (" + oStream + ", " // - + " new " + Util.javaQualifiedName (type) + " (" + name + "));"); // - else - stream.println (Util.helperName (type, true) + ".write (" + oStream + ", " + name + ");"); // // - } - else if (type instanceof ValueEntry) - stream.println (Util.helperName (type, true) + ".write (" + oStream + ", " + name + ");"); // // - else - stream.println (Util.helperName (type, true) + ".write (" + oStream + ", " + name + ");"); // - } // writeOutputStreamWrite - - /** - * - **/ - private String writeInputStreamRead (String source, SymtabEntry type) - { - String read = ""; - if (type instanceof PrimitiveEntry) - { - if (type.name ().equals ("long long")) - read = source + ".read_longlong ()"; - else if (type.name ().equals ("unsigned short")) - read = source + ".read_ushort ()"; - else if (type.name ().equals ("unsigned long")) - read = source + ".read_ulong ()"; - else if (type.name ().equals ("unsigned long long")) - read = source + ".read_ulonglong ()"; - else - read = source + ".read_" + type.name () + " ()"; - } - else if (type instanceof StringEntry) - read = source + ".read_" + type.name () + " ()"; - else - read = Util.helperName (type, true) + ".read (" + source + ')'; // - return read; - } // writeInputStreamRead - - /** - * - **/ - protected void writeMethodCall (String indent) - { - SymtabEntry mtype = Util.typeOf (m.type ()); - if (mtype == null) - stream.print (indent + "this." + m.name () + " ("); - else - stream.print (indent + "$result = this." + m.name () + " ("); - } // writeMethodCall - - /** - * - **/ - protected void writeCreateReply(String indent){ - stream.println(indent + "out = $rh.createReply();"); - } - - protected int methodIndex = 0; - protected String realName = ""; - protected Hashtable symbolTable = null; - protected MethodEntry m = null; - protected PrintWriter stream = null; - protected boolean localOptimization = false; - protected boolean isAbstract = false; -} // class MethodGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/MethodGen24.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/MethodGen24.java deleted file mode 100644 index ba84c9f1a1a..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/MethodGen24.java +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: -// -D62023 New file to implement CORBA 2.4 RTF -// -D62794 Fix problem with no-arg create functions - -import java.io.PrintWriter; - -import java.util.Enumeration; -import java.util.Vector; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.GenFileStream; -import com.sun.tools.corba.se.idl.InterfaceEntry; -import com.sun.tools.corba.se.idl.MethodEntry; -import com.sun.tools.corba.se.idl.ParameterEntry; -import com.sun.tools.corba.se.idl.SymtabEntry; -import com.sun.tools.corba.se.idl.ValueEntry; -import com.sun.tools.corba.se.idl.ValueBoxEntry; -import com.sun.tools.corba.se.idl.TypedefEntry; -import com.sun.tools.corba.se.idl.InterfaceState; -import com.sun.tools.corba.se.idl.PrimitiveEntry; -import com.sun.tools.corba.se.idl.StructEntry; - -/** - * - **/ -public class MethodGen24 extends MethodGen -{ - /** - * Public zero-argument constructor. - **/ - public MethodGen24 () - { - } // ctor - - /** - * Print the parameter list for the factory method. - * @param m The method to list parameters for - * @param listTypes If try, declare the parms, otherwise just list them - * @param stream The PrintWriter to print on - */ - protected void writeParmList (MethodEntry m, boolean listTypes, PrintWriter stream) { - boolean firstTime = true; - Enumeration e = m.parameters ().elements (); - while (e.hasMoreElements ()) - { - if (firstTime) - firstTime = false; - else - stream.print (", "); - ParameterEntry parm = (ParameterEntry)e.nextElement (); - if (listTypes) { - writeParmType (parm.type (), parm.passType ()); - stream.print (' '); - } - // Print parm name - stream.print (parm.name ()); - // end of parameter list - } - } - - /** - * d62023 - write the methodEntry for a valuetype factory method into - * the Value Helper class. Contents from email from Simon, - * 4/25/99. - **/ - protected void helperFactoryMethod (Hashtable symbolTable, MethodEntry m, SymtabEntry t, PrintWriter stream) - { - this.symbolTable = symbolTable; - this.m = m; - this.stream = stream; - String initializerName = m.name (); - String typeName = Util.javaName (t); - String factoryName = typeName + "ValueFactory"; - - // Step 1. Print factory method decl up to parms. - stream.print (" public static " + typeName + " " + initializerName + - " (org.omg.CORBA.ORB $orb"); - if (!m.parameters ().isEmpty ()) - stream.print (", "); // - - // Step 2. Print the declaration parameter list. - writeParmList (m, true, stream); - - // Step 3. Print the body of the factory method - stream.println (")"); - stream.println (" {"); - stream.println (" try {"); - stream.println (" " + factoryName + " $factory = (" + factoryName + ")"); - stream.println (" ((org.omg.CORBA_2_3.ORB) $orb).lookup_value_factory(id());"); - stream.print (" return $factory." + initializerName + " ("); - writeParmList (m, false, stream); - stream.println (");"); - stream.println (" } catch (ClassCastException $ex) {"); - stream.println (" throw new org.omg.CORBA.BAD_PARAM ();"); - stream.println (" }"); - stream.println (" }"); - stream.println (); - } // helperFactoryMethod - - /** - * d62023 - write an abstract method definition - **/ - protected void abstractMethod (Hashtable symbolTable, MethodEntry m, PrintWriter stream) - { - this.symbolTable = symbolTable; - this.m = m; - this.stream = stream; - if (m.comment () != null) - m.comment ().generate (" ", stream); - stream.print (" "); - stream.print ("public abstract "); - writeMethodSignature (); - stream.println (";"); - stream.println (); - } // abstractMethod - - /** - * d62023 - write a default factory method implementation for the - * {@code DefaultFactory}. m is a methodEntry for a factory - * method contained in a non-abstract ValueEntry. - **/ - protected void defaultFactoryMethod (Hashtable symbolTable, MethodEntry m, PrintWriter stream) - { - this.symbolTable = symbolTable; - this.m = m; - this.stream = stream; - String typeName = m.container (). name (); - stream.println (); - if (m.comment () != null) - m.comment ().generate (" ", stream); - stream.print (" public " + typeName + " " + m.name () + " ("); - writeParmList (m, true, stream); - stream.println (")"); - stream.println (" {"); - stream.print (" return new " + typeName + "Impl ("); - writeParmList (m, false, stream); - stream.println (");"); - stream.println (" }"); - } // defaultFactoryMethod - - /** - * d62023 - remove all valueInitializer junk - **/ - protected void writeMethodSignature () - { - // Step 0. Print the return type and name. - // A return type of null indicates the "void" return type. If m is a - // Valuetype factory method, it has a null return type, - if (m.type () == null) - { - // if factory method, result type is container - if (isValueInitializer ()) - stream.print (m.container ().name ()); - else - stream.print ("void"); - } - else - { - stream.print (Util.javaName (m.type ())); - } - stream.print (' ' + m.name () + " ("); - - // Step 1. Print the parameter list. - boolean firstTime = true; - Enumeration e = m.parameters ().elements (); - while (e.hasMoreElements ()) - { - if (firstTime) - firstTime = false; - else - stream.print (", "); - ParameterEntry parm = (ParameterEntry)e.nextElement (); - - writeParmType (parm.type (), parm.passType ()); - - // Print parm name - stream.print (' ' + parm.name ()); - } - - // Step 2. Add the context parameter if necessary. - if (m.contexts ().size () > 0) - { - if (!firstTime) - stream.print (", "); - stream.print ("org.omg.CORBA.Context $context"); - } - - // Step 3. Print the throws clause (if necessary). - if (m.exceptions ().size () > 0) - { - stream.print (") throws "); - e = m.exceptions ().elements (); - firstTime = true; - while (e.hasMoreElements ()) - { - if (firstTime) - firstTime = false; - else - stream.print (", "); - stream.print (Util.javaName ((SymtabEntry)e.nextElement ())); - } - } - else - stream.print (')'); - } // writeMethodSignature - - /** - * d62023 - delete method templates for valuetypes - **/ - protected void interfaceMethod (Hashtable symbolTable, MethodEntry m, PrintWriter stream) - { - this.symbolTable = symbolTable; - this.m = m; - this.stream = stream; - if (m.comment () != null) - m.comment ().generate (" ", stream); - stream.print (" "); - writeMethodSignature (); - stream.println (";"); - } // interfaceMethod -} diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/MethodGenClone24.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/MethodGenClone24.java deleted file mode 100644 index 5c2e9596b0a..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/MethodGenClone24.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: -// -D62023 New file to implement CORBA 2.4 RTF -// NOTE: The methods in this class should be exact copies of the -// correspoind methods in MethodGen24. The purpose of this class is -// to inject the changes made in MethodGen24 between AttributeGen -// and AttributeGen24. When the AttributeGen24 changes are merged, this -// class should be deleted. - -import java.io.PrintWriter; - -import java.util.Enumeration; -import java.util.Vector; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.GenFileStream; -import com.sun.tools.corba.se.idl.InterfaceEntry; -import com.sun.tools.corba.se.idl.MethodEntry; -import com.sun.tools.corba.se.idl.ParameterEntry; -import com.sun.tools.corba.se.idl.SymtabEntry; -import com.sun.tools.corba.se.idl.ValueEntry; -import com.sun.tools.corba.se.idl.ValueBoxEntry; -import com.sun.tools.corba.se.idl.TypedefEntry; -import com.sun.tools.corba.se.idl.InterfaceState; -import com.sun.tools.corba.se.idl.PrimitiveEntry; -import com.sun.tools.corba.se.idl.StructEntry; - -/** - * - **/ -public class MethodGenClone24 extends AttributeGen -{ - /** - * Public zero-argument constructor. - **/ - public MethodGenClone24 () - { - } // ctor - - /** - * d62023 - write an abstract method definition - **/ - protected void abstractMethod (Hashtable symbolTable, MethodEntry m, PrintWriter stream) - { - this.symbolTable = symbolTable; - this.m = m; - this.stream = stream; - if (m.comment () != null) - m.comment ().generate (" ", stream); - stream.print (" "); - stream.print ("public abstract "); - writeMethodSignature (); - stream.println (";"); - stream.println (); - } // abstractMethod - - /** - * d62023 - delete method templates for valuetypes - **/ - protected void interfaceMethod (Hashtable symbolTable, MethodEntry m, PrintWriter stream) - { - this.symbolTable = symbolTable; - this.m = m; - this.stream = stream; - if (m.comment () != null) - m.comment ().generate (" ", stream); - stream.print (" "); - writeMethodSignature (); - stream.println (";"); - } // interfaceMethod -} diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ModuleGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ModuleGen.java deleted file mode 100644 index ceae4b131f7..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ModuleGen.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: - -import java.io.File; -import java.io.PrintWriter; -import java.util.Enumeration; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.ModuleEntry; -import com.sun.tools.corba.se.idl.SymtabEntry; - -/** - * - **/ -public class ModuleGen implements com.sun.tools.corba.se.idl.ModuleGen -{ - /** - * Public zero-argument constructor. - **/ - public ModuleGen () - { - } // ctor - - /** - * Generate Java code for all members of an IDL module. - **/ - public void generate (Hashtable symbolTable, ModuleEntry entry, PrintWriter stream) - { - // Generate the package directory - String name = Util.containerFullName( entry ) ; - Util.mkdir (name); - - // Generate all of the contained types - Enumeration e = entry.contained ().elements (); - while (e.hasMoreElements ()) - { - SymtabEntry element = (SymtabEntry)e.nextElement (); - if (element.emit ()) - element.generate (symbolTable, stream); - } - } // generate -} // class ModuleGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/NameModifier.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/NameModifier.java deleted file mode 100644 index a69d507e2be..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/NameModifier.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.corba.se.idl.toJavaPortable ; - -public interface NameModifier { - /** Create a modified name from the base name. - */ - String makeName( String base ) ; -} ; diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/NameModifierImpl.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/NameModifierImpl.java deleted file mode 100644 index afbd2ea0000..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/NameModifierImpl.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.corba.se.idl.toJavaPortable ; - -import com.sun.tools.corba.se.idl.toJavaPortable.NameModifier ; - -public class NameModifierImpl implements NameModifier { - private String prefix ; - private String suffix ; - - public NameModifierImpl( ) - { - this.prefix = null ; - this.suffix = null ; - } - - public NameModifierImpl( String prefix, String suffix ) - { - this.prefix = prefix ; - this.suffix = suffix ; - } - - /** Construct a NameModifier from a pattern of the form xxx%xxx. - * The pattern must consist of characters chosen from the - * set [A-Za-z0-9%$_]. In addition, the pattern must contain - * exactly one % character. Finally, if % is not the first char in - * the pattern, the pattern must not start with a number. - *

            - * The semantics of makeName are very simply: just replace the - * % character with the base in the pattern and return the result. - */ - public NameModifierImpl( String pattern ) - { - int first = pattern.indexOf( '%' ) ; - int last = pattern.lastIndexOf( '%' ) ; - - if (first != last) - throw new IllegalArgumentException( - Util.getMessage( "NameModifier.TooManyPercent" ) ) ; - - if (first == -1) - throw new IllegalArgumentException( - Util.getMessage( "NameModifier.NoPercent" ) ) ; - - for (int ctr = 0; ctr - emit = "tk_Principal"; - else if (entry.name ().equals ("wchar")) - emit = "tk_wchar"; - stream.println (indent + name + " = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind." + emit + ");"); - return index; - } // type - - public void helperRead (String entryName, SymtabEntry entry, PrintWriter stream) - { - } // helperRead - - public void helperWrite (SymtabEntry entry, PrintWriter stream) - { - } // helperWrite - - public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - stream.println (indent + name + " = " + "istream.read_" + Util.collapseName (entry.name ()) + " ();"); - return index; - } // read - - public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - stream.println (indent + "ostream.write_" + Util.collapseName (entry.name ()) + " (" + name + ");"); - return index; - } // write - - // From JavaGenerator - /////////////// -} // class PrimitiveGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/SequenceGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/SequenceGen.java deleted file mode 100644 index e21c4697398..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/SequenceGen.java +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: -// -F46082.51 Remove -stateful feature; javaStatefulName() obsolete. -// -D61056 Use Util.helperName - -import java.io.PrintWriter; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.InterfaceEntry; -import com.sun.tools.corba.se.idl.PrimitiveEntry; -import com.sun.tools.corba.se.idl.SequenceEntry; -import com.sun.tools.corba.se.idl.StringEntry; -import com.sun.tools.corba.se.idl.SymtabEntry; - -import com.sun.tools.corba.se.idl.constExpr.Expression; - -/** - * - **/ -public class SequenceGen implements com.sun.tools.corba.se.idl.SequenceGen, JavaGenerator -{ - /** - * Public zero-argument constructor. - **/ - public SequenceGen () - { - } // ctor - - /** - * - **/ - public void generate (Hashtable symbolTable, SequenceEntry s, PrintWriter stream) - { - } // generator - - /////////////// - // From JavaGenerator - - public int helperType (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) - { - int offsetOfType = tcoffsets.offset (entry.type ().fullName ()); - if (offsetOfType >= 0) - { - // This code uses the deprecated create_recursive_sequence_tc() - // It should be eliminated when the API is removed from the ORB class - // Regardles, this code will not be emitted since updated emitters invoke - // method type() below instead of helperType() when handling sequences - - // This is a recursive sequence - tcoffsets.set (null); - Expression maxSize = ((SequenceEntry)entry).maxSize (); - if (maxSize == null) - stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_recursive_sequence_tc (0, " + (offsetOfType - tcoffsets.currentOffset ()) + ");"); - else - stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_recursive_sequence_tc (" + Util.parseExpression (maxSize) + ", " + (offsetOfType - tcoffsets.currentOffset ()) + ");"); - tcoffsets.bumpCurrentOffset (4); // add indirection field - } - else - { - // This is a normal sequence - tcoffsets.set (entry); - index = ((JavaGenerator)entry.type ().generator ()).helperType (index + 1, indent, tcoffsets, name, entry.type (), stream); - Expression maxSize = ((SequenceEntry)entry).maxSize (); - if (maxSize == null) - stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_sequence_tc (0, " + name + ");"); - else - stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_sequence_tc (" + Util.parseExpression (maxSize) + ", " + name + ");"); - } - tcoffsets.bumpCurrentOffset (4); // add on the seq max size - return index; - } // helperType - - public int type (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) { - int offsetOfType = tcoffsets.offset (entry.type ().fullName ()); - if (offsetOfType >= 0) - { - // This is a recursive sequence - tcoffsets.set (null); - - // Need to fix later: how to get repositoryId of IDL type containing this sequence? - // entry.repositoryID().ID() returns empty string and - // Util.javaQualifiedName(entry) returns internal name which is not valid repId - - stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_recursive_tc (" + "\"\"" + ");"); - tcoffsets.bumpCurrentOffset (4); // add indirection field - } - else - { - // This is a normal sequence - tcoffsets.set (entry); - index = ((JavaGenerator)entry.type ().generator ()).type (index + 1, indent, tcoffsets, name, entry.type (), stream); - Expression maxSize = ((SequenceEntry)entry).maxSize (); - if (maxSize == null) - stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_sequence_tc (0, " + name + ");"); - else - stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_sequence_tc (" + Util.parseExpression (maxSize) + ", " + name + ");"); - } - //stream.println (indent + name + " = " + Util.helperName (entry, true) + ".type ();"); // - return index; - } // type - - public void helperRead (String entryName, SymtabEntry entry, PrintWriter stream) - { - } // helperRead - - public void helperWrite (SymtabEntry entry, PrintWriter stream) - { - } // helperWrite - - public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - SequenceEntry seq = (SequenceEntry)entry; - String length = "_len" + index++; - stream.println (indent + "int " + length + " = istream.read_long ();"); - if (seq.maxSize () != null) - { - stream.println (indent + "if (" + length + " > (" + Util.parseExpression (seq.maxSize ()) + "))"); - stream.println (indent + " throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);"); - } - String seqOfName; - try - { - seqOfName = Util.sansArrayInfo ((String)seq.dynamicVariable (Compile.typedefInfo)); - } - catch (NoSuchFieldException e) - { - seqOfName = seq.name (); - } - int startArray = seqOfName.indexOf ('['); - String arrayDcl = seqOfName.substring (startArray); - seqOfName = seqOfName.substring (0, startArray); - - // For interfaces having state, e.g., valuetypes. - SymtabEntry seqOfEntry = (SymtabEntry)Util.symbolTable.get (seqOfName.replace ('.', '/')); - if (seqOfEntry != null && seqOfEntry instanceof InterfaceEntry && ((InterfaceEntry)seqOfEntry).state () != null) - // Remove -stateful feature; javaStatefulName() obsolete. - //seqOfName = Util.javaStatefulName ((InterfaceEntry)seqOfEntry); - seqOfName = Util.javaName ((InterfaceEntry)seqOfEntry); - - arrayDcl = arrayDcl.substring (2); - stream.println (indent + name + " = new " + seqOfName + '[' + length + ']' + arrayDcl + ';'); - if (seq.type () instanceof PrimitiveEntry) - // Check for CORBA::Principal, too - //if (seq.type ().name ().equals ("any") || seq.type ().name ().equals ("TypeCode")) - if (seq.type ().name ().equals ("any") || - seq.type ().name ().equals ("TypeCode") || - seq.type ().name ().equals ("Principal")) - { - String loopIndex = "_o" + index; - stream.println (indent + "for (int " + loopIndex + " = 0;" + loopIndex + " < " + name + ".length; ++" + loopIndex + ')'); - stream.println (indent + " " + name + '[' + loopIndex + "] = istream.read_" + seq.type ().name () + " ();"); - } - else - { // special case for ValueBox: if name is "xxx tmp", drop xxx - String varName = name; - int nameIndex = varName.indexOf (' '); - if ( nameIndex != -1 ) - varName = varName.substring( nameIndex + 1 ); - stream.println (indent + "istream.read_" + Util.collapseName (entry.type ().name ()) + "_array (" + varName + ", 0, " + length + ");"); - } - else if (entry.type () instanceof StringEntry) - { - String loopIndex = "_o" + index; - stream.println (indent + "for (int " + loopIndex + " = 0;" + loopIndex + " < " + name + ".length; ++" + loopIndex + ')'); - stream.println (indent + " " + name + '[' + loopIndex + "] = istream.read_" + seq.type ().name () + " ();"); - } - else if (entry.type () instanceof SequenceEntry) - { - String loopIndex = "_o" + index; - stream.println (indent + "for (int " + loopIndex + " = 0;" + loopIndex + " < " + name + ".length; ++" + loopIndex + ')'); - stream.println (indent + '{'); - index = ((JavaGenerator)seq.type ().generator ()).read (index, indent + " ", name + '[' + loopIndex + ']', seq.type (), stream); - stream.println (indent + '}'); - } - else - { // special case for ValueBox: if name is "xxx tmp", drop xxx - String varName = name; - int nameIndex = varName.indexOf (' '); - if ( nameIndex != -1 ) - varName = varName.substring( nameIndex + 1 ); - String loopIndex = "_o" + index; - stream.println (indent + "for (int " + loopIndex + " = 0;" + loopIndex + " < " + varName + ".length; ++" + loopIndex + ')'); - stream.println (indent + " " + varName + '[' + loopIndex + "] = " + Util.helperName (seq.type (), true) + ".read (istream);"); // - } - return index; - } // read - - public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - SequenceEntry seq = (SequenceEntry)entry; - if (seq.maxSize () != null) - { - stream.println (indent + "if (" + name + ".length > (" + Util.parseExpression (seq.maxSize ()) + "))"); - stream.println (indent + " throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);"); - } - stream.println (indent + "ostream.write_long (" + name + ".length);"); - if (entry.type () instanceof PrimitiveEntry) - // Check for CORBA::Principal, too. - //if (entry.type ().name ().equals ("any") || entry.type ().name ().equals ("TypeCode")) - if (entry.type ().name ().equals ("any") || - entry.type ().name ().equals ("TypeCode") || - entry.type ().name ().equals ("Principal")) - { - String loopIndex = "_i" + index++; - stream.println (indent + "for (int " + loopIndex + " = 0;" + loopIndex + " < " + name + ".length; ++" + loopIndex + ')'); - stream.println (indent + " ostream.write_" + seq.type ().name () + " (" + name + '[' + loopIndex + "]);"); - } - else - stream.println (indent + "ostream.write_" + Util.collapseName (entry.type ().name ()) + "_array (" + name + ", 0, " + name + ".length);"); - else if (entry.type () instanceof StringEntry) - { - String loopIndex = "_i" + index++; - stream.println (indent + "for (int " + loopIndex + " = 0;" + loopIndex + " < " + name + ".length; ++" + loopIndex + ')'); - stream.println (indent + " ostream.write_" + seq.type ().name () + " (" + name + '[' + loopIndex + "]);"); - } - else if (entry.type () instanceof SequenceEntry) - { - String loopIndex = "_i" + index++; - stream.println (indent + "for (int " + loopIndex + " = 0;" + loopIndex + " < " + name + ".length; ++" + loopIndex + ')'); - stream.println (indent + '{'); - index = ((JavaGenerator)seq.type ().generator ()).write (index, indent + " ", name + '[' + loopIndex + ']', seq.type (), stream); - stream.println (indent + '}'); - } - else - { - String loopIndex = "_i" + index++; - stream.println (indent + "for (int " + loopIndex + " = 0;" + loopIndex + " < " + name + ".length; ++" + loopIndex + ')'); - stream.println (indent + " " + Util.helperName (seq.type (), true) + ".write (ostream, " + name + '[' + loopIndex + "]);"); // - } - return index; - } // write - - // From JavaGenerator - /////////////// -} // class SequenceGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Skeleton.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Skeleton.java deleted file mode 100644 index 37070482c5d..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Skeleton.java +++ /dev/null @@ -1,568 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: -// -F46082.51 Remove -stateful feature; javaStatefulName() obsolete. -// -D57147 Make _Tie implement org.omg.CORBA.portable.InvokeHandler -// -D58037 Make _Tie delegate to Operations interface -// -D62739 no TIE for values that support abstract interfaces, etc. - -import java.io.File; -import java.io.PrintWriter; - -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Vector; - -import com.sun.tools.corba.se.idl.AttributeEntry; -import com.sun.tools.corba.se.idl.GenFileStream; - -import com.sun.tools.corba.se.idl.InterfaceEntry; -import com.sun.tools.corba.se.idl.InterfaceState; -import com.sun.tools.corba.se.idl.MethodEntry; -import com.sun.tools.corba.se.idl.SymtabEntry; -import com.sun.tools.corba.se.idl.TypedefEntry; -import com.sun.tools.corba.se.idl.ValueEntry; - -/** - * - **/ -public class Skeleton implements AuxGen -{ - private NameModifier skeletonNameModifier ; - private NameModifier tieNameModifier ; - - public Skeleton () - { - } - - public void generate (Hashtable symbolTable, SymtabEntry entry) - { - // - // Per Simon, 5-12-99, don't generate TIE or Skeleton for - // - // 1) valuetypes supporting abstract interfaces - // 2) valuetypes with no supports. - // 3) abstract interfaces - // - if (entry instanceof ValueEntry) - { - ValueEntry v = (ValueEntry) entry; - if ((v.supports ().size () == 0) || - ((InterfaceEntry) v.supports ().elementAt (0)).isAbstract ()) { - return; - } - } - if (((InterfaceEntry) entry).isAbstract ()) { - return; - } - // - - this.symbolTable = symbolTable; - - this.i = (InterfaceEntry)entry; - init (); - openStream (); - if (stream == null) - return; - writeHeading (); - writeBody (); - writeClosing (); - closeStream (); - } // generate - - /** - * Initialize members unique to this generator. - **/ - protected void init () - { - tie = ((Arguments)Compile.compiler.arguments).TIEServer ; - poa = ((Arguments)Compile.compiler.arguments).POAServer ; - - skeletonNameModifier = - ((Arguments)Compile.compiler.arguments).skeletonNameModifier ; - tieNameModifier = - ((Arguments)Compile.compiler.arguments).tieNameModifier ; - - tieClassName = tieNameModifier.makeName( i.name() ) ; - skeletonClassName = skeletonNameModifier.makeName( i.name() ) ; - - intfName = Util.javaName (i); - // for valuetype, get the name of the interface the valuetype supports - if (i instanceof ValueEntry) - { - ValueEntry v = (ValueEntry) i; - InterfaceEntry intf = (InterfaceEntry) v.supports ().elementAt (0); - intfName = Util.javaName (intf); - } - } // init - - protected void openStream () - { - if (tie) - stream = Util.stream( i, tieNameModifier, ".java" ) ; - else - stream = Util.stream( i, skeletonNameModifier, ".java" ) ; - } // openStream - - protected void writeHeading () - { - Util.writePackage (stream, i, Util.StubFile); - Util.writeProlog (stream, ((GenFileStream)stream).name ()); - if (i.comment () != null) - i.comment ().generate ("", stream); - writeClassDeclaration (); - stream.println ('{'); - stream.println (); - } // writeHeading - - protected void writeClassDeclaration () - { - if (tie){ - stream.println ("public class " + tieClassName + - " extends " + skeletonClassName ) ; - } else { - if (poa) { - stream.println ("public abstract class " + skeletonClassName + - " extends org.omg.PortableServer.Servant"); - stream.print (" implements " + intfName + "Operations, "); - stream.println ("org.omg.CORBA.portable.InvokeHandler"); - } else { - stream.println ("public abstract class " + skeletonClassName + - " extends org.omg.CORBA.portable.ObjectImpl"); - stream.print (" implements " + intfName + ", "); - stream.println ("org.omg.CORBA.portable.InvokeHandler"); - } - } - } // writeClassDeclaration - - /** - * - **/ - protected void writeBody () - { - // Remove -stateful feature. ????? - //if (i.state () != null) - // writeState (); - writeCtors (); - if (i instanceof ValueEntry) - { - // use the interface the valuetype supports to generate the - // tie class instead of using the valuetype itself - ValueEntry v = (ValueEntry) i; - this.i = (InterfaceEntry) v.supports ().elementAt (0); - } - buildMethodList (); - //DispatchMethod and MethodTable - if (tie){ //Concrete class implementing the remote interface - //The logic is here for future use - if (poa) { - writeMethods (); - stream.println (" private " + intfName + "Operations _impl;"); - stream.println (" private org.omg.PortableServer.POA _poa;"); - } else { - writeMethods (); - stream.println (" private " + intfName + "Operations _impl;"); - } - } else { //Both POA and ImplBase are abstract InvokeHandler - //The logic is here for future use - if (poa) { - writeMethodTable (); - writeDispatchMethod (); - writeCORBAOperations (); - } else { - writeMethodTable (); - writeDispatchMethod (); - writeCORBAOperations (); - } - } - //legacy !! - writeOperations (); - } // writeBody - - /** - * Close the skeleton class. The singleton ORB member is - * necessary only for portable skeletons. - **/ - protected void writeClosing () - { - stream.println (); - if (tie){ - stream.println ("} // class " + tieClassName); - } else { - stream.println ("} // class " + skeletonClassName); - } - } // writeClosing - - /** - * Close the print stream, which flushes the stream to file. - **/ - protected void closeStream () - { - stream.close (); - } // closeStream - - protected void writeCtors () - { - stream.println (" // Constructors"); - // Empty argument constructors - if (!poa) { - if (tie){ - stream.println (" public " + tieClassName + " ()"); - stream.println (" {"); - stream.println (" }"); - } else { - stream.println (" public " + skeletonClassName + " ()"); - stream.println (" {"); - stream.println (" }"); - } - } - stream.println (); - // Argumented constructors - if (tie){ - if (poa) { - //Write constructors - writePOATieCtors(); - //Write state setters and getters - writePOATieFieldAccessMethods(); - } else { - stream.println (" public " + tieClassName + - " (" + intfName + "Operations impl)"); - stream.println (" {"); - // Does it derive from a interface having state, e.g., valuetype? - if (((InterfaceEntry)i.derivedFrom ().firstElement ()).state () != null) - stream.println (" super (impl);"); - else - stream.println (" super ();"); - stream.println (" _impl = impl;"); - stream.println (" }"); - stream.println (); - } - } else { //Skeleton is not Tie so it has no constructors. - if (poa) { - } else { - } - } - - } // writeCtors - - - private void writePOATieCtors(){ - //First constructor - stream.println (" public " + tieClassName + " ( " + intfName + "Operations delegate ) {"); - stream.println (" this._impl = delegate;"); - stream.println (" }"); - //Second constructor specifying default poa. - stream.println (" public " + tieClassName + " ( " + intfName + - "Operations delegate , org.omg.PortableServer.POA poa ) {"); - stream.println (" this._impl = delegate;"); - stream.println (" this._poa = poa;"); - stream.println (" }"); - } - - private void writePOATieFieldAccessMethods(){ - //Getting delegate - stream.println (" public " + intfName+ "Operations _delegate() {"); - stream.println (" return this._impl;"); - stream.println (" }"); - //Setting delegate - stream.println (" public void _delegate (" + intfName + "Operations delegate ) {"); - stream.println (" this._impl = delegate;"); - stream.println (" }"); - //Overriding default poa - stream.println (" public org.omg.PortableServer.POA _default_POA() {"); - stream.println (" if(_poa != null) {"); - stream.println (" return _poa;"); - stream.println (" }"); - stream.println (" else {"); - stream.println (" return super._default_POA();"); - stream.println (" }"); - stream.println (" }"); - } - - /** - * Build a list of all of the methods, keeping out duplicates. - **/ - protected void buildMethodList () - { - // Start from scratch - methodList = new Vector (); - - buildMethodList (i); - } // buildMethodList - - /** - * - **/ - private void buildMethodList (InterfaceEntry entry) - { - // Add the local methods - Enumeration locals = entry.methods ().elements (); - while (locals.hasMoreElements ()) - addMethod ((MethodEntry)locals.nextElement ()); - - // Add the inherited methods - Enumeration parents = entry.derivedFrom ().elements (); - while (parents.hasMoreElements ()) - { - InterfaceEntry parent = (InterfaceEntry)parents.nextElement (); - if (!parent.name ().equals ("Object")) - buildMethodList (parent); - } - } // buildMethodList - - /** - * - **/ - private void addMethod (MethodEntry method) - { - if (!methodList.contains (method)) - methodList.addElement (method); - } // addMethod - - /** - * - **/ - protected void writeDispatchMethod () - { - String indent = " "; - stream.println (" public org.omg.CORBA.portable.OutputStream _invoke (String $method,"); - stream.println (indent + "org.omg.CORBA.portable.InputStream in,"); - stream.println (indent + "org.omg.CORBA.portable.ResponseHandler $rh)"); - stream.println (" {"); - - // this is a special case code generation for cases servantLocator and - // servantActivator, where OMG is taking too long to define them - // as local objects - - boolean isLocalInterface = false; - if (i instanceof InterfaceEntry) { - isLocalInterface = i.isLocalServant(); - } - - if (!isLocalInterface) { - // Per Simon 8/26/98, create and return reply stream for all methods - KLR - stream.println (" org.omg.CORBA.portable.OutputStream out = null;"); - stream.println (" java.lang.Integer __method = (java.lang.Integer)_methods.get ($method);"); - stream.println (" if (__method == null)"); - stream.println (" throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);"); - stream.println (); - if (methodList.size () > 0) - { - stream.println (" switch (__method.intValue ())"); - stream.println (" {"); - - // Write the method case statements - int realI = 0; - for (int i = 0; i < methodList.size (); ++i) - { - MethodEntry method = (MethodEntry)methodList.elementAt (i); - ((MethodGen)method.generator ()).dispatchSkeleton (symbolTable, method, stream, realI); - if (method instanceof AttributeEntry && !((AttributeEntry)method).readOnly ()) - realI += 2; - else - ++realI; - } - - indent = " "; - stream.println (indent + "default:"); - stream.println (indent + " throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);"); - stream.println (" }"); - stream.println (); - } - stream.println (" return out;"); - } else { - stream.println(" throw new org.omg.CORBA.BAD_OPERATION();"); - } - stream.println (" } // _invoke"); - stream.println (); - } // writeDispatchMethod - - /** - * - **/ - protected void writeMethodTable () - { - // Write the methods hashtable - stream.println (" private static java.util.Hashtable _methods = new java.util.Hashtable ();"); - stream.println (" static"); - stream.println (" {"); - - int count = -1; - Enumeration e = methodList.elements (); - while (e.hasMoreElements ()) - { - MethodEntry method = (MethodEntry)e.nextElement (); - if (method instanceof AttributeEntry) - { - stream.println (" _methods.put (\"_get_" + Util.stripLeadingUnderscores (method.name ()) + "\", new java.lang.Integer (" + (++count) + "));"); - if (!((AttributeEntry)method).readOnly ()) - stream.println (" _methods.put (\"_set_" + Util.stripLeadingUnderscores (method.name ()) + "\", new java.lang.Integer (" + (++count) + "));"); - } - else - stream.println (" _methods.put (\"" + Util.stripLeadingUnderscores (method.name ()) + "\", new java.lang.Integer (" + (++count) + "));"); - } - stream.println (" }"); - stream.println (); - } // writeMethodTable - - /** - * - **/ - protected void writeMethods () - { - int realI = 0; - for (int i = 0; i < methodList.size (); ++i) - { - MethodEntry method = (MethodEntry)methodList.elementAt (i); - ((MethodGen)method.generator ()).skeleton - (symbolTable, method, stream, realI); - if (method instanceof AttributeEntry && - !((AttributeEntry)method).readOnly ()) - realI += 2; - else - ++realI; - stream.println (); - } - } // writeMethods - - /** - * - **/ - private void writeIDs () - { - Vector list = new Vector (); - buildIDList (i, list); - Enumeration e = list.elements (); - boolean first = true; - while (e.hasMoreElements ()) - { - if (first) - first = false; - else - stream.println (", "); - stream.print (" \"" + (String)e.nextElement () + '"'); - } - } // writeIDs - - /** - * - **/ - private void buildIDList (InterfaceEntry entry, Vector list) - { - if (!entry.fullName ().equals ("org/omg/CORBA/Object")) - { - String id = Util.stripLeadingUnderscoresFromID (entry.repositoryID ().ID ()); - if (!list.contains (id)) - list.addElement (id); - Enumeration e = entry.derivedFrom ().elements (); - while (e.hasMoreElements ()) - buildIDList ((InterfaceEntry)e.nextElement (), list); - } - } // buildIDList - - /** - * - **/ - protected void writeCORBAOperations () - { - stream.println (" // Type-specific CORBA::Object operations"); - - stream.println (" private static String[] __ids = {"); - writeIDs (); - stream.println ("};"); - stream.println (); - if (poa) - writePOACORBAOperations(); - else - writeNonPOACORBAOperations(); - - } // writeCORBAOperations - - protected void writePOACORBAOperations(){ - stream.println (" public String[] _all_interfaces (org.omg.PortableServer.POA poa, byte[] objectId)"); - //Right now, with our POA implementation, the same - //implementation of _ids() type methods seem to work for both non-POA - //as well as POA servers. We need to REVISIT since the equivalent - //POA interface, i.e. _all_interfaces, has parameters which are not being - //used in the _ids() implementation. - stream.println (" {"); - stream.println (" return (String[])__ids.clone ();"); - stream.println (" }"); - stream.println (); - //_this() - stream.println (" public "+ i.name() +" _this() "); - stream.println (" {"); - stream.println (" return "+ i.name() +"Helper.narrow(" ); - stream.println (" super._this_object());"); - stream.println (" }"); - stream.println (); - //_this(org.omg.CORBA.ORB orb) - stream.println (" public "+ i.name() +" _this(org.omg.CORBA.ORB orb) "); - stream.println (" {"); - stream.println (" return "+ i.name() +"Helper.narrow(" ); - stream.println (" super._this_object(orb));"); - stream.println (" }"); - stream.println (); - } - protected void writeNonPOACORBAOperations(){ - stream.println (" public String[] _ids ()"); - stream.println (" {"); - stream.println (" return (String[])__ids.clone ();"); - stream.println (" }"); - stream.println (); - } - /** - * - **/ - protected void writeOperations () - { - // _get_ids removed at Simon's request 8/26/98 - KLR - } // writeOperations - - protected Hashtable symbolTable = null; - protected InterfaceEntry i = null; - protected PrintWriter stream = null; - - // Unique to this generator - protected String tieClassName = null; - protected String skeletonClassName = null; - protected boolean tie = false; - protected boolean poa = false; - protected Vector methodList = null; - protected String intfName = ""; -} // class Skeleton diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/StringGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/StringGen.java deleted file mode 100644 index ce92610fc0a..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/StringGen.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: -// -D61056 Use Util.helperName - -import java.io.PrintWriter; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.StringEntry; -import com.sun.tools.corba.se.idl.SymtabEntry; - -/** - * Handles generation of CORBA strings as well as wstrings. Be careful - * not to forget the wstrings. - **/ -public class StringGen implements com.sun.tools.corba.se.idl.StringGen, JavaGenerator -{ - /** - * Public zero-argument constructor. - **/ - public StringGen () - { - } // ctor - - /** - * This should never be called. This class exists for the - * JavaGenerator interface. - **/ - public void generate (Hashtable symbolTable, StringEntry e, PrintWriter stream) - { - } // generate - - /////////////// - // From JavaGenerator - - public int helperType (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) - { - return type(index, indent, tcoffsets, name, entry, stream); - } // helperType - - public int type (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) { - tcoffsets.set (entry); - StringEntry stringEntry = (StringEntry)entry; - String bound; - if (stringEntry.maxSize () == null) - bound = "0"; - else - bound = Util.parseExpression (stringEntry.maxSize ()); - - // entry.name() is necessary to determine whether it is a - // string or wstring - - stream.println (indent - + name - + " = org.omg.CORBA.ORB.init ().create_" - + entry.name() - + "_tc (" - + bound + ");"); - return index; - } // type - - public void helperRead (String entryName, SymtabEntry entry, PrintWriter stream) - { - } // helperRead - - public void helperWrite (SymtabEntry entry, PrintWriter stream) - { - } // helperWrite - - public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - StringEntry string = (StringEntry)entry; - String entryName = entry.name (); - if (entryName.equals ("string")) - stream.println (indent + name + " = istream.read_string ();"); - else if (entryName.equals ("wstring")) - stream.println (indent + name + " = istream.read_wstring ();"); - if (string.maxSize () != null) - { - stream.println (indent + "if (" + name + ".length () > (" + Util.parseExpression (string.maxSize ()) + "))"); - stream.println (indent + " throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);"); - } - return index; - } // read - - public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - StringEntry string = (StringEntry)entry; - if (string.maxSize () != null) - { - stream.print (indent + "if (" + name + ".length () > (" + Util.parseExpression (string.maxSize ()) + "))"); - stream.println (indent + " throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);"); - } - String entryName = entry.name (); - if (entryName.equals ("string")) - stream.println (indent + "ostream.write_string (" + name + ");"); - else if (entryName.equals ("wstring")) - stream.println (indent + "ostream.write_wstring (" + name + ");"); - return index; - } // write - - // From JavaGenerator - /////////////// -} // class StringGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/StructGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/StructGen.java deleted file mode 100644 index 610efad8d8c..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/StructGen.java +++ /dev/null @@ -1,455 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: -// - Think about arrays (and sequences?) as members -// - A sequence must be converted to an array, but a memory of the -// max size must be retained. -// - After demarshalling an IOR, think about how to deal with the exceptions. -// - The demarshall method should be throwing a ClientException, -// but should it, really? -// -D60929 Update for RTF2.4 changes -// -D61056 Use Util.helperName -// -D62023 Use corbaLevel in read/write generation -// -D59437 Modify read() to enit qualified name of value box helper. - -import java.io.File; -import java.io.PrintWriter; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Vector; - -import com.sun.tools.corba.se.idl.GenFileStream; -import com.sun.tools.corba.se.idl.EnumEntry; -import com.sun.tools.corba.se.idl.InterfaceEntry; -import com.sun.tools.corba.se.idl.PrimitiveEntry; -import com.sun.tools.corba.se.idl.SequenceEntry; -import com.sun.tools.corba.se.idl.StringEntry; -import com.sun.tools.corba.se.idl.StructEntry; -import com.sun.tools.corba.se.idl.SymtabEntry; -import com.sun.tools.corba.se.idl.TypedefEntry; -import com.sun.tools.corba.se.idl.ValueEntry; -import com.sun.tools.corba.se.idl.ValueBoxEntry; -import com.sun.tools.corba.se.idl.InterfaceState; - -/** - * - **/ -public class StructGen implements com.sun.tools.corba.se.idl.StructGen, JavaGenerator -{ - /** - * Public zero-argument constructor. - **/ - public StructGen () - { - } // ctor - - /** - * Constructor for ExceptionGen. - **/ - protected StructGen (boolean exception) - { - thisIsReallyAnException = exception; - } // ctor - - /** - * - **/ - public void generate (Hashtable symbolTable, StructEntry s, PrintWriter str) - { - this.symbolTable = symbolTable; - this.s = s; - //init (); - - openStream (); - if (stream == null) - return; - generateHelper (); - generateHolder (); - writeHeading (); - writeBody (); - writeClosing (); - closeStream (); - generateContainedTypes (); - } // generate - - /** - * Initialize members unique to this generator. - **/ - protected void init () - { - } // init - - /** - * - **/ - protected void openStream () - { - stream = Util.stream (s, ".java"); - } // openStream - - /** - * - **/ - protected void generateHelper () - { - ((Factories)Compile.compiler.factories ()).helper ().generate (symbolTable, s); - } // generateHelper - - /** - * - **/ - protected void generateHolder () - { - ((Factories)Compile.compiler.factories ()).holder ().generate (symbolTable, s); - } // generateHolder - - /** - * - **/ - protected void writeHeading () - { - Util.writePackage (stream, s); - Util.writeProlog (stream, ((GenFileStream)stream).name ()); - - if (s.comment () != null) - s.comment ().generate ("", stream); - - stream.print ("public final class " + s.name ()); - if (thisIsReallyAnException) - stream.print (" extends org.omg.CORBA.UserException"); - else - stream.print(" implements org.omg.CORBA.portable.IDLEntity"); - stream.println (); - stream.println ("{"); - } // writeHeading - - /** - * - **/ - protected void writeBody () - { - writeMembers (); - writeCtors (); - } // writeBody - - /** - * - **/ - protected void writeClosing () - { - stream.println ("} // class " + s.name ()); - } // writeClosing - - /** - * - **/ - protected void closeStream () - { - stream.close (); - } // closeStream - - /** - * - **/ - protected void generateContainedTypes () - { - // Generate all of the contained types - Enumeration e = s.contained ().elements (); - while (e.hasMoreElements ()) - { - SymtabEntry entry = (SymtabEntry)e.nextElement (); - - // Don't generate contained entries if they are sequences. - // Sequences are unnamed and since they translate to arrays, - // no classes are generated for them, not even holders in this - // case since they cannot be accessed outside of this struct. - - if (!(entry instanceof SequenceEntry)) - entry.generate (symbolTable, stream); - } - } // generateContainedTypes - - /** - * - **/ - protected void writeMembers () - { - // Write members and populate quality arrays - int size = s.members ().size (); - memberIsPrimitive = new boolean [size]; - memberIsInterface = new boolean [size]; - memberIsTypedef = new boolean [size]; - for (int i = 0; i < s.members ().size (); ++i) - { - SymtabEntry member = (SymtabEntry)s.members ().elementAt (i); - memberIsPrimitive[i] = member.type () instanceof PrimitiveEntry; - memberIsInterface[i] = member.type () instanceof InterfaceEntry; - memberIsTypedef[i] = member.type () instanceof TypedefEntry; - Util.fillInfo (member); - // Transfer member comment to target <31jul1997>. - if (member.comment () != null) - member.comment ().generate (" ", stream); - Util.writeInitializer (" public ", member.name (), "", member, stream); - } - } // writeMembers - - /** - * - **/ - protected void writeCtors () - { - // Write default ctor - stream.println (); - stream.println (" public " + s.name () + " ()"); - stream.println (" {"); - // fixed mapping for exceptions - if (thisIsReallyAnException) - stream.println (" super(" + s.name() + "Helper.id());"); - stream.println (" } // ctor"); - writeInitializationCtor(true); - if (thisIsReallyAnException) { - // for exception according to mapping we should always - // have a full constructor - writeInitializationCtor(false); - } - } - - private void writeInitializationCtor(boolean init) - { - // Write initialization ctor - if (!init || (s.members ().size () > 0)) - { - stream.println (); - stream.print (" public " + s.name () + " ("); - boolean firstTime = true; - if (!init) { - stream.print ("String $reason"); - firstTime = false; - } - - for (int i = 0; i < s.members ().size (); ++i) - { - SymtabEntry member = (SymtabEntry)s.members ().elementAt (i); - if (firstTime) - firstTime = false; - else - stream.print (", "); - stream.print (Util.javaName (member) + " _" + member.name ()); - } - stream.println (")"); - stream.println (" {"); - // fixed mapping for exceptions - if (thisIsReallyAnException) { - if (init) - stream.println (" super(" + s.name() + "Helper.id());"); - else - stream.println (" super(" + s.name() + "Helper.id() + \" \" + $reason);"); - } - for (int i = 0; i < s.members ().size (); ++i) - { - SymtabEntry member = (SymtabEntry)s.members ().elementAt (i); - stream.println (" " + member.name () + " = _" + member.name () + ";"); - } - stream.println (" } // ctor"); - } - stream.println (); - } // writeInitializationCtor - - /////////////// - // From JavaGenerator - - public int helperType (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) - { - TCOffsets innerOffsets = new TCOffsets (); - innerOffsets.set (entry); - int offsetForStruct = innerOffsets.currentOffset (); - StructEntry s = (StructEntry)entry; - String membersName = "_members" + index++; - stream.println (indent + "org.omg.CORBA.StructMember[] " + membersName + " = new org.omg.CORBA.StructMember [" + s.members ().size () + "];"); - String tcOfMembers = "_tcOf" + membersName; - stream.println (indent + "org.omg.CORBA.TypeCode " + tcOfMembers + " = null;"); - for (int i = 0; i < s.members ().size (); ++i) - { - TypedefEntry member = (TypedefEntry)s.members ().elementAt (i); - String memberName = member.name (); - // Generate and assign member TypeCode to tcofMembers - index = ((JavaGenerator)member.generator ()).type (index, indent, innerOffsets, tcOfMembers, member, stream); - stream.println (indent + membersName + '[' + i + "] = new org.omg.CORBA.StructMember ("); - stream.println (indent + " \"" + Util.stripLeadingUnderscores (memberName) + "\","); - stream.println (indent + " " + tcOfMembers + ','); - stream.println (indent + " null);"); - int offsetSoFar = innerOffsets.currentOffset (); - innerOffsets = new TCOffsets (); - innerOffsets.set (entry); - innerOffsets.bumpCurrentOffset (offsetSoFar - offsetForStruct); - - } - tcoffsets.bumpCurrentOffset (innerOffsets.currentOffset ()); - // <54697> - //stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_struct_tc (id (), \"" + Util.stripLeadingUnderscores (entry.name ()) + "\", " + membersName + ");"); - stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_" + (thisIsReallyAnException ? "exception" : "struct") + "_tc (" + Util.helperName (s, true) + ".id (), \"" + Util.stripLeadingUnderscores (entry.name ()) + "\", " + membersName + ");"); // - return index; - } // helperType - - public int type (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) { - stream.println (indent + name + " = " + Util.helperName (entry, true) + ".type ();"); // - return index; - } // type - - public void helperRead (String entryName, SymtabEntry entry, PrintWriter stream) - { - stream.println (" " + entryName + " value = new " + entryName + " ();"); - read (0, " ", "value", entry, stream); - stream.println (" return value;"); - } // helperRead - - public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - if (thisIsReallyAnException) - { - stream.println (indent + "// read and discard the repository ID"); - stream.println (indent + "istream.read_string ();"); - } - - Enumeration e = ((StructEntry)entry).members ().elements (); - while (e.hasMoreElements ()) - { - TypedefEntry member = (TypedefEntry)e.nextElement (); - SymtabEntry mType = member.type (); - - if (!member.arrayInfo ().isEmpty () || mType instanceof SequenceEntry || - mType instanceof PrimitiveEntry || mType instanceof StringEntry || - mType instanceof TypedefEntry) - index = ((JavaGenerator)member.generator ()).read (index, indent, name + '.' + member.name (), member, stream); - else if (mType instanceof ValueBoxEntry) - { - // call read_value instead of Helper.read for the value - Vector st = ((ValueBoxEntry) mType).state (); - TypedefEntry vbMember = ((InterfaceState) st.elementAt (0)).entry; - SymtabEntry vbType = vbMember.type (); - - String jName = null; - String jHelper = null; - - if (vbType instanceof SequenceEntry || vbType instanceof StringEntry || - !vbMember.arrayInfo ().isEmpty ()) - { - jName = Util.javaName (vbType); // name of mapped Java type - // REVISIT. Typename info. now correct for value boxes, so - // these two cases may be obsolete. See UnionGen.read(). - //jHelper = Util.helperName (vbType, false); // - jHelper = Util.helperName (mType, true); - } - else - { - jName = Util.javaName (mType); // name of mapped Java class - // - //jHelper = Util.helperName (mType, false); // - jHelper = Util.helperName (mType, true); - } - // Call xHelper.read() for valueboxes for RTF2.4 - if (Util.corbaLevel (2.4f, 99.0f)) - stream.println (indent + name + '.' + member.name () + " = (" + jName + ") " + jHelper + ".read (istream);"); - else - stream.println (indent + name + '.' + member.name () + " = (" + jName + ") ((org.omg.CORBA_2_3.portable.InputStream)istream).read_value (" + jHelper + ".get_instance ());"); // - } - // for corbaLevel 2.4 and up, use Helper.read like - // everything else - else if ((mType instanceof ValueEntry) && - !Util.corbaLevel (2.4f, 99.0f)) // - { - // call read_value instead of Helper.read for the value - stream.println (indent + name + '.' + member.name () + " = (" + Util.javaName (mType) + ") ((org.omg.CORBA_2_3.portable.InputStream)istream).read_value (" + Util.helperName (mType, false) + ".get_instance ());"); // // - } - else - stream.println (indent + name + '.' + member.name () + " = " + Util.helperName (member.type (), true) + ".read (istream);"); // - } - return index; - } // read - - public void helperWrite (SymtabEntry entry, PrintWriter stream) - { - write (0, " ", "value", entry, stream); - } // helperWrite - - public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - if (thisIsReallyAnException) - { - stream.println (indent + "// write the repository ID"); - stream.println (indent + "ostream.write_string (id ());"); - } - - Vector members = ((StructEntry)entry).members (); - for (int i = 0; i < members.size (); ++i) - { - TypedefEntry member = (TypedefEntry)members.elementAt (i); - SymtabEntry mType = member.type (); - - if (!member.arrayInfo ().isEmpty () || mType instanceof SequenceEntry || - mType instanceof TypedefEntry || mType instanceof PrimitiveEntry || - mType instanceof StringEntry) - index = ((JavaGenerator)member.generator ()).write (index, " ", name + '.' + member.name (), member, stream); - - // for corbaLevel 2.4 and up, use Helper.write like - // everything else - else if ((mType instanceof ValueEntry || mType instanceof ValueBoxEntry) - && !Util.corbaLevel (2.4f, 99.0f)) { // - stream.println (indent + "((org.omg.CORBA_2_3.portable.OutputStream)ostream).write_value ((java.io.Serializable) " // - + name + '.' + member.name () + ", " - + Util.helperName (member.type (), true) // - + ".get_instance ());"); // - } - else - stream.println (indent + Util.helperName (member.type (), true) + ".write (ostream, " + name + '.' + member.name () + ");"); // - } - return index; - } // write - - // From JavaGenerator - /////////////// - - protected Hashtable symbolTable = null; - protected StructEntry s = null; - protected PrintWriter stream = null; - - protected boolean thisIsReallyAnException = false; - private boolean[] memberIsPrimitive; - private boolean[] memberIsInterface; - private boolean[] memberIsTypedef; -} // class StructGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Stub.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Stub.java deleted file mode 100644 index c305ada5b24..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Stub.java +++ /dev/null @@ -1,380 +0,0 @@ -/* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: - -import java.io.File; -import java.io.PrintWriter; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Vector; - -import com.sun.tools.corba.se.idl.AttributeEntry; -import com.sun.tools.corba.se.idl.GenFileStream; -import com.sun.tools.corba.se.idl.InterfaceEntry; -import com.sun.tools.corba.se.idl.MethodEntry; -import com.sun.tools.corba.se.idl.SymtabEntry; - -/** - * - **/ -public class Stub implements AuxGen -{ - /** - * Public zero-argument constructor. - **/ - public Stub () - { - } // ctor - - /** - * - **/ - public void generate (Hashtable symbolTable, SymtabEntry entry) - { - this.symbolTable = symbolTable; - this.i = (InterfaceEntry)entry; - this.localStub = i.isLocalServant(); - this.isAbstract = i.isAbstract( ); - init (); - - openStream (); - if (stream == null) - return; - writeHeading (); - writeBody (); - writeClosing (); - closeStream (); - } // generate - - /** - * Initialize unique members of this generator. - **/ - protected void init () - { - classSuffix = "Stub"; - } // init - - /** - * - **/ - protected void openStream () - { - String name = '_' + i.name () + classSuffix; - String pkg = Util.containerFullName (i.container ()); - if (pkg != null && !pkg.equals ("")) - { - Util.mkdir (pkg); - name = pkg + '/' + name; - } - stream = Util.getStream (name.replace ('/', File.separatorChar) + ".java", i); - } // openStream - - /** - * - **/ - protected void writeHeading () - { - Util.writePackage (stream, i, Util.StubFile); - Util.writeProlog (stream, ((GenFileStream)stream).name ()); - - // Transfer interface comment to target <31jul1997>. - if (i.comment () != null) - i.comment ().generate ("", stream); - - writeClassDeclaration (); - stream.println ('{'); - } // writeHeading - - /** - * - **/ - protected void writeClassDeclaration () - { - stream.print ("public class _" + i.name () + classSuffix + " extends org.omg.CORBA.portable.ObjectImpl"); - stream.println (" implements " + Util.javaName (i)); - } // writeClassDeclaration - - /** - * Steps done within writeBody include: - * 1.) makeCtors (); - * 2.) buildMethodList (); - * 3.) makeMethods (); - * 4.) makeCORBAObjectMethods () - **/ - protected void writeBody () - { - writeCtors (); - buildMethodList (); - writeMethods (); - writeCORBAObjectMethods (); - writeSerializationMethods (); - } // writeBody - - /** - * - **/ - protected void writeClosing () - { - stream.println ("} // class _" + i.name () + classSuffix); - } // writeClosing - - /** - * - **/ - protected void closeStream () - { - stream.close (); - } // closeStream - - /** - * - **/ - protected void writeCtors () - { - String name = i.name (); - - /*** the constructors are not generated as per ptc/00-01-08.pdf - * since these are non-standard APIs, and same can be accomplished - * programatically, we need to comment this out, in order to - * be able to generate standard stubs - */ - - /************* - stream.println (" // Constructors"); - stream.println (" // NOTE: If the default constructor is used, the"); - stream.println (" // object is useless until _set_delegate (...)"); - stream.println (" // is called."); - stream.println (" public _" + name + classSuffix + " ()"); - stream.println (" {"); - stream.println (" super ();"); - stream.println (" }"); - stream.println (); - stream.println (" public _" + name + classSuffix + " (org.omg.CORBA.portable.Delegate delegate)"); - stream.println (" {"); - stream.println (" super ();"); - stream.println (" _set_delegate (delegate);"); - stream.println (" }"); - ***************/ - // This is confusing since we have localOptimization flag as well. - // We have left this code because JCK team filed a P1 bug for changing - // _opsClass to $opsClass. Will clean it up in Tiger - // _REVISIT_ (Hemanth 03/05/2002) - if (localStub) { - stream.println (" final public static java.lang.Class _opsClass = " + - name + "Operations.class;"); - stream.println (); - } - stream.println (); - } // writeCtors - - /** - * Build a list of all of the methods, keeping out duplicates. - **/ - protected void buildMethodList () - { - // Start from scratch - methodList = new Vector (); - - buildMethodList (i); - } // buildMethodList - - /** - * - **/ - private void buildMethodList (InterfaceEntry entry) - { - // Add the local methods - Enumeration locals = entry.methods ().elements (); - while (locals.hasMoreElements ()) - addMethod ((MethodEntry)locals.nextElement ()); - - // Add the inherited methods - Enumeration parents = entry.derivedFrom ().elements (); - while (parents.hasMoreElements ()) - { - InterfaceEntry parent = (InterfaceEntry)parents.nextElement (); - if (!parent.name ().equals ("Object")) - buildMethodList (parent); - } - } // buildMethodList - - /** - * - **/ - private void addMethod (MethodEntry method) - { - if (!methodList.contains (method)) - methodList.addElement (method); - } // addMethod - - /** - * - **/ - protected void writeMethods () - { - // Count the methods, attributes which are not readonly are - // counted as 2 methods. - int count = methodList.size (); - Enumeration e = methodList.elements (); - while (e.hasMoreElements ()) - { - Object method = e.nextElement (); - if (method instanceof AttributeEntry && !((AttributeEntry)method).readOnly ()) - ++count; - } - - if( (((Arguments)Compile.compiler.arguments).LocalOptimization ) - && !isAbstract ) - { - stream.println( " final public static java.lang.Class _opsClass =" ); - stream.println( " " + this.i.name() + "Operations.class;" ); - } - - // Write the methods - int realI = 0; - for (int i = 0; i < methodList.size (); ++i) - { - MethodEntry method = (MethodEntry)methodList.elementAt (i); - if (!localStub) { - ((MethodGen)method.generator ()).stub (this.i.name(), isAbstract, symbolTable, method, stream, realI); - } else { - ((MethodGen)method.generator ()).localstub (symbolTable, method, stream, realI, this.i); - } - if (method instanceof AttributeEntry && !((AttributeEntry)method).readOnly ()) - realI += 2; - else - ++realI; - } - } // writeMethods - - /** - * - **/ - private void buildIDList (InterfaceEntry entry, Vector list) - { - if (!entry.fullName ().equals ("org/omg/CORBA/Object")) - { - String id = Util.stripLeadingUnderscoresFromID (entry.repositoryID ().ID ()); - if (!list.contains (id)) - list.addElement (id); - Enumeration e = entry.derivedFrom ().elements (); - while (e.hasMoreElements ()) - buildIDList ((InterfaceEntry)e.nextElement (), list); - } - } // buildIDList - - /** - * - **/ - private void writeIDs () - { - Vector list = new Vector (); - buildIDList (i, list); - Enumeration e = list.elements (); - boolean first = true; - while (e.hasMoreElements ()) - { - if (first) - first = false; - else - stream.println (", "); - stream.print (" \"" + (String)e.nextElement () + '"'); - } - } // writeIDs - - /** - * - **/ - protected void writeCORBAObjectMethods () - { - stream.println (" // Type-specific CORBA::Object operations"); - stream.println (" private static String[] __ids = {"); - writeIDs (); - stream.println ("};"); - stream.println (); - stream.println (" public String[] _ids ()"); - stream.println (" {"); - stream.println (" return (String[])__ids.clone ();"); - stream.println (" }"); - stream.println (); - } // writeCORBAObjectMethods - - /** - * - **/ - protected void writeSerializationMethods () - { - stream.println (" private void readObject (java.io.ObjectInputStream s) throws java.io.IOException"); - stream.println (" {"); - stream.println (" String str = s.readUTF ();"); - stream.println (" String[] args = null;"); - stream.println (" java.util.Properties props = null;"); - stream.println (" org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);"); - stream.println (" try {"); - stream.println (" org.omg.CORBA.Object obj = orb.string_to_object (str);"); - stream.println (" org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();"); - stream.println (" _set_delegate (delegate);"); - stream.println (" } finally {"); - stream.println (" orb.destroy() ;"); - stream.println (" }"); - stream.println (" }"); - stream.println (); - stream.println (" private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException"); - stream.println (" {"); - stream.println (" String[] args = null;"); - stream.println (" java.util.Properties props = null;"); - stream.println (" org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);"); - stream.println (" try {"); - stream.println (" String str = orb.object_to_string (this);"); - stream.println (" s.writeUTF (str);"); - stream.println (" } finally {"); - stream.println (" orb.destroy() ;"); - stream.println (" }"); - stream.println (" }"); - } - - protected Hashtable symbolTable = null; - protected InterfaceEntry i = null; - protected PrintWriter stream = null; - - // Unique to this generator - protected Vector methodList = null; - protected String classSuffix = ""; - protected boolean localStub = false; - private boolean isAbstract = false; -} // class Stub diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/TCOffsets.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/TCOffsets.java deleted file mode 100644 index 5cf903dae38..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/TCOffsets.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: - -import java.util.Enumeration; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.*; - -// This class is passed through the JavaGenerator.HelperType methods. -// It is ONLY used when a recursive sequence is detected. ie. -// -// struct S1 -// { -// sequence others; -// }; - -/** - * - **/ -public class TCOffsets -{ - /** - * Return -1 if the given name is not in the list of types. - **/ - public int offset (String name) - { - Integer value = (Integer)tcs.get (name); - return value == null ? -1 : value.intValue (); - } // offset - - /** - * - **/ - public void set (SymtabEntry entry) - { - if (entry == null) - offset += 8; - else - { - tcs.put (entry.fullName (), new Integer (offset)); - offset += 4; - String repID = Util.stripLeadingUnderscoresFromID (entry.repositoryID ().ID ()); - if (entry instanceof InterfaceEntry) - offset += alignStrLen (repID) + alignStrLen (entry.name ()); - else if (entry instanceof StructEntry) - offset += alignStrLen (repID) + alignStrLen (entry.name ()) + 4; - else if (entry instanceof UnionEntry) - offset += alignStrLen (repID) + alignStrLen (entry.name ()) + 12; - else if (entry instanceof EnumEntry) - { - offset += alignStrLen (repID) + alignStrLen (entry.name ()) + 4; - Enumeration e = ((EnumEntry)entry).elements ().elements (); - while (e.hasMoreElements ()) - offset += alignStrLen ((String)e.nextElement ()); - } - else if (entry instanceof StringEntry) - offset += 4; - else if (entry instanceof TypedefEntry) - { - offset += alignStrLen (repID) + alignStrLen (entry.name ()); - if (((TypedefEntry)entry).arrayInfo ().size () != 0) - offset += 8; - } - } - } // set - - /** - * Return the full length of the string type: 4 byte length, x bytes for - * string + 1 for the null terminator, align it so it ends on a 4-byte - * boundary. This method assumes the string starts at a 4-byte boundary - * since it doesn't do any leading alignment. - **/ - public int alignStrLen (String string) - { - int len = string.length () + 1; - int align = 4 - (len % 4); - if (align == 4) align = 0; - return len + align + 4; - } // alignStrLen - - /** - * - **/ - public void setMember (SymtabEntry entry) - { - offset += alignStrLen (entry.name ()); - if (((TypedefEntry)entry).arrayInfo ().size () != 0) - offset += 4; - } // setMember - - /** - * - **/ - public int currentOffset () - { - return offset; - } // currentOffset - - /** - * - **/ - public void bumpCurrentOffset (int value) - { - offset += value; - } // bumpCurrentOffset - - private Hashtable tcs = new Hashtable (); - private int offset = 0; -} // class TCOffsets diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/TypedefGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/TypedefGen.java deleted file mode 100644 index 775a4936cc9..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/TypedefGen.java +++ /dev/null @@ -1,326 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: -// -11aug1997 No modification: comments for type_defs will appear in -// helper, holder classes as a result of modifications to routines -// makeHelper(), makeHolder() in class com.sun.tools.corba.se.idl.toJava.Util. -// -F46082.51 Remove -stateful feature; javaStatefulName() obsolete. -// -D61056 Use Util.helperName - -import java.io.PrintWriter; - -import java.util.Enumeration; -import java.util.Hashtable; - -import com.sun.tools.corba.se.idl.InterfaceEntry; -import com.sun.tools.corba.se.idl.InterfaceState; -import com.sun.tools.corba.se.idl.PrimitiveEntry; -import com.sun.tools.corba.se.idl.SequenceEntry; -import com.sun.tools.corba.se.idl.StringEntry; -import com.sun.tools.corba.se.idl.StructEntry; -import com.sun.tools.corba.se.idl.SymtabEntry; -import com.sun.tools.corba.se.idl.TypedefEntry; -import com.sun.tools.corba.se.idl.UnionEntry; - -import com.sun.tools.corba.se.idl.constExpr.Expression; - -// Notes: - -/** - * - **/ -public class TypedefGen implements com.sun.tools.corba.se.idl.TypedefGen, JavaGenerator -{ - /** - * Public zero-argument constructor. - **/ - public TypedefGen () - { - } // ctor - - /** - * - **/ - public void generate (Hashtable symbolTable, TypedefEntry t, PrintWriter stream) - { - this.symbolTable = symbolTable; - this.t = t; - - if (t.arrayInfo ().size () > 0 || t.type () instanceof SequenceEntry) - generateHolder (); - generateHelper (); - } // generator - - /** - * - **/ - protected void generateHolder () - { - ((Factories)Compile.compiler.factories ()).holder ().generate (symbolTable, t); - } - - /** - * - **/ - protected void generateHelper () - { - ((Factories)Compile.compiler.factories ()).helper ().generate (symbolTable, t); - } - - /////////////// - // From JavaGenerator - - private boolean inStruct (TypedefEntry entry) - { - boolean inStruct = false; - if (entry.container () instanceof StructEntry || entry.container () instanceof UnionEntry) - inStruct = true; - else if (entry.container () instanceof InterfaceEntry) - { - InterfaceEntry i = (InterfaceEntry)entry.container (); - if (i.state () != null) - { - Enumeration e = i.state ().elements (); - while (e.hasMoreElements ()) - if (((InterfaceState)e.nextElement ()).entry == entry) - { - inStruct = true; - break; - } - } - } - return inStruct; - } // inStruct - - public int helperType (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) - { - TypedefEntry td = (TypedefEntry)entry; - boolean inStruct = inStruct (td); - if (inStruct) - tcoffsets.setMember (entry); - else - tcoffsets.set (entry); - - // Print the base types typecode - index = ((JavaGenerator)td.type ().generator ()).type (index, indent, tcoffsets, name, td.type (), stream); - - if (inStruct && td.arrayInfo ().size () != 0) - tcoffsets.bumpCurrentOffset (4); // for array length field - - // Print the array typecodes (if there are any) - int dimensions = td.arrayInfo ().size (); - for (int i = 0; i < dimensions; ++i) - { - String size = Util.parseExpression ((Expression)td.arrayInfo ().elementAt (i)); - stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_array_tc (" + size + ", " + name + " );"); - } - - // If this typedef describes a struct/union member, don't put it - // in an alias typedef; otherwise that's where it belongs. - if (!inStruct) - // <54697> - //stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_alias_tc (id (), \"" + Util.stripLeadingUnderscores (td.name ()) + "\", " + name + ");"); - stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_alias_tc (" + Util.helperName (td, true) + ".id (), \"" + Util.stripLeadingUnderscores (td.name ()) + "\", " + name + ");"); // - - return index; - } // helperType - - public int type (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) - { - // The type() method is invoked from other emitters instead of when an IDL - // typedef statement is being processed. Code generated is identical minus the - // generation of a create_alias_tc() which is required for IDL typedef's but not - // needed when typedef is being processed as a member of struct/union/valuetype. - - return helperType( index, indent, tcoffsets, name, entry, stream); - } // type - - public void helperRead (String entryName, SymtabEntry entry, PrintWriter stream) - { - Util.writeInitializer (" ", "value", "", entry, stream); - read (0, " ", "value", entry, stream); - stream.println (" return value;"); - } // helperRead - - public void helperWrite (SymtabEntry entry, PrintWriter stream) - { - write (0, " ", "value", entry, stream); - } // helperWrite - - public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - TypedefEntry td = (TypedefEntry)entry; - String modifier = Util.arrayInfo (td.arrayInfo ()); - if (!modifier.equals ("")) - { - // arrayInfo is a vector of Expressions which indicate the - // number of array dimensions for this typedef. But what if - // this is a typedef of a sequence? - // The `new' statement being generated must know the full - // number of brackets. That can be found in td.info. - // For instance: - // typedef sequence A[10][10]; - // void proc (out A a); - // typeModifier = "[10][10]" - // td.info = "short[][][]"; - // The first new statement generated is: - // a.value = new short[10][][]; - // Note that the 3 sets of brackets come from td.info, not - // arrayInfo; - // The second new statement generated is: - // a.value[_i1] = new short[10][]; - // ------------ ---- ------ - // \ \ \ - // name baseName arrayDcl - int closingBrackets = 0; - String loopIndex = ""; - String baseName; - try - { - baseName = (String)td.dynamicVariable (Compile.typedefInfo); - } - catch (NoSuchFieldException e) - { - baseName = td.name (); - } - int startArray = baseName.indexOf ('['); - String arrayDcl = Util.sansArrayInfo (baseName.substring (startArray)) + "[]"; // Add an extra set because the first gets stripped off in the loop. - baseName = baseName.substring (0, startArray); - - // For interfaces having state, e.g., valuetypes. - SymtabEntry baseEntry = (SymtabEntry)Util.symbolTable.get (baseName.replace ('.', '/')); - if (baseEntry instanceof InterfaceEntry && ((InterfaceEntry)baseEntry).state () != null) - // Remove -stateful feature; javaStatefulName() obsolete. - //baseName = Util.javaStatefulName ((InterfaceEntry)baseEntry); - baseName = Util.javaName ((InterfaceEntry)baseEntry); - - int end1stArray; - while (!modifier.equals ("")) - { - int rbracket = modifier.indexOf (']'); - String size = modifier.substring (1, rbracket); - end1stArray = arrayDcl.indexOf (']'); - arrayDcl = '[' + size + arrayDcl.substring (end1stArray + 2); - stream.println (indent + name + " = new " + baseName + arrayDcl + ';'); - loopIndex = "_o" + index++; - stream.println (indent + "for (int " + loopIndex + " = 0;" + loopIndex + " < (" + size + "); ++" + loopIndex + ')'); - stream.println (indent + '{'); - ++closingBrackets; - modifier = modifier.substring (rbracket + 1); - indent = indent + " "; - name = name + '[' + loopIndex + ']'; - } - end1stArray = arrayDcl.indexOf (']'); - if (td.type () instanceof SequenceEntry || td.type () instanceof PrimitiveEntry || td.type () instanceof StringEntry) - index = ((JavaGenerator)td.type ().generator ()).read (index, indent, name, td.type (), stream); - else if (td.type () instanceof InterfaceEntry && td.type ().fullName ().equals ("org/omg/CORBA/Object")) - stream.println (indent + name + " = istream.read_Object ();"); - else - stream.println (indent + name + " = " + Util.helperName (td.type (), true) + ".read (istream);"); // - for (int i = 0; i < closingBrackets; ++i) - { - indent = indent.substring (2); - stream.println (indent + '}'); - } - } - else - { - SymtabEntry tdtype = Util.typeOf (td.type ()); - if (tdtype instanceof SequenceEntry || tdtype instanceof PrimitiveEntry || tdtype instanceof StringEntry) - index = ((JavaGenerator)tdtype.generator ()).read (index, indent, name, tdtype, stream); - else if (tdtype instanceof InterfaceEntry && tdtype.fullName ().equals ("org/omg/CORBA/Object")) - stream.println (indent + name + " = istream.read_Object ();"); - else - stream.println (indent + name + " = " + Util.helperName (tdtype, true) + ".read (istream);"); // - } - return index; - } // read - - public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - TypedefEntry td = (TypedefEntry)entry; - String modifier = Util.arrayInfo (td.arrayInfo ()); - if (!modifier.equals ("")) - { - int closingBrackets = 0; - String loopIndex = ""; - while (!modifier.equals ("")) - { - int rbracket = modifier.indexOf (']'); - String size = modifier.substring (1, rbracket); - stream.println (indent + "if (" + name + ".length != (" + size + "))"); - stream.println (indent + " throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);"); - loopIndex = "_i" + index++; - stream.println (indent + "for (int " + loopIndex + " = 0;" + loopIndex + " < (" + size + "); ++" + loopIndex + ')'); - stream.println (indent + '{'); - ++closingBrackets; - modifier = modifier.substring (rbracket + 1); - indent = indent + " "; - name = name + '[' + loopIndex + ']'; - } - if (td.type () instanceof SequenceEntry || td.type () instanceof PrimitiveEntry || td.type () instanceof StringEntry) - index = ((JavaGenerator)td.type ().generator ()).write (index, indent, name, td.type (), stream); - else if (td.type () instanceof InterfaceEntry && td.type ().fullName ().equals ("org/omg/CORBA/Object")) - stream.println (indent + "ostream.write_Object (" + name + ");"); - else - stream.println (indent + Util.helperName (td.type (), true) + ".write (ostream, " + name + ");"); // - for (int i = 0; i < closingBrackets; ++i) - { - indent = indent.substring (2); - stream.println (indent + '}'); - } - } - else - { - SymtabEntry tdtype = Util.typeOf (td.type ()); - if (tdtype instanceof SequenceEntry || tdtype instanceof PrimitiveEntry || tdtype instanceof StringEntry) - index = ((JavaGenerator)tdtype.generator ()).write (index, indent, name, tdtype, stream); - else if (tdtype instanceof InterfaceEntry && tdtype.fullName ().equals ("org/omg/CORBA/Object")) - stream.println (indent + "ostream.write_Object (" + name + ");"); - else - stream.println (indent + Util.helperName (tdtype, true) + ".write (ostream, " + name + ");"); // - } - return index; - } // write - - // From JavaGenerator - //////////////// - - protected Hashtable symbolTable = null; - protected TypedefEntry t = null; -} // class TypedefGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/UnionGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/UnionGen.java deleted file mode 100644 index 89367e69ac2..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/UnionGen.java +++ /dev/null @@ -1,1074 +0,0 @@ -/* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: -// -cast() does not support longlong types yet. -// -Deal with typedef changes. -// -Scoped names for the discriminator are ignored at the moment. -// -F46082.51 Remove -stateful feature; javaStatefulName() obsolete. -// -D61056 Use Util.helperName - -import java.io.File; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Vector; - -import com.sun.tools.corba.se.idl.GenFileStream; -import com.sun.tools.corba.se.idl.ConstEntry; -import com.sun.tools.corba.se.idl.EnumEntry; -import com.sun.tools.corba.se.idl.InterfaceEntry; -import com.sun.tools.corba.se.idl.PrimitiveEntry; -import com.sun.tools.corba.se.idl.SequenceEntry; -import com.sun.tools.corba.se.idl.StringEntry; -import com.sun.tools.corba.se.idl.SymtabEntry; -import com.sun.tools.corba.se.idl.TypedefEntry; -import com.sun.tools.corba.se.idl.UnionBranch; -import com.sun.tools.corba.se.idl.UnionEntry; - -import com.sun.tools.corba.se.idl.constExpr.Expression; -import com.sun.tools.corba.se.idl.constExpr.EvaluationException; - -/** - * - **/ -public class UnionGen implements com.sun.tools.corba.se.idl.UnionGen, JavaGenerator -{ - /** - * Public zero-argument constructor. - **/ - public UnionGen () - { - } // ctor - - /** - * - **/ - public void generate (Hashtable symbolTable, UnionEntry u, PrintWriter s) - { - this.symbolTable = symbolTable; - this.u = u; - init (); - - openStream (); - if (stream == null) - return; - generateHelper (); - generateHolder (); - writeHeading (); - writeBody (); - writeClosing (); - closeStream (); - generateContainedTypes (); - } // generate - - /** - * Initialize members unique to this generator. - **/ - protected void init () - { - utype = Util.typeOf (u.type ()); - unionIsEnum = utype instanceof EnumEntry; - } // init - - /** - * - **/ - protected void openStream () - { - stream = Util.stream (u, ".java"); - } // openStream - - /** - * - **/ - protected void generateHelper () - { - ((Factories)Compile.compiler.factories ()).helper ().generate (symbolTable, u); - } // generateHelper - - /** - * - **/ - protected void generateHolder () - { - ((Factories)Compile.compiler.factories ()).holder ().generate (symbolTable, u); - } // generateHolder - - /** - * - **/ - protected void writeHeading () - { - // If the discriminator is an enum, assign the typePackage string. - if (unionIsEnum) - typePackage = Util.javaQualifiedName (utype) + '.'; - else - typePackage = ""; - - Util.writePackage (stream, u); - Util.writeProlog (stream, ((GenFileStream)stream).name ()); - - String className = u.name (); - stream.println ("public final class " + u.name () + " implements org.omg.CORBA.portable.IDLEntity"); - stream.println ("{"); - } // writeHeading - - /** - * - **/ - protected void writeBody () - { - // Write branches and populate quality arrays - int size = u.branches ().size () + 1; - Enumeration e = u.branches ().elements (); - int i = 0; - while (e.hasMoreElements ()) - { - UnionBranch branch = (UnionBranch)e.nextElement (); - Util.fillInfo (branch.typedef); - // Remove -stateful feature; javaStatefulName() obsolete. - //stream.println (" private " + Util.javaStatefulName (branch.typedef) + " ___" + branch.typedef.name () + ";"); - stream.println (" private " + Util.javaName (branch.typedef) + " ___" + branch.typedef.name () + ";"); - ++i; - } - stream.println (" private " + Util.javaName (utype) + " __discriminator;"); - stream.println (" private boolean __uninitialized = true;"); - - // Write ctor - stream.println (); - stream.println (" public " + u.name () + " ()"); - stream.println (" {"); - stream.println (" }"); - - // Write discriminator - stream.println (); - stream.println (" public " + Util.javaName (utype) + " " + safeName (u, "discriminator") + " ()"); - stream.println (" {"); - stream.println (" if (__uninitialized)"); - stream.println (" throw new org.omg.CORBA.BAD_OPERATION ();"); - stream.println (" return __discriminator;"); - stream.println (" }"); - - // Write for each branch: - // - setter - // - getter - // - private verifyXXX - e = u.branches ().elements (); - i = 0; - while (e.hasMoreElements ()) - { - UnionBranch branch = (UnionBranch)e.nextElement (); - writeBranchMethods (stream, u, branch, i++); - } - if (u.defaultBranch () == null && !coversAll (u)) - { - stream.println (); - stream.println (" public void _default ()"); - stream.println (" {"); - stream.println (" __discriminator = " + defaultDiscriminator (u) + ';'); - stream.println (" __uninitialized = false;"); - stream.println (" }"); - - stream.println (); - stream.println (" public void _default (" + Util.javaName(utype) + - " discriminator)"); - stream.println (" {"); - stream.println (" verifyDefault( discriminator ) ;" ); - stream.println (" __discriminator = discriminator ;"); - stream.println (" __uninitialized = false;"); - stream.println (" }"); - - writeVerifyDefault() ; - } - stream.println (); - } // writeBody - - /** - * - **/ - protected void writeClosing () - { - stream.println ("} // class " + u.name ()); - } // writeClosing - - /** - * - **/ - protected void closeStream () - { - stream.close (); - } // closeStream - - /** - * - **/ - protected void generateContainedTypes () - { - Enumeration e = u.contained ().elements (); - while (e.hasMoreElements ()) - { - SymtabEntry entry = (SymtabEntry)e.nextElement (); - - // Don't generate contained entries if they are sequences. - // Sequences are unnamed and since they translate to arrays, - // no classes are generated for them, not even holders in this - // case since they cannot be accessed outside of this union. - if (!(entry instanceof SequenceEntry)) - entry.generate (symbolTable, stream); - } - } // generateContainedTypes - - private void writeVerifyDefault() - { - Vector labels = vectorizeLabels (u.branches (), true); - - if (Util.javaName(utype).equals ("boolean")) { - stream.println( "" ) ; - stream.println( " private void verifyDefault (boolean discriminator)" ) ; - stream.println( " {" ) ; - if (labels.contains ("true")) - stream.println (" if ( discriminator )"); - else - stream.println (" if ( !discriminator )"); - stream.println( " throw new org.omg.CORBA.BAD_OPERATION();" ) ; - stream.println( " }" ) ; - return; - } - - stream.println( "" ) ; - stream.println( " private void verifyDefault( " + Util.javaName(utype) + - " value )" ) ; - stream.println( " {" ) ; - - if (unionIsEnum) - stream.println( " switch (value.value()) {" ) ; - else - stream.println( " switch (value) {" ) ; - - Enumeration e = labels.elements() ; - while (e.hasMoreElements()) { - String str = (String)(e.nextElement()) ; - stream.println( " case " + str + ":" ) ; - } - - stream.println( " throw new org.omg.CORBA.BAD_OPERATION() ;" ) ; - stream.println( "" ) ; - stream.println( " default:" ) ; - stream.println( " return;" ) ; - stream.println( " }" ) ; - stream.println( " }" ) ; - } - - private String defaultDiscriminator (UnionEntry u) - { - Vector labels = vectorizeLabels (u.branches (), false ); - String ret = null; - SymtabEntry utype = Util.typeOf (u.type ()); - if (utype instanceof PrimitiveEntry && utype.name ().equals ("boolean")) { - // If it got this far, then: - // - there is only one branch; - // - that branch has only one label. - if (labels.contains ("true")) - ret = "false"; - else - ret = "true"; - } else if (utype.name ().equals ("char")) { - // This doesn't handle '\u0030' == '0'. Unions are so - // seldom used. I don't have time to make this perfect. - int def = 0; - String string = "'\\u0000'"; - while (def != 0xFFFF && labels.contains (string)) - if (++def / 0x10 == 0) - string = "'\\u000" + def + "'"; - else if (def / 0x100 == 0) - string = "\\u00" + def + "'"; - else if (def / 0x1000 == 0) - string = "\\u0" + def + "'"; - else - string = "\\u" + def + "'"; - ret = string; - } else if (utype instanceof EnumEntry) { - Enumeration e = labels.elements (); - EnumEntry enumEntry = (EnumEntry)utype; - Vector enumList = (Vector)enumEntry.elements ().clone (); - // cull out those elements in the enumeration list that are - // in the cases of this union - while (e.hasMoreElements ()) - enumList.removeElement (e.nextElement ()); - // If all of the enum elements are covered in this union and - // there is a default statement, just pick one of the - // elements for the default. If there are enum elements - // which are NOT covered by the cases, pick one as the - // default. - if (enumList.size () == 0) - ret = typePackage + (String)enumEntry.elements ().lastElement (); - else - ret = typePackage + (String)enumList.firstElement (); - } else if (utype.name ().equals ("octet")) { - short def = Byte.MIN_VALUE; - while (def != Byte.MAX_VALUE && labels.contains (Integer.toString (def))) - ++def; - ret = Integer.toString (def); - } else if (utype.name ().equals ("short")) { - short def = Short.MIN_VALUE; - while (def != Short.MAX_VALUE && labels.contains (Integer.toString (def))) - ++def; - ret = Integer.toString (def); - } else if (utype.name ().equals ("long")) { - int def = Integer.MIN_VALUE; - while (def != Integer.MAX_VALUE && labels.contains (Integer.toString (def))) - ++def; - ret = Integer.toString (def); - } else if (utype.name ().equals ("long long")) { - long def = Long.MIN_VALUE; - while (def != Long.MAX_VALUE && labels.contains (Long.toString (def))) - ++def; - ret = Long.toString (def); - } else if (utype.name ().equals ("unsigned short")) { - short def = 0; - while (def != Short.MAX_VALUE && labels.contains (Integer.toString (def))) - ++def; - ret = Integer.toString (def); - } else if (utype.name ().equals ("unsigned long")) { - int def = 0; - while (def != Integer.MAX_VALUE && labels.contains (Integer.toString (def))) - ++def; - ret = Integer.toString (def); - } else if (utype.name ().equals ("unsigned long long")) { - long def = 0; - while (def != Long.MAX_VALUE && labels.contains (Long.toString (def))) - ++def; - ret = Long.toString (def); - } - - return ret; - } // defaultDiscriminator - - /** - * - **/ - private Vector vectorizeLabels (Vector branchVector, boolean useIntsForEnums ) - { - Vector mergedLabels = new Vector (); - Enumeration branches = branchVector.elements (); - while (branches.hasMoreElements ()) - { - UnionBranch branch = (UnionBranch)branches.nextElement (); - Enumeration labels = branch.labels.elements (); - while (labels.hasMoreElements ()) - { - Expression expr = (Expression)labels.nextElement (); - String str ; - - if (unionIsEnum) - if (useIntsForEnums) - str = typePackage + "_" + Util.parseExpression( expr ) ; - else - str = typePackage + Util.parseExpression( expr ) ; - else - str = Util.parseExpression( expr ) ; - - mergedLabels.addElement (str); - } - } - return mergedLabels; - } // vectorizeLabels - - /** - * - **/ - private String safeName (UnionEntry u, String name) - { - Enumeration e = u.branches ().elements (); - while (e.hasMoreElements ()) - if (((UnionBranch)e.nextElement ()).typedef.name ().equals (name)) - { - name = '_' + name; - break; - } - return name; - } // safeName - - /** - * - **/ - private boolean coversAll (UnionEntry u) - { - // This assumes that it is not possible to cover types other than - // boolean and enums. This is not quite correct, but since octet - // is not a valid discriminator type, it's not too bad in practice. - // It may also be possible to cover a char type, but we won't worry - // about that either. - SymtabEntry utype = Util.typeOf (u.type ()); - - boolean coversAll = false; - if (utype.name ().equals ("boolean")) { - if (u.branches ().size () == 2) - coversAll = true; - } else if (utype instanceof EnumEntry) { - Vector labels = vectorizeLabels (u.branches (), true); - if (labels.size () == ((EnumEntry)utype).elements ().size ()) - coversAll = true; - } - - return coversAll; - } // coversAll - - /** - * - **/ - private void writeBranchMethods (PrintWriter stream, UnionEntry u, UnionBranch branch, int i) - { - // Write getter - stream.println (); - // Remove -stateful feature; javaStatefulName() obsolete. - //stream.println (" public " + Util.javaStatefulName (branch.typedef) + " " + branch.typedef.name () + " ()"); - stream.println (" public " + Util.javaName (branch.typedef) + " " + branch.typedef.name () + " ()"); - stream.println (" {"); - stream.println (" if (__uninitialized)"); - stream.println (" throw new org.omg.CORBA.BAD_OPERATION ();"); - stream.println (" verify" + branch.typedef.name () + " (__discriminator);"); - stream.println (" return ___" + branch.typedef.name () + ";"); - stream.println (" }"); - - // Write setter(s) - stream.println (); - // Remove -stateful feature; javaStatefulName() obsolete. - //stream.println (" public void " + branch.typedef.name () + " (" + Util.javaStatefulName (branch.typedef) + " value)"); - stream.println (" public void " + branch.typedef.name () + " (" + Util.javaName (branch.typedef) + " value)"); - stream.println (" {"); - if (branch.labels.size () == 0) - { - // This is a default branch - stream.println (" __discriminator = " + defaultDiscriminator (u) + ";"); - } - else - { - // This is a non-default branch - if (unionIsEnum) - stream.println (" __discriminator = " + typePackage + Util.parseExpression ((Expression)branch.labels.firstElement ()) + ";"); - else - stream.println (" __discriminator = " + cast ((Expression)branch.labels.firstElement (), u.type ()) + ";"); - } - stream.println (" ___" + branch.typedef.name () + " = value;"); - stream.println (" __uninitialized = false;"); - stream.println (" }"); - - SymtabEntry utype = Util.typeOf (u.type ()); - - // If there are multiple labels for one branch, write the - // setter that takes a discriminator. - if (branch.labels.size () > 0 || branch.isDefault) - { - stream.println (); - // Remove -stateful feature; javaStatefulName() obsolete. - //stream.println (" public void " + branch.typedef.name () + " (" + Util.javaName (utype) + " discriminator, " + Util.javaStatefulName (branch.typedef) + " value)"); - stream.println (" public void " + branch.typedef.name () + " (" + Util.javaName (utype) + " discriminator, " + Util.javaName (branch.typedef) + " value)"); - stream.println (" {"); - stream.println (" verify" + branch.typedef.name () + " (discriminator);"); - stream.println (" __discriminator = discriminator;"); - stream.println (" ___" + branch.typedef.name () + " = value;"); - stream.println (" __uninitialized = false;"); - stream.println (" }"); - } - - // Write verifyXXX - stream.println (); - stream.println (" private void verify" + branch.typedef.name () + " (" + Util.javaName (utype) + " discriminator)"); - stream.println (" {"); - - boolean onlyOne = true; - - if (branch.isDefault && u.branches ().size () == 1) - ;// If all that is in this union is a default branch, - // all discriminators are legal. Don't print any - // body to this method in that case. - else - { - // Otherwise this code is executed and a body is printed. - stream.print (" if ("); - if (branch.isDefault) - { - Enumeration eBranches = u.branches ().elements (); - while (eBranches.hasMoreElements ()) - { - UnionBranch b = (UnionBranch)eBranches.nextElement (); - if (b != branch) - { - Enumeration eLabels = b.labels.elements (); - while (eLabels.hasMoreElements ()) - { - Expression label = (Expression)eLabels.nextElement (); - if (!onlyOne) - stream.print (" || "); - if (unionIsEnum) - stream.print ("discriminator == " + typePackage + Util.parseExpression (label)); - else - stream.print ("discriminator == " + Util.parseExpression (label)); - onlyOne = false; - } - } - } - } - else - { - Enumeration e = branch.labels.elements (); - while (e.hasMoreElements ()) - { - Expression label = (Expression)e.nextElement (); - if (!onlyOne) - stream.print (" && "); - if (unionIsEnum) - stream.print ("discriminator != " + typePackage + Util.parseExpression (label)); - else - stream.print ("discriminator != " + Util.parseExpression (label)); - onlyOne = false; - } - } - stream.println (")"); - stream.println (" throw new org.omg.CORBA.BAD_OPERATION ();"); - } - stream.println (" }"); - } // writeBranchMethods - - /////////////// - // From JavaGenerator - - /** - * - **/ - - // Computes the total number of labels in the union, which is the sum - // of the number of labels in each branch of the union. Note that the - // label for the default branch has size 0, but still counts in the total - // size. - private int unionLabelSize( UnionEntry un ) - { - int size = 0 ; - Vector branches = un.branches() ; - for (int i = 0; i < branches.size (); ++i) { - UnionBranch branch = (UnionBranch)(branches.get(i)) ; - int branchSize = branch.labels.size() ; - size += ((branchSize == 0) ? 1 : branchSize) ; - } - return size ; - } - - public int helperType (int index, String indent, TCOffsets tcoffsets, - String name, SymtabEntry entry, PrintWriter stream) - { - TCOffsets innerOffsets = new TCOffsets (); - UnionEntry u = (UnionEntry)entry; - String discTypeCode = "_disTypeCode" + index; - String membersName = "_members" + index; - - // Build discriminator tc - stream.println (indent + "org.omg.CORBA.TypeCode " + discTypeCode + ';'); - index = ((JavaGenerator)u.type ().generator ()).type (index + 1, indent, - innerOffsets, discTypeCode, u.type (), stream); - tcoffsets.bumpCurrentOffset (innerOffsets.currentOffset ()); - - stream.println (indent + "org.omg.CORBA.UnionMember[] " + membersName + - " = new org.omg.CORBA.UnionMember [" + unionLabelSize(u) + "];"); - String tcOfMembers = "_tcOf" + membersName; - String anyOfMembers = "_anyOf" + membersName; - stream.println (indent + "org.omg.CORBA.TypeCode " + tcOfMembers + ';'); - stream.println (indent + "org.omg.CORBA.Any " + anyOfMembers + ';'); - - innerOffsets = new TCOffsets (); - innerOffsets.set (entry); - int offsetForUnion = innerOffsets.currentOffset (); - for (int i = 0; i < u.branches ().size (); ++i) { - UnionBranch branch = (UnionBranch)u.branches ().elementAt (i); - TypedefEntry member = branch.typedef; - Vector labels = branch.labels; - String memberName = Util.stripLeadingUnderscores (member.name ()); - - if (labels.size() == 0) { - stream.println (); - stream.println (indent + "// Branch for " + memberName + - " (Default case)" ); - SymtabEntry utype = Util.typeOf (u.type ()); - stream.println (indent + anyOfMembers + " = org.omg.CORBA.ORB.init ().create_any ();"); - // For default member, label is the zero octet (per CORBA spec.) - stream.println (indent + anyOfMembers + ".insert_octet ((byte)0); // default member label"); - - // Build typecode - innerOffsets.bumpCurrentOffset (4); // label value - index = ((JavaGenerator)member.generator ()).type (index, indent, innerOffsets, tcOfMembers, member, stream); - int offsetSoFar = innerOffsets.currentOffset (); - innerOffsets = new TCOffsets (); - innerOffsets.set (entry); - innerOffsets.bumpCurrentOffset (offsetSoFar - offsetForUnion); - - // Build union member - stream.println (indent + membersName + '[' + i + "] = new org.omg.CORBA.UnionMember ("); - stream.println (indent + " \"" + memberName + "\","); - stream.println (indent + " " + anyOfMembers + ','); - stream.println (indent + " " + tcOfMembers + ','); - stream.println (indent + " null);"); - } else { - Enumeration enumeration = labels.elements() ; - while (enumeration.hasMoreElements()) { - Expression expr = (Expression)(enumeration.nextElement()) ; - String elem = Util.parseExpression( expr ) ; - - stream.println (); - stream.println (indent + "// Branch for " + memberName + - " (case label " + elem + ")" ); - - SymtabEntry utype = Util.typeOf (u.type ()); - - // Build any - stream.println (indent + anyOfMembers + " = org.omg.CORBA.ORB.init ().create_any ();"); - - if (utype instanceof PrimitiveEntry) - stream.println (indent + anyOfMembers + ".insert_" + - Util.collapseName (utype.name ()) + " ((" + Util.javaName (utype) + - ')' + elem + ");"); - else { // it must be enum - String enumClass = Util.javaName (utype); - stream.println (indent + Util.helperName (utype, false) + ".insert (" + - anyOfMembers + ", " + enumClass + '.' + elem + ");"); // - } - - // Build typecode - innerOffsets.bumpCurrentOffset (4); // label value - index = ((JavaGenerator)member.generator ()).type (index, indent, innerOffsets, tcOfMembers, member, stream); - int offsetSoFar = innerOffsets.currentOffset (); - innerOffsets = new TCOffsets (); - innerOffsets.set (entry); - innerOffsets.bumpCurrentOffset (offsetSoFar - offsetForUnion); - - // Build union member - stream.println (indent + membersName + '[' + i + "] = new org.omg.CORBA.UnionMember ("); - stream.println (indent + " \"" + memberName + "\","); - stream.println (indent + " " + anyOfMembers + ','); - stream.println (indent + " " + tcOfMembers + ','); - stream.println (indent + " null);"); - } - } - } - - tcoffsets.bumpCurrentOffset (innerOffsets.currentOffset ()); - - // Build create_union_tc - stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_union_tc (" + - Util.helperName (u, true) + ".id (), \"" + entry.name () + "\", " + - discTypeCode + ", " + membersName + ");"); - return index; - } // helperType - - public int type (int index, String indent, TCOffsets tcoffsets, String name, - SymtabEntry entry, PrintWriter stream) - { - stream.println (indent + name + " = " + Util.helperName (entry, true) + ".type ();"); - return index; - } - - public void helperRead (String entryName, SymtabEntry entry, PrintWriter stream) - { - stream.println (" " + entryName + " value = new " + entryName + " ();"); - read (0, " ", "value", entry, stream); - stream.println (" return value;"); - } - - public void helperWrite (SymtabEntry entry, PrintWriter stream) - { - write (0, " ", "value", entry, stream); - } - - public int read (int index, String indent, String name, - SymtabEntry entry, PrintWriter stream) - { - UnionEntry u = (UnionEntry)entry; - String disName = "_dis" + index++; - SymtabEntry utype = Util.typeOf (u.type ()); - Util.writeInitializer (indent, disName, "", utype, stream); - - if (utype instanceof PrimitiveEntry) - index = ((JavaGenerator)utype.generator ()).read (index, indent, disName, utype, stream); - else - stream.println (indent + disName + " = " + Util.helperName (utype, true) + ".read (istream);"); - - if (utype.name ().equals ("boolean")) - index = readBoolean (disName, index, indent, name, u, stream); - else - index = readNonBoolean (disName, index, indent, name, u, stream); - - return index; - } - - private int readBoolean (String disName, int index, String indent, - String name, UnionEntry u, PrintWriter stream) - { - UnionBranch firstBranch = (UnionBranch)u.branches ().firstElement (); - UnionBranch secondBranch; - - if (u.branches ().size () == 2) - secondBranch = (UnionBranch)u.branches ().lastElement (); - else - secondBranch = null; - - boolean firstBranchIsTrue = false; - boolean noCases = false; - try { - if (u.branches ().size () == 1 && - (u.defaultBranch () != null || firstBranch.labels.size () == 2)) { - noCases = true; - } else { - Expression expr = (Expression)(firstBranch.labels.firstElement()) ; - Boolean bool = (Boolean)(expr.evaluate()) ; - firstBranchIsTrue = bool.booleanValue (); - } - } catch (EvaluationException ex) { - // no action - } - - if (noCases) { - // There is only a default label. Since there are no cases, - // there is no need for if...else branches. - index = readBranch (index, indent, firstBranch.typedef.name (), "", firstBranch.typedef, stream); - } else { - // If first branch is false, swap branches - if (!firstBranchIsTrue) { - UnionBranch tmp = firstBranch; - firstBranch = secondBranch; - secondBranch = tmp; - } - - stream.println (indent + "if (" + disName + ')'); - - if (firstBranch == null) - stream.println (indent + " value._default(" + disName + ");"); - else { - stream.println (indent + '{'); - index = readBranch (index, indent + " ", firstBranch.typedef.name (), - disName, firstBranch.typedef, stream); - stream.println (indent + '}'); - } - - stream.println (indent + "else"); - - if (secondBranch == null) - stream.println (indent + " value._default(" + disName + ");"); - else { - stream.println (indent + '{'); - index = readBranch (index, indent + " ", secondBranch.typedef.name (), - disName, secondBranch.typedef, stream); - stream.println (indent + '}'); - } - } - - return index; - } - - private int readNonBoolean (String disName, int index, String indent, - String name, UnionEntry u, PrintWriter stream) - { - SymtabEntry utype = Util.typeOf (u.type ()); - - if (utype instanceof EnumEntry) - stream.println (indent + "switch (" + disName + ".value ())"); - else - stream.println (indent + "switch (" + disName + ')'); - - stream.println (indent + '{'); - String typePackage = Util.javaQualifiedName (utype) + '.'; - - Enumeration e = u.branches ().elements (); - while (e.hasMoreElements ()) { - UnionBranch branch = (UnionBranch)e.nextElement (); - Enumeration labels = branch.labels.elements (); - - while (labels.hasMoreElements ()) { - Expression label = (Expression)labels.nextElement (); - - if (utype instanceof EnumEntry) { - String key = Util.parseExpression (label); - stream.println (indent + " case " + typePackage + '_' + key + ':'); - } else - stream.println (indent + " case " + cast (label, utype) + ':'); - } - - if (!branch.typedef.equals (u.defaultBranch ())) { - index = readBranch (index, indent + " ", branch.typedef.name (), - branch.labels.size() > 1 ? disName : "" , - branch.typedef, stream); - stream.println (indent + " break;"); - } - } - - // We need a default branch unless all of the case of the discriminator type - // are listed in the case branches. - if (!coversAll(u)) { - stream.println( indent + " default:") ; - - if (u.defaultBranch () == null) { - // If the union does not have a default branch, we still need to initialize - // the discriminator. - stream.println( indent + " value._default( " + disName + " ) ;" ) ; - } else { - index = readBranch (index, indent + " ", u.defaultBranch ().name (), disName, - u.defaultBranch (), stream); - } - - stream.println (indent + " break;"); - } - - stream.println (indent + '}'); - - return index; - } - - private int readBranch (int index, String indent, String name, String disName, TypedefEntry entry, PrintWriter stream) - { - SymtabEntry type = entry.type (); - Util.writeInitializer (indent, '_' + name, "", entry, stream); - - if (!entry.arrayInfo ().isEmpty () || - type instanceof SequenceEntry || - type instanceof PrimitiveEntry || - type instanceof StringEntry) { - index = ((JavaGenerator)entry.generator ()).read (index, indent, '_' + name, entry, stream); - } else { - stream.println (indent + '_' + name + " = " + Util.helperName (type, true) + ".read (istream);"); - } - - stream.print (indent + "value." + name + " ("); - if( disName == "" ) - stream.println("_" + name + ");"); - else - stream.println(disName + ", " + "_" + name + ");"); - - return index; - } - - /** - * - **/ - public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - UnionEntry u = (UnionEntry)entry; - SymtabEntry utype = Util.typeOf (u.type ()); - if (utype instanceof PrimitiveEntry) - index = ((JavaGenerator)utype.generator ()).write (index, indent, name + ".discriminator ()", utype, stream); - else - stream.println (indent + Util.helperName (utype, true) + ".write (ostream, " + name + ".discriminator ());"); // - if (utype.name ().equals ("boolean")) - index = writeBoolean (name + ".discriminator ()", index, indent, name, u, stream); - else - index = writeNonBoolean (name + ".discriminator ()", index, indent, name, u, stream); - return index; - } // write - - /** - * - **/ - private int writeBoolean (String disName, int index, String indent, String name, UnionEntry u, PrintWriter stream) - { - SymtabEntry utype = Util.typeOf (u.type ()); - UnionBranch firstBranch = (UnionBranch)u.branches ().firstElement (); - UnionBranch secondBranch; - if (u.branches ().size () == 2) - secondBranch = (UnionBranch)u.branches ().lastElement (); - else - secondBranch = null; - boolean firstBranchIsTrue = false; - boolean noCases = false; - try - { - if (u.branches ().size () == 1 && (u.defaultBranch () != null || firstBranch.labels.size () == 2)) - noCases = true; - else - firstBranchIsTrue = ((Boolean)((Expression)firstBranch.labels.firstElement ()).evaluate ()).booleanValue (); - } - catch (EvaluationException ex) - {} - - if (noCases) - { - // There is only a default label. Since there are no cases, - // there is no need for if...else branches. - index = writeBranch (index, indent, name, firstBranch.typedef, stream); - } - else - { - // If first branch is false, swap branches - if (!firstBranchIsTrue) - { - UnionBranch tmp = firstBranch; - firstBranch = secondBranch; - secondBranch = tmp; - } - if (firstBranch != null && secondBranch != null) { - stream.println (indent + "if (" + disName + ')'); - stream.println (indent + '{'); - index = writeBranch (index, indent + " ", name, firstBranch.typedef, stream); - stream.println (indent + '}'); - stream.println (indent + "else"); - stream.println (indent + '{'); - index = writeBranch (index, indent + " ", name, secondBranch.typedef, stream); - stream.println (indent + '}'); - } else if (firstBranch != null) { - stream.println (indent + "if (" + disName + ')'); - stream.println (indent + '{'); - index = writeBranch (index, indent + " ", name, firstBranch.typedef, stream); - stream.println (indent + '}'); - } else { - stream.println (indent + "if (!" + disName + ')'); - stream.println (indent + '{'); - index = writeBranch (index, indent + " ", name, secondBranch.typedef, stream); - stream.println (indent + '}'); - } - } - return index; - } // writeBoolean - - /** - * - **/ - private int writeNonBoolean (String disName, int index, String indent, String name, UnionEntry u, PrintWriter stream) - { - SymtabEntry utype = Util.typeOf (u.type ()); - if (utype instanceof EnumEntry) - stream.println (indent + "switch (" + name + ".discriminator ().value ())"); - else - stream.println (indent + "switch (" + name + ".discriminator ())"); - stream.println (indent + "{"); - String typePackage = Util.javaQualifiedName (utype) + '.'; - Enumeration e = u.branches ().elements (); - while (e.hasMoreElements ()) - { - UnionBranch branch = (UnionBranch)e.nextElement (); - Enumeration labels = branch.labels.elements (); - while (labels.hasMoreElements ()) - { - Expression label = (Expression)labels.nextElement (); - if (utype instanceof EnumEntry) - { - String key = Util.parseExpression (label); - stream.println (indent + " case " + typePackage + '_' + key + ":"); - } - else - stream.println (indent + " case " + cast (label, utype) + ':'); - } - if (!branch.typedef.equals (u.defaultBranch ())) - { - index = writeBranch (index, indent + " ", name, branch.typedef, stream); - stream.println (indent + " break;"); - } - } - if (u.defaultBranch () != null) { - stream.println (indent + " default:"); - index = writeBranch (index, indent + " ", name, u.defaultBranch (), stream); - stream.println (indent + " break;"); - } - stream.println (indent + "}"); - return index; - } // writeNonBoolean - - /** - * - **/ - private int writeBranch (int index, String indent, String name, TypedefEntry entry, PrintWriter stream) - { - SymtabEntry type = entry.type (); - if (!entry.arrayInfo ().isEmpty () || type instanceof SequenceEntry || type instanceof PrimitiveEntry || type instanceof StringEntry) - index = ((JavaGenerator)entry.generator ()).write (index, indent, name + '.' + entry.name () + " ()", entry, stream); - else - stream.println (indent + Util.helperName (type, true) + ".write (ostream, " + name + '.' + entry.name () + " ());"); // - return index; - } // writeBranch - - // From JavaGenerator - /////////////// - - /** - * - **/ - private String cast (Expression expr, SymtabEntry type) - { - String ret = Util.parseExpression (expr); - if (type.name ().indexOf ("short") >= 0) - { - if (expr.value () instanceof Long) - { - long value = ((Long)expr.value ()).longValue (); - if (value > Short.MAX_VALUE) - ret = "(short)(" + ret + ')'; - } - else if (expr.value () instanceof Integer) - { - int value = ((Integer)expr.value ()).intValue (); - if (value > Short.MAX_VALUE) - ret = "(short)(" + ret + ')'; - } - } - else if (type.name ().indexOf ("long") >= 0) - { - if (expr.value () instanceof Long) - { - long value = ((Long)expr.value ()).longValue (); - // value == Integer.MIN_VALUE because if the number is - // Integer.MIN_VALUE, then it will have the 'L' suffix and - // the cast will be necessary. - if (value > Integer.MAX_VALUE || value == Integer.MIN_VALUE) - ret = "(int)(" + ret + ')'; - } - else if (expr.value () instanceof Integer) - { - int value = ((Integer)expr.value ()).intValue (); - // value == Integer.MIN_VALUE because if the number is - // Integer.MIN_VALUE, then it will have the 'L' suffix and - // the cast will be necessary. - if (value > Integer.MAX_VALUE || value == Integer.MIN_VALUE) - ret = "(int)(" + ret + ')'; - } - } - return ret; - } // cast - - protected Hashtable symbolTable = null; - protected UnionEntry u = null; - protected PrintWriter stream = null; - protected SymtabEntry utype = null; - protected boolean unionIsEnum; - protected String typePackage = ""; -} // class UnionGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Util.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Util.java deleted file mode 100644 index 7397619f2f2..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Util.java +++ /dev/null @@ -1,1429 +0,0 @@ -/* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// Notes: -// -F46838.4 Ported -td option from toJava. -// -10/17/98 KLR Ported fix for d48911 from toJava -// -10/18/98 KLR Ported fix from toJava for "unsigned long" constants -// -F46082.51 Removed code to collect makefile list generation inforamtion -// from getStream(); see f46830. -// -F46082.51 Removed -stateful feature: methods javaStatefulName(String) -// and javaStatefulName(SymtabEntry) are obsolete, supplanted by javaName(). -// -D54640 Represent unsigned long long expressions with their computed -// value rather than their actual representation (see notes in method -// parseTerminal(), parseBinary(), and parseUnary().) -// -D58319 Add getVersion() method. -// -D48034 Import Helper classes for typedef struct members when generating -// helper. See method addImportLines(). -// -D59851 Modify to enable QuickTest build. (pending) -// -D42256 Determine import lines for template types, which may specify any -// positive int., constant expression for a boundary. Such expression containing -// non-literal contansts previously caused problems when appearing in constructs -// structs, unions, exceptions, typedefs, operation types and parameters, -// attributes; and of course, sequences, strings. -// -D59063 Add helper for global exception to stub import list. -// -D58951 Publicise members for QuickTest. -// -D59421 Change ValueBaseHolder to SerializableHolder -// -D59596 Prevent accesses to elements of empty Vectors. -// -D59771 Add import stmt for Helper of global type in stubs. -// -D59355 Remove target dir. from filename when writing to prolog. -// -D59437 Fill typename information for value boxes. -// -D62023 Don't import ValueBase* -// -D62023 Add corbaLevel - -import java.io.File; -import java.io.PrintWriter; -import java.math.BigInteger; -import java.text.DateFormat; -import java.util.Date; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Locale; -import java.util.Vector; - -import com.sun.tools.corba.se.idl.ConstEntry; -import com.sun.tools.corba.se.idl.EnumEntry; -import com.sun.tools.corba.se.idl.ExceptionEntry; -import com.sun.tools.corba.se.idl.GenFileStream; -import com.sun.tools.corba.se.idl.InterfaceEntry; -import com.sun.tools.corba.se.idl.MethodEntry; -import com.sun.tools.corba.se.idl.NativeEntry; -import com.sun.tools.corba.se.idl.ParameterEntry; -import com.sun.tools.corba.se.idl.PrimitiveEntry; -import com.sun.tools.corba.se.idl.SequenceEntry; -import com.sun.tools.corba.se.idl.StringEntry; -import com.sun.tools.corba.se.idl.StructEntry; -import com.sun.tools.corba.se.idl.SymtabEntry; -import com.sun.tools.corba.se.idl.TypedefEntry; -import com.sun.tools.corba.se.idl.UnionBranch; -import com.sun.tools.corba.se.idl.UnionEntry; -import com.sun.tools.corba.se.idl.ValueEntry; -import com.sun.tools.corba.se.idl.ValueBoxEntry; -import com.sun.tools.corba.se.idl.InterfaceState; - -import com.sun.tools.corba.se.idl.constExpr.*; - -/** - * Class Util is a repository of static members available for general - * use by the IDL parser framework and any generator extensions. - **/ -public class Util extends com.sun.tools.corba.se.idl.Util -{ - // - /** - * Fetch the version number of this build of the IDL-to-Java (portable) - * compiler from the appropriate properties file. - * @return the version number of this compiler build. - **/ - public static String getVersion () - { - return com.sun.tools.corba.se.idl.Util.getVersion ("com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable.prp"); - } // getVersion - - /** - * This method is called by Setup.preEmit, so - * symbolTable is available for all Util methods. - **/ - static void setSymbolTable (Hashtable symtab) - { - symbolTable = symtab; - } // setSymbolTable - - public static void setPackageTranslation( Hashtable pkgtrans ) - { - packageTranslation = pkgtrans ; - } - - public static boolean isInterface (String name) - { - return isInterface (name, symbolTable); - } // isInterface - - static String arrayInfo (Vector arrayInfo) - { - int arrays = arrayInfo.size (); - String info = ""; - Enumeration e = arrayInfo.elements (); - while (e.hasMoreElements ()) - info = info + '[' + parseExpression ((Expression)e.nextElement ()) + ']'; - return info; - } // arrayInfo - - // static String sansArrayInfo (Vector arrayInfo) - public static String sansArrayInfo (Vector arrayInfo) - { - int arrays = arrayInfo.size (); - String brackets = ""; - for (int i = 0; i < arrays; ++i) - brackets = brackets + "[]"; - return brackets; - } // sansArrayInfo - - // static String sansArrayInfo (String name) - static public String sansArrayInfo (String name) - { - int index = name.indexOf ('['); - if (index >= 0) - { - String array = name.substring (index); - name = name.substring (0, index); - while (!array.equals ("")) - { - name = name + "[]"; - array = array.substring (array.indexOf (']') + 1); - } - } - return name; - } // sansArrayInfo - - /** - * Given a symbol table entry, return the name of - * the file which should be created. - **/ - public static String fileName (SymtabEntry entry, String extension ) - { - NameModifier nm = new NameModifierImpl() ; - return fileName( entry, nm, extension ) ; - } // fileName - - public static String fileName (SymtabEntry entry, NameModifier modifier, String extension ) - { - // This may not be the most appropriate place for - // the mkdir calls, but it's common to everything: - String pkg = containerFullName (entry.container ()); - if (pkg != null && !pkg.equals ("")) - mkdir (pkg); - - String name = entry.name (); - name = modifier.makeName( name ) + extension ; - if (pkg != null && !pkg.equals ("")) - name = pkg + '/' + name; - - return name.replace ('/', File.separatorChar); - } // fileName - - public static GenFileStream stream (SymtabEntry entry, String extension) - { - NameModifier nm = new NameModifierImpl() ; - return stream(entry, nm, extension); - } // stream - - public static GenFileStream stream (SymtabEntry entry, NameModifier modifier, String extension ) - { - return getStream ( fileName (entry,modifier,extension), entry ) ; - } - - public static GenFileStream getStream (String name, SymtabEntry entry) - { - // - String absPathName = ((Arguments)Compile.compiler.arguments).targetDir + name; - if (Compile.compiler.arguments.keepOldFiles && new File (absPathName).exists ()) - return null; - else - // Write the data to the file stream - return new GenFileStream (absPathName); - } // getStream - - public static String containerFullName( SymtabEntry container) - { - String name = doContainerFullName( container ) ; - if (packageTranslation.size() > 0) - name = translate( name ) ; - return name ; - } - - public static String translate( String name ) - { - String head = name ; - String tail = "" ; - int index ; - String trname ; - - // Check for package name translations, starting with the - // most specific match. - do { - trname = (String)(packageTranslation.get( head )) ; - if (trname != null) - return trname + tail ; - - index = head.lastIndexOf( '/' ) ; - if (index >= 0) { - tail = head.substring( index ) + tail ; - head = head.substring( 0, index ) ; - } - } while (index >= 0) ; - - return name ; - } - - private static String doContainerFullName (SymtabEntry container) - { - String name = ""; - - if (container == null) - name = ""; - else - { - if (container instanceof InterfaceEntry || - container instanceof StructEntry || - container instanceof UnionEntry) - name = container.name () + "Package"; - else - name = container.name (); - - if (container.container () != null && - !container.container ().name ().equals ("")) - name = doContainerFullName (container.container ()) + '/' + name; - } - - return name; - } // doContainerFullName - - /** - * Given a SymtabEntry, return the string which should be used - * for this entry. Enums are converted to ints, typedefs and - * sequences are converted to their info types. javaQualifiedName - * does not do any of these conversions. - **/ - public static String javaName (SymtabEntry entry) - { - // First get the real name of this type - String name = ""; - if (entry instanceof TypedefEntry || entry instanceof SequenceEntry) - try - { - name = sansArrayInfo ((String)entry.dynamicVariable (Compile.typedefInfo)); - } - catch (NoSuchFieldException e) - { - name = entry.name (); - } - else if (entry instanceof PrimitiveEntry) - name = javaPrimName (entry.name ()); - else if (entry instanceof StringEntry) - name = "String"; - else if (entry instanceof NativeEntry) - name = javaNativeName (entry.name()); - else if (entry instanceof ValueEntry && entry.name ().equals ("ValueBase")) - name = "java.io.Serializable"; - else if (entry instanceof ValueBoxEntry) - { - ValueBoxEntry v = (ValueBoxEntry) entry; - TypedefEntry member = ((InterfaceState) v.state ().elementAt (0)).entry; - SymtabEntry mType = member.type (); - if (mType instanceof PrimitiveEntry) - { - name = containerFullName (entry.container ()); - if (!name.equals ("")) - name = name + '.'; - name = name + entry.name (); - } - else - name = javaName (mType); - } - else - { - name = containerFullName (entry.container ()); - if (name.equals ("")) - name = entry.name (); - else - name = name + '.' + entry.name (); - } - - // Make it a fully package-qualified name - return name.replace ('/', '.'); - } // javaName - - public static String javaPrimName (String name) - { - if (name.equals ("long") || name.equals ("unsigned long")) - name = "int"; - else if (name.equals ("octet")) - name = "byte"; - // "unisigned long long" exceeds Java long. - else if (name.equals ("long long") || name.equals ("unsigned long long")) - name = "long"; - else if (name.equals ("wchar")) - name = "char"; - else if (name.equals ("unsigned short")) - name = "short"; - else if (name.equals ("any")) - name = "org.omg.CORBA.Any"; - else if (name.equals ("TypeCode")) - name = "org.omg.CORBA.TypeCode"; - else if (name.equals ("Principal")) // - name = "org.omg.CORBA.Principal"; - return name; - } // javaPrimName - - public static String javaNativeName (String name) - { - - // translations for Native declarations according to CORBA 2.3 spec - - if (name.equals ("AbstractBase") || name.equals ("Cookie")) - name = "java.lang.Object"; - else if (name.equals ("Servant")) - name = "org.omg.PortableServer.Servant"; - else if (name.equals ("ValueFactory")) - name = "org.omg.CORBA.portable.ValueFactory"; - return name; - } - - - /** - * Given a symtabEntry, return the name of this entry. This - * method does not do any conversions like javaName does. - **/ - public static String javaQualifiedName (SymtabEntry entry) - { - String name = ""; - if (entry instanceof PrimitiveEntry) - name = javaPrimName (entry.name ()); - else if (entry instanceof StringEntry) - name = "String"; - else if (entry instanceof ValueEntry && entry.name ().equals ("ValueBase")) - name = "java.io.Serializable"; - else - { - SymtabEntry container = entry.container (); - if (container != null) - name = container.name (); - if (name.equals ("")) - name = entry.name (); - else - name = containerFullName (entry.container ()) + '.' + entry.name (); - } - return name.replace ('/', '.'); - } // javaQualifiedName - - // Publicize for extensions. - //static String collapseName (String name) - - /** - * Collapse primitive type names. - **/ - public static String collapseName (String name) - { - if (name.equals ("unsigned short")) - name = "ushort"; - else if (name.equals ("unsigned long")) - name = "ulong"; - else if (name.equals ("unsigned long long")) - name = "ulonglong"; - else if (name.equals ("long long")) - name = "longlong"; - return name; - } // collapseName - - /** - * - **/ - public static SymtabEntry typeOf (SymtabEntry entry) - { - while (entry instanceof TypedefEntry && ((TypedefEntry)entry).arrayInfo ().isEmpty () && !(entry.type () instanceof SequenceEntry)) - entry = entry.type (); - return entry; - } // typeOf - - /** - * Fill the info field with the full name (with array info) of the type. - **/ - static void fillInfo (SymtabEntry infoEntry) - { - String arrayInfo = ""; - SymtabEntry entry = infoEntry; - boolean alreadyHave = false; - - do - { - try - { - alreadyHave = entry.dynamicVariable (Compile.typedefInfo) != null; - } - catch (NoSuchFieldException e) - {} - // If this entry's info has already been processed - // don't bother processing it again, just take it. - if (!alreadyHave) - { - if (entry instanceof TypedefEntry) - arrayInfo = arrayInfo + arrayInfo (((TypedefEntry)entry).arrayInfo ()); - else if (entry instanceof SequenceEntry) - { - Expression maxSize = ((SequenceEntry)entry).maxSize (); - if (maxSize == null) - arrayInfo = arrayInfo + "[]"; - else - arrayInfo = arrayInfo + '[' + parseExpression (maxSize) + ']'; - } - if (entry.type () == null) - { - // Suppress this message. It tells the developer nothing, and - // this path does not cause the algorithm to fail. Value boxes may - // contain anonymous types, like a struct or enum. - //System.err.println (getMessage ("PreEmit.indeterminateTypeInfo", entry.typeName ())); - } - else - entry = entry.type (); - } - } while (!alreadyHave && entry != null && - (entry instanceof TypedefEntry || entry instanceof SequenceEntry)); - // Value boxes may contain types lacking typename info., which - // causes the 2nd case, below, to fail with exception when retrieving the - // javaName(). - if (entry instanceof ValueBoxEntry) - fillValueBoxInfo ((ValueBoxEntry)entry); - try - { - if (alreadyHave) - infoEntry.dynamicVariable (Compile.typedefInfo, (String)entry.dynamicVariable (Compile.typedefInfo) + arrayInfo); - else - infoEntry.dynamicVariable (Compile.typedefInfo, javaName (entry) + arrayInfo); - } - catch (NoSuchFieldException e) - {} - } // fillInfo - - // - /** - * - **/ - static void fillValueBoxInfo (ValueBoxEntry vb) - { - SymtabEntry stateMember = (((InterfaceState) vb.state ().elementAt (0)).entry); - if (stateMember.type() != null) - Util.fillInfo (stateMember.type ()); - Util.fillInfo (stateMember); - } // fillValueBoxInfo - - /** - * - **/ - public static String holderName (SymtabEntry entry) - { - String name; - if (entry instanceof PrimitiveEntry) - if (entry.name ().equals ("any")) - name = "org.omg.CORBA.AnyHolder"; - else if (entry.name ().equals ("TypeCode")) - name = "org.omg.CORBA.TypeCodeHolder"; - else if (entry.name ().equals ("Principal")) // - name = "org.omg.CORBA.PrincipalHolder"; - else - name = "org.omg.CORBA." + capitalize (javaQualifiedName (entry)) + "Holder"; - else if (entry instanceof TypedefEntry) - { - TypedefEntry td = (TypedefEntry)entry; - if (!td.arrayInfo ().isEmpty () || td.type () instanceof SequenceEntry) - name = javaQualifiedName (entry) + "Holder"; - else - name = holderName (entry.type ()); - } - else if (entry instanceof StringEntry) - name = "org.omg.CORBA.StringHolder"; - else if (entry instanceof ValueEntry) - { - if (entry.name ().equals ("ValueBase")) - name = "org.omg.CORBA.ValueBaseHolder"; // , - else - name = javaName (entry) + "Holder"; - } else if (entry instanceof NativeEntry) { - // do not attach holder to the translation for Native Entries, e.g. - // for Cookie it should be CookieHolder instead of java.lang.ObjectHolder - // returns the complete name for the package, etc. - name = javaQualifiedName(entry) + "Holder"; - } - else - name = javaName (entry) + "Holder"; - return name; - } // holderName - - /** - * d61056 - **/ - public static String helperName (SymtabEntry entry, boolean qualifiedName) - { - if (entry instanceof ValueEntry) - if (entry.name ().equals ("ValueBase")) - return "org.omg.CORBA.ValueBaseHelper"; - - if (qualifiedName) - return javaQualifiedName (entry) + "Helper"; - else - return javaName (entry) + "Helper"; - } // helperName - - public static final short - TypeFile = 0, - StubFile = 1, - HelperFile = 2, - HolderFile = 3, - StateFile = 4; - - /** - * - **/ - public static void writePackage (PrintWriter stream, SymtabEntry entry) - { - writePackage (stream, entry, TypeFile); - } // writePackage - - /** - * - **/ - public static void writePackage (PrintWriter stream, SymtabEntry entry, String name, short type) - { - if (name != null && !name.equals ("")) - { - stream.println ("package " + name.replace ('/', '.') + ';'); - - // This type is in a module. Just in case it refers to types - // in the unnamed module, add an import statement for each of - // those types. - if (!Compile.compiler.importTypes.isEmpty ()) - { - stream.println (); - Vector v = addImportLines (entry, Compile.compiler.importTypes, type); - printImports (v, stream); - } - } - } // writePackage - - /** - * - **/ - public static void writePackage (PrintWriter stream, SymtabEntry entry, short type) - { - String fullName = containerFullName (entry.container ()); - if (fullName != null && !fullName.equals ("")) - { - stream.println ("package " + fullName.replace ('/', '.') + ';'); - // This type is in a module. Just in case it refers to types - // in the unnamed module, add an import statement for each of - // those types. - if ((type != HolderFile || entry instanceof TypedefEntry) && !Compile.compiler.importTypes.isEmpty ()) - { - stream.println (); - Vector v = addImportLines (entry, Compile.compiler.importTypes, type); - printImports (v, stream); - } - /* - Enumeration e = Compile.compiler.importTypes.elements (); - while (e.hasMoreElements ()) - { - SymtabEntry i = (SymtabEntry)e.nextElement (); - // Write import for type - if (!(i instanceof TypedefEntry)) - stream.println ("import " + i.name () + ';'); - - // Write import for Helper - if (!(i instanceof ConstEntry)) - stream.println ("import " + i.name () + "Helper;"); - - // Write import for Holder - if (!(i instanceof ConstEntry)) - if (!(i instanceof TypedefEntry) || (i.type () instanceof SequenceEntry || !((TypedefEntry)i).arrayInfo ().isEmpty ())) - stream.println ("import " + i.name () + "Holder;"); - } - */ - } - } // writePackage - - /** - * - **/ - static private void printImports (Vector importList, PrintWriter stream) - { - Enumeration e = importList.elements (); - while (e.hasMoreElements ()) - stream.println ("import " + (String)e.nextElement () + ';'); - } // printImport - - /** - * - **/ - static private void addTo (Vector importList, String name) - { - // REVISIT - was also importing ValueBaseHolder and Helper - if (name.startsWith ("ValueBase")) // don't import ValueBase* - if ((name.compareTo ("ValueBase") == 0) || - (name.compareTo ("ValueBaseHolder") == 0) || - (name.compareTo ("ValueBaseHelper") == 0)) - return; - if (!importList.contains (name)) - importList.addElement (name); - } // addTo - - /** - * - **/ - static private Vector addImportLines (SymtabEntry entry, Vector importTypes, short type) - { - Vector importList = new Vector (); - if (entry instanceof ConstEntry) - { - ConstEntry c = (ConstEntry)entry; - Object cvalue = c.value ().value (); - if (cvalue instanceof ConstEntry && importTypes.contains (cvalue)) - addTo (importList, ((ConstEntry)cvalue).name ()); - } - else if (entry instanceof ValueEntry && type == HelperFile) // - { - // This code inspired by ValueGen.getConcreteBaseTypeCode(). Helper method - // type() could be invoked against a global valuetype. - if (((ValueEntry)entry).derivedFrom ().size () > 0) // <59596> KLR HACK - { - ValueEntry base = (ValueEntry)((ValueEntry)entry).derivedFrom ().elementAt (0); - String baseName = base.name (); - if (!"ValueBase".equals (baseName)) - if (importTypes.contains (base)) - addTo (importList, baseName + "Helper"); - } - } - else if (entry instanceof InterfaceEntry && (type == TypeFile || type == StubFile)) - { - InterfaceEntry i = (InterfaceEntry)entry; - - if (i instanceof ValueEntry) // - { - // Examine interface parents in supports vector. - Enumeration e = ((ValueEntry)i).supports ().elements (); - while (e.hasMoreElements ()) - { - SymtabEntry parent = (SymtabEntry)e.nextElement (); - if (importTypes.contains (parent)) - { - addTo (importList, parent.name () + "Operations"); - } - // If this is a stub, then recurse to the parents - if (type == StubFile) - { - if (importTypes.contains (parent)) - addTo (importList, parent.name ()); - Vector subImportList = addImportLines (parent, importTypes, StubFile); - Enumeration en = subImportList.elements (); - while (en.hasMoreElements ()) - { - addTo (importList, (String)en.nextElement ()); - } - } - } - } - // Interface or valuetype -- Examine interface and valuetype parents, - // Look through derivedFrom vector - Enumeration e = i.derivedFrom ().elements (); - while (e.hasMoreElements ()) - { - SymtabEntry parent = (SymtabEntry)e.nextElement (); - if (importTypes.contains (parent)) - { - addTo (importList, parent.name ()); - // Always add both imports, even though superfluous. Cannot - // tell when writing Operations or Signature interface! - if (!(parent instanceof ValueEntry)) // && parent.name ().equals ("ValueBase"))) - addTo (importList, parent.name () + "Operations"); - } - // If this is a stub, then recurse to the parents - if (type == StubFile) - { - Vector subImportList = addImportLines (parent, importTypes, StubFile); - Enumeration en = subImportList.elements (); - while (en.hasMoreElements ()) - { - addTo (importList, (String)en.nextElement ()); - } - } - } - // Look through methods vector - e = i.methods ().elements (); - while (e.hasMoreElements ()) - { - MethodEntry m = (MethodEntry)e.nextElement (); - - // Look at method type - SymtabEntry mtype = typeOf (m.type ()); - if (mtype != null && importTypes.contains (mtype)) - if (type == TypeFile || type == StubFile) - { - addTo (importList, mtype.name ()); - addTo (importList, mtype.name () + "Holder"); - if (type == StubFile) - addTo (importList, mtype.name () + "Helper"); - } - checkForArrays (mtype, importTypes, importList); - // Print import lines for globals constants and constants - // within global interfaces. - if (type == StubFile) - checkForBounds (mtype, importTypes, importList); - - // Look through exceptions - Enumeration exEnum = m.exceptions ().elements (); - while (exEnum.hasMoreElements ()) - { - ExceptionEntry ex = (ExceptionEntry)exEnum.nextElement (); - if (importTypes.contains (ex)) - { - addTo (importList, ex.name ()); - addTo (importList, ex.name () + "Helper"); // - } - } - - // Look through parameters - Enumeration parms = m.parameters ().elements (); - while (parms.hasMoreElements ()) - { - ParameterEntry parm = (ParameterEntry)parms.nextElement (); - SymtabEntry parmType = typeOf (parm.type ()); - if (importTypes.contains (parmType)) - { - // Helper needed in stubs. - if (type == StubFile) - addTo (importList, parmType.name () + "Helper"); - if (parm.passType () == ParameterEntry.In) - addTo (importList, parmType.name ()); - else - addTo (importList, parmType.name () + "Holder"); - } - checkForArrays (parmType, importTypes, importList); - // - if (type == StubFile) - checkForBounds (parmType, importTypes, importList); - } - } - } - else if (entry instanceof StructEntry) - { - StructEntry s = (StructEntry)entry; - - // Look through the members - Enumeration members = s.members ().elements (); - while (members.hasMoreElements ()) - { - SymtabEntry member = (TypedefEntry)members.nextElement (); - // Need to add helper name for typedef members. This name - // is referenced at typecode generation in Helper class. - SymtabEntry memberType = member.type (); - member = typeOf (member); - if (importTypes.contains (member)) - { - // If this IS a typedef, then there are only Helper/Holder classes. - //if (!(member instanceof TypedefEntry)) - // Valueboxes - if (!(member instanceof TypedefEntry) && !(member instanceof ValueBoxEntry)) - addTo (importList, member.name ()); - // Add helper name of alias, too, if member is a typedef. - //if (type == HelperFile) - // addTo (importList, member.name () + "Helper"); - if (type == HelperFile) - { - addTo (importList, member.name () + "Helper"); - if (memberType instanceof TypedefEntry) - addTo (importList, memberType.name () + "Helper"); - } - } - checkForArrays (member, importTypes, importList); - checkForBounds (member, importTypes, importList); - } - } - else if (entry instanceof TypedefEntry) - { - TypedefEntry t = (TypedefEntry)entry; - String arrays = checkForArrayBase (t, importTypes, importList); - if (type == HelperFile) - { - checkForArrayDimensions (arrays, importTypes, importList); - try - { - String name = (String)t.dynamicVariable (Compile.typedefInfo); - int index = name.indexOf ('['); - if (index >= 0) - name = name.substring (0, index); - // See if the base type should be added to the list. - SymtabEntry typeEntry = (SymtabEntry)symbolTable.get (name); - if (typeEntry != null && importTypes.contains (typeEntry)) - addTo (importList, typeEntry.name () + "Helper"); - } - catch (NoSuchFieldException e) - {} - - // Typedefs for global bounded strings need import - // statement when bound expression contains non-literal constants. - checkForBounds (typeOf (t), importTypes, importList); - } - Vector subImportList = addImportLines (t.type (), importTypes, type); - Enumeration e = subImportList.elements (); - while (e.hasMoreElements ()) - addTo (importList, (String)e.nextElement ()); - } - else if (entry instanceof UnionEntry) - { - UnionEntry u = (UnionEntry)entry; - - // Look at the discriminant type - SymtabEntry utype = typeOf (u.type ()); - if (utype instanceof EnumEntry && importTypes.contains (utype)) - addTo (importList, utype.name ()); - - // Look through the branches - Enumeration branches = u.branches ().elements (); - while (branches.hasMoreElements ()) - { - UnionBranch branch = (UnionBranch)branches.nextElement (); - SymtabEntry branchEntry = typeOf (branch.typedef); - if (importTypes.contains (branchEntry)) - { - addTo (importList, branchEntry.name ()); - if (type == HelperFile) - addTo (importList, branchEntry.name () + "Helper"); - } - checkForArrays (branchEntry, importTypes, importList); - // - checkForBounds (branchEntry, importTypes, importList); - } - } - - // If a typedef is not a sequence or an array, only holders and - // helpers are generated for it. Remove references to such - // class names. - Enumeration en = importList.elements (); - while (en.hasMoreElements ()) - { - String name = (String)en.nextElement (); - SymtabEntry e = (SymtabEntry)symbolTable.get (name); - if (e != null && e instanceof TypedefEntry) - { - TypedefEntry t = (TypedefEntry)e; - if (t.arrayInfo ().size () == 0 || !(t.type () instanceof SequenceEntry)) - importList.removeElement (name); - } - } - return importList; - } // addImportLines - - /** - * - **/ - static private void checkForArrays (SymtabEntry entry, Vector importTypes, Vector importList) - { - if (entry instanceof TypedefEntry) - { - TypedefEntry t = (TypedefEntry)entry; - String arrays = checkForArrayBase (t, importTypes, importList); - checkForArrayDimensions (arrays, importTypes, importList); - } - } // checkForArrays - - /** - * - **/ - static private String checkForArrayBase (TypedefEntry t, Vector importTypes, Vector importList) - { - String arrays = ""; - try - { - String name = (String)t.dynamicVariable (Compile.typedefInfo); - int index = name.indexOf ('['); - if (index >= 0) - { - arrays = name.substring (index); - name = name.substring (0, index); - } - - // See if the base type should be added to the list. - SymtabEntry typeEntry = (SymtabEntry)symbolTable.get (name); - if (typeEntry != null && importTypes.contains (typeEntry)) - addTo (importList, typeEntry.name ()); - } - catch (NoSuchFieldException e) - {} - return arrays; - } // checkForArrayBase - - /** - * - **/ - static private void checkForArrayDimensions (String arrays, Vector importTypes, Vector importList) - { - // See if any of the arrays contain a constentry. - // If so, see if it should be added to the list. - while (!arrays.equals ("")) - { - int index = arrays.indexOf (']'); - String dim = arrays.substring (1, index); - arrays = arrays.substring (index + 1); - SymtabEntry constant = (SymtabEntry)symbolTable.get (dim); - if (constant == null) - { - // A constant expr could be of the form OR - // .. This if branch checks for that case. - int i = dim.lastIndexOf ('.'); - if (i >= 0) - constant = (SymtabEntry)symbolTable.get (dim.substring (0, i)); - } - if (constant != null && importTypes.contains (constant)) - addTo (importList, constant.name ()); - } - } // checkForArrayDimensions - - // Call the following method when its necessary to determine the - // the import types for IDL constructs containing arbitrary positive int. - // expressions, which may specify non-literal constants. - - /** - * Determine the import lines for template types. - **/ - static private void checkForBounds (SymtabEntry entry, Vector importTypes, Vector importList) - { - // Obtain actual type, just to be complete. - SymtabEntry entryType = entry; - while (entryType instanceof TypedefEntry) - entryType = entryType.type (); - - if (entryType instanceof StringEntry && ((StringEntry)entryType).maxSize () != null) - checkForGlobalConstants (((StringEntry)entryType).maxSize ().rep (), importTypes, importList); - else - if (entryType instanceof SequenceEntry && ((SequenceEntry)entryType).maxSize () != null) - checkForGlobalConstants (((SequenceEntry)entryType).maxSize ().rep (), importTypes, importList); - } // checkForBounds - - /** - * Extract the global constants from the supplied integer expression - * representation (string) and add them to the supplied import list. - **/ - static private void checkForGlobalConstants (String exprRep, Vector importTypes, Vector importList) - { - // NOTE: Do not use '/' as a delimiter. Symbol table names use '/' as a - // delimiter and would not be otherwise properly collected. Blanks and - // arithmetic symbols do not appear in tokens, except for '/'. - java.util.StringTokenizer st = new java.util.StringTokenizer (exprRep, " +-*()~&|^%<>"); - while (st.hasMoreTokens ()) - { - String token = st.nextToken (); - // When token contains '/', it represents the division symbol or - // a nested type (e.g., I/x). Ignore the division symbol, and don't - // forget constants declared within global interfaces! - if (!token.equals ("/")) - { - SymtabEntry typeEntry = (SymtabEntry)symbolTable.get (token); - if (typeEntry instanceof ConstEntry) - { - int slashIdx = token.indexOf ('/'); - if (slashIdx < 0) // Possible global constant - { - if (importTypes.contains (typeEntry)) - addTo (importList, typeEntry.name ()); - } - else // Possible constant in global interface - { - SymtabEntry constContainer = (SymtabEntry)symbolTable.get (token.substring (0, slashIdx)); - if (constContainer instanceof InterfaceEntry && importTypes.contains (constContainer)) - addTo (importList, constContainer.name ()); - } - } - } - } - } // checkForGlobalConstants - - /** - * - **/ - public static void writeInitializer (String indent, String name, String arrayDcl, SymtabEntry entry, PrintWriter stream) - { - if (entry instanceof TypedefEntry) - { - TypedefEntry td = (TypedefEntry)entry; - writeInitializer (indent, name, arrayDcl + sansArrayInfo (td.arrayInfo ()), td.type (), stream); - } - else if (entry instanceof SequenceEntry) - writeInitializer (indent, name, arrayDcl + "[]", entry.type (), stream); - else if (entry instanceof EnumEntry) - if (arrayDcl.length () > 0) - stream.println (indent + javaName (entry) + ' ' + name + arrayDcl + " = null;"); - else - stream.println (indent + javaName (entry) + ' ' + name + " = null;"); - else if (entry instanceof PrimitiveEntry) - { - boolean array = arrayDcl.length () > 0; - String tname = javaPrimName (entry.name ()); - if (tname.equals ("boolean")) - stream.println (indent + "boolean " + name + arrayDcl + " = " + (array ? "null;" : "false;")); - else if (tname.equals ("org.omg.CORBA.TypeCode")) - stream.println (indent + "org.omg.CORBA.TypeCode " + name + arrayDcl + " = null;"); - else if (tname.equals ("org.omg.CORBA.Any")) - stream.println (indent + "org.omg.CORBA.Any " + name + arrayDcl + " = null;"); - else if (tname.equals ("org.omg.CORBA.Principal")) // - stream.println (indent + "org.omg.CORBA.Principal " + name + arrayDcl + " = null;"); - else - stream.println (indent + tname + ' ' + name + arrayDcl + " = " + (array ? "null;" : '(' + tname + ")0;")); - } - // Remove -stateful feature. This case is identical to next one - // because javaName() supplants javaStatefulName(). - //else if (entry instanceof InterfaceEntry && ((InterfaceEntry)entry).state () != null) - // stream.println (indent + javaStatefulName ((InterfaceEntry)entry) + ' ' + name + arrayDcl + " = null;"); - else - stream.println (indent + javaName (entry) + ' ' + name + arrayDcl + " = null;"); - } // writeInitializer - - /** - * - **/ - public static void writeInitializer (String indent, String name, String arrayDcl, SymtabEntry entry, String initializer, PrintWriter stream) - { - if (entry instanceof TypedefEntry) - { - TypedefEntry td = (TypedefEntry)entry; - writeInitializer (indent, name, arrayDcl + sansArrayInfo (td.arrayInfo ()), td.type (), initializer, stream); - } - else if (entry instanceof SequenceEntry) - writeInitializer (indent, name, arrayDcl + "[]", entry.type (), initializer, stream); - else if (entry instanceof EnumEntry) - if (arrayDcl.length () > 0) - stream.println (indent + javaName (entry) + ' ' + name + arrayDcl + " = " + initializer + ';'); - else - stream.println (indent + javaName (entry) + ' ' + name + " = " + initializer + ';'); - else if (entry instanceof PrimitiveEntry) - { - boolean array = arrayDcl.length () > 0; - String tname = javaPrimName (entry.name ()); - if (tname.equals ("boolean")) - stream.println (indent + "boolean " + name + arrayDcl + " = " + initializer + ';'); - else if (tname.equals ("org.omg.CORBA.TypeCode")) - stream.println (indent + "org.omg.CORBA.TypeCode " + name + arrayDcl + " = " + initializer + ';'); - else if (tname.equals ("org.omg.CORBA.Any")) - stream.println (indent + "org.omg.CORBA.Any " + name + arrayDcl + " = " + initializer + ';'); - else if (tname.equals ("org.omg.CORBA.Principal")) // - stream.println (indent + "org.omg.CORBA.Principal " + name + arrayDcl + " = " + initializer + ';'); - else - stream.println (indent + tname + ' ' + name + arrayDcl + " = " + initializer + ';'); - } - // Remove -stateful feature. This case is identical to next one - // because javaName() supplants javaStatefulName(). - //else if (entry instanceof InterfaceEntry && ((InterfaceEntry)entry).state () != null) - // stream.println (indent + javaStatefulName ((InterfaceEntry)entry) + ' ' + name + arrayDcl + " = " + initializer + ';'); - else - stream.println (indent + javaName (entry) + ' ' + name + arrayDcl + " = " + initializer + ';'); - } // writeInitializer - - /** - * - **/ - public static void mkdir (String name) - { - String targetDir = ((Arguments)Compile.compiler.arguments).targetDir; // F46838.4 - name = (targetDir + name).replace ('/', File.separatorChar); // F46838.4 - File pkg = new File (name); - if (!pkg.exists ()) - if (!pkg.mkdirs ()) - System.err.println (getMessage ("Util.cantCreatePkg", name)); - } // mkdir - - /** - * - **/ - public static void writeProlog (PrintWriter stream, String filename) - { - // Remove target directory - String targetDir = ((Arguments)Compile.compiler.arguments).targetDir; - if (targetDir != null) - filename = filename.substring (targetDir.length ()); - stream.println (); - stream.println ("/**"); - stream.println ("* " + filename.replace (File.separatorChar, '/') + - " ."); - stream.println ("* " + Util.getMessage ("toJavaProlog1", - Util.getMessage ("Version.product", Util.getMessage ("Version.number")))); - // Do not introduce invalid escape characters into comment! - //stream.println ("* " + Util.getMessage ("toJavaProlog2", Compile.compiler.arguments.file)); - stream.println ("* " + Util.getMessage ("toJavaProlog2", Compile.compiler.arguments.file.replace (File.separatorChar, '/'))); - - /////////////// - // This SHOULD work, but there's a bug in the JDK. - // stream.println ("* " + DateFormat.getDateTimeInstance (DateFormat.FULL, DateFormat.FULL, Locale.getDefault ()).format (new Date ())); - // This gets around the bug: - - DateFormat formatter = DateFormat.getDateTimeInstance (DateFormat.FULL, DateFormat.FULL, Locale.getDefault ()); - - // Japanese-specific workaround. JDK bug 4069784 being repaired by JavaSoft. - // Keep this transient solution until bug fix is reported.cd . - - if (Locale.getDefault () == Locale.JAPAN) - formatter.setTimeZone (java.util.TimeZone.getTimeZone ("JST")); - else - formatter.setTimeZone (java.util.TimeZone.getDefault ()); - - stream.println ("* " + formatter.format (new Date ())); - - // - /////////////// - - stream.println ("*/"); - stream.println (); - } // writeProlog - - // keywords ending in Holder or Helper or Package have '_' prepended. - // These prepended underscores must not be part of anything sent - // across the wire, so these two methods are provided to strip them - // off. - - /** - * - **/ - public static String stripLeadingUnderscores (String string) - { - while (string.startsWith ("_")) - string = string.substring (1); - return string; - } // stripLeadingUnderscores - - /** - * - **/ - public static String stripLeadingUnderscoresFromID (String string) - { - String stringPrefix = ""; - int slashIndex = string.indexOf (':'); - if (slashIndex >= 0) - do - { - stringPrefix = stringPrefix + string.substring (0, slashIndex + 1); - string = string.substring (slashIndex + 1); - while (string.startsWith ("_")) - string = string.substring (1); - slashIndex = string.indexOf ('/'); - } while (slashIndex >= 0); - return stringPrefix + string; - } // stripLeadingUnderscoresFromID - - /** - * - **/ - public static String parseExpression (Expression e) - { - if (e instanceof Terminal) - return parseTerminal ((Terminal)e); - else if (e instanceof BinaryExpr) - return parseBinary ((BinaryExpr)e); - else if (e instanceof UnaryExpr) - return parseUnary ((UnaryExpr)e); - else - return "(UNKNOWN_VALUE)"; // This shouldn't happen unless someone slips - // in another type of expression. - } // parseExpression - - /** - * - **/ - static String parseTerminal (Terminal e) - { - if (e.value () instanceof ConstEntry) - { - ConstEntry c = (ConstEntry)e.value (); - if (c.container () instanceof InterfaceEntry) - return javaQualifiedName (c.container ()) + '.' + c.name (); - else - return javaQualifiedName (c) + ".value"; - } - else if (e.value () instanceof Expression) - return '(' + parseExpression ((Expression)e.value ()) + ')'; - else if (e.value () instanceof Character) - { - if (((Character)e.value ()).charValue () == '\013') - // e.rep is \v. \v for vertical tab is meaningless in Java. - return "'\\013'"; - else if (((Character)e.value ()).charValue () == '\007') - // e.rep is \a. \a for alert is meaningless in Java. - return "'\\007'"; - else if (e.rep ().startsWith ("'\\x")) - return hexToOctal (e.rep ()); - else if (e.rep ().equals ("'\\?'")) - return "'?'"; - else - return e.rep (); - } - else if (e.value () instanceof Boolean) - return e.value ().toString (); - - // If value is type "unsigned long long" (ull) and its magnitude - // is greater than the maximal Java long (i.e., IDL long long) value, then - // return its signed representation rather than its actual representation. - /* - // Support long long - //else if (e.value () instanceof Long) - else if (e.value () instanceof BigInteger && - (e.type ().indexOf ("long long") >= 0 || e.type ().equals ("unsigned long"))) // - { - String rep = e.rep (); - int index = rep.indexOf (')'); - if (index < 0) - return rep + 'L'; - else - return rep.substring (0, index) + 'L' + rep.substring (index); - } - */ - else if (e.value () instanceof BigInteger) - { - // Get the correct primitive type. Since integer types (octet, short, - // long, long long, unsigned short, unsigned long, unsigned long long) - // could be aliased (typedef'ed) to any arbitrary levels, the code - // below walks up the alias chain to get to the primitive type. - - // Get the symbol table entry corresponding to the 'type'. - SymtabEntry typeEntry = (SymtabEntry) symbolTable.get(e.type()); - - // Get to the primitive type. - while (typeEntry.type() != null) { - typeEntry = typeEntry.type(); - } - String type = typeEntry.name(); - - if (type.equals("unsigned long long") && - ((BigInteger)e.value ()).compareTo (Expression.llMax) > 0) // value > long long Max? - { - // Convert to signed value, which will always be negative. - BigInteger v = (BigInteger)e.value (); - v = v.subtract (Expression.twoPow64); - int index = e.rep ().indexOf (')'); - if (index < 0) - return v.toString () + 'L'; - else - return '(' + v.toString () + 'L' + ')'; - } - else if ( type.indexOf("long long") >= 0 || type.equals("unsigned long") ) - { - String rep = e.rep (); - int index = rep.indexOf (')'); - if (index < 0) - return rep + 'L'; - else - return rep.substring (0, index) + 'L' + rep.substring (index); - } - else - return e.rep (); - } // end - else - return e.rep (); - } // parseTerminal - - /** - * - **/ - static String hexToOctal (String hex) - { - // The format of hex is '/xXX' where XX is one or two hex digits. - // This statement pulls off XX. - hex = hex.substring (3, hex.length () - 1); - return "'\\" + Integer.toString (Integer.parseInt (hex, 16), 8) + "'"; - } // hexToOctal - - /** - * - **/ - static String parseBinary (BinaryExpr e) - { - String castString = ""; - if (e.value () instanceof Float || e.value () instanceof Double) - { - castString = "(double)"; - if (!(e instanceof Plus || e instanceof Minus || - e instanceof Times || e instanceof Divide)) - System.err.println ("Operator " + e.op () + " is invalid on floating point numbers"); - } - else if (e.value () instanceof Number) - { - if (e.type (). indexOf ("long long") >= 0) - castString = "(long)"; - else - castString = "(int)"; - } - else - { - castString = ""; - System.err.println ("Unknown type in constant expression"); - } - - // Must emit value rather than representation when type "unsigned - // long long" (ull) because emitted binary arithmetic expressions containing - // ull's converted to long (i.e., IDL long long) do not always compute to - // the correct result. - - //return castString + '(' + parseExpression (e.left ()) + ' ' + e.op () + ' ' + parseExpression (e.right ()) + ')'; - if (e.type ().equals ("unsigned long long")) - { - BigInteger value = (BigInteger)e.value (); - if (value.compareTo (Expression.llMax) > 0) // value > long long max? - value = value.subtract (Expression.twoPow64); // Convert to Java long (signed) - return castString + '(' + value.toString () + 'L' + ')'; - } - else - return castString + '(' + parseExpression (e.left ()) + ' ' + e.op () + ' ' + parseExpression (e.right ()) + ')'; - // end - } // parseBinary - - /** - * - **/ - static String parseUnary (UnaryExpr e) - { - if (!(e.value () instanceof Number)) - return "(UNKNOWN_VALUE)"; // This shouldn't happen if the parser checked the expression types correctly. - else if ((e.value () instanceof Float || e.value () instanceof Double) && e instanceof Not) - return "(UNKNOWN_VALUE)"; // This shouldn't happen if the parser checked the expression types correctly. - else - { - String castString = ""; - if (e.operand ().value () instanceof Float || - e.operand ().value () instanceof Double) - castString = "(double)"; - // Support long long. - //else - // castString = "(long)"; - else if (e.type (). indexOf ("long long") >= 0) - castString = "(long)"; - else - castString = "(int)"; - - // Must emit value rather than representation when type is - // "unsigned long long" (ull) because emitted unary arithmetic expressions - // containing a ull converted to long (i.e., IDL long long) do not always - // compute to the correct result. - - //return castString + e.op () + parseExpression (e.operand ()); - if (e.type ().equals ("unsigned long long")) - { - BigInteger value = (BigInteger)e.value (); - if (value.compareTo (Expression.llMax) > 0) // value > long long max? - value = value.subtract (Expression.twoPow64); // Convert to Java long (signed) - return castString + '(' + value.toString () + 'L' + ')'; - } - else - return castString + e.op () + parseExpression (e.operand ()); - // end - } - } // parseUnary - - /** - * - **/ - public static boolean IDLEntity (SymtabEntry entry) - { - boolean rc = true; - if (entry instanceof PrimitiveEntry || entry instanceof StringEntry) - rc = false; - else if (entry instanceof TypedefEntry) - rc = IDLEntity (entry.type ()); - return rc; - } // IDLEntity - - // - /** - * @return true if the current setting of corbaLevel is within delta of - * the range {@code min <= corbaLevel <= max} - **/ - public static boolean corbaLevel (float min, float max) - { - float level = Compile.compiler.arguments.corbaLevel; - float delta = 0.001f; - if ((level - min + delta >= 0.0f) && (max - level + delta >= 0.0f)) - return true; - else - return false; - } // corbaLevel - - static Hashtable symbolTable = new Hashtable (); - static Hashtable packageTranslation = new Hashtable() ; -} // class Util diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ValueBoxGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ValueBoxGen.java deleted file mode 100644 index d8efe320029..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ValueBoxGen.java +++ /dev/null @@ -1,349 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: -// -D60929 Update for RTF2.4 changes -// -D61056 Use Util.helperName -// -D62023 Fix generation botch in helper.read for boxed bounded strings - -import java.io.File; -import java.io.PrintWriter; -import java.util.Hashtable; -import java.util.Enumeration; -import java.util.Vector; - -import com.sun.tools.corba.se.idl.GenFileStream; -import com.sun.tools.corba.se.idl.InterfaceEntry; -import com.sun.tools.corba.se.idl.SymtabEntry; -import com.sun.tools.corba.se.idl.TypedefEntry; -import com.sun.tools.corba.se.idl.ValueEntry; -import com.sun.tools.corba.se.idl.ValueBoxEntry; -import com.sun.tools.corba.se.idl.InterfaceState; -import com.sun.tools.corba.se.idl.MethodEntry; -import com.sun.tools.corba.se.idl.PrimitiveEntry; -import com.sun.tools.corba.se.idl.SequenceEntry; -import com.sun.tools.corba.se.idl.StringEntry; - -/** - * - **/ -public class ValueBoxGen implements com.sun.tools.corba.se.idl.ValueBoxGen, JavaGenerator -{ - /** - * Public zero-argument constructor. - **/ - public ValueBoxGen () - { - } // ctor - - /** - * - **/ - public void generate (Hashtable symbolTable, ValueBoxEntry v, PrintWriter str) - { - this.symbolTable = symbolTable; - this.v = v; - - TypedefEntry member = ((InterfaceState) v.state ().elementAt (0)).entry; - SymtabEntry mType = member.type (); - // if it's primitive type, generate a java class - if (mType instanceof PrimitiveEntry) - { - openStream (); - if (stream == null) - return; - writeHeading (); - writeBody (); - writeClosing (); - closeStream (); - } - else - { - // If a constructed type is nested in the value box, - // value v struct s {...}; - // the bindings for the nested type must be handled here - Enumeration e = v.contained ().elements (); - while (e.hasMoreElements ()) - { - SymtabEntry contained = (SymtabEntry) e.nextElement (); - - // in case of value box w/ nested enum, ex: value v enum e {e0, e1,...}; - // the SymtabEntry for the enum and labels are contained in the vector. - // Must check the type to ignore the SymtabEntry for labels. - if (contained.type () != null) - contained.type ().generate (symbolTable, stream); - } - } - generateHelper (); - generateHolder (); - } // generate - - /** - * - **/ - protected void openStream () - { - stream = Util.stream (v, ".java"); - } // openStream - - /** - * - **/ - protected void generateHelper () - { - ((Factories)Compile.compiler.factories ()).helper ().generate (symbolTable, v); - } // generateHelper - - /** - * - **/ - protected void generateHolder () - { - ((Factories)Compile.compiler.factories ()).holder ().generate (symbolTable, v); - } // generateHolder - - /** - * - **/ - protected void writeHeading () - { - Util.writePackage (stream, v); - Util.writeProlog (stream, ((GenFileStream)stream).name ()); - if (v.comment () != null) - v.comment ().generate ("", stream); -// stream.println ("public class " + v.name () + " implements org.omg.CORBA.portable.ValueBase, org.omg.CORBA.portable.Streamable"); - stream.println ("public class " + v.name () + " implements org.omg.CORBA.portable.ValueBase"); // - stream.println ("{"); - } // writeHeading - - /** - * - **/ - protected void writeBody () - { - InterfaceState member = (InterfaceState) v.state ().elementAt (0); - SymtabEntry entry = (SymtabEntry) member.entry; - Util.fillInfo (entry); - if (entry.comment () != null) - entry.comment ().generate (" ", stream); - stream.println (" public " + Util.javaName (entry) + " value;"); - stream.println (" public " + v.name () + " (" + Util.javaName (entry) + " initial)"); - stream.println (" {"); - stream.println (" value = initial;"); - stream.println (" }"); - stream.println (); - writeTruncatable (); // -// writeStreamableMethods (); - } // writeBody - - /** - * - **/ - protected void writeTruncatable () // - { - // Per Simon, 4/6/98, emit _truncatable_ids() - stream.println (" public String[] _truncatable_ids() {"); - stream.println (" return " + Util.helperName(v, true) + ".get_instance().get_truncatable_base_ids();"); // - stream.println (" }"); - stream.println (); - } // writeTruncatable - - /** - * - **/ - protected void writeClosing () - { - stream.println ("} // class " + v.name ()); - } // writeClosing - - /** - * - **/ - protected void closeStream () - { - stream.close (); - } // closeStream - - /** - * - **/ - protected void writeStreamableMethods () - { - stream.println (" public void _read (org.omg.CORBA.portable.InputStream istream)"); - stream.println (" {"); - streamableRead ("this", v, stream); - stream.println (" }"); - stream.println (); - stream.println (" public void _write (org.omg.CORBA.portable.OutputStream ostream)"); - stream.println (" {"); - write (0, " ", "this", v, stream); - stream.println (" }"); - stream.println (); - stream.println (" public org.omg.CORBA.TypeCode _type ()"); - stream.println (" {"); - stream.println (" return " + Util.helperName (v, false) + ".type ();"); // - stream.println (" }"); - } // writeStreamableMethods - - /////////////// - // From JavaGenerator - - public int helperType (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) - { - ValueEntry vt = (ValueEntry) entry; - TypedefEntry member = (TypedefEntry) ((InterfaceState) (vt.state ()).elementAt (0)).entry; - SymtabEntry mType = Util.typeOf (member); - index = ((JavaGenerator)mType.generator ()).type (index, indent, tcoffsets, name, mType, stream); - stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_value_box_tc (" - + "_id, " - + '"' + entry.name () + "\", " - + name - + ");"); - return index; - } // helperType - - public int type (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) { - stream.println (indent + name + " = " + Util.helperName (entry, true) + ".type ();"); // - return index; - } // type - - public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - return index; - } // read - - public void helperRead (String entryName, SymtabEntry entry, PrintWriter stream) - { - // per Simon, make "static" read call istream.read_value. - // put real marshalling code in read_value. - stream.println (" return (" + entryName +") ((org.omg.CORBA_2_3.portable.InputStream) istream).read_value (get_instance());"); // - stream.println (" }"); - stream.println (); - - // done with "read", now do "read_value with real marshalling code. - - stream.println (" public java.io.Serializable read_value (org.omg.CORBA.portable.InputStream istream)"); // - stream.println (" {"); - // end of changes - - String indent = " "; - Vector vMembers = ((ValueBoxEntry) entry).state (); - TypedefEntry member = ((InterfaceState) vMembers.elementAt (0)).entry; - SymtabEntry mType = member.type (); - if (mType instanceof PrimitiveEntry || - mType instanceof SequenceEntry || - mType instanceof TypedefEntry || - mType instanceof StringEntry || - !member.arrayInfo ().isEmpty ()) { - stream.println (indent + Util.javaName (mType) + " tmp;"); // - ((JavaGenerator)member.generator ()).read (0, indent, "tmp", member, stream); - } - else if (mType instanceof ValueEntry || mType instanceof ValueBoxEntry) - stream.println (indent + Util.javaQualifiedName (mType) + " tmp = (" + - Util.javaQualifiedName (mType) + ") ((org.omg.CORBA_2_3.portable.InputStream)istream).read_value (" + Util.helperName (mType, true) + ".get_instance ());"); // // - else - stream.println (indent + Util.javaName (mType) + " tmp = " + - Util.helperName ( mType, true ) + ".read (istream);"); // - if (mType instanceof PrimitiveEntry) - stream.println (indent + "return new " + entryName + " (tmp);"); - else - stream.println (indent + "return tmp;"); - } // helperRead - - public void helperWrite (SymtabEntry entry, PrintWriter stream) - { - // per Simon, make "static" write call istream.write_value. - // put real marshalling code in write_value. - stream.println (" ((org.omg.CORBA_2_3.portable.OutputStream) ostream).write_value (value, get_instance());"); // - stream.println (" }"); - stream.println (); - - // done with "write", now do "write_value with real marshalling code. - - stream.println (" public void write_value (org.omg.CORBA.portable.OutputStream ostream, java.io.Serializable obj)"); // - stream.println (" {"); - - String entryName = Util.javaName(entry); - stream.println (" " + entryName + " value = (" + entryName + ") obj;"); - write (0, " ", "value", entry, stream); - } // helperWrite - - public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - Vector vMembers = ( (ValueEntry) entry ).state (); - TypedefEntry member = ((InterfaceState) vMembers.elementAt (0)).entry; - SymtabEntry mType = member.type (); - - if (mType instanceof PrimitiveEntry || !member.arrayInfo ().isEmpty ()) - index = ((JavaGenerator)member.generator ()).write (index, indent, name + ".value", member, stream); - else if (mType instanceof SequenceEntry || mType instanceof StringEntry || mType instanceof TypedefEntry || !member.arrayInfo ().isEmpty ()) - index = ((JavaGenerator)member.generator ()).write (index, indent, name, member, stream); - else if (mType instanceof ValueEntry || mType instanceof ValueBoxEntry) - stream.println (indent - + "((org.omg.CORBA_2_3.portable.OutputStream)ostream).write_value ((java.io.Serializable) value, " // - + Util.helperName (mType, true) // - + ".get_instance ());"); // - else - stream.println (indent + Util.helperName (mType, true) + ".write (ostream, " + name + ");"); // - return index; - } // write - - protected void writeAbstract () - { - } // writeAbstract - - protected void streamableRead (String entryName, SymtabEntry entry, PrintWriter stream) - { - Vector vMembers = ( (ValueBoxEntry) entry ).state (); - TypedefEntry member = ((InterfaceState) vMembers.elementAt (0)).entry; - SymtabEntry mType = member.type (); - if (mType instanceof PrimitiveEntry || mType instanceof SequenceEntry || mType instanceof TypedefEntry || - mType instanceof StringEntry || !member.arrayInfo ().isEmpty ()) - { - SymtabEntry mEntry = (SymtabEntry) ((InterfaceState) vMembers.elementAt (0)).entry; - ((JavaGenerator)member.generator ()).read (0, " ", entryName + ".value", member, stream); - } - else if (mType instanceof ValueEntry || mType instanceof ValueBoxEntry) - stream.println (" " + entryName + ".value = (" + Util.javaQualifiedName (mType) + ") ((org.omg.CORBA_2_3.portable.InputStream)istream).read_value (" + Util.helperName(mType, true) + ".get_instance ());"); // // - else - stream.println (" " + entryName + ".value = " + Util.helperName (mType, true) + ".read (istream);"); // - } // streamableRead - - protected Hashtable symbolTable = null; - protected ValueBoxEntry v = null; - protected PrintWriter stream = null; -} // class ValueBoxGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ValueBoxGen24.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ValueBoxGen24.java deleted file mode 100644 index dbb1ced706c..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ValueBoxGen24.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: -// -D62023 Update for Java 2.4 RTF - -import java.io.File; -import java.io.PrintWriter; -import java.util.Hashtable; -import java.util.Enumeration; -import java.util.Vector; - -import com.sun.tools.corba.se.idl.GenFileStream; -import com.sun.tools.corba.se.idl.InterfaceEntry; -import com.sun.tools.corba.se.idl.SymtabEntry; -import com.sun.tools.corba.se.idl.TypedefEntry; -import com.sun.tools.corba.se.idl.ValueEntry; -import com.sun.tools.corba.se.idl.ValueBoxEntry; -import com.sun.tools.corba.se.idl.InterfaceState; -import com.sun.tools.corba.se.idl.MethodEntry; -import com.sun.tools.corba.se.idl.PrimitiveEntry; -import com.sun.tools.corba.se.idl.SequenceEntry; -import com.sun.tools.corba.se.idl.StringEntry; - -/** - * - **/ -public class ValueBoxGen24 extends ValueBoxGen -{ - /** - * Public zero-argument constructor. - **/ - public ValueBoxGen24 () - { - } // ctor - - /** - * d62023 - Move from helper to mapped class - **/ - protected void writeTruncatable () // - { - stream.print (" private static String[] _truncatable_ids = {"); - stream.println (Util.helperName(v, true) + ".id ()};"); - stream.println (); - stream.println (" public String[] _truncatable_ids() {"); - stream.println (" return _truncatable_ids;"); - stream.println (" }"); - stream.println (); - } // writeTruncatable - - - /** - * d62023 - **/ - public void helperRead (String entryName, SymtabEntry entry, PrintWriter stream) - { - stream.println (" if (!(istream instanceof org.omg.CORBA_2_3.portable.InputStream)) {"); - stream.println (" throw new org.omg.CORBA.BAD_PARAM(); }"); - stream.println (" return (" + entryName +") ((org.omg.CORBA_2_3.portable.InputStream) istream).read_value (_instance);"); - stream.println (" }"); - stream.println (); - - // done with "read", now do "read_value with real marshalling code. - - stream.println (" public java.io.Serializable read_value (org.omg.CORBA.portable.InputStream istream)"); // - stream.println (" {"); - - String indent = " "; - Vector vMembers = ((ValueBoxEntry) entry).state (); - TypedefEntry member = ((InterfaceState) vMembers.elementAt (0)).entry; - SymtabEntry mType = member.type (); - if (mType instanceof PrimitiveEntry || - mType instanceof SequenceEntry || - mType instanceof TypedefEntry || - mType instanceof StringEntry || - !member.arrayInfo ().isEmpty ()) { - stream.println (indent + Util.javaName (mType) + " tmp;"); - ((JavaGenerator)member.generator ()).read (0, indent, "tmp", member, stream); - } - else - stream.println (indent + Util.javaName (mType) + " tmp = " + - Util.helperName ( mType, true ) + ".read (istream);"); - if (mType instanceof PrimitiveEntry) - stream.println (indent + "return new " + entryName + " (tmp);"); - else - stream.println (indent + "return (java.io.Serializable) tmp;"); - } // helperRead - - /** - * d62023 - **/ - public void helperWrite (SymtabEntry entry, PrintWriter stream) - { - stream.println (" if (!(ostream instanceof org.omg.CORBA_2_3.portable.OutputStream)) {"); - stream.println (" throw new org.omg.CORBA.BAD_PARAM(); }"); - stream.println (" ((org.omg.CORBA_2_3.portable.OutputStream) ostream).write_value (value, _instance);"); - stream.println (" }"); - stream.println (); - - // done with "write", now do "write_value with real marshalling code. - - stream.println (" public void write_value (org.omg.CORBA.portable.OutputStream ostream, java.io.Serializable value)"); - stream.println (" {"); - - String entryName = Util.javaName(entry); - stream.println (" if (!(value instanceof " + entryName + ")) {"); - stream.println (" throw new org.omg.CORBA.MARSHAL(); }"); - stream.println (" " + entryName + " valueType = (" + entryName + ") value;"); - write (0, " ", "valueType", entry, stream); - } // helperWrite - - /** - * d62023 - **/ - public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - Vector vMembers = ( (ValueEntry) entry ).state (); - TypedefEntry member = ((InterfaceState) vMembers.elementAt (0)).entry; - SymtabEntry mType = member.type (); - - if (mType instanceof PrimitiveEntry || !member.arrayInfo ().isEmpty ()) - index = ((JavaGenerator)member.generator ()).write (index, indent, name + ".value", member, stream); - else if (mType instanceof SequenceEntry || mType instanceof StringEntry || mType instanceof TypedefEntry || !member.arrayInfo ().isEmpty ()) - index = ((JavaGenerator)member.generator ()).write (index, indent, name, member, stream); - else - stream.println (indent + Util.helperName (mType, true) + ".write (ostream, " + name + ");"); // - return index; - } // write -} diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ValueFactory.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ValueFactory.java deleted file mode 100644 index b0d6e94749a..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ValueFactory.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: -// -D62023 klr new class - -import java.io.PrintWriter; -import java.util.Vector; - -import com.sun.tools.corba.se.idl.GenFileStream; -import com.sun.tools.corba.se.idl.SymtabEntry; -import com.sun.tools.corba.se.idl.MethodEntry; -import com.sun.tools.corba.se.idl.ValueEntry; - -/** - * - **/ -public class ValueFactory implements AuxGen -{ - /** - * Public zero-argument constructor. - **/ - public ValueFactory () - { - } // ctor - - /** - * Generate the default value factory class. Provides general algorithm for - * auxiliary binding generation: - * 1.) Initialize symbol table and symbol table entry members, - * common to all generators. - * 2.) Initialize members unique to this generator. - * 3.) Open print stream - * 4.) Write class heading (package, prologue, source comment, class - * statement, open curly - * 5.) Write class body (member data and methods) - * 6.) Write class closing (close curly) - * 7.) Close the print stream - **/ - public void generate (java.util.Hashtable symbolTable, com.sun.tools.corba.se.idl.SymtabEntry entry) - { - this.symbolTable = symbolTable; - this.entry = entry; - init (); - if (hasFactoryMethods ()) { - openStream (); - if (stream == null) - return; - writeHeading (); - writeBody (); - writeClosing (); - closeStream (); - } - } // generate - - /** - * Initialize variables unique to this generator. - **/ - protected void init () - { - factoryClass = entry.name () + "ValueFactory"; - factoryType = Util.javaName (entry); - } // init - - /** - * @return true if entry has any factory methods declared - **/ - protected boolean hasFactoryMethods () - { - Vector init = ((ValueEntry)entry).initializers (); - if (init != null && init.size () > 0) - return true; - else - return false; - } // hasFactoryMethods - - /** - * Open the print stream for subsequent output. - **/ - protected void openStream () - { - stream = Util.stream (entry, "ValueFactory.java"); - } // openStream - - /** - * Generate the heading, including the package, imports, - * source comment, class statement, and left curly. - **/ - protected void writeHeading () - { - Util.writePackage (stream, entry, Util.TypeFile); // REVISIT - same as interface? - Util.writeProlog (stream, stream.name ()); - if (entry.comment () != null) - entry.comment ().generate ("", stream); - stream.println ("public interface " + factoryClass + " extends org.omg.CORBA.portable.ValueFactory"); - stream.println ('{'); - } // writeHeading - - /** - * Generate members of this class. - **/ - protected void writeBody () - { - Vector init = ((ValueEntry)entry).initializers (); - if (init != null) - { - for (int i = 0; i < init.size (); i++) - { - MethodEntry element = (MethodEntry) init.elementAt (i); - element.valueMethod (true); //tag value method if not tagged previously - ((MethodGen) element.generator ()). interfaceMethod (symbolTable, element, stream); - } - } - } // writeBody - - /** - * Generate the closing statements. - **/ - protected void writeClosing () - { - stream.println ('}'); - } // writeClosing - - /** - * Write the stream to file by closing the print stream. - **/ - protected void closeStream () - { - stream.close (); - } // closeStream - - protected java.util.Hashtable symbolTable; - protected com.sun.tools.corba.se.idl.SymtabEntry entry; - protected GenFileStream stream; - - // Unique to this generator - protected String factoryClass; - protected String factoryType; -} // class Holder diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ValueGen.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ValueGen.java deleted file mode 100644 index 26e6fb06394..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ValueGen.java +++ /dev/null @@ -1,767 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: -// -F46082.51 Remove -stateful feature; javaStatefulName() obsolete. -// -D57067 suppress default init if an emit init explicitly specified. -// -D59071 Clone method entries when their content needs modification. -// -D59092 Valuetype supporting interfaces should implement interface. -// -D59418 Custom values implement org.omg.CORBA.CustomMarshal -// -D59418 Invert read/read_Value, write/write_Value for Simon -// -D60929 Update for RTF2.4 changes -// -D62018 write_value for value with value field x calls xHelper.write. -// -D62062 Add _write to value Helper to marshal state. -// write_value for value subclass calls parent._write -// -D61650 Remove '\n' from generated strings; use println()'s. - -import java.io.File; -import java.io.PrintWriter; -import java.util.Hashtable; -import java.util.Enumeration; -import java.util.Vector; - -import com.sun.tools.corba.se.idl.GenFileStream; -import com.sun.tools.corba.se.idl.InterfaceEntry; -import com.sun.tools.corba.se.idl.SymtabEntry; -import com.sun.tools.corba.se.idl.TypedefEntry; -import com.sun.tools.corba.se.idl.ValueEntry; -import com.sun.tools.corba.se.idl.ValueBoxEntry; -import com.sun.tools.corba.se.idl.InterfaceState; -import com.sun.tools.corba.se.idl.MethodEntry; -import com.sun.tools.corba.se.idl.PrimitiveEntry; -import com.sun.tools.corba.se.idl.SequenceEntry; -import com.sun.tools.corba.se.idl.StringEntry; -import com.sun.tools.corba.se.idl.StructEntry; - -/** - * - **/ -public class ValueGen implements com.sun.tools.corba.se.idl.ValueGen, JavaGenerator -{ - /** - * Public zero-argument constructor. - **/ - public ValueGen () - { - } // ctor - - /** - * - **/ - public void generate (Hashtable symbolTable, ValueEntry v, PrintWriter str) - { - this.symbolTable = symbolTable; - this.v = v; - init (); - - openStream (); - if (stream == null) - return; - generateTie (); - generateHelper (); - generateHolder (); - writeHeading (); - writeBody (); - writeClosing (); - closeStream (); - } // generate - - /** - * Initialize members unique to this generator. - **/ - protected void init () - { - emit = ((Arguments)Compile.compiler.arguments).emit; - factories = (Factories)Compile.compiler.factories (); - } // init - - /** - * - **/ - protected void openStream () - { - stream = Util.stream (v, ".java"); - } // openStream - - /** - * Generate a Tie class only when the user specifies the TIE option - * and the valuetype does support an interface. - **/ - protected void generateTie () - { - boolean tie = ((Arguments)Compile.compiler.arguments).TIEServer; - if (v.supports ().size () > 0 && tie) - { - Factories factories = (Factories)Compile.compiler.factories (); - factories.skeleton ().generate (symbolTable, v); - } - } // generateTie - - /** - * - **/ - protected void generateHelper () - { - ((Factories)Compile.compiler.factories ()).helper ().generate (symbolTable, v); - } // generateHelper - - /** - * - **/ - protected void generateHolder () - { - ((Factories)Compile.compiler.factories ()).holder ().generate (symbolTable, v); - } // generateHolder - - /** - * - **/ - protected void writeHeading () - { - Util.writePackage (stream, v); - Util.writeProlog (stream, ((GenFileStream)stream).name ()); - - if (v.comment () != null) - v.comment ().generate ("", stream); - - if (v.isAbstract ()) - { - writeAbstract (); - return; - } - else - stream.print ("public class " + v.name ()); - - // There should always be at least one parent: ValueBase - SymtabEntry parent = (SymtabEntry) v.derivedFrom ().elementAt (0); - - // If parent is ValueBase, it's mapped to java.io.Serializable - String parentName = Util.javaName (parent); - boolean impl = false; - - if (parentName.equals ("java.io.Serializable")) - { -// stream.print (" implements org.omg.CORBA.portable.ValueBase, org.omg.CORBA.portable.Streamable"); - stream.print (" implements org.omg.CORBA.portable.ValueBase"); // - impl = true; - } - else if ( !((ValueEntry)parent).isAbstract ()) - stream.print (" extends " + parentName); - - // if inheriting from abstract values - for (int i = 0; i < v.derivedFrom ().size (); i++) { - parent = (SymtabEntry) v.derivedFrom ().elementAt (i); - if ( ((ValueEntry)parent).isAbstract ()) - { - if (!impl) - { - stream.print (" implements "); - impl = true; - } - else - stream.print (", "); - stream.print (Util.javaName (parent)); - } - } -// Valuetype supporting interface implement Operations interface -// for supported IDL interface - if (((ValueEntry)v).supports ().size () > 0) { - if (!impl) - { - stream.print (" implements "); - impl = true; - } - else - stream.print (", "); - - InterfaceEntry s =(InterfaceEntry)((ValueEntry)v).supports().elementAt(0); - // abstract supported classes don't have "Operations" - if (s.isAbstract ()) - stream.print (Util.javaName (s)); - else - stream.print (Util.javaName (s) + "Operations"); - } - -// Custom valuetypes implement org.omg.CORBA.CustomMarshal. - if ( ((ValueEntry)v).isCustom ()) { - if (!impl) - { - stream.print (" implements "); - impl = true; - } - else - stream.print (", "); - - stream.print ("org.omg.CORBA.CustomMarshal "); - } - - stream.println (); - stream.println ("{"); - } // writeHeading - - /** - * - **/ - protected void writeBody () - { - writeMembers (); - writeInitializers (); - writeConstructor (); // - writeTruncatable (); // - writeMethods (); - } // writeBody - - /** - * - **/ - protected void writeClosing () - { - if (v.isAbstract ()) - stream.println ("} // interface " + v.name ()); - else - stream.println ("} // class " + v.name ()); - } // writeClosing - - /** - * - **/ - protected void closeStream () - { - stream.close (); - } // closeStream - - /** - * - **/ - protected void writeConstructor () - { - // Per Simon, 9/3/98, emit a protected default constructor - if (!v.isAbstract () && !explicitDefaultInit) { // - stream.println (" protected " + v.name () + " () {}"); - stream.println (); - } - } // writeConstructor - - /** - * - **/ - protected void writeTruncatable () // - { - // Per Simon, 4/6/98, emit _truncatable_ids() - if (!v.isAbstract ()) { - stream.println (" public String[] _truncatable_ids() {"); - stream.println (" return " + Util.helperName(v, true) + ".get_instance().get_truncatable_base_ids();"); // - stream.println (" }"); - stream.println (); - } - } // writeTruncatable - - /** - * - **/ - protected void writeMembers () - { - // if the value type contains no data members, a null return is expected - if (v.state () == null) - return; - - for (int i = 0; i < v.state ().size (); i ++) - { - InterfaceState member = (InterfaceState) v.state ().elementAt (i); - SymtabEntry entry = (SymtabEntry) member.entry; - Util.fillInfo (entry); - - if (entry.comment () != null) - entry.comment ().generate (" ", stream); - - String modifier = " "; - if (member.modifier == InterfaceState.Public) - modifier = " public "; - Util.writeInitializer (modifier, entry.name (), "", entry, stream); - } - } // writeMembers - - /** - * - **/ - protected void writeInitializers () - { - Vector init = v.initializers (); - if (init != null) - { - stream.println (); - for (int i = 0; i < init.size (); i++) - { - MethodEntry element = (MethodEntry) init.elementAt (i); - element.valueMethod (true); - ((MethodGen) element.generator ()). interfaceMethod (symbolTable, element, stream); - if (element.parameters ().isEmpty ()) // - explicitDefaultInit = true; - } - } - } // writeInitializers - - /** - * - **/ - protected void writeMethods () - { - // contained vector contains methods, attributes, const, enums, exceptions, - // structs, unions, or typedefs that are declared inside the value object. - // State members of the nested types are also included in this vector. - // Thus, if the declaration of a constructed type is nested in the decl. - // of a state member, e.g struct x {boolean b;} memberx; - // the generation of the nested type must be handled here. - Enumeration e = v.contained ().elements (); - while (e.hasMoreElements ()) - { - SymtabEntry contained = (SymtabEntry)e.nextElement (); - if (contained instanceof MethodEntry) - { - MethodEntry element = (MethodEntry)contained; - ((MethodGen)element.generator ()).interfaceMethod (symbolTable, element, stream); - } - else - { - // Generate the type referenced by the typedef. - if (contained instanceof TypedefEntry) - contained.type ().generate (symbolTable, stream); - - // Note that we also need to generate the typedef itself if - // contained is a typedef. - contained.generate (symbolTable, stream); - } - } - - // Abstract values are mapped to interfaces. There is no need to generate - // the bindings for inheriting methods in case of inheritance from other - // abstract values or supporting interface - if (v.isAbstract ()) - return; - - // workaround: if the value type doesnot support any interfaces, a null - // return is expected instead of an empty vector - - // if supporting an interfaces, generate bindings for inheriting methods - if (v.supports ().size () > 0) - { - InterfaceEntry intf = (InterfaceEntry) v.supports ().elementAt (0); - Enumeration el = intf.allMethods ().elements (); - while (el.hasMoreElements ()) - { - MethodEntry m = (MethodEntry) el.nextElement (); - // Don't alter the symbol table/emit list elements! - //m.container (v); - //((MethodGen)m.generator ()).interfaceMethod (symbolTable, m, stream); - MethodEntry mClone = (MethodEntry)m.clone (); - mClone.container (v); - ((MethodGen)mClone.generator ()).interfaceMethod (symbolTable, mClone, stream); - } - } - - // if inheriting from abstract values, generating bindings for all - // inheriting methods - for (int i = 0; i < v.derivedFrom ().size (); i++) { - ValueEntry parentValue = (ValueEntry) v.derivedFrom ().elementAt (i); - if (parentValue.isAbstract ()) - { - Enumeration el = parentValue.allMethods ().elements (); - while (el.hasMoreElements ()) - { - MethodEntry m = (MethodEntry) el.nextElement (); - // Don't alter the symbol table/emit list elements! - //m.container (v); - //((MethodGen)m.generator ()).interfaceMethod (symbolTable, m, stream); - MethodEntry mClone = (MethodEntry)m.clone (); - mClone.container (v); - ((MethodGen)mClone.generator ()).interfaceMethod (symbolTable, mClone, stream); - } - } - } - - //writeStreamableMethods (); - } // writeMethods - - /** - * - **/ - protected void writeStreamableMethods () - { - stream.println (" public void _read (org.omg.CORBA.portable.InputStream istream)"); - stream.println (" {"); - read (0, " ", "this", v, stream); - stream.println (" }"); - stream.println (); - stream.println (" public void _write (org.omg.CORBA.portable.OutputStream ostream)"); - stream.println (" {"); - write (0, " ", "this", v, stream); - stream.println (" }"); - stream.println (); - stream.println (" public org.omg.CORBA.TypeCode _type ()"); - stream.println (" {"); - stream.println (" return " + Util.helperName (v, false) + ".type ();"); // - stream.println (" }"); - } // writeStreamableMethods - - /////////////// - // From JavaGenerator - - public int helperType (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) - { - ValueEntry vt = (ValueEntry) entry; - Vector state = vt.state (); - int noOfMembers = state == null ? 0 : state.size (); - String members = "_members" + index++; - String tcOfMembers = "_tcOf" + members; - - stream.println (indent + "org.omg.CORBA.ValueMember[] " - + members + " = new org.omg.CORBA.ValueMember[" - + noOfMembers - + "];"); - stream.println (indent + "org.omg.CORBA.TypeCode " + tcOfMembers + " = null;"); - //stream.println (""); // - - String definedInrepId = "_id"; - String repId, version; - - for (int k=0; k - if (mType instanceof ValueEntry || mType instanceof ValueBoxEntry) - // OBV spec is silent on defining VersionSpec for valuetype RepIds - version = "\"\""; - else - { - String id = mType.repositoryID ().ID (); - version = '"' + id.substring (id.lastIndexOf (':')+1) + '"'; - } - } - else - { - repId = "\"\""; - version = "\"\""; - } - - // Get TypeCode for valuetype member and store it var. name given by tcOfMembers - stream.println (indent + "// ValueMember instance for " + member.name ()); - index = ((JavaGenerator)member.generator ()).type (index, indent, tcoffsets, tcOfMembers, member, stream); - stream.println (indent + members + "[" + k + "] = new org.omg.CORBA.ValueMember (" // - + '"' + member.name () + "\", "); // name - stream.println (indent + " " + repId + ", "); // id - stream.println (indent + " " + definedInrepId + ", "); // defined_in - stream.println (indent + " " + version + ", "); // version - stream.println (indent + " " + tcOfMembers + ", "); // type - stream.println (indent + " " + "null, "); // type_def - stream.println (indent + " " + "org.omg.CORBA." + - (valueMember.modifier == InterfaceState.Public ? - "PUBLIC_MEMBER" : "PRIVATE_MEMBER") + ".value" + ");"); // access - } // end for - - stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_value_tc (" - + "_id, " - + '"' + entry.name () + "\", " - + getValueModifier (vt) + ", " - + getConcreteBaseTypeCode (vt) + ", " - + members - + ");"); - - return index; - } // helperType - - public int type (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) { - stream.println (indent + name + " = " + Util.helperName (entry, true) + ".type ();"); // - return index; - } // type - - // Check for types which don't have a Repository ID: primitive, - // string, arrays and sequences. - - private static boolean hasRepId (SymtabEntry member) - { - SymtabEntry mType = Util.typeOf (member); - return !( mType instanceof PrimitiveEntry || - mType instanceof StringEntry || - ( mType instanceof TypedefEntry && - !(((TypedefEntry)mType).arrayInfo ().isEmpty ()) ) || - ( mType instanceof TypedefEntry && member.type () instanceof SequenceEntry) ); - } // hasRepId - - private static String getValueModifier (ValueEntry vt) - { - String mod = "NONE"; - if (vt.isCustom ()) - mod = "CUSTOM"; - else if (vt.isAbstract ()) - mod = "ABSTRACT"; - else if (vt.isSafe ()) - mod = "TRUNCATABLE"; - return "org.omg.CORBA.VM_" + mod + ".value"; - } // getValueModifier - - private static String getConcreteBaseTypeCode (ValueEntry vt) - { - Vector v = vt.derivedFrom (); - if (!vt.isAbstract ()) - { - SymtabEntry base = (SymtabEntry)vt.derivedFrom ().elementAt (0); - if (!"ValueBase".equals (base.name ())) - return Util.helperName (base, true) + ".type ()"; // - } - return "null"; - } // getConcreteBaseTypeCode - - public void helperRead (String entryName, SymtabEntry entry, PrintWriter stream) - { - // per Simon, make "static" read call istream.read_value. - // put real marshalling code in read_value. - - if (((ValueEntry)entry).isAbstract ()) - { - stream.println (" throw new org.omg.CORBA.BAD_OPERATION (\"abstract value cannot be instantiated\");"); - } - else - { - stream.println (" return (" + entryName +") ((org.omg.CORBA_2_3.portable.InputStream) istream).read_value (get_instance());"); // - } - stream.println (" }"); - stream.println (); - - // done with "read", now do "read_value with real marshalling code. - - stream.println (" public java.io.Serializable read_value (org.omg.CORBA.portable.InputStream istream)"); // - stream.println (" {"); - - // per Simon, 3/3/99, read_value for custom values throws an exception - if (((ValueEntry)entry).isAbstract ()) - { - stream.println (" throw new org.omg.CORBA.BAD_OPERATION (\"abstract value cannot be instantiated\");"); - } - else - if (((ValueEntry)entry).isCustom ()) - { - stream.println (" throw new org.omg.CORBA.BAD_OPERATION (\"custom values should use unmarshal()\");"); - } - else - { - stream.println (" " + entryName + " value = new " + entryName + " ();"); - read (0, " ", "value", entry, stream); - stream.println (" return value;"); - } - stream.println (" }"); - stream.println (); - // End of normal read method - - // Per Simon, 8/26/98 - Value helpers get an additional overloaded - // read method where the value is passed in instead of "new'd" up. This is - // used for reading parent value state. - - // Per Simon, 3/3/99 - Don't change this "read" for custom marshalling - stream.println (" public static void read (org.omg.CORBA.portable.InputStream istream, " + entryName + " value)"); - stream.println (" {"); - read (0, " ", "value", entry, stream); - } // helperRead - - public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - // First do the state members from concrete parent hierarchy - Vector vParents = ((ValueEntry) entry).derivedFrom (); - if (vParents != null && vParents.size() != 0) - { - ValueEntry parent = (ValueEntry) vParents.elementAt (0); - if (parent == null) - return index; - // Per Simon, 4/6/99 - call parent read. - if (! Util.javaQualifiedName(parent).equals ("java.io.Serializable")) // - stream.println(indent + Util.helperName (parent, true) + ".read (istream, value);"); // // - } - - Vector vMembers = ((ValueEntry) entry).state (); - int noOfMembers = vMembers == null ? 0 : vMembers.size (); - - for (int k = 0; k < noOfMembers; k++) - { - TypedefEntry member = (TypedefEntry)((InterfaceState)vMembers.elementAt (k)).entry; - String memberName = member.name (); - SymtabEntry mType = member.type (); - - if (mType instanceof PrimitiveEntry || - mType instanceof TypedefEntry || - mType instanceof SequenceEntry || - mType instanceof StringEntry || - !member.arrayInfo ().isEmpty ()) - index = ((JavaGenerator)member.generator ()).read (index, indent, name + '.' + memberName, member, stream); - else if (mType instanceof ValueEntry) - { - String returnType = Util.javaQualifiedName (mType); - if (mType instanceof ValueBoxEntry) - // Remove -stateful. - //returnType = Util.javaStatefulName (mType); - returnType = Util.javaName (mType); - stream.println (" " + name + '.' + memberName + " = (" + returnType + - ") ((org.omg.CORBA_2_3.portable.InputStream)istream).read_value (" + Util.helperName (mType, true) + // - ".get_instance ());"); // - } - else - stream.println (indent + name + '.' + memberName + " = " + - Util.helperName (mType, true) + ".read (istream);"); // - } - - return index; - } // read - - public void helperWrite (SymtabEntry entry, PrintWriter stream) - { - // per Simon, make "static" write call istream.write_value. - // put real marshalling code in write_value. - stream.println (" ((org.omg.CORBA_2_3.portable.OutputStream) ostream).write_value (value, get_instance());"); // - stream.println (" }"); - stream.println (); - - // - // per Simon, 4/27/99, add static _write that marshals the state of this - // value for non-custom valuetypes - if (!((ValueEntry)entry).isCustom ()) - { - stream.println (" public static void _write (org.omg.CORBA.portable.OutputStream ostream, " + Util.javaName (entry) + " value)"); - stream.println (" {"); - write (0, " ", "value", entry, stream); - stream.println (" }"); - stream.println (); - } - - // done with "_write", now do "write_value - stream.println (" public void write_value (org.omg.CORBA.portable.OutputStream ostream, java.io.Serializable obj)"); // - stream.println (" {"); - - // per Simon, 3/3/99, write_value for custom values throws an exception - if (((ValueEntry)entry).isCustom ()) - { - stream.println (" throw new org.omg.CORBA.BAD_OPERATION (\"custom values should use marshal()\");"); - } - else { - String entryName = Util.javaName(entry); - stream.println (" _write (ostream, (" + entryName + ") obj);"); // -// write (0, " ", "value", entry, stream); - } - } // helperWrite - - public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - // First do the state members from concrete parent hierarchy - Vector vParents = ((ValueEntry)entry).derivedFrom (); - if (vParents != null && vParents.size () != 0) - { - ValueEntry parent = (ValueEntry)vParents.elementAt (0); - if (parent == null) - return index; - // Per Simon, 4/06/99 - call parent write. - // Per Simon, 4/27/99 - call parent _write. - if (! Util.javaQualifiedName(parent).equals ("java.io.Serializable")) // - stream.println(indent + Util.helperName (parent, true) + "._write (ostream, value);"); // - } - - Vector vMembers = ((ValueEntry) entry ).state (); - int noOfMembers = vMembers == null ? 0 : vMembers.size (); - for (int k = 0; k < noOfMembers; k++) - { - TypedefEntry member = (TypedefEntry)((InterfaceState)vMembers.elementAt (k)).entry; - String memberName = member.name (); - SymtabEntry mType = member.type (); - - if (mType instanceof PrimitiveEntry || - mType instanceof TypedefEntry || - mType instanceof SequenceEntry || - mType instanceof StringEntry || - !member.arrayInfo ().isEmpty ()) - index = ((JavaGenerator)member.generator ()).write (index, indent, name + '.' + memberName, member, stream); - else - stream.println (indent + Util.helperName (mType, true) + // - ".write (ostream, " + name + '.' + memberName + ");"); - } - - return index; - } // write - - /** - * - **/ - protected void writeAbstract () - { - stream.print ("public interface " + v.name ()); - - // workaround: if the abstract value type does not have any parent, a vector - // containing ValueBase should be returned instead of an empty vector - if (v.derivedFrom ().size () == 0) - stream.print (" extends org.omg.CORBA.portable.ValueBase"); // - else - { - SymtabEntry parent; - // list the values the abstract value type inherits - for (int i = 0; i < v.derivedFrom ().size (); i++) - { - if (i == 0) - stream.print (" extends "); - else - stream.print (", "); - parent = (SymtabEntry) v.derivedFrom ().elementAt (i); - stream.print (Util.javaName (parent)); - } - } - - // list the interface the abstract value type supports - if (v.supports ().size () > 0) - { - stream.print (", "); - SymtabEntry intf = (SymtabEntry) v.supports ().elementAt (0); - stream.print (Util.javaName (intf)); - } - stream.println (); - stream.println ("{"); - } - - protected int emit = 0; - protected Factories factories = null; - protected Hashtable symbolTable = null; - protected ValueEntry v = null; - protected PrintWriter stream = null; - protected boolean explicitDefaultInit = false; // -} // class ValueGen diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ValueGen24.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ValueGen24.java deleted file mode 100644 index 93701b01049..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ValueGen24.java +++ /dev/null @@ -1,417 +0,0 @@ -/* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * COMPONENT_NAME: idl.toJava - * - * ORIGINS: 27 - * - * Licensed Materials - Property of IBM - * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 - * RMI-IIOP v1.0 - * - */ - -package com.sun.tools.corba.se.idl.toJavaPortable; - -// NOTES: -// -D62023 Update for Java 2.4 RTF -// -D62794.1 Don't include operations inherited from abstract valuetypes -// -D62794.1 Don't include operations inherited from supported interfaces - -import java.io.File; -import java.io.PrintWriter; -import java.util.Hashtable; -import java.util.Enumeration; -import java.util.Vector; - -import com.sun.tools.corba.se.idl.GenFileStream; -import com.sun.tools.corba.se.idl.InterfaceEntry; -import com.sun.tools.corba.se.idl.SymtabEntry; -import com.sun.tools.corba.se.idl.TypedefEntry; -import com.sun.tools.corba.se.idl.ValueEntry; -import com.sun.tools.corba.se.idl.ValueBoxEntry; -import com.sun.tools.corba.se.idl.InterfaceState; -import com.sun.tools.corba.se.idl.MethodEntry; -import com.sun.tools.corba.se.idl.AttributeEntry; -import com.sun.tools.corba.se.idl.PrimitiveEntry; -import com.sun.tools.corba.se.idl.SequenceEntry; -import com.sun.tools.corba.se.idl.StringEntry; -import com.sun.tools.corba.se.idl.StructEntry; - -/** - * - **/ -public class ValueGen24 extends ValueGen -{ - /** - * Public zero-argument constructor. - **/ - public ValueGen24 () - { - } // ctor - - /** - * d62023 - delete constructor; helper is abstract - **/ - protected void writeConstructor () - { - } // writeConstructor - - /** - *

            -   * d62023 - delete write_value from non-boxed helpers
            -   *        - delete _write from non-boxed helpers
            -   * 
            - **/ - public void helperWrite (SymtabEntry entry, PrintWriter stream) - { - // REVISIT: Abstract/Custom?? - // per Simon mail 5/17/99 - stream.println (" ((org.omg.CORBA_2_3.portable.OutputStream) ostream).write_value (value, id ());"); - } // helperWrite - - /** - * d62023 - **/ - public void helperRead (String entryName, SymtabEntry entry, PrintWriter stream) - { - // REVISIT: Abstract/Custom?? - // per Simon mail 5/17/99 - stream.println (" return (" + entryName + ")((org.omg.CORBA_2_3.portable.InputStream) istream).read_value (id ());"); - } // helperRead - - /** - * d62023 - suppress initializers from mapped value; now generated in - * the Helper class and Factory class - **/ - protected void writeInitializers () - { - // override to do nothing - } // writeInitializers - - /** - * d62023 - goes in mapped class, not Helper - **/ - protected void writeTruncatable () // - { - if (!v.isAbstract ()) { - stream.println (" private static String[] _truncatable_ids = {"); - stream.print (" " + Util.helperName(v, true) + ".id ()"); - - // Any safe ValueEntry must have a concete value parent. - // The topmost parent cannot be safe since it doesn't have - // a concrete parent. - ValueEntry child = v; - while (child.isSafe ()) - { - stream.println(","); - ValueEntry parent = (ValueEntry)child.derivedFrom ().elementAt (0); - stream.print(" \"" + Util.stripLeadingUnderscoresFromID (parent.repositoryID ().ID ()) + "\""); - child = parent; - } - stream.println(); - stream.println(" };"); - stream.println(); - stream.println (" public String[] _truncatable_ids() {"); - stream.println (" return _truncatable_ids;"); - stream.println (" }"); - stream.println (); - } - } // writeTruncatable - - class ImplStreamWriter { - private boolean isImplementsWritten = false ; - - public void writeClassName( String name ) - { - if (!isImplementsWritten) { - stream.print( " implements " ) ; - isImplementsWritten = true ; - } else - stream.print( ", " ) ; - - stream.print( name ) ; - } - } - - /** - * d62023 - CustomMarshal {@literal ->} CustomValue for custom valuetypes - * mapped class is abstract - **/ - protected void writeHeading () - { - ImplStreamWriter isw = new ImplStreamWriter() ; - - Util.writePackage (stream, v); - Util.writeProlog (stream, ((GenFileStream)stream).name ()); - - if (v.comment () != null) - v.comment ().generate ("", stream); - - if (v.isAbstract ()) { - writeAbstract (); - return; - } else - stream.print ("public abstract class " + v.name ()); - - // There should always be at least one parent: ValueBase - SymtabEntry parent = (SymtabEntry) v.derivedFrom ().elementAt (0); - - // If parent is ValueBase, it's mapped to java.io.Serializable - String parentName = Util.javaName (parent); - boolean cv = false; // true if we've already implemented CustomValue - - if (parentName.equals ("java.io.Serializable")) { - if (((ValueEntry)v).isCustom ()) { - isw.writeClassName( "org.omg.CORBA.portable.CustomValue" ) ; - cv = true; - } else - isw.writeClassName( "org.omg.CORBA.portable.StreamableValue" ) ; - } else if ( !((ValueEntry)parent).isAbstract ()) - stream.print (" extends " + parentName); - - // if inheriting from abstract values - for (int i = 0; i < v.derivedFrom ().size (); i++) { - parent = (SymtabEntry) v.derivedFrom ().elementAt (i); - if ( ((ValueEntry)parent).isAbstract ()) { - isw.writeClassName( Util.javaName(parent) ) ; - } - } - - // Write out the supported interfaces - Enumeration enumeration = v.supports().elements(); - while (enumeration.hasMoreElements()) { - InterfaceEntry ie = (InterfaceEntry)(enumeration.nextElement()) ; - String cname = Util.javaName(ie) ; - if (!ie.isAbstract()) - cname += "Operations" ; - isw.writeClassName( cname ) ; - } - - // for when a custom valuetype inherits from a non-custom valuetype - if ( v.isCustom () && !cv) - isw.writeClassName( "org.omg.CORBA.portable.CustomValue" ) ; - - stream.println (); - stream.println ("{"); - } // writeHeading - - /** - * d62023 - private state maps to protected, not default - **/ - protected void writeMembers () - { - // if the value type contains no data members, a null return is expected - if (v.state () == null) - return; - - for (int i = 0; i < v.state ().size (); i ++) - { - InterfaceState member = (InterfaceState) v.state ().elementAt (i); - SymtabEntry entry = (SymtabEntry) member.entry; - Util.fillInfo (entry); - - if (entry.comment () != null) - entry.comment ().generate (" ", stream); - - String modifier = " "; - if (member.modifier == InterfaceState.Public) - modifier = " public "; - else - modifier = " protected "; - Util.writeInitializer (modifier, entry.name (), "", entry, stream); - } - stream.println(); - } // writeMembers - - /** - * d62023 - methods need to be abstract writeStreamable - **/ - protected void writeMethods () - { - // contained vector contains methods, attributes, const, enums, exceptions, - // structs, unions, or typedefs that are declared inside the value object. - // State members of the nested types are also included in this vector. - // Thus, if the declaration of a constructed type is nested in the decl. - // of a state member, e.g struct x {boolean b;} memberx; - // the generation of the nested type must be handled here. - Enumeration e = v.contained ().elements (); - while (e.hasMoreElements ()) - { - SymtabEntry contained = (SymtabEntry)e.nextElement (); - if (contained instanceof AttributeEntry) - { - AttributeEntry element = (AttributeEntry)contained; - ((AttributeGen24)element.generator ()).abstractMethod (symbolTable, element, stream); - } - else if (contained instanceof MethodEntry) - { - MethodEntry element = (MethodEntry)contained; - ((MethodGen24)element.generator ()).abstractMethod (symbolTable, element, stream); - } - else - { - // Generate the type referenced by the typedef. - if (contained instanceof TypedefEntry) - contained.type ().generate (symbolTable, stream); - - // Note that we also need to generate the typedef itself if - // contained is a typedef. - contained.generate (symbolTable, stream); - } - } - - // Abstract values are mapped to interfaces. There is no need to generate - // the bindings for inheriting methods in case of inheritance from other - // abstract values or supporting interface - if (v.isAbstract ()) - return; - - // Non-abstract, Non-Custom valuetypes support the Streamable interface - if (!(v.isCustom () || v.isAbstract ())) - writeStreamableMethods (); - } // writeMethods - - /** - * d62023 - call super._read() - **/ - public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - // First do the state members from concrete parent hierarchy - Vector vParents = ((ValueEntry) entry).derivedFrom (); - if (vParents != null && vParents.size() != 0) - { - ValueEntry parent = (ValueEntry) vParents.elementAt (0); - if (parent == null) - return index; - - // call super._read if non-abstract value parent - if ((!parent.isAbstract ()) && (! Util.javaQualifiedName(parent).equals ("java.io.Serializable"))) // - stream.println(indent + "super._read (istream);"); - } - - Vector vMembers = ((ValueEntry) entry).state (); - int noOfMembers = vMembers == null ? 0 : vMembers.size (); - - for (int k = 0; k < noOfMembers; k++) - { - TypedefEntry member = (TypedefEntry)((InterfaceState)vMembers.elementAt (k)).entry; - String memberName = member.name (); - SymtabEntry mType = member.type (); - - if (mType instanceof PrimitiveEntry || - mType instanceof TypedefEntry || - mType instanceof SequenceEntry || - mType instanceof StringEntry || - !member.arrayInfo ().isEmpty ()) - index = ((JavaGenerator)member.generator ()).read (index, indent, name + '.' + memberName, member, stream); - else - stream.println (indent + name + '.' + memberName + " = " + - Util.helperName (mType, true) + ".read (istream);"); // - } - - return index; - } // read - - /** - * d62023 - call super._write() - **/ - public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) - { - // First do the state members from concrete parent hierarchy - Vector vParents = ((ValueEntry)entry).derivedFrom (); - if (vParents != null && vParents.size () != 0) - { - ValueEntry parent = (ValueEntry)vParents.elementAt (0); - if (parent == null) - return index; - // call super._read if non-abstract value parent - if ((!parent.isAbstract ()) && (! Util.javaQualifiedName(parent).equals ("java.io.Serializable"))) // - stream.println(indent + "super._write (ostream);"); - } - - Vector vMembers = ((ValueEntry) entry ).state (); - int noOfMembers = vMembers == null ? 0 : vMembers.size (); - for (int k = 0; k < noOfMembers; k++) - { - TypedefEntry member = (TypedefEntry)((InterfaceState)vMembers.elementAt (k)).entry; - String memberName = member.name (); - SymtabEntry mType = member.type (); - - if (mType instanceof PrimitiveEntry || - mType instanceof TypedefEntry || - mType instanceof SequenceEntry || - mType instanceof StringEntry || - !member.arrayInfo ().isEmpty ()) - index = ((JavaGenerator)member.generator ()).write (index, indent, name + '.' + memberName, member, stream); - else - stream.println (indent + Util.helperName (mType, true) + // - ".write (ostream, " + name + '.' + memberName + ");"); - } - - return index; - } // write - - /** - * d62023 - generate factory interface and default factory - **/ - public void generate (Hashtable symbolTable, ValueEntry v, PrintWriter str) - { - this.symbolTable = symbolTable; - this.v = v; - init (); - - openStream (); - if (stream == null) - return; - generateTie (); - generateHelper (); - generateHolder (); - if (!v.isAbstract ()) { - generateValueFactory (); - generateDefaultFactory (); - } - writeHeading (); - writeBody (); - writeClosing (); - closeStream (); - } // generate - - /** - * - **/ - protected void generateValueFactory () - { - ((Factories)Compile.compiler.factories ()).valueFactory ().generate (symbolTable, v); - } // generateValueFactory - - /** - * - **/ - protected void generateDefaultFactory () - { - ((Factories)Compile.compiler.factories ()).defaultFactory ().generate (symbolTable, v); - } // generateDefaultFactory -} diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable.prp b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable.prp deleted file mode 100644 index a6611ad1e2c..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable.prp +++ /dev/null @@ -1,111 +0,0 @@ -# -# Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# -# COMPONENT_NAME: idl.toJava -# -# ORIGINS: 27 -# -# Licensed Materials - Property of IBM -# 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 -# RMI-IIOP v1.0 -# -# -# Translator: Each line below is of the form "=". -# The keys are NOT to be translated. -# The messages ARE to be translated. -# -# DO NOT translate the following: -# IBM -# IDL -# Java -# -# %0 is a parameter to the message. Do not translate it. -# -# A backslash (\) at the end of a line is a line continuation -# character. A backslash at the beginning of a line means don't -# ignore leading blanks (they normally are). These backslashes -# should remain in the message. -# -# Translator: Start Translating -# -toJavaProlog1=Generated by the %0 -toJavaProlog2=from %0 -PreEmit.indeterminateTypeInfo=Cannot determine type infomation for %0. -InterfaceGen.noImpl=No local implementation found for %0. -Version.product=IDL-to-Java compiler (portable), version "%0" -Version.number=3.2 -NameModifier.TooManyPercent=Pattern contains more than one percent characters -NameModifier.NoPercent=Pattern does not contain a percent character -NameModifier.InvalidChar=Pattern contains an invalid character %0 -# -# Translator: In the list of options below, do not translate: -# -d, -emitAll, -f, -i, -keep, -m, -sep, -pkgPrefix, -td, -v, -verbose, -version, -implbase -# Do not translate the string "java com.sun.tools.corba.se.idl.toJavaPortable.Compile" -# -usage=Compiler Usage:\n\ -\n\ -\ java com.sun.tools.corba.se.idl.toJavaPortable.Compile [options] \n\ -\n\ -where is the name of a file containing IDL definitions, and\n\ -[options] is any combination of the options listed below. The options\n\ -are optional and may appear in any order; is required and\n\ -must appear last.\n\ -\ \n\ -Options:\n\ - -d This is equivalent to the following line in an\n\ -\ IDL file: #define \n\ - -emitAll Emit all types, including those found in #included files.\n\ - -f Define what bindings to emit. is one of client,\n\ -\ server, all, serverTIE, allTIE. serverTIE and allTIE\n\ -\ cause delegate model skeletons to be emitted. If this\n\ -\ flag is not used, -fclient is assumed.\n\ - -i By default, the current directory is scanned for\n\ -\ included files. This option adds another directory.\n\ - -keep If a file to be generated already exists, do not\n\ -\ overwrite it. By default it is overwritten.\n\ - -noWarn Suppress warnings.\n\ - -oldImplBase Generate skeletons compatible with old (pre-1.4) JDK ORBs.\n\ - -pkgPrefix When the type or module name is encountered at\n\ -\ file scope, begin the Java package name for all files\n\ -\ generated for with .\n\ - -pkgTranslate When the type or module name in encountered, replace\n\ -\ it with in the generated java package. Note that\n\ -\ pkgPrefix changes are made first. must match the\n\ -\ full package name exactly. Also, must not be\n\ -\ org, org.omg, or any subpackage of org.omg.\n\ - -skeletonName Name the skeleton according to the pattern.\n\ -\ The defaults are:\n\ -\ %POA for the POA base class (-fserver or -fall) \n\ -\ _%ImplBase for the oldImplBase base class\n\ -\ (-oldImplBase and (-fserver or -fall)).\n\ - -td use for the output directory instead of\n\ -\ the current directory.\n\ - -tieName Name the tie according to the pattern. The defaults are:\n\ -\ %POATie for the POA tie (-fserverTie or -fallTie) \n\ -\ %_Tie for the oldImplBase tie\n\ -\ (-oldImplBase and (-fserverTie or -fallTie)).\n\ - -v, -verbose Verbose mode.\n\ - -version Display the version number and quit.\n diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable_ja.prp b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable_ja.prp deleted file mode 100644 index 52bb4f311cf..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable_ja.prp +++ /dev/null @@ -1,69 +0,0 @@ -# -# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# -# COMPONENT_NAME: idl.toJava -# -# ORIGINS: 27 -# -# Licensed Materials - Property of IBM -# 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 -# RMI-IIOP v1.0 -# -# -# Translator: Each line below is of the form "=". -# The keys are NOT to be translated. -# The messages ARE to be translated. -# -# DO NOT translate the following: -# IBM -# IDL -# Java -# -# %0 is a parameter to the message. Do not translate it. -# -# A backslash (\) at the end of a line is a line continuation -# character. A backslash at the beginning of a line means don't -# ignore leading blanks (they normally are). These backslashes -# should remain in the message. -# -# Translator: Start Translating -# -toJavaProlog1=%0\u306B\u3088\u3063\u3066\u751F\u6210\u3055\u308C\u307E\u3057\u305F -toJavaProlog2=%0\u304B\u3089 -PreEmit.indeterminateTypeInfo=%0\u306E\u30BF\u30A4\u30D7\u60C5\u5831\u3092\u5224\u5225\u3067\u304D\u307E\u305B\u3093\u3002 -InterfaceGen.noImpl=%0\u306E\u30ED\u30FC\u30AB\u30EB\u5B9F\u88C5\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002 -Version.product=IDL-to-Java\u30B3\u30F3\u30D1\u30A4\u30E9(\u30DD\u30FC\u30BF\u30D6\u30EB)\u3001\u30D0\u30FC\u30B8\u30E7\u30F3"%0" -Version.number=3.2 -NameModifier.TooManyPercent=\u30D1\u30BF\u30FC\u30F3\u306B\u8907\u6570\u306E\u30D1\u30FC\u30BB\u30F3\u30C8\u6587\u5B57\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059 -NameModifier.NoPercent=\u30D1\u30BF\u30FC\u30F3\u306B\u30D1\u30FC\u30BB\u30F3\u30C8\u6587\u5B57\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u305B\u3093 -NameModifier.InvalidChar=\u30D1\u30BF\u30FC\u30F3\u306B\u7121\u52B9\u306A\u6587\u5B57%0\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059 -# -# Translator: In the list of options below, do not translate: -# -d, -emitAll, -f, -i, -keep, -m, -sep, -pkgPrefix, -td, -v, -verbose, -version, -implbase -# Do not translate the string "java com.sun.tools.corba.se.idl.toJavaPortable.Compile" -# -usage=\u30B3\u30F3\u30D1\u30A4\u30E9\u306E\u4F7F\u7528\u65B9\u6CD5:\n\n java com.sun.tools.corba.se.idl.toJavaPortable.Compile [options] \n\n\u306FIDL\u5B9A\u7FA9\u3092\u542B\u3080\u30D5\u30A1\u30A4\u30EB\u306E\u540D\u524D\u3067\u3001\n[options]\u306F\u6B21\u306B\u30EA\u30B9\u30C8\u3059\u308B\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u7D44\u5408\u305B\u3067\u3059\u3002\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\n\u7701\u7565\u53EF\u80FD\u3067\u3001\u4EFB\u610F\u306E\u9806\u5E8F\u3067\u8868\u793A\u3055\u308C\u307E\u3059\u3002\u306F\u5FC5\u9808\u3067\u3001\n\u6700\u5F8C\u306B\u8868\u793A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n \n\u30AA\u30D7\u30B7\u30E7\u30F3:\n-d IDL\u30D5\u30A1\u30A4\u30EB\u306E\u6B21\u306E\u884C\u3068\n \u540C\u3058\u3067\u3059: #define \n-emitAll #included\u30D5\u30A1\u30A4\u30EB\u3067\u898B\u3064\u304B\u3063\u305F\u30BF\u30A4\u30D7\u3092\u542B\u3080\u3001\u3059\u3079\u3066\u306E\u30BF\u30A4\u30D7\u3092\u767A\u884C\u3057\u307E\u3059\u3002\n-f \u767A\u884C\u3059\u308B\u30D0\u30A4\u30F3\u30C7\u30A3\u30F3\u30B0\u3092\u5B9A\u7FA9\u3057\u307E\u3059\u3002\u306Fclient\u3001\n server\u3001all\u3001serverTIE\u3001allTIE\u306E\u3044\u305A\u308C\u304B\u3067\u3059\u3002serverTIE\u3068allTIE\u306F\n \u59D4\u4EFB\u30E2\u30C7\u30EB\u30FB\u30B9\u30B1\u30EB\u30C8\u30F3\u3092\u767A\u884C\u3057\u307E\u3059\u3002\u3053\u306E\u30D5\u30E9\u30B0\u3092\n \u4F7F\u7528\u3057\u306A\u3044\u5834\u5408\u306F\u3001-fclient\u3068\u307F\u306A\u3055\u308C\u307E\u3059\u3002\n-i \u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u3001\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30A4\u30F3\u30AF\u30EB\u30FC\u30C9\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB\u304C\n \u30B9\u30AD\u30E3\u30F3\u3055\u308C\u307E\u3059\u3002\u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u5225\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u8FFD\u52A0\u3057\u307E\u3059\u3002\n-keep \u751F\u6210\u3055\u308C\u308B\u30D5\u30A1\u30A4\u30EB\u304C\u3059\u3067\u306B\u5B58\u5728\u3059\u308B\u5834\u5408\u306F\u3001\u4E0A\u66F8\u304D\n \u3057\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u4E0A\u66F8\u304D\u3055\u308C\u307E\u3059\u3002\n-noWarn \u8B66\u544A\u3092\u51FA\u3055\u306A\u3044\u3088\u3046\u306B\u3057\u307E\u3059\u3002\n-oldImplBase \u53E4\u3044(1.4\u4EE5\u524D) JDK ORB\u3068\u4E92\u63DB\u6027\u306E\u3042\u308B\u30B9\u30B1\u30EB\u30C8\u30F3\u3092\u751F\u6210\u3057\u307E\u3059\u3002\n-pkgPrefix \u30D5\u30A1\u30A4\u30EB\u30FB\u30B9\u30B3\u30FC\u30D7\u3067\u30BF\u30A4\u30D7\u307E\u305F\u306F\u30E2\u30B8\u30E5\u30FC\u30EB\u540D\u304C\u691C\u51FA\u3055\u308C\u305F\u5834\u5408\u3001\n \u306B\u5BFE\u3057\u3066\u751F\u6210\u3055\u308C\u305F\u3059\u3079\u3066\u306E\u30D5\u30A1\u30A4\u30EB\u306EJava\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u3092\n \u3067\u59CB\u3081\u307E\u3059\u3002\n-pkgTranslate \u30BF\u30A4\u30D7\u307E\u305F\u306F\u30E2\u30B8\u30E5\u30FC\u30EB\u540D\u304C\u691C\u51FA\u3055\u308C\u305F\u5834\u5408\u3001\n \u751F\u6210\u3055\u308C\u305FJava\u30D1\u30C3\u30B1\u30FC\u30B8\u5185\u3067\u306B\u7F6E\u63DB\u3055\u308C\u307E\u3059\u3002pkgPrefix\u306E\n \u5909\u66F4\u304C\u5148\u306B\u884C\u308F\u308C\u308B\u3053\u3068\u306B\u6CE8\u610F\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u306F\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\n \u6B63\u5F0F\u540D\u3068\u5B8C\u5168\u306B\u4E00\u81F4\u3057\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u307E\u305F\u3001\u3092\n \ -org\u3001org.omg\u307E\u305F\u306Forg.omg\u306E\u30B5\u30D6\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002\n-skeletonName \u30D1\u30BF\u30FC\u30F3\u306B\u5F93\u3063\u3066\u30B9\u30B1\u30EB\u30C8\u30F3\u306B\u540D\u524D\u3092\u4ED8\u3051\u307E\u3059\u3002\n \u30C7\u30D5\u30A9\u30EB\u30C8\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n POA\u30D9\u30FC\u30B9\u30FB\u30AF\u30E9\u30B9\u306E\u5834\u5408\u306F%POA (-fserver\u307E\u305F\u306F-fall) \n oldImplBase\u30D9\u30FC\u30B9\u30FB\u30AF\u30E9\u30B9\u306E\u5834\u5408\u306F_%ImplBase\n (-oldImplBase\u304A\u3088\u3073(-fserver\u307E\u305F\u306F-fall))\u3002\n-td \u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u306F\u3001\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u304B\u308F\u308A\u306B\u3092\n \u4F7F\u7528\u3057\u307E\u3059\u3002\n-tieName \u30D1\u30BF\u30FC\u30F3\u306B\u5F93\u3063\u3066tie\u306B\u540D\u524D\u3092\u4ED8\u3051\u307E\u3059\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n POA tie\u306E\u5834\u5408\u306F%POATie (-fserverTie\u307E\u305F\u306F-fallTie) \n oldImplBase tie\u306E\u5834\u5408\u306F%_Tie\n (-oldImplBase\u304A\u3088\u3073(-fserverTie\u307E\u305F\u306F-fallTie))\u3002\n-v, -verbose \u8A73\u7D30\u30E2\u30FC\u30C9\u3002\n-version \u30D0\u30FC\u30B8\u30E7\u30F3\u756A\u53F7\u3092\u8868\u793A\u3057\u3066\u7D42\u4E86\u3057\u307E\u3059\u3002\n diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable_zh_CN.prp b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable_zh_CN.prp deleted file mode 100644 index f436137378b..00000000000 --- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable_zh_CN.prp +++ /dev/null @@ -1,68 +0,0 @@ -# -# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# -# COMPONENT_NAME: idl.toJava -# -# ORIGINS: 27 -# -# Licensed Materials - Property of IBM -# 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999 -# RMI-IIOP v1.0 -# -# -# Translator: Each line below is of the form "=". -# The keys are NOT to be translated. -# The messages ARE to be translated. -# -# DO NOT translate the following: -# IBM -# IDL -# Java -# -# %0 is a parameter to the message. Do not translate it. -# -# A backslash (\) at the end of a line is a line continuation -# character. A backslash at the beginning of a line means don't -# ignore leading blanks (they normally are). These backslashes -# should remain in the message. -# -# Translator: Start Translating -# -toJavaProlog1=\u7531%0\u751F\u6210 -toJavaProlog2=\u4ECE%0 -PreEmit.indeterminateTypeInfo=\u65E0\u6CD5\u786E\u5B9A%0\u7684\u7C7B\u578B\u4FE1\u606F\u3002 -InterfaceGen.noImpl=\u627E\u4E0D\u5230%0\u7684\u672C\u5730\u5B9E\u73B0\u3002 -Version.product=IDL-to-Java \u7F16\u8BD1\u5668 (\u53EF\u79FB\u690D), \u7248\u672C "%0" -Version.number=3.2 -NameModifier.TooManyPercent=\u6A21\u5F0F\u4E2D\u5305\u542B\u591A\u4E2A\u767E\u5206\u6BD4\u5B57\u7B26 -NameModifier.NoPercent=\u6A21\u5F0F\u4E2D\u4E0D\u5305\u542B\u767E\u5206\u6BD4\u5B57\u7B26 -NameModifier.InvalidChar=\u6A21\u5F0F\u4E2D\u5305\u542B\u65E0\u6548\u5B57\u7B26 %0 -# -# Translator: In the list of options below, do not translate: -# -d, -emitAll, -f, -i, -keep, -m, -sep, -pkgPrefix, -td, -v, -verbose, -version, -implbase -# Do not translate the string "java com.sun.tools.corba.se.idl.toJavaPortable.Compile" -# -usage=\u7F16\u8BD1\u5668\u7528\u6CD5:\n\n java com.sun.tools.corba.se.idl.toJavaPortable.Compile [\u9009\u9879] \n\n\u5176\u4E2D, \u662F\u5305\u542B IDL \u5B9A\u4E49\u7684\u6587\u4EF6\u7684\u540D\u79F0, \u800C\n[\u9009\u9879] \u662F\u4E0B\u5217\u9009\u9879\u7684\u4EFB\u610F\u7EC4\u5408\u3002\u9009\u9879\n\u662F\u53EF\u9009\u7684, \u5E76\u4E14\u663E\u793A\u987A\u5E8F\u5E76\u4E0D\u56FA\u5B9A; \u662F\u5FC5\u9700\u7684,\n\u5E76\u4E14\u5FC5\u987B\u663E\u793A\u5728\u6700\u540E\u3002\n \n\u9009\u9879:\n-d <\u7B26\u53F7> \u8FD9\u7B49\u540C\u4E8E IDL \u6587\u4EF6\u4E2D\u7684\n \u4E0B\u9762\u4E00\u884C: #define <\u7B26\u53F7>\n-emitAll \u53D1\u51FA\u6240\u6709\u7C7B\u578B, \u5305\u62EC\u5728 #included \u6587\u4EF6\u4E2D\u627E\u5230\u7684\u7C7B\u578B\u3002\n-f \u5B9A\u4E49\u8981\u53D1\u51FA\u54EA\u4E9B\u7ED1\u5B9A\u3002 \u662F client,\n server, all, serverTIE, allTIE \u4E4B\u4E00\u3002serverTIE \u548C allTIE\n \u5BFC\u81F4\u53D1\u51FA\u59D4\u6D3E\u6A21\u578B\u9AA8\u67B6\u3002\u5982\u679C\u672A\u4F7F\u7528\n \u6B64\u6807\u8BB0, \u5C06\u5047\u5B9A\u4E3A -fclient\u3002\n-i <\u5305\u542B\u8DEF\u5F84> \u9ED8\u8BA4\u60C5\u51B5\u4E0B, \u5C06\u5728\u5F53\u524D\u76EE\u5F55\u4E2D\u626B\u63CF\n \u5305\u542B\u7684\u6587\u4EF6\u3002\u6B64\u9009\u9879\u5C06\u6DFB\u52A0\u53E6\u4E00\u4E2A\u76EE\u5F55\u3002\n-keep \u5982\u679C\u8981\u751F\u6210\u7684\u6587\u4EF6\u5DF2\u5B58\u5728, \u8BF7\u4E0D\u8981\n \u8986\u76D6\u5B83\u3002\u9ED8\u8BA4\u60C5\u51B5\u4E0B\u4F1A\u8986\u76D6\u5B83\u3002\n-noWarn \u9690\u85CF\u8B66\u544A\u3002\n-oldImplBase \u751F\u6210\u4E0E\u65E7\u7248 (1.4 \u7248\u4E4B\u524D) JDK ORB \u517C\u5BB9\u7684\u9AA8\u67B6\u3002\n-pkgPrefix <\u524D\u7F00> \u5F53\u5728\u6587\u4EF6\u8303\u56F4\u5185\u9047\u5230\u7C7B\u578B\u6216\u6A21\u5757\u540D \u65F6,\n \u5728\u4E3A \u751F\u6210\u7684\u6240\u6709\u6587\u4EF6\u7684 Java \u7A0B\u5E8F\u5305\u540D\u524D\n \u6DFB\u52A0 <\u524D\u7F00>\u3002\n-pkgTranslate \u5F53\u9047\u5230\u7C7B\u578B\u6216\u6A21\u5757\u540D \u65F6, \u5728\n \u751F\u6210\u7684 Java \u7A0B\u5E8F\u5305\u4E2D\u5C06\u5176\u66FF\u6362\u4E3A \u3002\u8BF7\u6CE8\u610F, \n \u5C06\u9996\u5148\u8FDB\u884C pkgPrefix \u66F4\u6539\u3002 \u5FC5\u987B\u4E0E\n \u5B8C\u6574\u7A0B\u5E8F\u5305\u540D\u5B8C\u5168\u5339\u914D\u3002\u53E6\u5916, \u4E0D\u80FD\u4E3A\n org, org.omg \u6216 org.omg \u7684\u4EFB\u4F55\u5B50\u7A0B\u5E8F\u5305\u3002\n-skeletonName \u6839\u636E\u6A21\u5F0F\u547D\u540D\u9AA8\u67B6\u3002\n \u9ED8\u8BA4\u503C\u4E3A:\n %POA \u8868\u793A POA \u57FA\u7C7B (-fserver \u6216 -fall) \n _%ImplBase \u8868\u793A oldImplBase \u57FA\u7C7B\n (-oldImplBase \u548C (-fserver \u6216 -fall))\u3002\n-td \u4F7F\u7528 \u8868\u793A\u8F93\u51FA\u76EE\u5F55\u4EE5\u4EE3\u66FF\n \u5F53\u524D\u76EE\u5F55\u3002\n-tieName \u6839\u636E\u6A21\u5F0F\u547D\u540D tie\u3002\u9ED8\u8BA4\u503C\u4E3A:\n %POATie \u8868\u793A POA tie (-fserverTie \u6216 -fallTie) \n %_Tie \u8868\u793A oldImplBase tie\n (-oldImplBase \u548C (-fserverTie \u6216 -fallTie))\u3002\n-v, -verbose \u8BE6\u7EC6\u6A21\u5F0F\u3002\n-version \u663E\u793A\u7248\u672C\u53F7\u5E76\u9000\u51FA\u3002\n diff --git a/src/java.corba/share/classes/javax/activity/ActivityCompletedException.java b/src/java.corba/share/classes/javax/activity/ActivityCompletedException.java deleted file mode 100644 index 79899221e85..00000000000 --- a/src/java.corba/share/classes/javax/activity/ActivityCompletedException.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package javax.activity; - -/** - * This exception may be thrown on any method for which Activity context is - * accessed and indicates that ongoing work within the Activity is not - * possible. This may be because the Activity has been instructed to complete - * with CompletionStatusFailOnly or has ended as a result of a timeout. This - * exception will be propagated across ORB boundaries via an - * org.omg.CORBA.ACTIVITY_COMPLETED system exception. An application should - * handle this error by attempting to complete the Activity. - */ -public class ActivityCompletedException extends java.rmi.RemoteException -{ - /** - * Constructs a new instance with null as its detail message. - */ - public ActivityCompletedException() { super(); } - - /** - * Constructs a new instance with the specified detail message. - * - * @param message the detail message. - */ - public ActivityCompletedException(String message) { - super(message); - } - - /** - * Constructs a new throwable with the specified cause. - * - * @param cause a chained exception of type - * Throwable. - */ - public ActivityCompletedException(Throwable cause) { - this("", cause); - } - - /** - * Constructs a new throwable with the specified detail message and cause. - * - * @param message the detail message. - * - * @param cause a chained exception of type - * Throwable. - */ - public ActivityCompletedException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/src/java.corba/share/classes/javax/activity/ActivityRequiredException.java b/src/java.corba/share/classes/javax/activity/ActivityRequiredException.java deleted file mode 100644 index ce44b1798b1..00000000000 --- a/src/java.corba/share/classes/javax/activity/ActivityRequiredException.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package javax.activity; - -/** - * This exception is thrown by a container if Activity context is not received - * on a method for which Activity context is mandatory. This exception - * indicates a deployment or application configuration error. This exception - * will be propagated across ORB boundaries via an - * org.omg.CORBA.ACTIVITY_REQUIRED system exception. - */ -public class ActivityRequiredException extends java.rmi.RemoteException -{ - /** - * Constructs a new instance with null as its detail message. - */ - public ActivityRequiredException() { super(); } - - /** - * Constructs a new instance with the specified detail message. - * - * @param message the detail message. - */ - public ActivityRequiredException(String message) { - super(message); - } - - /** - * Constructs a new throwable with the specified cause. - * - * @param cause a chained exception of type - * Throwable. - */ - public ActivityRequiredException(Throwable cause) { - this("", cause); - } - - /** - * Constructs a new throwable with the specified detail message and cause. - * - * @param message the detail message. - * - * @param cause a chained exception of type - * Throwable. - */ - public ActivityRequiredException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/src/java.corba/share/classes/javax/activity/InvalidActivityException.java b/src/java.corba/share/classes/javax/activity/InvalidActivityException.java deleted file mode 100644 index 73feb0363dc..00000000000 --- a/src/java.corba/share/classes/javax/activity/InvalidActivityException.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package javax.activity; - -/** - * This exception may be thrown on any method for which Activity context - * is accessed and indicates that the attempted invocation or the Activity - * context associated with the attempted invocation is incompatible with - * the Activity's current state. It may also be thrown by a container if - * Activity context is received on a method for which Activity context is - * forbidden. This exception will be propagated across J2EE Activity Service - * ORB boundaries via an org.omg.CORBA.INVALID_ACTIVITY system exception. - * An application should handle this error by attempting to complete the - * Activity. - */ -public class InvalidActivityException extends java.rmi.RemoteException -{ - /** - * Constructs a new instance with null as its detail message. - */ - public InvalidActivityException() { super(); } - - /** - * Constructs a new instance with the specified detail message. - * - * @param message the detail message. - */ - public InvalidActivityException(String message) { - super(message); - } - - /** - * Constructs a new throwable with the specified cause. - * - * @param cause a chained exception of type - * Throwable. - */ - public InvalidActivityException(Throwable cause) { - this("", cause); - } - - /** - * Constructs a new throwable with the specified detail message and cause. - * - * @param message the detail message. - * - * @param cause a chained exception of type - * Throwable. - */ - public InvalidActivityException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/src/java.corba/share/classes/javax/activity/package.html b/src/java.corba/share/classes/javax/activity/package.html deleted file mode 100644 index d9696cc090a..00000000000 --- a/src/java.corba/share/classes/javax/activity/package.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - -Contains Activity service related exceptions thrown by the ORB machinery during -unmarshalling. - -@since 1.5 - - diff --git a/src/java.corba/share/classes/javax/rmi/CORBA/ClassDesc.java b/src/java.corba/share/classes/javax/rmi/CORBA/ClassDesc.java deleted file mode 100644 index 15c6af935a4..00000000000 --- a/src/java.corba/share/classes/javax/rmi/CORBA/ClassDesc.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package javax.rmi.CORBA; - -/** - * This class is used to marshal java.lang.Class objects over IIOP. - */ -public class ClassDesc implements java.io.Serializable { - - /** - * @serial The class's RepositoryId. - */ - private String repid; - - /** - * @serial A space-separated list of codebase URLs. - */ - private String codebase; -} diff --git a/src/java.corba/share/classes/javax/rmi/CORBA/GetORBPropertiesFileAction.java b/src/java.corba/share/classes/javax/rmi/CORBA/GetORBPropertiesFileAction.java deleted file mode 100644 index 064753eaa7d..00000000000 --- a/src/java.corba/share/classes/javax/rmi/CORBA/GetORBPropertiesFileAction.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * (C) Copyright IBM Corp. 1993 - 1997 - All Rights Reserved - * - * The original version of this source code and documentation is - * copyrighted and owned by IBM, Inc. These materials are provided under - * terms of a License Agreement between IBM and Sun. This technology is - * protected by multiple US and International patents. This notice and - * attribution to IBM may not be removed. - * - */ - - -package javax.rmi.CORBA; - -import java.io.IOException; -import java.io.File; -import java.io.FileInputStream; - -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.Properties; - -class GetORBPropertiesFileAction implements PrivilegedAction { - private boolean debug = false ; - - public GetORBPropertiesFileAction () { - } - - private String getSystemProperty(final String name) { - // This will not throw a SecurityException because this - // class was loaded from rt.jar using the bootstrap classloader. - String propValue = (String) AccessController.doPrivileged( - new PrivilegedAction() { - public java.lang.Object run() { - return System.getProperty(name); - } - } - ); - - return propValue; - } - - private void getPropertiesFromFile( Properties props, String fileName ) - { - try { - File file = new File( fileName ) ; - if (!file.exists()) - return ; - - FileInputStream in = new FileInputStream( file ) ; - - try { - props.load( in ) ; - } finally { - in.close() ; - } - } catch (Exception exc) { - if (debug) - System.out.println( "ORB properties file " + fileName + - " not found: " + exc) ; - } - } - - public Object run() - { - Properties defaults = new Properties() ; - - String javaHome = getSystemProperty( "java.home" ) ; - String fileName = javaHome + File.separator + "lib" + File.separator + - "orb.properties" ; - - getPropertiesFromFile( defaults, fileName ) ; - - Properties results = new Properties( defaults ) ; - - String userHome = getSystemProperty( "user.home" ) ; - fileName = userHome + File.separator + "orb.properties" ; - - getPropertiesFromFile( results, fileName ) ; - return results ; - } -} diff --git a/src/java.corba/share/classes/javax/rmi/CORBA/PortableRemoteObjectDelegate.java b/src/java.corba/share/classes/javax/rmi/CORBA/PortableRemoteObjectDelegate.java deleted file mode 100644 index b4aaa9d1b47..00000000000 --- a/src/java.corba/share/classes/javax/rmi/CORBA/PortableRemoteObjectDelegate.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package javax.rmi.CORBA; - -import java.rmi.RemoteException; -import java.rmi.NoSuchObjectException; -import java.rmi.Remote; - -/** - * Supports delegation for method implementations in {@link javax.rmi.PortableRemoteObject}. - * The delegate is a singleton instance of a class that implements this - * interface and provides a replacement implementation for all the - * methods of javax.rmi.PortableRemoteObject. - * - * Delegates are enabled by providing the delegate's class name as the - * value of the - * javax.rmi.CORBA.PortableRemoteObjectClass - * system property. - * - * @see javax.rmi.PortableRemoteObject - */ -public interface PortableRemoteObjectDelegate { - - /** - * Delegation call for {@link javax.rmi.PortableRemoteObject#exportObject}. - */ - void exportObject(Remote obj) - throws RemoteException; - - /** - * Delegation call for {@link javax.rmi.PortableRemoteObject#toStub}. - */ - Remote toStub (Remote obj) - throws NoSuchObjectException; - - /** - * Delegation call for {@link javax.rmi.PortableRemoteObject#unexportObject}. - */ - void unexportObject(Remote obj) - throws NoSuchObjectException; - - /** - * Delegation call for {@link javax.rmi.PortableRemoteObject#narrow}. - */ - java.lang.Object narrow (java.lang.Object narrowFrom, - java.lang.Class narrowTo) - throws ClassCastException; - - /** - * Delegation call for {@link javax.rmi.PortableRemoteObject#connect}. - */ - void connect (Remote target, Remote source) - throws RemoteException; - -} diff --git a/src/java.corba/share/classes/javax/rmi/CORBA/Stub.java b/src/java.corba/share/classes/javax/rmi/CORBA/Stub.java deleted file mode 100644 index 507b262a29c..00000000000 --- a/src/java.corba/share/classes/javax/rmi/CORBA/Stub.java +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package javax.rmi.CORBA; - -import org.omg.CORBA.ORB; -import org.omg.CORBA.INITIALIZE; -import org.omg.CORBA_2_3.portable.ObjectImpl; - -import java.io.IOException; -import java.rmi.RemoteException; -import java.io.File; -import java.io.FileInputStream; -import java.net.MalformedURLException ; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.Properties; -import java.rmi.server.RMIClassLoader; - -import com.sun.corba.se.impl.orbutil.GetPropertyAction; - - -/** - * Base class from which all RMI-IIOP stubs must inherit. - */ -public abstract class Stub extends ObjectImpl - implements java.io.Serializable { - - private static final long serialVersionUID = 1087775603798577179L; - - // This can only be set at object construction time (no sync necessary). - private transient StubDelegate stubDelegate = null; - private static Class stubDelegateClass = null; - private static final String StubClassKey = "javax.rmi.CORBA.StubClass"; - - static { - Object stubDelegateInstance = createDelegate(StubClassKey); - if (stubDelegateInstance != null) - stubDelegateClass = stubDelegateInstance.getClass(); - } - - - /** - * Returns a hash code value for the object which is the same for all stubs - * that represent the same remote object. - * @return the hash code value. - */ - public int hashCode() { - - if (stubDelegate == null) { - setDefaultDelegate(); - } - - if (stubDelegate != null) { - return stubDelegate.hashCode(this); - } - - return 0; - } - - /** - * Compares two stubs for equality. Returns true when used to compare stubs - * that represent the same remote object, and false otherwise. - * @param obj the reference object with which to compare. - * @return true if this object is the same as the obj - * argument; false otherwise. - */ - public boolean equals(java.lang.Object obj) { - - if (stubDelegate == null) { - setDefaultDelegate(); - } - - if (stubDelegate != null) { - return stubDelegate.equals(this, obj); - } - - return false; - } - - /** - * Returns a string representation of this stub. Returns the same string - * for all stubs that represent the same remote object. - * @return a string representation of this stub. - */ - public String toString() { - - - if (stubDelegate == null) { - setDefaultDelegate(); - } - - String ior; - if (stubDelegate != null) { - ior = stubDelegate.toString(this); - if (ior == null) { - return super.toString(); - } else { - return ior; - } - } - return super.toString(); - } - - /** - * Connects this stub to an ORB. Required after the stub is deserialized - * but not after it is demarshalled by an ORB stream. If an unconnected - * stub is passed to an ORB stream for marshalling, it is implicitly - * connected to that ORB. Application code should not call this method - * directly, but should call the portable wrapper method - * {@link javax.rmi.PortableRemoteObject#connect}. - * @param orb the ORB to connect to. - * @exception RemoteException if the stub is already connected to a different - * ORB, or if the stub does not represent an exported remote or local object. - */ - public void connect(ORB orb) throws RemoteException { - - if (stubDelegate == null) { - setDefaultDelegate(); - } - - if (stubDelegate != null) { - stubDelegate.connect(this, orb); - } - - } - - /** - * Serialization method to restore the IOR state. - */ - private void readObject(java.io.ObjectInputStream stream) - throws IOException, ClassNotFoundException { - - if (stubDelegate == null) { - setDefaultDelegate(); - } - - if (stubDelegate != null) { - stubDelegate.readObject(this, stream); - } - - } - - /** - * Serialization method to save the IOR state. - * @serialData The length of the IOR type ID (int), followed by the IOR type ID - * (byte array encoded using ISO8859-1), followed by the number of IOR profiles - * (int), followed by the IOR profiles. Each IOR profile is written as a - * profile tag (int), followed by the length of the profile data (int), followed - * by the profile data (byte array). - */ - private void writeObject(java.io.ObjectOutputStream stream) throws IOException { - - if (stubDelegate == null) { - setDefaultDelegate(); - } - - if (stubDelegate != null) { - stubDelegate.writeObject(this, stream); - } - } - - private void setDefaultDelegate() { - if (stubDelegateClass != null) { - try { - stubDelegate = (javax.rmi.CORBA.StubDelegate) stubDelegateClass.newInstance(); - } catch (Exception ex) { - // what kind of exception to throw - // delegate not set therefore it is null and will return default - // values - } - } - } - - // Same code as in PortableRemoteObject. Can not be shared because they - // are in different packages and the visibility needs to be package for - // security reasons. If you know a better solution how to share this code - // then remove it from PortableRemoteObject. Also in Util.java - private static Object createDelegate(String classKey) { - String className = (String) - AccessController.doPrivileged(new GetPropertyAction(classKey)); - if (className == null) { - Properties props = getORBPropertiesFile(); - if (props != null) { - className = props.getProperty(classKey); - } - } - - if (className == null) { - return new com.sun.corba.se.impl.javax.rmi.CORBA.StubDelegateImpl(); - } - - try { - return loadDelegateClass(className).newInstance(); - } catch (ClassNotFoundException ex) { - INITIALIZE exc = new INITIALIZE( "Cannot instantiate " + className); - exc.initCause( ex ) ; - throw exc ; - } catch (Exception ex) { - INITIALIZE exc = new INITIALIZE( "Error while instantiating" + className); - exc.initCause( ex ) ; - throw exc ; - } - - } - - private static Class loadDelegateClass( String className ) throws ClassNotFoundException - { - try { - ClassLoader loader = Thread.currentThread().getContextClassLoader(); - return Class.forName(className, false, loader); - } catch (ClassNotFoundException e) { - // ignore, then try RMIClassLoader - } - - try { - return RMIClassLoader.loadClass(className); - } catch (MalformedURLException e) { - String msg = "Could not load " + className + ": " + e.toString(); - ClassNotFoundException exc = new ClassNotFoundException( msg ) ; - throw exc ; - } - } - - /** - * Load the orb.properties file. - */ - private static Properties getORBPropertiesFile () { - return (Properties) AccessController.doPrivileged(new GetORBPropertiesFileAction()); - } - -} diff --git a/src/java.corba/share/classes/javax/rmi/CORBA/StubDelegate.java b/src/java.corba/share/classes/javax/rmi/CORBA/StubDelegate.java deleted file mode 100644 index 5932f2644e8..00000000000 --- a/src/java.corba/share/classes/javax/rmi/CORBA/StubDelegate.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package javax.rmi.CORBA; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.rmi.RemoteException; -import org.omg.CORBA.ORB; - -/** - * Supports delegation for method implementations in {@link Stub}. - * A delegate is an instance of a class that implements this - * interface and provides a replacement implementation for all the - * methods of javax.rmi.CORBA.Stub. If delegation is - * enabled, each stub has an associated delegate. - * - * Delegates are enabled by providing the delegate's class name as the - * value of the - * javax.rmi.CORBA.StubClass - * system property. - * - * @see Stub - */ -public interface StubDelegate { - - /** - * Delegation call for {@link Stub#hashCode}. - */ - int hashCode(Stub self); - - /** - * Delegation call for {@link Stub#equals}. - */ - boolean equals(Stub self, java.lang.Object obj); - - /** - * Delegation call for {@link Stub#toString}. - */ - String toString(Stub self); - - /** - * Delegation call for {@link Stub#connect}. - */ - void connect(Stub self, ORB orb) - throws RemoteException; - - // _REVISIT_ cannot link to Stub.readObject directly... why not? - /** - * Delegation call for - * Stub.readObject(java.io.ObjectInputStream). - */ - void readObject(Stub self, ObjectInputStream s) - throws IOException, ClassNotFoundException; - - // _REVISIT_ cannot link to Stub.writeObject directly... why not? - /** - * Delegation call for - * Stub.writeObject(java.io.ObjectOutputStream). - */ - void writeObject(Stub self, ObjectOutputStream s) - throws IOException; - -} diff --git a/src/java.corba/share/classes/javax/rmi/CORBA/Tie.java b/src/java.corba/share/classes/javax/rmi/CORBA/Tie.java deleted file mode 100644 index 9d3f36b3d94..00000000000 --- a/src/java.corba/share/classes/javax/rmi/CORBA/Tie.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package javax.rmi.CORBA; - -import java.rmi.Remote; -import java.util.Hashtable; - -import org.omg.CORBA.portable.ApplicationException; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; -import org.omg.CORBA.portable.ObjectImpl; -import org.omg.CORBA.portable.ResponseHandler; -import org.omg.CORBA.portable.Delegate; -import org.omg.CORBA.ORB; - -/** - * Defines methods which all RMI-IIOP server side ties must implement. - */ -public interface Tie extends org.omg.CORBA.portable.InvokeHandler { - /** - * Returns an object reference for the target object represented by - * this tie. - * @return an object reference for the target object. - */ - org.omg.CORBA.Object thisObject(); - - /** - * Deactivates the target object represented by this tie. - */ - void deactivate() throws java.rmi.NoSuchObjectException; - - /** - * Returns the ORB for this tie. - * @return the ORB. - */ - ORB orb(); - - /** - * Sets the ORB for this tie. - * @param orb the ORB. - */ - void orb(ORB orb); - - /** - * Called by {@link Util#registerTarget} to set the target - * for this tie. - * @param target the object to use as the target for this tie. - */ - void setTarget(java.rmi.Remote target); - - /** - * Returns the target for this tie. - * @return the target. - */ - java.rmi.Remote getTarget(); -} diff --git a/src/java.corba/share/classes/javax/rmi/CORBA/Util.java b/src/java.corba/share/classes/javax/rmi/CORBA/Util.java deleted file mode 100644 index 03a40734ed2..00000000000 --- a/src/java.corba/share/classes/javax/rmi/CORBA/Util.java +++ /dev/null @@ -1,405 +0,0 @@ -/* - * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package javax.rmi.CORBA; - -import java.rmi.RemoteException; - -import org.omg.CORBA.ORB; -import org.omg.CORBA.INITIALIZE; -import org.omg.CORBA.SystemException; -import org.omg.CORBA.Any; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; -import org.omg.CORBA.portable.ObjectImpl; - -import javax.rmi.CORBA.Tie; -import java.rmi.Remote; -import java.io.File; -import java.io.FileInputStream; -import java.io.SerializablePermission; -import java.net.MalformedURLException ; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.Properties; -import java.rmi.server.RMIClassLoader; - -import com.sun.corba.se.impl.orbutil.GetPropertyAction; - -/** - * Provides utility methods that can be used by stubs and ties to - * perform common operations. - */ -public class Util { - - // This can only be set at static initialization time (no sync necessary). - private static final javax.rmi.CORBA.UtilDelegate utilDelegate; - private static final String UtilClassKey = "javax.rmi.CORBA.UtilClass"; - - static { - utilDelegate = (javax.rmi.CORBA.UtilDelegate)createDelegate(UtilClassKey); - } - - private Util(){} - - /** - * Maps a SystemException to a RemoteException. - * @param ex the SystemException to map. - * @return the mapped exception. - */ - public static RemoteException mapSystemException(SystemException ex) { - - if (utilDelegate != null) { - return utilDelegate.mapSystemException(ex); - } - return null; - } - - /** - * Writes any java.lang.Object as a CORBA any. - * @param out the stream in which to write the any. - * @param obj the object to write as an any. - */ - public static void writeAny(OutputStream out, Object obj) { - - if (utilDelegate != null) { - utilDelegate.writeAny(out, obj); - } - } - - /** - * Reads a java.lang.Object as a CORBA any. - * @param in the stream from which to read the any. - * @return the object read from the stream. - */ - public static Object readAny(InputStream in) { - - if (utilDelegate != null) { - return utilDelegate.readAny(in); - } - return null; - } - - /** - * Writes a java.lang.Object as a CORBA Object. If {@code obj} is - * an exported RMI-IIOP server object, the tie is found - * and wired to {@code obj}, then written to - * {@code out.write_Object(org.omg.CORBA.Object)}. - * If {@code obj} is a CORBA Object, it is written to - * {@code out.write_Object(org.omg.CORBA.Object)}. - * @param out the stream in which to write the object. - * @param obj the object to write. - */ - public static void writeRemoteObject(OutputStream out, - java.lang.Object obj) { - - if (utilDelegate != null) { - utilDelegate.writeRemoteObject(out, obj); - } - - } - - /** - * Writes a java.lang.Object as either a value or a CORBA Object. - * If {@code obj} is a value object or a stub object, it is written to - * {@code out.write_abstract_interface(java.lang.Object)}. - * If {@code obj} is an exported - * RMI-IIOP server object, the tie is found and wired to {@code obj}, - * then written to {@code out.write_abstract_interface(java.lang.Object)}. - * @param out the stream in which to write the object. - * @param obj the object to write. - */ - public static void writeAbstractObject(OutputStream out, - java.lang.Object obj) { - - if (utilDelegate != null) { - utilDelegate.writeAbstractObject(out, obj); - } - } - - /** - * Registers a target for a tie. Adds the tie to an internal table and calls - * {@link Tie#setTarget} on the tie object. - * @param tie the tie to register. - * @param target the target for the tie. - */ - public static void registerTarget(javax.rmi.CORBA.Tie tie, - java.rmi.Remote target) { - - if (utilDelegate != null) { - utilDelegate.registerTarget(tie, target); - } - - } - - /** - * Removes the associated tie from an internal table - * and calls {@link Tie#deactivate} - * to deactivate the object. - * @param target the object to unexport. - */ - public static void unexportObject(java.rmi.Remote target) - throws java.rmi.NoSuchObjectException - { - - if (utilDelegate != null) { - utilDelegate.unexportObject(target); - } - - } - - /** - * Returns the tie (if any) for a given target object. - * @return the tie or null if no tie is registered for the given target. - */ - public static Tie getTie (Remote target) { - - if (utilDelegate != null) { - return utilDelegate.getTie(target); - } - return null; - } - - - /** - * Returns a singleton instance of a class that implements the - * {@link ValueHandler} interface. - * @return a class which implements the ValueHandler interface. - */ - public static ValueHandler createValueHandler() { - - isCustomSerializationPermitted(); - - if (utilDelegate != null) { - return utilDelegate.createValueHandler(); - } - return null; - } - - /** - * Returns the codebase, if any, for the given class. - * @param clz the class to get a codebase for. - * @return a space-separated list of URLs, or null. - */ - public static String getCodebase(java.lang.Class clz) { - if (utilDelegate != null) { - return utilDelegate.getCodebase(clz); - } - return null; - } - - /** - * Returns a class instance for the specified class. - *

            The spec for this method is the "Java to IDL language - * mapping", ptc/00-01-06. - *

            In Java SE Platform, this method works as follows: - *

            • Find the first non-null {@code ClassLoader} on the - * call stack and attempt to load the class using this - * {@code ClassLoader}. - *
            • If the first step fails, and if {@code remoteCodebase} - * is non-null and - * {@code useCodebaseOnly} is false, then call - * {@code java.rmi.server.RMIClassLoader.loadClass(remoteCodebase, className)}. - *
            • If {@code remoteCodebase} is null or {@code useCodebaseOnly} - * is true, then call {@code java.rmi.server.RMIClassLoader.loadClass(className)}. - *
            • If a class was not successfully loaded by step 1, 2, or 3, - * and {@code loader} is non-null, then call {@code loader.loadClass(className)}. - *
            • If a class was successfully loaded by step 1, 2, 3, or 4, then - * return the loaded class, else throw {@code ClassNotFoundException}. - *
            - * - * @param className the name of the class. - * @param remoteCodebase a space-separated list of URLs at which - * the class might be found. May be null. - * @param loader a {@code ClassLoader} that may be used to - * load the class if all other methods fail. - * @return the {@code Class} object representing the loaded class. - * @exception ClassNotFoundException if class cannot be loaded. - */ - public static Class loadClass(String className, - String remoteCodebase, - ClassLoader loader) - throws ClassNotFoundException { - if (utilDelegate != null) { - return utilDelegate.loadClass(className,remoteCodebase,loader); - } - return null ; - } - - - /** - * The {@code isLocal} method has the same semantics as the - * {@code ObjectImpl._is_local} - * method, except that it can throw a {@code RemoteException}. - * - * The {@code _is_local()} method is provided so that stubs may determine if a - * particular object is implemented by a local servant and hence local - * invocation APIs may be used. - * - * @param stub the stub to test. - * - * @return The {@code _is_local()} method returns true if - * the servant incarnating the object is located in the same process as - * the stub and they both share the same ORB instance. The {@code _is_local()} - * method returns false otherwise. The default behavior of {@code _is_local()} is - * to return false. - * - * @throws RemoteException The Java to IDL specification does not - * specify the conditions that cause a {@code RemoteException} to be thrown. - */ - public static boolean isLocal(Stub stub) throws RemoteException { - - if (utilDelegate != null) { - return utilDelegate.isLocal(stub); - } - - return false; - } - - /** - * Wraps an exception thrown by an implementation - * method. It returns the corresponding client-side exception. - * @param orig the exception to wrap. - * @return the wrapped exception. - */ - public static RemoteException wrapException(Throwable orig) { - - if (utilDelegate != null) { - return utilDelegate.wrapException(orig); - } - - return null; - } - - /** - * Copies or connects an array of objects. Used by local stubs - * to copy any number of actual parameters, preserving sharing - * across parameters as necessary to support RMI semantics. - * @param obj the objects to copy or connect. - * @param orb the ORB. - * @return the copied or connected objects. - * @exception RemoteException if any object could not be copied or connected. - */ - public static Object[] copyObjects (Object[] obj, ORB orb) - throws RemoteException { - - if (utilDelegate != null) { - return utilDelegate.copyObjects(obj, orb); - } - - return null; - } - - /** - * Copies or connects an object. Used by local stubs to copy - * an actual parameter, result object, or exception. - * @param obj the object to copy. - * @param orb the ORB. - * @return the copy or connected object. - * @exception RemoteException if the object could not be copied or connected. - */ - public static Object copyObject (Object obj, ORB orb) - throws RemoteException { - - if (utilDelegate != null) { - return utilDelegate.copyObject(obj, orb); - } - return null; - } - - // Same code as in PortableRemoteObject. Can not be shared because they - // are in different packages and the visibility needs to be package for - // security reasons. If you know a better solution how to share this code - // then remove it from PortableRemoteObject. Also in Stub.java - private static Object createDelegate(String classKey) { - - String className = (String) - AccessController.doPrivileged(new GetPropertyAction(classKey)); - if (className == null) { - Properties props = getORBPropertiesFile(); - if (props != null) { - className = props.getProperty(classKey); - } - } - if (className == null) { - return new com.sun.corba.se.impl.javax.rmi.CORBA.Util(); - } - - try { - return loadDelegateClass(className).newInstance(); - } catch (ClassNotFoundException ex) { - INITIALIZE exc = new INITIALIZE( "Cannot instantiate " + className); - exc.initCause( ex ) ; - throw exc ; - } catch (Exception ex) { - INITIALIZE exc = new INITIALIZE( "Error while instantiating" + className); - exc.initCause( ex ) ; - throw exc ; - } - } - - private static Class loadDelegateClass( String className ) throws ClassNotFoundException - { - try { - ClassLoader loader = Thread.currentThread().getContextClassLoader(); - return Class.forName(className, false, loader); - } catch (ClassNotFoundException e) { - // ignore, then try RMIClassLoader - } - - try { - return RMIClassLoader.loadClass(className); - } catch (MalformedURLException e) { - String msg = "Could not load " + className + ": " + e.toString(); - ClassNotFoundException exc = new ClassNotFoundException( msg ) ; - throw exc ; - } - } - /** - * Load the orb.properties file. - */ - private static Properties getORBPropertiesFile () - { - return (Properties) AccessController.doPrivileged( - new GetORBPropertiesFileAction()); - } - - private static void isCustomSerializationPermitted() { - SecurityManager sm = System.getSecurityManager(); - if ( sm != null) { - // check that a serialization permission has been - // set to allow the loading of the Util delegate - // which provides access to custom ValueHandler - sm.checkPermission(new SerializablePermission( - "enableCustomValueHandler")); -} - } -} diff --git a/src/java.corba/share/classes/javax/rmi/CORBA/UtilDelegate.java b/src/java.corba/share/classes/javax/rmi/CORBA/UtilDelegate.java deleted file mode 100644 index c9f6dc19976..00000000000 --- a/src/java.corba/share/classes/javax/rmi/CORBA/UtilDelegate.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package javax.rmi.CORBA; - -import java.io.Serializable; -import java.rmi.Remote; -import java.rmi.RemoteException; -import javax.rmi.CORBA.Tie; -import javax.rmi.CORBA.ValueHandler; -import org.omg.CORBA.ORB; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; -import org.omg.CORBA.SystemException; - -/** - * Supports delegation for method implementations in {@link Util}. The - * delegate is a singleton instance of a class that implements this - * interface and provides a replacement implementation for all the - * methods of javax.rmi.CORBA.Util. - * - * Delegation is enabled by providing the delegate's class name as the - * value of the - * javax.rmi.CORBA.UtilClass - * system property. - * - * @see Util - */ -public interface UtilDelegate { - - /** - * Delegation call for {@link Util#mapSystemException}. - */ - RemoteException mapSystemException(SystemException ex); - - /** - * Delegation call for {@link Util#writeAny}. - */ - void writeAny(OutputStream out, Object obj); - - /** - * Delegation call for {@link Util#readAny}. - */ - java.lang.Object readAny(InputStream in); - - /** - * Delegation call for {@link Util#writeRemoteObject}. - */ - void writeRemoteObject(OutputStream out, Object obj); - - /** - * Delegation call for {@link Util#writeAbstractObject}. - */ - void writeAbstractObject(OutputStream out, Object obj); - - /** - * Delegation call for {@link Util#registerTarget}. - */ - void registerTarget(Tie tie, Remote target); - - /** - * Delegation call for {@link Util#unexportObject}. - */ - void unexportObject(Remote target) throws java.rmi.NoSuchObjectException; - - /** - * Delegation call for {@link Util#getTie}. - */ - Tie getTie(Remote target); - - /** - * Delegation call for {@link Util#createValueHandler}. - */ - ValueHandler createValueHandler(); - - /** - * Delegation call for {@link Util#getCodebase}. - */ - String getCodebase(Class clz); - - /** - * Delegation call for {@link Util#loadClass}. - */ - Class loadClass(String className, String remoteCodebase, ClassLoader loader) - throws ClassNotFoundException; - - /** - * Delegation call for {@link Util#isLocal}. - */ - boolean isLocal(Stub stub) throws RemoteException; - - /** - * Delegation call for {@link Util#wrapException}. - */ - RemoteException wrapException(Throwable obj); - - /** - * Delegation call for {@link Util#copyObject}. - */ - Object copyObject(Object obj, ORB orb) throws RemoteException; - - /** - * Delegation call for {@link Util#copyObjects}. - */ - Object[] copyObjects(Object[] obj, ORB orb) throws RemoteException; - -} diff --git a/src/java.corba/share/classes/javax/rmi/CORBA/ValueHandler.java b/src/java.corba/share/classes/javax/rmi/CORBA/ValueHandler.java deleted file mode 100644 index d05a7362a6b..00000000000 --- a/src/java.corba/share/classes/javax/rmi/CORBA/ValueHandler.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package javax.rmi.CORBA; - -/** - * Defines methods which allow serialization of Java objects - * to and from GIOP streams. - **/ -public interface ValueHandler { - - /** - * Writes a value to the stream using Java semantics. - * @param out the stream to write the value to. - * @param value the value to be written to the stream. - **/ - void writeValue(org.omg.CORBA.portable.OutputStream out, - java.io.Serializable value); - - /** - * Reads a value from the stream using Java semantics. - * @param in the stream to read the value from. - * @param offset the current position in the input stream. - * @param clz the type of the value to be read in. - * @param repositoryID the RepositoryId of the value to be read in. - * @param sender the sending context runtime codebase. - * @return the value read from the stream. - **/ - java.io.Serializable readValue(org.omg.CORBA.portable.InputStream in, - int offset, - java.lang.Class clz, - String repositoryID, - org.omg.SendingContext.RunTime sender); - - /** - * Returns the CORBA RepositoryId for the given Java class. - * @param clz a Java class. - * @return the CORBA RepositoryId for the class. - **/ - java.lang.String getRMIRepositoryID(java.lang.Class clz); - - /** - * Indicates whether the given class performs custom or - * default marshaling. - * @param clz the class to test for custom marshaling. - * @return true if the class performs custom marshaling, false - * if it does not. - **/ - boolean isCustomMarshaled(java.lang.Class clz); - - /** - * Returns the CodeBase for this ValueHandler. This is used by - * the ORB runtime. The server sends the service context containing - * the IOR for this CodeBase on the first GIOP reply. The client - * does the same on the first GIOP request. - * @return the SendingContext.CodeBase of this ValueHandler. - **/ - org.omg.SendingContext.RunTime getRunTimeCodeBase(); - - /** - * If the value contains a writeReplace method then the result - * is returned. Otherwise, the value itself is returned. - * @param value the value to be marshaled. - * @return the true value to marshal on the wire. - **/ - java.io.Serializable writeReplace(java.io.Serializable value); - -} diff --git a/src/java.corba/share/classes/javax/rmi/CORBA/ValueHandlerMultiFormat.java b/src/java.corba/share/classes/javax/rmi/CORBA/ValueHandlerMultiFormat.java deleted file mode 100644 index 6869c870705..00000000000 --- a/src/java.corba/share/classes/javax/rmi/CORBA/ValueHandlerMultiFormat.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package javax.rmi.CORBA; - -/** - * Java to IDL ptc 02-01-12 1.5.1.5 - * @since 1.5 - */ -public interface ValueHandlerMultiFormat extends ValueHandler { - - /** - * Returns the maximum stream format version for - * RMI/IDL custom value types that is supported - * by this ValueHandler object. The ValueHandler - * object must support the returned stream format version and - * all lower versions. - * - * An ORB may use this value to include in a standard - * IOR tagged component or service context to indicate to other - * ORBs the maximum RMI-IIOP stream format that it - * supports. If not included, the default for GIOP 1.2 - * is stream format version 1, and stream format version - * 2 for GIOP 1.3 and higher. - */ - byte getMaximumStreamFormatVersion(); - - /** - * Allows the ORB to pass the stream format - * version for RMI/IDL custom value types. If the ORB - * calls this method, it must pass a stream format version - * between 1 and the value returned by the - * getMaximumStreamFormatVersion method inclusive, - * or else a BAD_PARAM exception with standard minor code - * will be thrown. - * - * If the ORB calls the older ValueHandler.writeValue(OutputStream, - * Serializable) method, stream format version 1 is implied. - * - * The ORB output stream passed to the ValueHandlerMultiFormat.writeValue - * method must implement the ValueOutputStream interface, and the - * ORB input stream passed to the ValueHandler.readValue method must - * implement the ValueInputStream interface. - */ - void writeValue(org.omg.CORBA.portable.OutputStream out, - java.io.Serializable value, - byte streamFormatVersion); -} diff --git a/src/java.corba/share/classes/javax/rmi/CORBA/package.html b/src/java.corba/share/classes/javax/rmi/CORBA/package.html deleted file mode 100644 index db004c63d22..00000000000 --- a/src/java.corba/share/classes/javax/rmi/CORBA/package.html +++ /dev/null @@ -1,35 +0,0 @@ - - -javax.rmi.CORBA package - - - -Contains portability APIs for RMI-IIOP. These APIs -provide a standard interface between the generated stubs and ties and the -RMI-IIOP runtime. They also allow third party ORBs to be used for RMI over IIOP -as an alternative to the ORB supplied by Sun. They are not intended to be called -directly from RMI-IIOP applications. See also the {@link javax.rmi} package. - diff --git a/src/java.corba/share/classes/javax/rmi/PortableRemoteObject.java b/src/java.corba/share/classes/javax/rmi/PortableRemoteObject.java deleted file mode 100644 index 6cd0dc79cda..00000000000 --- a/src/java.corba/share/classes/javax/rmi/PortableRemoteObject.java +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package javax.rmi; - -import java.lang.reflect.Method ; - -import org.omg.CORBA.INITIALIZE; -import javax.rmi.CORBA.Util; - -import java.rmi.RemoteException; -import java.rmi.NoSuchObjectException; -import java.rmi.Remote; -import java.io.File; -import java.io.FileInputStream; -import java.util.Properties; -import java.net.MalformedURLException ; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.rmi.server.RMIClassLoader; - -import com.sun.corba.se.impl.orbutil.GetPropertyAction; - -/** - * Server implementation objects may either inherit from - * javax.rmi.PortableRemoteObject or they may implement a remote interface - * and then use the exportObject method to register themselves as a server object. - * The toStub method takes a server implementation and returns a stub that - * can be used to access that server object. - * The connect method makes a Remote object ready for remote communication. - * The unexportObject method is used to deregister a server object, allowing it to become - * available for garbage collection. - * The narrow method takes an object reference or abstract interface type and - * attempts to narrow it to conform to - * the given interface. If the operation is successful the result will be an - * object of the specified type, otherwise an exception will be thrown. - * - *

            See also {@extLink rmi_iiop_guides RMI-IIOP developer's guides}.

            - */ -public class PortableRemoteObject { - - private static final javax.rmi.CORBA.PortableRemoteObjectDelegate proDelegate; - - private static final String PortableRemoteObjectClassKey = - "javax.rmi.CORBA.PortableRemoteObjectClass"; - - static { - proDelegate = (javax.rmi.CORBA.PortableRemoteObjectDelegate) - createDelegate(PortableRemoteObjectClassKey); - } - - /** - * Initializes the object by calling exportObject(this). - * @exception RemoteException if export fails. - */ - protected PortableRemoteObject() throws RemoteException { - if (proDelegate != null) { - PortableRemoteObject.exportObject((Remote)this); - } - } - - /** - * Makes a server object ready to receive remote calls. Note - * that subclasses of PortableRemoteObject do not need to call this - * method, as it is called by the constructor. - * @param obj the server object to export. - * @exception RemoteException if export fails. - */ - public static void exportObject(Remote obj) - throws RemoteException { - - // Let the delegate do everything, including error handling. - if (proDelegate != null) { - proDelegate.exportObject(obj); - } - } - - /** - * Returns a stub for the given server object. - * @param obj the server object for which a stub is required. Must either be a subclass - * of PortableRemoteObject or have been previously the target of a call to - * {@link #exportObject}. - * @return the most derived stub for the object. - * @exception NoSuchObjectException if a stub cannot be located for the given server object. - */ - public static Remote toStub (Remote obj) - throws NoSuchObjectException { - - if (proDelegate != null) { - return proDelegate.toStub(obj); - } - return null; - } - - /** - * Deregisters a server object from the runtime, allowing the object to become - * available for garbage collection. - * @param obj the object to unexport. - * @exception NoSuchObjectException if the remote object is not - * currently exported. - */ - public static void unexportObject(Remote obj) - throws NoSuchObjectException { - - if (proDelegate != null) { - proDelegate.unexportObject(obj); - } - - } - - /** - * Checks to ensure that an object of a remote or abstract interface type - * can be cast to a desired type. - * @param narrowFrom the object to check. - * @param narrowTo the desired type. - * @return an object which can be cast to the desired type. - * @throws ClassCastException if narrowFrom cannot be cast to narrowTo. - */ - public static java.lang.Object narrow ( java.lang.Object narrowFrom, - java.lang.Class narrowTo) - throws ClassCastException { - - if (proDelegate != null) { - return proDelegate.narrow(narrowFrom, narrowTo); - } - return null; - - } - - /** - * Makes a Remote object ready for remote communication. This normally - * happens implicitly when the object is sent or received as an argument - * on a remote method call, but in some circumstances it is useful to - * perform this action by making an explicit call. See the - * {@link javax.rmi.CORBA.Stub#connect} method for more information. - * @param target the object to connect. - * @param source a previously connected object. - * @throws RemoteException if source is not connected - * or if target is already connected to a different ORB than - * source. - */ - public static void connect (Remote target, Remote source) - throws RemoteException { - - if (proDelegate != null) { - proDelegate.connect(target, source); - } - - } - - // Same code as in javax.rmi.CORBA.Util. Can not be shared because they - // are in different packages and the visibility needs to be package for - // security reasons. If you know a better solution how to share this code - // then remove it from here. - private static Object createDelegate(String classKey) { - String className = (String) - AccessController.doPrivileged(new GetPropertyAction(classKey)); - if (className == null) { - Properties props = getORBPropertiesFile(); - if (props != null) { - className = props.getProperty(classKey); - } - } - if (className == null) { - return new com.sun.corba.se.impl.javax.rmi.PortableRemoteObject(); - } - - try { - return (Object) loadDelegateClass(className).newInstance(); - } catch (ClassNotFoundException ex) { - INITIALIZE exc = new INITIALIZE( "Cannot instantiate " + className); - exc.initCause( ex ) ; - throw exc ; - } catch (Exception ex) { - INITIALIZE exc = new INITIALIZE( "Error while instantiating" + className); - exc.initCause( ex ) ; - throw exc ; - } - - } - - private static Class loadDelegateClass( String className ) throws ClassNotFoundException - { - try { - ClassLoader loader = Thread.currentThread().getContextClassLoader(); - return Class.forName(className, false, loader); - } catch (ClassNotFoundException e) { - // ignore, then try RMIClassLoader - } - - try { - return RMIClassLoader.loadClass(className); - } catch (MalformedURLException e) { - String msg = "Could not load " + className + ": " + e.toString(); - ClassNotFoundException exc = new ClassNotFoundException( msg ) ; - throw exc ; - } - } - - /** - * Load the orb.properties file. - */ - private static Properties getORBPropertiesFile () { - return (Properties) AccessController.doPrivileged(new GetORBPropertiesFileAction()); - } -} - -class GetORBPropertiesFileAction implements PrivilegedAction { - private boolean debug = false ; - - public GetORBPropertiesFileAction () { - } - - private String getSystemProperty(final String name) { - // This will not throw a SecurityException because this - // class was loaded from rt.jar using the bootstrap classloader. - String propValue = (String) AccessController.doPrivileged( - new PrivilegedAction() { - public java.lang.Object run() { - return System.getProperty(name); - } - } - ); - - return propValue; - } - - private void getPropertiesFromFile( Properties props, String fileName ) - { - try { - File file = new File( fileName ) ; - if (!file.exists()) - return ; - - FileInputStream in = new FileInputStream( file ) ; - - try { - props.load( in ) ; - } finally { - in.close() ; - } - } catch (Exception exc) { - if (debug) - System.out.println( "ORB properties file " + fileName + - " not found: " + exc) ; - } - } - - public Object run() - { - Properties defaults = new Properties() ; - - String javaHome = getSystemProperty( "java.home" ) ; - String fileName = javaHome + File.separator + "lib" + File.separator + - "orb.properties" ; - - getPropertiesFromFile( defaults, fileName ) ; - - Properties results = new Properties( defaults ) ; - - String userHome = getSystemProperty( "user.home" ) ; - fileName = userHome + File.separator + "orb.properties" ; - - getPropertiesFromFile( results, fileName ) ; - return results ; - } -} diff --git a/src/java.corba/share/classes/javax/rmi/package.html b/src/java.corba/share/classes/javax/rmi/package.html deleted file mode 100644 index e743b10a92e..00000000000 --- a/src/java.corba/share/classes/javax/rmi/package.html +++ /dev/null @@ -1,34 +0,0 @@ - - -javax.rmi package - - - -Contains user APIs for RMI-IIOP. These APIs are -provided for use by RMI-IIOP applications, and provide equivalent -semantics when running over either IIOP or JRMP. See also the -{@link javax.rmi.CORBA} package. - diff --git a/src/java.corba/share/classes/module-info.java b/src/java.corba/share/classes/module-info.java deleted file mode 100644 index b2d862fa3b2..00000000000 --- a/src/java.corba/share/classes/module-info.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/** - * Defines the Java binding of the OMG CORBA APIs, and the RMI-IIOP API. - * - *

            This module is upgradeable. - * - * @moduleGraph - * @since 9 - */ -@Deprecated(since="9", forRemoval=true) -module java.corba { - requires java.logging; - requires java.naming; - requires java.transaction; - requires jdk.unsupported; - - requires transitive java.desktop; - requires transitive java.rmi; - - exports javax.activity; - exports javax.rmi; - exports javax.rmi.CORBA; - exports org.omg.CORBA; - exports org.omg.CORBA.DynAnyPackage; - exports org.omg.CORBA.ORBPackage; - exports org.omg.CORBA.TypeCodePackage; - exports org.omg.CORBA.portable; - exports org.omg.CORBA_2_3; - exports org.omg.CORBA_2_3.portable; - exports org.omg.CosNaming; - exports org.omg.CosNaming.NamingContextExtPackage; - exports org.omg.CosNaming.NamingContextPackage; - exports org.omg.Dynamic; - exports org.omg.DynamicAny; - exports org.omg.DynamicAny.DynAnyFactoryPackage; - exports org.omg.DynamicAny.DynAnyPackage; - exports org.omg.IOP; - exports org.omg.IOP.CodecFactoryPackage; - exports org.omg.IOP.CodecPackage; - exports org.omg.Messaging; - exports org.omg.PortableInterceptor; - exports org.omg.PortableInterceptor.ORBInitInfoPackage; - exports org.omg.PortableServer; - exports org.omg.PortableServer.CurrentPackage; - exports org.omg.PortableServer.POAManagerPackage; - exports org.omg.PortableServer.POAPackage; - exports org.omg.PortableServer.ServantLocatorPackage; - exports org.omg.PortableServer.portable; - exports org.omg.SendingContext; - exports org.omg.stub.java.rmi; - - // rmic --iiop - exports com.sun.corba.se.impl.util to jdk.rmic; - - // JNDI CosNaming provider - opens com.sun.jndi.cosnaming to java.naming; // jndiprovider.properties - exports com.sun.jndi.url.corbaname to java.naming; - exports com.sun.jndi.url.iiop to java.naming; - exports com.sun.jndi.url.iiopname to java.naming; -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ACTIVITY_COMPLETED.java b/src/java.corba/share/classes/org/omg/CORBA/ACTIVITY_COMPLETED.java deleted file mode 100644 index b7334539631..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ACTIVITY_COMPLETED.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * The ACTIVITY_COMPLETED system exception may be raised on any - * method for which Activity context is accessed. It indicates that the - * Activity context in which the method call was made has been completed due - * to a timeout of either the Activity itself or a transaction that encompasses - * the Activity, or that the Activity completed in a manner other than that - * originally requested. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since J2SE 1.5 - */ - -public final class ACTIVITY_COMPLETED extends SystemException { - - /** - * Constructs an ACTIVITY_COMPLETED exception with - * minor code set to 0 and CompletionStatus set to COMPLETED_NO. - */ - public ACTIVITY_COMPLETED() { - this(""); - } - - /** - * Constructs an ACTIVITY_COMPLETED exception with the - * specified message. - * - * @param detailMessage string containing a detailed message. - */ - public ACTIVITY_COMPLETED(String detailMessage) { - this(detailMessage, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs an ACTIVITY_COMPLETED exception with the - * specified minor code and completion status. - * - * @param minorCode minor code. - * @param completionStatus completion status. - */ - public ACTIVITY_COMPLETED(int minorCode, - CompletionStatus completionStatus) { - this("", minorCode, completionStatus); - } - - /** - * Constructs an ACTIVITY_COMPLETED exception with the - * specified message, minor code, and completion status. - * - * @param detailMessage string containing a detailed message. - * @param minorCode minor code. - * @param completionStatus completion status. - */ - public ACTIVITY_COMPLETED(String detailMessage, - int minorCode, - CompletionStatus completionStatus) { - super(detailMessage, minorCode, completionStatus); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ACTIVITY_REQUIRED.java b/src/java.corba/share/classes/org/omg/CORBA/ACTIVITY_REQUIRED.java deleted file mode 100644 index 1e319930a4c..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ACTIVITY_REQUIRED.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * The ACTIVITY_REQUIRED system exception may be raised on any - * method for which an Activity context is required. It indicates that an - * Activity context was necessary to perform the invoked operation, but one - * was not found associated with the calling thread. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since J2SE 1.5 - */ - -public final class ACTIVITY_REQUIRED extends SystemException { - - /** - * Constructs an ACTIVITY_REQUIRED exception with - * minor code set to 0 and CompletionStatus set to COMPLETED_NO. - */ - public ACTIVITY_REQUIRED() { - this(""); - } - - /** - * Constructs an ACTIVITY_REQUIRED exception with the - * specified message. - * - * @param detailMessage string containing a detailed message. - */ - public ACTIVITY_REQUIRED(String detailMessage) { - this(detailMessage, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs an ACTIVITY_REQUIRED exception with the - * specified minor code and completion status. - * - * @param minorCode minor code. - * @param completionStatus completion status. - */ - public ACTIVITY_REQUIRED(int minorCode, - CompletionStatus completionStatus) { - this("", minorCode, completionStatus); - } - - /** - * Constructs an ACTIVITY_REQUIRED exception with the - * specified message, minor code, and completion status. - * - * @param detailMessage string containing a detailed message. - * @param minorCode minor code. - * @param completionStatus completion status. - */ - public ACTIVITY_REQUIRED(String detailMessage, - int minorCode, - CompletionStatus completionStatus) { - super(detailMessage, minorCode, completionStatus); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ARG_IN.java b/src/java.corba/share/classes/org/omg/CORBA/ARG_IN.java deleted file mode 100644 index 14d415e5530..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ARG_IN.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * Signifies an "input" argument to an invocation, - * meaning that the argument is being passed from the client to - * the server. - * ARG_IN.value is one of the possible values used to - * indicate the direction in - * which a parameter is being passed during an invocation performed - * using the Dynamic Invocation Interface (DII). - *

            - * The code fragment below shows a typical usage: - *

            - *    ORB orb = ORB.init(args, null);
            - *    org.omg.CORBA.NamedValue nv = orb.create_named_value(
            - *         "IDLArgumentIdentifier", myAny, org.omg.CORBA.ARG_IN.value);
            - * 
            - * - * @see org.omg.CORBA.NamedValue - * @since JDK1.2 - */ -public interface ARG_IN { - - /** - * The value indicating an input argument. - */ - int value = 1; -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ARG_INOUT.java b/src/java.corba/share/classes/org/omg/CORBA/ARG_INOUT.java deleted file mode 100644 index b33b8c03126..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ARG_INOUT.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * Signifies an argument used for both input and output in an invocation, - * meaning that the argument is being passed from the client to - * the server and then back from the server to the client. - * ARG_INOUT.value is one of the possible values used to - * indicate the direction in - * which a parameter is being passed during a dynamic invocation - * using the Dynamic Invocation Interface (DII). - *

            - * The code fragment below shows a typical usage: - *

            - *  ORB orb = ORB.init(args, null);
            - *  org.omg.CORBA.NamedValue nv = orb.create_named_value(
            - *        "argumentIdentifier", myAny, org.omg.CORBA.ARG_INOUT.value);
            - * 
            - * - * @see org.omg.CORBA.NamedValue - * @since JDK1.2 - */ -public interface ARG_INOUT { - -/** - * The constant value indicating an argument used for both - * input and output. - */ - int value = 3; -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ARG_OUT.java b/src/java.corba/share/classes/org/omg/CORBA/ARG_OUT.java deleted file mode 100644 index 8d4443b531e..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ARG_OUT.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * A constant that signifies an "output" argument to an invocation, - * meaning that the argument is being passed from the server to - * the client. - * ARG_OUT.value is one of the possible values used - * to indicate the direction in - * which a parameter is being passed during a dynamic invocation - * using the Dynamic Invocation Interface (DII). - *

            - * The code fragment below shows a typical usage: - *

            - *  ORB orb = ORB.init(args, null);
            - *  org.omg.CORBA.NamedValue nv = orb.create_named_value(
            - *        "argumentIdentifier", myAny, org.omg.CORBA.ARG_OUT.value);
            - * 
            - * - * @see org.omg.CORBA.NamedValue - * @since JDK1.2 - */ -public interface ARG_OUT { - -/** - * The constant value indicating an output argument. - */ - int value = 2; -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/Any.java b/src/java.corba/share/classes/org/omg/CORBA/Any.java deleted file mode 100644 index c02b4fa4bfb..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/Any.java +++ /dev/null @@ -1,721 +0,0 @@ -/* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; -import org.omg.CORBA.portable.Streamable; -import org.omg.CORBA.portable.IDLEntity; - -/** - * Serves as a container for any data that can be - * described in IDL or for any IDL primitive type. - * An Any object is used as a component of a - * NamedValue object, which provides information about - * arguments or return values in requests, and which is used to define - * name/value pairs in Context objects. -

            - * - * An Any object consists of two parts: - *

              - *
            1. a data value - *
            2. a TypeCode object describing the type of the data - * value contained in the Any object. For example, - * a TypeCode object for an array contains - * a field for the length of the array and a field for - * the type of elements in the array. (Note that in this case, the - * second field of the TypeCode object is itself a - * TypeCode object.) - *
            - * - *

            - * - * A large part of the Any class consists of pairs of methods - * for inserting values into and extracting values from an - * Any object. - *

            - * For a given primitive type X, these methods are: - *

            - *
            void insert_X(X x) - *
            This method allows the insertion of - * an instance x of primitive type X - * into the value field of the Any object. - * Note that the method - * insert_X also resets the Any object's - * type field if necessary. - *
            X extract_X() - *
            This method allows the extraction of an instance of - * type X from the Any object. - *
            - *

            - * This method throws the exception BAD_OPERATION under two conditions: - *

              - *
            1. the type of the element contained in the Any object is not - * X - *
            2. the method extract_X is called before - * the value field of the Any object - * has been set - *
            - *
            - *

            - * There are distinct method pairs for each - * primitive IDL data type (insert_long and extract_long, - * insert_string and extract_string, and so on).
            - *

            - * The class Any also has methods for - * getting and setting the type code, - * for testing two Any objects for equality, - * and for reading an Any object from a stream or - * writing it to a stream. - *
            - * @since JDK1.2 - */ -abstract public class Any implements IDLEntity { - - /** - * Checks for equality between this Any object and the - * given Any object. Two Any objects are - * equal if both their values and type codes are equal. - * - * @param a the Any object to test for equality - * @return true if the Any objects are equal; - * false otherwise - * @see CORBA package - * comments for unimplemented features - */ - abstract public boolean equal(Any a); - - /** - * Returns type information for the element contained in this - * Any object. - * - * @return the TypeCode object containing type information - * about the value contained in this Any object - */ - abstract public TypeCode type(); - - /** - * Sets this Any object's type field - * to the given TypeCode object and clears its value. - *

            - * Note that using this method to set the type code wipes out the - * value if there is one. The method - * is provided primarily so that the type may be set properly for - * IDL out parameters. Generally, setting the type - * is done by the insert_X methods, which will set the type - * to X if it is not already set to X. - * - * @param t the TypeCode object giving - * information for the value in - * this Any object - */ - abstract public void type(TypeCode t); - - /////////////////////////////////////////////////////////////////////////// - // marshalling/unmarshalling routines - - /** - * Reads off (unmarshals) the value of an Any object from - * the given input stream using the given typecode. - * - * @param is the org.omg.CORBA.portable.InputStream - * object from which to read - * the value contained in this Any object - * - * @param t a TypeCode object containing type information - * about the value to be read - * - * @exception MARSHAL when the given TypeCode object is - * not consistent with the value that was contained - * in the input stream - */ - abstract public void read_value(InputStream is, TypeCode t) - throws MARSHAL; - - /** - * Writes out the value of this Any object - * to the given output stream. If both typecode - * and value need to be written, use - * create_output_stream() to create an OutputStream, - * then use write_any on the OutputStream. - *

            - * If this method is called on an Any object that has not - * had a value inserted into its value field, it will throw - * the exception java.lang.NullPointerException. - * - * @param os the org.omg.CORBA.portable.OutputStream - * object into which to marshal the value - * of this Any object - * - */ - abstract public void write_value(OutputStream os); - - /** - * Creates an output stream into which this Any object's - * value can be marshalled. - * - * @return the newly-created OutputStream - */ - abstract public OutputStream create_output_stream(); - - /** - * Creates an input stream from which this Any object's value - * can be unmarshalled. - * - * @return the newly-created InputStream - */ - abstract public InputStream create_input_stream(); - - /////////////////////////////////////////////////////////////////////////// - // basic insertion/extraction methods - - /** - * Extracts the short in this - * Any object's value field. - * - * @return the short stored in this Any object - * @exception BAD_OPERATION if this Any object - * contains something other than a short or the - * value field has not yet been set - */ - abstract public short extract_short() throws BAD_OPERATION; - - /** - * Inserts the given short - * into this Any object's value field. - * - * @param s the short to insert into this - * Any object - */ - abstract public void insert_short(short s); - - /** - * Extracts the int in this - * Any object's value field. - * - * @return the int stored in this Any object - * @exception BAD_OPERATION if this Any object - * contains something other than an int or the - * value field has not yet been set - */ - abstract public int extract_long() throws BAD_OPERATION; - - /** - * Inserts the given int - * into this Any object's value field. - * - * @param l the int to insert into this - * Any object - */ - abstract public void insert_long(int l); - - - /** - * Extracts the long in this - * Any object's value field. - * - * @return the long stored in this Any object - * @exception BAD_OPERATION if this Any object - * contains something other than a long or the - * value field has not yet been set - */ - abstract public long extract_longlong() throws BAD_OPERATION; - - /** - * Inserts the given long - * into this Any object's value field. - * - * @param l the long to insert into this - * Any object - */ - abstract public void insert_longlong(long l); - - /** - * Extracts the short in this - * Any object's value field. - * - * @return the short stored in this Any object - * @exception BAD_OPERATION if this Any object - * contains something other than a short or the - * value field has not yet been set - */ - abstract public short extract_ushort() throws BAD_OPERATION; - - /** - * Inserts the given short - * into this Any object's value field. - * - * @param s the short to insert into this - * Any object - */ - abstract public void insert_ushort(short s); - - /** - * Extracts the int in this - * Any object's value field. - * - * @return the int stored in this Any object - * @exception BAD_OPERATION if this Any object - * contains something other than an int or the - * value field has not yet been set - */ - abstract public int extract_ulong() throws BAD_OPERATION; - - /** - * Inserts the given int - * into this Any object's value field. - * - * @param l the int to insert into this - * Any object - */ - abstract public void insert_ulong(int l); - - /** - * Extracts the long in this - * Any object's value field. - * - * @return the long stored in this Any object - * @exception BAD_OPERATION if this Any object - * contains something other than a long or the - * value field has not yet been set - */ - abstract public long extract_ulonglong() throws BAD_OPERATION; - - /** - * Inserts the given long - * into this Any object's value field. - * - * @param l the long to insert into this - * Any object - */ - abstract public void insert_ulonglong(long l); - - /** - * Extracts the float in this - * Any object's value field. - * - * @return the float stored in this Any object - * @exception BAD_OPERATION if this Any object - * contains something other than a float or the - * value field has not yet been set - */ - abstract public float extract_float() throws BAD_OPERATION; - - /** - * Inserts the given float - * into this Any object's value field. - * - * @param f the float to insert into this - * Any object - */ - abstract public void insert_float(float f); - - /** - * Extracts the double in this - * Any object's value field. - * - * @return the double stored in this Any object - * @exception BAD_OPERATION if this Any object - * contains something other than a double or the - * value field has not yet been set - */ - abstract public double extract_double() throws BAD_OPERATION; - - /** - * Inserts the given double - * into this Any object's value field. - * - * @param d the double to insert into this - * Any object - */ - abstract public void insert_double(double d); - - /** - * Extracts the boolean in this - * Any object's value field. - * - * @return the boolean stored in this Any object - * @exception BAD_OPERATION if this Any object - * contains something other than a boolean or the - * value field has not yet been set - */ - abstract public boolean extract_boolean() throws BAD_OPERATION; - - /** - * Inserts the given boolean - * into this Any object's value field. - * - * @param b the boolean to insert into this - * Any object - */ - abstract public void insert_boolean(boolean b); - - /** - * Extracts the char in this - * Any object's value field. - * - * @return the char stored in this Any object - * @exception BAD_OPERATION if this Any object - * contains something other than a char or the - * value field has not yet been set - */ - abstract public char extract_char() throws BAD_OPERATION; - - /** - * Inserts the given char - * into this Any object's value field. - * - * @param c the char to insert into this - * Any object - * @exception DATA_CONVERSION if there is a data conversion - * error - */ - abstract public void insert_char(char c) throws DATA_CONVERSION; - - /** - * Extracts the char in this - * Any object's value field. - * - * @return the char stored in this Any object - * @exception BAD_OPERATION if this Any object - * contains something other than a char or the - * value field has not yet been set - */ - abstract public char extract_wchar() throws BAD_OPERATION; - - /** - * Inserts the given char - * into this Any object's value field. - * - * @param c the char to insert into this - * Any object - */ - abstract public void insert_wchar(char c); - - /** - * Extracts the byte in this - * Any object's value field. - * - * @return the byte stored in this Any object - * @exception BAD_OPERATION if this Any object - * contains something other than a byte or the - * value field has not yet been set - */ - abstract public byte extract_octet() throws BAD_OPERATION; - - /** - * Inserts the given byte - * into this Any object's value field. - * - * @param b the byte to insert into this - * Any object - */ - abstract public void insert_octet(byte b); - - /** - * Extracts the Any object in this - * Any object's value field. - * - * @return the Any object stored in this Any object - * @exception BAD_OPERATION if this Any object - * contains something other than an Any object or the - * value field has not yet been set - */ - abstract public Any extract_any() throws BAD_OPERATION; - - /** - * Inserts the given Any object - * into this Any object's value field. - * - * @param a the Any object to insert into this - * Any object - */ - abstract public void insert_any(Any a); - - /** - * Extracts the org.omg.CORBA.Object in this - * Any object's value field. - * - * @return the org.omg.CORBA.Object stored in - * this Any object - * @exception BAD_OPERATION if this Any object - * contains something other than an - * org.omg.CORBA.Object or the - * value field has not yet been set - */ - abstract public org.omg.CORBA.Object extract_Object() throws BAD_OPERATION; - - /** - * Inserts the given org.omg.CORBA.Object object - * into this Any object's value field. - * - * @param o the org.omg.CORBA.Object object to insert into this - * Any object - */ - abstract public void insert_Object(org.omg.CORBA.Object o); - - /** - * Extracts the java.io.Serializable object in this - * Any object's value field. - * - * @return the java.io.Serializable object stored in - * this Any object - * @exception BAD_OPERATION if this Any object - * contains something other than a java.io.Serializable - * object or the - * value field has not yet been set - */ - abstract public java.io.Serializable extract_Value() throws BAD_OPERATION ; - - /** - * Inserts the given java.io.Serializable object - * into this Any object's value field. - * - * @param v the java.io.Serializable object to insert into this - * Any object - */ - abstract public void insert_Value(java.io.Serializable v) ; - - /** - * Inserts the given java.io.Serializable object - * into this Any object's value field. - * - * @param v the java.io.Serializable object to insert into this - * Any object - * @param t the TypeCode object that is to be inserted into - * this Any object's type field - * and that describes the java.io.Serializable - * object being inserted - * @throws MARSHAL if the ORB has a problem marshalling or - * unmarshalling parameters - */ - abstract public void insert_Value(java.io.Serializable v, TypeCode t) - throws MARSHAL ; -/** - * Inserts the given org.omg.CORBA.Object object - * into this Any object's value field. - * - * @param o the org.omg.CORBA.Object instance to insert into this - * Any object - * @param t the TypeCode object that is to be inserted into - * this Any object and that describes - * the Object being inserted - * @exception BAD_OPERATION if this method is invalid for this - * Any object - * - */ - abstract public void insert_Object(org.omg.CORBA.Object o, TypeCode t) - throws BAD_PARAM; - - /** - * Extracts the String object in this - * Any object's value field. - * - * @return the String object stored in this Any object - * @exception BAD_OPERATION if this Any object - * contains something other than a String object or the - * value field has not yet been set - */ - abstract public String extract_string() throws BAD_OPERATION; - - /** - * Inserts the given String object - * into this Any object's value field. - * - * @param s the String object to insert into this - * Any object - * @exception DATA_CONVERSION if there is a data conversion error - * @exception MARSHAL if the ORB has a problem marshalling or - * unmarshalling parameters - */ - abstract public void insert_string(String s) throws DATA_CONVERSION, MARSHAL; - - /** - * Extracts the String object in this - * Any object's value field. - * - * @return the String object stored in this Any object - * @exception BAD_OPERATION if this Any object - * contains something other than a String object or the - * value field has not yet been set - */ - abstract public String extract_wstring() throws BAD_OPERATION; - - /** - * Inserts the given String object - * into this Any object's value field. - * - * @param s the String object to insert into this - * Any object - * @exception MARSHAL if the ORB has a problem marshalling or - * unmarshalling parameters - */ - abstract public void insert_wstring(String s) throws MARSHAL; - - /** - * Extracts the TypeCode object in this - * Any object's value field. - * - * @return the TypeCode object stored in this Any object - * @exception BAD_OPERATION if this Any object - * contains something other than a TypeCode object or the - * value field has not yet been set - */ - abstract public TypeCode extract_TypeCode() throws BAD_OPERATION; - - /** - * Inserts the given TypeCode object - * into this Any object's value field. - * - * @param t the TypeCode object to insert into this - * Any object - */ - abstract public void insert_TypeCode(TypeCode t); - - /** - * Extracts the Principal object in this - * Any object's value field. - * Note that the class Principal has been deprecated. - * - * @return the Principal object stored in this Any object - * @exception BAD_OPERATION if this Any object - * contains something other than a - * Principal object or the - * value field has not yet been set - * @see CORBA package - * comments for unimplemented features - * @deprecated Deprecated by CORBA 2.2. - */ - @Deprecated - public Principal extract_Principal() throws BAD_OPERATION { - throw new org.omg.CORBA.NO_IMPLEMENT() ; - } - - /** - * Inserts the given Principal object - * into this Any object's value field. - * Note that the class Principal has been deprecated. - * - * @param p the Principal object to insert into this - * Any object - * @see CORBA package - * comments for unimplemented features - * @deprecated Deprecated by CORBA 2.2. - */ - @Deprecated - public void insert_Principal(Principal p) { - throw new org.omg.CORBA.NO_IMPLEMENT() ; - } - - /////////////////////////////////////////////////////////////////////////// - // insertion/extraction of streamables - - /** - * Extracts a Streamable from this Any object's - * value field. This method allows the extraction of - * non-primitive IDL types. - * - * @return the Streamable stored in the Any object. - * @throws BAD_INV_ORDER if the caller has invoked operations in the wrong order - * @see CORBA package - * comments for unimplemented features - */ - public org.omg.CORBA.portable.Streamable extract_Streamable() - throws org.omg.CORBA.BAD_INV_ORDER { - throw new org.omg.CORBA.NO_IMPLEMENT() ; - } - - /** - * Inserts the given Streamable object - * into this Any object's value field. - * This method allows the insertion of non-primitive IDL types. - * - * @param s the Streamable object to insert into this - * Any object; may be a non-primitive - * IDL type - * @see CORBA package - * comments for unimplemented features - */ - public void insert_Streamable(Streamable s) { - throw new org.omg.CORBA.NO_IMPLEMENT() ; - } - - /** - * Extracts the java.math.BigDecimal object in this - * Any object's value field. - * - * @return the java.math.BigDecimal object - * stored in this Any object - * @exception BAD_OPERATION if this Any object - * contains something other than a - * java.math.BigDecimal object or the - * value field has not yet been set - * @see CORBA package - * comments for unimplemented features - */ - public java.math.BigDecimal extract_fixed() { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Throws an - * org.omg.CORBA.NO_IMPLEMENT exception. - *

            - * Inserts the given java.math.BigDecimal object - * into this Any object's value field. - * - * @param value the java.math.BigDecimal object - * to insert into this Any object - * @see CORBA package - * comments for unimplemented features - */ - public void insert_fixed(java.math.BigDecimal value) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Throws an - * org.omg.CORBA.NO_IMPLEMENT exception. - *

            - * Inserts the given java.math.BigDecimal object - * into this Any object's value field. - * - * @param value the java.math.BigDecimal object - * to insert into this Any object - * @param type the TypeCode object that is to be inserted into - * this Any object's type field - * and that describes the java.math.BigDecimal - * object being inserted - * @throws org.omg.CORBA.BAD_INV_ORDER if this method is invoked improperly - * @see CORBA package - * comments for unimplemented features - */ - public void insert_fixed(java.math.BigDecimal value, org.omg.CORBA.TypeCode type) - throws org.omg.CORBA.BAD_INV_ORDER - { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/AnyHolder.java b/src/java.corba/share/classes/org/omg/CORBA/AnyHolder.java deleted file mode 100644 index fed1979665f..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/AnyHolder.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 1996, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -import org.omg.CORBA.portable.Streamable; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; - -/** - * The Holder for {@code Any}. For more information on - * Holder files, see - * "Generated Files: Holder Files".

            - * A Holder class for {@code Any} objects - * that is used to store "out" and "inout" parameters in IDL methods. - * If an IDL method signature has an IDL {@code any} as an "out" - * or "inout" parameter, the programmer must pass an instance of - * {@code AnyHolder} as the corresponding - * parameter in the method invocation; for "inout" parameters, the programmer - * must also fill the "in" value to be sent to the server. - * Before the method invocation returns, the ORB will fill in the - * value corresponding to the "out" value returned from the server. - *

            - * If {@code myAnyHolder} is an instance of {@code AnyHolder}, - * the value stored in its {@code value} field can be accessed with - * {@code myAnyHolder.value}. - * - * @since JDK1.2 - */ -public final class AnyHolder implements Streamable { - /** - * The {@code Any} value held by this {@code AnyHolder} object. - */ - - public Any value; - - /** - * Constructs a new {@code AnyHolder} object with its - * {@code value} field initialized to {@code null}. - */ - public AnyHolder() { - } - - /** - * Constructs a new {@code AnyHolder} object for the given - * {@code Any} object. - * @param initial the {@code Any} object with which to initialize - * the {@code value} field of the new - * {@code AnyHolder} object - */ - public AnyHolder(Any initial) { - value = initial; - } - - /** - * Reads from {@code input} and initalizes the value in the Holder - * with the unmarshalled data. - * - * @param input the InputStream containing CDR formatted data from the wire. - */ - public void _read(InputStream input) { - value = input.read_any(); - } - - /** - * Marshals to {@code output} the value in - * this {@code AnyHolder} object. - * - * @param output the OutputStream which will contain the CDR formatted data. - */ - public void _write(OutputStream output) { - output.write_any(value); - } - - /** - * Returns the {@code TypeCode} object corresponding to the value - * held in this {@code AnyHolder} object. - * - * @return the TypeCode of the value held in - * this {@code AnyHolder} object - */ - public TypeCode _type() { - return ORB.init().get_primitive_tc(TCKind.tk_any); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/AnySeqHelper.java b/src/java.corba/share/classes/org/omg/CORBA/AnySeqHelper.java deleted file mode 100644 index 1897a8ecc58..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/AnySeqHelper.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Helper for {@code AnySeq}. For more information on - * Helper files, see - * "Generated Files: Helper Files".

            - * org/omg/CORBA/AnySeqHelper.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from streams.idl - * 13 May 1999 22:41:36 o'clock GMT+00:00 - * - * The class definition has been modified to conform to the following - * OMG specifications : - *

              - *
            • ORB core as defined by CORBA 2.3.1 - * (formal/99-10-07) - *
            • - * - *
            • IDL/Java Language Mapping as defined in - * ptc/00-01-08 - *
            • - *
            - */ - -public abstract class AnySeqHelper -{ - private static String _id = "IDL:omg.org/CORBA/AnySeq:1.0"; - - public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.Any[] that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static org.omg.CORBA.Any[] extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_any); - __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.AnySeqHelper.id (), "AnySeq", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static org.omg.CORBA.Any[] read (org.omg.CORBA.portable.InputStream istream) - { - org.omg.CORBA.Any value[] = null; - int _len0 = istream.read_long (); - value = new org.omg.CORBA.Any[_len0]; - for (int _o1 = 0;_o1 < value.length; ++_o1) - value[_o1] = istream.read_any (); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.Any[] value) - { - ostream.write_long (value.length); - for (int _i0 = 0;_i0 < value.length; ++_i0) - ostream.write_any (value[_i0]); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/AnySeqHolder.java b/src/java.corba/share/classes/org/omg/CORBA/AnySeqHolder.java deleted file mode 100644 index 4f5dd5975d7..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/AnySeqHolder.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Holder for {@code AnySeq}. For more information on - * Holder files, see - * "Generated Files: Holder Files".

            - * org/omg/CORBA/AnySeqHolder.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from streams.idl - * 13 May 1999 22:41:36 o'clock GMT+00:00 - */ - -public final class AnySeqHolder implements org.omg.CORBA.portable.Streamable -{ - public org.omg.CORBA.Any value[] = null; - - public AnySeqHolder () - { - } - - public AnySeqHolder (org.omg.CORBA.Any[] initialValue) - { - value = initialValue; - } - - public void _read (org.omg.CORBA.portable.InputStream i) - { - value = org.omg.CORBA.AnySeqHelper.read (i); - } - - public void _write (org.omg.CORBA.portable.OutputStream o) - { - org.omg.CORBA.AnySeqHelper.write (o, value); - } - - public org.omg.CORBA.TypeCode _type () - { - return org.omg.CORBA.AnySeqHelper.type (); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/BAD_CONTEXT.java b/src/java.corba/share/classes/org/omg/CORBA/BAD_CONTEXT.java deleted file mode 100644 index f32f686c48f..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/BAD_CONTEXT.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * Exception thrown when an operation is invoked by a client but the passed - * context does not contain the context values required by the operation.

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since JDK1.2 - */ - -public final class BAD_CONTEXT extends SystemException { - - /** - * Constructs a BAD_CONTEXT exception - * with a default minor code - * of 0 and a completion state of COMPLETED_NO. - */ - public BAD_CONTEXT() { - this(""); - } - - /** - * Constructs a BAD_CONTEXT exception - * with the specified detail message, a minor code - * of 0 and a completion state of COMPLETED_NO. - * @param s a String object containing a detail message - */ - public BAD_CONTEXT(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs a BAD_CONTEXT exception - * with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed an instance of CompletionStatus indicating - * the completion status - */ - public BAD_CONTEXT(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs a BAD_CONTEXT exception - * with the specified detail - * message, minor code, and completion status. - * A detail message is a String that describes this particular exception. - * @param s the String containing a detail message - * @param minor the minor code - * @param completed an instance of CompletionStatus indicating - * the completion status - */ - public BAD_CONTEXT(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/BAD_INV_ORDER.java b/src/java.corba/share/classes/org/omg/CORBA/BAD_INV_ORDER.java deleted file mode 100644 index 183042867f4..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/BAD_INV_ORDER.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * This exception indicates that the caller has invoked operations in - * the wrong order. For example, it can be raised by an ORB if an - * application makes an ORB-related call without having correctly - * initialized the ORB first.

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since JDK1.2 - */ - -public final class BAD_INV_ORDER extends SystemException { - - /** - * Constructs a BAD_INV_ORDER exception with a default - * minor code of 0 and a completion state of COMPLETED_NO. - */ - public BAD_INV_ORDER() { - this(""); - } - - /** - * Constructs a BAD_INV_ORDER exception with the specified detail - * message, a minor code of 0, and a completion state of COMPLETED_NO. - * - * @param s the String containing a detail message - */ - public BAD_INV_ORDER(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs a BAD_INV_ORDER exceptionBAD_INV_ORDER with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed an instance of CompletionStatus indicating - * the completion status - */ - public BAD_INV_ORDER(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs a BAD_INV_ORDER exception with the specified detail - * message, minor code, and completion status. - * A detail message is a String that describes this particular exception. - * @param s the String containing a detail message - * @param minor the minor code - * @param completed the completion status - */ - public BAD_INV_ORDER(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/BAD_OPERATION.java b/src/java.corba/share/classes/org/omg/CORBA/BAD_OPERATION.java deleted file mode 100644 index 44ce51721aa..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/BAD_OPERATION.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * Exception thrown when an object reference denotes an existing object, - * but that the object does not support the operation that was invoked.

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since JDK1.2 - */ - -public final class BAD_OPERATION extends SystemException { - - /** - * Constructs a BAD_OPERATION exception with a default - * minor code of 0 and a completion state of COMPLETED_NO. - */ - public BAD_OPERATION() { - this(""); - } - - /** - * Constructs a BAD_OPERATION exception with the specified detail - * message, a minor code of 0, and a completion state of COMPLETED_NO. - * @param s the String containing a detail message - */ - public BAD_OPERATION(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs a BAD_OPERATION exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed an instance of CompletionStatus indicating - * the completion status - */ - public BAD_OPERATION(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs a BAD_OPERATION exception with the specified detail - * message, minor code, and completion status. - * A detail message is a String that describes this particular exception. - * @param s the String containing a detail message - * @param minor the minor code - * @param completed an instance of CompletionStatus indicating - * the completion status - */ - public BAD_OPERATION(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/BAD_PARAM.java b/src/java.corba/share/classes/org/omg/CORBA/BAD_PARAM.java deleted file mode 100644 index cdeee3b93c2..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/BAD_PARAM.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * Exception thrown - * when a parameter passed to a call is out of range or - * otherwise considered illegal. An ORB may raise this exception - * if null values or null pointers are passed to an operation (for - * language mappings where the concept of a null pointers or null - * values applies). BAD_PARAM can also be raised as a result of a - * client generating requests with incorrect parameters using the DII.

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}, - * {@extLink jidlexception_minorcodes meaning of minor codes} - *

            - * @since JDK1.2 - */ - -public final class BAD_PARAM extends SystemException { - - /** - * Constructs a BAD_PARAM exception with a default - * minor code of 0 and a completion state of COMPLETED_NO. - */ - public BAD_PARAM() { - this(""); - } - - /** - * Constructs a BAD_PARAM exception with the specified detail - * message, a minor code of 0, and a completion state of COMPLETED_NO. - * - * @param s the String containing a detail message describing this - * exception - */ - public BAD_PARAM(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs a BAD_PARAM exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed the completion status - */ - public BAD_PARAM(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs a BAD_PARAM exception with the specified detail - * message, minor code, and completion status. - * A detail message is a String that describes - * this particular exception. - * - * @param s the String containing a detail message - * @param minor the minor code - * @param completed the completion status - */ - public BAD_PARAM(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/BAD_POLICY.java b/src/java.corba/share/classes/org/omg/CORBA/BAD_POLICY.java deleted file mode 100644 index 91ff0f65d72..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/BAD_POLICY.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; -/** - * A {@code PolicyErrorCode} which would be filled in - * the {@code PolicyError} exception. - * - * @author rip-dev - */ - -public interface BAD_POLICY { - /** - * The Error code in PolicyError exception. - */ - final short value = (short) (0L); -}; diff --git a/src/java.corba/share/classes/org/omg/CORBA/BAD_POLICY_TYPE.java b/src/java.corba/share/classes/org/omg/CORBA/BAD_POLICY_TYPE.java deleted file mode 100644 index 532797d1de8..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/BAD_POLICY_TYPE.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * A {@code PolicyErrorCode} which would be filled in - * the {@code PolicyError} exception. - * - * @author rip-dev - */ -public interface BAD_POLICY_TYPE { - /** - * The Error code in PolicyError exception. - */ - final short value = (short) (2L); -}; diff --git a/src/java.corba/share/classes/org/omg/CORBA/BAD_POLICY_VALUE.java b/src/java.corba/share/classes/org/omg/CORBA/BAD_POLICY_VALUE.java deleted file mode 100644 index 94ff3e2ccb4..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/BAD_POLICY_VALUE.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** -* Contains the value used to indicate a policy value that is -* incorrect for a valid policy type in a call to the -* create_policy method defined in the ORB class. -* -*/ -public interface BAD_POLICY_VALUE { - /** - * The value used to represent a bad policy value error - * in a PolicyError exception. - * @see org.omg.CORBA.PolicyError - */ - final short value = (short) (3L); -}; diff --git a/src/java.corba/share/classes/org/omg/CORBA/BAD_QOS.java b/src/java.corba/share/classes/org/omg/CORBA/BAD_QOS.java deleted file mode 100644 index c21b30a01f8..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/BAD_QOS.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * The BAD_QOS exception is raised whenever an object cannot - * support the quality of service required by an invocation parameter that - * has a quality of service semantics associated with it. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since J2SE 1.5 - */ - -public final class BAD_QOS extends SystemException { - - /** - * Constructs an BAD_QOS exception with - * minor code set to 0 and CompletionStatus set to COMPLETED_NO. - */ - public BAD_QOS() { - this(""); - } - - /** - * Constructs an BAD_QOS exception with the - * specified message. - * - * @param detailMessage string containing a detailed message. - */ - public BAD_QOS(String detailMessage) { - this(detailMessage, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs an BAD_QOS exception with the - * specified minor code and completion status. - * - * @param minorCode minor code. - * @param completionStatus completion status. - */ - public BAD_QOS(int minorCode, - CompletionStatus completionStatus) { - this("", minorCode, completionStatus); - } - - /** - * Constructs an BAD_QOS exception with the - * specified message, minor code, and completion status. - * - * @param detailMessage string containing a detailed message. - * @param minorCode minor code. - * @param completionStatus completion status. - */ - public BAD_QOS(String detailMessage, - int minorCode, - CompletionStatus completionStatus) { - super(detailMessage, minorCode, completionStatus); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/BAD_TYPECODE.java b/src/java.corba/share/classes/org/omg/CORBA/BAD_TYPECODE.java deleted file mode 100644 index 076aea32d8f..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/BAD_TYPECODE.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * Exception thrown when the ORB has encountered a malformed type code - * (for example, a type code with an invalid {@code TCKind} value).

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since JDK1.2 - */ - -public final class BAD_TYPECODE extends SystemException { - - /** - * Constructs a {@code BAD_TYPECODE} exception with a default - * minor code of 0 and a completion state of COMPLETED_NO. - */ - public BAD_TYPECODE() { - this(""); - } - - /** - * Constructs a {@code BAD_TYPECODE} exception with the specified detail, - * a minor code of 0, and a completion state of COMPLETED_NO. - * - * @param s the String containing a detail message - */ - public BAD_TYPECODE(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs a {@code BAD_TYPECODE} exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed an instance of {@code CompletionStatus} indicating - * the completion status - */ - public BAD_TYPECODE(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs a {@code BAD_TYPECODE} exception with the specified detail - * message, minor code, and completion status. - * A detail message is a String that describes this particular exception. - * @param s the String containing a detail message - * @param minor the minor code - * @param completed an instance of {@code CompletionStatus} indicating - * the completion status - */ - public BAD_TYPECODE(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/BooleanHolder.java b/src/java.corba/share/classes/org/omg/CORBA/BooleanHolder.java deleted file mode 100644 index f0f14e6e249..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/BooleanHolder.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 1995, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - -import org.omg.CORBA.portable.Streamable; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; - - -/** - * The Holder for {@code Boolean}. For more information on - * Holder files, see - * "Generated Files: Holder Files".

            - * A Holder class for a {@code boolean} - * that is used to store "out" and "inout" parameters in IDL methods. - * If an IDL method signature has an IDL {@code boolean} as an "out" - * or "inout" parameter, the programmer must pass an instance of - * {@code BooleanHolder} as the corresponding - * parameter in the method invocation; for "inout" parameters, the programmer - * must also fill the "in" value to be sent to the server. - * Before the method invocation returns, the ORB will fill in the - * value corresponding to the "out" value returned from the server. - *

            - * If {@code myBooleanHolder} is an instance of {@code BooleanHolder}, - * the value stored in its {@code value} field can be accessed with - * {@code myBooleanHolder.value}. - * - * @since JDK1.2 - */ -public final class BooleanHolder implements Streamable { - - /** - * The {@code boolean} value held by this {@code BooleanHolder} - * object. - */ - public boolean value; - - /** - * Constructs a new {@code BooleanHolder} object with its - * {@code value} field initialized to {@code false}. - */ - public BooleanHolder() { - } - - /** - * Constructs a new {@code BooleanHolder} object with its - * {@code value} field initialized with the given {@code boolean}. - * @param initial the {@code boolean} with which to initialize - * the {@code value} field of the newly-created - * {@code BooleanHolder} object - */ - public BooleanHolder(boolean initial) { - value = initial; - } - - /** - * Reads unmarshalled data from {@code input} and assigns it to this - * {@code BooleanHolder} object's {@code value} field. - * - * @param input the {@code InputStream} object containing - * CDR formatted data from the wire - */ - public void _read(InputStream input) { - value = input.read_boolean(); - } - - /** - * Marshals the value in this {@code BooleanHolder} object's - * {@code value} field to the output stream {@code output}. - * - * @param output the OutputStream which will contain the CDR formatted data - */ - public void _write(OutputStream output) { - output.write_boolean(value); - } - - /** - * Retrieves the {@code TypeCode} object that corresponds to the - * value held in this {@code BooleanHolder} object. - * - * @return the {@code TypeCode} for the value held - * in this {@code BooleanHolder} object - */ - public TypeCode _type() { - return ORB.init().get_primitive_tc(TCKind.tk_boolean); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/BooleanSeqHelper.java b/src/java.corba/share/classes/org/omg/CORBA/BooleanSeqHelper.java deleted file mode 100644 index c072b5f53a6..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/BooleanSeqHelper.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Helper for {@code BooleanSeq}. For more information on - * Helper files, see - * "Generated Files: Helper Files".

            - * org/omg/CORBA/BooleanSeqHelper.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from streams.idl - * 13 May 1999 22:41:36 o'clock GMT+00:00 - * - * The class definition has been modified to conform to the following - * OMG specifications : - *

              - *
            • ORB core as defined by CORBA 2.3.1 - * (formal/99-10-07) - *
            • - * - *
            • IDL/Java Language Mapping as defined in - * ptc/00-01-08 - *
            • - *
            - */ - -public abstract class BooleanSeqHelper -{ - private static String _id = "IDL:omg.org/CORBA/BooleanSeq:1.0"; - - public static void insert (org.omg.CORBA.Any a, boolean[] that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static boolean[] extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_boolean); - __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.BooleanSeqHelper.id (), "BooleanSeq", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static boolean[] read (org.omg.CORBA.portable.InputStream istream) - { - boolean value[] = null; - int _len0 = istream.read_long (); - value = new boolean[_len0]; - istream.read_boolean_array (value, 0, _len0); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, boolean[] value) - { - ostream.write_long (value.length); - ostream.write_boolean_array (value, 0, value.length); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/BooleanSeqHolder.java b/src/java.corba/share/classes/org/omg/CORBA/BooleanSeqHolder.java deleted file mode 100644 index 0c45eff8907..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/BooleanSeqHolder.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Holder for {@code BooleanSeq}. For more information on - * Holder files, see - * "Generated Files: Holder Files".

            - * org/omg/CORBA/BooleanSeqHolder.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from streams.idl - * 13 May 1999 22:41:36 o'clock GMT+00:00 - */ - -public final class BooleanSeqHolder implements org.omg.CORBA.portable.Streamable -{ - public boolean value[] = null; - - public BooleanSeqHolder () - { - } - - public BooleanSeqHolder (boolean[] initialValue) - { - value = initialValue; - } - - public void _read (org.omg.CORBA.portable.InputStream i) - { - value = org.omg.CORBA.BooleanSeqHelper.read (i); - } - - public void _write (org.omg.CORBA.portable.OutputStream o) - { - org.omg.CORBA.BooleanSeqHelper.write (o, value); - } - - public org.omg.CORBA.TypeCode _type () - { - return org.omg.CORBA.BooleanSeqHelper.type (); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/Bounds.java b/src/java.corba/share/classes/org/omg/CORBA/Bounds.java deleted file mode 100644 index 3c6c0231cea..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/Bounds.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * A user exception thrown when a parameter is not within - * the legal bounds for the object that a method is trying - * to access. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - */ - -public final class Bounds extends org.omg.CORBA.UserException { - - /** - * Constructs an Bounds with no specified detail message. - */ - public Bounds() { - super(); - } - - /** - * Constructs an Bounds with the specified detail message. - * - * @param reason the detail message. - */ - public Bounds(String reason) { - super(reason); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/BoundsHelper.java b/src/java.corba/share/classes/org/omg/CORBA/BoundsHelper.java deleted file mode 100644 index 0d5d6cc9533..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/BoundsHelper.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - - -/** - * This Helper class is used to facilitate the marshalling of {@code Bounds}. - * For more information on Helper files, see - * - * "Generated Files: Helper Files". - */ - -abstract public class BoundsHelper -{ - private static String _id = "IDL:omg.org/CORBA/Bounds:1.0"; - - public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.Bounds that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static org.omg.CORBA.Bounds extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - private static boolean __active = false; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - synchronized (org.omg.CORBA.TypeCode.class) - { - if (__typeCode == null) - { - if (__active) - { - return org.omg.CORBA.ORB.init().create_recursive_tc ( _id ); - } - __active = true; - org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [0]; - org.omg.CORBA.TypeCode _tcOf_members0 = null; - __typeCode = org.omg.CORBA.ORB.init ().create_exception_tc (org.omg.CORBA.BoundsHelper.id (), "Bounds", _members0); - __active = false; - } - } - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static org.omg.CORBA.Bounds read (org.omg.CORBA.portable.InputStream istream) - { - org.omg.CORBA.Bounds value = new org.omg.CORBA.Bounds (); - // read and discard the repository ID - istream.read_string (); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.Bounds value) - { - // write the repository ID - ostream.write_string (id ()); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ByteHolder.java b/src/java.corba/share/classes/org/omg/CORBA/ByteHolder.java deleted file mode 100644 index 75c76c5bb61..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ByteHolder.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package org.omg.CORBA; - -import org.omg.CORBA.portable.Streamable; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; - -/** - * The Holder for {@code Byte}. For more information on - * Holder files, see - * "Generated Files: Holder Files".

            - * A Holder class for a {@code byte} - * that is used to store "out" and "inout" parameters in IDL methods. - * If an IDL method signature has an IDL {@code octet} as an "out" - * or "inout" parameter, the programmer must pass an instance of - * {@code ByteHolder} as the corresponding - * parameter in the method invocation; for "inout" parameters, the programmer - * must also fill the "in" value to be sent to the server. - * Before the method invocation returns, the ORB will fill in the - * value corresponding to the "out" value returned from the server. - *

            - * If {@code myByteHolder} is an instance of {@code ByteHolder}, - * the value stored in its {@code value} field can be accessed with - * {@code myByteHolder.value}. - * - * @since JDK1.2 - */ -public final class ByteHolder implements Streamable { - /** - * The {@code byte} value held by this {@code ByteHolder} - * object. - */ - - public byte value; - - /** - * Constructs a new {@code ByteHolder} object with its - * {@code value} field initialized to 0. - */ - public ByteHolder() { - } - - /** - * Constructs a new {@code ByteHolder} object for the given - * {@code byte}. - * @param initial the {@code byte} with which to initialize - * the {@code value} field of the new - * {@code ByteHolder} object - */ - public ByteHolder(byte initial) { - value = initial; - } - - /** - * Reads from {@code input} and initalizes the value in - * this {@code ByteHolder} object - * with the unmarshalled data. - * - * @param input the InputStream containing CDR formatted data from the wire. - */ - public void _read(InputStream input) { - value = input.read_octet(); - } - - /** - * Marshals to {@code output} the value in - * this {@code ByteHolder} object. - * - * @param output the OutputStream which will contain the CDR formatted data. - */ - public void _write(OutputStream output) { - output.write_octet(value); - } - - /** - * Returns the TypeCode corresponding to the value held in - * this {@code ByteHolder} object. - * - * @return the TypeCode of the value held in - * this {@code ByteHolder} object - */ - public org.omg.CORBA.TypeCode _type() { - return ORB.init().get_primitive_tc(TCKind.tk_octet); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/CODESET_INCOMPATIBLE.java b/src/java.corba/share/classes/org/omg/CORBA/CODESET_INCOMPATIBLE.java deleted file mode 100644 index 5b1e465a3fd..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/CODESET_INCOMPATIBLE.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * This exception is raised whenever meaningful communication is not possible - * between client and server native code sets. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since J2SE 1.5 - */ - -public final class CODESET_INCOMPATIBLE extends SystemException { - - /** - * Constructs an CODESET_INCOMPATIBLE exception with - * minor code set to 0 and CompletionStatus set to COMPLETED_NO. - */ - public CODESET_INCOMPATIBLE() { - this(""); - } - - /** - * Constructs an CODESET_INCOMPATIBLE exception with the - * specified message. - * - * @param detailMessage string containing a detailed message. - */ - public CODESET_INCOMPATIBLE(String detailMessage) { - this(detailMessage, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs an CODESET_INCOMPATIBLE exception with the - * specified minor code and completion status. - * - * @param minorCode minor code. - * @param completionStatus completion status. - */ - public CODESET_INCOMPATIBLE(int minorCode, - CompletionStatus completionStatus) { - this("", minorCode, completionStatus); - } - - /** - * Constructs an CODESET_INCOMPATIBLE exception with the - * specified message, minor code, and completion status. - * - * @param detailMessage string containing a detailed message. - * @param minorCode minor code. - * @param completionStatus completion status. - */ - public CODESET_INCOMPATIBLE(String detailMessage, - int minorCode, - CompletionStatus completionStatus) { - super(detailMessage, minorCode, completionStatus); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/COMM_FAILURE.java b/src/java.corba/share/classes/org/omg/CORBA/COMM_FAILURE.java deleted file mode 100644 index b85c2671b7c..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/COMM_FAILURE.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * This exception is raised if communication is lost while an operation - * is in progress, after the request was sent by the client, but before - * the reply from the server has been returned to the client.

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - *

            - * See the section {@extLink jidlexception_minorcodes Minor Code Meanings} - * to see the minor codes for this exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since JDK1.2 - */ - -public final class COMM_FAILURE extends SystemException { - - /** - * Constructs a COMM_FAILURE exception with - * a default minor code of 0 and a completion state of COMPLETED_NO. - */ - public COMM_FAILURE() { - this(""); - } - - /** - * Constructs a COMM_FAILURE exception with the specified detail - * message, a minor code of 0, and a completion state of COMPLETED_NO. - * - * @param s the String containing a detail message describing - * this exception - */ - public COMM_FAILURE(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs a COMM_FAILURE exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed the completion status, which must be one of - * COMPLETED_YES, COMPLETED_NO, or - * COMPLETED_MAYBE. - */ - public COMM_FAILURE(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs a COMM_FAILURE exception with the specified detail - * message, minor code, and completion status. - * A detail message is a String that describes this particular exception. - * @param s the String containing a detail message - * @param minor the minor code - * @param completed the completion status, which must be one of - * COMPLETED_YES, COMPLETED_NO, or - * COMPLETED_MAYBE. - */ - public COMM_FAILURE(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/CTX_RESTRICT_SCOPE.java b/src/java.corba/share/classes/org/omg/CORBA/CTX_RESTRICT_SCOPE.java deleted file mode 100644 index dbfa9f88999..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/CTX_RESTRICT_SCOPE.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * A flag that can be used as the second parameter to the method - * Context.get_values to restrict the search scope. - * When this flag is used, it restricts the search for - * context values to this particular Context object - * or to the scope specified in the first parameter to - * Context.get_values. - *

            - * Usage: - *

            - *     NVList props = myContext.get_values("_USER",
            - *                     CTX_RESTRICT_SCOPE.value, "id*");
            - * 
            - * - * @see org.omg.CORBA.Context#get_values(String, int, String) - * @since JDK1.2 - */ -public interface CTX_RESTRICT_SCOPE { - -/** - * The field containing the int value of a - * CTX_RESTRICT_SCOPE flag. - */ - int value = 15; -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/CharHolder.java b/src/java.corba/share/classes/org/omg/CORBA/CharHolder.java deleted file mode 100644 index 35ce03c640e..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/CharHolder.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 1995, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package org.omg.CORBA; - -import org.omg.CORBA.portable.Streamable; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; - -/** - * The Holder for {@code Char}. For more information on - * Holder files, see - * "Generated Files: Holder Files".

            - * A Holder class for a {@code char} - * that is used to store "out" and "inout" parameters in IDL methods. - * If an IDL method signature has an IDL {@code char} as an "out" - * or "inout" parameter, the programmer must pass an instance of - * {@code CharHolder} as the corresponding - * parameter in the method invocation; for "inout" parameters, the programmer - * must also fill the "in" value to be sent to the server. - * Before the method invocation returns, the ORB will fill in the - * value corresponding to the "out" value returned from the server. - *

            - * If {@code myCharHolder} is an instance of {@code CharHolder}, - * the value stored in its {@code value} field can be accessed with - * {@code myCharHolder.value}. - * - * @since JDK1.2 - */ -public final class CharHolder implements Streamable { - - /** - * The {@code char} value held by this {@code CharHolder} - * object. - */ - public char value; - - /** - * Constructs a new {@code CharHolder} object with its - * {@code value} field initialized to {@code 0}. - */ - public CharHolder() { - } - - /** - * Constructs a new {@code CharHolder} object for the given - * {@code char}. - * @param initial the {@code char} with which to initialize - * the {@code value} field of the new - * {@code CharHolder} object - */ - public CharHolder(char initial) { - value = initial; - } - - /** - * Reads from {@code input} and initalizes the value in - * this {@code CharHolder} object - * with the unmarshalled data. - * - * @param input the InputStream containing CDR formatted data from the wire - */ - public void _read(InputStream input) { - value = input.read_char(); - } - - /** - * Marshals to {@code output} the value in - * this {@code CharHolder} object. - * - * @param output the OutputStream which will contain the CDR formatted data - */ - public void _write(OutputStream output) { - output.write_char(value); - } - - /** - * Returns the {@code TypeCode} object corresponding - * to the value held in - * this {@code CharHolder} object. - * - * @return the TypeCode of the value held in - * this {@code CharHolder} object - */ - public org.omg.CORBA.TypeCode _type() { - return ORB.init().get_primitive_tc(TCKind.tk_char); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/CharSeqHelper.java b/src/java.corba/share/classes/org/omg/CORBA/CharSeqHelper.java deleted file mode 100644 index 2a0f112f2e2..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/CharSeqHelper.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Helper for {@code CharSeq}. For more information on - * Helper files, see - * "Generated Files: Helper Files".

            - * org/omg/CORBA/CharSeqHelper.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from streams.idl - * 13 May 1999 22:41:36 o'clock GMT+00:00 - * - * The class definition has been modified to conform to the following - * OMG specifications : - *

              - *
            • ORB core as defined by CORBA 2.3.1 - * (formal/99-10-07) - *
            • - * - *
            • IDL/Java Language Mapping as defined in - * ptc/00-01-08 - *
            • - *
            - */ - -public abstract class CharSeqHelper -{ - private static String _id = "IDL:omg.org/CORBA/CharSeq:1.0"; - - public static void insert (org.omg.CORBA.Any a, char[] that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static char[] extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_char); - __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.CharSeqHelper.id (), "CharSeq", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static char[] read (org.omg.CORBA.portable.InputStream istream) - { - char value[] = null; - int _len0 = istream.read_long (); - value = new char[_len0]; - istream.read_char_array (value, 0, _len0); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, char[] value) - { - ostream.write_long (value.length); - ostream.write_char_array (value, 0, value.length); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/CharSeqHolder.java b/src/java.corba/share/classes/org/omg/CORBA/CharSeqHolder.java deleted file mode 100644 index 739a1281bcb..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/CharSeqHolder.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Holder for {@code CharSeq}. For more information on - * Holder files, see - * "Generated Files: Holder Files".

            - * org/omg/CORBA/CharSeqHolder.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from streams.idl - * 13 May 1999 22:41:36 o'clock GMT+00:00 - */ - -public final class CharSeqHolder implements org.omg.CORBA.portable.Streamable -{ - public char value[] = null; - - public CharSeqHolder () - { - } - - public CharSeqHolder (char[] initialValue) - { - value = initialValue; - } - - public void _read (org.omg.CORBA.portable.InputStream i) - { - value = org.omg.CORBA.CharSeqHelper.read (i); - } - - public void _write (org.omg.CORBA.portable.OutputStream o) - { - org.omg.CORBA.CharSeqHelper.write (o, value); - } - - public org.omg.CORBA.TypeCode _type () - { - return org.omg.CORBA.CharSeqHelper.type (); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/CompletionStatus.java b/src/java.corba/share/classes/org/omg/CORBA/CompletionStatus.java deleted file mode 100644 index a8ad47d058b..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/CompletionStatus.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - -/** - * An object that indicates whether a method had completed running - * when a SystemException was thrown. - *

            - * The class CompletionStatus - * contains three CompletionStatus instances, which are constants - * representing each - * possible completion status: COMPLETED_MAYBE, - * COMPLETED_NO, and COMPLETED_YES. - * It also contains - * three int members, each a constant corresponding to one of - * the CompletionStatus instances. These int - * members make it possible to use a switch statement. - *

            - * The class also contains two methods: - *

              - *
            • public int value() -- which accesses the - * value field of a CompletionStatus object - *
            • public static CompletionStatus - * from_int(int i) -- - * for creating an instance from one of the int members - *
            - * @see org.omg.CORBA.SystemException - * @since JDK1.2 - */ - -public final class CompletionStatus implements org.omg.CORBA.portable.IDLEntity -{ -/** - * The constant indicating that a method completed running - * before a SystemException was thrown. - */ - public static final int _COMPLETED_YES = 0, - -/** - * The constant indicating that a method had not completed running - * when a SystemException was thrown. - */ - _COMPLETED_NO = 1, - -/** - * The constant indicating that it is unknown whether a method had - * completed running when a SystemException was thrown. - */ - _COMPLETED_MAYBE = 2; - - -/** - * An instance of CompletionStatus initialized with - * the constant _COMPLETED_YES. - */ - public static final CompletionStatus COMPLETED_YES = new CompletionStatus(_COMPLETED_YES); - -/** - * An instance of CompletionStatus initialized with - * the constant _COMPLETED_NO. - */ - public static final CompletionStatus COMPLETED_NO = new CompletionStatus(_COMPLETED_NO); - - /** - * An instance of CompletionStatus initialized with - * the constant _COMPLETED_MAYBE. - */ - public static final CompletionStatus COMPLETED_MAYBE = new CompletionStatus(_COMPLETED_MAYBE); - - /** - * Retrieves the value of this CompletionStatus object. - * - * @return one of the possible CompletionStatus values: - * _COMPLETED_YES, _COMPLETED_NO, or - * _COMPLETED_MAYBE - * - */ - public int value() { return _value; } - -/** - * Creates a CompletionStatus object from the given int. - * - * @param i one of _COMPLETED_YES, _COMPLETED_NO, or - * _COMPLETED_MAYBE - * - * @return one of the possible CompletionStatus objects - * with values: - * _COMPLETED_YES, _COMPLETED_NO, or - * _COMPLETED_MAYBE - * - * @exception org.omg.CORBA.BAD_PARAM if the argument given is not one of the - * int constants defined in CompletionStatus - */ - public static CompletionStatus from_int(int i) { - switch (i) { - case _COMPLETED_YES: - return COMPLETED_YES; - case _COMPLETED_NO: - return COMPLETED_NO; - case _COMPLETED_MAYBE: - return COMPLETED_MAYBE; - default: - throw new org.omg.CORBA.BAD_PARAM(); - } - } - - -/** - * Creates a CompletionStatus object from the given int. - * - * @param _value one of _COMPLETED_YES, _COMPLETED_NO, or - * _COMPLETED_MAYBE - * - */ - private CompletionStatus(int _value) { - this._value = _value; - } - - private int _value; -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/CompletionStatusHelper.java b/src/java.corba/share/classes/org/omg/CORBA/CompletionStatusHelper.java deleted file mode 100644 index 1be74d5d92c..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/CompletionStatusHelper.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Helper for {@code CompletionStatus}. For more information on - * Helper files, see - * "Generated Files: Helper Files".

            - * org/omg/CORBA/CompletionStatusHelper.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * 03 June 1999 11:52:03 o'clock GMT+00:00 - */ - -abstract public class CompletionStatusHelper -{ - private static String _id = "IDL:omg.org/CORBA/CompletionStatus:1.0"; - - public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.CompletionStatus that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static org.omg.CORBA.CompletionStatus extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_enum_tc (org.omg.CORBA.CompletionStatusHelper.id (), "CompletionStatus", new String[] { "COMPLETED_YES", "COMPLETED_NO", "COMPLETED_MAYBE"} ); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static org.omg.CORBA.CompletionStatus read (org.omg.CORBA.portable.InputStream istream) - { - return org.omg.CORBA.CompletionStatus.from_int (istream.read_long ()); - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.CompletionStatus value) - { - ostream.write_long (value.value ()); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/Context.java b/src/java.corba/share/classes/org/omg/CORBA/Context.java deleted file mode 100644 index 60c7e7d2840..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/Context.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Copyright (c) 1996, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * An object used in Request operations - * to specify the context object in which context strings - * must be resolved before being sent along with the request invocation. - * A Context object - * contains a list of properties in the form of NamedValue - * objects. These properties represent information - * about the client, the environment, or the circumstances of a request - * and generally are properties that might be inconvenient - * to pass as parameters. - *

            - * A Context object is created by first calling the - * ORB method get_default_context - * and then calling the method create_child on the - * default context. - *

            - * Each property in a Context object is represented by - * a NamedValue object. The property name is contained - * in the NamedValue object's name field, and - * the value associated with the name is contained in the Any - * object that was assigned to the NamedValue object's - * value field. - *

            - * Context properties can represent a portion of a client's - * or application's environment that is meant to be propagated to - * (and made implicitly part of) a server's environment. - * (Examples might be a window identifier or user preference information). - * Once a server has been invoked (that is, after the properties are - * propagated), the server may query its Context object - * for these properties using the method get_values. - * - *

            - * When an operation declaration includes a context clause, - * the stubs and skeletons will have an additional argument - * added for the context. When an operation invocation occurs, - * the ORB causes the properties that were named in the operation - * definition in IDL and - * that are present in the client's Context object - * to be provided in the Context object parameter to - * the invoked method. - *

            - * Context property names (which are strings) - * typically have the form of an OMG IDL identifier or - * a series of OMG IDL identifiers separated by periods. - * A context property name pattern is either a property name - * or a property name followed by a single "*". A property - * name pattern without a trailing "*" is said to match only - * itself. A property name pattern of the form "<name>*" matches any - * property name that starts with <name> and continues with zero - * or more additional characters. - *

            - * Property name patterns are used in the context clause of - * an operation definition and as a parameter for the - * method Context.get_values. - *

            - * Context objects may be "chained" together to achieve a - * particular defaulting behavior. A Context - * object created with the method create_child will - * be chained to its parent (the Context object - * that created it), and that means that the parent will be searched - * after the child in a search for property names. - *

            - * Properties defined in a particular Context object - * effectively override those properties in the next higher level. - * The scope used in a search for properties may be restricted by specifying a - * starting scope and by using the flag CTX_RESTRICT_SCOPE - * when invoking the method get_values. - *

            - * A Context object may be named for purposes of specifying - * a starting search scope. - * - * @since JDK1.2 - */ - -public abstract class Context { - - /** - * Retrieves the name of this Context object. - * - * @return the name of this Context object - */ - - public abstract String context_name(); - - - /** - * Retrieves the parent of this Context object. - * - * @return the Context object that is the - * parent of this Context object - */ - - public abstract Context parent(); - - /** - * Creates a Context object with the given string as its - * name and with this Context object set as its parent. - *

            - * The new Context object is chained into its parent - * Context object. This means that in a search for - * matching property names, if a match is not found in this context, - * the search will continue in the parent. If that is not successful, - * the search will continue in the grandparent, if there is one, and - * so on. - * - * - * @param child_ctx_name the String object to be set as - * the name of the new Context object - * @return the newly-created child Context object - * initialized with the specified name - */ - - public abstract Context create_child(String child_ctx_name); - - /** - * Creates a NamedValue object and adds it to this - * Context object. The name field of the - * new NamedValue object is set to the given string, - * the value field is set to the given Any - * object, and the flags field is set to zero. - * - * @param propname the name of the property to be set - * @param propvalue the Any object to which the - * value of the property will be set. The - * Any object's value - * field contains the value to be associated - * with the given propname; the - * kind field must be set to - * TCKind.tk_string. - */ - - public abstract void set_one_value(String propname, Any propvalue); - - /** - I Sets one or more property values in this Context - * object. The NVList supplied to this method - * contains one or more NamedValue objects. - * In each NamedValue object, - * the name field holds the name of the property, and - * the flags field must be set to zero. - * The NamedValue object's value field - * contains an Any object, which, in turn, contains the value - * for the property. Since the value is always a string, - * the Any object must have the kind - * field of its TypeCode set to TCKind.tk_string. - * - * @param values an NVList containing the property - * names and associated values to be set - * - * @see #get_values - * @see org.omg.CORBA.NamedValue - * @see org.omg.CORBA.Any - */ - - public abstract void set_values(NVList values); - - /** - * Deletes from this Context object the - * NamedValue object(s) whose - * name field matches the given property name. - * If the String object supplied for - * propname has a - * trailing wildcard character ("*"), then - * all NamedValue objects whose name - * fields match will be deleted. The search scope is always - * limited to this Context object. - *

            - * If no matching property is found, an exception is returned. - * - * @param propname name of the property to be deleted - */ - - public abstract void delete_values(String propname); - - /** - * Retrieves the NamedValue objects whose - * name field matches the given name or name - * pattern. This method allows for wildcard searches, - * which means that there can be multiple matches and - * therefore multiple values returned. If the - * property is not found at the indicated level, the search - * continues up the context object tree until a match is found or - * all Context objects in the chain have been exhausted. - *

            - * If no match is found, an error is returned and no property list - * is returned. - * - * @param start_scope a String object indicating the - * context object level at which to initiate the - * search for the specified properties - * (for example, "_USER", "_GROUP", "_SYSTEM"). Valid scope - * names are implementation-specific. If a - * scope name is omitted, the search - * begins with the specified context - * object. If the specified scope name is - * not found, an exception is returned. - * @param op_flags an operation flag. The one flag - * that may be specified is CTX_RESTRICT_SCOPE. - * If this flag is specified, searching is limited to the - * specified start_scope or this - * Context object. - * @param pattern the property name whose values are to - * be retrieved. pattern may be a - * name or a name with a - * trailing wildcard character ("*"). - * - * @return an NVList containing all the property values - * (in the form of NamedValue objects) - * whose associated property name matches the given name or - * name pattern - * @see #set_values - * @see org.omg.CORBA.NamedValue - */ - - abstract public NVList get_values(String start_scope, int op_flags, - String pattern); -}; diff --git a/src/java.corba/share/classes/org/omg/CORBA/ContextList.java b/src/java.corba/share/classes/org/omg/CORBA/ContextList.java deleted file mode 100644 index 46cb76498ec..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ContextList.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * An object containing a modifiable list of String objects - * that represent property names. - * This class is used in Request operations to - * describe the contexts that need to be resolved and sent with the - * invocation. (A context is resolved by giving a property name - * and getting back the value associated with it.) This is done - * by calling the Context method - * get_values and supplying a string from a - * ContextList object as the third parameter. - * The method get_values returns an NVList - * object containing the NamedValue objects that hold - * the value(s) identified by the given string. - *

            - * A ContextList object is created by the ORB, as - * illustrated here: - *

            - *   ORB orb = ORB.init(args, null);
            - *   org.omg.CORBA.ContextList ctxList = orb.create_context_list();
            - * 
            - * The variable ctxList represents an empty - * ContextList object. Strings are added to - * the list with the method add, accessed - * with the method item, and removed with the - * method remove. - * - * @see Context - * @since JDK1.2 - */ - -public abstract class ContextList { - - /** - * Returns the number of String objects in this - * ContextList object. - * - * @return an int representing the number of - * Strings in this ContextList object - */ - - public abstract int count(); - - /** - * Adds a String object to this ContextList - * object. - * - * @param ctx the String object to be added - */ - - public abstract void add(String ctx); - - /** - * Returns the String object at the given index. - * - * @param index the index of the string desired, with 0 being the - index of the first string - * @return the string at the given index - * @exception org.omg.CORBA.Bounds if the index is greater than - * or equal to the number of strings in this - * ContextList object - */ - - public abstract String item(int index) throws org.omg.CORBA.Bounds; - - /** - * Removes the String object at the given index. Note that - * the indices of all strings following the one removed are - * shifted down by one. - * - * @param index the index of the String object to be removed, - * with 0 designating the first string - * @exception org.omg.CORBA.Bounds if the index is greater than - * or equal to the number of String objects in - * this ContextList object - */ - - public abstract void remove(int index) throws org.omg.CORBA.Bounds; - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/Current.java b/src/java.corba/share/classes/org/omg/CORBA/Current.java deleted file mode 100644 index a71334946e7..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/Current.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** -* Interfaces derived from the {@code Current} interface enable ORB and CORBA -* services to provide access to information (context) associated with -* the thread of execution in which they are running. This information -* is accessed in a structured manner using interfaces derived from the -* {@code Current} interface defined in the CORBA module. -* -*

            Each ORB or CORBA service that needs its own context derives an -* interface from the CORBA module's {@code Current}. Users of the -* service can obtain an instance of the appropriate {@code Current} -* interface by invoking {@code ORB::resolve_initial_references}.

            -* -* org/omg/CORBA/Current.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl -* Saturday, July 17, 1999 12:26:21 AM PDT. -*/ - -public interface Current extends CurrentOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity -{ -} // interface Current diff --git a/src/java.corba/share/classes/org/omg/CORBA/CurrentHelper.java b/src/java.corba/share/classes/org/omg/CORBA/CurrentHelper.java deleted file mode 100644 index f838de5d9f3..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/CurrentHelper.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Helper for {@code Current}. For more information on - * Helper files, see - * "Generated Files: Helper Files".

            - * org/omg/CORBA/CurrentHelper.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl - * Saturday, July 17, 1999 12:26:21 AM PDT - */ - -abstract public class CurrentHelper -{ - private static String _id = "IDL:omg.org/CORBA/Current:1.0"; - - public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.Current that) - { - throw new org.omg.CORBA.MARSHAL() ; - } - - public static org.omg.CORBA.Current extract (org.omg.CORBA.Any a) - { - throw new org.omg.CORBA.MARSHAL() ; - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (org.omg.CORBA.CurrentHelper.id (), "Current"); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static org.omg.CORBA.Current read (org.omg.CORBA.portable.InputStream istream) - { - throw new org.omg.CORBA.MARSHAL() ; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.Current value) - { - throw new org.omg.CORBA.MARSHAL() ; - } - - public static org.omg.CORBA.Current narrow (org.omg.CORBA.Object obj) - { - if (obj == null) - return null; - else if (obj instanceof org.omg.CORBA.Current) - return (org.omg.CORBA.Current)obj; - else - throw new org.omg.CORBA.BAD_PARAM (); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/CurrentHolder.java b/src/java.corba/share/classes/org/omg/CORBA/CurrentHolder.java deleted file mode 100644 index 74f16d3ab6b..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/CurrentHolder.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - -/** - * The Holder for {@code Current}. For more information on - * Holder files, see - * "Generated Files: Holder Files".

            - * org/omg/CORBA/CurrentHolder.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl - * Saturday, July 17, 1999 12:26:21 AM PDT - */ - -public final class CurrentHolder implements org.omg.CORBA.portable.Streamable -{ - public org.omg.CORBA.Current value = null; - - public CurrentHolder () - { - } - - public CurrentHolder (org.omg.CORBA.Current initialValue) - { - value = initialValue; - } - - public void _read (org.omg.CORBA.portable.InputStream i) - { - value = org.omg.CORBA.CurrentHelper.read (i); - } - - public void _write (org.omg.CORBA.portable.OutputStream o) - { - org.omg.CORBA.CurrentHelper.write (o, value); - } - - public org.omg.CORBA.TypeCode _type () - { - return org.omg.CORBA.CurrentHelper.type (); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/CurrentOperations.java b/src/java.corba/share/classes/org/omg/CORBA/CurrentOperations.java deleted file mode 100644 index f058e662647..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/CurrentOperations.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The interface for {@code Current}. For more information on - * Operations interfaces, see - * "Generated Files". - * - * org/omg/CORBA/CurrentOperations.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl - * Saturday, July 17, 1999 12:26:21 AM PDT. - */ - -public interface CurrentOperations -{ -} // interface CurrentOperations diff --git a/src/java.corba/share/classes/org/omg/CORBA/CustomMarshal.java b/src/java.corba/share/classes/org/omg/CORBA/CustomMarshal.java deleted file mode 100644 index 793739105ef..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/CustomMarshal.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -import org.omg.CORBA.DataOutputStream; -import org.omg.CORBA.DataInputStream; - -/** - * An abstract value type that is meant to - * be used by the ORB, not the user. Semantically it is treated - * as a custom value type's implicit base class, although the custom - * valuetype does not actually inherit it in IDL. The implementer - * of a custom value type shall provide an implementation of the - * {@code CustomMarshal} operations. The manner in which this is done is - * specified in the IDL to Java langauge mapping. Each custom - * marshaled value type shall have its own implementation. - * @see DataInputStream - */ -public interface CustomMarshal { - /** - * Marshal method has to be implemented by the Customized Marshal class. - * This is the method invoked for Marshalling. - * - * @param os a DataOutputStream - */ - void marshal(DataOutputStream os); - /** - * Unmarshal method has to be implemented by the Customized Marshal class. - * This is the method invoked for Unmarshalling. - * - * @param is a DataInputStream - */ - void unmarshal(DataInputStream is); -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/DATA_CONVERSION.java b/src/java.corba/share/classes/org/omg/CORBA/DATA_CONVERSION.java deleted file mode 100644 index 3a58ea7d5f7..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/DATA_CONVERSION.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * This exception is raised if an ORB cannot convert the representation - * of data as marshaled into its native representation or vice-versa. - * For example, DATA_CONVERSION can be raised if wide character codeset - * conversion fails, or if an ORB cannot convert floating point values - * between different representations.

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - *

            - * See the section {@extLink jidlexception_minorcodes Minor Code Meanings} - * to see the minor codes for this exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since JDK1.2 - */ - -public final class DATA_CONVERSION extends SystemException { - - /** - * Constructs a DATA_CONVERSION exception with a default minor code - * of 0 and a completion state of COMPLETED_NO. - */ - public DATA_CONVERSION() { - this(""); - } - - /** - * Constructs a DATA_CONVERSION exception with the specified detail. - * @param s the String containing a detail message - */ - public DATA_CONVERSION(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs a DATA_CONVERSION exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed the completion status - */ - public DATA_CONVERSION(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs a DATA_CONVERSION exception with the specified detail - * message, minor code, and completion status. - * A detail message is a String that describes this particular exception. - * @param s the String containing a detail message - * @param minor the minor code - * @param completed the completion status - */ - public DATA_CONVERSION(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/DataInputStream.java b/src/java.corba/share/classes/org/omg/CORBA/DataInputStream.java deleted file mode 100644 index d90792a44ae..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/DataInputStream.java +++ /dev/null @@ -1,344 +0,0 @@ -/* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** Defines the methods used to read primitive data types from input streams -* for unmarshaling custom value types. This interface is used by user -* written custom unmarshaling code for custom value types. -* @see org.omg.CORBA.DataOutputStream -* @see org.omg.CORBA.CustomMarshal -*/ -public interface DataInputStream extends org.omg.CORBA.portable.ValueBase -{ - /** Reads an IDL Any value from the input stream. - * @return the Any read. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - org.omg.CORBA.Any read_any (); - - /** Reads an IDL boolean value from the input stream. - * @return the boolean read. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - boolean read_boolean (); - - /** Reads an IDL character value from the input stream. - * @return the character read. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - char read_char (); - - /** Reads an IDL wide character value from the input stream. - * @return the wide character read. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - char read_wchar (); - - /** Reads an IDL octet value from the input stream. - * @return the octet value read. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - byte read_octet (); - - /** Reads an IDL short from the input stream. - * @return the short read. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - short read_short (); - - /** Reads an IDL unsigned short from the input stream. - * @return the unsigned short read. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - short read_ushort (); - - /** Reads an IDL long from the input stream. - * @return the long read. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - int read_long (); - - /** Reads an IDL unsigned long from the input stream. - * @return the unsigned long read. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - int read_ulong (); - - /** Reads an IDL long long from the input stream. - * @return the long long read. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - long read_longlong (); - - /** Reads an unsigned IDL long long from the input stream. - * @return the unsigned long long read. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - long read_ulonglong (); - - /** Reads an IDL float from the input stream. - * @return the float read. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - float read_float (); - - /** Reads an IDL double from the input stream. - * @return the double read. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - double read_double (); - // read_longdouble not supported by IDL/Java mapping - - /** Reads an IDL string from the input stream. - * @return the string read. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - String read_string (); - - /** Reads an IDL wide string from the input stream. - * @return the wide string read. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - String read_wstring (); - - /** Reads an IDL CORBA::Object from the input stream. - * @return the CORBA::Object read. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - org.omg.CORBA.Object read_Object (); - - /** Reads an IDL Abstract interface from the input stream. - * @return the Abstract interface read. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - java.lang.Object read_Abstract (); - - /** Reads an IDL value type from the input stream. - * @return the value type read. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - java.io.Serializable read_Value (); - - /** Reads an IDL typecode from the input stream. - * @return the typecode read. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - org.omg.CORBA.TypeCode read_TypeCode (); - - /** Reads array of IDL Anys from offset for length elements from the - * input stream. - * @param seq The out parameter holder for the array to be read. - * @param offset The index into seq of the first element to read from the - * input stream. - * @param length The number of elements to read from the input stream. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - void read_any_array (org.omg.CORBA.AnySeqHolder seq, int offset, int length); - - /** Reads array of IDL booleans from offset for length elements from the - * input stream. - * @param seq The out parameter holder for the array to be read. - * @param offset The index into seq of the first element to read from the - * input stream. - * @param length The number of elements to read from the input stream. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - void read_boolean_array (org.omg.CORBA.BooleanSeqHolder seq, int offset, int length); - - /** Reads array of IDL characters from offset for length elements from the - * input stream. - * @param seq The out parameter holder for the array to be read. - * @param offset The index into seq of the first element to read from the - * input stream. - * @param length The number of elements to read from the input stream. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - void read_char_array (org.omg.CORBA.CharSeqHolder seq, int offset, int length); - - /** Reads array of IDL wide characters from offset for length elements from the - * input stream. - * @param seq The out parameter holder for the array to be read. - * @param offset The index into seq of the first element to read from the - * input stream. - * @param length The number of elements to read from the input stream. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - void read_wchar_array (org.omg.CORBA.WCharSeqHolder seq, int offset, int length); - - /** Reads array of IDL octets from offset for length elements from the - * input stream. - * @param seq The out parameter holder for the array to be read. - * @param offset The index into seq of the first element to read from the - * input stream. - * @param length The number of elements to read from the input stream. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - void read_octet_array (org.omg.CORBA.OctetSeqHolder seq, int offset, int length); - - /** Reads array of IDL shorts from offset for length elements from the - * input stream. - * @param seq The out parameter holder for the array to be read. - * @param offset The index into seq of the first element to read from the - * input stream. - * @param length The number of elements to read from the input stream. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - void read_short_array (org.omg.CORBA.ShortSeqHolder seq, int offset, int length); - - /** Reads array of IDL unsigned shorts from offset for length elements from the - * input stream. - * @param seq The out parameter holder for the array to be read. - * @param offset The index into seq of the first element to read from the - * input stream. - * @param length The number of elements to read from the input stream. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - void read_ushort_array (org.omg.CORBA.UShortSeqHolder seq, int offset, int length); - - /** Reads array of IDL longs from offset for length elements from the - * input stream. - * @param seq The out parameter holder for the array to be read. - * @param offset The index into seq of the first element to read from the - * input stream. - * @param length The number of elements to read from the input stream. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - void read_long_array (org.omg.CORBA.LongSeqHolder seq, int offset, int length); - - /** Reads array of IDL unsigned longs from offset for length elements from the - * input stream. - * @param seq The out parameter holder for the array to be read. - * @param offset The index into seq of the first element to read from the - * input stream. - * @param length The number of elements to read from the input stream. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - void read_ulong_array (org.omg.CORBA.ULongSeqHolder seq, int offset, int length); - - /** Reads array of IDL unsigned long longs from offset for length elements from the - * input stream. - * @param seq The out parameter holder for the array to be read. - * @param offset The index into seq of the first element to read from the - * input stream. - * @param length The number of elements to read from the input stream. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - void read_ulonglong_array (org.omg.CORBA.ULongLongSeqHolder seq, int offset, int length); - - /** Reads array of IDL long longs from offset for length elements from the - * input stream. - * @param seq The out parameter holder for the array to be read. - * @param offset The index into seq of the first element to read from the - * input stream. - * @param length The number of elements to read from the input stream. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - void read_longlong_array (org.omg.CORBA.LongLongSeqHolder seq, int offset, int length); - - /** Reads array of IDL floats from offset for length elements from the - * input stream. - * @param seq The out parameter holder for the array to be read. - * @param offset The index into seq of the first element to read from the - * input stream. - * @param length The number of elements to read from the input stream. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - void read_float_array (org.omg.CORBA.FloatSeqHolder seq, int offset, int length); - - /** Reads array of IDL doubles from offset for length elements from the - * input stream. - * @param seq The out parameter holder for the array to be read. - * @param offset The index into seq of the first element to read from the - * input stream. - * @param length The number of elements to read from the input stream. - * @throws org.omg.CORBA.MARSHAL - * If an inconsistency is detected, including not having registered - * a streaming policy, then the standard system exception MARSHAL is raised. - */ - void read_double_array (org.omg.CORBA.DoubleSeqHolder seq, int offset, int length); -} // interface DataInputStream diff --git a/src/java.corba/share/classes/org/omg/CORBA/DataOutputStream.java b/src/java.corba/share/classes/org/omg/CORBA/DataOutputStream.java deleted file mode 100644 index c6ea054cff1..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/DataOutputStream.java +++ /dev/null @@ -1,283 +0,0 @@ -/* - * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** Defines the methods used to write primitive data types to output streams -* for marshalling custom value types. This interface is used by user -* written custom marshalling code for custom value types. -* @see org.omg.CORBA.DataInputStream -* @see org.omg.CORBA.CustomMarshal -*/ -public interface DataOutputStream extends org.omg.CORBA.portable.ValueBase -{ - /** - * Writes the Any value to the output stream. - * @param value The value to be written. - */ - void write_any (org.omg.CORBA.Any value); - - /** - * Writes the boolean value to the output stream. - * @param value The value to be written. - */ - void write_boolean (boolean value); - - /** - * Writes the IDL character value to the output stream. - * @param value The value to be written. - */ - void write_char (char value); - - /** - * Writes the IDL wide character value to the output stream. - * @param value The value to be written. - */ - void write_wchar (char value); - - /** - * Writes the IDL octet value (represented as a Java byte) to the output stream. - * @param value The value to be written. - */ - void write_octet (byte value); - - /** - * Writes the IDL short value to the output stream. - * @param value The value to be written. - */ - void write_short (short value); - - /** - * Writes the IDL unsigned short value (represented as a Java short - * value) to the output stream. - * @param value The value to be written. - */ - void write_ushort (short value); - - /** - * Writes the IDL long value (represented as a Java int) to the output stream. - * @param value The value to be written. - */ - void write_long (int value); - - /** - * Writes the IDL unsigned long value (represented as a Java int) to the output stream. - * @param value The value to be written. - */ - void write_ulong (int value); - - /** - * Writes the IDL long long value (represented as a Java long) to the output stream. - * @param value The value to be written. - */ - void write_longlong (long value); - - /** - * Writes the IDL unsigned long long value (represented as a Java long) - * to the output stream. - * @param value The value to be written. - */ - void write_ulonglong (long value); - - /** - * Writes the IDL float value to the output stream. - * @param value The value to be written. - */ - void write_float (float value); - - /** - * Writes the IDL double value to the output stream. - * @param value The value to be written. - */ - void write_double (double value); - - // write_longdouble not supported by IDL/Java mapping - - /** - * Writes the IDL string value to the output stream. - * @param value The value to be written. - */ - void write_string (String value); - - /** - * Writes the IDL wide string value (represented as a Java String) to the output stream. - * @param value The value to be written. - */ - void write_wstring (String value); - - /** - * Writes the IDL CORBA::Object value to the output stream. - * @param value The value to be written. - */ - void write_Object (org.omg.CORBA.Object value); - - /** - * Writes the IDL Abstract interface type to the output stream. - * @param value The value to be written. - */ - void write_Abstract (java.lang.Object value); - - /** - * Writes the IDL value type value to the output stream. - * @param value The value to be written. - */ - void write_Value (java.io.Serializable value); - - /** - * Writes the typecode to the output stream. - * @param value The value to be written. - */ - void write_TypeCode (org.omg.CORBA.TypeCode value); - - /** - * Writes the array of IDL Anys from offset for length elements to the - * output stream. - * @param seq The array to be written. - * @param offset The index into seq of the first element to write to the - * output stream. - * @param length The number of elements to write to the output stream. - */ - void write_any_array (org.omg.CORBA.Any[] seq, int offset, int length); - - /** - * Writes the array of IDL booleans from offset for length elements to the - * output stream. - * @param seq The array to be written. - * @param offset The index into seq of the first element to write to the - * output stream. - * @param length The number of elements to write to the output stream. - */ - void write_boolean_array (boolean[] seq, int offset, int length); - - /** - * Writes the array of IDL characters from offset for length elements to the - * output stream. - * @param seq The array to be written. - * @param offset The index into seq of the first element to write to the - * output stream. - * @param length The number of elements to write to the output stream. - */ - void write_char_array (char[] seq, int offset, int length); - - /** - * Writes the array of IDL wide characters from offset for length elements to the - * output stream. - * @param seq The array to be written. - * @param offset The index into seq of the first element to write to the - * output stream. - * @param length The number of elements to write to the output stream. - */ - void write_wchar_array (char[] seq, int offset, int length); - - /** - * Writes the array of IDL octets from offset for length elements to the - * output stream. - * @param seq The array to be written. - * @param offset The index into seq of the first element to write to the - * output stream. - * @param length The number of elements to write to the output stream. - */ - void write_octet_array (byte[] seq, int offset, int length); - - /** - * Writes the array of IDL shorts from offset for length elements to the - * output stream. - * @param seq The array to be written. - * @param offset The index into seq of the first element to write to the - * output stream. - * @param length The number of elements to write to the output stream. - */ - void write_short_array (short[] seq, int offset, int length); - - /** - * Writes the array of IDL unsigned shorts (represented as Java shorts) - * from offset for length elements to the output stream. - * @param seq The array to be written. - * @param offset The index into seq of the first element to write to the - * output stream. - * @param length The number of elements to write to the output stream. - */ - void write_ushort_array (short[] seq, int offset, int length); - - /** - * Writes the array of IDL longs from offset for length elements to the - * output stream. - * @param seq The array to be written. - * @param offset The index into seq of the first element to write to the - * output stream. - * @param length The number of elements to write to the output stream. - */ - void write_long_array (int[] seq, int offset, int length); - - /** - * Writes the array of IDL unsigned longs (represented as Java ints) - * from offset for length elements to the output stream. - * @param seq The array to be written. - * @param offset The index into seq of the first element to write to the - * output stream. - * @param length The number of elements to write to the output stream. - */ - void write_ulong_array (int[] seq, int offset, int length); - - /** - * Writes the array of IDL unsigned long longs (represented as Java longs) - * from offset for length elements to the output stream. - * @param seq The array to be written. - * @param offset The index into seq of the first element to write to the - * output stream. - * @param length The number of elements to write to the output stream. - */ - void write_ulonglong_array (long[] seq, int offset, int length); - - /** - * Writes the array of IDL long longs from offset for length elements to the - * output stream. - * @param seq The array to be written. - * @param offset The index into seq of the first element to write to the - * output stream. - * @param length The number of elements to write to the output stream. - */ - void write_longlong_array (long[] seq, int offset, int length); - - /** - * Writes the array of IDL floats from offset for length elements to the - * output stream. - * @param seq The array to be written. - * @param offset The index into seq of the first element to write to the - * output stream. - * @param length The number of elements to write to the output stream. - */ - void write_float_array (float[] seq, int offset, int length); - - /** - * Writes the array of IDL doubles from offset for length elements to the - * output stream. - * @param seq The array to be written. - * @param offset The index into seq of the first element to write to the - * output stream. - * @param length The number of elements to write to the output stream. - */ - void write_double_array (double[] seq, int offset, int length); -} // interface DataOutputStream diff --git a/src/java.corba/share/classes/org/omg/CORBA/DefinitionKind.java b/src/java.corba/share/classes/org/omg/CORBA/DefinitionKind.java deleted file mode 100644 index 5abed1dd5e1..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/DefinitionKind.java +++ /dev/null @@ -1,501 +0,0 @@ -/* - * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * File: ./org/omg/CORBA/DefinitionKind.java - * From: ./ir.idl - * Date: Fri Aug 28 16:03:31 1998 - * By: idltojava Java IDL 1.2 Aug 11 1998 02:00:18 - */ - -package org.omg.CORBA; - -/** -* The class that provides the constants used to identify the type of an -* Interface Repository object. This class contains two kinds of constants, -* those that are an int and those that are an instance of the class -* DefinitionKind. This class provides the method -* from_int, which given one -* of the int constants, creates the corresponding -* DefinitionKind instance. It also provides the method -* value, which returns the int constant that -* is the value for a DefinitionKind instance. -* -* @see IRObject -*/ - -public class DefinitionKind implements org.omg.CORBA.portable.IDLEntity { - -/** - * The constant that indicates that an Interface Repository object - * does not have a definition kind. - */ - public static final int _dk_none = 0, - -/** - * The constant that indicates that the type of an Interface Repository object - * may be any type. - */ - _dk_all = 1, - -/** - * The constant that indicates that an Interface Repository object is an - * attribute. - */ - _dk_Attribute = 2, - -/** - * The constant that indicates that an Interface Repository object is a - * constant. - */ - _dk_Constant = 3, - -/** - * The constant that indicates that an Interface Repository object is an - * exception. - */ - - _dk_Exception = 4, - -/** - * The constant that indicates that an Interface Repository object is an - * interface. - */ - - _dk_Interface = 5, - -/** - * The constant that indicates that an Interface Repository object is a - * module. - */ - - _dk_Module = 6, - -/** - * The constant that indicates that an Interface Repository object is an - * operation. - */ - - _dk_Operation = 7, - -/** - * The constant that indicates that an Interface Repository object is a - * Typedef. - */ - - _dk_Typedef = 8, - -/** - * The constant that indicates that an Interface Repository object is an - * Alias. - */ - - _dk_Alias = 9, - -/** - * The constant that indicates that an Interface Repository object is a - * Struct. - */ - - _dk_Struct = 10, - -/** - * The constant that indicates that an Interface Repository object is a - * Union. - */ - - _dk_Union = 11, - -/** - * The constant that indicates that an Interface Repository object is an - * Enum. - */ - - _dk_Enum = 12, - -/** - * The constant that indicates that an Interface Repository object is a - * Primitive. - */ - - _dk_Primitive = 13, - -/** - * The constant that indicates that an Interface Repository object is a - * String. - */ - - _dk_String = 14, - -/** - * The constant that indicates that an Interface Repository object is a - * Sequence. - */ - - _dk_Sequence = 15, - -/** - * The constant that indicates that an Interface Repository object is an - * Array. - */ - - _dk_Array = 16, - -/** - * The constant that indicates that an Interface Repository object is a - * Repository. - */ - - _dk_Repository = 17, - -/** - * The constant that indicates that an Interface Repository object is a - * Wstring. - */ - - _dk_Wstring = 18, - -/** - * The constant that indicates that an Interface Repository object is of type - * Fixed. - */ - - _dk_Fixed = 19, - -/** - * The constant that indicates that an Interface Repository object is a - * Value. - */ - - _dk_Value = 20, - -/** - * The constant that indicates that an Interface Repository object is a - * ValueBox. - */ - - _dk_ValueBox = 21, - -/** - * The constant that indicates that an Interface Repository object is a - * ValueMember. - */ - - _dk_ValueMember = 22, - -/** - * The constant that indicates that an Interface Repository object is of type - * Native. - */ - - _dk_Native = 23, - -/** - * The constant that indicates that an Interface Repository object - * is representing an abstract interface. - */ - _dk_AbstractInterface = 24; - -/** - * The static instance of DefinitionKind indicating that an - * Interface Repository object has no definition kind. - */ - - public static final DefinitionKind dk_none = new DefinitionKind(_dk_none); - - /** - * The wildcard DefinitionKind constant, useful - * in all occasions where any - * DefinitionKind is appropriate. The Container's - * contents method - * makes use of this constant to return all contained definitions of any kind. - */ - - public static final DefinitionKind dk_all = new DefinitionKind(_dk_all); - -/** - * The static instance of DefinitionKind indicating that an - * Interface Repository object is an Attribute. - */ - - public static final DefinitionKind dk_Attribute = new DefinitionKind(_dk_Attribute); - -/** - * The static instance of DefinitionKind indicating that an - * Interface Repository object is a constant. - */ - - public static final DefinitionKind dk_Constant = new DefinitionKind(_dk_Constant); - - -/** - * The static instance of DefinitionKind indicating that an - * Interface Repository object is an Exception. - */ - - public static final DefinitionKind dk_Exception = new DefinitionKind(_dk_Exception); - -/** - * The static instance of DefinitionKind indicating that an - * Interface Repository object is an Interface. - */ - - public static final DefinitionKind dk_Interface = new DefinitionKind(_dk_Interface); - -/** - * The static instance of DefinitionKind indicating that an - * Interface Repository object is a Module. - */ - - public static final DefinitionKind dk_Module = new DefinitionKind(_dk_Module); - -/** - * The static instance of DefinitionKind indicating that an - * Interface Repository object is an Operation. - */ - - public static final DefinitionKind dk_Operation = new DefinitionKind(_dk_Operation); - -/** - * The static instance of DefinitionKind indicating that an - * Interface Repository object is a Typedef. - */ - - public static final DefinitionKind dk_Typedef = new DefinitionKind(_dk_Typedef); - -/** - * The static instance of DefinitionKind indicating that an - * Interface Repository object is an Alias. - */ - - public static final DefinitionKind dk_Alias = new DefinitionKind(_dk_Alias); - -/** - * The static instance of DefinitionKind indicating that an - * Interface Repository object is a Struct. - */ - - public static final DefinitionKind dk_Struct = new DefinitionKind(_dk_Struct); - -/** - * The static instance of DefinitionKind indicating that an - * Interface Repository object is a Union. - */ - - public static final DefinitionKind dk_Union = new DefinitionKind(_dk_Union); - -/** - * The static instance of DefinitionKind indicating that an - * Interface Repository object is an Enum. - */ - - public static final DefinitionKind dk_Enum = new DefinitionKind(_dk_Enum); - -/** - * The static instance of DefinitionKind indicating that an - * Interface Repository object is a Primitive. - */ - - public static final DefinitionKind dk_Primitive = new DefinitionKind(_dk_Primitive); - -/** - * The static instance of DefinitionKind indicating that an - * Interface Repository object is a String. - */ - - public static final DefinitionKind dk_String = new DefinitionKind(_dk_String); - -/** - * The static instance of DefinitionKind indicating that an - * Interface Repository object is a Sequence. - */ - - public static final DefinitionKind dk_Sequence = new DefinitionKind(_dk_Sequence); - -/** - * The static instance of DefinitionKind indicating that an - * Interface Repository object is an Array. - */ - - public static final DefinitionKind dk_Array = new DefinitionKind(_dk_Array); - - -/** - * The static instance of DefinitionKind indicating that an - * Interface Repository object is a Repository. - */ - - public static final DefinitionKind dk_Repository = new DefinitionKind(_dk_Repository); - - -/** - * The static instance of DefinitionKind indicating that an - * Interface Repository object is a Wstring. - */ - - public static final DefinitionKind dk_Wstring = new DefinitionKind(_dk_Wstring); - -/** - * The static instance of DefinitionKind indicating that an - * Interface Repository object is a Fixed value. - */ - - public static final DefinitionKind dk_Fixed = new DefinitionKind(_dk_Fixed); - -/** - * The static instance of DefinitionKind indicating that an - * Interface Repository object is a Value. - */ - - public static final DefinitionKind dk_Value = new DefinitionKind(_dk_Value); - -/** - * The static instance of DefinitionKind indicating that an - * Interface Repository object is a ValueBox. - */ - - public static final DefinitionKind dk_ValueBox = new DefinitionKind(_dk_ValueBox); - -/** - * The static instance of DefinitionKind indicating that an - * Interface Repository object is a ValueMember. - */ - - public static final DefinitionKind dk_ValueMember = new DefinitionKind(_dk_ValueMember); - - -/** - * The static instance of DefinitionKind indicating that an - * Interface Repository object is a Native value. - */ - - public static final DefinitionKind dk_Native = new DefinitionKind(_dk_Native); - - -/** -* The static instance of DefinitionKind indicating that an -* Interface Repository object represents an abstract interface. -*/ - public static final DefinitionKind dk_AbstractInterface = new DefinitionKind(_dk_AbstractInterface); - - - /** - * Returns the int constant identifying the type of an IR object. - * @return the int constant from the class - * DefinitionKind that is the value of this - * DefinitionKind instance - */ - - public int value() { - return _value; - } - - - /** - * Creates a DefinitionKind instance corresponding to the given code -. - * @param i one of the int constants from the class - * DefinitionKind - * @return the DefinitionKind instance corresponding - * to the given code - * @throws org.omg.CORBA.BAD_PARAM if the given parameter is not - one - * of the int constants from the class - * DefinitionKind - */ - - public static DefinitionKind from_int(int i) { - switch (i) { - case _dk_none: - return dk_none; - case _dk_all: - return dk_all; - case _dk_Attribute: - return dk_Attribute; - case _dk_Constant: - return dk_Constant; - case _dk_Exception: - return dk_Exception; - case _dk_Interface: - return dk_Interface; - case _dk_Module: - return dk_Module; - case _dk_Operation: - return dk_Operation; - case _dk_Typedef: - return dk_Typedef; - case _dk_Alias: - return dk_Alias; - case _dk_Struct: - return dk_Struct; - case _dk_Union: - return dk_Union; - case _dk_Enum: - return dk_Enum; - case _dk_Primitive: - return dk_Primitive; - case _dk_String: - return dk_String; - case _dk_Sequence: - return dk_Sequence; - case _dk_Array: - return dk_Array; - case _dk_Repository: - return dk_Repository; - case _dk_Wstring: - return dk_Wstring; - case _dk_Fixed: - return dk_Fixed; - case _dk_Value: - return dk_Value; - case _dk_ValueBox: - return dk_ValueBox; - case _dk_ValueMember: - return dk_ValueMember; - case _dk_Native: - return dk_Native; - default: - throw new org.omg.CORBA.BAD_PARAM(); - } - } - - /** - * Constructs a DefinitionKind object with its _value - * field initialized with the given value. - * @param _value one of the int constants defined in the - * class DefinitionKind - */ - - protected DefinitionKind(int _value){ - this._value = _value; - } - - /** - * The field that holds a value for a DefinitionKind object. - * @serial - */ - - private int _value; -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/DefinitionKindHelper.java b/src/java.corba/share/classes/org/omg/CORBA/DefinitionKindHelper.java deleted file mode 100644 index 945ceebf379..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/DefinitionKindHelper.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Helper for {@code DefinitionKind}. For more information on - * Helper files, see - * "Generated Files: Helper Files".

            - * org/omg/CORBA/DefinitionKindHelper.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from ir.idl - * 03 June 1999 11:33:43 o'clock GMT+00:00 - */ - -abstract public class DefinitionKindHelper -{ - private static String _id = "IDL:omg.org/CORBA/DefinitionKind:1.0"; - - public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.DefinitionKind that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static org.omg.CORBA.DefinitionKind extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_enum_tc (org.omg.CORBA.DefinitionKindHelper.id (), "DefinitionKind", new String[] { "dk_none", "dk_all", "dk_Attribute", "dk_Constant", "dk_Exception", "dk_Interface", "dk_Module", "dk_Operation", "dk_Typedef", "dk_Alias", "dk_Struct", "dk_Union", "dk_Enum", "dk_Primitive", "dk_String", "dk_Sequence", "dk_Array", "dk_Repository", "dk_Wstring", "dk_Fixed", "dk_Value", "dk_ValueBox", "dk_ValueMember", "dk_Native"} ); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static org.omg.CORBA.DefinitionKind read (org.omg.CORBA.portable.InputStream istream) - { - return org.omg.CORBA.DefinitionKind.from_int (istream.read_long ()); - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.DefinitionKind value) - { - ostream.write_long (value.value ()); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/DomainManager.java b/src/java.corba/share/classes/org/omg/CORBA/DomainManager.java deleted file mode 100644 index 2bdc89f9147..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/DomainManager.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * Provides mechanisms for establishing and navigating relationships to - * superior and subordinate domains, as well as for creating and accessing - * policies. The {@code DomainManager} has associated with it the policy - * objects for a particular domain. - * The domain manager also records the membership of - * the domain and provides the means to add and remove members. The domain - * manager is itself a member of a domain, possibly the domain it manages. - * The domain manager provides mechanisms for establishing and navigating - * relationships to superior and subordinate domains and - * creating and accessing policies. - */ - -public interface DomainManager extends DomainManagerOperations, - org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity -{ -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/DomainManagerOperations.java b/src/java.corba/share/classes/org/omg/CORBA/DomainManagerOperations.java deleted file mode 100644 index 4324b1b6136..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/DomainManagerOperations.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * Provides the {@code DomainManager} with the means to access policies. - *

            - * The {@code DomainManager} has associated with it the policy objects for a - * particular domain. The domain manager also records the membership of - * the domain and provides the means to add and remove members. The domain - * manager is itself a member of a domain, possibly the domain it manages. - * The domain manager provides mechanisms for establishing and navigating - * relationships to superior and subordinate domains and - * creating and accessing policies. - */ - -public interface DomainManagerOperations -{ - /** - * This returns the policy of the specified type for objects in - * this domain. The types of policies available are domain specific. - * See the CORBA specification for a list of standard ORB policies. - * - * @param policy_type Type of policy to request - */ - public org.omg.CORBA.Policy get_domain_policy(int policy_type); -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/DoubleHolder.java b/src/java.corba/share/classes/org/omg/CORBA/DoubleHolder.java deleted file mode 100644 index 3d1cd7300b5..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/DoubleHolder.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 1995, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -import org.omg.CORBA.portable.Streamable; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; - -/** - * The Holder for {@code Double}. For more information on - * Holder files, see - * "Generated Files: Holder Files".

            - * A Holder class for a {@code double} - * that is used to store "out" and "inout" parameters in IDL methods. - * If an IDL method signature has an IDL {@code double} as an "out" - * or "inout" parameter, the programmer must pass an instance of - * {@code DoubleHolder} as the corresponding - * parameter in the method invocation; for "inout" parameters, the programmer - * must also fill the "in" value to be sent to the server. - * Before the method invocation returns, the ORB will fill in the - * value corresponding to the "out" value returned from the server. - *

            - * If {@code myDoubleHolder} is an instance of {@code DoubleHolder}, - * the value stored in its {@code value} field can be accessed with - * {@code myDoubleHolder.value}. - * - * @since JDK1.2 - */ -public final class DoubleHolder implements Streamable { - - /** - * The {@code double} value held by this {@code DoubleHolder} - * object. - */ - - public double value; - - /** - * Constructs a new {@code DoubleHolder} object with its - * {@code value} field initialized to 0.0. - */ - public DoubleHolder() { - } - - /** - * Constructs a new {@code DoubleHolder} object for the given - * {@code double}. - * @param initial the {@code double} with which to initialize - * the {@code value} field of the new - * {@code DoubleHolder} object - */ - public DoubleHolder(double initial) { - value = initial; - } - - /** - * Read a double value from the input stream and store it in the - * value member. - * - * @param input the {@code InputStream} to read from. - */ - public void _read(InputStream input) { - value = input.read_double(); - } - - /** - * Write the double value stored in this holder to an - * {@code OutputStream}. - * - * @param output the {@code OutputStream} to write into. - */ - public void _write(OutputStream output) { - output.write_double(value); - } - - /** - * Return the {@code TypeCode} of this holder object. - * - * @return the {@code TypeCode} object. - */ - public org.omg.CORBA.TypeCode _type() { - return ORB.init().get_primitive_tc(TCKind.tk_double); - } - - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/DoubleSeqHelper.java b/src/java.corba/share/classes/org/omg/CORBA/DoubleSeqHelper.java deleted file mode 100644 index 5c63c491b22..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/DoubleSeqHelper.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Helper for {@code DoubleSeq}. For more information on - * Helper files, see - * "Generated Files: Helper Files".

            - * org/omg/CORBA/DoubleSeqHelper.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from streams.idl - * 13 May 1999 22:41:37 o'clock GMT+00:00 - * - * The class definition has been modified to conform to the following - * OMG specifications : - *

              - *
            • ORB core as defined by CORBA 2.3.1 - * (formal/99-10-07) - *
            • - * - *
            • IDL/Java Language Mapping as defined in - * ptc/00-01-08 - *
            • - *
            - */ - -public abstract class DoubleSeqHelper -{ - private static String _id = "IDL:omg.org/CORBA/DoubleSeq:1.0"; - - public static void insert (org.omg.CORBA.Any a, double[] that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static double[] extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_double); - __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.DoubleSeqHelper.id (), "DoubleSeq", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static double[] read (org.omg.CORBA.portable.InputStream istream) - { - double value[] = null; - int _len0 = istream.read_long (); - value = new double[_len0]; - istream.read_double_array (value, 0, _len0); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, double[] value) - { - ostream.write_long (value.length); - ostream.write_double_array (value, 0, value.length); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/DoubleSeqHolder.java b/src/java.corba/share/classes/org/omg/CORBA/DoubleSeqHolder.java deleted file mode 100644 index d71651c6877..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/DoubleSeqHolder.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Holder for {@code DoubleSeq}. For more information on - * Holder files, see - * "Generated Files: Holder Files".

            - * org/omg/CORBA/DoubleSeqHolder.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from streams.idl - * 13 May 1999 22:41:37 o'clock GMT+00:00 - */ - -public final class DoubleSeqHolder implements org.omg.CORBA.portable.Streamable -{ - public double value[] = null; - - public DoubleSeqHolder () - { - } - - public DoubleSeqHolder (double[] initialValue) - { - value = initialValue; - } - - public void _read (org.omg.CORBA.portable.InputStream i) - { - value = org.omg.CORBA.DoubleSeqHelper.read (i); - } - - public void _write (org.omg.CORBA.portable.OutputStream o) - { - org.omg.CORBA.DoubleSeqHelper.write (o, value); - } - - public org.omg.CORBA.TypeCode _type () - { - return org.omg.CORBA.DoubleSeqHelper.type (); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/DynAny.java b/src/java.corba/share/classes/org/omg/CORBA/DynAny.java deleted file mode 100644 index 0d45b25b29e..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/DynAny.java +++ /dev/null @@ -1,732 +0,0 @@ -/* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package org.omg.CORBA; - - -/** - * Enables {@code org.omg.CORBA.Any} values to be dynamically - * interpreted (traversed) and - * constructed. A {@code DynAny} object is associated with a data value - * which may correspond to a copy of the value inserted into an {@code Any}. - * The {@code DynAny} APIs enable traversal of the data value associated with an - * Any at runtime and extraction of the primitive constituents of the - * data value. - * @deprecated Use the new DynAny instead - */ -@Deprecated -public interface DynAny extends org.omg.CORBA.Object -{ - /** - * Returns the {@code TypeCode} of the object inserted into - * this {@code DynAny}. - * - * @return the {@code TypeCode} object. - */ - public org.omg.CORBA.TypeCode type() ; - - /** - * Copy the contents from one Dynamic Any into another. - * - * @param dyn_any the {@code DynAny} object whose contents - * are assigned to this {@code DynAny}. - * @throws org.omg.CORBA.DynAnyPackage.Invalid if the source - * {@code DynAny} is invalid - */ - public void assign(org.omg.CORBA.DynAny dyn_any) - throws org.omg.CORBA.DynAnyPackage.Invalid; - - /** - * Make a {@code DynAny} object from an {@code Any} - * object. - * - * @param value the {@code Any} object. - * @throws org.omg.CORBA.DynAnyPackage.Invalid if the source - * {@code Any} object is empty or bad - */ - public void from_any(org.omg.CORBA.Any value) - throws org.omg.CORBA.DynAnyPackage.Invalid; - - /** - * Convert a {@code DynAny} object to an {@code Any} - * object. - * - * @return the {@code Any} object. - * @throws org.omg.CORBA.DynAnyPackage.Invalid if this - * {@code DynAny} is empty or bad. - * created or does not contain a meaningful value - */ - public org.omg.CORBA.Any to_any() - throws org.omg.CORBA.DynAnyPackage.Invalid; - - /** - * Destroys this {@code DynAny} object and frees any resources - * used to represent the data value associated with it. This method - * also destroys all {@code DynAny} objects obtained from it. - *

            - * Destruction of {@code DynAny} objects should be handled with - * care, taking into account issues dealing with the representation of - * data values associated with {@code DynAny} objects. A programmer - * who wants to destroy a {@code DynAny} object but still be able - * to manipulate some component of the data value associated with it, - * should first create a {@code DynAny} object for the component - * and then make a copy of the created {@code DynAny} object. - */ - public void destroy() ; - - /** - * Clones this {@code DynAny} object. - * - * @return a copy of this {@code DynAny} object - */ - public org.omg.CORBA.DynAny copy() ; - - /** - * Inserts the given {@code boolean} as the value for this - * {@code DynAny} object. - * - *

            If this method is called on a constructed {@code DynAny} - * object, it initializes the next component of the constructed data - * value associated with this {@code DynAny} object. - * - * @param value the {@code boolean} to insert into this - * {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.InvalidValue - * if the value inserted is not consistent with the type - * of the accessed component in this {@code DynAny} object - */ - public void insert_boolean(boolean value) - throws org.omg.CORBA.DynAnyPackage.InvalidValue; - - /** - * Inserts the given {@code byte} as the value for this - * {@code DynAny} object. - * - *

            If this method is called on a constructed {@code DynAny} - * object, it initializes the next component of the constructed data - * value associated with this {@code DynAny} object. - * - * @param value the {@code byte} to insert into this - * {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.InvalidValue - * if the value inserted is not consistent with the type - * of the accessed component in this {@code DynAny} object - */ - public void insert_octet(byte value) - throws org.omg.CORBA.DynAnyPackage.InvalidValue; - - /** - * Inserts the given {@code char} as the value for this - * {@code DynAny} object. - * - *

            If this method is called on a constructed {@code DynAny} - * object, it initializes the next component of the constructed data - * value associated with this {@code DynAny} object. - * - * @param value the {@code char} to insert into this - * {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.InvalidValue - * if the value inserted is not consistent with the type - * of the accessed component in this {@code DynAny} object - */ - public void insert_char(char value) - throws org.omg.CORBA.DynAnyPackage.InvalidValue; - - /** - * Inserts the given {@code short} as the value for this - * {@code DynAny} object. - * - *

            If this method is called on a constructed {@code DynAny} - * object, it initializes the next component of the constructed data - * value associated with this {@code DynAny} object. - * - * @param value the {@code short} to insert into this - * {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.InvalidValue - * if the value inserted is not consistent with the type - * of the accessed component in this {@code DynAny} object - */ - public void insert_short(short value) - throws org.omg.CORBA.DynAnyPackage.InvalidValue; - - /** - * Inserts the given {@code short} as the value for this - * {@code DynAny} object. - * - *

            If this method is called on a constructed {@code DynAny} - * object, it initializes the next component of the constructed data - * value associated with this {@code DynAny} object. - * - * @param value the {@code short} to insert into this - * {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.InvalidValue - * if the value inserted is not consistent with the type - * of the accessed component in this {@code DynAny} object - */ - public void insert_ushort(short value) - throws org.omg.CORBA.DynAnyPackage.InvalidValue; - - /** - * Inserts the given {@code int} as the value for this - * {@code DynAny} object. - * - *

            If this method is called on a constructed {@code DynAny} - * object, it initializes the next component of the constructed data - * value associated with this {@code DynAny} object. - * - * @param value the {@code int} to insert into this - * {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.InvalidValue - * if the value inserted is not consistent with the type - * of the accessed component in this {@code DynAny} object - */ - public void insert_long(int value) - throws org.omg.CORBA.DynAnyPackage.InvalidValue; - - /** - * Inserts the given {@code int} as the value for this - * {@code DynAny} object. - * - *

            If this method is called on a constructed {@code DynAny} - * object, it initializes the next component of the constructed data - * value associated with this {@code DynAny} object. - * - * @param value the {@code int} to insert into this - * {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.InvalidValue - * if the value inserted is not consistent with the type - * of the accessed component in this {@code DynAny} object - */ - public void insert_ulong(int value) - throws org.omg.CORBA.DynAnyPackage.InvalidValue; - - /** - * Inserts the given {@code float} as the value for this - * {@code DynAny} object. - * - *

            If this method is called on a constructed {@code DynAny} - * object, it initializes the next component of the constructed data - * value associated with this {@code DynAny} object. - * - * @param value the {@code float} to insert into this - * {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.InvalidValue - * if the value inserted is not consistent with the type - * of the accessed component in this {@code DynAny} object - */ - public void insert_float(float value) - throws org.omg.CORBA.DynAnyPackage.InvalidValue; - - /** - * Inserts the given {@code double} as the value for this - * {@code DynAny} object. - * - *

            If this method is called on a constructed {@code DynAny} - * object, it initializes the next component of the constructed data - * value associated with this {@code DynAny} object. - * - * @param value the {@code double} to insert into this - * {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.InvalidValue - * if the value inserted is not consistent with the type - * of the accessed component in this {@code DynAny} object - */ - public void insert_double(double value) - throws org.omg.CORBA.DynAnyPackage.InvalidValue; - - /** - * Inserts the given {@code String} object as the value for this - * {@code DynAny} object. - * - *

            If this method is called on a constructed {@code DynAny} - * object, it initializes the next component of the constructed data - * value associated with this {@code DynAny} object. - * - * @param value the {@code String} to insert into this - * {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.InvalidValue - * if the value inserted is not consistent with the type - * of the accessed component in this {@code DynAny} object - */ - public void insert_string(String value) - throws org.omg.CORBA.DynAnyPackage.InvalidValue; - - /** - * Inserts the given {@code org.omg.CORBA.Object} as the value for this - * {@code DynAny} object. - * - *

            If this method is called on a constructed {@code DynAny} - * object, it initializes the next component of the constructed data - * value associated with this {@code DynAny} object. - * - * @param value the {@code org.omg.CORBA.Object} to insert into this - * {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.InvalidValue - * if the value inserted is not consistent with the type - * of the accessed component in this {@code DynAny} object - */ - public void insert_reference(org.omg.CORBA.Object value) - throws org.omg.CORBA.DynAnyPackage.InvalidValue; - - /** - * Inserts the given {@code org.omg.CORBA.TypeCode} as the value for this - * {@code DynAny} object. - * - *

            If this method is called on a constructed {@code DynAny} - * object, it initializes the next component of the constructed data - * value associated with this {@code DynAny} object. - * - * @param value the {@code org.omg.CORBA.TypeCode} to insert into this - * {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.InvalidValue - * if the value inserted is not consistent with the type - * of the accessed component in this {@code DynAny} object - */ - public void insert_typecode(org.omg.CORBA.TypeCode value) - throws org.omg.CORBA.DynAnyPackage.InvalidValue; - - /** - * Inserts the given {@code long} as the value for this - * {@code DynAny} object. - * - *

            If this method is called on a constructed {@code DynAny} - * object, it initializes the next component of the constructed data - * value associated with this {@code DynAny} object. - * - * @param value the {@code long} to insert into this - * {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.InvalidValue - * if the value inserted is not consistent with the type - * of the accessed component in this {@code DynAny} object - */ - public void insert_longlong(long value) - throws org.omg.CORBA.DynAnyPackage.InvalidValue; - - /** - * Inserts the given {@code long} as the value for this - * {@code DynAny} object. - * - *

            If this method is called on a constructed {@code DynAny} - * object, it initializes the next component of the constructed data - * value associated with this {@code DynAny} object. - * - * @param value the {@code long} to insert into this - * {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.InvalidValue - * if the value inserted is not consistent with the type - * of the accessed component in this {@code DynAny} object - */ - public void insert_ulonglong(long value) - throws org.omg.CORBA.DynAnyPackage.InvalidValue; - - /** - * Inserts the given {@code char} as the value for this - * {@code DynAny} object. - * - *

            If this method is called on a constructed {@code DynAny} - * object, it initializes the next component of the constructed data - * value associated with this {@code DynAny} object. - * - * @param value the {@code char} to insert into this - * {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.InvalidValue - * if the value inserted is not consistent with the type - * of the accessed component in this {@code DynAny} object - */ - public void insert_wchar(char value) - throws org.omg.CORBA.DynAnyPackage.InvalidValue; - - /** - * Inserts the given {@code String} as the value for this - * {@code DynAny} object. - * - *

            If this method is called on a constructed {@code DynAny} - * object, it initializes the next component of the constructed data - * value associated with this {@code DynAny} object. - * - * @param value the {@code String} to insert into this - * {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.InvalidValue - * if the value inserted is not consistent with the type - * of the accessed component in this {@code DynAny} object - */ - public void insert_wstring(String value) - throws org.omg.CORBA.DynAnyPackage.InvalidValue; - - /** - * Inserts the given {@code org.omg.CORBA.Any} object as the value for this - * {@code DynAny} object. - * - *

            If this method is called on a constructed {@code DynAny} - * object, it initializes the next component of the constructed data - * value associated with this {@code DynAny} object. - * - * @param value the {@code org.omg.CORBA.Any} object to insert into this - * {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.InvalidValue - * if the value inserted is not consistent with the type - * of the accessed component in this {@code DynAny} object - */ - public void insert_any(org.omg.CORBA.Any value) - throws org.omg.CORBA.DynAnyPackage.InvalidValue; - - // orbos 98-01-18: Objects By Value -- begin - - /** - * Inserts the given {@code java.io.Serializable} object as the value for this - * {@code DynAny} object. - * - *

            If this method is called on a constructed {@code DynAny} - * object, it initializes the next component of the constructed data - * value associated with this {@code DynAny} object. - * - * @param value the {@code java.io.Serializable} object to insert into this - * {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.InvalidValue - * if the value inserted is not consistent with the type - * of the accessed component in this {@code DynAny} object - */ - public void insert_val(java.io.Serializable value) - throws org.omg.CORBA.DynAnyPackage.InvalidValue; - - /** - * Retrieves the {@code java.io.Serializable} object contained - * in this {@code DynAny} object. - * - * @return the {@code java.io.Serializable} object that is the - * value for this {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.TypeMismatch - * if the type code of the accessed component in this - * {@code DynAny} object is not equivalent to - * the type code for a {@code java.io.Serializable} object - */ - public java.io.Serializable get_val() - throws org.omg.CORBA.DynAnyPackage.TypeMismatch; - - // orbos 98-01-18: Objects By Value -- end - - /** - * Retrieves the {@code boolean} contained - * in this {@code DynAny} object. - * - * @return the {@code boolean} that is the - * value for this {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.TypeMismatch - * if the type code of the accessed component in this - * {@code DynAny} object is not equivalent to - * the type code for a {@code boolean} - */ - public boolean get_boolean() - throws org.omg.CORBA.DynAnyPackage.TypeMismatch; - - - /** - * Retrieves the {@code byte} contained - * in this {@code DynAny} object. - * - * @return the {@code byte} that is the - * value for this {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.TypeMismatch - * if the type code of the accessed component in this - * {@code DynAny} object is not equivalent to - * the type code for a {@code byte} - */ - public byte get_octet() - throws org.omg.CORBA.DynAnyPackage.TypeMismatch; - - /** - * Retrieves the {@code char} contained - * in this {@code DynAny} object. - * - * @return the {@code char} that is the - * value for this {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.TypeMismatch - * if the type code of the accessed component in this - * {@code DynAny} object is not equivalent to - * the type code for a {@code char} - */ - public char get_char() - throws org.omg.CORBA.DynAnyPackage.TypeMismatch; - - - /** - * Retrieves the {@code short} contained - * in this {@code DynAny} object. - * - * @return the {@code short} that is the - * value for this {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.TypeMismatch - * if the type code of the accessed component in this - * {@code DynAny} object is not equivalent to - * the type code for a {@code short} - */ - public short get_short() - throws org.omg.CORBA.DynAnyPackage.TypeMismatch; - - - /** - * Retrieves the {@code short} contained - * in this {@code DynAny} object. - * - * @return the {@code short} that is the - * value for this {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.TypeMismatch - * if the type code of the accessed component in this - * {@code DynAny} object is not equivalent to - * the type code for a {@code short} - */ - public short get_ushort() - throws org.omg.CORBA.DynAnyPackage.TypeMismatch; - - - /** - * Retrieves the {@code int} contained - * in this {@code DynAny} object. - * - * @return the {@code int} that is the - * value for this {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.TypeMismatch - * if the type code of the accessed component in this - * {@code DynAny} object is not equivalent to - * the type code for a {@code int} - */ - public int get_long() - throws org.omg.CORBA.DynAnyPackage.TypeMismatch; - - - /** - * Retrieves the {@code int} contained - * in this {@code DynAny} object. - * - * @return the {@code int} that is the - * value for this {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.TypeMismatch - * if the type code of the accessed component in this - * {@code DynAny} object is not equivalent to - * the type code for a {@code int} - */ - public int get_ulong() - throws org.omg.CORBA.DynAnyPackage.TypeMismatch; - - - /** - * Retrieves the {@code float} contained - * in this {@code DynAny} object. - * - * @return the {@code float} that is the - * value for this {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.TypeMismatch - * if the type code of the accessed component in this - * {@code DynAny} object is not equivalent to - * the type code for a {@code float} - */ - public float get_float() - throws org.omg.CORBA.DynAnyPackage.TypeMismatch; - - - /** - * Retrieves the {@code double} contained - * in this {@code DynAny} object. - * - * @return the {@code double} that is the - * value for this {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.TypeMismatch - * if the type code of the accessed component in this - * {@code DynAny} object is not equivalent to - * the type code for a {@code double} - */ - public double get_double() - throws org.omg.CORBA.DynAnyPackage.TypeMismatch; - - - /** - * Retrieves the {@code String} contained - * in this {@code DynAny} object. - * - * @return the {@code String} that is the - * value for this {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.TypeMismatch - * if the type code of the accessed component in this - * {@code DynAny} object is not equivalent to - * the type code for a {@code String} - */ - public String get_string() - throws org.omg.CORBA.DynAnyPackage.TypeMismatch; - - - /** - * Retrieves the {@code org.omg.CORBA.Other} contained - * in this {@code DynAny} object. - * - * @return the {@code org.omg.CORBA.Other} that is the - * value for this {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.TypeMismatch - * if the type code of the accessed component in this - * {@code DynAny} object is not equivalent to - * the type code for an {@code org.omg.CORBA.Other} - */ - public org.omg.CORBA.Object get_reference() - throws org.omg.CORBA.DynAnyPackage.TypeMismatch; - - - /** - * Retrieves the {@code org.omg.CORBA.TypeCode} contained - * in this {@code DynAny} object. - * - * @return the {@code org.omg.CORBA.TypeCode} that is the - * value for this {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.TypeMismatch - * if the type code of the accessed component in this - * {@code DynAny} object is not equivalent to - * the type code for a {@code org.omg.CORBA.TypeCode} - */ - public org.omg.CORBA.TypeCode get_typecode() - throws org.omg.CORBA.DynAnyPackage.TypeMismatch; - - - /** - * Retrieves the {@code long} contained - * in this {@code DynAny} object. - * - * @return the {@code long} that is the - * value for this {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.TypeMismatch - * if the type code of the accessed component in this - * {@code DynAny} object is not equivalent to - * the type code for a {@code long} - */ - public long get_longlong() - throws org.omg.CORBA.DynAnyPackage.TypeMismatch; - - - /** - * Retrieves the {@code long} contained - * in this {@code DynAny} object. - * - * @return the {@code long} that is the - * value for this {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.TypeMismatch - * if the type code of the accessed component in this - * {@code DynAny} object is not equivalent to - * the type code for a {@code long} - */ - public long get_ulonglong() - throws org.omg.CORBA.DynAnyPackage.TypeMismatch; - - - /** - * Retrieves the {@code char} contained - * in this {@code DynAny} object. - * - * @return the {@code char} that is the - * value for this {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.TypeMismatch - * if the type code of the accessed component in this - * {@code DynAny} object is not equivalent to - * the type code for a {@code char} - */ - public char get_wchar() - throws org.omg.CORBA.DynAnyPackage.TypeMismatch; - - - /** - * Retrieves the {@code String} contained - * in this {@code DynAny} object. - * - * @return the {@code String} that is the - * value for this {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.TypeMismatch - * if the type code of the accessed component in this - * {@code DynAny} object is not equivalent to - * the type code for a {@code String} - */ - public String get_wstring() - throws org.omg.CORBA.DynAnyPackage.TypeMismatch; - - - /** - * Retrieves the {@code org.omg.CORBA.Any} contained - * in this {@code DynAny} object. - * - * @return the {@code org.omg.CORBA.Any} that is the - * value for this {@code DynAny} object - * @throws org.omg.CORBA.DynAnyPackage.TypeMismatch - * if the type code of the accessed component in this - * {@code DynAny} object is not equivalent to - * the type code for an {@code org.omg.CORBA.Any} - */ - public org.omg.CORBA.Any get_any() - throws org.omg.CORBA.DynAnyPackage.TypeMismatch; - - /** - * Returns a {@code DynAny} object reference that can - * be used to get/set the value of the component currently accessed. - * The appropriate {@code insert} method - * can be called on the resulting {@code DynAny} object - * to initialize the component. - * The appropriate {@code get} method - * can be called on the resulting {@code DynAny} object - * to extract the value of the component. - * - * @return a {@code DynAny} object reference that can be - * used to retrieve or set the value of the component currently - * accessed - */ - public org.omg.CORBA.DynAny current_component() ; - - /** - * Moves to the next component of this {@code DynAny} object. - * This method is used for iterating through the components of - * a constructed type, effectively moving a pointer from one - * component to the next. The pointer starts out on the first - * component when a {@code DynAny} object is created. - * - * @return {@code true} if the pointer points to a component; - * {@code false} if there are no more components or this - * {@code DynAny} is associated with a basic type rather than - * a constructed type - */ - public boolean next() ; - - /** - * Moves the internal pointer to the given index. Logically, this method - * sets a new offset for this pointer. - * - * @param index an {@code int} indicating the position to which - * the pointer should move. The first position is 0. - * @return {@code true} if the pointer points to a component; - * {@code false} if there is no component at the designated - * index. If this {@code DynAny} object is associated with a - * basic type, this method returns {@code false} for any index - * other than 0. - */ - public boolean seek(int index) ; - - /** - * Moves the internal pointer to the first component. - */ - public void rewind() ; -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/DynAnyPackage/Invalid.java b/src/java.corba/share/classes/org/omg/CORBA/DynAnyPackage/Invalid.java deleted file mode 100644 index 9b87ab57670..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/DynAnyPackage/Invalid.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package org.omg.CORBA.DynAnyPackage; - -/** - * Invalid is thrown by dynamic any operations when a bad - * DynAny or Any is passed as a parameter. - */ -public final class Invalid - extends org.omg.CORBA.UserException { - - /** - * Constructs an Invalid object. - */ - public Invalid() { - super(); - } - - /** - * Constructs an Invalid object. - * @param reason a String giving more information - * regarding the bad parameter passed to a dynamic any operation. - */ - public Invalid(String reason) { - super(reason); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/DynAnyPackage/InvalidSeq.java b/src/java.corba/share/classes/org/omg/CORBA/DynAnyPackage/InvalidSeq.java deleted file mode 100644 index 399eab5a4ce..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/DynAnyPackage/InvalidSeq.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package org.omg.CORBA.DynAnyPackage; - -/** - * The InvalidSeq exception is thrown by all operations on dynamic - * anys that take a sequence (Java array) as an argument, when that - * sequence is invalid. - */ -public final class InvalidSeq - extends org.omg.CORBA.UserException { - - /** - * Constructs an InvalidSeq object. - */ - public InvalidSeq() { - super(); - } - - /** - * Constructs an InvalidSeq object. - * @param reason a String giving more information - * regarding the exception. - */ - public InvalidSeq(String reason) { - super(reason); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/DynAnyPackage/InvalidValue.java b/src/java.corba/share/classes/org/omg/CORBA/DynAnyPackage/InvalidValue.java deleted file mode 100644 index ea42c8392d8..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/DynAnyPackage/InvalidValue.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA.DynAnyPackage; - -/** - * @author unattributed - * - * Dynamic Any insert operations raise the InvalidValue - * exception if the value inserted is not consistent with the type - * of the accessed component in the DynAny object. - */ -public final class InvalidValue - extends org.omg.CORBA.UserException { - - /** - * Constructs an InvalidValue object. - */ - public InvalidValue() { - super(); - } - - /** - * Constructs an InvalidValue object. - * @param reason a String giving more information - * regarding the exception. - */ - public InvalidValue(String reason) { - super(reason); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/DynAnyPackage/TypeMismatch.java b/src/java.corba/share/classes/org/omg/CORBA/DynAnyPackage/TypeMismatch.java deleted file mode 100644 index 698be59a11b..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/DynAnyPackage/TypeMismatch.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package org.omg.CORBA.DynAnyPackage; - -/** - * TypeMismatch is thrown by dynamic any accessor methods when - * type of the actual contents do not match what is trying to be - * accessed. - */ -public final class TypeMismatch - extends org.omg.CORBA.UserException { - - /** - * Constructs a TypeMismatch object. - */ - public TypeMismatch() { - super(); - } - - /** - * Constructs a TypeMismatch object. - * @param reason a String giving more information - * regarding the exception. - */ - public TypeMismatch(String reason) { - super(reason); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/DynAnyPackage/package.html b/src/java.corba/share/classes/org/omg/CORBA/DynAnyPackage/package.html deleted file mode 100644 index 0908e6462b0..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/DynAnyPackage/package.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - -Provides the exceptions used with the DynAny interface -(InvalidValue, -Invalid, InvalidSeq, and -TypeMismatch). - - - -@since JDK1.2 -@serial exclude - - diff --git a/src/java.corba/share/classes/org/omg/CORBA/DynArray.java b/src/java.corba/share/classes/org/omg/CORBA/DynArray.java deleted file mode 100644 index 83236a076fd..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/DynArray.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package org.omg.CORBA; - - -/** - * Represents a {@code DynAny} object associated with an array. - * - * @deprecated Use the new DynArray instead - */ -@Deprecated -public interface DynArray extends org.omg.CORBA.Object, org.omg.CORBA.DynAny -{ - /** - * Returns the value of all the elements of this array. - * - * @return the array of Any objects that is the value - * for this DynArray object - * @see #set_elements - */ - public org.omg.CORBA.Any[] get_elements(); - - /** - * Sets the value of this - * DynArray object to the given array. - * - * @param value the array of Any objects - * @exception org.omg.CORBA.DynAnyPackage.InvalidSeq if the - * sequence is bad - * @see #get_elements - */ - public void set_elements(org.omg.CORBA.Any[] value) - throws org.omg.CORBA.DynAnyPackage.InvalidSeq; -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/DynEnum.java b/src/java.corba/share/classes/org/omg/CORBA/DynEnum.java deleted file mode 100644 index d98957c1425..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/DynEnum.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package org.omg.CORBA; - -/** - * Represents a {@code DynAny} object associated with an IDL enum. - * - * @deprecated Use the new DynEnum instead - */ -@Deprecated -public interface DynEnum extends org.omg.CORBA.Object, org.omg.CORBA.DynAny -{ - /** - * Return the value of the IDL enum stored in this - * {@code DynEnum} as a string. - * - * @return the stringified value. - */ - public String value_as_string(); - - /** - * Set a particular enum in this {@code DynEnum}. - * - * @param arg the string corresponding to the value. - */ - public void value_as_string(String arg); - - /** - * Return the value of the IDL enum as a Java int. - * - * @return the integer value. - */ - public int value_as_ulong(); - - /** - * Set the value of the IDL enum. - * - * @param arg the int value of the enum. - */ - public void value_as_ulong(int arg); -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/DynFixed.java b/src/java.corba/share/classes/org/omg/CORBA/DynFixed.java deleted file mode 100644 index 7cf872e852f..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/DynFixed.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package org.omg.CORBA; - -/** - * Represents a DynAny object that is associated - * with an IDL fixed type. - * @deprecated Use the new DynFixed instead - */ -@Deprecated -public interface DynFixed extends org.omg.CORBA.Object, org.omg.CORBA.DynAny -{ - /** - * Returns the value of the fixed type represented in this - * DynFixed object. - * - * @return the value as a byte array - * @see #set_value - */ - public byte[] get_value(); - - /** - * Sets the given fixed type instance as the value for this - * DynFixed object. - * - * @param val the value of the fixed type as a byte array - * @throws org.omg.CORBA.DynAnyPackage.InvalidValue if the given - * argument is bad - * @see #get_value - */ - public void set_value(byte[] val) - throws org.omg.CORBA.DynAnyPackage.InvalidValue; -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/DynSequence.java b/src/java.corba/share/classes/org/omg/CORBA/DynSequence.java deleted file mode 100644 index c5361834c75..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/DynSequence.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package org.omg.CORBA; - -/** - * The representation of a DynAny object that is associated - * with an IDL sequence. - * @deprecated Use the new DynSequence instead - */ -@Deprecated -public interface DynSequence extends org.omg.CORBA.Object, org.omg.CORBA.DynAny -{ - - /** - * Returns the length of the sequence represented by this - * DynFixed object. - * - * @return the length of the sequence - */ - public int length(); - - /** - * Sets the length of the sequence represented by this - * DynFixed object to the given argument. - * - * @param arg the length of the sequence - */ - public void length(int arg); - - /** - * Returns the value of every element in this sequence. - * - * @return an array of Any objects containing the values in - * the sequence - * @see #set_elements - */ - public org.omg.CORBA.Any[] get_elements(); - - /** - * Sets the values of all elements in this sequence with the given - * array. - * - * @param value the array of Any objects to be set - * @exception org.omg.CORBA.DynAnyPackage.InvalidSeq if the array - * of values is bad - * @see #get_elements - */ - public void set_elements(org.omg.CORBA.Any[] value) - throws org.omg.CORBA.DynAnyPackage.InvalidSeq; -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/DynStruct.java b/src/java.corba/share/classes/org/omg/CORBA/DynStruct.java deleted file mode 100644 index 448f158ed19..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/DynStruct.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package org.omg.CORBA; - -/** - * The representation of a DynAny object that is associated - * with an IDL struct. - * @deprecated Use the new DynStruct instead - */ -@Deprecated -public interface DynStruct extends org.omg.CORBA.Object, org.omg.CORBA.DynAny -{ - /** - * During a traversal, returns the name of the current member. - * - * @return the string name of the current member - */ - public String current_member_name(); - - /** - * Returns the TCKind object that describes the kind of - * the current member. - * - * @return the TCKind object that describes the current member - */ - public org.omg.CORBA.TCKind current_member_kind(); - - /** - * Returns an array containing all the members of the stored struct. - * - * @return the array of name-value pairs - * @see #set_members - */ - public org.omg.CORBA.NameValuePair[] get_members(); - - /** - * Set the members of the struct. - * - * @param value the array of name-value pairs. - * @throws org.omg.CORBA.DynAnyPackage.InvalidSeq if the given argument - * is invalid - * @see #get_members - */ - public void set_members(org.omg.CORBA.NameValuePair[] value) - throws org.omg.CORBA.DynAnyPackage.InvalidSeq; -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/DynUnion.java b/src/java.corba/share/classes/org/omg/CORBA/DynUnion.java deleted file mode 100644 index 6ce271d882b..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/DynUnion.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package org.omg.CORBA; - -/** - * The DynUnion interface represents a DynAny object - * that is associated with an IDL union. - * Union values can be traversed using the operations defined in DynAny. - * The first component in the union corresponds to the discriminator; - * the second corresponds to the actual value of the union. - * Calling the method next() twice allows you to access both components. - * @deprecated Use the new DynUnion instead - */ -@Deprecated -public interface DynUnion extends org.omg.CORBA.Object, org.omg.CORBA.DynAny -{ - /** - * Determines whether the discriminator associated with this union has been assigned - * a valid default value. - * @return true if the discriminator has a default value; - * false otherwise - */ - public boolean set_as_default(); - - /** - * Determines whether the discriminator associated with this union gets assigned - * a valid default value. - * @param arg true if the discriminator gets assigned a default value - */ - public void set_as_default(boolean arg); - - /** - * Returns a DynAny object reference that must be narrowed to the type - * of the discriminator in order to insert/get the discriminator value. - * @return a DynAny object reference representing the discriminator value - */ - public org.omg.CORBA.DynAny discriminator(); - - /** - * Returns the TCKind object associated with the discriminator of this union. - * @return the TCKind object associated with the discriminator of this union - */ - public org.omg.CORBA.TCKind discriminator_kind(); - - /** - * Returns a DynAny object reference that is used in order to insert/get - * a member of this union. - * @return the DynAny object representing a member of this union - */ - public org.omg.CORBA.DynAny member(); - - /** - * Allows for the inspection of the name of this union member - * without checking the value of the discriminator. - * @return the name of this union member - */ - public String member_name(); - - /** - * Allows for the assignment of the name of this union member. - * @param arg the new name of this union member - */ - public void member_name(String arg); - - /** - * Returns the TCKind associated with the member of this union. - * @return the TCKind object associated with the member of this union - */ - public org.omg.CORBA.TCKind member_kind(); -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/DynValue.java b/src/java.corba/share/classes/org/omg/CORBA/DynValue.java deleted file mode 100644 index 40972aefb98..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/DynValue.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * The representation of a DynAny object that is associated - * with an IDL value type. - * @deprecated Use the new DynValue instead - */ -@Deprecated -public interface DynValue extends org.omg.CORBA.Object, org.omg.CORBA.DynAny { - - /** - * Returns the name of the current member while traversing a - * DynAny object that represents a Value object. - * - * @return the name of the current member - */ - String current_member_name(); - - /** - * Returns the TCKind object that describes the current member. - * - * @return the TCKind object corresponding to the current - * member - */ - TCKind current_member_kind(); - - /** - * Returns an array containing all the members of the value object - * stored in this DynValue. - * - * @return an array of name-value pairs. - * @see #set_members - */ - org.omg.CORBA.NameValuePair[] get_members(); - - /** - * Sets the members of the value object this DynValue - * object represents to the given array of NameValuePair - * objects. - * - * @param value the array of name-value pairs to be set - * @throws org.omg.CORBA.DynAnyPackage.InvalidSeq - * if an inconsistent value is part of the given array - * @see #get_members - */ - void set_members(NameValuePair[] value) - throws org.omg.CORBA.DynAnyPackage.InvalidSeq; -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/DynamicImplementation.java b/src/java.corba/share/classes/org/omg/CORBA/DynamicImplementation.java deleted file mode 100644 index b7c547e8a5c..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/DynamicImplementation.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -import org.omg.CORBA.portable.ObjectImpl; - -/** - * @deprecated org.omg.CORBA.DynamicImplementation - */ -@Deprecated -public class DynamicImplementation extends org.omg.CORBA.portable.ObjectImpl { - - /** - * @deprecated Deprecated by Portable Object Adapter - */ - @Deprecated - public void invoke(ServerRequest request) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - public String[] _ids() { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/Environment.java b/src/java.corba/share/classes/org/omg/CORBA/Environment.java deleted file mode 100644 index 77548e5ae7e..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/Environment.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * A container (holder) for an exception that is used in Request - * operations to make exceptions available to the client. An - * Environment object is created with the ORB - * method create_environment. - * - * @since JDK1.2 - */ - -public abstract class Environment { - - /** - * Retrieves the exception in this Environment object. - * - * @return the exception in this Environment object - */ - - public abstract java.lang.Exception exception(); - - /** - * Inserts the given exception into this Environment object. - * - * @param except the exception to be set - */ - - public abstract void exception(java.lang.Exception except); - - /** - * Clears this Environment object of its exception. - */ - - public abstract void clear(); - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ExceptionList.java b/src/java.corba/share/classes/org/omg/CORBA/ExceptionList.java deleted file mode 100644 index 5e7e3f1a061..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ExceptionList.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * An object used in Request operations to - * describe the exceptions that can be thrown by a method. It maintains a - * modifiable list of TypeCodes of the exceptions. - *

            - * The following code fragment demonstrates creating - * an ExceptionList object: - *

            - *    ORB orb = ORB.init(args, null);
            - *    org.omg.CORBA.ExceptionList excList = orb.create_exception_list();
            - * 
            - * The variable excList represents an ExceptionList - * object with no TypeCode objects in it. - *

            - * To add items to the list, you first create a TypeCode object - * for the exception you want to include, using the ORB method - * create_exception_tc. Then you use the ExceptionList - * method add to add it to the list. - * The class ExceptionList has a method for getting - * the number of TypeCode objects in the list, and after - * items have been added, it is possible to call methods for accessing - * or deleting an item at a designated index. - * - * @since JDK1.2 - */ - -public abstract class ExceptionList { - - /** - * Retrieves the number of TypeCode objects in this - * ExceptionList object. - * - * @return the number of TypeCode objects in this - * ExceptionList object - */ - - public abstract int count(); - - /** - * Adds a TypeCode object describing an exception - * to this ExceptionList object. - * - * @param exc the TypeCode object to be added - */ - - public abstract void add(TypeCode exc); - - /** - * Returns the TypeCode object at the given index. The first - * item is at index 0. - * - * @param index the index of the TypeCode object desired. - * This must be an int between 0 and the - * number of TypeCode objects - * minus one, inclusive. - * @return the TypeCode object at the given index - * @exception org.omg.CORBA.Bounds if the index given is greater than - * or equal to the number of TypeCode objects - * in this ExceptionList object - */ - - public abstract TypeCode item(int index) - throws org.omg.CORBA.Bounds; - - /** - * Removes the TypeCode object at the given index. - * Note that the indices of all the TypeCoded objects - * following the one deleted are shifted down by one. - * - * @param index the index of the TypeCode object to be - * removed. - * This must be an int between 0 and the - * number of TypeCode objects - * minus one, inclusive. - * - * @exception org.omg.CORBA.Bounds if the index is greater than - * or equal to the number of TypeCode objects - * in this ExceptionList object - */ - - public abstract void remove(int index) - throws org.omg.CORBA.Bounds; -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/FREE_MEM.java b/src/java.corba/share/classes/org/omg/CORBA/FREE_MEM.java deleted file mode 100644 index 6196a7c3148..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/FREE_MEM.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * Exception thrown - * when the ORB failed in an attempt to free dynamic memory, for example - * because of heap corruption or memory segments being locked.

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since JDK1.2 - */ - -public final class FREE_MEM extends SystemException { - /** - * Constructs a FREE_MEM exception with a default - * minor code of 0 and a completion state of COMPLETED_NO. - */ - public FREE_MEM() { - this(""); - } - - /** - * Constructs a FREE_MEM exception with the specified detail - * message, a minor code of 0, and a completion state of COMPLETED_NO. - * - * @param s the String containing a detail message - */ - public FREE_MEM(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs a FREE_MEM exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed the completion status - */ - public FREE_MEM(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs a FREE_MEM exception with the specified detail - * message, minor code, and completion status. - * A detail message is a String that describes this particular exception. - * @param s the String containing a detail message - * @param minor the minor code - * @param completed the completion status - */ - public FREE_MEM(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/FieldNameHelper.java b/src/java.corba/share/classes/org/omg/CORBA/FieldNameHelper.java deleted file mode 100644 index 9e97bcabf1e..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/FieldNameHelper.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Helper for {@code FieldName}. For more information on - * Helper files, see - * "Generated Files: Helper Files".

            - * org/omg/CORBA/FieldNameHelper.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * 03 June 1999 11:52:03 o'clock GMT+00:00 - */ - -abstract public class FieldNameHelper -{ - private static String _id = "IDL:omg.org/CORBA/FieldName:1.0"; - - public static void insert (org.omg.CORBA.Any a, String that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static String extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_string_tc (0); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.FieldNameHelper.id (), "FieldName", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static String read (org.omg.CORBA.portable.InputStream istream) - { - String value = null; - value = istream.read_string (); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, String value) - { - ostream.write_string (value); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/FixedHolder.java b/src/java.corba/share/classes/org/omg/CORBA/FixedHolder.java deleted file mode 100644 index c51e9025688..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/FixedHolder.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -import org.omg.CORBA.portable.Streamable; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; - - -/** - * The Holder for {@code Fixed}. For more information on - * Holder files, see - * "Generated Files: Holder Files".

            - * FixedHolder is a container class for values of IDL type "fixed", - * which is mapped to the Java class java.math.BigDecimal. - * It is usually used to store "out" and "inout" IDL method parameters. - * If an IDL method signature has a fixed as an "out" or "inout" parameter, - * the programmer must pass an instance of FixedHolder as the corresponding - * parameter in the method invocation; for "inout" parameters, the programmer - * must also fill the "in" value to be sent to the server. - * Before the method invocation returns, the ORB will fill in the contained - * value corresponding to the "out" value returned from the server. - * - */ -public final class FixedHolder implements Streamable { - /** - * The value held by the FixedHolder - */ - public java.math.BigDecimal value; - - /** - * Construct the FixedHolder without initializing the contained value. - */ - public FixedHolder() { - } - - /** - * Construct the FixedHolder and initialize it with the given value. - * @param initial the value used to initialize the FixedHolder - */ - public FixedHolder(java.math.BigDecimal initial) { - value = initial; - } - - /** - * Read a fixed point value from the input stream and store it in - * the value member. - * - * @param input the {@code InputStream} to read from. - */ - public void _read(InputStream input) { - value = input.read_fixed(); - } - - /** - * Write the fixed point value stored in this holder to an - * {@code OutputStream}. - * - * @param output the {@code OutputStream} to write into. - */ - public void _write(OutputStream output) { - output.write_fixed(value); - } - - - /** - * Return the {@code TypeCode} of this holder object. - * - * @return the {@code TypeCode} object. - */ - public org.omg.CORBA.TypeCode _type() { - return ORB.init().get_primitive_tc(TCKind.tk_fixed); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/FloatHolder.java b/src/java.corba/share/classes/org/omg/CORBA/FloatHolder.java deleted file mode 100644 index 3199974ec11..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/FloatHolder.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 1995, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -import org.omg.CORBA.portable.Streamable; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; - - -/** - * The Holder for {@code Float}. For more information on - * Holder files, see - * "Generated Files: Holder Files".

            - * A Holder class for a {@code float} - * that is used to store "out" and "inout" parameters in IDL methods. - * If an IDL method signature has an IDL {@code float} as an "out" - * or "inout" parameter, the programmer must pass an instance of - * {@code FloatHolder} as the corresponding - * parameter in the method invocation; for "inout" parameters, the programmer - * must also fill the "in" value to be sent to the server. - * Before the method invocation returns, the ORB will fill in the - * value corresponding to the "out" value returned from the server. - *

            - * If {@code myFloatHolder} is an instance of {@code FloatHolder}, - * the value stored in its {@code value} field can be accessed with - * {@code myFloatHolder.value}. - * - * @since JDK1.2 - */ -public final class FloatHolder implements Streamable { - /** - * The {@code float} value held by this {@code FloatHolder} - * object. - */ - public float value; - - /** - * Constructs a new {@code FloatHolder} object with its - * {@code value} field initialized to 0.0. - */ - public FloatHolder() { - } - - /** - * Constructs a new {@code FloatHolder} object for the given - * {@code float}. - * @param initial the {@code float} with which to initialize - * the {@code value} field of the new - * {@code FloatHolder} object - */ - public FloatHolder(float initial) { - value = initial; - } - - /** - * Read a float from an input stream and initialize the value - * member with the float value. - * - * @param input the {@code InputStream} to read from. - */ - public void _read(InputStream input) { - value = input.read_float(); - } - - /** - * Write the float value into an output stream. - * - * @param output the {@code OutputStream} to write into. - */ - public void _write(OutputStream output) { - output.write_float(value); - } - - /** - * Return the {@code TypeCode} of this Streamable. - * - * @return the {@code TypeCode} object. - */ - public org.omg.CORBA.TypeCode _type() { - return ORB.init().get_primitive_tc(TCKind.tk_float); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/FloatSeqHelper.java b/src/java.corba/share/classes/org/omg/CORBA/FloatSeqHelper.java deleted file mode 100644 index a8684b5c5d0..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/FloatSeqHelper.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Helper for {@code FloatSeq}. For more information on - * Helper files, see - * "Generated Files: Helper Files".

            - * org/omg/CORBA/FloatSeqHelper.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from streams.idl - * 13 May 1999 22:41:37 o'clock GMT+00:00 - * - * The class definition has been modified to conform to the following - * OMG specifications : - *

              - *
            • ORB core as defined by CORBA 2.3.1 - * (formal/99-10-07) - *
            • - * - *
            • IDL/Java Language Mapping as defined in - * ptc/00-01-08 - *
            • - *
            - */ - -public abstract class FloatSeqHelper -{ - private static String _id = "IDL:omg.org/CORBA/FloatSeq:1.0"; - - public static void insert (org.omg.CORBA.Any a, float[] that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static float[] extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_float); - __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.FloatSeqHelper.id (), "FloatSeq", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static float[] read (org.omg.CORBA.portable.InputStream istream) - { - float value[] = null; - int _len0 = istream.read_long (); - value = new float[_len0]; - istream.read_float_array (value, 0, _len0); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, float[] value) - { - ostream.write_long (value.length); - ostream.write_float_array (value, 0, value.length); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/FloatSeqHolder.java b/src/java.corba/share/classes/org/omg/CORBA/FloatSeqHolder.java deleted file mode 100644 index 645bbb9ecb9..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/FloatSeqHolder.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Holder for {@code FloatSeq}. For more information on - * Holder files, see - * "Generated Files: Holder Files".

            - * org/omg/CORBA/FloatSeqHolder.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from streams.idl - * 13 May 1999 22:41:37 o'clock GMT+00:00 - */ - -public final class FloatSeqHolder implements org.omg.CORBA.portable.Streamable -{ - public float value[] = null; - - public FloatSeqHolder () - { - } - - public FloatSeqHolder (float[] initialValue) - { - value = initialValue; - } - - public void _read (org.omg.CORBA.portable.InputStream i) - { - value = org.omg.CORBA.FloatSeqHelper.read (i); - } - - public void _write (org.omg.CORBA.portable.OutputStream o) - { - org.omg.CORBA.FloatSeqHelper.write (o, value); - } - - public org.omg.CORBA.TypeCode _type () - { - return org.omg.CORBA.FloatSeqHelper.type (); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/IDLType.java b/src/java.corba/share/classes/org/omg/CORBA/IDLType.java deleted file mode 100644 index dbd45954da1..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/IDLType.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * File: ./org/omg/CORBA/IDLType.java - * From: ./ir.idl - * Date: Fri Aug 28 16:03:31 1998 - * By: idltojava Java IDL 1.2 Aug 11 1998 02:00:18 - */ - -package org.omg.CORBA; -/** -* tempout/org/omg/CORBA/IDLType.java -* Generated by the IBM IDL-to-Java compiler, version 1.0 -* from ../../Lib/ir.idl -* Thursday, February 25, 1999 2:11:23 o'clock PM PST -*/ - -/** - * An abstract interface inherited by all Interface Repository - * (IR) objects that represent OMG IDL types. It provides access - * to the TypeCode object describing the type and is used in defining the - * other interfaces wherever definitions of IDLType must be referenced. - */ - -public interface IDLType extends IDLTypeOperations, org.omg.CORBA.IRObject, org.omg.CORBA.portable.IDLEntity -{ -} // interface IDLType diff --git a/src/java.corba/share/classes/org/omg/CORBA/IDLTypeHelper.java b/src/java.corba/share/classes/org/omg/CORBA/IDLTypeHelper.java deleted file mode 100644 index 76bdbe42402..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/IDLTypeHelper.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Helper for {@code IDLType}. For more information on - * Helper files, see - * "Generated Files: Helper Files".

            - * org/omg/CORBA/IDLTypeHelper.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from ir.idl - * 03 June 1999 11:33:44 o'clock GMT+00:00 - */ - -abstract public class IDLTypeHelper -{ - private static String _id = "IDL:omg.org/CORBA/IDLType:1.0"; - - public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.IDLType that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static org.omg.CORBA.IDLType extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (org.omg.CORBA.IDLTypeHelper.id (), "IDLType"); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static org.omg.CORBA.IDLType read (org.omg.CORBA.portable.InputStream istream) - { - return narrow (istream.read_Object (_IDLTypeStub.class)); - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.IDLType value) - { - ostream.write_Object ((org.omg.CORBA.Object) value); - } - - public static org.omg.CORBA.IDLType narrow (org.omg.CORBA.Object obj) - { - if (obj == null) - return null; - else if (obj instanceof org.omg.CORBA.IDLType) - return (org.omg.CORBA.IDLType)obj; - else if (!obj._is_a (id ())) - throw new org.omg.CORBA.BAD_PARAM (); - else - { - org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate (); - return new org.omg.CORBA._IDLTypeStub (delegate); - } - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/IDLTypeOperations.java b/src/java.corba/share/classes/org/omg/CORBA/IDLTypeOperations.java deleted file mode 100644 index ac2eabac731..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/IDLTypeOperations.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - -/** - * The interface for {@code IDLType}. For more information on - * Operations interfaces, see - * "Generated Files: Operations files". - */ - -/* - tempout/org/omg/CORBA/IDLTypeOperations.java - Generated by the IBM IDL-to-Java compiler, version 1.0 - from ../../Lib/ir.idl - Thursday, February 25, 1999 2:11:23 o'clock PM PST -*/ - -/** - * This interface must be implemented by all IDLType objects. - * The IDLType is inherited by all IR objects that - * represent IDL types, including interfaces, typedefs, and - * anonymous types. - * @see IDLType - * @see IRObject - * @see IRObjectOperations - */ - -public interface IDLTypeOperations extends org.omg.CORBA.IRObjectOperations -{ - /** - * The type attribute describes the type defined by an object - * derived from {@code IDLType}. - * @return the {@code TypeCode} defined by this object. - */ - org.omg.CORBA.TypeCode type (); -} // interface IDLTypeOperations diff --git a/src/java.corba/share/classes/org/omg/CORBA/IMP_LIMIT.java b/src/java.corba/share/classes/org/omg/CORBA/IMP_LIMIT.java deleted file mode 100644 index 93df8e31a53..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/IMP_LIMIT.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * This exception indicates that an implementation limit was - * exceeded in the ORB run time. For example, an ORB may reach - * the maximum number of references it can hold simultaneously - * in an address space, the size of a parameter may have - * exceeded the allowed maximum, or an ORB may impose a maximum - * on the number of clients or servers that can run simultaneously.

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since JDK1.2 - */ - - -public final class IMP_LIMIT extends SystemException { - /** - * Constructs an IMP_LIMIT exception with a default - * minor code of 0 and a completion state of COMPLETED_NO. - */ - public IMP_LIMIT() { - this(""); - } - - /** - * Constructs an IMP_LIMIT exception with the specified detail - * message, a minor code of 0, and a completion state of COMPLETED_NO. - * - * @param s the String containing a detail message - */ - public IMP_LIMIT(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs an IMP_LIMIT exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed the completion status - */ - public IMP_LIMIT(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs an IMP_LIMIT exception with the specified detail - * message, minor code, and completion status. - * A detail message is a String that describes this particular exception. - * @param s the String containing a detail message - * @param minor the minor code - * @param completed the completion status - */ - public IMP_LIMIT(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/INITIALIZE.java b/src/java.corba/share/classes/org/omg/CORBA/INITIALIZE.java deleted file mode 100644 index 9768d9836bc..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/INITIALIZE.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * Exception thrown - * when an ORB has encountered a failure during its initialization, - * such as failure to acquire networking resources or detecting a - * configuration error.

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since JDK1.2 - */ - -public final class INITIALIZE extends SystemException { - /** - * Constructs an INITIALIZE exception with a default - * minor code of 0 and a completion state of - * CompletionStatus.COMPLETED_NO. - */ - public INITIALIZE() { - this(""); - } - - /** - * Constructs an INITIALIZE exception with the specified detail - * message, a minor code of 0, and a completion state of - * CompletionStatus.COMPLETED_NO. - * @param s the String containing a detail message - */ - public INITIALIZE(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs an INITIALIZE exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed an instance of CompletionStatus - * indicating the completion status of the method - * that threw this exception - */ - public INITIALIZE(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs an INITIALIZE exception with the specified detail - * message, minor code, and completion status. - * A detail message is a String that describes this particular exception. - * @param s the String containing a detail message - * @param minor the minor code - * @param completed an instance of CompletionStatus - * indicating the completion status of the method - * that threw this exception - */ - public INITIALIZE(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/INTERNAL.java b/src/java.corba/share/classes/org/omg/CORBA/INTERNAL.java deleted file mode 100644 index bec91d6642f..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/INTERNAL.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * This exception indicates an internal failure in an ORB, for - * example, if an ORB has detected corruption of its internal - * data structures.

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - *

            - * See the section {@extLink jidlexception_minorcodes meaning of minor codes} - * to see the minor codes for this exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since JDK1.2 - */ - -public final class INTERNAL extends SystemException { - /** - * Constructs an INTERNAL exception with a default - * minor code of 0 and a completion state of COMPLETED_NO. - */ - public INTERNAL() { - this(""); - } - - /** - * Constructs an INTERNAL exception with the specified detail - * message, a minor code of 0, and a completion state of COMPLETED_NO. - * @param s the String containing a detail message - */ - public INTERNAL(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs an INTERNAL exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed an instance of CompletionStatus - * that indicates the completion status of the method - * that threw this exception - */ - public INTERNAL(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs an INTERNAL exception with the specified detail - * message, minor code, and completion status. - * A detail message is a String that describes this particular exception. - * @param s the String containing a detail message - * @param minor the minor code - * @param completed an instance of CompletionStatus - * that indicates the completion status of the method - * that threw this exception - */ - public INTERNAL(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/INTF_REPOS.java b/src/java.corba/share/classes/org/omg/CORBA/INTF_REPOS.java deleted file mode 100644 index ef06d427852..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/INTF_REPOS.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * Exception raised - * when an ORB cannot reach the interface - * repository, or some other failure relating to the interface repository - * is detected.

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since JDK1.2 - */ - -public final class INTF_REPOS extends SystemException { - /** - * Constructs an INTF_REPOS exception with a default minor code - * of 0 and a completion state of COMPLETED_NO. - */ - public INTF_REPOS() { - this(""); - } - - /** - * Constructs an INTF_REPOS exception with the specified detail. - * @param s the String containing a detail message - */ - public INTF_REPOS(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs an INTF_REPOS exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed the completion status - */ - public INTF_REPOS(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs an INTF_REPOS exception with the specified detail - * message, minor code, and completion status. - * A detail message is a String that describes this particular exception. - * @param s the String containing a detail message - * @param minor the minor code - * @param completed the completion status - */ - public INTF_REPOS(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/INVALID_ACTIVITY.java b/src/java.corba/share/classes/org/omg/CORBA/INVALID_ACTIVITY.java deleted file mode 100644 index 12a13f8e0dd..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/INVALID_ACTIVITY.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * The INVALID_ACTIVITY system exception may be raised on the - * Activity or Transaction services' resume methods if a transaction or - * Activity is resumed in a context different to that from which it was - * suspended. It is also raised when an attempted invocation is made that - * is incompatible with the Activity's current state. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since J2SE 1.5 - */ - -public final class INVALID_ACTIVITY extends SystemException { - - /** - * Constructs an INVALID_ACTIVITY exception with - * minor code set to 0 and CompletionStatus set to COMPLETED_NO. - */ - public INVALID_ACTIVITY() { - this(""); - } - - /** - * Constructs an INVALID_ACTIVITY exception with the - * specified message. - * - * @param detailMessage string containing a detailed message. - */ - public INVALID_ACTIVITY(String detailMessage) { - this(detailMessage, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs an INVALID_ACTIVITY exception with the - * specified minor code and completion status. - * - * @param minorCode minor code. - * @param completionStatus completion status. - */ - public INVALID_ACTIVITY(int minorCode, - CompletionStatus completionStatus) { - this("", minorCode, completionStatus); - } - - /** - * Constructs an INVALID_ACTIVITY exception with the - * specified message, minor code, and completion status. - * - * @param detailMessage string containing a detailed message. - * @param minorCode minor code. - * @param completionStatus completion status. - */ - public INVALID_ACTIVITY(String detailMessage, - int minorCode, - CompletionStatus completionStatus) { - super(detailMessage, minorCode, completionStatus); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/INVALID_TRANSACTION.java b/src/java.corba/share/classes/org/omg/CORBA/INVALID_TRANSACTION.java deleted file mode 100644 index 219c549de46..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/INVALID_TRANSACTION.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * Exception thrown - * when the request carried an invalid transaction context. - * For example, this exception could be raised if an error - * occurred when trying to register a resource.

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since JDK1.2 - * - */ - -public final class INVALID_TRANSACTION extends SystemException { - /** - * Constructs an INVALID_TRANSACTION exception with a default minor code - * of 0 and a completion state of COMPLETED_NO. - */ - public INVALID_TRANSACTION() { - this(""); - } - - /** - * Constructs an INVALID_TRANSACTION exception - * with the specified detail message. - * @param s the String containing a detail message - */ - public INVALID_TRANSACTION(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs an INVALID_TRANSACTION exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed the completion status - */ - public INVALID_TRANSACTION(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs an INVALID_TRANSACTION exception with the specified detail - * message, minor code, and completion status. - * A detail message is a String that describes this particular exception. - * @param s the String containing a detail message - * @param minor the minor code - * @param completed the completion status - */ - public INVALID_TRANSACTION(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/INV_FLAG.java b/src/java.corba/share/classes/org/omg/CORBA/INV_FLAG.java deleted file mode 100644 index 6ad485c87cc..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/INV_FLAG.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * Exception thrown - * when an invalid flag was passed to an operation (for example, when - * creating a DII request).

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since JDK1.2 - */ - -public final class INV_FLAG extends SystemException { - /** - * Constructs an INV_FLAG exception with a default - * minor code of 0 and a completion state of COMPLETED_NO. - */ - public INV_FLAG() { - this(""); - } - - /** - * Constructs an INV_FLAG exception with the specified detail - * message, a minor code of 0, and a completion state of COMPLETED_NO. - * @param s the String containing a detail message - */ - public INV_FLAG(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs an INV_FLAG exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed an instance of CompletionStatus - * indicating the completion status - */ - public INV_FLAG(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs an INV_FLAG exception with the specified detail - * message, minor code, and completion status. - * A detail message is a String that describes this particular exception. - * @param s the String containing a detail message - * @param minor the minor code - * @param completed an instance of CompletionStatus - * indicating the completion status - */ - public INV_FLAG(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/INV_IDENT.java b/src/java.corba/share/classes/org/omg/CORBA/INV_IDENT.java deleted file mode 100644 index 167ff5f3a94..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/INV_IDENT.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * This exception indicates that an IDL identifier is syntactically - * invalid. It may be raised if, for example, an identifier passed - * to the interface repository does not conform to IDL identifier - * syntax, or if an illegal operation name is used with the DII.

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since JDK1.2 - */ - -public final class INV_IDENT extends SystemException { - /** - * Constructs an INV_IDENT exception with a default - * minor code of 0 and a completion state of COMPLETED_NO. - */ - public INV_IDENT() { - this(""); - } - - /** - * Constructs an INV_IDENT exception with the specified detail - * message, a minor code of 0, and a completion state of COMPLETED_NO. - * @param s the String containing a detail message - */ - public INV_IDENT(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs an INV_IDENT exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed a CompletionStatus object indicating - * the completion status - */ - public INV_IDENT(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs an INV_IDENT exception with the specified detail - * message, minor code, and completion status. - * A detail message is a String that describes this particular exception. - * @param s the String containing a detail message - * @param minor the minor code - * @param completed a CompletionStatus object indicating - * the completion status - */ - public INV_IDENT(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/INV_OBJREF.java b/src/java.corba/share/classes/org/omg/CORBA/INV_OBJREF.java deleted file mode 100644 index 821ffcf101d..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/INV_OBJREF.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * This exception indicates that an object reference is internally - * malformed. For example, the repository ID may have incorrect - * syntax or the addressing information may be invalid. This - * exception is raised by ORB::string_to_object if the passed - * string does not decode correctly. An ORB may choose to detect - * calls via nil references (but is not obliged to do detect them). - * {@code INV_OBJREF} is used to indicate this.

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - *

            - * See the section {@extLink jidlexception_minorcodes Minor Code Meanings} - * to see the minor codes for this exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since JDK1.2 - */ - -public final class INV_OBJREF extends SystemException { - /** - * Constructs an {@code INV_OBJREF} exception with a default - * minor code of 0 and a completion state of COMPLETED_NO. - */ - public INV_OBJREF() { - this(""); - } - - /** - * Constructs an {@code INV_OBJREF} exception with the specified detail - * message, a minor code of 0, and a completion state of COMPLETED_NO. - * @param s the String containing a detail message - */ - public INV_OBJREF(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs an {@code INV_OBJREF} exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed a {@code CompletionStatus} instance indicating - * the completion status - */ - public INV_OBJREF(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs an {@code INV_OBJREF} exception with the specified detail - * message, minor code, and completion status. - * A detail message is a String that describes this particular exception. - * @param s the String containing a detail message - * @param minor the minor code - * @param completed a {@code CompletionStatus} instance indicating - * the completion status - */ - public INV_OBJREF(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/INV_POLICY.java b/src/java.corba/share/classes/org/omg/CORBA/INV_POLICY.java deleted file mode 100644 index 5eea852c4d9..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/INV_POLICY.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * Standard exception thrown - * when an invocation cannot be made because of an incompatibility between - * {@code Policy} overrides that apply to the particular invocation. - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - */ - -public final class INV_POLICY extends SystemException { - /** - * Constructs a {@code INV_POLICY} exception with a default minor code - * of 0, a completion state of CompletionStatus.COMPLETED_NO, - * and a null description. - */ - public INV_POLICY() { - this(""); - } - - /** - * Constructs a {@code INV_POLICY} exception with the - * specified description message, - * a minor code of 0, and a completion state of COMPLETED_NO. - * @param s the String containing a detail message - */ - public INV_POLICY(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs a {@code INV_POLICY} exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed the completion status - */ - public INV_POLICY(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs a {@code INV_POLICY} exception with the - * specified description message, minor code, and completion status. - * @param s the String containing a description message - * @param minor the minor code - * @param completed the completion status - */ - public INV_POLICY(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/IRObject.java b/src/java.corba/share/classes/org/omg/CORBA/IRObject.java deleted file mode 100644 index b60694af252..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/IRObject.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * File: ./org/omg/CORBA/IRObject.java - * From: ./ir.idl - * Date: Fri Aug 28 16:03:31 1998 - * By: idltojava Java IDL 1.2 Aug 11 1998 02:00:18 - */ - -package org.omg.CORBA; -/** -An IRObject IDL interface represents the most generic interface -from which all other Interface Repository interfaces are derived, -even the Repository itself. -*/ - -public interface IRObject extends IRObjectOperations, org.omg.CORBA.Object, - org.omg.CORBA.portable.IDLEntity -{ -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/IRObjectOperations.java b/src/java.corba/share/classes/org/omg/CORBA/IRObjectOperations.java deleted file mode 100644 index bd38f6b263e..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/IRObjectOperations.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The interface for {@code IRObject}. For more information on - * Operations interfaces, see - * "Generated Files: Operations files". - */ - -/* - tempout/org/omg/CORBA/IRObjectOperations.java - Generated by the IBM IDL-to-Java compiler, version 1.0 - from ../../Lib/ir.idl - Thursday, February 25, 1999 2:11:21 o'clock PM PST -*/ - -/** - * This is the Operations interface for the mapping from {@code IRObject}. - * Several interfaces are used as base interfaces for objects in - * the Interface Repository (IR). These base interfaces are not instantiable. - * A common set of operations is used to locate objects within the - * Interface Repository. Some of these operations are defined in - * the IRObject. All IR objects inherit from the IRObject interface, - * which provides an operation for identifying the actual type of - * the object. (The IDL base interface IRObject represents the most - * generic interface from which all other Interface Repository interfaces - * are derived, even the Repository itself.) All java implementations of - * IR objects must implement the IRObjectOperations interface. - * @see IDLTypeOperations - * @see IDLType - * @see IRObject - */ -public interface IRObjectOperations -{ - - // read interface - /** - * Returns the {@code DefinitionKind} corresponding to this Interface Repository object. - * @return the {@code DefinitionKind} corresponding to this Interface Repository object. - */ - org.omg.CORBA.DefinitionKind def_kind (); - - // write interface - /** - * Destroys this object. If the object is a Container, - * this method is applied to all its contents. If the object contains an IDLType - * attribute for an anonymous type, that IDLType is destroyed. - * If the object is currently contained in some other object, it is removed. - * If the method is invoked on a {@code Repository} or on a {@code PrimitiveDef} - * then the {@code BAD_INV_ORDER} exception is raised with minor value 2. - * An attempt to destroy an object that would leave the repository in an - * incoherent state causes {@code BAD_INV_ORDER} exception to be raised - * with the minor code 1. - * @exception BAD_INV_ORDER if this method is invoked on a repository or - * {@code PrimitiveDef}, or if an attempt to destroy an - * object would leave the repository in an incoherent state - */ - void destroy (); -} // interface IRObjectOperations diff --git a/src/java.corba/share/classes/org/omg/CORBA/IdentifierHelper.java b/src/java.corba/share/classes/org/omg/CORBA/IdentifierHelper.java deleted file mode 100644 index 665e23c80a3..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/IdentifierHelper.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Helper for {@code Identifier}. For more information on - * Helper files, see - * "Generated Files: Helper Files".

            - * org/omg/CORBA/IdentifierHelper.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from ir.idl - * 03 June 1999 11:33:42 o'clock GMT+00:00 - */ - -abstract public class IdentifierHelper -{ - private static String _id = "IDL:omg.org/CORBA/Identifier:1.0"; - - public static void insert (org.omg.CORBA.Any a, String that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static String extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_string_tc (0); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.IdentifierHelper.id (), "Identifier", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static String read (org.omg.CORBA.portable.InputStream istream) - { - String value = null; - value = istream.read_string (); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, String value) - { - ostream.write_string (value); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/IntHolder.java b/src/java.corba/share/classes/org/omg/CORBA/IntHolder.java deleted file mode 100644 index 2b43131f199..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/IntHolder.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -import org.omg.CORBA.portable.Streamable; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; - -/** - * The Holder for {@code Int}. For more information on - * Holder files, see - * "Generated Files: Holder Files".

            - * A Holder class for an {@code int} - * that is used to store "out" and "inout" parameters in IDL methods. - * If an IDL method signature has an IDL {@code long} as an "out" - * or "inout" parameter, the programmer must pass an instance of - * {@code IntHolder} as the corresponding - * parameter in the method invocation; for "inout" parameters, the programmer - * must also fill the "in" value to be sent to the server. - * Before the method invocation returns, the ORB will fill in the - * value corresponding to the "out" value returned from the server. - *

            - * If {@code myIntHolder} is an instance of {@code IntHolder}, - * the value stored in its {@code value} field can be accessed with - * {@code myIntHolder.value}. - * - * @since JDK1.2 - */ -public final class IntHolder implements Streamable { - - /** - * The {@code int} value held by this {@code IntHolder} - * object in its {@code value} field. - */ - public int value; - - /** - * Constructs a new {@code IntHolder} object with its - * {@code value} field initialized to {@code 0}. - */ - public IntHolder() { - } - - /** - * Constructs a new {@code IntHolder} object with its - * {@code value} field initialized to the given - * {@code int}. - * @param initial the {@code int} with which to initialize - * the {@code value} field of the newly-created - * {@code IntHolder} object - */ - public IntHolder(int initial) { - value = initial; - } - - /** - * Reads unmarshalled data from {@code input} and assigns it to - * the {@code value} field in this {@code IntHolder} object. - * - * @param input the {@code InputStream} object containing CDR - * formatted data from the wire - */ - public void _read(InputStream input) { - value = input.read_long(); - } - - /** - * Marshals the value in this {@code IntHolder} object's - * {@code value} field to the output stream {@code output}. - * - * @param output the {@code OutputStream} object that will contain - * the CDR formatted data - */ - public void _write(OutputStream output) { - output.write_long(value); - } - - /** - * Retrieves the {@code TypeCode} object that corresponds - * to the value held in this {@code IntHolder} object's - * {@code value} field. - * - * @return the type code for the value held in this {@code IntHolder} - * object - */ - public org.omg.CORBA.TypeCode _type() { - return ORB.init().get_primitive_tc(TCKind.tk_long); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/LocalObject.java b/src/java.corba/share/classes/org/omg/CORBA/LocalObject.java deleted file mode 100644 index fedbead0516..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/LocalObject.java +++ /dev/null @@ -1,514 +0,0 @@ -/* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; -import org.omg.CORBA.portable.*; - - -/** - * Used as a base class for implementation of a local IDL interface in the - * Java language mapping. It is a class which implements all the operations - * in the {@code org.omg.CORBA.Object} interface. - *

            Local interfaces are implemented by using CORBA::LocalObject - * to provide implementations of {@code Object} pseudo - * operations and any other ORB-specific support mechanisms that are - * appropriate for such objects. Object implementation techniques are - * inherently language-mapping specific. Therefore, the - * {@code LocalObject} type is not defined in IDL, but is specified - * in each language mapping. - *

            Methods that do not apply to local objects throw - * an {@code org.omg.CORBA.NO_IMPLEMENT} exception with the message, - * "This is a locally contrained object." Attempting to use a - * {@code LocalObject} to create a DII request results in NO_IMPLEMENT - * system exception. Attempting to marshal or stringify a - * {@code LocalObject} results in a MARSHAL system exception. Narrowing - * and widening references to {@code LocalObjects} must work as for regular - * object references. - *

            {@code LocalObject} is to be used as the base class of locally - * constrained objects, such as those in the PortableServer module. - * The specification here is based on the CORBA Components - * Volume I - orbos/99-07-01 - * - * @see CORBA package - * comments for unimplemented features - */ - -public class LocalObject implements org.omg.CORBA.Object -{ - private static String reason = "This is a locally constrained object."; - - /** - * Constructs a default {@code LocalObject} instance. - */ - public LocalObject() {} - - /** - * Determines whether the two object references are equivalent, - * so far as the ORB can easily determine. Two object references are equivalent - * if they are identical. Two distinct object references which in fact refer to - * the same object are also equivalent. However, ORBs are not required - * to attempt determination of whether two distinct object references - * refer to the same object, since such determination could be impractically - * expensive. - *

            Default implementation of the org.omg.CORBA.Object method. - * - * @param that the object reference with which to check for equivalence - * @return {@code true} if this object reference is known to be - * equivalent to the given object reference. - * Note that {@code false} indicates only that the two - * object references are distinct, not necessarily that - * they reference distinct objects. - */ - public boolean _is_equivalent(org.omg.CORBA.Object that) { - return equals(that) ; - } - - /** - * Always returns {@code false}. - * This method is the default implementation of the - * {@code org.omg.CORBA.Object} method. - * - * @return {@code false} - */ - public boolean _non_existent() { - return false; - } - - /** - * Returns a hash value that is consistent for the - * lifetime of the object, using the given number as the maximum. - * This method is the default implementation of the - * {@code org.omg.CORBA.Object} method. - * - * @param maximum an {@code int} identifying maximum value of - * the hashcode - * @return this instance's hashcode - */ - public int _hash(int maximum) { - return hashCode() ; - } - - /** - * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with - * the message "This is a locally constrained object." This method - * does not apply to local objects and is therefore not implemented. - * This method is the default implementation of the - * {@code org.omg.CORBA.Object} method. - * - * @param repository_id a {@code String} - * @return NO_IMPLEMENT because this is a locally constrained object - * and this method does not apply to local objects - * @exception NO_IMPLEMENT because this is a locally constrained object - * and this method does not apply to local objects - * @see CORBA package - * comments for unimplemented features - */ - public boolean _is_a(String repository_id) { - throw new org.omg.CORBA.NO_IMPLEMENT(reason); - } - - /** - * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with - * the message "This is a locally constrained object." - * This method is the default implementation of the - * {@code org.omg.CORBA.Object} method. - * - * @return a duplicate of this {@code LocalObject} instance. - * @exception NO_IMPLEMENT - * @see CORBA package - * comments for unimplemented features - */ - public org.omg.CORBA.Object _duplicate() { - throw new org.omg.CORBA.NO_IMPLEMENT(reason); - } - - /** - * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with - * the message "This is a locally constrained object." - * This method is the default implementation of the - * {@code org.omg.CORBA.Object} method. - * - * @exception NO_IMPLEMENT - * @see CORBA package - * comments for unimplemented features - */ - public void _release() { - throw new org.omg.CORBA.NO_IMPLEMENT(reason); - } - - /** - * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with - * the message "This is a locally constrained object." - * This method is the default implementation of the - * {@code org.omg.CORBA.Object} method. - * - * @param operation a {@code String} giving the name of an operation - * to be performed by the request that is returned - * @return a {@code Request} object with the given operation - * @exception NO_IMPLEMENT - * @see CORBA package - * comments for unimplemented features - */ - public Request _request(String operation) { - throw new org.omg.CORBA.NO_IMPLEMENT(reason); - } - - /** - * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with - * the message "This is a locally constrained object." - * This method is the default implementation of the - * {@code org.omg.CORBA.Object} method. - * - * @param ctx a {@code Context} object containing - * a list of properties - * @param operation the {@code String} representing the name of the - * method to be invoked - * @param arg_list an {@code NVList} containing the actual arguments - * to the method being invoked - * @param result a {@code NamedValue} object to serve as a - * container for the method's return value - * @return a new {@code Request} object initialized with the given - * arguments - * @exception NO_IMPLEMENT - * @see CORBA package - * comments for unimplemented features - */ - public Request _create_request(Context ctx, - String operation, - NVList arg_list, - NamedValue result) { - throw new org.omg.CORBA.NO_IMPLEMENT(reason); - } - - /** - * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with - * the message "This is a locally constrained object." - * This method is the default implementation of the - * {@code org.omg.CORBA.Object} method. - * - * @param ctx a {@code Context} object containing - * a list of properties - * @param operation the name of the method to be invoked - * @param arg_list an {@code NVList} containing the actual arguments - * to the method being invoked - * @param result a {@code NamedValue} object to serve as a - * container for the method's return value - * @param exceptions an {@code ExceptionList} object containing a - * list of possible exceptions the method can throw - * @param contexts a {@code ContextList} object containing a list of - * context strings that need to be resolved and sent - * with the - * {@code Request} instance - * @return the new {@code Request} object initialized with the given - * arguments - * @exception NO_IMPLEMENT - * @see CORBA package - * comments for unimplemented features - */ - public Request _create_request(Context ctx, - String operation, - NVList arg_list, - NamedValue result, - ExceptionList exceptions, - ContextList contexts) { - throw new org.omg.CORBA.NO_IMPLEMENT(reason); - } - - /** - * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with - * the message "This is a locally constrained object." This method - * does not apply to local objects and is therefore not implemented. - * This method is the default implementation of the - * {@code org.omg.CORBA.Object} method. - * - * @return NO_IMPLEMENT because this is a locally constrained object - * and this method does not apply to local objects - * @exception NO_IMPLEMENT because this is a locally constrained object - * and this method does not apply to local objects - * @see CORBA package - * comments for unimplemented features - */ - public org.omg.CORBA.Object _get_interface() - { - throw new org.omg.CORBA.NO_IMPLEMENT(reason); - } - - /** - * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with - * the message "This is a locally constrained object." - * This method is the default implementation of the - * {@code org.omg.CORBA.Object} method. - * - * @exception NO_IMPLEMENT - * @see CORBA package - * comments for unimplemented features - */ - public org.omg.CORBA.Object _get_interface_def() - { - // First try to call the delegate implementation class's - // "Object get_interface_def(..)" method (will work for JDK1.2 - // ORBs). - // Else call the delegate implementation class's - // "InterfaceDef get_interface(..)" method using reflection - // (will work for pre-JDK1.2 ORBs). - - throw new org.omg.CORBA.NO_IMPLEMENT(reason); - } - - /** - * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with - * the message "This is a locally constrained object." - * This method is the default implementation of the - * {@code org.omg.CORBA.Object} method. - * @return the ORB instance that created the Delegate contained in this - * {@code ObjectImpl} - * @exception NO_IMPLEMENT - * @see CORBA package - * comments for unimplemented features - */ - public org.omg.CORBA.ORB _orb() { - throw new org.omg.CORBA.NO_IMPLEMENT(reason); - } - - /** - * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with - * the message "This is a locally constrained object." This method - * does not apply to local objects and is therefore not implemented. - * This method is the default implementation of the - * {@code org.omg.CORBA.Object} method. - * - * @param policy_type an {@code int} - * @return NO_IMPLEMENT because this is a locally constrained object - * and this method does not apply to local objects - * @exception NO_IMPLEMENT because this is a locally constrained object - * and this method does not apply to local objects - * @see CORBA package - * comments for unimplemented features - */ - public org.omg.CORBA.Policy _get_policy(int policy_type) { - throw new org.omg.CORBA.NO_IMPLEMENT(reason); - } - - - /** - * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with - * the message "This is a locally constrained object." This method - * does not apply to local objects and is therefore not implemented. - * This method is the default implementation of the - * {@code org.omg.CORBA.Object} method. - * - * @exception NO_IMPLEMENT - * @see CORBA package - * comments for unimplemented features - */ - public org.omg.CORBA.DomainManager[] _get_domain_managers() { - throw new org.omg.CORBA.NO_IMPLEMENT(reason); - } - - /** - * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with - * the message "This is a locally constrained object." This method - * does not apply to local objects and is therefore not implemented. - * This method is the default implementation of the - * {@code org.omg.CORBA.Object} method. - * - * @param policies an array - * @param set_add a flag - * @return NO_IMPLEMENT because this is a locally constrained object - * and this method does not apply to local objects - * @exception NO_IMPLEMENT because this is a locally constrained object - * and this method does not apply to local objects - * @see CORBA package - * comments for unimplemented features - */ - public org.omg.CORBA.Object - _set_policy_override(org.omg.CORBA.Policy[] policies, - org.omg.CORBA.SetOverrideType set_add) { - throw new org.omg.CORBA.NO_IMPLEMENT(reason); - } - - - /** - * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with - * the message "This is a locally constrained object." - * This method is the default implementation of the - * {@code org.omg.CORBA.Object} method.

            - * Returns {@code true} for this {@code LocalObject} instance. - * - * @return {@code true} always - * @exception NO_IMPLEMENT - * @see CORBA package - * comments for unimplemented features - */ - public boolean _is_local() { - throw new org.omg.CORBA.NO_IMPLEMENT(reason); - } - - /** - * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with - * the message "This is a locally constrained object." - * This method is the default implementation of the - * {@code org.omg.CORBA.Object} method. - * - * @param operation a {@code String} indicating which operation - * to preinvoke - * @param expectedType the class of the type of operation mentioned above - * @return NO_IMPLEMENT because this is a locally constrained object - * and this method does not apply to local objects - * @exception NO_IMPLEMENT because this is a locally constrained object - * and this method does not apply to local object - * @see CORBA package - * comments for unimplemented features - */ - public ServantObject _servant_preinvoke(String operation, - Class expectedType) { - throw new org.omg.CORBA.NO_IMPLEMENT(reason); - } - - /** - * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with - * the message "This is a locally constrained object." - * This method is the default implementation of the - * {@code org.omg.CORBA.Object} method. - * - * @param servant the servant object on which to post-invoke - * @exception NO_IMPLEMENT - * @see CORBA package - * comments for unimplemented features - */ - public void _servant_postinvoke(ServantObject servant) { - throw new org.omg.CORBA.NO_IMPLEMENT(reason); - } - - /* - * The following methods were added by orbos/98-04-03: Java to IDL - * Mapping. These are used by RMI over IIOP. - */ - - /** - * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with - * the message "This is a locally constrained object." - * This method is the default implementation of the - * {@code org.omg.CORBA.Object} method. - *

            Called by a stub to obtain an OutputStream for - * marshaling arguments. The stub must supply the operation name, - * and indicate if a response is expected (i.e is this a oneway call). - * - * @param operation the name of the operation being requested - * @param responseExpected {@code true} if a response is expected, - * {@code false} if it is a one-way call - * @return NO_IMPLEMENT because this is a locally constrained object - * and this method does not apply to local objects - * @exception NO_IMPLEMENT because this is a locally constrained object - * and this method does not apply to local objects - * @see CORBA package - * comments for unimplemented features - */ - public OutputStream _request(String operation, - boolean responseExpected) { - throw new org.omg.CORBA.NO_IMPLEMENT(reason); - } - - /** - * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with - * the message "This is a locally constrained object." - * This method is the default implementation of the - * {@code org.omg.CORBA.Object} method. - *

            Called to invoke an operation. The stub provides an - * {@code OutputStream} that was previously returned by a - * {@code _request()} - * call. {@code _invoke} returns an {@code InputStream} which - * contains the - * marshaled reply. If an exception occurs, {@code _invoke} may throw an - * {@code ApplicationException} object which contains an - * {@code InputStream} from - * which the user exception state may be unmarshaled. - * - * @param output the {@code OutputStream} to invoke - * @return NO_IMPLEMENT because this is a locally constrained object - * and this method does not apply to local objects - * @throws ApplicationException If an exception occurs, - * {@code _invoke} may throw an - * {@code ApplicationException} object which contains - * an {@code InputStream} from - * which the user exception state may be unmarshaled. - * @throws RemarshalException If an exception occurs, - * {@code _invoke} may throw an - * {@code ApplicationException} object which contains - * an {@code InputStream} from - * which the user exception state may be unmarshaled. - * @exception NO_IMPLEMENT because this is a locally constrained object - * and this method does not apply to local objects - * @see CORBA package - * comments for unimplemented features - */ - public InputStream _invoke(OutputStream output) - throws ApplicationException, RemarshalException - { - throw new org.omg.CORBA.NO_IMPLEMENT(reason); - } - - /** - * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with - * the message "This is a locally constrained object." - * This method is the default implementation of the - * {@code org.omg.CORBA.Object} method. - *

            May optionally be called by a stub to release a - * reply stream back to the ORB when the unmarshaling has - * completed. The stub passes the {@code InputStream} returned by - * {@code _invoke()} or - * {@code ApplicationException.getInputStream()}. - * A null - * value may also be passed to {@code _releaseReply}, in which case the - * method is a no-op. - * - * @param input the reply stream back to the ORB or null - * @exception NO_IMPLEMENT - * @see CORBA package - * comments for unimplemented features - */ - public void _releaseReply(InputStream input) { - throw new org.omg.CORBA.NO_IMPLEMENT(reason); - } - - /** - * Throws an {@code org.omg.CORBA.NO_IMPLEMENT} exception with - * the message "This is a locally constrained object." This method - * does not apply to local objects and is therefore not implemented. - * This method is the default implementation of the - * {@code org.omg.CORBA.Object} method. - * - * @return NO_IMPLEMENT because this is a locally constrained object - * and this method does not apply to local objects - * @exception NO_IMPLEMENT because this is a locally constrained object - * and this method does not apply to local objects - * @see CORBA package - * comments for unimplemented features - */ - - public boolean validate_connection() { - throw new org.omg.CORBA.NO_IMPLEMENT(reason); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/LongHolder.java b/src/java.corba/share/classes/org/omg/CORBA/LongHolder.java deleted file mode 100644 index 670bec57d67..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/LongHolder.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 1995, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -import org.omg.CORBA.portable.Streamable; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; - -/** - * The Holder for {@code Long}. For more information on - * Holder files, see - * "Generated Files: Holder Files".

            - * A Holder class for a {@code long} - * that is used to store "out" and "inout" parameters in IDL methods. - * If an IDL method signature has an IDL {@code long long} as an "out" - * or "inout" parameter, the programmer must pass an instance of - * {@code LongHolder} as the corresponding - * parameter in the method invocation; for "inout" parameters, the programmer - * must also fill the "in" value to be sent to the server. - * Before the method invocation returns, the ORB will fill in the - * value corresponding to the "out" value returned from the server. - *

            - * If {@code myLongHolder} is an instance of {@code LongHolder}, - * the value stored in its {@code value} field can be accessed with - * {@code myLongHolder.value}. - * - * @since JDK1.2 - */ -public final class LongHolder implements Streamable { - - /** - * The {@code long} value held by this {@code LongHolder} - * object. - */ - public long value; - - /** - * Constructs a new {@code LongHolder} object with its - * {@code value} field initialized to {@code 0}. - */ - public LongHolder() { - } - - /** - * Constructs a new {@code LongHolder} object with its - * {@code value} field initialized to the given - * {@code long}. - * @param initial the {@code long} with which to initialize - * the {@code value} field of the newly-created - * {@code LongHolder} object - */ - public LongHolder(long initial) { - value = initial; - } - - /** - * Reads from {@code input} and initalizes the value in the Holder - * with the unmarshalled data. - * - * @param input the InputStream containing CDR formatted data from the wire - */ - public void _read(InputStream input) { - value = input.read_longlong(); - } - - /** - * Marshals to {@code output} the value in the Holder. - * - * @param output the OutputStream which will contain the CDR formatted data - */ - public void _write(OutputStream output) { - output.write_longlong(value); - } - - /** - * Returns the {@code TypeCode} object - * corresponding to the value held in the Holder. - * - * @return the TypeCode of the value held in the holder - */ - public org.omg.CORBA.TypeCode _type() { - return ORB.init().get_primitive_tc(TCKind.tk_longlong); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/LongLongSeqHelper.java b/src/java.corba/share/classes/org/omg/CORBA/LongLongSeqHelper.java deleted file mode 100644 index 63b77c446b6..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/LongLongSeqHelper.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Helper for {@code LongLongSeq}. For more information on - * Helper files, see - * "Generated Files: Helper Files".

            - * org/omg/CORBA/LongLongSeqHelper.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from streams.idl - * 13 May 1999 22:41:37 o'clock GMT+00:00 - * - * The class definition has been modified to conform to the following - * OMG specifications : - *

              - *
            • ORB core as defined by CORBA 2.3.1 - * (formal/99-10-07) - *
            • - * - *
            • IDL/Java Language Mapping as defined in - * ptc/00-01-08 - *
            • - *
            - */ - -public abstract class LongLongSeqHelper -{ - private static String _id = "IDL:omg.org/CORBA/LongLongSeq:1.0"; - - public static void insert (org.omg.CORBA.Any a, long[] that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static long[] extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_longlong); - __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.LongLongSeqHelper.id (), "LongLongSeq", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static long[] read (org.omg.CORBA.portable.InputStream istream) - { - long value[] = null; - int _len0 = istream.read_long (); - value = new long[_len0]; - istream.read_longlong_array (value, 0, _len0); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, long[] value) - { - ostream.write_long (value.length); - ostream.write_longlong_array (value, 0, value.length); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/LongLongSeqHolder.java b/src/java.corba/share/classes/org/omg/CORBA/LongLongSeqHolder.java deleted file mode 100644 index abc01230c43..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/LongLongSeqHolder.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Holder for {@code LongLongSeq}. For more information on - * Holder files, see - * "Generated Files: Holder Files".

            - * org/omg/CORBA/LongLongSeqHolder.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from streams.idl - * 13 May 1999 22:41:36 o'clock GMT+00:00 - */ - -public final class LongLongSeqHolder implements org.omg.CORBA.portable.Streamable -{ - public long value[] = null; - - public LongLongSeqHolder () - { - } - - public LongLongSeqHolder (long[] initialValue) - { - value = initialValue; - } - - public void _read (org.omg.CORBA.portable.InputStream i) - { - value = org.omg.CORBA.LongLongSeqHelper.read (i); - } - - public void _write (org.omg.CORBA.portable.OutputStream o) - { - org.omg.CORBA.LongLongSeqHelper.write (o, value); - } - - public org.omg.CORBA.TypeCode _type () - { - return org.omg.CORBA.LongLongSeqHelper.type (); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/LongSeqHelper.java b/src/java.corba/share/classes/org/omg/CORBA/LongSeqHelper.java deleted file mode 100644 index 2c9eb2ab49d..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/LongSeqHelper.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Helper for {@code LongSeqHelper}. For more information on - * Helper files, see - * "Generated Files: Helper Files".

            - * org/omg/CORBA/LongSeqHelper.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from streams.idl - * 13 May 1999 22:41:36 o'clock GMT+00:00 - * - * The class definition has been modified to conform to the following - * OMG specifications : - *

              - *
            • ORB core as defined by CORBA 2.3.1 - * (formal/99-10-07) - *
            • - * - *
            • IDL/Java Language Mapping as defined in - * ptc/00-01-08 - *
            • - *
            - */ - -public abstract class LongSeqHelper -{ - private static String _id = "IDL:omg.org/CORBA/LongSeq:1.0"; - - public static void insert (org.omg.CORBA.Any a, int[] that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static int[] extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_long); - __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.LongSeqHelper.id (), "LongSeq", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static int[] read (org.omg.CORBA.portable.InputStream istream) - { - int value[] = null; - int _len0 = istream.read_long (); - value = new int[_len0]; - istream.read_long_array (value, 0, _len0); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, int[] value) - { - ostream.write_long (value.length); - ostream.write_long_array (value, 0, value.length); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/LongSeqHolder.java b/src/java.corba/share/classes/org/omg/CORBA/LongSeqHolder.java deleted file mode 100644 index 6ff9e6a9a91..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/LongSeqHolder.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Holder for {@code LongSeq}. For more information on - * Holder files, see - * "Generated Files: Holder Files".

            - * org/omg/CORBA/LongSeqHolder.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from streams.idl - * 13 May 1999 22:41:36 o'clock GMT+00:00 - */ - -public final class LongSeqHolder implements org.omg.CORBA.portable.Streamable -{ - public int value[] = null; - - public LongSeqHolder () - { - } - - public LongSeqHolder (int[] initialValue) - { - value = initialValue; - } - - public void _read (org.omg.CORBA.portable.InputStream i) - { - value = org.omg.CORBA.LongSeqHelper.read (i); - } - - public void _write (org.omg.CORBA.portable.OutputStream o) - { - org.omg.CORBA.LongSeqHelper.write (o, value); - } - - public org.omg.CORBA.TypeCode _type () - { - return org.omg.CORBA.LongSeqHelper.type (); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/MARSHAL.java b/src/java.corba/share/classes/org/omg/CORBA/MARSHAL.java deleted file mode 100644 index adec5d6f43f..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/MARSHAL.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * A request or reply from the network is structurally invalid. - * This error typically indicates a bug in either the client-side - * or server-side run time. For example, if a reply from the server - * indicates that the message contains 1000 bytes, but the actual - * message is shorter or longer than 1000 bytes, the ORB raises - * this exception. {@code MARSHAL} can also be caused by using - * the DII or DSI incorrectly, for example, if the type of the - * actual parameters sent does not agree with IDL signature of an - * operation.

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - *

            - * See the section {@extLink jidlexception_minorcodes Minor Code Meanings} - * to see the minor codes for this exception. - * - * @since JDK1.2 - */ - -public final class MARSHAL extends SystemException { - /** - * Constructs a {@code MARSHAL} exception with a default minor code - * of 0, a completion state of CompletionStatus.COMPLETED_NO, - * and a null description. - */ - public MARSHAL() { - this(""); - } - - /** - * Constructs a {@code MARSHAL} exception with the specified description message, - * a minor code of 0, and a completion state of COMPLETED_NO. - * @param s the String containing a description of the exception - */ - public MARSHAL(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs a {@code MARSHAL} exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed the completion status - */ - public MARSHAL(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs a {@code MARSHAL} exception with the specified description - * message, minor code, and completion status. - * @param s the String containing a description message - * @param minor the minor code - * @param completed the completion status - */ - public MARSHAL(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/NO_IMPLEMENT.java b/src/java.corba/share/classes/org/omg/CORBA/NO_IMPLEMENT.java deleted file mode 100644 index 6beff5b0313..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/NO_IMPLEMENT.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * This exception indicates that even though the operation that - * was invoked exists (it has an IDL definition), no implementation - * for that operation exists. {@code NO_IMPLEMENT} can, for - * example, be raised by an ORB if a client asks for an object's - * type definition from the interface repository, but no interface - * repository is provided by the ORB.

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - *

            - * See the section {extLink jidlexception_minorcodes Minor Code Meanings} - * to see the minor codes for this exception. - * - * @since JDK1.2 - */ - -public final class NO_IMPLEMENT extends SystemException { - /** - * Constructs a {@code NO_IMPLEMENT} exception with a default minor code - * of 0, a completion state of CompletionStatus.COMPLETED_NO, - * and a null description. - */ - public NO_IMPLEMENT() { - this(""); - } - - /** - * Constructs a {@code NO_IMPLEMENT} exception with the specified description message, - * a minor code of 0, and a completion state of COMPLETED_NO. - * @param s the String containing a description of the exception - */ - public NO_IMPLEMENT(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs a {@code NO_IMPLEMENT} exception with the specified - * minor code and completion status. - * @param minor an {@code int} specifying the minor code - * @param completed a {@code CompletionStatus} instance indicating - * the completion status - */ - public NO_IMPLEMENT(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs a {@code NO_IMPLEMENT} exception with the specified description - * message, minor code, and completion status. - * @param s the String containing a description message - * @param minor an {@code int} specifying the minor code - * @param completed a {@code CompletionStatus} instance indicating - * the completion status - */ - public NO_IMPLEMENT(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/NO_MEMORY.java b/src/java.corba/share/classes/org/omg/CORBA/NO_MEMORY.java deleted file mode 100644 index b88a9260de5..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/NO_MEMORY.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * Exception thrown when the ORB run time has run out of memory. - *

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since JDK1.2 - */ - -public final class NO_MEMORY extends SystemException { - /** - * Constructs a NO_MEMORY exception with a default minor code - * of 0, a completion state of CompletionStatus.COMPLETED_NO, - * and a null description. - */ - public NO_MEMORY() { - this(""); - } - - /** - * Constructs a NO_MEMORY exception with the specified description message, - * a minor code of 0, and a completion state of COMPLETED_NO. - * @param s the String containing a description message - */ - public NO_MEMORY(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs a NO_MEMORY exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed the completion status - */ - public NO_MEMORY(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs a NO_MEMORY exception with the specified description - * message, minor code, and completion status. - * @param s the String containing a description message - * @param minor the minor code - * @param completed the completion status - */ - public NO_MEMORY(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/NO_PERMISSION.java b/src/java.corba/share/classes/org/omg/CORBA/NO_PERMISSION.java deleted file mode 100644 index a2dadde4881..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/NO_PERMISSION.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * Exception thrown when an invocation failed because the caller - * has insufficient privileges.

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since JDK1.2 - */ - -public final class NO_PERMISSION extends SystemException { - /** - * Constructs a NO_PERMISSION exception with a default minor code - * of 0 and a completion state of CompletionStatus.COMPLETED_NO, - * and a null description. - */ - public NO_PERMISSION() { - this(""); - } - - /** - * Constructs a NO_PERMISSION exception with the specified description, - * a minor code of 0, and a completion state of COMPLETED_NO. - * @param s the String containing a description message - */ - public NO_PERMISSION(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs a NO_PERMISSION exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed the completion status - */ - public NO_PERMISSION(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs a NO_PERMISSION exception with the specified description - * message, minor code, and completion status. - * @param s the String containing a description message - * @param minor the minor code - * @param completed the completion status - */ - public NO_PERMISSION(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/NO_RESOURCES.java b/src/java.corba/share/classes/org/omg/CORBA/NO_RESOURCES.java deleted file mode 100644 index 82552ad6125..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/NO_RESOURCES.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * Exception thrown when the ORB has encountered some general resource - * limitation. For example, the run time may have reached the maximum - * permissible number of open connections.

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since JDK1.2 - */ - -public final class NO_RESOURCES extends SystemException { - /** - * Constructs a NO_RESOURCES exception with a default minor code - * of 0, a completion state of CompletionStatus.COMPLETED_NO, - * and a null description. - */ - public NO_RESOURCES() { - this(""); - } - - /** - * Constructs a NO_RESOURCES exception with the specified description, - * a minor code of 0, and a completion state of COMPLETED_NO. - * @param s the String containing a description message - */ - public NO_RESOURCES(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs a NO_RESOURCES exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed the completion status - */ - public NO_RESOURCES(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs a NO_RESOURCES exception with the specified description - * message, minor code, and completion status. - * @param s the String containing a description message - * @param minor the minor code - * @param completed the completion status - */ - public NO_RESOURCES(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/NO_RESPONSE.java b/src/java.corba/share/classes/org/omg/CORBA/NO_RESPONSE.java deleted file mode 100644 index 759986c1bed..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/NO_RESPONSE.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * This exception is raised if a client attempts to retrieve the result - * of a deferred synchronous call, but the response for the request is - * not yet available.

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since JDK1.2 - */ - -public final class NO_RESPONSE extends SystemException { - /** - * Constructs a NO_RESPONSE exception with a default minor code - * of 0, a completion state of CompletionStatus.COMPLETED_NO, - * and a null description. - */ - public NO_RESPONSE() { - this(""); - } - - /** - * Constructs a NO_RESPONSE exception with the specified description message, - * a minor code of 0, and a completion state of COMPLETED_NO. - * @param s the String containing a description message - */ - public NO_RESPONSE(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs a NO_RESPONSE exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed the completion status - */ - public NO_RESPONSE(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs a NO_RESPONSE exception with the specified description - * message, minor code, and completion status. - * @param s the String containing a description message - * @param minor the minor code - * @param completed the completion status - */ - public NO_RESPONSE(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/NVList.java b/src/java.corba/share/classes/org/omg/CORBA/NVList.java deleted file mode 100644 index e60a7e32e79..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/NVList.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * A modifiable list containing NamedValue objects. - *

            - * The class NVList is used as follows: - *

              - *
            • to describe arguments for a Request object - * in the Dynamic Invocation Interface and - * the Dynamic Skeleton Interface - *
            • to describe context values in a Context object - *
            - *

            - * Each NamedValue object consists of the following: - *

              - *
            • a name, which is a String object - *
            • a value, as an Any object - *
            • an argument mode flag - *
            - *

            - * An NVList object - * may be created using one of the following - * ORB methods: - *

              - *
            1. org.omg.CORBA.ORB.create_list - *
              - *    org.omg.CORBA.NVList nv = orb.create_list(3);
              - * 
              - * The variable nv represents a newly-created - * NVList object. The argument is a memory-management - * hint to the orb and does not imply the actual length of the list. - * If, for example, you want to use an NVList object - * in a request, and the method being invoked takes three parameters, - * you might optimize by supplying 3 to the method - * create_list. Note that the new NVList - * will not necessarily have a length of 3; it - * could have a length of 2 or 4, for instance. - * Note also that you can add any number of - * NamedValue objects to this list regardless of - * its original length. - *
            2. org.omg.CORBA.ORB.create_operation_list - *
              - *    org.omg.CORBA.NVList nv = orb.create_operation_list(myOperationDef);
              - * 
              - * The variable nv represents a newly-created - * NVList object that contains descriptions of the - * arguments to the method described in the given - * OperationDef object. - *
            - *

            - * The methods in the class NVList all deal with - * the NamedValue objects in the list. - * There are three methods for adding a NamedValue object, - * a method for getting the count of NamedValue objects in - * the list, a method for retrieving a NamedValue object - * at a given index, and a method for removing a NamedValue object - * at a given index. - * - * @see org.omg.CORBA.Request - * @see org.omg.CORBA.ServerRequest - * @see org.omg.CORBA.NamedValue - * @see org.omg.CORBA.Context - * - * @since JDK1.2 - */ - -public abstract class NVList { - - /** - * Returns the number of NamedValue objects that have - * been added to this NVList object. - * - * @return an int indicating the number of - * NamedValue objects in this NVList. - */ - - public abstract int count(); - - /** - * Creates a new NamedValue object initialized with the given flag - * and adds it to the end of this NVList object. - * The flag can be any one of the argument passing modes: - * ARG_IN.value, ARG_OUT.value, or - * ARG_INOUT.value. - * - * @param flags one of the argument mode flags - * @return the newly-created NamedValue object - */ - - public abstract NamedValue add(int flags); - - /** - * Creates a new NamedValue object initialized with the - * given name and flag, - * and adds it to the end of this NVList object. - * The flag can be any one of the argument passing modes: - * ARG_IN.value, ARG_OUT.value, or - * ARG_INOUT.value. - * - * @param item_name the name for the new NamedValue object - * @param flags one of the argument mode flags - * @return the newly-created NamedValue object - */ - - public abstract NamedValue add_item(String item_name, int flags); - - /** - * Creates a new NamedValue object initialized with the - * given name, value, and flag, - * and adds it to the end of this NVList object. - * - * @param item_name the name for the new NamedValue object - * @param val an Any object containing the value - * for the new NamedValue object - * @param flags one of the following argument passing modes: - * ARG_IN.value, ARG_OUT.value, or - * ARG_INOUT.value - * @return the newly created NamedValue object - */ - - public abstract NamedValue add_value(String item_name, Any val, int flags); - - /** - * Retrieves the NamedValue object at the given index. - * - * @param index the index of the desired NamedValue object, - * which must be between zero and the length of the list - * minus one, inclusive. The first item is at index zero. - * @return the NamedValue object at the given index - * @exception org.omg.CORBA.Bounds if the index is greater than - * or equal to number of NamedValue objects - */ - - public abstract NamedValue item(int index) throws org.omg.CORBA.Bounds; - - /** - * Removes the NamedValue object at the given index. - * Note that the indices of all NamedValue objects following - * the one removed are shifted down by one. - * - * @param index the index of the NamedValue object to be - * removed, which must be between zero and the length - * of the list minus one, inclusive. - * The first item is at index zero. - * @exception org.omg.CORBA.Bounds if the index is greater than - * or equal to number of NamedValue objects in - * the list - */ - - public abstract void remove(int index) throws org.omg.CORBA.Bounds; - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/NameValuePair.java b/src/java.corba/share/classes/org/omg/CORBA/NameValuePair.java deleted file mode 100644 index bd851c3e314..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/NameValuePair.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package org.omg.CORBA; - -/** - * Associates a name with a value that is an - * attribute of an IDL struct, and is used in the {@code DynStruct} APIs. - */ - -public final class NameValuePair implements org.omg.CORBA.portable.IDLEntity { - - /** - * The name to be associated with a value by this {@code NameValuePair} object. - */ - public String id; - - /** - * The value to be associated with a name by this {@code NameValuePair} object. - */ - public org.omg.CORBA.Any value; - - /** - * Constructs an empty {@code NameValuePair} object. - * To associate a name with a value after using this constructor, the fields - * of this object have to be accessed individually. - */ - public NameValuePair() { } - - /** - * Constructs a {@code NameValuePair} object that associates - * the given name with the given {@code org.omg.CORBA.Any} object. - * @param __id the name to be associated with the given {@code Any} object - * @param __value the {@code Any} object to be associated with the given name - */ - public NameValuePair(String __id, org.omg.CORBA.Any __value) { - id = __id; - value = __value; - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/NameValuePairHelper.java b/src/java.corba/share/classes/org/omg/CORBA/NameValuePairHelper.java deleted file mode 100644 index ec411e11a74..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/NameValuePairHelper.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Helper for {@code NameValuePair}. For more information on - * Helper files, see - * "Generated Files: Helper Files".

            - * org/omg/CORBA/NameValuePairHelper.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * 03 June 1999 11:52:03 o'clock GMT+00:00 - */ - -abstract public class NameValuePairHelper -{ - private static String _id = "IDL:omg.org/CORBA/NameValuePair:1.0"; - - public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.NameValuePair that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static org.omg.CORBA.NameValuePair extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - private static boolean __active = false; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - synchronized (org.omg.CORBA.TypeCode.class) - { - if (__typeCode == null) - { - if (__active) - { - return org.omg.CORBA.ORB.init().create_recursive_tc ( _id ); - } - __active = true; - org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [2]; - org.omg.CORBA.TypeCode _tcOf_members0 = null; - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.FieldNameHelper.id (), "FieldName", _tcOf_members0); - _members0[0] = new org.omg.CORBA.StructMember ( - "id", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_any); - _members0[1] = new org.omg.CORBA.StructMember ( - "value", - _tcOf_members0, - null); - __typeCode = org.omg.CORBA.ORB.init ().create_struct_tc (org.omg.CORBA.NameValuePairHelper.id (), "NameValuePair", _members0); - __active = false; - } - } - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static org.omg.CORBA.NameValuePair read (org.omg.CORBA.portable.InputStream istream) - { - org.omg.CORBA.NameValuePair value = new org.omg.CORBA.NameValuePair (); - value.id = istream.read_string (); - value.value = istream.read_any (); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.NameValuePair value) - { - ostream.write_string (value.id); - ostream.write_any (value.value); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/NamedValue.java b/src/java.corba/share/classes/org/omg/CORBA/NamedValue.java deleted file mode 100644 index a3deb942d2d..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/NamedValue.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * An object used in the DII and DSI to describe - * arguments and return values. NamedValue objects - * are also used in the Context - * object routines to pass lists of property names and values. - *

            - * A NamedValue object contains: - *

              - *
            • a name -- If the NamedValue object is used to - * describe arguments to a request, the name will be an argument - * identifier specified in the OMG IDL interface definition - * for the operation being described. - *
            • a value -- an Any object - *
            • an argument mode flag -- one of the following: - *
                - *
              • ARG_IN.value - *
              • ARG_OUT.value - *
              • ARG_INOUT.value - *
              • zero -- if this NamedValue object represents a property - * in a Context object rather than a parameter or - * return value - *
              - *
            - *

            - * The class NamedValue has three methods, which - * access its fields. The following code fragment demonstrates - * creating a NamedValue object and then accessing - * its fields: - *

            - *    ORB orb = ORB.init(args, null);
            - *    String s = "argument_1";
            - *    org.omg.CORBA.Any myAny = orb.create_any();
            - *    myAny.insert_long(12345);
            - *    int in = org.omg.CORBA.ARG_IN.value;
            -
            - *    org.omg.CORBA.NamedValue nv = orb.create_named_value(
            - *        s, myAny, in);
            - *    System.out.println("This nv name is " + nv.name());
            - *    try {
            - *        System.out.println("This nv value is " + nv.value().extract_long());
            - *        System.out.println("This nv flag is " + nv.flags());
            - *    } catch (org.omg.CORBA.BAD_OPERATION b) {
            - *      System.out.println("extract failed");
            - *    }
            - * 
            - * - *

            - * If this code fragment were put into a main method, - * the output would be something like the following: - *

            - *    This nv name is argument_1
            - *    This nv value is 12345
            - *    This nv flag is 1
            - * 
            - *

            - * Note that the method value returns an Any - * object. In order to access the long contained in the - * Any object, - * we used the method extract_long. - * - * @see Any - * @see ARG_IN - * @see ARG_INOUT - * @see ARG_OUT - * - * @since JDK1.2 - */ - -public abstract class NamedValue { - - /** - * Retrieves the name for this NamedValue object. - * - * @return a String object representing - * the name of this NamedValue object - */ - - public abstract String name(); - - /** - * Retrieves the value for this NamedValue object. - * - * @return an Any object containing - * the value of this NamedValue object - */ - - public abstract Any value(); - - /** - * Retrieves the argument mode flag for this NamedValue object. - * - * @return an int representing the argument - * mode for this NamedValue object - */ - - public abstract int flags(); - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/OBJECT_NOT_EXIST.java b/src/java.corba/share/classes/org/omg/CORBA/OBJECT_NOT_EXIST.java deleted file mode 100644 index e9871fe31a4..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/OBJECT_NOT_EXIST.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * Exception raised whenever an invocation on a deleted object was - * performed. It is an authoritative "hard" fault report. Anyone - * receiving it is allowed (even expected) to delete all copies of - * this object reference and to perform other appropriate "final - * recovery" style procedures. Bridges forward this exception to - * clients, also destroying any records they may hold (for example, - * proxy objects used in reference translation). The clients could - * in turn purge any of their own data structures. - *

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - *

            - * See the section {@extLink jidlexception_minorcodes Minor Code Meanings} - * to see the minor codes for this exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since JDK1.2 - */ - -public final class OBJECT_NOT_EXIST extends SystemException { - /** - * Constructs an OBJECT_NOT_EXIST exception with a default minor code - * of 0, a completion state of CompletionStatus.COMPLETED_NO, - * and a null description. - */ - public OBJECT_NOT_EXIST() { - this(""); - } - - /** - * Constructs an OBJECT_NOT_EXIST exception with the specified description, - * a minor code of 0, and a completion state of COMPLETED_NO. - * @param s the String containing a description message - */ - public OBJECT_NOT_EXIST(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs an OBJECT_NOT_EXIST exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed the completion status - */ - public OBJECT_NOT_EXIST(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs an OBJECT_NOT_EXIST exception with the specified description - * message, minor code, and completion status. - * @param s the String containing a description message - * @param minor the minor code - * @param completed the completion status - */ - public OBJECT_NOT_EXIST(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/OBJ_ADAPTER.java b/src/java.corba/share/classes/org/omg/CORBA/OBJ_ADAPTER.java deleted file mode 100644 index e0432a14d67..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/OBJ_ADAPTER.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * This exception typically indicates an administrative mismatch, for - * example, a server may have made an attempt to register itself with - * an implementation repository under a name that is already in use, - * or is unknown to the repository.

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - *

            - * See the section {@extLink jidlexception_minorcodes Minor Code Meanings} - * to see the minor codes for this exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since JDK1.2 - */ - -public final class OBJ_ADAPTER extends SystemException { - /** - * Constructs an OBJ_ADAPTER exception with a default minor code - * of 0, a completion state of CompletionStatus.COMPLETED_NO, - * and a null description. - */ - public OBJ_ADAPTER() { - this(""); - } - - /** - * Constructs an OBJ_ADAPTER exception with the specified description, - * a minor code of 0, and a completion state of COMPLETED_NO. - * @param s the String containing a description message - */ - public OBJ_ADAPTER(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs an OBJ_ADAPTER exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed the completion status - */ - public OBJ_ADAPTER(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs an OBJ_ADAPTER exception with the specified description - * message, minor code, and completion status. - * @param s the String containing a description message - * @param minor the minor code - * @param completed the completion status - */ - public OBJ_ADAPTER(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/OMGVMCID.java b/src/java.corba/share/classes/org/omg/CORBA/OMGVMCID.java deleted file mode 100644 index 9a2738a1038..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/OMGVMCID.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * The vendor minor code ID reserved for OMG. Minor codes for the standard - * exceptions are prefaced by the VMCID assigned to OMG, defined as the - * constant OMGVMCID, which, like all VMCIDs, occupies the high order 20 bits. - */ - -public interface OMGVMCID { - - /** - * The vendor minor code ID reserved for OMG. This value is or'd with - * the high order 20 bits of the minor code to produce the minor value - * in a system exception. - */ - static final int value = 0x4f4d0000; -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ORB.java b/src/java.corba/share/classes/org/omg/CORBA/ORB.java deleted file mode 100644 index 1139c11cc17..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ORB.java +++ /dev/null @@ -1,1406 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -import org.omg.CORBA.portable.*; -import org.omg.CORBA.ORBPackage.InvalidName; - -import java.util.Properties; -import java.applet.Applet; -import java.io.File; -import java.io.FileInputStream; - -import java.security.AccessController; -import java.security.PrivilegedAction; - -/** - * A class providing APIs for the CORBA Object Request Broker - * features. The {@code ORB} class also provides - * "pluggable ORB implementation" APIs that allow another vendor's ORB - * implementation to be used. - *

            - * An ORB makes it possible for CORBA objects to communicate - * with each other by connecting objects making requests (clients) with - * objects servicing requests (servers). - *

            - * - * The {@code ORB} class, which - * encapsulates generic CORBA functionality, does the following: - * (Note that items 5 and 6, which include most of the methods in - * the class {@code ORB}, are typically used with the - * {@code Dynamic Invocation Interface} (DII) and - * the {@code Dynamic Skeleton Interface} (DSI). - * These interfaces may be used by a developer directly, but - * most commonly they are used by the ORB internally and are - * not seen by the general programmer.) - *

              - *
            1. initializes the ORB implementation by supplying values for - * predefined properties and environmental parameters - *
            2. obtains initial object references to services such as - * the NameService using the method {@code resolve_initial_references} - *
            3. converts object references to strings and back - *
            4. connects the ORB to a servant (an instance of a CORBA object - * implementation) and disconnects the ORB from a servant - *
            5. creates objects such as - *
                - *
              • {@code TypeCode} - *
              • {@code Any} - *
              • {@code NamedValue} - *
              • {@code Context} - *
              • {@code Environment} - *
              • lists (such as {@code NVList}) containing these objects - *
              - *
            6. sends multiple messages in the DII - *
            - * - *

            - * The {@code ORB} class can be used to obtain references to objects - * implemented anywhere on the network. - *

            - * An application or applet gains access to the CORBA environment - * by initializing itself into an {@code ORB} using one of - * three {@code init} methods. Two of the three methods use the properties - * (associations of a name with a value) shown in the - * table below.
            - *

            Static argument types
            - * - * - * - * - * - * - * - * - * - * - *
            Standard Java CORBA Properties
            Property Name Property Value
            org.omg.CORBA.ORBClassclass name of an ORB implementation
            org.omg.CORBA.ORBSingletonClassclass name of the ORB returned by {@code init()}
            - *

            - * These properties allow a different vendor's {@code ORB} - * implementation to be "plugged in." - *

            - * When an ORB instance is being created, the class name of the ORB - * implementation is located using - * the following standard search order: - * - *

              - *
            1. check in Applet parameter or application string array, if any - * - *
            2. check in properties parameter, if any - * - *
            3. check in the System properties, if any - * - *
            4. check in the orb.properties file located in the user.home - * directory, if any - * - *
            5. check in the orb.properties file located in the run-time image, - * if any - * - *
            6. fall back on a hardcoded default behavior (use the Java IDL - * implementation) - *
            - *

            - * Note that Java IDL provides a default implementation for the - * fully-functional ORB and for the Singleton ORB. When the method - * {@code init} is given no parameters, the default Singleton - * ORB is returned. When the method {@code init} is given parameters - * but no ORB class is specified, the Java IDL ORB implementation - * is returned. - *

            - * The following code fragment creates an {@code ORB} object - * initialized with the default ORB Singleton. - * This ORB has a - * restricted implementation to prevent malicious applets from doing - * anything beyond creating typecodes. - * It is called a singleton - * because there is only one instance for an entire virtual machine. - *

            - *    ORB orb = ORB.init();
            - * 
            - *

            - * The following code fragment creates an {@code ORB} object - * for an application. The parameter {@code args} - * represents the arguments supplied to the application's {@code main} - * method. Since the property specifies the ORB class to be - * "SomeORBImplementation", the new ORB will be initialized with - * that ORB implementation. If p had been null, - * and the arguments had not specified an ORB class, - * the new ORB would have been - * initialized with the default Java IDL implementation. - *

            - *    Properties p = new Properties();
            - *    p.put("org.omg.CORBA.ORBClass", "SomeORBImplementation");
            - *    ORB orb = ORB.init(args, p);
            - * 
            - *

            - * The following code fragment creates an {@code ORB} object - * for the applet supplied as the first parameter. If the given - * applet does not specify an ORB class, the new ORB will be - * initialized with the default Java IDL implementation. - *

            - *    ORB orb = ORB.init(myApplet, null);
            - * 
            - *

            - * An application or applet can be initialized in one or more ORBs. - * ORB initialization is a bootstrap call into the CORBA world. - * - * - * @implNote - * When a singleton ORB is configured via the system property, - * or orb.properties, it will be - * located, and loaded via the system class loader. - * Thus, where appropriate, it is necessary that - * the classes for this alternative ORBSingleton are available on the application's class path. - * It should be noted that the singleton ORB is system wide. - *

            - * When a per-application ORB is created via the 2-arg init methods, - * then it will be located using the thread context class loader. - *

            - * The IDL to Java Language OMG specification documents the ${java.home}/lib directory as the location, - * in the Java run-time image, to search for orb.properties. - * This location is not intended for user editable configuration files. - * Therefore, the implementation first checks the ${java.home}/conf directory for orb.properties, - * and thereafter the ${java.home}/lib directory. - * - *

            See also {@extLink idl_guides IDL developer's guide}.

            - * - * @since JDK1.2 - */ -abstract public class ORB { - - // - // This is the ORB implementation used when nothing else is specified. - // Whoever provides this class customizes this string to - // point at their ORB implementation. - // - private static final String ORBClassKey = "org.omg.CORBA.ORBClass"; - private static final String ORBSingletonClassKey = "org.omg.CORBA.ORBSingletonClass"; - - // check that access to the class is not restricted by the security manager. - private static void checkPackageAccess(String name) { - SecurityManager s = System.getSecurityManager(); - if (s != null) { - String cname = name.replace('/', '.'); - if (cname.startsWith("[")) { - int b = cname.lastIndexOf('[') + 2; - if (b > 1 && b < cname.length()) { - cname = cname.substring(b); - } - } - int i = cname.lastIndexOf('.'); - if (i != -1) { - s.checkPackageAccess(cname.substring(0, i)); - } - } - } - - // - // The global instance of the singleton ORB implementation which - // acts as a factory for typecodes for generated Helper classes. - // TypeCodes should be immutable since they may be shared across - // different security contexts (applets). There should be no way to - // use a TypeCode as a storage depot for illicitly passing - // information or Java objects between different security contexts. - // - static private ORB singleton; - - // Get System property - private static String getSystemProperty(final String name) { - - // This will not throw a SecurityException because this - // class was loaded from rt.jar using the bootstrap classloader. - String propValue = (String) AccessController.doPrivileged( - new PrivilegedAction() { - public java.lang.Object run() { - return System.getProperty(name); - } - } - ); - - return propValue; - } - - // Get property from orb.properties in either or /lib - // directories. - private static String getPropertyFromFile(final String name) { - // This will not throw a SecurityException because this - // class was loaded from rt.jar using the bootstrap classloader. - - String propValue = (String) AccessController.doPrivileged( - new PrivilegedAction() { - private Properties getFileProperties( String fileName ) { - try { - File propFile = new File( fileName ) ; - if (!propFile.exists()) - return null ; - - Properties props = new Properties() ; - FileInputStream fis = new FileInputStream(propFile); - try { - props.load( fis ); - } finally { - fis.close() ; - } - - return props ; - } catch (Exception exc) { - return null ; - } - } - - public java.lang.Object run() { - String userHome = System.getProperty("user.home"); - String fileName = userHome + File.separator + - "orb.properties" ; - Properties props = getFileProperties( fileName ) ; - - if (props != null) { - String value = props.getProperty( name ) ; - if (value != null) - return value ; - } - - String javaHome = System.getProperty("java.home"); - - fileName = javaHome + File.separator + "conf" - + File.separator + "orb.properties"; - props = getFileProperties(fileName); - - if (props != null) { - String value = props.getProperty(name); - if (value != null) - return value; - } - - fileName = javaHome + File.separator + "lib" - + File.separator + "orb.properties"; - props = getFileProperties(fileName); - - if (props == null) - return null; - else - return props.getProperty(name); - } - } - ); - - return propValue; - } - - /** - * Returns the {@code ORB} singleton object. This method always returns the - * same ORB instance, which is an instance of the class described by the - * {@code org.omg.CORBA.ORBSingletonClass} system property. - *

            - * This no-argument version of the method {@code init} is used primarily - * as a factory for {@code TypeCode} objects, which are used by - * {@code Helper} classes to implement the method {@code type}. - * It is also used to create {@code Any} objects that are used to - * describe {@code union} labels (as part of creating a - * {@code TypeCode} object for a {@code union}). - *

            - * This method is not intended to be used by applets, and in the event - * that it is called in an applet environment, the ORB it returns - * is restricted so that it can be used only as a factory for - * {@code TypeCode} objects. Any {@code TypeCode} objects - * it produces can be safely shared among untrusted applets. - *

            - * If an ORB is created using this method from an applet, - * a system exception will be thrown if - * methods other than those for - * creating {@code TypeCode} objects are invoked. - * - * @return the singleton ORB - * - * @implNote - * When configured via the system property, or orb.properties, - * the system-wide singleton ORB is located via the - * system class loader. - */ - public static synchronized ORB init() { - if (singleton == null) { - String className = getSystemProperty(ORBSingletonClassKey); - if (className == null) - className = getPropertyFromFile(ORBSingletonClassKey); - if ((className == null) || - (className.equals("com.sun.corba.se.impl.orb.ORBSingleton"))) { - singleton = new com.sun.corba.se.impl.orb.ORBSingleton(); - } else { - singleton = create_impl_with_systemclassloader(className); - } - } - return singleton; - } - - private static ORB create_impl_with_systemclassloader(String className) { - - try { - checkPackageAccess(className); - ClassLoader cl = ClassLoader.getSystemClassLoader(); - Class orbBaseClass = org.omg.CORBA.ORB.class; - Class singletonOrbClass = Class.forName(className, true, cl).asSubclass(orbBaseClass); - return (ORB)singletonOrbClass.newInstance(); - } catch (Throwable ex) { - SystemException systemException = new INITIALIZE( - "can't instantiate default ORB implementation " + className); - systemException.initCause(ex); - throw systemException; - } - } - - private static ORB create_impl(String className) { - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - if (cl == null) - cl = ClassLoader.getSystemClassLoader(); - - try { - checkPackageAccess(className); - Class orbBaseClass = org.omg.CORBA.ORB.class; - Class orbClass = Class.forName(className, true, cl).asSubclass(orbBaseClass); - return (ORB)orbClass.newInstance(); - } catch (Throwable ex) { - SystemException systemException = new INITIALIZE( - "can't instantiate default ORB implementation " + className); - systemException.initCause(ex); - throw systemException; - } - } - - /** - * Creates a new {@code ORB} instance for a standalone - * application. This method may be called from applications - * only and returns a new fully functional {@code ORB} object - * each time it is called. - * @param args command-line arguments for the application's {@code main} - * method; may be {@code null} - * @param props application-specific properties; may be {@code null} - * @return the newly-created ORB instance - * - * @implNote - * When configured via the system property, or orb.properties, - * the ORB is located via the thread context class loader. - */ - public static ORB init(String[] args, Properties props) { - // - // Note that there is no standard command-line argument for - // specifying the default ORB implementation. For an - // application you can choose an implementation either by - // setting the CLASSPATH to pick a different org.omg.CORBA - // and it's baked-in ORB implementation default or by - // setting an entry in the properties object or in the - // system properties. - // - String className = null; - ORB orb; - - if (props != null) - className = props.getProperty(ORBClassKey); - if (className == null) - className = getSystemProperty(ORBClassKey); - if (className == null) - className = getPropertyFromFile(ORBClassKey); - if ((className == null) || - (className.equals("com.sun.corba.se.impl.orb.ORBImpl"))) { - orb = new com.sun.corba.se.impl.orb.ORBImpl(); - } else { - orb = create_impl(className); - } - orb.set_parameters(args, props); - return orb; - } - - - /** - * Creates a new {@code ORB} instance for an applet. This - * method may be called from applets only and returns a new - * fully-functional {@code ORB} object each time it is called. - * @param app the applet; may be {@code null} - * @param props applet-specific properties; may be {@code null} - * @return the newly-created ORB instance - * - * @implNote - * When configured via the system property, or orb.properties, - * the ORB is located via the thread context class loader. - */ - public static ORB init(Applet app, Properties props) { - String className; - ORB orb; - - className = app.getParameter(ORBClassKey); - if (className == null && props != null) - className = props.getProperty(ORBClassKey); - if (className == null) - className = getSystemProperty(ORBClassKey); - if (className == null) - className = getPropertyFromFile(ORBClassKey); - if ((className == null) || - (className.equals("com.sun.corba.se.impl.orb.ORBImpl"))) { - orb = new com.sun.corba.se.impl.orb.ORBImpl(); - } else { - orb = create_impl(className); - } - orb.set_parameters(app, props); - return orb; - } - - /** - * Allows the ORB implementation to be initialized with the given - * parameters and properties. This method, used in applications only, - * is implemented by subclass ORB implementations and called - * by the appropriate {@code init} method to pass in its parameters. - * - * @param args command-line arguments for the application's {@code main} - * method; may be {@code null} - * @param props application-specific properties; may be {@code null} - */ - abstract protected void set_parameters(String[] args, Properties props); - - /** - * Allows the ORB implementation to be initialized with the given - * applet and parameters. This method, used in applets only, - * is implemented by subclass ORB implementations and called - * by the appropriate {@code init} method to pass in its parameters. - * - * @param app the applet; may be {@code null} - * @param props applet-specific properties; may be {@code null} - */ - abstract protected void set_parameters(Applet app, Properties props); - - /** - * Connects the given servant object (a Java object that is - * an instance of the server implementation class) - * to the ORB. The servant class must - * extend the {@code ImplBase} class corresponding to the interface that is - * supported by the server. The servant must thus be a CORBA object - * reference, and inherit from {@code org.omg.CORBA.Object}. - * Servants created by the user can start receiving remote invocations - * after the method {@code connect} has been called. A servant may also be - * automatically and implicitly connected to the ORB if it is passed as - * an IDL parameter in an IDL method invocation on a non-local object, - * that is, if the servant object has to be marshalled and sent outside of the - * process address space. - *

            - * Calling the method {@code connect} has no effect - * when the servant object is already connected to the ORB. - *

            - * Deprecated by the OMG in favor of the Portable Object Adapter APIs. - * - * @param obj The servant object reference - */ - public void connect(org.omg.CORBA.Object obj) { - throw new NO_IMPLEMENT(); - } - - /** - * Destroys the ORB so that its resources can be reclaimed. - * Any operation invoked on a destroyed ORB reference will throw the - * {@code OBJECT_NOT_EXIST} exception. - * Once an ORB has been destroyed, another call to {@code init} - * with the same ORBid will return a reference to a newly constructed ORB.

            - * If {@code destroy} is called on an ORB that has not been shut down, - * it will start the shut down process and block until the ORB has shut down - * before it destroys the ORB.
            - * If an application calls {@code destroy} in a thread that is currently servicing - * an invocation, the {@code BAD_INV_ORDER} system exception will be thrown - * with the OMG minor code 3, since blocking would result in a deadlock.

            - * For maximum portability and to avoid resource leaks, an application should - * always call {@code shutdown} and {@code destroy} - * on all ORB instances before exiting. - * - * @throws org.omg.CORBA.BAD_INV_ORDER if the current thread is servicing an invocation - */ - public void destroy( ) { - throw new NO_IMPLEMENT(); - } - - /** - * Disconnects the given servant object from the ORB. After this method returns, - * the ORB will reject incoming remote requests for the disconnected - * servant and will send the exception - * {@code org.omg.CORBA.OBJECT_NOT_EXIST} back to the - * remote client. Thus the object appears to be destroyed from the - * point of view of remote clients. Note, however, that local requests issued - * using the servant directly do not - * pass through the ORB; hence, they will continue to be processed by the - * servant. - *

            - * Calling the method {@code disconnect} has no effect - * if the servant is not connected to the ORB. - *

            - * Deprecated by the OMG in favor of the Portable Object Adapter APIs. - * - * @param obj The servant object to be disconnected from the ORB - */ - public void disconnect(org.omg.CORBA.Object obj) { - throw new NO_IMPLEMENT(); - } - - // - // ORB method implementations. - // - // We are trying to accomplish 2 things at once in this class. - // It can act as a default ORB implementation front-end, - // creating an actual ORB implementation object which is a - // subclass of this ORB class and then delegating the method - // implementations. - // - // To accomplish the delegation model, the 'delegate' private instance - // variable is set if an instance of this class is created directly. - // - - /** - * Returns a list of the initially available CORBA object references, - * such as "NameService" and "InterfaceRepository". - * - * @return an array of {@code String} objects that represent - * the object references for CORBA services - * that are initially available with this ORB - */ - abstract public String[] list_initial_services(); - - /** - * Resolves a specific object reference from the set of available - * initial service names. - * - * @param object_name the name of the initial service as a string - * @return the object reference associated with the given name - * @exception InvalidName if the given name is not associated with a - * known service - */ - abstract public org.omg.CORBA.Object resolve_initial_references(String object_name) - throws InvalidName; - - /** - * Converts the given CORBA object reference to a string. - * Note that the format of this string is predefined by IIOP, allowing - * strings generated by a different ORB to be converted back into an object - * reference. - *

            - * The resulting {@code String} object may be stored or communicated - * in any way that a {@code String} object can be manipulated. - * - * @param obj the object reference to stringify - * @return the string representing the object reference - */ - abstract public String object_to_string(org.omg.CORBA.Object obj); - - /** - * Converts a string produced by the method {@code object_to_string} - * back to a CORBA object reference. - * - * @param str the string to be converted back to an object reference. It must - * be the result of converting an object reference to a string using the - * method {@code object_to_string}. - * @return the object reference - */ - abstract public org.omg.CORBA.Object string_to_object(String str); - - /** - * Allocates an {@code NVList} with (probably) enough - * space for the specified number of {@code NamedValue} objects. - * Note that the specified size is only a hint to help with - * storage allocation and does not imply the maximum size of the list. - * - * @param count suggested number of {@code NamedValue} objects for - * which to allocate space - * @return the newly-created {@code NVList} - * - * @see NVList - */ - abstract public NVList create_list(int count); - - /** - * Creates an {@code NVList} initialized with argument - * descriptions for the operation described in the given - * {@code OperationDef} object. This {@code OperationDef} object - * is obtained from an Interface Repository. The arguments in the - * returned {@code NVList} object are in the same order as in the - * original IDL operation definition, which makes it possible for the list - * to be used in dynamic invocation requests. - * - * @param oper the {@code OperationDef} object to use to create the list - * @return a newly-created {@code NVList} object containing - * descriptions of the arguments to the method described in the given - * {@code OperationDef} object - * - * @see NVList - */ - public NVList create_operation_list(org.omg.CORBA.Object oper) - { - // If we came here, it means that the actual ORB implementation - // did not have a create_operation_list(...CORBA.Object oper) method, - // so lets check if it has a create_operation_list(OperationDef oper) - // method. - try { - // First try to load the OperationDef class - String opDefClassName = "org.omg.CORBA.OperationDef"; - Class opDefClass = null; - - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - if ( cl == null ) - cl = ClassLoader.getSystemClassLoader(); - // if this throws a ClassNotFoundException, it will be caught below. - opDefClass = Class.forName(opDefClassName, true, cl); - - // OK, we loaded OperationDef. Now try to get the - // create_operation_list(OperationDef oper) method. - Class[] argc = { opDefClass }; - java.lang.reflect.Method meth = - this.getClass().getMethod("create_operation_list", argc); - - // OK, the method exists, so invoke it and be happy. - java.lang.Object[] argx = { oper }; - return (org.omg.CORBA.NVList)meth.invoke(this, argx); - } - catch( java.lang.reflect.InvocationTargetException exs ) { - Throwable t = exs.getTargetException(); - if (t instanceof Error) { - throw (Error) t; - } - else if (t instanceof RuntimeException) { - throw (RuntimeException) t; - } - else { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - } - catch( RuntimeException ex ) { - throw ex; - } - catch( Exception exr ) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - } - - - /** - * Creates a {@code NamedValue} object - * using the given name, value, and argument mode flags. - *

            - * A {@code NamedValue} object serves as (1) a parameter or return - * value or (2) a context property. - * It may be used by itself or - * as an element in an {@code NVList} object. - * - * @param s the name of the {@code NamedValue} object - * @param any the {@code Any} value to be inserted into the - * {@code NamedValue} object - * @param flags the argument mode flags for the {@code NamedValue}: one of - * {@code ARG_IN.value}, {@code ARG_OUT.value}, - * or {@code ARG_INOUT.value}. - * - * @return the newly-created {@code NamedValue} object - * @see NamedValue - */ - abstract public NamedValue create_named_value(String s, Any any, int flags); - - /** - * Creates an empty {@code ExceptionList} object. - * - * @return the newly-created {@code ExceptionList} object - */ - abstract public ExceptionList create_exception_list(); - - /** - * Creates an empty {@code ContextList} object. - * - * @return the newly-created {@code ContextList} object - * @see ContextList - * @see Context - */ - abstract public ContextList create_context_list(); - - /** - * Gets the default {@code Context} object. - * - * @return the default {@code Context} object - * @see Context - */ - abstract public Context get_default_context(); - - /** - * Creates an {@code Environment} object. - * - * @return the newly-created {@code Environment} object - * @see Environment - */ - abstract public Environment create_environment(); - - /** - * Creates a new {@code org.omg.CORBA.portable.OutputStream} into which - * IDL method parameters can be marshalled during method invocation. - * @return the newly-created - * {@code org.omg.CORBA.portable.OutputStream} object - */ - abstract public org.omg.CORBA.portable.OutputStream create_output_stream(); - - /** - * Sends multiple dynamic (DII) requests asynchronously without expecting - * any responses. Note that oneway invocations are not guaranteed to - * reach the server. - * - * @param req an array of request objects - */ - abstract public void send_multiple_requests_oneway(Request[] req); - - /** - * Sends multiple dynamic (DII) requests asynchronously. - * - * @param req an array of {@code Request} objects - */ - abstract public void send_multiple_requests_deferred(Request[] req); - - /** - * Finds out if any of the deferred (asynchronous) invocations have - * a response yet. - * @return {@code true} if there is a response available; - * {@code false} otherwise - */ - abstract public boolean poll_next_response(); - - /** - * Gets the next {@code Request} instance for which a response - * has been received. - * - * @return the next {@code Request} object ready with a response - * @exception WrongTransaction if the method {@code get_next_response} - * is called from a transaction scope different - * from the one from which the original request was sent. See the - * OMG Transaction Service specification for details. - */ - abstract public Request get_next_response() throws WrongTransaction; - - /** - * Retrieves the {@code TypeCode} object that represents - * the given primitive IDL type. - * - * @param tcKind the {@code TCKind} instance corresponding to the - * desired primitive type - * @return the requested {@code TypeCode} object - */ - abstract public TypeCode get_primitive_tc(TCKind tcKind); - - /** - * Creates a {@code TypeCode} object representing an IDL {@code struct}. - * The {@code TypeCode} object is initialized with the given id, - * name, and members. - * - * @param id the repository id for the {@code struct} - * @param name the name of the {@code struct} - * @param members an array describing the members of the {@code struct} - * @return a newly-created {@code TypeCode} object describing - * an IDL {@code struct} - */ - abstract public TypeCode create_struct_tc(String id, String name, - StructMember[] members); - - /** - * Creates a {@code TypeCode} object representing an IDL {@code union}. - * The {@code TypeCode} object is initialized with the given id, - * name, discriminator type, and members. - * - * @param id the repository id of the {@code union} - * @param name the name of the {@code union} - * @param discriminator_type the type of the {@code union} discriminator - * @param members an array describing the members of the {@code union} - * @return a newly-created {@code TypeCode} object describing - * an IDL {@code union} - */ - abstract public TypeCode create_union_tc(String id, String name, - TypeCode discriminator_type, - UnionMember[] members); - - /** - * Creates a {@code TypeCode} object representing an IDL {@code enum}. - * The {@code TypeCode} object is initialized with the given id, - * name, and members. - * - * @param id the repository id for the {@code enum} - * @param name the name for the {@code enum} - * @param members an array describing the members of the {@code enum} - * @return a newly-created {@code TypeCode} object describing - * an IDL {@code enum} - */ - abstract public TypeCode create_enum_tc(String id, String name, String[] members); - - /** - * Creates a {@code TypeCode} object representing an IDL {@code alias} - * ({@code typedef}). - * The {@code TypeCode} object is initialized with the given id, - * name, and original type. - * - * @param id the repository id for the alias - * @param name the name for the alias - * @param original_type - * the {@code TypeCode} object describing the original type - * for which this is an alias - * @return a newly-created {@code TypeCode} object describing - * an IDL {@code alias} - */ - abstract public TypeCode create_alias_tc(String id, String name, - TypeCode original_type); - - /** - * Creates a {@code TypeCode} object representing an IDL {@code exception}. - * The {@code TypeCode} object is initialized with the given id, - * name, and members. - * - * @param id the repository id for the {@code exception} - * @param name the name for the {@code exception} - * @param members an array describing the members of the {@code exception} - * @return a newly-created {@code TypeCode} object describing - * an IDL {@code exception} - */ - abstract public TypeCode create_exception_tc(String id, String name, - StructMember[] members); - - /** - * Creates a {@code TypeCode} object representing an IDL {@code interface}. - * The {@code TypeCode} object is initialized with the given id - * and name. - * - * @param id the repository id for the interface - * @param name the name for the interface - * @return a newly-created {@code TypeCode} object describing - * an IDL {@code interface} - */ - - abstract public TypeCode create_interface_tc(String id, String name); - - /** - * Creates a {@code TypeCode} object representing a bounded IDL - * {@code string}. - * The {@code TypeCode} object is initialized with the given bound, - * which represents the maximum length of the string. Zero indicates - * that the string described by this type code is unbounded. - * - * @param bound the bound for the {@code string}; cannot be negative - * @return a newly-created {@code TypeCode} object describing - * a bounded IDL {@code string} - * @exception BAD_PARAM if bound is a negative value - */ - - abstract public TypeCode create_string_tc(int bound); - - /** - * Creates a {@code TypeCode} object representing a bounded IDL - * {@code wstring} (wide string). - * The {@code TypeCode} object is initialized with the given bound, - * which represents the maximum length of the wide string. Zero indicates - * that the string described by this type code is unbounded. - * - * @param bound the bound for the {@code wstring}; cannot be negative - * @return a newly-created {@code TypeCode} object describing - * a bounded IDL {@code wstring} - * @exception BAD_PARAM if bound is a negative value - */ - abstract public TypeCode create_wstring_tc(int bound); - - /** - * Creates a {@code TypeCode} object representing an IDL {@code sequence}. - * The {@code TypeCode} object is initialized with the given bound and - * element type. - * - * @param bound the bound for the {@code sequence}, 0 if unbounded - * @param element_type the {@code TypeCode} object describing - * the elements contained in the {@code sequence} - * - * @return a newly-created {@code TypeCode} object describing - * an IDL {@code sequence} - */ - abstract public TypeCode create_sequence_tc(int bound, TypeCode element_type); - - /** - * Creates a {@code TypeCode} object representing a - * a recursive IDL {@code sequence}. - *

            - * For the IDL {@code struct} Node in following code fragment, - * the offset parameter for creating its sequence would be 1: - *

            -     *    Struct Node {
            -     *        long value;
            -     *        Sequence <Node> subnodes;
            -     *    };
            -     * 
            - * - * @param bound the bound for the sequence, 0 if unbounded - * @param offset the index to the enclosing {@code TypeCode} object - * that describes the elements of this sequence - * @return a newly-created {@code TypeCode} object describing - * a recursive sequence - * @deprecated Use a combination of create_recursive_tc and create_sequence_tc instead - * @see #create_recursive_tc(String) create_recursive_tc - * @see #create_sequence_tc(int, TypeCode) create_sequence_tc - */ - @Deprecated - abstract public TypeCode create_recursive_sequence_tc(int bound, int offset); - - /** - * Creates a {@code TypeCode} object representing an IDL {@code array}. - * The {@code TypeCode} object is initialized with the given length and - * element type. - * - * @param length the length of the {@code array} - * @param element_type a {@code TypeCode} object describing the type - * of element contained in the {@code array} - * @return a newly-created {@code TypeCode} object describing - * an IDL {@code array} - */ - abstract public TypeCode create_array_tc(int length, TypeCode element_type); - - /** - * Create a {@code TypeCode} object for an IDL native type. - * - * @param id the logical id for the native type. - * @param name the name of the native type. - * @return the requested TypeCode. - */ - public org.omg.CORBA.TypeCode create_native_tc(String id, - String name) - { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Create a {@code TypeCode} object for an IDL abstract interface. - * - * @param id the logical id for the abstract interface type. - * @param name the name of the abstract interface type. - * @return the requested TypeCode. - */ - public org.omg.CORBA.TypeCode create_abstract_interface_tc( - String id, - String name) - { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - - /** - * Create a {@code TypeCode} object for an IDL fixed type. - * - * @param digits specifies the total number of decimal digits in the number - * and must be from 1 to 31 inclusive. - * @param scale specifies the position of the decimal point. - * @return the requested TypeCode. - */ - public org.omg.CORBA.TypeCode create_fixed_tc(short digits, short scale) - { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - - // orbos 98-01-18: Objects By Value -- begin - - - /** - * Create a {@code TypeCode} object for an IDL value type. - * The concrete_base parameter is the TypeCode for the immediate - * concrete valuetype base of the valuetype for which the TypeCode - * is being created. - * It may be null if the valuetype does not have a concrete base. - * - * @param id the logical id for the value type. - * @param name the name of the value type. - * @param type_modifier one of the value type modifier constants: - * VM_NONE, VM_CUSTOM, VM_ABSTRACT or VM_TRUNCATABLE - * @param concrete_base a {@code TypeCode} object - * describing the concrete valuetype base - * @param members an array containing the members of the value type - * @return the requested TypeCode - */ - public org.omg.CORBA.TypeCode create_value_tc(String id, - String name, - short type_modifier, - TypeCode concrete_base, - ValueMember[] members) - { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Create a recursive {@code TypeCode} object which - * serves as a placeholder for a concrete TypeCode during the process of creating - * TypeCodes which contain recursion. The id parameter specifies the repository id of - * the type for which the recursive TypeCode is serving as a placeholder. Once the - * recursive TypeCode has been properly embedded in the enclosing TypeCode which - * corresponds to the specified repository id, it will function as a normal TypeCode. - * Invoking operations on the recursive TypeCode before it has been embedded in the - * enclosing TypeCode will result in a {@code BAD_TYPECODE} exception. - *

            - * For example, the following IDL type declaration contains recursion: - *

            -     *    Struct Node {
            -     *        Sequence<Node> subnodes;
            -     *    };
            -     * 
            - *

            - * To create a TypeCode for struct Node, you would invoke the TypeCode creation - * operations as shown below: - *

            -     * String nodeID = "IDL:Node:1.0";
            -     * TypeCode recursiveSeqTC = orb.create_sequence_tc(0, orb.create_recursive_tc(nodeID));
            -     * StructMember[] members = { new StructMember("subnodes", recursiveSeqTC, null) };
            -     * TypeCode structNodeTC = orb.create_struct_tc(nodeID, "Node", members);
            -     * 
            - *

            - * Also note that the following is an illegal IDL type declaration: - *

            -     *    Struct Node {
            -     *        Node next;
            -     *    };
            -     * 
            - *

            - * Recursive types can only appear within sequences which can be empty. - * That way marshaling problems, when transmitting the struct in an Any, are avoided. - * - * @param id the logical id of the referenced type - * @return the requested TypeCode - */ - public org.omg.CORBA.TypeCode create_recursive_tc(String id) { - // implemented in subclass - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Creates a {@code TypeCode} object for an IDL value box. - * - * @param id the logical id for the value type - * @param name the name of the value type - * @param boxed_type the TypeCode for the type - * @return the requested TypeCode - */ - public org.omg.CORBA.TypeCode create_value_box_tc(String id, - String name, - TypeCode boxed_type) - { - // implemented in subclass - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - // orbos 98-01-18: Objects By Value -- end - - /** - * Creates an IDL {@code Any} object initialized to - * contain a {@code Typecode} object whose {@code kind} field - * is set to {@code TCKind.tc_null}. - * - * @return a newly-created {@code Any} object - */ - abstract public Any create_any(); - - - - - /** - * Retrieves a {@code Current} object. - * The {@code Current} interface is used to manage thread-specific - * information for use by services such as transactions and security. - * - * @see CORBA package - * comments for unimplemented features - * - * @return a newly-created {@code Current} object - * @deprecated use {@code resolve_initial_references}. - */ - @Deprecated - public org.omg.CORBA.Current get_current() - { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * This operation blocks the current thread until the ORB has - * completed the shutdown process, initiated when some thread calls - * {@code shutdown}. It may be used by multiple threads which - * get all notified when the ORB shuts down. - * - */ - public void run() - { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Instructs the ORB to shut down, which causes all - * object adapters to shut down, in preparation for destruction.
            - * If the {@code wait_for_completion} parameter - * is true, this operation blocks until all ORB processing (including - * processing of currently executing requests, object deactivation, - * and other object adapter operations) has completed. - * If an application does this in a thread that is currently servicing - * an invocation, the {@code BAD_INV_ORDER} system exception - * will be thrown with the OMG minor code 3, - * since blocking would result in a deadlock.
            - * If the {@code wait_for_completion} parameter is {@code FALSE}, - * then shutdown may not have completed upon return.

            - * While the ORB is in the process of shutting down, the ORB operates as normal, - * servicing incoming and outgoing requests until all requests have been completed. - * Once an ORB has shutdown, only object reference management operations - * may be invoked on the ORB or any object reference obtained from it. - * An application may also invoke the {@code destroy} operation on the ORB itself. - * Invoking any other operation will throw the {@code BAD_INV_ORDER} - * system exception with the OMG minor code 4.

            - * The {@code ORB.run} method will return after - * {@code shutdown} has been called. - * - * @param wait_for_completion {@code true} if the call - * should block until the shutdown is complete; - * {@code false} if it should return immediately - * @throws org.omg.CORBA.BAD_INV_ORDER if the current thread is servicing - * an invocation - */ - public void shutdown(boolean wait_for_completion) - { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Returns {@code true} if the ORB needs the main thread to - * perform some work, and {@code false} if the ORB does not - * need the main thread. - * - * @return {@code true} if there is work pending, meaning that the ORB - * needs the main thread to perform some work; {@code false} - * if there is no work pending and thus the ORB does not need the - * main thread - * - */ - public boolean work_pending() - { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Performs an implementation-dependent unit of work if called - * by the main thread. Otherwise it does nothing. - * The methods {@code work_pending} and {@code perform_work} - * can be used in - * conjunction to implement a simple polling loop that multiplexes - * the main thread among the ORB and other activities. - * - */ - public void perform_work() - { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Used to obtain information about CORBA facilities and services - * that are supported by this ORB. The service type for which - * information is being requested is passed in as the in - * parameter {@code service_type}, the values defined by - * constants in the CORBA module. If service information is - * available for that type, that is returned in the out parameter - * {@code service_info}, and the operation returns the - * value {@code true}. If no information for the requested - * services type is available, the operation returns {@code false} - * (i.e., the service is not supported by this ORB). - * - * @param service_type a {@code short} indicating the - * service type for which information is being requested - * @param service_info a {@code ServiceInformationHolder} object - * that will hold the {@code ServiceInformation} object - * produced by this method - * @return {@code true} if service information is available - * for the {@code service_type}; - * {@code false} if no information for the - * requested services type is available - * @see CORBA package - * comments for unimplemented features - */ - public boolean get_service_information(short service_type, - ServiceInformationHolder service_info) - { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - // orbos 98-01-18: Objects By Value -- begin - - /** - * Creates a new {@code DynAny} object from the given - * {@code Any} object. - * - * @param value the {@code Any} object from which to create a new - * {@code DynAny} object - * @return the new {@code DynAny} object created from the given - * {@code Any} object - * @see CORBA package - * comments for unimplemented features - * @deprecated Use the new DynAnyFactory API instead - */ - @Deprecated - public org.omg.CORBA.DynAny create_dyn_any(org.omg.CORBA.Any value) - { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Creates a basic {@code DynAny} object from the given - * {@code TypeCode} object. - * - * @param type the {@code TypeCode} object from which to create a new - * {@code DynAny} object - * @return the new {@code DynAny} object created from the given - * {@code TypeCode} object - * @throws org.omg.CORBA.ORBPackage.InconsistentTypeCode if the given - * {@code TypeCode} object is not consistent with the operation. - * @see CORBA package - * comments for unimplemented features - * @deprecated Use the new DynAnyFactory API instead - */ - @Deprecated - public org.omg.CORBA.DynAny create_basic_dyn_any(org.omg.CORBA.TypeCode type) throws org.omg.CORBA.ORBPackage.InconsistentTypeCode - { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Creates a new {@code DynStruct} object from the given - * {@code TypeCode} object. - * - * @param type the {@code TypeCode} object from which to create a new - * {@code DynStruct} object - * @return the new {@code DynStruct} object created from the given - * {@code TypeCode} object - * @throws org.omg.CORBA.ORBPackage.InconsistentTypeCode if the given - * {@code TypeCode} object is not consistent with the operation. - * @see CORBA package - * comments for unimplemented features - * @deprecated Use the new DynAnyFactory API instead - */ - @Deprecated - public org.omg.CORBA.DynStruct create_dyn_struct(org.omg.CORBA.TypeCode type) throws org.omg.CORBA.ORBPackage.InconsistentTypeCode - { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Creates a new {@code DynSequence} object from the given - * {@code TypeCode} object. - * - * @param type the {@code TypeCode} object from which to create a new - * {@code DynSequence} object - * @return the new {@code DynSequence} object created from the given - * {@code TypeCode} object - * @throws org.omg.CORBA.ORBPackage.InconsistentTypeCode if the given - * {@code TypeCode} object is not consistent with the operation. - * @see CORBA package - * comments for unimplemented features - * @deprecated Use the new DynAnyFactory API instead - */ - @Deprecated - public org.omg.CORBA.DynSequence create_dyn_sequence(org.omg.CORBA.TypeCode type) throws org.omg.CORBA.ORBPackage.InconsistentTypeCode - { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - - /** - * Creates a new {@code DynArray} object from the given - * {@code TypeCode} object. - * - * @param type the {@code TypeCode} object from which to create a new - * {@code DynArray} object - * @return the new {@code DynArray} object created from the given - * {@code TypeCode} object - * @throws org.omg.CORBA.ORBPackage.InconsistentTypeCode if the given - * {@code TypeCode} object is not consistent with the operation. - * @see CORBA package - * comments for unimplemented features - * @deprecated Use the new DynAnyFactory API instead - */ - @Deprecated - public org.omg.CORBA.DynArray create_dyn_array(org.omg.CORBA.TypeCode type) throws org.omg.CORBA.ORBPackage.InconsistentTypeCode - { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Creates a new {@code DynUnion} object from the given - * {@code TypeCode} object. - * - * @param type the {@code TypeCode} object from which to create a new - * {@code DynUnion} object - * @return the new {@code DynUnion} object created from the given - * {@code TypeCode} object - * @throws org.omg.CORBA.ORBPackage.InconsistentTypeCode if the given - * {@code TypeCode} object is not consistent with the operation. - * @see CORBA package - * comments for unimplemented features - * @deprecated Use the new DynAnyFactory API instead - */ - @Deprecated - public org.omg.CORBA.DynUnion create_dyn_union(org.omg.CORBA.TypeCode type) throws org.omg.CORBA.ORBPackage.InconsistentTypeCode - { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Creates a new {@code DynEnum} object from the given - * {@code TypeCode} object. - * - * @param type the {@code TypeCode} object from which to create a new - * {@code DynEnum} object - * @return the new {@code DynEnum} object created from the given - * {@code TypeCode} object - * @throws org.omg.CORBA.ORBPackage.InconsistentTypeCode if the given - * {@code TypeCode} object is not consistent with the operation. - * @see CORBA package - * comments for unimplemented features - * @deprecated Use the new DynAnyFactory API instead - */ - @Deprecated - public org.omg.CORBA.DynEnum create_dyn_enum(org.omg.CORBA.TypeCode type) throws org.omg.CORBA.ORBPackage.InconsistentTypeCode - { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Can be invoked to create new instances of policy objects - * of a specific type with specified initial state. If - * {@code create_policy} fails to instantiate a new Policy - * object due to its inability to interpret the requested type - * and content of the policy, it raises the {@code PolicyError} - * exception with the appropriate reason. - * @param type the {@code PolicyType} of the policy object to - * be created - * @param val the value that will be used to set the initial - * state of the {@code Policy} object that is created - * @return Reference to a newly created {@code Policy} object - * of type specified by the {@code type} parameter and - * initialized to a state specified by the {@code val} - * parameter - * @throws org.omg.CORBA.PolicyError when the requested - * policy is not supported or a requested initial state - * for the policy is not supported. - */ - public org.omg.CORBA.Policy create_policy(int type, org.omg.CORBA.Any val) - throws org.omg.CORBA.PolicyError - { - // Currently not implemented until PIORB. - throw new org.omg.CORBA.NO_IMPLEMENT(); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ORBPackage/InconsistentTypeCode.java b/src/java.corba/share/classes/org/omg/CORBA/ORBPackage/InconsistentTypeCode.java deleted file mode 100644 index a608d824be3..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ORBPackage/InconsistentTypeCode.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package org.omg.CORBA.ORBPackage; - -/** - * InconsistentTypeCode is thrown when an attempt is made to create a - * dynamic any with a type code that does not match the particular - * subclass of DynAny. - */ -public final class InconsistentTypeCode - extends org.omg.CORBA.UserException { - /** - * Constructs an InconsistentTypeCode user exception - * with no reason message. - */ - public InconsistentTypeCode() { - super(); - } - - /** - * Constructs an InconsistentTypeCode user exception - * with the specified reason message. - * @param reason The String containing a reason message - */ - public InconsistentTypeCode(String reason) { - super(reason); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ORBPackage/InvalidName.java b/src/java.corba/share/classes/org/omg/CORBA/ORBPackage/InvalidName.java deleted file mode 100644 index 1079d95a5e9..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ORBPackage/InvalidName.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA.ORBPackage; - -/** - * The InvalidName exception is raised when - * ORB.resolve_initial_references is passed a name - * for which there is no initial reference. - * - * @see org.omg.CORBA.ORB#resolve_initial_references(String) - * @since JDK1.2 - */ - -final public class InvalidName extends org.omg.CORBA.UserException { - /** - * Constructs an InvalidName exception with no reason message. - */ - public InvalidName() { - super(); - } - - /** - * Constructs an InvalidName exception with the specified - * reason message. - * @param reason the String containing a reason message - */ - public InvalidName(String reason) { - super(reason); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ORBPackage/InvalidNameHelper.java b/src/java.corba/share/classes/org/omg/CORBA/ORBPackage/InvalidNameHelper.java deleted file mode 100644 index afb6dac4e54..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ORBPackage/InvalidNameHelper.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA.ORBPackage; - - -/** - * This Helper class is used to facilitate the marshalling of - * {@code ORBPackage/InvalidName}. - * For more information on Helper files, see - * - * "Generated Files: Helper Files". - */ - -abstract public class InvalidNameHelper -{ - private static String _id = "IDL:omg.org.CORBA/ORB/InvalidName:1.0"; - - public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.ORBPackage.InvalidName that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static org.omg.CORBA.ORBPackage.InvalidName extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - private static boolean __active = false; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - synchronized (org.omg.CORBA.TypeCode.class) - { - if (__typeCode == null) - { - if (__active) - { - return org.omg.CORBA.ORB.init().create_recursive_tc ( _id ); - } - __active = true; - org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [0]; - org.omg.CORBA.TypeCode _tcOf_members0 = null; - __typeCode = org.omg.CORBA.ORB.init ().create_exception_tc (org.omg.CORBA.ORBPackage.InvalidNameHelper.id (), "InvalidName", _members0); - __active = false; - } - } - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static org.omg.CORBA.ORBPackage.InvalidName read (org.omg.CORBA.portable.InputStream istream) - { - org.omg.CORBA.ORBPackage.InvalidName value = new org.omg.CORBA.ORBPackage.InvalidName (); - // read and discard the repository ID - istream.read_string (); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.ORBPackage.InvalidName value) - { - // write the repository ID - ostream.write_string (id ()); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ORBPackage/package.html b/src/java.corba/share/classes/org/omg/CORBA/ORBPackage/package.html deleted file mode 100644 index 7fcb5e857a3..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ORBPackage/package.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - -Provides the exception InvalidName, which is thrown -by the method ORB.resolve_initial_references -and the exception InconsistentTypeCode, which is thrown -by the Dynamic Any creation methods in the ORB class. - - -

            Related Documentation

            - -For an overview, please see: - - - -@since JDK1.2 -@serial exclude - - diff --git a/src/java.corba/share/classes/org/omg/CORBA/Object.java b/src/java.corba/share/classes/org/omg/CORBA/Object.java deleted file mode 100644 index 7875dd99138..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/Object.java +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * The definition for a CORBA object reference. - *

            - * A CORBA object reference is a handle for a particular - * CORBA object implemented by a server. A CORBA object reference - * identifies the same CORBA object each time the reference is used to invoke - * a method on the object. - * A CORBA object may have multiple, distinct object references. - *

            - * The org.omg.CORBA.Object interface is the root of - * the inheritance hierarchy for all CORBA object references in the Java - * programming language, analogous to java.rmi.Remote - * for RMI remote objects. - *

            - * A CORBA object may be either local or remote. - * If it is a local object (that is, running in the same - * VM as the client), invocations may be directly serviced by - * the object instance, and the object reference could point to the actual - * instance of the object implementation class. - * If a CORBA object is a remote object (that is, running in a different - * VM from the client), the object reference points to a stub (proxy) which uses the - * ORB machinery to make a remote invocation on the server where the object - * implementation resides. - *

            - * Default implementations of the methods in the interface - * org.omg.CORBA.Object - * are provided in the class org.omg.CORBA.portable.ObjectImpl, - * which is the base class for stubs and object implementations. - * - * @see org.omg.CORBA.portable.ObjectImpl - */ - -public interface Object { - - /** - * Checks whether this object is an instance of a class that - * implements the given interface. - * - * @param repositoryIdentifier the interface to check against - * @return true if this object reference is an instance - * of a class that implements the interface; - * false otherwise - */ - boolean _is_a(String repositoryIdentifier); - - - /** - * Determines whether the two object references are equivalent, - * so far as the ORB can easily determine. Two object references are equivalent - * if they are identical. Two distinct object references which in fact refer to - * the same object are also equivalent. However, ORBs are not required - * to attempt determination of whether two distinct object references - * refer to the same object, since such determination could be impractically - * expensive. - * @param other the other object reference with which to check for equivalence - * @return true if this object reference is known to be - * equivalent to the given object reference. - * Note that false indicates only that the two - * object references are distinct, not necessarily that - * they reference distinct objects. - */ - boolean _is_equivalent(org.omg.CORBA.Object other); - - - /** - * Determines whether the server object for this object reference has been - * destroyed. - * @return true if the ORB knows authoritatively that the - * server object does not exist; false otherwise - */ - boolean _non_existent(); - - - /** - * Returns an ORB-internal identifier for this object reference. - * This is a hash identifier, which does - * not change during the lifetime of the object reference, and so - * neither will any hash function of that identifier change. The value returned - * is not guaranteed to be unique; in other words, another object - * reference may have the same hash value. - * If two object references hash differently, - * then they are distinct object references; however, both may still refer - * to the same CORBA object. - * - * @param maximum the upper bound on the hash value returned by the ORB - * @return the ORB-internal hash identifier for this object reference - */ - int _hash(int maximum); - - - /** - * Returns a duplicate of this CORBA object reference. - * The server object implementation is not involved in creating - * the duplicate, and the implementation cannot distinguish whether - * the original object reference or a duplicate was used to make a request. - *

            - * Note that this method is not very useful in the Java platform, - * since memory management is handled by the VM. - * It is included for compliance with the CORBA APIs. - *

            - * The method _duplicate may return this object reference itself. - * - * @return a duplicate of this object reference or this object reference - * itself - */ - org.omg.CORBA.Object _duplicate(); - - - /** - * Signals that the caller is done using this object reference, so - * internal ORB resources associated with this object reference can be - * released. Note that the object implementation is not involved in - * this operation, and other references to the same object are not affected. - */ - void _release(); - - - /** - * Obtains an InterfaceDef for the object implementation - * referenced by this object reference. - * The InterfaceDef object - * may be used to introspect on the methods, attributes, and other - * type information for the object referred to by this object reference. - * - * @return the InterfaceDef object in the Interface Repository - * which provides type information about the object referred to by - * this object reference - */ - org.omg.CORBA.Object _get_interface_def(); - - - - /** - * Creates a Request instance for use in the - * Dynamic Invocation Interface. - * - * @param operation the name of the method to be invoked using the - * Request instance - * @return the newly-created Request instance - */ - Request _request(String operation); - - - - /** - * Creates a Request instance initialized with the - * given context, method name, list of arguments, and container - * for the method's return value. - * - * @param ctx a Context object containing - * a list of properties - * @param operation the name of the method to be invoked - * @param arg_list an NVList containing the actual arguments - * to the method being invoked - * @param result a NamedValue object to serve as a - * container for the method's return value - * @return the newly-created Request object - * - * @see Request - * @see NVList - * @see NamedValue - */ - - Request _create_request(Context ctx, - String operation, - NVList arg_list, - NamedValue result); - - /** - * Creates a Request instance initialized with the - * given context, method name, list of arguments, container - * for the method's return value, list of possible exceptions, - * and list of context strings needing to be resolved. - * - * @param ctx a Context object containing - * a list of properties - * @param operation the name of the method to be invoked - * @param arg_list an NVList containing the actual arguments - * to the method being invoked - * @param result a NamedValue object to serve as a - * container for the method's return value - * @param exclist an ExceptionList object containing a - * list of possible exceptions the method can throw - * @param ctxlist a ContextList object containing a list of - * context strings that need to be resolved and sent with the - * Request instance - * @return the newly-created Request object - * - * @see Request - * @see NVList - * @see NamedValue - * @see ExceptionList - * @see ContextList - */ - - Request _create_request(Context ctx, - String operation, - NVList arg_list, - NamedValue result, - ExceptionList exclist, - ContextList ctxlist); - - - - - /** - * Returns the Policy object of the specified type - * which applies to this object. - * - * @param policy_type the type of policy to be obtained - * @return A Policy object of the type specified by - * the policy_type parameter - * @exception org.omg.CORBA.BAD_PARAM when the value of policy type - * is not valid either because the specified type is not supported by this - * ORB or because a policy object of that type is not associated with this - * Object - */ - Policy _get_policy(int policy_type); - - - /** - * Retrieves the DomainManagers of this object. - * This allows administration services (and applications) to retrieve the - * domain managers, and hence the security and other policies applicable - * to individual objects that are members of the domain. - * - * @return the list of immediately enclosing domain managers of this object. - * At least one domain manager is always returned in the list since by - * default each object is associated with at least one domain manager at - * creation. - */ - DomainManager[] _get_domain_managers(); - - - /** - * Returns a new Object with the given policies - * either replacing any existing policies in this - * Object or with the given policies added - * to the existing ones, depending on the value of the - * given SetOverrideType object. - * - * @param policies an array of Policy objects containing - * the policies to be added or to be used as replacements - * @param set_add either SetOverrideType.SET_OVERRIDE, indicating - * that the given policies will replace any existing ones, or - * SetOverrideType.ADD_OVERRIDE, indicating that - * the given policies should be added to any existing ones - * @return a new Object with the given policies replacing - * or added to those in this Object - */ - org.omg.CORBA.Object _set_policy_override(Policy[] policies, - SetOverrideType set_add); - - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ObjectHelper.java b/src/java.corba/share/classes/org/omg/CORBA/ObjectHelper.java deleted file mode 100644 index 85aa169c32d..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ObjectHelper.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/** - * The Helper for {@code Object}. For more information on - * Helper files, see - * "Generated Files: Helper Files".

            - */ - -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package org.omg.CORBA; - -abstract public class ObjectHelper -{ - private static String _id = ""; - - public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.Object that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static org.omg.CORBA.Object extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (TCKind.tk_objref); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static org.omg.CORBA.Object read (org.omg.CORBA.portable.InputStream istream) - { - return istream.read_Object (); - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.Object value) - { - ostream.write_Object (value); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ObjectHolder.java b/src/java.corba/share/classes/org/omg/CORBA/ObjectHolder.java deleted file mode 100644 index f83f3b3aa1b..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ObjectHolder.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 1996, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -import org.omg.CORBA.portable.Streamable; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; - - -/** - * The Holder for {@code Object}. For more information on - * Holder files, see - * "Generated Files: Holder Files".

            - * A Holder class for a CORBA object reference (a value of type - * {@code org.omg.CORBA.Object}). It is usually - * used to store "out" and "inout" parameters in IDL methods. - * If an IDL method signature has a CORBA Object reference as an "out" - * or "inout" parameter, the programmer must pass an instance of - * {@code ObjectHolder} as the corresponding - * parameter in the method invocation; for "inout" parameters, the programmer - * must also fill the "in" value to be sent to the server. - * Before the method invocation returns, the ORB will fill in the - * value corresponding to the "out" value returned from the server. - *

            - * If {@code myObjectHolder} is an instance of {@code ObjectHolder}, - * the value stored in its {@code value} field can be accessed with - * {@code myObjectHolder.value}. - * - * @since JDK1.2 - */ -public final class ObjectHolder implements Streamable { - /** - * The {@code Object} value held by this {@code ObjectHolder} - * object. - */ - public Object value; - - /** - * Constructs a new {@code ObjectHolder} object with its - * {@code value} field initialized to {@code null}. - */ - public ObjectHolder() { - } - - /** - * Constructs a new {@code ObjectHolder} object with its - * {@code value} field initialized to the given - * {@code Object}. - * @param initial the {@code Object} with which to initialize - * the {@code value} field of the newly-created - * {@code ObjectHolder} object - */ - public ObjectHolder(Object initial) { - value = initial; - } - - /** - * Reads from {@code input} and initalizes the value in - * this {@code ObjectHolder} object - * with the unmarshalled data. - * - * @param input the InputStream containing CDR formatted data from the wire. - */ - public void _read(InputStream input) { - value = input.read_Object(); - } - - /** - * Marshals to {@code output} the value in - * this {@code ObjectHolder} object. - * - * @param output the OutputStream which will contain the CDR formatted data. - */ - public void _write(OutputStream output) { - output.write_Object(value); - } - - /** - * Returns the TypeCode corresponding to the value held in - * this {@code ObjectHolder} object - * - * @return the TypeCode of the value held in - * this {@code ObjectHolder} object - */ - public org.omg.CORBA.TypeCode _type() { - return org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_objref); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/OctetSeqHelper.java b/src/java.corba/share/classes/org/omg/CORBA/OctetSeqHelper.java deleted file mode 100644 index ca03a6a9f6c..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/OctetSeqHelper.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Helper for {@code OctetSeq}. For more information on - * Helper files, see - * "Generated Files: Helper Files".

            - * org/omg/CORBA/OctetSeqHelper.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from streams.idl - * 13 May 1999 22:41:36 o'clock GMT+00:00 - * - * The class definition has been modified to conform to the following - * OMG specifications : - *

              - *
            • ORB core as defined by CORBA 2.3.1 - * (formal/99-10-07) - *
            • - * - *
            • IDL/Java Language Mapping as defined in - * ptc/00-01-08 - *
            • - *
            - */ - -public abstract class OctetSeqHelper -{ - private static String _id = "IDL:omg.org/CORBA/OctetSeq:1.0"; - - public static void insert (org.omg.CORBA.Any a, byte[] that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static byte[] extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_octet); - __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.OctetSeqHelper.id (), "OctetSeq", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static byte[] read (org.omg.CORBA.portable.InputStream istream) - { - byte value[] = null; - int _len0 = istream.read_long (); - value = new byte[_len0]; - istream.read_octet_array (value, 0, _len0); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, byte[] value) - { - ostream.write_long (value.length); - ostream.write_octet_array (value, 0, value.length); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/OctetSeqHolder.java b/src/java.corba/share/classes/org/omg/CORBA/OctetSeqHolder.java deleted file mode 100644 index 868aaddac86..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/OctetSeqHolder.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Holder for {@code OctetSeq}. For more information on - * Holder files, see - * "Generated Files: Holder Files".

            - * org/omg/CORBA/OctetSeqHolder.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from streams.idl - * 13 May 1999 22:41:36 o'clock GMT+00:00 - */ - -public final class OctetSeqHolder implements org.omg.CORBA.portable.Streamable -{ - public byte value[] = null; - - public OctetSeqHolder () - { - } - - public OctetSeqHolder (byte[] initialValue) - { - value = initialValue; - } - - public void _read (org.omg.CORBA.portable.InputStream i) - { - value = org.omg.CORBA.OctetSeqHelper.read (i); - } - - public void _write (org.omg.CORBA.portable.OutputStream o) - { - org.omg.CORBA.OctetSeqHelper.write (o, value); - } - - public org.omg.CORBA.TypeCode _type () - { - return org.omg.CORBA.OctetSeqHelper.type (); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/PERSIST_STORE.java b/src/java.corba/share/classes/org/omg/CORBA/PERSIST_STORE.java deleted file mode 100644 index 00eff183183..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/PERSIST_STORE.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * This exception indicates a persistent storage failure, for example, - * failure to establish a database connection or corruption of a - * database.

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - */ - -public final class PERSIST_STORE extends SystemException { - /** - * Constructs a PERSIST_STORE exception with a default minor code - * of 0, a completion state of CompletionStatus.COMPLETED_NO, - * and a null description. - */ - public PERSIST_STORE() { - this(""); - } - - /** - * Constructs a PERSIST_STORE exception with the specified description message, - * a minor code of 0, and a completion state of COMPLETED_NO. - * @param s the String containing a detail message - */ - public PERSIST_STORE(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs a PERSIST_STORE exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed the completion status - */ - public PERSIST_STORE(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs a PERSIST_STORE exception with the specified description - * message, minor code, and completion status. - * @param s the String containing a description message - * @param minor the minor code - * @param completed the completion status - */ - public PERSIST_STORE(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/PRIVATE_MEMBER.java b/src/java.corba/share/classes/org/omg/CORBA/PRIVATE_MEMBER.java deleted file mode 100644 index d0ac2393ecf..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/PRIVATE_MEMBER.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * File: ./org/omg/CORBA/PRIVATE_MEMBER.java - * From: ./ir.idl - * Date: Fri Aug 28 16:03:31 1998 - * By: idltojava Java IDL 1.2 Aug 11 1998 02:00:18 - */ - -package org.omg.CORBA; - -/** - * Constant to define a private member in the ValueMember class. - *

            - * PRIVATE_MEMBER is one of the two constants of typedef - * Visibility used in the interface repository - * to identify visibility of a ValueMember type. - * The other constant is PUBLIC_MEMBER. - * - * @author unattributed - */ -public interface PRIVATE_MEMBER { - final short value = (short) (0L); -}; diff --git a/src/java.corba/share/classes/org/omg/CORBA/PUBLIC_MEMBER.java b/src/java.corba/share/classes/org/omg/CORBA/PUBLIC_MEMBER.java deleted file mode 100644 index c7701fd7334..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/PUBLIC_MEMBER.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * File: ./org/omg/CORBA/PUBLIC_MEMBER.java - * From: ./ir.idl - * Date: Fri Aug 28 16:03:31 1998 - * By: idltojava Java IDL 1.2 Aug 11 1998 02:00:18 - */ - -package org.omg.CORBA; - -/** - * Constant to define a public member in the ValueMember - * class. - *

            - * PUBLIC_MEMBER is one of the two constants of typedef - * Visibility used in the interface repository - * to identify visibility of a ValueMember type. - * The other constant is PRIVATE_MEMBER. - * - * @author unattributed - */ -public interface PUBLIC_MEMBER { - final short value = (short) (1L); -}; diff --git a/src/java.corba/share/classes/org/omg/CORBA/Policy.java b/src/java.corba/share/classes/org/omg/CORBA/Policy.java deleted file mode 100644 index 9fc9bef4952..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/Policy.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * Interfaces derived from the {@code Policy} interface allow an - * ORB or CORBA service access to certain choices that affect - * its operation. This information is accessed in a structured - * manner using interfaces derived from the {@code Policy} - * interface defined in the CORBA module. A CORBA service does not - * have to use this method of accessing operating options, but - * may choose to do so. The Security Service in particular uses - * this technique for associating Security Policy with objects - * in the system. - * An interface generated by the IDL-to-Java compiler. - * org/omg/CORBA/Policy.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl - * Saturday, July 17, 1999 12:26:20 AM PDT - */ - -public interface Policy extends PolicyOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity -{ -} // interface Policy diff --git a/src/java.corba/share/classes/org/omg/CORBA/PolicyError.java b/src/java.corba/share/classes/org/omg/CORBA/PolicyError.java deleted file mode 100644 index d95f6d72039..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/PolicyError.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** -* A user exception thrown when a policy error occurs. A PolicyError -* exception may include one of the following policy error reason codes -* defined in the org.omg.CORBA package: BAD_POLICY, BAD_POLICY_TYPE, -* BAD_POLICY_VALUE, UNSUPPORTED_POLICY, UNSUPPORTED_POLICY_VALUE. -*/ - -public final class PolicyError extends org.omg.CORBA.UserException { - - /** - * The reason for the PolicyError exception being thrown. - * @serial - */ - public short reason; - - /** - * Constructs a default PolicyError user exception - * with no reason code and an empty reason detail message. - */ - public PolicyError() { - super(); - } - - /** - * Constructs a PolicyError user exception - * initialized with the given reason code and an empty reason detail message. - * @param __reason the reason code. - */ - public PolicyError(short __reason) { - super(); - reason = __reason; - } - - /** - * Constructs a PolicyError user exception - * initialized with the given reason detail message and reason code. - * @param reason_string the reason detail message. - * @param __reason the reason code. - */ - public PolicyError(String reason_string, short __reason) { - super(reason_string); - reason = __reason; - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/PolicyHelper.java b/src/java.corba/share/classes/org/omg/CORBA/PolicyHelper.java deleted file mode 100644 index a775affbc85..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/PolicyHelper.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Helper for {@code Policy}. For more information on - * Helper files, see - * "Generated Files: Helper Files".

            - * org/omg/CORBA/PolicyHelper.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl - * Saturday, July 17, 1999 12:26:20 AM PDT - */ - -abstract public class PolicyHelper -{ - private static String _id = "IDL:omg.org/CORBA/Policy:1.0"; - - public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.Policy that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static org.omg.CORBA.Policy extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (org.omg.CORBA.PolicyHelper.id (), "Policy"); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static org.omg.CORBA.Policy read (org.omg.CORBA.portable.InputStream istream) - { - return narrow (istream.read_Object (_PolicyStub.class)); - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.Policy value) - { - ostream.write_Object ((org.omg.CORBA.Object) value); - } - - public static org.omg.CORBA.Policy narrow (org.omg.CORBA.Object obj) - { - if (obj == null) - return null; - else if (obj instanceof org.omg.CORBA.Policy) - return (org.omg.CORBA.Policy)obj; - else if (!obj._is_a (id ())) - throw new org.omg.CORBA.BAD_PARAM (); - else - { - org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate (); - return new org.omg.CORBA._PolicyStub (delegate); - } - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/PolicyHolder.java b/src/java.corba/share/classes/org/omg/CORBA/PolicyHolder.java deleted file mode 100644 index 0d395d4c9fe..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/PolicyHolder.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - -/** - * The Holder for {@code Policy}. For more information on - * Holder files, see - * "Generated Files: Holder Files".

            - * org/omg/CORBA/PolicyHolder.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl - * Saturday, July 17, 1999 12:26:20 AM PDT - */ - -public final class PolicyHolder implements org.omg.CORBA.portable.Streamable -{ - public org.omg.CORBA.Policy value = null; - - public PolicyHolder () - { - } - - public PolicyHolder (org.omg.CORBA.Policy initialValue) - { - value = initialValue; - } - - public void _read (org.omg.CORBA.portable.InputStream i) - { - value = org.omg.CORBA.PolicyHelper.read (i); - } - - public void _write (org.omg.CORBA.portable.OutputStream o) - { - org.omg.CORBA.PolicyHelper.write (o, value); - } - - public org.omg.CORBA.TypeCode _type () - { - return org.omg.CORBA.PolicyHelper.type (); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/PolicyListHelper.java b/src/java.corba/share/classes/org/omg/CORBA/PolicyListHelper.java deleted file mode 100644 index 8877c68ea1f..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/PolicyListHelper.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Helper for {@code PolicyList}. For more information on - * Helper files, see - * "Generated Files: Helper Files".

            - * org/omg/CORBA/PolicyListHelper.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl - * Saturday, July 17, 1999 12:26:21 AM PDT - */ - -abstract public class PolicyListHelper -{ - private static String _id = "IDL:omg.org/CORBA/PolicyList:1.0"; - - public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.Policy[] that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static org.omg.CORBA.Policy[] extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.PolicyHelper.type (); - __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.PolicyListHelper.id (), "PolicyList", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static org.omg.CORBA.Policy[] read (org.omg.CORBA.portable.InputStream istream) - { - org.omg.CORBA.Policy value[] = null; - int _len0 = istream.read_long (); - value = new org.omg.CORBA.Policy[_len0]; - for (int _o1 = 0;_o1 < value.length; ++_o1) - value[_o1] = org.omg.CORBA.PolicyHelper.read (istream); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.Policy[] value) - { - ostream.write_long (value.length); - for (int _i0 = 0;_i0 < value.length; ++_i0) - org.omg.CORBA.PolicyHelper.write (ostream, value[_i0]); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/PolicyListHolder.java b/src/java.corba/share/classes/org/omg/CORBA/PolicyListHolder.java deleted file mode 100644 index 5eb11026896..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/PolicyListHolder.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Holder for {@code PolicyList}. For more information on - * Holder files, see - * "Generated Files: Holder Files".

            - * org/omg/CORBA/PolicyListHolder.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl - * Saturday, July 17, 1999 12:26:21 AM PDT - */ - -public final class PolicyListHolder implements org.omg.CORBA.portable.Streamable -{ - public org.omg.CORBA.Policy value[] = null; - - public PolicyListHolder () - { - } - - public PolicyListHolder (org.omg.CORBA.Policy[] initialValue) - { - value = initialValue; - } - - public void _read (org.omg.CORBA.portable.InputStream i) - { - value = org.omg.CORBA.PolicyListHelper.read (i); - } - - public void _write (org.omg.CORBA.portable.OutputStream o) - { - org.omg.CORBA.PolicyListHelper.write (o, value); - } - - public org.omg.CORBA.TypeCode _type () - { - return org.omg.CORBA.PolicyListHelper.type (); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/PolicyOperations.java b/src/java.corba/share/classes/org/omg/CORBA/PolicyOperations.java deleted file mode 100644 index 305066f3df1..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/PolicyOperations.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The interface for {@code Policy}. For more information on - * Operations interfaces, see - * "Generated Files: Operations files". - *

            - * org/omg/CORBA/PolicyOperations.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl - * Saturday, July 17, 1999 12:26:20 AM PDT - */ - -/** - * Provides the operations for a {@code Policy} object. - */ -public interface PolicyOperations -{ - - /** - * Returns the constant value that corresponds to the - * type of the policy object. The values of - * the policy objects are allocated by the OMG. - * New values for PolicyType should be obtained from the OMG by - * sending mail to request@omg.org. In general the constant - * values that are allocated are defined in conjunction with - * the definition of the corresponding policy object. - * - * @return the constant value that corresponds to the type of - * the policy object - */ - int policy_type (); - - /** - * Returns a copy of the {@code Policy} object. The copy does not retain - * any relationships that the policy had with any domain or object. - * - * @return a copy of the {@code Policy} object - */ - org.omg.CORBA.Policy copy (); - - /** - * Destroys the {@code Policy} object. It is the responsibility of - * the {@code Policy} object to determine whether it can be destroyed. - */ - void destroy (); -} // interface PolicyOperations diff --git a/src/java.corba/share/classes/org/omg/CORBA/PolicyTypeHelper.java b/src/java.corba/share/classes/org/omg/CORBA/PolicyTypeHelper.java deleted file mode 100644 index f58c932bd51..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/PolicyTypeHelper.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Helper for {@code PolicyType}. For more information on - * Helper files, see - * "Generated Files: Helper Files".

            - * org/omg/CORBA/PolicyTypeHelper.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl - * Saturday, July 17, 1999 12:26:20 AM PDT - */ - - -// basic Policy definition -abstract public class PolicyTypeHelper -{ - private static String _id = "IDL:omg.org/CORBA/PolicyType:1.0"; - - public static void insert (org.omg.CORBA.Any a, int that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static int extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ulong); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.PolicyTypeHelper.id (), "PolicyType", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static int read (org.omg.CORBA.portable.InputStream istream) - { - int value = (int)0; - value = istream.read_ulong (); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, int value) - { - ostream.write_ulong (value); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/Principal.java b/src/java.corba/share/classes/org/omg/CORBA/Principal.java deleted file mode 100644 index f8459706fdc..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/Principal.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - - -/** - * A class that contains information about the identity of - * the client, for access control - * and other purposes. It contains a single attribute, the name of the - * Principal, encoded as a sequence of bytes. - * - * @deprecated Deprecated by CORBA 2.2. - */ -@Deprecated -public class Principal { - /** - * Sets the name of this Principal object to the given value. - * @param value the value to be set in the Principal - * @deprecated Deprecated by CORBA 2.2. - */ - @Deprecated - public void name(byte[] value) { - throw new org.omg.CORBA.NO_IMPLEMENT() ; - } - - /** - * Gets the name of this Principal object. - * @return the name of this Principal object - * @deprecated Deprecated by CORBA 2.2. - */ - @Deprecated - public byte[] name() { - throw new org.omg.CORBA.NO_IMPLEMENT() ; - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/PrincipalHolder.java b/src/java.corba/share/classes/org/omg/CORBA/PrincipalHolder.java deleted file mode 100644 index a8df7fed76d..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/PrincipalHolder.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 1996, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -import org.omg.CORBA.portable.Streamable; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; - - -/** - * The Holder for {@code Principal}. For more information on - * Holder files, see - * "Generated Files: Holder Files".

            - * A container class for values of type {@code Principal} - * that is used to store "out" and "inout" parameters in IDL methods. - * If an IDL method signature has an IDL {@code Principal} as an "out" - * or "inout" parameter, the programmer must pass an instance of - * {@code PrincipalHolder} as the corresponding - * parameter in the method invocation; for "inout" parameters, the programmer - * must also fill the "in" value to be sent to the server. - * Before the method invocation returns, the ORB will fill in the - * value corresponding to the "out" value returned from the server. - *

            - * If {@code myPrincipalHolder} is an instance of {@code PrincipalHolder}, - * the value stored in its {@code value} field can be accessed with - * {@code myPrincipalHolder.value}. - * - * @since JDK1.2 - * @deprecated Deprecated by CORBA 2.2. - */ -@Deprecated -public final class PrincipalHolder implements Streamable { - /** - * The {@code Principal} value held by this {@code PrincipalHolder} - * object. - */ - public Principal value; - - /** - * Constructs a new {@code PrincipalHolder} object with its - * {@code value} field initialized to {@code null}. - */ - public PrincipalHolder() { - } - - /** - * Constructs a new {@code PrincipalHolder} object with its - * {@code value} field initialized to the given - * {@code Principal} object. - * @param initial the {@code Principal} with which to initialize - * the {@code value} field of the newly-created - * {@code PrincipalHolder} object - */ - public PrincipalHolder(Principal initial) { - value = initial; - } - - public void _read(InputStream input) { - value = input.read_Principal(); - } - - public void _write(OutputStream output) { - output.write_Principal(value); - } - - public org.omg.CORBA.TypeCode _type() { - return ORB.init().get_primitive_tc(TCKind.tk_Principal); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/REBIND.java b/src/java.corba/share/classes/org/omg/CORBA/REBIND.java deleted file mode 100644 index 6692b725fed..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/REBIND.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * REBIND is raised when the current effective RebindPolicy, - * has a value of NO_REBIND or NO_RECONNECT and an invocation on a bound - * object reference results in a LocateReply message with status - * OBJECT_FORWARD or a Reply message with status LOCATION_FORWARD. - * This exception is also raised if the current effective RebindPolicy has - * a value of NO_RECONNECT and a connection must be reopened. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since J2SE 1.5 - */ - -public final class REBIND extends SystemException { - - /** - * Constructs an REBIND exception with - * minor code set to 0 and CompletionStatus set to COMPLETED_NO. - */ - public REBIND() { - this(""); - } - - /** - * Constructs an REBIND exception with the - * specified message. - * - * @param detailMessage string containing a detailed message. - */ - public REBIND(String detailMessage) { - this(detailMessage, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs an REBIND exception with the - * specified minor code and completion status. - * - * @param minorCode minor code. - * @param completionStatus completion status. - */ - public REBIND(int minorCode, - CompletionStatus completionStatus) { - this("", minorCode, completionStatus); - } - - /** - * Constructs an REBIND exception with the - * specified message, minor code, and completion status. - * - * @param detailMessage string containing a detailed message. - * @param minorCode minor code. - * @param completionStatus completion status. - */ - public REBIND(String detailMessage, - int minorCode, - CompletionStatus completionStatus) { - super(detailMessage, minorCode, completionStatus); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/RepositoryIdHelper.java b/src/java.corba/share/classes/org/omg/CORBA/RepositoryIdHelper.java deleted file mode 100644 index a3ad94fd0ec..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/RepositoryIdHelper.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** - * The Helper for {@code RepositoryId}. For more information on - * Helper files, see - * "Generated Files: Helper Files".

            - * - * org/omg/CORBA/RepositoryIdHelper.java - * Generated by the IDL-to-Java compiler (portable), version "3.0" - * from ir.idl - * 03 June 1999 11:33:43 o'clock GMT+00:00 - */ - -abstract public class RepositoryIdHelper -{ - private static String _id = "IDL:omg.org/CORBA/RepositoryId:1.0"; - - public static void insert (org.omg.CORBA.Any a, String that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static String extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_string_tc (0); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.RepositoryIdHelper.id (), "RepositoryId", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static String read (org.omg.CORBA.portable.InputStream istream) - { - String value = null; - value = istream.read_string (); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, String value) - { - ostream.write_string (value); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/Request.java b/src/java.corba/share/classes/org/omg/CORBA/Request.java deleted file mode 100644 index 51667c815aa..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/Request.java +++ /dev/null @@ -1,301 +0,0 @@ -/* - * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * An object containing the information necessary for - * invoking a method. This class is - * the cornerstone of the ORB Dynamic - * Invocation Interface (DII), which allows dynamic creation and - * invocation of requests. - * A server cannot tell the difference between a client - * invocation using a client stub and a request using the DII. - *

            - * A Request object consists of: - *

              - *
            • the name of the operation to be invoked - *
            • an NVList containing arguments for the operation.
              - * Each item in the list is a NamedValue object, which has three - * parts: - *
                - *
              1. the name of the argument - *
              2. the value of the argument (as an Any object) - *
              3. the argument mode flag indicating whether the argument is - * for input, output, or both - *
              - *
            - *

            - * Request objects may also contain additional information, - * depending on how an operation was defined in the original IDL - * interface definition. For example, where appropriate, they may contain - * a NamedValue object to hold the return value or exception, - * a context, a list of possible exceptions, and a list of - * context strings that need to be resolved. - *

            - * New Request objects are created using one of the - * create_request methods in the Object class. - * In other words, a create_request method is performed on the - * object which is to be invoked. - * - * @see org.omg.CORBA.NamedValue - * - */ - -public abstract class Request { - - /** - * Retrieves the the target object reference. - * - * @return the object reference that points to the - * object implementation for the method - * to be invoked - */ - - public abstract org.omg.CORBA.Object target(); - - /** - * Retrieves the name of the method to be invoked. - * - * @return the name of the method to be invoked - */ - - public abstract String operation(); - - /** - * Retrieves the NVList object containing the arguments - * to the method being invoked. The elements in the list are - * NamedValue objects, with each one describing an argument - * to the method. - * - * @return the NVList object containing the arguments - * for the method - * - */ - - public abstract NVList arguments(); - - /** - * Retrieves the NamedValue object containing the return - * value for the method. - * - * @return the NamedValue object containing the result - * of the method - */ - - public abstract NamedValue result(); - - /** - * Retrieves the Environment object for this request. - * It contains the exception that the method being invoked has - * thrown (after the invocation returns). - * - * - * @return the Environment object for this request - */ - - public abstract Environment env(); - - /** - * Retrieves the ExceptionList object for this request. - * This list contains TypeCode objects describing the - * exceptions that may be thrown by the method being invoked. - * - * @return the ExceptionList object describing the exceptions - * that may be thrown by the method being invoked - */ - - public abstract ExceptionList exceptions(); - - /** - * Retrieves the ContextList object for this request. - * This list contains context Strings that need to - * be resolved and sent with the invocation. - * - * - * @return the list of context strings whose values - * need to be resolved and sent with the - * invocation. - */ - - public abstract ContextList contexts(); - - /** - * Retrieves the Context object for this request. - * This is a list of properties giving information about the - * client, the environment, or the circumstances of this request. - * - * @return the Context object that is to be used - * to resolve any context strings whose - * values need to be sent with the invocation - */ - - public abstract Context ctx(); - - /** - * Sets this request's Context object to the one given. - * - * @param c the new Context object to be used for - * resolving context strings - */ - - public abstract void ctx(Context c); - - - /** - * Creates an input argument and adds it to this Request - * object. - * - * @return an Any object that contains the - * value and typecode for the input argument added - */ - - public abstract Any add_in_arg(); - - /** - * Creates an input argument with the given name and adds it to - * this Request object. - * - * @param name the name of the argument being added - * @return an Any object that contains the - * value and typecode for the input argument added - */ - - public abstract Any add_named_in_arg(String name); - - /** - * Adds an input/output argument to this Request object. - * - * @return an Any object that contains the - * value and typecode for the input/output argument added - */ - - public abstract Any add_inout_arg(); - - /** - * Adds an input/output argument with the given name to this - * Request object. - * - * @param name the name of the argument being added - * @return an Any object that contains the - * value and typecode for the input/output argument added - */ - - public abstract Any add_named_inout_arg(String name); - - - /** - * Adds an output argument to this Request object. - * - * @return an Any object that contains the - * value and typecode for the output argument added - */ - - public abstract Any add_out_arg(); - - /** - * Adds an output argument with the given name to this - * Request object. - * - * @param name the name of the argument being added - * @return an Any object that contains the - * value and typecode for the output argument added - */ - - public abstract Any add_named_out_arg(String name); - - /** - * Sets the typecode for the return - * value of the method. - * - * @param tc the TypeCode object containing type information - * for the return value - */ - - public abstract void set_return_type(TypeCode tc); - - /** - * Returns the Any object that contains the value for the - * result of the method. - * - * @return an Any object containing the value and - * typecode for the return value - */ - - public abstract Any return_value(); - - /** - * Makes a synchronous invocation using the - * information in the Request object. Exception information is - * placed into the Request object's environment object. - */ - - public abstract void invoke(); - - /** - * Makes a oneway invocation on the - * request. In other words, it does not expect or wait for a - * response. Note that this can be used even if the operation was - * not declared as oneway in the IDL declaration. No response or - * exception information is returned. - */ - - public abstract void send_oneway(); - - /** - * Makes an asynchronous invocation on - * the request. In other words, it does not wait for a response before it - * returns to the user. The user can then later use the methods - * poll_response and get_response to get - * the result or exception information for the invocation. - */ - - public abstract void send_deferred(); - - /** - * Allows the user to determine - * whether a response has been received for the invocation triggered - * earlier with the send_deferred method. - * - * @return true if the method response has - * been received; false otherwise - */ - - public abstract boolean poll_response(); - - /** - * Allows the user to access the - * response for the invocation triggered earlier with the - * send_deferred method. - * - * @exception WrongTransaction if the method get_response was invoked - * from a different transaction's scope than the one from which the - * request was originally sent. See the OMG Transaction Service specification - * for details. - */ - - public abstract void get_response() throws WrongTransaction; - -}; diff --git a/src/java.corba/share/classes/org/omg/CORBA/ServerRequest.java b/src/java.corba/share/classes/org/omg/CORBA/ServerRequest.java deleted file mode 100644 index 04cdeb6ffde..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ServerRequest.java +++ /dev/null @@ -1,314 +0,0 @@ -/* - * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * An object that captures the explicit state of a request - * for the Dynamic Skeleton Interface (DSI). This class, the - * cornerstone of the DSI, is analogous to the Request - * object in the DII. - *

            - * The ORB is responsible for creating this embodiment of a request, - * and delivering it to a Dynamic Implementation Routine (DIR). - * A dynamic servant (a DIR) is created by implementing the - * DynamicImplementation class, - * which has a single invoke method. This method accepts a - * ServerRequest object. - * - * The abstract class ServerRequest defines - * methods for accessing the - * method name, the arguments and the context of the request, as - * well as methods for setting the result of the request either as a - * return value or an exception.

            - * - * A subtlety with accessing the arguments of the request is that the - * DIR needs to provide type information about the - * expected arguments, since there is no compiled information about - * these. This information is provided through an NVList, - * which is a list of NamedValue objects. - * Each NamedValue object - * contains an Any object, which in turn - * has a TypeCode object representing the type - * of the argument.

            - * - * Similarly, type information needs to be provided for the response, - * for either the expected result or for an exception, so the methods - * result and except take an Any - * object as a parameter. - * - * @see org.omg.CORBA.DynamicImplementation - * @see org.omg.CORBA.NVList - * @see org.omg.CORBA.NamedValue - * - */ - -public abstract class ServerRequest { - - /** - * Retrieves the name of the operation being - * invoked. According to OMG IDL's rules, these names must be unique - * among all operations supported by this object's "most-derived" - * interface. Note that the operation names for getting and setting - * attributes are _get_<attribute_name> - * and _set_<attribute_name>, - * respectively. - * - * @return the name of the operation to be invoked - * @deprecated use operation() - */ - @Deprecated - public String op_name() - { - return operation(); - } - - - /** - * Throws an org.omg.CORBA.NO_IMPLEMENT exception. - *

            - * Retrieves the name of the operation being - * invoked. According to OMG IDL's rules, these names must be unique - * among all operations supported by this object's "most-derived" - * interface. Note that the operation names for getting and setting - * attributes are _get_<attribute_name> - * and _set_<attribute_name>, - * respectively. - * - * @return the name of the operation to be invoked - * @see CORBA - * package comments for unimplemented features - */ - public String operation() - { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - - /** - * Specifies method parameter types and retrieves "in" and "inout" - * argument values. - *

            - * Note that this method is deprecated; use the method - * arguments in its place. - *

            - * Unless it calls the method set_exception, - * the DIR must call this method exactly once, even if the - * method signature contains no parameters. Once the method - * arguments or set_exception - * has been called, calling arguments on the same - * ServerRequest object - * will result in a BAD_INV_ORDER system exception. - * The DIR must pass in to the method arguments - * an NVList initialized with TypeCodes and Flags - * describing the parameter types for the operation, in the order in which - * they appear in the IDL specification (left to right). A - * potentially-different NVList will be returned from - * arguments, with the - * "in" and "inout" argument values supplied. If it does not call - * the method set_exception, - * the DIR must supply the returned NVList with return - * values for any "out" arguments before returning, and may also change - * the return values for any "inout" arguments. - * - * @param params the arguments of the method, in the - * form of an NVList object - * @deprecated use the method arguments - */ - @Deprecated - public void params(NVList params) - { - arguments(params); - } - - /** - * Specifies method parameter types and retrieves "in" and "inout" - * argument values. - * Unless it calls the method set_exception, - * the DIR must call this method exactly once, even if the - * method signature contains no parameters. Once the method - * arguments or set_exception - * has been called, calling arguments on the same - * ServerRequest object - * will result in a BAD_INV_ORDER system exception. - * The DIR must pass in to the method arguments - * an NVList initialized with TypeCodes and Flags - * describing the parameter types for the operation, in the order in which - * they appear in the IDL specification (left to right). A - * potentially-different NVList will be returned from - * arguments, with the - * "in" and "inout" argument values supplied. If it does not call - * the method set_exception, - * the DIR must supply the returned NVList with return - * values for any "out" arguments before returning, and it may also change - * the return values for any "inout" arguments. - * - * @param args the arguments of the method, in the - * form of an NVList - * @see CORBA - * package comments for unimplemented features - */ - public void arguments(org.omg.CORBA.NVList args) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - - - /** - * Specifies any return value for the call. - *

            - * Note that this method is deprecated; use the method - * set_result in its place. - *

            - * Unless the method - * set_exception is called, if the invoked method - * has a non-void result type, the method set_result - * must be called exactly once before the DIR returns. - * If the operation has a void result type, the method - * set_result may optionally be - * called once with an Any object whose type is - * tk_void. Calling the method set_result before - * the method arguments has been called or after - * the method set_result or set_exception has been - * called will result in a BAD_INV_ORDER exception. Calling the method - * set_result without having previously called - * the method ctx when the IDL operation contains a - * context expression, or when the NVList passed to arguments did not - * describe all parameters passed by the client, may result in a MARSHAL - * system exception. - * - * @param any an Any object containing the return value to be set - * @deprecated use the method set_result - */ - @Deprecated - public void result(Any any) - { - set_result(any); - } - - - /** - * Throws an org.omg.CORBA.NO_IMPLEMENT exception. - *

            - * Specifies any return value for the call. Unless the method - * set_exception is called, if the invoked method - * has a non-void result type, the method set_result - * must be called exactly once before the DIR returns. - * If the operation has a void result type, the method - * set_result may optionally be - * called once with an Any object whose type is - * tk_void. Calling the method set_result before - * the method arguments has been called or after - * the method set_result or set_exception has been - * called will result in a BAD_INV_ORDER exception. Calling the method - * set_result without having previously called - * the method ctx when the IDL operation contains a - * context expression, or when the NVList passed to arguments did not - * describe all parameters passed by the client, may result in a MARSHAL - * system exception. - * - * @param any an Any object containing the return value to be set - * @see CORBA - * package comments for unimplemented features - */ - public void set_result(org.omg.CORBA.Any any) - { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - - /** - * The DIR may call set_exception at any time to return an exception to the - * client. The Any passed to set_exception must contain either a system - * exception or a user exception specified in the raises expression - * of the invoked operation's IDL definition. Passing in an Any that does - * not - * contain an exception will result in a BAD_PARAM system exception. Passing - * in an unlisted user exception will result in either the DIR receiving a - * BAD_PARAM system exception or in the client receiving an - * UNKNOWN system exception. - * - * @param any the Any object containing the exception - * @deprecated use set_exception() - */ - @Deprecated - public void except(Any any) - { - set_exception(any); - } - - /** - * Throws an org.omg.CORBA.NO_IMPLEMENT exception. - *

            - * Returns the given exception to the client. This method - * is invoked by the DIR, which may call it at any time. - * The Any object passed to this method must - * contain either a system - * exception or one of the user exceptions specified in the - * invoked operation's IDL definition. Passing in an - * Any object that does not contain an exception - * will cause a BAD_PARAM system exception to be thrown. Passing - * in an unlisted user exception will result in either the DIR receiving a - * BAD_PARAM system exception or in the client receiving an - * UNKNOWN system exception. - * - * @param any the Any object containing the exception - * @exception BAD_PARAM if the given Any object does not - * contain an exception or the exception is an - * unlisted user exception - * @exception UNKNOWN if the given exception is an unlisted - * user exception and the DIR did not - * receive a BAD_PARAM exception - * @see CORBA - * package comments for unimplemented features - */ - public void set_exception(Any any) - { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Returns the context information specified in IDL for the operation - * when the operation is not an attribute access and the operation's IDL - * definition contains a context expression; otherwise it returns - * a nil Context reference. Calling the method - * ctx before the method arguments has - * been called or after the method ctx, - * set_result, or set_exception - * has been called will result in a - * BAD_INV_ORDER system exception. - * - * @return the context object that is to be used - * to resolve any context strings whose - * values need to be sent with the invocation. - * @exception BAD_INV_ORDER if (1) the method ctx is called - * before the method arguments or - * (2) the method ctx is called - * after calling set_result or - * set_exception - */ - public abstract Context ctx(); - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ServiceDetail.java b/src/java.corba/share/classes/org/omg/CORBA/ServiceDetail.java deleted file mode 100644 index 580230039e4..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ServiceDetail.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * An object that represents an ORB service: its service_detail_type - * field contains the type of the ORB service, and its service_detail - * field contains a description of the ORB service. - - * - * @author RIP Team - */ -public final class ServiceDetail implements org.omg.CORBA.portable.IDLEntity -{ - /** - * The type of the ORB service that this ServiceDetail - * object represents. - */ - public int service_detail_type; - - /** - * The data describing the ORB service that this ServiceDetail - * object represents. - */ - public byte[] service_detail; - - /** - * Constructs a ServiceDetail object with 0 for the type of - * ORB service and an empty description. - */ - public ServiceDetail() { } - - /** - * Constructs a ServiceDetail object with the given - * ORB service type and the given description. - * - * @param service_detail_type an int specifying the type of - * ORB service - * @param service_detail a byte array describing the ORB service - */ - public ServiceDetail(int service_detail_type, byte[] service_detail) { - this.service_detail_type = service_detail_type; - this.service_detail = service_detail; - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ServiceDetailHelper.java b/src/java.corba/share/classes/org/omg/CORBA/ServiceDetailHelper.java deleted file mode 100644 index 903a65e2f28..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ServiceDetailHelper.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - /** - * The Helper for {@code ServiceDetail}. For more information on - * Helper files, see - * "Generated Files: Helper Files".

            - */ - -package org.omg.CORBA; - - -public abstract class ServiceDetailHelper { - - public static void write(org.omg.CORBA.portable.OutputStream out, org.omg.CORBA.ServiceDetail that) { - out.write_ulong(that.service_detail_type); - { - out.write_long(that.service_detail.length); - out.write_octet_array(that.service_detail, 0, that.service_detail.length); - } - } - public static org.omg.CORBA.ServiceDetail read(org.omg.CORBA.portable.InputStream in) { - org.omg.CORBA.ServiceDetail that = new org.omg.CORBA.ServiceDetail(); - that.service_detail_type = in.read_ulong(); - { - int __length = in.read_long(); - that.service_detail = new byte[__length]; - in.read_octet_array(that.service_detail, 0, that.service_detail.length); - } - return that; - } - public static org.omg.CORBA.ServiceDetail extract(org.omg.CORBA.Any a) { - org.omg.CORBA.portable.InputStream in = a.create_input_stream(); - return read(in); - } - public static void insert(org.omg.CORBA.Any a, org.omg.CORBA.ServiceDetail that) { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream(); - write(out, that); - a.read_value(out.create_input_stream(), type()); - } - private static org.omg.CORBA.TypeCode _tc; - synchronized public static org.omg.CORBA.TypeCode type() { - int _memberCount = 2; - org.omg.CORBA.StructMember[] _members = null; - if (_tc == null) { - _members= new org.omg.CORBA.StructMember[2]; - _members[0] = new org.omg.CORBA.StructMember( - "service_detail_type", - org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_ulong), - null); - - _members[1] = new org.omg.CORBA.StructMember( - "service_detail", - org.omg.CORBA.ORB.init().create_sequence_tc(0, org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_octet)), - null); - _tc = org.omg.CORBA.ORB.init().create_struct_tc(id(), "ServiceDetail", _members); - } - return _tc; - } - public static String id() { - return "IDL:omg.org/CORBA/ServiceDetail:1.0"; - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ServiceInformation.java b/src/java.corba/share/classes/org/omg/CORBA/ServiceInformation.java deleted file mode 100644 index 47098f2f44c..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ServiceInformation.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - - -/** - * An IDL struct in the CORBA module that - * stores information about a CORBA service available in the - * ORB implementation and is obtained from the {@code ORB.get_service_information} - * method. - */ -public final class ServiceInformation implements org.omg.CORBA.portable.IDLEntity -{ - /** Array of ints representing service options. - */ - public int[] service_options; - - /** Array of ServiceDetails giving more details about the service. - */ - public org.omg.CORBA.ServiceDetail[] service_details; - - /** Constructs a ServiceInformation object with empty service_options - * and service_details. - */ - public ServiceInformation() { } - - /** Constructs a ServiceInformation object with the given service_options - * and service_details. - * @param __service_options An array of ints describing the service options. - * @param __service_details An array of ServiceDetails describing the service - * details. - */ - public ServiceInformation(int[] __service_options, - org.omg.CORBA.ServiceDetail[] __service_details) - { - service_options = __service_options; - service_details = __service_details; - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ServiceInformationHelper.java b/src/java.corba/share/classes/org/omg/CORBA/ServiceInformationHelper.java deleted file mode 100644 index 82103dfeda4..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ServiceInformationHelper.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - /** - * The Helper for {@code ServiceInformation}. For more information on - * Helper files, see - * "Generated Files: Helper Files".

            - */ - -package org.omg.CORBA; - - -public abstract class ServiceInformationHelper { - - public static void write(org.omg.CORBA.portable.OutputStream out, org.omg.CORBA.ServiceInformation that) - { - out.write_long(that.service_options.length); - out.write_ulong_array(that.service_options, 0, that.service_options.length); - out.write_long(that.service_details.length); - for (int i = 0 ; i < that.service_details.length ; i += 1) { - org.omg.CORBA.ServiceDetailHelper.write(out, that.service_details[i]); - } - } - - public static org.omg.CORBA.ServiceInformation read(org.omg.CORBA.portable.InputStream in) { - org.omg.CORBA.ServiceInformation that = new org.omg.CORBA.ServiceInformation(); - { - int __length = in.read_long(); - that.service_options = new int[__length]; - in.read_ulong_array(that.service_options, 0, that.service_options.length); - } - { - int __length = in.read_long(); - that.service_details = new org.omg.CORBA.ServiceDetail[__length]; - for (int __index = 0 ; __index < that.service_details.length ; __index += 1) { - that.service_details[__index] = org.omg.CORBA.ServiceDetailHelper.read(in); - } - } - return that; - } - public static org.omg.CORBA.ServiceInformation extract(org.omg.CORBA.Any a) { - org.omg.CORBA.portable.InputStream in = a.create_input_stream(); - return read(in); - } - public static void insert(org.omg.CORBA.Any a, org.omg.CORBA.ServiceInformation that) { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream(); - write(out, that); - a.read_value(out.create_input_stream(), type()); - } - private static org.omg.CORBA.TypeCode _tc; - synchronized public static org.omg.CORBA.TypeCode type() { - int _memberCount = 2; - org.omg.CORBA.StructMember[] _members = null; - if (_tc == null) { - _members= new org.omg.CORBA.StructMember[2]; - _members[0] = new org.omg.CORBA.StructMember( - "service_options", - org.omg.CORBA.ORB.init().create_sequence_tc(0, org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_ulong)), - null); - - _members[1] = new org.omg.CORBA.StructMember( - "service_details", - org.omg.CORBA.ORB.init().create_sequence_tc(0, org.omg.CORBA.ServiceDetailHelper.type()), - null); - _tc = org.omg.CORBA.ORB.init().create_struct_tc(id(), "ServiceInformation", _members); - } - return _tc; - } - public static String id() { - return "IDL:omg.org/CORBA/ServiceInformation:1.0"; - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ServiceInformationHolder.java b/src/java.corba/share/classes/org/omg/CORBA/ServiceInformationHolder.java deleted file mode 100644 index 5e4f6a73ca9..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ServiceInformationHolder.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * The Holder for {@code ServiceInformation}. For more information on - * Holder files, see - * "Generated Files: Holder Files".

            - * A Holder class for a {@code ServiceInformation} object - * that is used to store "out" and "inout" parameters in IDL methods. - * If an IDL method signature has an IDL {@code xxx} as an "out" - * or "inout" parameter, the programmer must pass an instance of - * {@code ServiceInformationHolder} as the corresponding - * parameter in the method invocation; for "inout" parameters, the programmer - * must also fill the "in" value to be sent to the server. - * Before the method invocation returns, the ORB will fill in the - * value corresponding to the "out" value returned from the server. - *

            - * If {@code myServiceInformationHolder} is an instance of {@code ServiceInformationHolder}, - * the value stored in its {@code value} field can be accessed with - * {@code myServiceInformationHolder.value}. - */ -public final class ServiceInformationHolder - implements org.omg.CORBA.portable.Streamable { - - /** - * The {@code ServiceInformation} value held by this - * {@code ServiceInformationHolder} object in its {@code value} field. - */ - public ServiceInformation value; - - /** - * Constructs a new {@code ServiceInformationHolder} object with its - * {@code value} field initialized to null. - */ - public ServiceInformationHolder() { - this(null); - } - - /** - * Constructs a new {@code ServiceInformationHolder} object with its - * {@code value} field initialized to the given - * {@code ServiceInformation} object. - * - * @param arg the {@code ServiceInformation} object with which to initialize - * the {@code value} field of the newly-created - * {@code ServiceInformationHolder} object - */ - public ServiceInformationHolder(org.omg.CORBA.ServiceInformation arg) { - value = arg; - } - - - /** - * Marshals the value in this {@code ServiceInformationHolder} object's - * {@code value} field to the output stream {@code out}. - * - * @param out the {@code OutputStream} object that will contain - * the CDR formatted data - */ - public void _write(org.omg.CORBA.portable.OutputStream out) { - org.omg.CORBA.ServiceInformationHelper.write(out, value); - } - - /** - * Reads unmarshalled data from the input stream {@code in} and assigns it to - * the {@code value} field in this {@code ServiceInformationHolder} object. - * - * @param in the {@code InputStream} object containing CDR - * formatted data from the wire - */ - public void _read(org.omg.CORBA.portable.InputStream in) { - value = org.omg.CORBA.ServiceInformationHelper.read(in); - } - - /** - * Retrieves the {@code TypeCode} object that corresponds - * to the value held in this {@code ServiceInformationHolder} object's - * {@code value} field. - * - * @return the type code for the value held in this {@code ServiceInformationHolder} - * object - */ - public org.omg.CORBA.TypeCode _type() { - return org.omg.CORBA.ServiceInformationHelper.type(); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/SetOverrideType.java b/src/java.corba/share/classes/org/omg/CORBA/SetOverrideType.java deleted file mode 100644 index 82818974d2a..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/SetOverrideType.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * The mapping of a CORBA enum tagging - * SET_OVERRIDE and ADD_OVERRIDE, which - * indicate whether policies should replace the - * existing policies of an Object or be added to them. - *

            - * The method {@link org.omg.CORBA.Object#_set_policy_override} takes - * either SetOverrideType.SET_OVERRIDE or - * SetOverrideType.ADD_OVERRIDE as its second argument. - * The method _set_policy_override - * creates a new Object initialized with the - * Policy objects supplied as the first argument. If the - * second argument is ADD_OVERRIDE, the new policies - * are added to those of the Object instance that is - * calling the _set_policy_override method. If - * SET_OVERRIDE is given instead, the existing policies - * are replaced with the given ones. - * - * @author OMG - * @since JDK1.2 - */ - -public class SetOverrideType implements org.omg.CORBA.portable.IDLEntity { - - /** - * The int constant for the enum value SET_OVERRIDE. - */ - public static final int _SET_OVERRIDE = 0; - - /** - * The int constant for the enum value ADD_OVERRIDE. - */ - public static final int _ADD_OVERRIDE = 1; - - /** - * The SetOverrideType constant for the enum value SET_OVERRIDE. - */ - public static final SetOverrideType SET_OVERRIDE = new SetOverrideType(_SET_OVERRIDE); - - /** - * The SetOverrideType constant for the enum value ADD_OVERRIDE. - */ - public static final SetOverrideType ADD_OVERRIDE = new SetOverrideType(_ADD_OVERRIDE); - - /** - * Retrieves the value of this SetOverrideType instance. - * - * @return the int for this SetOverrideType instance. - */ - public int value() { - return _value; - } - - /** - * Converts the given int to the corresponding - * SetOverrideType instance. - * - * @param i the int to convert; must be either - * SetOverrideType._SET_OVERRIDE or - * SetOverrideType._ADD_OVERRIDE - * @return the SetOverrideType instance whose value - * matches the given int - * @exception BAD_PARAM if the given int does not - * match the value of - * any SetOverrideType instance - */ - public static SetOverrideType from_int(int i) - { - switch (i) { - case _SET_OVERRIDE: - return SET_OVERRIDE; - case _ADD_OVERRIDE: - return ADD_OVERRIDE; - default: - throw new org.omg.CORBA.BAD_PARAM(); - } - } - - /** - * Constructs a SetOverrideType instance from an - * int. - * @param _value must be either SET_OVERRIDE or - * ADD_OVERRIDE - */ - protected SetOverrideType(int _value){ - this._value = _value; - } - - /** - * The field containing the value for this SetOverrideType - * object. - * - */ - private int _value; -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/SetOverrideTypeHelper.java b/src/java.corba/share/classes/org/omg/CORBA/SetOverrideTypeHelper.java deleted file mode 100644 index fa2c4a6348e..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/SetOverrideTypeHelper.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** -* The Helper for {@code SetOverrideType}. For more information on -* Helper files, see -* "Generated Files: Helper Files".

            -* org/omg/CORBA/SetOverrideTypeHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* 03 June 1999 11:52:03 o'clock GMT+00:00 -*/ - -abstract public class SetOverrideTypeHelper -{ - private static String _id = "IDL:omg.org/CORBA/SetOverrideType:1.0"; - - public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.SetOverrideType that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static org.omg.CORBA.SetOverrideType extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_enum_tc (org.omg.CORBA.SetOverrideTypeHelper.id (), "SetOverrideType", new String[] { "SET_OVERRIDE", "ADD_OVERRIDE"} ); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static org.omg.CORBA.SetOverrideType read (org.omg.CORBA.portable.InputStream istream) - { - return org.omg.CORBA.SetOverrideType.from_int (istream.read_long ()); - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.SetOverrideType value) - { - ostream.write_long (value.value ()); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ShortHolder.java b/src/java.corba/share/classes/org/omg/CORBA/ShortHolder.java deleted file mode 100644 index aa0cdb166cf..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ShortHolder.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -import org.omg.CORBA.portable.Streamable; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; - -/** - * The Holder for {@code Short}. For more information on - * Holder files, see - * "Generated Files: Holder Files". - *

            A Holder class for a {@code short} - * that is used to store "out" and "inout" parameters in IDL operations. - * If an IDL operation signature has an IDL {@code short} as an "out" - * or "inout" parameter, the programmer must pass an instance of - * {@code ShortHolder} as the corresponding - * parameter in the method invocation; for "inout" parameters, the programmer - * must also fill the "in" value to be sent to the server. - * Before the method invocation returns, the ORB will fill in the - * value corresponding to the "out" value returned from the server. - *

            - * If {@code myShortHolder} is an instance of {@code ShortHolder}, - * the value stored in its {@code value} field can be accessed with - * {@code myShortHolder.value}. - * - * @since JDK1.2 - */ -public final class ShortHolder implements Streamable { - - /** - * The {@code short} value held by this {@code ShortHolder} - * object. - */ - public short value; - - /** - * Constructs a new {@code ShortHolder} object with its - * {@code value} field initialized to {@code 0}. - */ - public ShortHolder() { - } - - /** - * Constructs a new {@code ShortHolder} object with its - * {@code value} field initialized to the given - * {@code short}. - * @param initial the {@code short} with which to initialize - * the {@code value} field of the newly-created - * {@code ShortHolder} object - */ - public ShortHolder(short initial) { - value = initial; - } - - /** - * Reads from {@code input} and initalizes the value in - * this {@code ShortHolder} object - * with the unmarshalled data. - * - * @param input the InputStream containing CDR formatted data from the wire. - */ - public void _read(InputStream input) { - value = input.read_short(); - } - - /** - * Marshals to {@code output} the value in - * this {@code ShortHolder} object. - * - * @param output the OutputStream which will contain the CDR formatted data. - */ - public void _write(OutputStream output) { - output.write_short(value); - } - - /** - * Returns the TypeCode corresponding to the value held in - * this {@code ShortHolder} object. - * - * @return the TypeCode of the value held in - * this {@code ShortHolder} object - */ - public org.omg.CORBA.TypeCode _type() { - return ORB.init().get_primitive_tc(TCKind.tk_short); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ShortSeqHelper.java b/src/java.corba/share/classes/org/omg/CORBA/ShortSeqHelper.java deleted file mode 100644 index 6159d19abbf..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ShortSeqHelper.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** -* The Helper for {@code ShortSeqHelper}. For more information on -* Helper files, see -* "Generated Files: Helper Files".

            -* org/omg/CORBA/ShortSeqHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from streams.idl -* 13 May 1999 22:41:36 o'clock GMT+00:00 -* -* The class definition has been modified to conform to the following -* OMG specifications : -*

            -*/ - -public abstract class ShortSeqHelper -{ - private static String _id = "IDL:omg.org/CORBA/ShortSeq:1.0"; - - public static void insert (org.omg.CORBA.Any a, short[] that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static short[] extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_short); - __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.ShortSeqHelper.id (), "ShortSeq", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static short[] read (org.omg.CORBA.portable.InputStream istream) - { - short value[] = null; - int _len0 = istream.read_long (); - value = new short[_len0]; - istream.read_short_array (value, 0, _len0); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, short[] value) - { - ostream.write_long (value.length); - ostream.write_short_array (value, 0, value.length); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ShortSeqHolder.java b/src/java.corba/share/classes/org/omg/CORBA/ShortSeqHolder.java deleted file mode 100644 index ee4ddbfc02d..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ShortSeqHolder.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** -* The Holder for {@code ShortSeq}. For more information on -* Holder files, see -* "Generated Files: Holder Files".

            -* org/omg/CORBA/ShortSeqHolder.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from streams.idl -* 13 May 1999 22:41:36 o'clock GMT+00:00 -*/ - -public final class ShortSeqHolder implements org.omg.CORBA.portable.Streamable -{ - public short value[] = null; - - public ShortSeqHolder () - { - } - - public ShortSeqHolder (short[] initialValue) - { - value = initialValue; - } - - public void _read (org.omg.CORBA.portable.InputStream i) - { - value = org.omg.CORBA.ShortSeqHelper.read (i); - } - - public void _write (org.omg.CORBA.portable.OutputStream o) - { - org.omg.CORBA.ShortSeqHelper.write (o, value); - } - - public org.omg.CORBA.TypeCode _type () - { - return org.omg.CORBA.ShortSeqHelper.type (); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/StringHolder.java b/src/java.corba/share/classes/org/omg/CORBA/StringHolder.java deleted file mode 100644 index a7c8b78e634..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/StringHolder.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 1995, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -import org.omg.CORBA.portable.Streamable; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; - -/** - * The Holder for {@code String}. For more information on - * Holder files, see - * "Generated Files: Holder Files".

            - * A Holder class for a {@code String} - * that is used to store "out" and "inout" parameters in IDL operations. - * If an IDL operation signature has an IDL {@code string} as an "out" - * or "inout" parameter, the programmer must pass an instance of - * {@code StringHolder} as the corresponding - * parameter in the method invocation; for "inout" parameters, the programmer - * must also fill the "in" value to be sent to the server. - * Before the method invocation returns, the ORB will fill in the - * value corresponding to the "out" value returned from the server. - *

            - * If {@code myStringHolder} is an instance of {@code StringHolder}, - * the value stored in its {@code value} field can be accessed with - * {@code myStringHolder.value}. - * - * @since JDK1.2 - */ -public final class StringHolder implements Streamable { - - /** - * The {@code String} value held by this {@code StringHolder} - * object. - */ - public String value; - - /** - * Constructs a new {@code StringHolder} object with its - * {@code value} field initialized to {@code null}. - */ - public StringHolder() { - } - - /** - * Constructs a new {@code StringHolder} object with its - * {@code value} field initialized to the given - * {@code String}. - * @param initial the {@code String} with which to initialize - * the {@code value} field of the newly-created - * {@code StringHolder} object - */ - public StringHolder(String initial) { - value = initial; - } - - /** - * Reads the unmarshalled data from {@code input} and assigns it to - * the {@code value} field of this {@code StringHolder} object. - * - * @param input the InputStream containing CDR formatted data from the wire. - */ - public void _read(InputStream input) { - value = input.read_string(); - } - - /** - * Marshals the value held by this {@code StringHolder} object - * to the output stream {@code output}. - * - * @param output the OutputStream which will contain the CDR formatted data. - */ - public void _write(OutputStream output) { - output.write_string(value); - } - - /** - * Retrieves the {@code TypeCode} object that corresponds to - * the value held in this {@code StringHolder} object. - * - * @return the type code of the value held in this {@code StringHolder} - * object - */ - public org.omg.CORBA.TypeCode _type() { - return ORB.init().get_primitive_tc(TCKind.tk_string); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/StringValueHelper.java b/src/java.corba/share/classes/org/omg/CORBA/StringValueHelper.java deleted file mode 100644 index d2f3c95c632..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/StringValueHelper.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package org.omg.CORBA; - -/** -* The Helper for {@code StringValue}. For more information on -* Helper files, see -* "Generated Files: Helper Files".

            -* org/omg/CORBA/StringValueHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from orb.idl -* 31 May 1999 22:27:30 o'clock GMT+00:00 -* -* The class definition has been modified to conform to the following -* OMG specifications : -*

            -*/ - -public class StringValueHelper implements org.omg.CORBA.portable.BoxedValueHelper -{ - private static String _id = "IDL:omg.org/CORBA/StringValue:1.0"; - - private static StringValueHelper _instance = new StringValueHelper (); - - public static void insert (org.omg.CORBA.Any a, String that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static String extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - private static boolean __active = false; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - synchronized (org.omg.CORBA.TypeCode.class) - { - if (__typeCode == null) - { - if (__active) - { - return org.omg.CORBA.ORB.init().create_recursive_tc ( _id ); - } - __active = true; - __typeCode = org.omg.CORBA.ORB.init ().create_string_tc (0); - __typeCode = org.omg.CORBA.ORB.init ().create_value_box_tc (_id, "StringValue", __typeCode); - __active = false; - } - } - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static String read (org.omg.CORBA.portable.InputStream istream) - { - if (!(istream instanceof org.omg.CORBA_2_3.portable.InputStream)) { - throw new org.omg.CORBA.BAD_PARAM(); } - return (String) ((org.omg.CORBA_2_3.portable.InputStream) istream).read_value (_instance); - } - - public java.io.Serializable read_value (org.omg.CORBA.portable.InputStream istream) - { - String tmp; - tmp = istream.read_string (); - return (java.io.Serializable) tmp; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, String value) - { - if (!(ostream instanceof org.omg.CORBA_2_3.portable.OutputStream)) { - throw new org.omg.CORBA.BAD_PARAM(); } - ((org.omg.CORBA_2_3.portable.OutputStream) ostream).write_value (value, _instance); - } - - public void write_value (org.omg.CORBA.portable.OutputStream ostream, java.io.Serializable value) - { - if (!(value instanceof String)) { - throw new org.omg.CORBA.MARSHAL(); } - String valueType = (String) value; - ostream.write_string (valueType); - } - - public String get_id () - { - return _id; - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/StructMember.java b/src/java.corba/share/classes/org/omg/CORBA/StructMember.java deleted file mode 100644 index 58a8e177b02..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/StructMember.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * File: ./org/omg/CORBA/StructMember.java - * From: ./ir.idl - * Date: Fri Aug 28 16:03:31 1998 - * By: idltojava Java IDL 1.2 Aug 11 1998 02:00:18 - */ - -package org.omg.CORBA; - -/** - * Describes a member of an IDL struct in the - * Interface Repository, including - * the name of the struct member, the type of - * the struct member, and - * the typedef that represents the IDL type of the - * struct member - * described the struct member object. - */ -public final class StructMember implements org.omg.CORBA.portable.IDLEntity { - - // instance variables - - /** - * The name of the struct member described by - * this StructMember object. - * @serial - */ - public String name; - - /** - * The type of the struct member described by - * this StructMember object. - * @serial - */ - public org.omg.CORBA.TypeCode type; - - /** - * The typedef that represents the IDL type of the struct member described by - * this StructMember object. - * @serial - */ - public org.omg.CORBA.IDLType type_def; - // constructors - - /** - * Constructs a default StructMember object. - */ - public StructMember() { } - - /** - * Constructs a StructMember object initialized with the - * given values. - * @param __name a String object with the name of the struct - * member - * @param __type a TypeCode object describing the type of the struct - * member - * @param __type_def an IDLType object representing the IDL type - * of the struct member - */ - public StructMember(String __name, org.omg.CORBA.TypeCode __type, org.omg.CORBA.IDLType __type_def) { - name = __name; - type = __type; - type_def = __type_def; - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/StructMemberHelper.java b/src/java.corba/share/classes/org/omg/CORBA/StructMemberHelper.java deleted file mode 100644 index 714175807c5..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/StructMemberHelper.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** -* The Helper for {@code StructMember}. For more information on -* Helper files, see -* "Generated Files: Helper Files".

            -* org/omg/CORBA/StructMemberHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* 03 June 1999 11:33:43 o'clock GMT+00:00 -*/ - -abstract public class StructMemberHelper -{ - private static String _id = "IDL:omg.org/CORBA/StructMember:1.0"; - - public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.StructMember that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static org.omg.CORBA.StructMember extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - private static boolean __active = false; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - synchronized (org.omg.CORBA.TypeCode.class) - { - if (__typeCode == null) - { - if (__active) - { - return org.omg.CORBA.ORB.init().create_recursive_tc ( _id ); - } - __active = true; - org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [3]; - org.omg.CORBA.TypeCode _tcOf_members0 = null; - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.IdentifierHelper.id (), "Identifier", _tcOf_members0); - _members0[0] = new org.omg.CORBA.StructMember ( - "name", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_TypeCode); - _members0[1] = new org.omg.CORBA.StructMember ( - "type", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.IDLTypeHelper.type (); - _members0[2] = new org.omg.CORBA.StructMember ( - "type_def", - _tcOf_members0, - null); - __typeCode = org.omg.CORBA.ORB.init ().create_struct_tc (org.omg.CORBA.StructMemberHelper.id (), "StructMember", _members0); - __active = false; - } - } - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static org.omg.CORBA.StructMember read (org.omg.CORBA.portable.InputStream istream) - { - org.omg.CORBA.StructMember value = new org.omg.CORBA.StructMember (); - value.name = istream.read_string (); - value.type = istream.read_TypeCode (); - value.type_def = org.omg.CORBA.IDLTypeHelper.read (istream); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.StructMember value) - { - ostream.write_string (value.name); - ostream.write_TypeCode (value.type); - org.omg.CORBA.IDLTypeHelper.write (ostream, value.type_def); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/SystemException.java b/src/java.corba/share/classes/org/omg/CORBA/SystemException.java deleted file mode 100644 index fa808c61088..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/SystemException.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; -import java.util.*; -import org.omg.CORBA.OMGVMCID; -import com.sun.corba.se.impl.util.SUNVMCID; - -/** - * The root class for all CORBA standard exceptions. These exceptions - * may be thrown as a result of any CORBA operation invocation and may - * also be returned by many standard CORBA API methods. The standard - * exceptions contain a minor code, allowing more detailed specification, and a - * completion status. This class is subclassed to - * generate each one of the set of standard ORB exceptions. - * SystemException extends - * java.lang.RuntimeException; thus none of the - * SystemException exceptions need to be - * declared in signatures of the Java methods mapped from operations in - * IDL interfaces. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - */ - -public abstract class SystemException extends java.lang.RuntimeException { - - /** - * The CORBA Exception minor code. - * @serial - */ - public int minor; - - /** - * The status of the operation that threw this exception. - * @serial - */ - public CompletionStatus completed; - - /** - * Constructs a SystemException exception with the specified detail - * message, minor code, and completion status. - * A detail message is a String that describes this particular exception. - * @param reason the String containing a detail message - * @param minor the minor code - * @param completed the completion status - */ - protected SystemException(String reason, int minor, CompletionStatus completed) { - super(reason); - this.minor = minor; - this.completed = completed; - } - - /** - * Converts this exception to a representative string. - */ - public String toString() { - // The fully qualified exception class name - String result = super.toString(); - - // The vmcid part - int vmcid = minor & 0xFFFFF000; - switch (vmcid) { - case OMGVMCID.value: - result += " vmcid: OMG"; - break; - case SUNVMCID.value: - result += " vmcid: SUN"; - break; - default: - result += " vmcid: 0x" + Integer.toHexString(vmcid); - break; - } - - // The minor code part - int mc = minor & 0x00000FFF; - result += " minor code: " + mc; - - // The completion status part - switch (completed.value()) { - case CompletionStatus._COMPLETED_YES: - result += " completed: Yes"; - break; - case CompletionStatus._COMPLETED_NO: - result += " completed: No"; - break; - case CompletionStatus._COMPLETED_MAYBE: - default: - result += " completed: Maybe"; - break; - } - return result; - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/TCKind.java b/src/java.corba/share/classes/org/omg/CORBA/TCKind.java deleted file mode 100644 index 79c7039b28d..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/TCKind.java +++ /dev/null @@ -1,554 +0,0 @@ -/* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - - -/** - * The Java mapping of the IDL enum TCKind, which - * specifies the kind of a TypeCode object. There is - * one kind for each primitive and essential IDL data type. - *

            - * The class TCKind consists of: - *

              - *
            • a set of int constants, one for each - * kind of IDL data type. These int constants - * make it possible to use a switch statement. - *
            • a set of TCKind constants, one for each - * kind of IDL data type. The value field for - * each TCKind instance is initialized with - * the int constant that corresponds with - * the IDL data type that the instance represents. - *
            • the method from_intfor converting - * an int to its - * corresponding TCKind instance - *

              Example: - *

              - *      org.omg.CORBA.TCKind k = org.omg.CORBA.TCKind.from_int(
              - *                         org.omg.CORBA.TCKind._tk_string);
              - * 
              - * The variable k represents the TCKind - * instance for the IDL type string, which is - * tk_string. - * - *
            • the method value for accessing the - * _value field of a TCKind constant - *

              Example: - *

              - *   int i = org.omg.CORBA.TCKind.tk_char.value();
              - * 
              - * The variable i represents 9, the value for the - * IDL data type char. - *
            - *

            The value field of a TCKind instance - * is the CDR encoding used for a TypeCode object in - * an IIOP message. - */ - -public class TCKind { - - /** - * The int constant for a null IDL data type. - */ - public static final int _tk_null = 0; - - /** - * The int constant for the IDL data type void. - */ - public static final int _tk_void = 1; - - /** - * The int constant for the IDL data type short. - */ - public static final int _tk_short = 2; - - /** - * The int constant for the IDL data type long. - */ - public static final int _tk_long = 3; - - /** - * The int constant for the IDL data type ushort. - */ - public static final int _tk_ushort = 4; - - /** - * The int constant for the IDL data type ulong. - */ - public static final int _tk_ulong = 5; - - /** - * The int constant for the IDL data type float. - */ - public static final int _tk_float = 6; - - /** - * The int constant for the IDL data type double. - */ - public static final int _tk_double = 7; - - /** - * The int constant for the IDL data type boolean. - */ - public static final int _tk_boolean = 8; - - /** - * The int constant for the IDL data type char. - */ - public static final int _tk_char = 9; - - /** - * The int constant for the IDL data type octet. - */ - public static final int _tk_octet = 10; - - /** - * The int constant for the IDL data type any. - */ - public static final int _tk_any = 11; - - /** - * The int constant for the IDL data type TypeCode. - */ - public static final int _tk_TypeCode = 12; - - /** - * The int constant for the IDL data type Principal. - */ - public static final int _tk_Principal = 13; - - /** - * The int constant for the IDL data type objref. - */ - public static final int _tk_objref = 14; - - /** - * The int constant for the IDL data type struct. - */ - public static final int _tk_struct = 15; - - /** - * The int constant for the IDL data type union. - */ - public static final int _tk_union = 16; - - /** - * The int constant for the IDL data type enum. - */ - public static final int _tk_enum = 17; - - /** - * The int constant for the IDL data type string. - */ - public static final int _tk_string = 18; - - /** - * The int constant for the IDL data type sequence. - */ - public static final int _tk_sequence = 19; - - /** - * The int constant for the IDL data type array. - */ - public static final int _tk_array = 20; - - /** - * The int constant for the IDL data type alias. - */ - public static final int _tk_alias = 21; - - /** - * The int constant for the IDL data type except. - */ - public static final int _tk_except = 22; - - /** - * The int constant for the IDL data type longlong. - */ - public static final int _tk_longlong = 23; - - /** - * The int constant for the IDL data type ulonglong. - */ - public static final int _tk_ulonglong = 24; - - /** - * The int constant for the IDL data type longdouble. - */ - public static final int _tk_longdouble = 25; - - /** - * The int constant for the IDL data type wchar. - */ - public static final int _tk_wchar = 26; - - /** - * The int constant for the IDL data type wstring. - */ - public static final int _tk_wstring = 27; - - /** - * The int constant for the IDL data type fixed. - */ - public static final int _tk_fixed = 28; - - /** - * The int constant for the IDL data type value. - */ - public static final int _tk_value = 29; // orbos 98-01-18: Objects By Value - - /** - * The int constant for the IDL data type value_box. - */ - public static final int _tk_value_box = 30; // orbos 98-01-18: Objects By Value - - /** - * The int constant for the IDL data type native. - */ - public static final int _tk_native = 31; // Verify - - /** - * The int constant for the IDL data type abstract interface. - */ - public static final int _tk_abstract_interface = 32; - - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_null}. - */ - public static final TCKind tk_null = new TCKind(_tk_null); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_void}. - */ - public static final TCKind tk_void = new TCKind(_tk_void); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_short}. - */ - public static final TCKind tk_short = new TCKind(_tk_short); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_long}. - */ - public static final TCKind tk_long = new TCKind(_tk_long); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_ushort}. - */ - public static final TCKind tk_ushort = new TCKind(_tk_ushort); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_ulong}. - */ - public static final TCKind tk_ulong = new TCKind(_tk_ulong); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_float}. - */ - public static final TCKind tk_float = new TCKind(_tk_float); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_double}. - */ - public static final TCKind tk_double = new TCKind(_tk_double); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_boolean}. - */ - public static final TCKind tk_boolean = new TCKind(_tk_boolean); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_char}. - */ - public static final TCKind tk_char = new TCKind(_tk_char); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_octet}. - */ - public static final TCKind tk_octet = new TCKind(_tk_octet); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_any}. - */ - public static final TCKind tk_any = new TCKind(_tk_any); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_TypeCode}. - */ - public static final TCKind tk_TypeCode = new TCKind(_tk_TypeCode); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_Principal}. - */ - public static final TCKind tk_Principal = new TCKind(_tk_Principal); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_objref}. - */ - public static final TCKind tk_objref = new TCKind(_tk_objref); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_struct}. - */ - public static final TCKind tk_struct = new TCKind(_tk_struct); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_union}. - */ - public static final TCKind tk_union = new TCKind(_tk_union); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_enum}. - */ - public static final TCKind tk_enum = new TCKind(_tk_enum); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_string}. - */ - public static final TCKind tk_string = new TCKind(_tk_string); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_sequence}. - */ - public static final TCKind tk_sequence = new TCKind(_tk_sequence); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_array}. - */ - public static final TCKind tk_array = new TCKind(_tk_array); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_alias}. - */ - public static final TCKind tk_alias = new TCKind(_tk_alias); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_except}. - */ - public static final TCKind tk_except = new TCKind(_tk_except); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_longlong}. - */ - public static final TCKind tk_longlong = new TCKind(_tk_longlong); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_ulonglong}. - */ - public static final TCKind tk_ulonglong = new TCKind(_tk_ulonglong); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_longdouble}. - */ - public static final TCKind tk_longdouble = new TCKind(_tk_longdouble); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_wchar}. - */ - public static final TCKind tk_wchar = new TCKind(_tk_wchar); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_wstring}. - */ - public static final TCKind tk_wstring = new TCKind(_tk_wstring); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_fixed}. - */ - public static final TCKind tk_fixed = new TCKind(_tk_fixed); - - // orbos 98-01-18: Objects By Value -- begin - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_value}. - */ - public static final TCKind tk_value = new TCKind(_tk_value); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_value_box}. - */ - public static final TCKind tk_value_box = new TCKind(_tk_value_box); - // orbos 98-01-18: Objects By Value -- end - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_native}. - */ - public static final TCKind tk_native = new TCKind(_tk_native); - - /** - * The TCKind constant whose value field is - * initialized with {@code TCKind._tk_abstract_interface}. - */ - public static final TCKind tk_abstract_interface = new TCKind(_tk_abstract_interface); - - - - - /** - * Retrieves the value of this TCKind instance. - * - * @return the int that represents the kind of - * IDL data type for this TCKind instance - */ - public int value() { - return _value; - } - - /** - * Converts the given int to the corresponding - * TCKind instance. - * - * @param i the int to convert. It must be one of - * the int constants in the class - * TCKind. - * @return the TCKind instance whose value - * field matches the given int - * @exception BAD_PARAM if the given int does not - * match the _value field of - * any TCKind instance - */ - public static TCKind from_int(int i) { - switch (i) { - case _tk_null: - return tk_null; - case _tk_void: - return tk_void; - case _tk_short: - return tk_short; - case _tk_long: - return tk_long; - case _tk_ushort: - return tk_ushort; - case _tk_ulong: - return tk_ulong; - case _tk_float: - return tk_float; - case _tk_double: - return tk_double; - case _tk_boolean: - return tk_boolean; - case _tk_char: - return tk_char; - case _tk_octet: - return tk_octet; - case _tk_any: - return tk_any; - case _tk_TypeCode: - return tk_TypeCode; - case _tk_Principal: - return tk_Principal; - case _tk_objref: - return tk_objref; - case _tk_struct: - return tk_struct; - case _tk_union: - return tk_union; - case _tk_enum: - return tk_enum; - case _tk_string: - return tk_string; - case _tk_sequence: - return tk_sequence; - case _tk_array: - return tk_array; - case _tk_alias: - return tk_alias; - case _tk_except: - return tk_except; - case _tk_longlong: - return tk_longlong; - case _tk_ulonglong: - return tk_ulonglong; - case _tk_longdouble: - return tk_longdouble; - case _tk_wchar: - return tk_wchar; - case _tk_wstring: - return tk_wstring; - case _tk_fixed: - return tk_fixed; - case _tk_value: // orbos 98-01-18: Objects By Value - return tk_value; - case _tk_value_box: // orbos 98-01-18: Objects By Value - return tk_value_box; - case _tk_native: - return tk_native; - case _tk_abstract_interface: - return tk_abstract_interface; - default: - throw new org.omg.CORBA.BAD_PARAM(); - } - } - - - /** - * Creates a new TCKind instance initialized with the given - * int. - * @deprecated Do not use this constructor as this method should be private - * according to the OMG specification. Use {@link #from_int(int)} instead. - * - * @param _value the int to convert. It must be one of - * the int constants in the class - * TCKind. - */ - @Deprecated - protected TCKind(int _value){ - this._value = _value; - } - private int _value; -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/TIMEOUT.java b/src/java.corba/share/classes/org/omg/CORBA/TIMEOUT.java deleted file mode 100644 index ed4a9790130..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/TIMEOUT.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * TIMEOUT is raised when no delivery has been made and the - * specified time-to-live period has been exceeded. It is a standard system - * exception because time-to-live QoS can be applied to any invocation. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @since J2SE 1.5 - */ - -public final class TIMEOUT extends SystemException { - - /** - * Constructs an TIMEOUT exception with - * minor code set to 0 and CompletionStatus set to COMPLETED_NO. - */ - public TIMEOUT() { - this(""); - } - - /** - * Constructs an TIMEOUT exception with the - * specified message. - * - * @param detailMessage string containing a detailed message. - */ - public TIMEOUT(String detailMessage) { - this(detailMessage, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs an TIMEOUT exception with the - * specified minor code and completion status. - * - * @param minorCode minor code. - * @param completionStatus completion status. - */ - public TIMEOUT(int minorCode, - CompletionStatus completionStatus) { - this("", minorCode, completionStatus); - } - - /** - * Constructs an TIMEOUT exception with the - * specified message, minor code, and completion status. - * - * @param detailMessage string containing a detailed message. - * @param minorCode minor code. - * @param completionStatus completion status. - */ - public TIMEOUT(String detailMessage, - int minorCode, - CompletionStatus completionStatus) { - super(detailMessage, minorCode, completionStatus); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_MODE.java b/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_MODE.java deleted file mode 100644 index f4ce02cbe2a..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_MODE.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * The CORBA TRANSACTION_MODE exception is thrown - * by the client ORB if it detects a mismatch between the - * InvocationPolicy in the IOR and the chosen invocation path - * (i.e, direct or routed invocation). - * It contains a minor code, which gives information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - * The OMG CORBA core 2.4 specification has details. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - */ - -public final class TRANSACTION_MODE extends SystemException { - /** - * Constructs a TRANSACTION_MODE exception with a default - * minor code of 0, a completion state of CompletionStatus.COMPLETED_NO, - * and a null description. - */ - public TRANSACTION_MODE() { - this(""); - } - - /** - * Constructs a TRANSACTION_MODE exception with the specified - * description message, a minor code of 0, and a completion state of - * COMPLETED_NO. - * @param s the String containing a detail message - */ - public TRANSACTION_MODE(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs a TRANSACTION_MODE exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed the completion status - */ - public TRANSACTION_MODE(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs a TRANSACTION_MODE exception with the specified - * description message, minor code, and completion status. - * @param s the String containing a description message - * @param minor the minor code - * @param completed the completion status - */ - public TRANSACTION_MODE(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_REQUIRED.java b/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_REQUIRED.java deleted file mode 100644 index 5f4d94ebf1e..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_REQUIRED.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * Exception indicates that the request carried a null transaction context, - * but an active transaction is required.

            - * It contains a minor code, which gives information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - * The OMG Transaction Service specfication has details. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - */ - -public final class TRANSACTION_REQUIRED extends SystemException { - /** - * Constructs a TRANSACTION_REQUIRED exception with a default minor code - * of 0, a completion state of CompletionStatus.COMPLETED_NO, - * and a null description. - */ - public TRANSACTION_REQUIRED() { - this(""); - } - - /** - * Constructs a TRANSACTION_REQUIRED exception with the specified - * description message, a minor code of 0, and a completion state of COMPLETED_NO. - * @param s the String containing a detail message - */ - public TRANSACTION_REQUIRED(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs a TRANSACTION_REQUIRED exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed the completion status - */ - public TRANSACTION_REQUIRED(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs a TRANSACTION_REQUIRED exception with the specified description - * message, minor code, and completion status. - * @param s the String containing a description message - * @param minor the minor code - * @param completed the completion status - */ - public TRANSACTION_REQUIRED(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_ROLLEDBACK.java b/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_ROLLEDBACK.java deleted file mode 100644 index 52e597c421d..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_ROLLEDBACK.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * Exception thrown when the transaction associated with the request has - * already been rolled back or marked to roll back. Thus, the requested - * operation either could not be performed or was not performed because - * further computation on behalf of the transaction would be fruitless.

            - * See the OMG Transaction - * Service specification for details. - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - */ - -public final class TRANSACTION_ROLLEDBACK extends SystemException { - /** - * Constructs a TRANSACTION_ROLLEDBACK exception with a default minor code - * of 0, a completion state of CompletionStatus.COMPLETED_NO, - * and a null description. - */ - public TRANSACTION_ROLLEDBACK() { - this(""); - } - - /** - * Constructs a TRANSACTION_ROLLEDBACK exception with the - * specified description message, - * a minor code of 0, and a completion state of COMPLETED_NO. - * @param s the String containing a detail message - */ - public TRANSACTION_ROLLEDBACK(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs a TRANSACTION_ROLLEDBACK exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed the completion status - */ - public TRANSACTION_ROLLEDBACK(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs a TRANSACTION_ROLLEDBACK exception with the - * specified description message, minor code, and completion status. - * @param s the String containing a description message - * @param minor the minor code - * @param completed the completion status - */ - public TRANSACTION_ROLLEDBACK(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_UNAVAILABLE.java b/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_UNAVAILABLE.java deleted file mode 100644 index 5870c44967b..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_UNAVAILABLE.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * The CORBA TRANSACTION_UNAVAILABLE exception is thrown - * by the ORB when it cannot process a transaction service context because - * its connection to the Transaction Service has been abnormally terminated. - * - * It contains a minor code, which gives information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - * The OMG CORBA core 2.4 specification has details. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - */ - -public final class TRANSACTION_UNAVAILABLE extends SystemException { - /** - * Constructs a TRANSACTION_UNAVAILABLE exception - * with a default minor code of 0, a completion state of - * CompletionStatus.COMPLETED_NO, and a null description. - */ - public TRANSACTION_UNAVAILABLE() { - this(""); - } - - /** - * Constructs a TRANSACTION_UNAVAILABLE exception with the - * specifieddescription message, a minor code of 0, and a completion state - * of COMPLETED_NO. - * @param s the String containing a detail message - */ - public TRANSACTION_UNAVAILABLE(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs a TRANSACTION_UNAVAILABLE exception with the - * specified minor code and completion status. - * @param minor the minor code - * @param completed the completion status - */ - public TRANSACTION_UNAVAILABLE(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs a TRANSACTION_UNAVAILABLE exception with the - * specified description message, minor code, and completion status. - * @param s the String containing a description message - * @param minor the minor code - * @param completed the completion status - */ - public TRANSACTION_UNAVAILABLE(String s, int minor, - CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/TRANSIENT.java b/src/java.corba/share/classes/org/omg/CORBA/TRANSIENT.java deleted file mode 100644 index fc03856d477..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/TRANSIENT.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * Exception thrown when the ORB attempted to reach an object and failed. - * It is not an indication that an object does not exist. Instead, it simply - * means that no further determination of an object's status was possible - * because it could not be reached. This exception is raised if an attempt - * to establish a connection fails, for example, because the server or the - * implementation repository is down.

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - */ - -public final class TRANSIENT extends SystemException { - /** - * Constructs a TRANSIENT exception with a default minor code - * of 0, a completion state of CompletionStatus.COMPLETED_NO, - * and a null description. - */ - public TRANSIENT() { - this(""); - } - - /** - * Constructs a TRANSIENT exception with the specified description message, - * a minor code of 0, and a completion state of COMPLETED_NO. - * @param s the String containing a detail message - */ - public TRANSIENT(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs a TRANSIENT exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed the completion status - */ - public TRANSIENT(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs a TRANSIENT exception with the specified description - * message, minor code, and completion status. - * @param s the String containing a description message - * @param minor the minor code - * @param completed the completion status - */ - public TRANSIENT(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/TypeCode.java b/src/java.corba/share/classes/org/omg/CORBA/TypeCode.java deleted file mode 100644 index 8366a75d31c..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/TypeCode.java +++ /dev/null @@ -1,516 +0,0 @@ -/* - * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -import org.omg.CORBA.TypeCodePackage.*; -import org.omg.CORBA.portable.IDLEntity; - -/** - * A container for information about a specific CORBA data - * type. - *

            - * TypeCode objects are used: - *

              - *
            • in the Dynamic Invocation Interface -- to indicate the types - * of the actual arguments or the type of the return value.
              - * NamedValue objects are used to represent arguments and - * return values. One of their components is an Any - * object, which in turn has as one of its components a - * TypeCode object. - *
            • by an Interface Repository to represent the type specifications - * that are part of many OMG IDL declarations - *
            - *

            - * The representation of a TypeCode object is opaque, - * but abstractly, a TypeCode object consists of: - *

              - *
            • a kind field, which is set to an instance - * of the class TCKind - *
            • zero or more additional fields appropriate - * for the particular kind. For example, the - * TypeCode object - * describing the OMG IDL type 1ong has kind - * TCKind.tk_long and no additional fields. - * The TypeCode describing OMG IDL type - * sequence<boolean, 10> has a kind field - * with the value - * TCKind.tk_sequence and also fields with the values - * boolean and 10 for the - * type of sequence elements and the length of the sequence. - *
            - * - * TypeCode objects can be obtained in various ways: - *
              - *
            1. from a call to the method Any.insert_X, where X is - * a basic IDL type. This method creates a TypeCode object - * for type X and assigns it to the Any object's - * type field. - *
            2. from invocations of methods in the ORB class - *

              For example, the following creates a TypeCode - * object for a string with a maximum of 30 characters: - *

              - *   org.omg.CORBA.TypeCode tcString = orb.create_string_tc(30);
              - * 
              - *

              The following creates a TypeCode - * object for an array of five strings: - *

              - *   org.omg.CORBA.TypeCode tcArray = orb.create_array_tc(
              - *                                       5, TCKind.tk_string);
              - * 
              - *

              The following creates a TypeCode - * object for an interface named "Account": - *

              - *   org.omg.CORBA.TypeCode tcInterface = orb.create_interface_tc(
              - *                                                 "thisId", "Account");
              - * 
              - *
            3. as the return value from the _type method - * in Holder classes for user-defined - * IDL types. These Holder classes are generated - * by the idltojava compiler. - *
            4. from a CORBA Interface Repository - *
            - *

            - * Most of the methods in the class TypeCode - * are accessors, and the information contained in a TypeCode - * object is specific to a particular type. Therefore, methods - * must be invoked - * only on the kind of type codes to which they apply. If an - * accessor method - * tries to access information from an inappropriate kind of - * type code, it will throw - * the exception TypeCodePackage.BadKind. For example, - * if the method discriminator_type is called on anything - * other than a union, it will throw BadKind - * because only unions have a discriminator. - * The following list shows which methods apply to which kinds of - * type codes: - *

            - * These methods may be invoked on all TypeCode kinds: - *

              - *
            • equal - *
            • kind - *
            - *

            - * These methods may be invoked on objref, struct, - * union, enum, - * alias, exception, value, - * value_box, native, - * and abstract_interface: - *

              - *
            • id - *
            • name - *
            - *

            - * These methods may be invoked on struct, - * union, enum, - * and exception: - *

              - *
            • member_count - *
            • member_name - *
            - *

            - * These methods may be invoked on struct, - * union, and exception: - *

              - *
            • member_type(int index) - *
            - *

            - * These methods may be invoked on union: - *

              - *
            • member_label - *
            • discriminator_type - *
            • default_index - *
            - *

            - * These methods may be invoked on string, - * sequence, and array: - *

              - *
            • length - *
            - *

            - * These methods may be invoked on alias, - * sequence, array, and value_box: - *

              - *
            • content_type - *
            - *

            - * Unlike other CORBA pseudo-objects, TypeCode - * objects can be passed as general IDL parameters.

            - * The methods parameter and param_count, - * which are deprecated, are not mapped.

            - * - * Java IDL extends the CORBA specification to allow all operations permitted - * on a struct TypeCode to be permitted - * on an exception TypeCode as well. - */ -public abstract class TypeCode implements IDLEntity { - - /** - * Compares this TypeCode object with the given one, - * testing for equality. TypeCode objects are equal if - * they are interchangeable and give identical results when - * TypeCode operations are applied to them. - * - * @param tc the TypeCode object to compare against - * @return true if the type codes are equal; - * false otherwise - */ - public abstract boolean equal(TypeCode tc); - - /** - * Tests to see if the given TypeCode object is - * equivalent to this TypeCode object. - * - * - * @param tc the typecode to compare with this typecode - * - * @return true if the given typecode is equivalent to - * this typecode; false otherwise - * - */ - public abstract boolean equivalent(TypeCode tc); - - /** - * Strips out all optional name and member name fields, - * but leaves all alias typecodes intact. - * @return a TypeCode object with optional name and - * member name fields stripped out, except for alias typecodes, - * which are left intact - * @see CORBA package - * comments for unimplemented features - */ - public abstract TypeCode get_compact_typecode(); - - - /** - * Retrieves the kind of this TypeCode object. - * The kind of a type code determines which TypeCode - * methods may legally be invoked on it. - *

            - * The method kind may be invoked on any - * TypeCode object. - * - * @return the TCKind instance indicating the - * value of the kind field of this - * TypeCode object - */ - public abstract TCKind kind(); - - /** - * Retrieves the RepositoryId globally identifying the type - * of this TypeCode object. - *

            - * The method id can be invoked on object reference, - * structure, union, enumeration, alias, exception, valuetype, - * boxed valuetype, native, and abstract interface type codes. - * Object reference, exception, valuetype, boxed valuetype, - * native, and abstract interface TypeCode objects - * always have a RepositoryId. - * Structure, union, enumeration, and alias TypeCode objects - * obtained from the Interface Repository or the method - * ORB.create_operation_list - * also always have a RepositoryId. If there is no RepositoryId, the - * method can return an empty string. - * - * @return the RepositoryId for this TypeCode object - * or an empty string if there is no RepositoryID - * @throws org.omg.CORBA.TypeCodePackage.BadKind if the method - * is invoked on an inappropriate kind ofTypeCode - * object - */ - public abstract String id() throws BadKind; - - /** - * Retrieves the simple name identifying this TypeCode - * object within its - * enclosing scope. Since names are local to a Repository, the - * name returned from a TypeCode object - * may not match the name of the - * type in any particular Repository, and may even be an empty - * string. - *

            - * The method name can be invoked on object reference, - * structure, union, enumeration, alias, exception, valuetype, - * boxed valuetype, native, and abstract interface - * TypeCode objects. - * - * @return the name identifying this TypeCode object - * or an empty string - * @throws org.omg.CORBA.TypeCodePackage.BadKind if the method - * is invoked on an inappropriate kind ofTypeCode - * object - */ - public abstract String name() throws BadKind; - - /** - * Retrieves the number of members in the type described by - * this TypeCode object. - *

            - * The method member_count can be invoked on - * structure, union, and enumeration TypeCode objects. - * Java IDL extends the CORBA specification to allow this method to - * operate on exceptions as well. - * - * @return the number of members constituting the type described - * by this TypeCode object - * - * @throws org.omg.CORBA.TypeCodePackage.BadKind if the method - * is invoked on an inappropriate kind of TypeCode - * object - */ - public abstract int member_count() throws BadKind; - - /** - * Retrieves the simple name of the member identified by - * the given index. Since names are local to a - * Repository, the name returned from a TypeCode object - * may not match the name of the member in any particular - * Repository, and may even be an empty string. - *

            - * The method member_name can be invoked on structure, union, - * and enumeration TypeCode objects. - * Java IDL extends the CORBA specification to allow this method to - * operate on exceptions as well. - * - * @param index index of the member for which a name is being reqested - * @return simple name of the member identified by the - * index or an empty string - * @throws org.omg.CORBA.TypeCodePackage.Bounds if the index is equal - * to or greater than - * the number of members constituting the type - * @throws org.omg.CORBA.TypeCodePackage.BadKind if the method - * is invoked on an inappropriate kind of TypeCode - * object - */ - public abstract String member_name(int index) - throws BadKind, org.omg.CORBA.TypeCodePackage.Bounds; - - /** - * Retrieves the TypeCode object describing the type - * of the member identified by the given index. - *

            - * The method member_type can be invoked on structure - * and union TypeCode objects. - * Java IDL extends the CORBA specification to allow this method to - * operate on exceptions as well. - * - * @param index index of the member for which type information - * is begin requested - * @return the TypeCode object describing the - * member at the given index - * @throws org.omg.CORBA.TypeCodePackage.Bounds if the index is - * equal to or greater than - * the number of members constituting the type - * @throws org.omg.CORBA.TypeCodePackage.BadKind if the method - * is invoked on an inappropriate kind of TypeCode - * object - */ - public abstract TypeCode member_type(int index) - throws BadKind, org.omg.CORBA.TypeCodePackage.Bounds; - - /** - * Retrieves the label of the union member - * identified by the given index. For the default member, - * the label is the zero octet. - *

            - * The method member_label can only be invoked on union - * TypeCode objects. - * - * @param index index of the union member for which the - * label is being requested - * @return an Any object describing the label of - * the requested union member or the zero octet for - * the default member - * @throws org.omg.CORBA.TypeCodePackage.Bounds if the index is - * equal to or greater than - * the number of members constituting the union - * @throws org.omg.CORBA.TypeCodePackage.BadKind if the method - * is invoked on a non-union TypeCode - * object - */ - public abstract Any member_label(int index) - throws BadKind, org.omg.CORBA.TypeCodePackage.Bounds; - - /** - * Returns a TypeCode object describing - * all non-default member labels. - * The method discriminator_type can be invoked only - * on union TypeCode objects. - * - * @return the TypeCode object describing - * the non-default member labels - * @throws org.omg.CORBA.TypeCodePackage.BadKind if the method - * is invoked on a non-union TypeCode - * object - */ - public abstract TypeCode discriminator_type() - throws BadKind; - - /** - * Returns the index of the - * default member, or -1 if there is no default member. - *

            - * The method default_index can be invoked only on union - * TypeCode objects. - * - * @return the index of the default member, or -1 if - * there is no default member - * @throws org.omg.CORBA.TypeCodePackage.BadKind if the method - * is invoked on a non-union TypeCode - * object - */ - public abstract int default_index() throws BadKind; - - /** - * Returns the number of elements in the type described by - * this TypeCode object. - * For strings and sequences, it returns the - * bound, with zero indicating an unbounded string or sequence. - * For arrays, it returns the number of elements in the array. - *

            - * The method length can be invoked on string, sequence, and - * array TypeCode objects. - * - * @return the bound for strings and sequences, or the - * number of elements for arrays - * @throws org.omg.CORBA.TypeCodePackage.BadKind if the method - * is invoked on an inappropriate kind of TypeCode - * object - */ - public abstract int length() throws BadKind; - - /** - * Returns the TypeCode object representing the - * IDL type for the members of the object described by this - * TypeCode object. - * For sequences and arrays, it returns the - * element type. For aliases, it returns the original type. Note - * that multidimensional arrays are represented by nesting - * TypeCode objects, one per dimension. - * For boxed valuetypes, it returns the boxed type. - *

            - * The method content_type can be invoked on sequence, array, - * alias, and boxed valuetype TypeCode objects. - * - * @return a TypeCode object representing - * the element type for sequences and arrays, the - * original type for aliases, or the - * boxed type for boxed valuetypes. - * @throws org.omg.CORBA.TypeCodePackage.BadKind if the method - * is invoked on an inappropriate kind of TypeCode - * object - */ - public abstract TypeCode content_type() throws BadKind; - - - /** - * Returns the number of digits in the fixed type described by this - * TypeCode object. For example, the typecode for - * the number 3000.275d could be fixed<7,3>, where - * 7 is the precision and 3 is the scale. - * - * @return the total number of digits - * @throws org.omg.CORBA.TypeCodePackage.BadKind if this method - * is invoked on an inappropriate kind of TypeCode - * object - * - */ - public abstract short fixed_digits() throws BadKind ; - - /** - * Returns the scale of the fixed type described by this - * TypeCode object. A positive number indicates the - * number of digits to the right of the decimal point. - * For example, the number 3000d could have the - * typecode fixed<4,0>, where the first number is - * the precision and the second number is the scale. - * A negative number is also possible and adds zeroes to the - * left of the decimal point. In this case, fixed<1,-3>, - * could be the typecode for the number 3000d. - * - * @return the scale of the fixed type that this - * TypeCode object describes - * @throws org.omg.CORBA.TypeCodePackage.BadKind if this method - * is invoked on an inappropriate kind of TypeCode - * object - */ - public abstract short fixed_scale() throws BadKind ; - - /** - * Returns the constant that indicates the visibility of the member - * at the given index. - * - * This operation can only be invoked on non-boxed value - * TypeCode objects. - * - * @param index an int indicating the index into the - * value - * @return either PRIVATE_MEMBER.value or - * PUBLIC_MEMBER.value - * @throws org.omg.CORBA.TypeCodePackage.BadKind if this method - * is invoked on a non-value type TypeCode - * object - * @throws org.omg.CORBA.TypeCodePackage.Bounds - * if the given index is out of bounds - * @see CORBA package - * comments for unimplemented features - */ - abstract public short member_visibility(int index) - throws BadKind, org.omg.CORBA.TypeCodePackage.Bounds ; - - /** - * Returns a constant indicating the modifier of the value type - * that this TypeCode object describes. The constant - * returned must be one of the following: VM_NONE.value, - * VM_ABSTRACT.value, VM_CUSTOM.value, - * or VM_TRUNCATABLE.value, - * - * @return a constant describing the value type - * that this TypeCode object describes - * @throws org.omg.CORBA.TypeCodePackage.BadKind - * if this method - * is invoked on a non-value type TypeCode - * object - * @see CORBA package - * comments for unimplemented features - */ - abstract public short type_modifier() throws BadKind ; - - /** - * Returns the TypeCode object that describes the concrete base type - * of the value type that this TypeCode object describes. - * Returns null if it doesn't have a concrete base type. - * - * @return the TypeCode object that describes the - * concrete base type of the value type - * that this TypeCode object describes - * @throws org.omg.CORBA.TypeCodePackage.BadKind if this method - * is invoked on a non-boxed value type TypeCode object - * @see CORBA package - * comments for unimplemented features - */ - abstract public TypeCode concrete_base_type() throws BadKind ; -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/TypeCodeHolder.java b/src/java.corba/share/classes/org/omg/CORBA/TypeCodeHolder.java deleted file mode 100644 index 2fcde8b66c0..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/TypeCodeHolder.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 1996, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -import org.omg.CORBA.portable.Streamable; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; - -/** - * The Holder for {@code TypeCode}. For more information on - * Holder files, see - * "Generated Files: Holder Files".

            - * A Holder class for a {@code TypeCode} object - * that is used to store "out" and "inout" parameters in IDL operations. - * If an IDL operation signature has an IDL {@code TypeCode} as an "out" - * or "inout" parameter, the programmer must pass an instance of - * {@code TypeCodeHolder} as the corresponding - * parameter in the method invocation; for "inout" parameters, the programmer - * must also fill the "in" value to be sent to the server. - * Before the method invocation returns, the ORB will fill in the - * value corresponding to the "out" value returned from the server. - *

            - * If {@code myTypeCodeHolder} is an instance of {@code TypeCodeHolder}, - * the value stored in its {@code value} field can be accessed with - * {@code myTypeCodeHolder.value}. - * - * @since JDK1.2 - */ -public final class TypeCodeHolder implements Streamable { - - /** - * The {@code TypeCode} value held by - * this {@code TypeCodeHolder} object. - */ - public TypeCode value; - - /** - * Constructs a new {@code TypeCodeHolder} object with its - * {@code value} field initialized to {@code null}. - */ - public TypeCodeHolder() { - } - - /** - * Constructs a new {@code TypeCodeHolder} object with its - * {@code value} field initialized to the given - * {@code TypeCode} object. - * @param initial the {@code TypeCode} object with which to initialize - * the {@code value} field of the newly-created - * {@code TypeCodeHolder} object - */ - public TypeCodeHolder(TypeCode initial) { - value = initial; - } - - /** - * Reads from {@code input} and initalizes the value in - * this {@code TypeCodeHolder} object - * with the unmarshalled data. - * - * @param input the InputStream containing CDR formatted data from the wire - */ - public void _read(InputStream input) { - value = input.read_TypeCode(); - } - - /** - * Marshals to {@code output} the value in - * this {@code TypeCodeHolder} object. - * - * @param output the OutputStream which will contain the CDR formatted data - */ - public void _write(OutputStream output) { - output.write_TypeCode(value); - } - - /** - * Returns the TypeCode corresponding to the value held in - * this {@code TypeCodeHolder} object. - * - * @return the TypeCode of the value held in - * this {@code TypeCodeHolder} object - */ - public org.omg.CORBA.TypeCode _type() { - return ORB.init().get_primitive_tc(TCKind.tk_TypeCode); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/TypeCodePackage/BadKind.java b/src/java.corba/share/classes/org/omg/CORBA/TypeCodePackage/BadKind.java deleted file mode 100644 index e139c2bb09a..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/TypeCodePackage/BadKind.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA.TypeCodePackage; - -/** - * The exception BadKind is thrown when - * an inappropriate operation is invoked on a TypeCode object. For example, - * invoking the method discriminator_type() on an instance of - * TypeCode that does not represent an IDL union will cause the - * exception BadKind to be thrown. - * - * @see org.omg.CORBA.TypeCode - * @since JDK1.2 - */ - -public final class BadKind extends org.omg.CORBA.UserException { - /** - * Constructs a BadKind exception with no reason message. - */ - public BadKind() { - super(); - } - - /** - * Constructs a BadKind exception with the specified - * reason message. - * @param reason the String containing a reason message - */ - public BadKind(String reason) { - super(reason); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/TypeCodePackage/BadKindHelper.java b/src/java.corba/share/classes/org/omg/CORBA/TypeCodePackage/BadKindHelper.java deleted file mode 100644 index b9c17569949..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/TypeCodePackage/BadKindHelper.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA.TypeCodePackage; - - -/** - * This Helper class is used to facilitate the marshalling of - * {@code TypeCodePackage/BadKind}. - * For more information on Helper files, see - * - * "Generated Files: Helper Files". - */ - -abstract public class BadKindHelper -{ - private static String _id = "IDL:omg.org.CORBA/TypeCode/BadKind:1.0"; - - public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.TypeCodePackage.BadKind that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static org.omg.CORBA.TypeCodePackage.BadKind extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - private static boolean __active = false; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - synchronized (org.omg.CORBA.TypeCode.class) - { - if (__typeCode == null) - { - if (__active) - { - return org.omg.CORBA.ORB.init().create_recursive_tc ( _id ); - } - __active = true; - org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [0]; - org.omg.CORBA.TypeCode _tcOf_members0 = null; - __typeCode = org.omg.CORBA.ORB.init ().create_exception_tc (org.omg.CORBA.TypeCodePackage.BadKindHelper.id (), "BadKind", _members0); - __active = false; - } - } - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static org.omg.CORBA.TypeCodePackage.BadKind read (org.omg.CORBA.portable.InputStream istream) - { - org.omg.CORBA.TypeCodePackage.BadKind value = new org.omg.CORBA.TypeCodePackage.BadKind (); - // read and discard the repository ID - istream.read_string (); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.TypeCodePackage.BadKind value) - { - // write the repository ID - ostream.write_string (id ()); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/TypeCodePackage/Bounds.java b/src/java.corba/share/classes/org/omg/CORBA/TypeCodePackage/Bounds.java deleted file mode 100644 index 059a3abfec1..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/TypeCodePackage/Bounds.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA.TypeCodePackage; - -/** - * Provides the TypeCode operations member_name(), - * member_type(), and member_label. - * These methods - * raise Bounds when the index parameter is greater than or equal - * to the number of members constituting the type. - * - * @since JDK1.2 - */ - -public final class Bounds extends org.omg.CORBA.UserException { - - /** - * Constructs a Bounds exception with no reason message. - */ - public Bounds() { - super(); - } - - /** - * Constructs a Bounds exception with the specified - * reason message. - * @param reason the String containing a reason message - */ - public Bounds(String reason) { - super(reason); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/TypeCodePackage/BoundsHelper.java b/src/java.corba/share/classes/org/omg/CORBA/TypeCodePackage/BoundsHelper.java deleted file mode 100644 index 5c1c89f029c..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/TypeCodePackage/BoundsHelper.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA.TypeCodePackage; - - -/** - * This Helper class is used to facilitate the marshalling of - * {@code TypeCodePackage/Bounds}. - * For more information on Helper files, see - * - * "Generated Files: Helper Files". - */ - -abstract public class BoundsHelper -{ - private static String _id = "IDL:omg.org.CORBA/TypeCode/Bounds:1.0"; - - public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.TypeCodePackage.Bounds that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static org.omg.CORBA.TypeCodePackage.Bounds extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - private static boolean __active = false; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - synchronized (org.omg.CORBA.TypeCode.class) - { - if (__typeCode == null) - { - if (__active) - { - return org.omg.CORBA.ORB.init().create_recursive_tc ( _id ); - } - __active = true; - org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [0]; - org.omg.CORBA.TypeCode _tcOf_members0 = null; - __typeCode = org.omg.CORBA.ORB.init ().create_exception_tc (org.omg.CORBA.TypeCodePackage.BoundsHelper.id (), "Bounds", _members0); - __active = false; - } - } - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static org.omg.CORBA.TypeCodePackage.Bounds read (org.omg.CORBA.portable.InputStream istream) - { - org.omg.CORBA.TypeCodePackage.Bounds value = new org.omg.CORBA.TypeCodePackage.Bounds (); - // read and discard the repository ID - istream.read_string (); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.TypeCodePackage.Bounds value) - { - // write the repository ID - ostream.write_string (id ()); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/TypeCodePackage/package.html b/src/java.corba/share/classes/org/omg/CORBA/TypeCodePackage/package.html deleted file mode 100644 index e69994d1c7a..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/TypeCodePackage/package.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - -Provides the user-defined exceptions BadKind -and Bounds, which are thrown by methods in -in the class TypeCode. - - -

            Related Documentation

            - -For an overview, please see: - - - -@since JDK1.2 -@serial exclude - - diff --git a/src/java.corba/share/classes/org/omg/CORBA/ULongLongSeqHelper.java b/src/java.corba/share/classes/org/omg/CORBA/ULongLongSeqHelper.java deleted file mode 100644 index 54376e8ab6e..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ULongLongSeqHelper.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** -* The Helper for {@code ULongLongSeq}. For more information on -* Helper files, see -* "Generated Files: Helper Files".

            -* org/omg/CORBA/ULongLongSeqHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from streams.idl -* 13 May 1999 22:41:37 o'clock GMT+00:00 -* -* The class definition has been modified to conform to the following -* OMG specifications : -*

            -*/ - -public abstract class ULongLongSeqHelper -{ - private static String _id = "IDL:omg.org/CORBA/ULongLongSeq:1.0"; - - public static void insert (org.omg.CORBA.Any a, long[] that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static long[] extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ulonglong); - __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.ULongLongSeqHelper.id (), "ULongLongSeq", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static long[] read (org.omg.CORBA.portable.InputStream istream) - { - long value[] = null; - int _len0 = istream.read_long (); - value = new long[_len0]; - istream.read_ulonglong_array (value, 0, _len0); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, long[] value) - { - ostream.write_long (value.length); - ostream.write_ulonglong_array (value, 0, value.length); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ULongLongSeqHolder.java b/src/java.corba/share/classes/org/omg/CORBA/ULongLongSeqHolder.java deleted file mode 100644 index a56e64bfff3..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ULongLongSeqHolder.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** -* The Holder for {@code ULongLongSeq}. For more information on -* Holder files, see -* "Generated Files: Holder Files".

            -* org/omg/CORBA/ULongLongSeqHolder.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from streams.idl -* 13 May 1999 22:41:37 o'clock GMT+00:00 -*/ - -public final class ULongLongSeqHolder implements org.omg.CORBA.portable.Streamable -{ - public long value[] = null; - - public ULongLongSeqHolder () - { - } - - public ULongLongSeqHolder (long[] initialValue) - { - value = initialValue; - } - - public void _read (org.omg.CORBA.portable.InputStream i) - { - value = org.omg.CORBA.ULongLongSeqHelper.read (i); - } - - public void _write (org.omg.CORBA.portable.OutputStream o) - { - org.omg.CORBA.ULongLongSeqHelper.write (o, value); - } - - public org.omg.CORBA.TypeCode _type () - { - return org.omg.CORBA.ULongLongSeqHelper.type (); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ULongSeqHelper.java b/src/java.corba/share/classes/org/omg/CORBA/ULongSeqHelper.java deleted file mode 100644 index c89e7b7511e..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ULongSeqHelper.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** -* The Helper for {@code ULongSeq}. For more information on -* Helper files, see -* "Generated Files: Helper Files".

            -* org/omg/CORBA/ULongSeqHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from streams.idl -* 13 May 1999 22:41:36 o'clock GMT+00:00 -* -* The class definition has been modified to conform to the following -* OMG specifications : -*

            -*/ - -public abstract class ULongSeqHelper -{ - private static String _id = "IDL:omg.org/CORBA/ULongSeq:1.0"; - - public static void insert (org.omg.CORBA.Any a, int[] that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static int[] extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ulong); - __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.ULongSeqHelper.id (), "ULongSeq", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static int[] read (org.omg.CORBA.portable.InputStream istream) - { - int value[] = null; - int _len0 = istream.read_long (); - value = new int[_len0]; - istream.read_ulong_array (value, 0, _len0); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, int[] value) - { - ostream.write_long (value.length); - ostream.write_ulong_array (value, 0, value.length); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ULongSeqHolder.java b/src/java.corba/share/classes/org/omg/CORBA/ULongSeqHolder.java deleted file mode 100644 index 0895bb482b5..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ULongSeqHolder.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** -* The Holder for {@code ULongSeq}. For more information on -* Holder files, see -* "Generated Files: Holder Files".

            -* org/omg/CORBA/ULongSeqHolder.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from streams.idl -* 13 May 1999 22:41:36 o'clock GMT+00:00 -*/ - -public final class ULongSeqHolder implements org.omg.CORBA.portable.Streamable -{ - public int value[] = null; - - public ULongSeqHolder () - { - } - - public ULongSeqHolder (int[] initialValue) - { - value = initialValue; - } - - public void _read (org.omg.CORBA.portable.InputStream i) - { - value = org.omg.CORBA.ULongSeqHelper.read (i); - } - - public void _write (org.omg.CORBA.portable.OutputStream o) - { - org.omg.CORBA.ULongSeqHelper.write (o, value); - } - - public org.omg.CORBA.TypeCode _type () - { - return org.omg.CORBA.ULongSeqHelper.type (); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/UNKNOWN.java b/src/java.corba/share/classes/org/omg/CORBA/UNKNOWN.java deleted file mode 100644 index ba57f3e73b3..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/UNKNOWN.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * This exception is raised if an operation implementation - * throws a non-CORBA exception (such as an exception - * specific to the implementation's programming language), - * or if an operation raises a user exception that does not - * appear in the operation's raises expression. UNKNOWN is - * also raised if the server returns a system exception that - * is unknown to the client. (This can happen if the server - * uses a later version of CORBA than the client and new system - * exceptions have been added to the later version.)

            - * It contains a minor code, which gives more detailed information about - * what caused the exception, and a completion status. It may also contain - * a string describing the exception. - *

            - * See the section {@extLink jidlexception_minorcodes Minor Code Meaning} - * to see the minor codes for this exception. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - */ - -public final class UNKNOWN extends SystemException { - /** - * Constructs an UNKNOWN exception with a default minor code - * of 0, a completion state of CompletionStatus.COMPLETED_NO, - * and a null description. - */ - public UNKNOWN() { - this(""); - } - - /** - * Constructs an UNKNOWN exception with the specified description message, - * a minor code of 0, and a completion state of COMPLETED_NO. - * @param s the String containing a detail message - */ - public UNKNOWN(String s) { - this(s, 0, CompletionStatus.COMPLETED_NO); - } - - /** - * Constructs an UNKNOWN exception with the specified - * minor code and completion status. - * @param minor the minor code - * @param completed the completion status - */ - public UNKNOWN(int minor, CompletionStatus completed) { - this("", minor, completed); - } - - /** - * Constructs an UNKNOWN exception with the specified description - * message, minor code, and completion status. - * @param s the String containing a description message - * @param minor the minor code - * @param completed the completion status - */ - public UNKNOWN(String s, int minor, CompletionStatus completed) { - super(s, minor, completed); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/UNSUPPORTED_POLICY.java b/src/java.corba/share/classes/org/omg/CORBA/UNSUPPORTED_POLICY.java deleted file mode 100644 index fb6d960bcf8..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/UNSUPPORTED_POLICY.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * One of the {@code PolicyErrorCode}s which would be filled if - * the requested {@code Policy} is understood to be valid by the - * ORB, but is not currently supported. - * - * @author rip-dev - */ -public interface UNSUPPORTED_POLICY { - /** - * The Error code for PolicyError exception. - */ - final short value = (short) (1L); -}; diff --git a/src/java.corba/share/classes/org/omg/CORBA/UNSUPPORTED_POLICY_VALUE.java b/src/java.corba/share/classes/org/omg/CORBA/UNSUPPORTED_POLICY_VALUE.java deleted file mode 100644 index a070b9f3b40..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/UNSUPPORTED_POLICY_VALUE.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * A {@code PolicyErrorCode} which would be filled if the value - * requested for the {@code Policy} is of a - * valid type and within the valid range for that type, but this valid value - * is not currently supported. - * - * @author rip-dev - */ -public interface UNSUPPORTED_POLICY_VALUE { - /** - * The Error code for PolicyError exception. - */ - final short value = (short) (4L); -}; diff --git a/src/java.corba/share/classes/org/omg/CORBA/UShortSeqHelper.java b/src/java.corba/share/classes/org/omg/CORBA/UShortSeqHelper.java deleted file mode 100644 index aa6f92fe920..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/UShortSeqHelper.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** -* The Helper for {@code UShortSeq}. For more information on -* Helper files, see -* "Generated Files: Helper Files".

            -* org/omg/CORBA/UShortSeqHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from streams.idl -* 13 May 1999 22:41:36 o'clock GMT+00:00 -* -* The class definition has been modified to conform to the following -* OMG specifications : -*

            -*/ - -public abstract class UShortSeqHelper -{ - private static String _id = "IDL:omg.org/CORBA/UShortSeq:1.0"; - - public static void insert (org.omg.CORBA.Any a, short[] that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static short[] extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ushort); - __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.UShortSeqHelper.id (), "UShortSeq", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static short[] read (org.omg.CORBA.portable.InputStream istream) - { - short value[] = null; - int _len0 = istream.read_long (); - value = new short[_len0]; - istream.read_ushort_array (value, 0, _len0); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, short[] value) - { - ostream.write_long (value.length); - ostream.write_ushort_array (value, 0, value.length); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/UShortSeqHolder.java b/src/java.corba/share/classes/org/omg/CORBA/UShortSeqHolder.java deleted file mode 100644 index d9ab4095da6..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/UShortSeqHolder.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** -* The Holder for {@code UShortSeq}. For more information on -* Holder files, see -* "Generated Files: Holder Files".

            -* org/omg/CORBA/UShortSeqHolder.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from streams.idl -* 13 May 1999 22:41:36 o'clock GMT+00:00 -*/ - -public final class UShortSeqHolder implements org.omg.CORBA.portable.Streamable -{ - public short value[] = null; - - public UShortSeqHolder () - { - } - - public UShortSeqHolder (short[] initialValue) - { - value = initialValue; - } - - public void _read (org.omg.CORBA.portable.InputStream i) - { - value = org.omg.CORBA.UShortSeqHelper.read (i); - } - - public void _write (org.omg.CORBA.portable.OutputStream o) - { - org.omg.CORBA.UShortSeqHelper.write (o, value); - } - - public org.omg.CORBA.TypeCode _type () - { - return org.omg.CORBA.UShortSeqHelper.type (); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/UnionMember.java b/src/java.corba/share/classes/org/omg/CORBA/UnionMember.java deleted file mode 100644 index 61d259331ad..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/UnionMember.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * File: ./org/omg/CORBA/UnionMember.java - * From: ./ir.idl - * Date: Fri Aug 28 16:03:31 1998 - * By: idltojava Java IDL 1.2 Aug 11 1998 02:00:18 - */ - -package org.omg.CORBA; - -/** - * A description in the Interface Repository of a member of an IDL union. - */ -public final class UnionMember implements org.omg.CORBA.portable.IDLEntity { - // instance variables - - /** - * The name of the union member described by this - * UnionMember object. - * @serial - */ - public String name; - - /** - * The label of the union member described by this - * UnionMember object. - * @serial - */ - public org.omg.CORBA.Any label; - - /** - * The type of the union member described by this - * UnionMember object. - * @serial - */ - public org.omg.CORBA.TypeCode type; - - /** - * The typedef that represents the IDL type of the union member described by this - * UnionMember object. - * @serial - */ - public org.omg.CORBA.IDLType type_def; - - // constructors - - /** - * Constructs a new UnionMember object with its fields initialized - * to null. - */ - public UnionMember() { } - - /** - * Constructs a new UnionMember object with its fields initialized - * to the given values. - * - * @param __name a String object with the name of this - * UnionMember object - * @param __label an Any object with the label of this - * UnionMember object - * @param __type a TypeCode object describing the type of this - * UnionMember object - * @param __type_def an IDLType object that represents the - * IDL type of this UnionMember object - */ - public UnionMember(String __name, org.omg.CORBA.Any __label, org.omg.CORBA.TypeCode __type, org.omg.CORBA.IDLType __type_def) { - name = __name; - label = __label; - type = __type; - type_def = __type_def; - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/UnionMemberHelper.java b/src/java.corba/share/classes/org/omg/CORBA/UnionMemberHelper.java deleted file mode 100644 index de52b2376a4..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/UnionMemberHelper.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** -* The Helper for {@code UnionMember}. For more information on -* Helper files, see -* "Generated Files: Helper Files".

            -* org/omg/CORBA/UnionMemberHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* 03 June 1999 11:33:43 o'clock GMT+00:00 -*/ - -abstract public class UnionMemberHelper -{ - private static String _id = "IDL:omg.org/CORBA/UnionMember:1.0"; - - public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.UnionMember that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static org.omg.CORBA.UnionMember extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - private static boolean __active = false; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - synchronized (org.omg.CORBA.TypeCode.class) - { - if (__typeCode == null) - { - if (__active) - { - return org.omg.CORBA.ORB.init().create_recursive_tc ( _id ); - } - __active = true; - org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [4]; - org.omg.CORBA.TypeCode _tcOf_members0 = null; - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.IdentifierHelper.id (), "Identifier", _tcOf_members0); - _members0[0] = new org.omg.CORBA.StructMember ( - "name", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_any); - _members0[1] = new org.omg.CORBA.StructMember ( - "label", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_TypeCode); - _members0[2] = new org.omg.CORBA.StructMember ( - "type", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.IDLTypeHelper.type (); - _members0[3] = new org.omg.CORBA.StructMember ( - "type_def", - _tcOf_members0, - null); - __typeCode = org.omg.CORBA.ORB.init ().create_struct_tc (org.omg.CORBA.UnionMemberHelper.id (), "UnionMember", _members0); - __active = false; - } - } - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static org.omg.CORBA.UnionMember read (org.omg.CORBA.portable.InputStream istream) - { - org.omg.CORBA.UnionMember value = new org.omg.CORBA.UnionMember (); - value.name = istream.read_string (); - value.label = istream.read_any (); - value.type = istream.read_TypeCode (); - value.type_def = org.omg.CORBA.IDLTypeHelper.read (istream); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.UnionMember value) - { - ostream.write_string (value.name); - ostream.write_any (value.label); - ostream.write_TypeCode (value.type); - org.omg.CORBA.IDLTypeHelper.write (ostream, value.type_def); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/UnknownUserException.java b/src/java.corba/share/classes/org/omg/CORBA/UnknownUserException.java deleted file mode 100644 index 4a65b0ad7f7..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/UnknownUserException.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * A class that contains user exceptions returned by the server. - * When the client uses the DII to make an invocation, any user exception - * returned from the server is enclosed in an Any object contained in the - * UnknownUserException object. This is available from the - * Environment object returned by the method Request.env. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - * @see Request - */ - -public final class UnknownUserException extends UserException { - - /** The Any instance that contains the actual user exception thrown - * by the server. - * @serial - */ - public Any except; - - /** - * Constructs an UnknownUserException object. - */ - public UnknownUserException() { - super(); - } - - /** - * Constructs an UnknownUserException object that contains the given - * Any object. - * - * @param a an Any object that contains a user exception returned - * by the server - */ - public UnknownUserException(Any a) { - super(); - except = a; - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/UnknownUserExceptionHelper.java b/src/java.corba/share/classes/org/omg/CORBA/UnknownUserExceptionHelper.java deleted file mode 100644 index 32ff8eef456..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/UnknownUserExceptionHelper.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** -* The Helper for {@code UnknownUserException}. For more information on -* Helper files, see -* "Generated Files: Helper Files".

            -* org/omg/CORBA/UnknownUserExceptionHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from CORBA.idl -* Thursday, August 24, 2000 5:52:22 PM PDT -*/ - -abstract public class UnknownUserExceptionHelper -{ - private static String _id = "IDL:omg.org/CORBA/UnknownUserException:1.0"; - - public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.UnknownUserException that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static org.omg.CORBA.UnknownUserException extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - private static boolean __active = false; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - synchronized (org.omg.CORBA.TypeCode.class) - { - if (__typeCode == null) - { - if (__active) - { - return org.omg.CORBA.ORB.init().create_recursive_tc ( _id ); - } - __active = true; - org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [1]; - org.omg.CORBA.TypeCode _tcOf_members0 = null; - _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_any); - _members0[0] = new org.omg.CORBA.StructMember ( - "except", - _tcOf_members0, - null); - __typeCode = org.omg.CORBA.ORB.init ().create_exception_tc (org.omg.CORBA.UnknownUserExceptionHelper.id (), "UnknownUserException", _members0); - __active = false; - } - } - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static org.omg.CORBA.UnknownUserException read (org.omg.CORBA.portable.InputStream istream) - { - org.omg.CORBA.UnknownUserException value = new org.omg.CORBA.UnknownUserException (); - // read and discard the repository ID - istream.read_string (); - value.except = istream.read_any (); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.UnknownUserException value) - { - // write the repository ID - ostream.write_string (id ()); - ostream.write_any (value.except); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/UnknownUserExceptionHolder.java b/src/java.corba/share/classes/org/omg/CORBA/UnknownUserExceptionHolder.java deleted file mode 100644 index ee5ccd984d7..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/UnknownUserExceptionHolder.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - -/** -* The Holder for {@code UnknownUserException}. For more information on -* Holder files, see -* "Generated Files: Holder Files".

            -* org/omg/CORBA/UnknownUserExceptionHolder.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from CORBA.idl -* Thursday, August 24, 2000 5:52:22 PM PDT -*/ - -public final class UnknownUserExceptionHolder implements org.omg.CORBA.portable.Streamable -{ - public org.omg.CORBA.UnknownUserException value = null; - - public UnknownUserExceptionHolder () - { - } - - public UnknownUserExceptionHolder (org.omg.CORBA.UnknownUserException initialValue) - { - value = initialValue; - } - - public void _read (org.omg.CORBA.portable.InputStream i) - { - value = org.omg.CORBA.UnknownUserExceptionHelper.read (i); - } - - public void _write (org.omg.CORBA.portable.OutputStream o) - { - org.omg.CORBA.UnknownUserExceptionHelper.write (o, value); - } - - public org.omg.CORBA.TypeCode _type () - { - return org.omg.CORBA.UnknownUserExceptionHelper.type (); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/UserException.java b/src/java.corba/share/classes/org/omg/CORBA/UserException.java deleted file mode 100644 index fa803d74098..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/UserException.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * The root class for CORBA IDL-defined user exceptions. - * All CORBA user exceptions are checked exceptions, which - * means that they need to - * be declared in method signatures. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - */ -public abstract class UserException extends java.lang.Exception implements org.omg.CORBA.portable.IDLEntity { - - /** - * Constructs a UserException object. - * This method is called only by subclasses. - */ - protected UserException() { - super(); - } - - /** - * Constructs a UserException object with a - * detail message. This method is called only by subclasses. - * - * @param reason a String object giving the reason for this - * exception - */ - protected UserException(String reason) { - super(reason); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/VM_ABSTRACT.java b/src/java.corba/share/classes/org/omg/CORBA/VM_ABSTRACT.java deleted file mode 100644 index 8bbc8f7234f..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/VM_ABSTRACT.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** Defines the code used to represent an Abstract interface in -* a typecode. -* This is one of the possible results of the type_modified -* method on the TypeCode interface. -* @see org.omg.CORBA.TypeCode -*/ -public interface VM_ABSTRACT { - /** The value representing an abstract interface value type in - * a typecode. - */ - final short value = (short) (2L); -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/VM_CUSTOM.java b/src/java.corba/share/classes/org/omg/CORBA/VM_CUSTOM.java deleted file mode 100644 index d9b40343f24..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/VM_CUSTOM.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** Defines the code used to represent a custom marshalled value type in -* a typecode. -* This is one of the possible results of the type_modifier -* method on the TypeCode interface. -* @see org.omg.CORBA.TypeCode -*/ -public interface VM_CUSTOM { - /** The value representing a custom marshalled value type in - * a typecode. - */ - final short value = (short) (1L); -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/VM_NONE.java b/src/java.corba/share/classes/org/omg/CORBA/VM_NONE.java deleted file mode 100644 index ec0fac4d66b..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/VM_NONE.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * Defines the code used to represent the one of the values of a value type - * in a typecode. - * - * @author OMG - * @see org.omg.CORBA.TypeCode - * @since JDK1.2 - */ - - -public interface VM_NONE { - /** - * The value representing the value type in a typecode as per - * CORBA 2.3 spec. - */ - final short value = (short) (0L); -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/VM_TRUNCATABLE.java b/src/java.corba/share/classes/org/omg/CORBA/VM_TRUNCATABLE.java deleted file mode 100644 index d2cee0b8bfb..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/VM_TRUNCATABLE.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** Defines the code used to represent a truncatable value type in -* a typecode. A value type is truncatable if it inherits "safely" -* from another value type, which means it can be cast to a more -* general inherited type. -* This is one of the possible results of the type_modifier -* method on the TypeCode interface. -* @see org.omg.CORBA.TypeCode -*/ -public interface VM_TRUNCATABLE { - /** The value representing a truncatable value type in - * a typecode. - */ - final short value = (short) (3L); -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ValueBaseHelper.java b/src/java.corba/share/classes/org/omg/CORBA/ValueBaseHelper.java deleted file mode 100644 index 68a106636ee..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ValueBaseHelper.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - /** - * The Helper for {@code ValueBase}. For more information on - * Helper files, see - * "Generated Files: Helper Files".

            - */ - -/* - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package org.omg.CORBA; - -abstract public class ValueBaseHelper -{ - private static String _id = "IDL:omg.org/CORBA/ValueBase:1.0"; - - public static void insert (org.omg.CORBA.Any a, java.io.Serializable that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static java.io.Serializable extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (TCKind.tk_value); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static java.io.Serializable read (org.omg.CORBA.portable.InputStream istream) - { - return ((org.omg.CORBA_2_3.portable.InputStream)istream).read_value (); - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, java.io.Serializable value) - { - ((org.omg.CORBA_2_3.portable.OutputStream)ostream).write_value (value); - } - - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ValueBaseHolder.java b/src/java.corba/share/classes/org/omg/CORBA/ValueBaseHolder.java deleted file mode 100644 index 364aba7b562..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ValueBaseHolder.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -import org.omg.CORBA.portable.Streamable; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.OutputStream; - -/** - * The Holder for {@code ValueBase}. For more information on - * Holder files, see - * "Generated Files: Holder Files".

            - * A Holder class for a {@code java.io.Serializable} - * that is used to store "out" and "inout" parameters in IDL methods. - * If an IDL method signature has an IDL {@code ValueBase} as an "out" - * or "inout" parameter, the programmer must pass an instance of - * {@code ValueBaseHolder} as the corresponding - * parameter in the method invocation; for "inout" parameters, the programmer - * must also fill the "in" value to be sent to the server. - * Before the method invocation returns, the ORB will fill in the - * value corresponding to the "out" value returned from the server. - *

            - * If {@code myValueBaseHolder} is an instance of {@code ValueBaseHolder}, - * the value stored in its {@code value} field can be accessed with - * {@code myValueBaseHolder.value}. - * - */ -public final class ValueBaseHolder implements Streamable { - - /** - * The {@code java.io.Serializable} value held by this - * {@code ValueBaseHolder} object. - */ - public java.io.Serializable value; - - /** - * Constructs a new {@code ValueBaseHolder} object with its - * {@code value} field initialized to {@code 0}. - */ - public ValueBaseHolder() { - } - - /** - * Constructs a new {@code ValueBaseHolder} object with its - * {@code value} field initialized to the given - * {@code java.io.Serializable}. - * @param initial the {@code java.io.Serializable} with which to initialize - * the {@code value} field of the newly-created - * {@code ValueBaseHolder} object - */ - public ValueBaseHolder(java.io.Serializable initial) { - value = initial; - } - - /** - * Reads from {@code input} and initalizes the value in the Holder - * with the unmarshalled data. - * - * @param input the InputStream containing CDR formatted data from the wire - */ - public void _read(InputStream input) { - value = ((org.omg.CORBA_2_3.portable.InputStream)input).read_value(); - } - - /** - * Marshals to {@code output} the value in the Holder. - * - * @param output the OutputStream which will contain the CDR formatted data - */ - public void _write(OutputStream output) { - ((org.omg.CORBA_2_3.portable.OutputStream)output).write_value(value); - } - - /** - * Returns the {@code TypeCode} object - * corresponding to the value held in the Holder. - * - * @return the TypeCode of the value held in the holder - */ - public org.omg.CORBA.TypeCode _type() { - return ORB.init().get_primitive_tc(TCKind.tk_value); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ValueMember.java b/src/java.corba/share/classes/org/omg/CORBA/ValueMember.java deleted file mode 100644 index 64779380eff..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ValueMember.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * File: ./org/omg/CORBA/ValueMember.java - * From: ./ir.idl - * Date: Fri Aug 28 16:03:31 1998 - * By: idltojava Java IDL 1.2 Aug 11 1998 02:00:18 - */ - -package org.omg.CORBA; - -/** - * A description in the Interface Repository of - * a member of a value object. - */ -public final class ValueMember implements org.omg.CORBA.portable.IDLEntity { - - // instance variables - - /** - * The name of the value member described by this - * ValueMember object. - * @serial - */ - public String name; - - /** - * The repository ID of the value member described by - * this ValueMember object; - * @serial - */ - public String id; - - /** - * The repository ID of the value in which this member - * is defined. - * @serial - */ - public String defined_in; - - /** - * The version of the value in which this member is defined. - * @serial - */ - public String version; - - /** - * The type of of this value member. - * @serial - */ - public org.omg.CORBA.TypeCode type; - - /** - * The typedef that represents the IDL type of the value - * member described by this ValueMember object. - * @serial - */ - public org.omg.CORBA.IDLType type_def; - - /** - * The type of access (public, private) for the value - * member described by this ValueMember object. - * @serial - */ - public short access; - // constructors - - /** - * Constructs a default ValueMember object. - */ - public ValueMember() { } - - /** - * Constructs a ValueMember object initialized with - * the given values. - * - *@param __name The name of the value member described by this - * ValueMember object. - *@param __id The repository ID of the value member described by - * this ValueMember object; - *@param __defined_in The repository ID of the value in which this member - * is defined. - *@param __version The version of the value in which this member is defined. - *@param __type The type of of this value member. - *@param __type_def The typedef that represents the IDL type of the value - * member described by this ValueMember object. - *@param __access The type of access (public, private) for the value - * member described by this ValueMember object. - */ - public ValueMember(String __name, String __id, String __defined_in, String __version, org.omg.CORBA.TypeCode __type, org.omg.CORBA.IDLType __type_def, short __access) { - name = __name; - id = __id; - defined_in = __defined_in; - version = __version; - type = __type; - type_def = __type_def; - access = __access; - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/ValueMemberHelper.java b/src/java.corba/share/classes/org/omg/CORBA/ValueMemberHelper.java deleted file mode 100644 index ac3130c3dfc..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ValueMemberHelper.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** -* The Helper for {@code ValueMember}. For more information on -* Helper files, see -* "Generated Files: Helper Files".

            -* org/omg/CORBA/ValueMemberHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* 03 June 1999 11:33:44 o'clock GMT+00:00 -*/ - -abstract public class ValueMemberHelper -{ - private static String _id = "IDL:omg.org/CORBA/ValueMember:1.0"; - - public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.ValueMember that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static org.omg.CORBA.ValueMember extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - private static boolean __active = false; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - synchronized (org.omg.CORBA.TypeCode.class) - { - if (__typeCode == null) - { - if (__active) - { - return org.omg.CORBA.ORB.init().create_recursive_tc ( _id ); - } - __active = true; - org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [7]; - org.omg.CORBA.TypeCode _tcOf_members0 = null; - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.IdentifierHelper.id (), "Identifier", _tcOf_members0); - _members0[0] = new org.omg.CORBA.StructMember ( - "name", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.RepositoryIdHelper.id (), "RepositoryId", _tcOf_members0); - _members0[1] = new org.omg.CORBA.StructMember ( - "id", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.RepositoryIdHelper.id (), "RepositoryId", _tcOf_members0); - _members0[2] = new org.omg.CORBA.StructMember ( - "defined_in", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.VersionSpecHelper.id (), "VersionSpec", _tcOf_members0); - _members0[3] = new org.omg.CORBA.StructMember ( - "version", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_TypeCode); - _members0[4] = new org.omg.CORBA.StructMember ( - "type", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.IDLTypeHelper.type (); - _members0[5] = new org.omg.CORBA.StructMember ( - "type_def", - _tcOf_members0, - null); - _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_short); - _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.VisibilityHelper.id (), "Visibility", _tcOf_members0); - _members0[6] = new org.omg.CORBA.StructMember ( - "access", - _tcOf_members0, - null); - __typeCode = org.omg.CORBA.ORB.init ().create_struct_tc (org.omg.CORBA.ValueMemberHelper.id (), "ValueMember", _members0); - __active = false; - } - } - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static org.omg.CORBA.ValueMember read (org.omg.CORBA.portable.InputStream istream) - { - org.omg.CORBA.ValueMember value = new org.omg.CORBA.ValueMember (); - value.name = istream.read_string (); - value.id = istream.read_string (); - value.defined_in = istream.read_string (); - value.version = istream.read_string (); - value.type = istream.read_TypeCode (); - value.type_def = org.omg.CORBA.IDLTypeHelper.read (istream); - value.access = istream.read_short (); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.ValueMember value) - { - ostream.write_string (value.name); - ostream.write_string (value.id); - ostream.write_string (value.defined_in); - ostream.write_string (value.version); - ostream.write_TypeCode (value.type); - org.omg.CORBA.IDLTypeHelper.write (ostream, value.type_def); - ostream.write_short (value.access); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/VersionSpecHelper.java b/src/java.corba/share/classes/org/omg/CORBA/VersionSpecHelper.java deleted file mode 100644 index d4bf84572fd..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/VersionSpecHelper.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** -* The Helper for {@code VersionSpec}. For more information on -* Helper files, see -* "Generated Files: Helper Files".

            -* org/omg/CORBA/VersionSpecHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* 03 June 1999 11:33:43 o'clock GMT+00:00 -*/ - -abstract public class VersionSpecHelper -{ - private static String _id = "IDL:omg.org/CORBA/VersionSpec:1.0"; - - public static void insert (org.omg.CORBA.Any a, String that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static String extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_string_tc (0); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.VersionSpecHelper.id (), "VersionSpec", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static String read (org.omg.CORBA.portable.InputStream istream) - { - String value = null; - value = istream.read_string (); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, String value) - { - ostream.write_string (value); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/VisibilityHelper.java b/src/java.corba/share/classes/org/omg/CORBA/VisibilityHelper.java deleted file mode 100644 index 5db6c4e2b8a..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/VisibilityHelper.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** -* The Helper for {@code Visibility}. For more information on -* Helper files, see -* "Generated Files: Helper Files".

            -* org/omg/CORBA/VisibilityHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl -* 03 June 1999 11:33:44 o'clock GMT+00:00 -*/ - - -// orbos 98-01-18: Objects By Value -- begin -abstract public class VisibilityHelper -{ - private static String _id = "IDL:omg.org/CORBA/Visibility:1.0"; - - public static void insert (org.omg.CORBA.Any a, short that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static short extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_short); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.VisibilityHelper.id (), "Visibility", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static short read (org.omg.CORBA.portable.InputStream istream) - { - short value = (short)0; - value = istream.read_short (); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, short value) - { - ostream.write_short (value); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/WCharSeqHelper.java b/src/java.corba/share/classes/org/omg/CORBA/WCharSeqHelper.java deleted file mode 100644 index 10d3d7cbf62..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/WCharSeqHelper.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** -* The Helper for {@code WCharSeq}. For more information on -* Helper files, see -* "Generated Files: Helper Files".

            -* org/omg/CORBA/WCharSeqHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from streams.idl -* 13 May 1999 22:41:36 o'clock GMT+00:00 -* -* The class definition has been modified to conform to the following -* OMG specifications : -*

            -*/ - -public abstract class WCharSeqHelper -{ - private static String _id = "IDL:omg.org/CORBA/WCharSeq:1.0"; - - public static void insert (org.omg.CORBA.Any a, char[] that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static char[] extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_wchar); - __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); - __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.WCharSeqHelper.id (), "WCharSeq", __typeCode); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static char[] read (org.omg.CORBA.portable.InputStream istream) - { - char value[] = null; - int _len0 = istream.read_long (); - value = new char[_len0]; - istream.read_wchar_array (value, 0, _len0); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, char[] value) - { - ostream.write_long (value.length); - ostream.write_wchar_array (value, 0, value.length); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/WCharSeqHolder.java b/src/java.corba/share/classes/org/omg/CORBA/WCharSeqHolder.java deleted file mode 100644 index af9aac4ec5d..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/WCharSeqHolder.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** -* The Holder for {@code WCharSeq}. For more information on -* Holder files, see -* "Generated Files: Holder Files".

            -* org/omg/CORBA/WCharSeqHolder.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from streams.idl -* 13 May 1999 22:41:36 o'clock GMT+00:00 -*/ - -public final class WCharSeqHolder implements org.omg.CORBA.portable.Streamable -{ - public char value[] = null; - - public WCharSeqHolder () - { - } - - public WCharSeqHolder (char[] initialValue) - { - value = initialValue; - } - - public void _read (org.omg.CORBA.portable.InputStream i) - { - value = org.omg.CORBA.WCharSeqHelper.read (i); - } - - public void _write (org.omg.CORBA.portable.OutputStream o) - { - org.omg.CORBA.WCharSeqHelper.write (o, value); - } - - public org.omg.CORBA.TypeCode _type () - { - return org.omg.CORBA.WCharSeqHelper.type (); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/WStringValueHelper.java b/src/java.corba/share/classes/org/omg/CORBA/WStringValueHelper.java deleted file mode 100644 index fa14f5ee55c..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/WStringValueHelper.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/** -* The Helper for {@code WStringValue}. For more information on -* Helper files, see -* "Generated Files: Helper Files".

            -*/ - -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package org.omg.CORBA; - -/** -* org/omg/CORBA/WStringValueHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from orb.idl -* 31 May 1999 22:27:30 o'clock GMT+00:00 -* -* The class definition has been modified to conform to the following -* OMG specifications : -*

            -*/ - -public class WStringValueHelper implements org.omg.CORBA.portable.BoxedValueHelper -{ - private static String _id = "IDL:omg.org/CORBA/WStringValue:1.0"; - - private static WStringValueHelper _instance = new WStringValueHelper (); - - public static void insert (org.omg.CORBA.Any a, String that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static String extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - private static boolean __active = false; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - synchronized (org.omg.CORBA.TypeCode.class) - { - if (__typeCode == null) - { - if (__active) - { - return org.omg.CORBA.ORB.init().create_recursive_tc ( _id ); - } - __active = true; - __typeCode = org.omg.CORBA.ORB.init ().create_wstring_tc (0); - __typeCode = org.omg.CORBA.ORB.init ().create_value_box_tc (_id, "WStringValue", __typeCode); - __active = false; - } - } - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static String read (org.omg.CORBA.portable.InputStream istream) - { - if (!(istream instanceof org.omg.CORBA_2_3.portable.InputStream)) { - throw new org.omg.CORBA.BAD_PARAM(); } - return (String) ((org.omg.CORBA_2_3.portable.InputStream) istream).read_value (_instance); - } - - public java.io.Serializable read_value (org.omg.CORBA.portable.InputStream istream) - { - String tmp; - tmp = istream.read_wstring (); - return (java.io.Serializable) tmp; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, String value) - { - if (!(ostream instanceof org.omg.CORBA_2_3.portable.OutputStream)) { - throw new org.omg.CORBA.BAD_PARAM(); } - ((org.omg.CORBA_2_3.portable.OutputStream) ostream).write_value (value, _instance); - } - - public void write_value (org.omg.CORBA.portable.OutputStream ostream, java.io.Serializable value) - { - if (!(value instanceof String)) { - throw new org.omg.CORBA.MARSHAL(); } - String valueType = (String) value; - ostream.write_wstring (valueType); - } - - public String get_id () - { - return _id; - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/WrongTransaction.java b/src/java.corba/share/classes/org/omg/CORBA/WrongTransaction.java deleted file mode 100644 index a9670d271d7..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/WrongTransaction.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA; - -/** - * The CORBA WrongTransaction user-defined exception. - * This exception is thrown only by the methods - * Request.get_response - * and ORB.get_next_response when they are invoked - * from a transaction scope that is different from the one in - * which the client originally sent the request. - * See the OMG Transaction Service Specification for details. - * - *

            See also {@extLink jidlexception documentation on Java IDL exceptions}. - *

            - */ - -public final class WrongTransaction extends UserException { - /** - * Constructs a WrongTransaction object with an empty detail message. - */ - public WrongTransaction() { - super(WrongTransactionHelper.id()); - } - - /** - * Constructs a WrongTransaction object with the given detail message. - * @param reason The detail message explaining what caused this exception to be thrown. - */ - public WrongTransaction(String reason) { - super(WrongTransactionHelper.id() + " " + reason); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/WrongTransactionHelper.java b/src/java.corba/share/classes/org/omg/CORBA/WrongTransactionHelper.java deleted file mode 100644 index b87ed34261c..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/WrongTransactionHelper.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - -/** -* The Helper for {@code WrongTransaction}. For more information on -* Helper files, see -* "Generated Files: Helper Files".

            -* org/omg/CORBA/WrongTransactionHelper.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from CORBA.idl -* Thursday, August 24, 2000 5:32:50 PM PDT -*/ - -abstract public class WrongTransactionHelper -{ - private static String _id = "IDL:omg.org/CORBA/WrongTransaction:1.0"; - - public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.WrongTransaction that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static org.omg.CORBA.WrongTransaction extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - private static boolean __active = false; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - synchronized (org.omg.CORBA.TypeCode.class) - { - if (__typeCode == null) - { - if (__active) - { - return org.omg.CORBA.ORB.init().create_recursive_tc ( _id ); - } - __active = true; - org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [0]; - org.omg.CORBA.TypeCode _tcOf_members0 = null; - __typeCode = org.omg.CORBA.ORB.init ().create_exception_tc (org.omg.CORBA.WrongTransactionHelper.id (), "WrongTransaction", _members0); - __active = false; - } - } - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static org.omg.CORBA.WrongTransaction read (org.omg.CORBA.portable.InputStream istream) - { - org.omg.CORBA.WrongTransaction value = new org.omg.CORBA.WrongTransaction (); - // read and discard the repository ID - istream.read_string (); - return value; - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.WrongTransaction value) - { - // write the repository ID - ostream.write_string (id ()); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/WrongTransactionHolder.java b/src/java.corba/share/classes/org/omg/CORBA/WrongTransactionHolder.java deleted file mode 100644 index d33ba970aaf..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/WrongTransactionHolder.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - -/** -* The Holder for {@code WrongTransaction}. For more information on -* Holder files, see -* "Generated Files: Holder Files".

            -* org/omg/CORBA/WrongTransactionHolder.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from CORBA.idl -* Thursday, August 24, 2000 5:32:50 PM PDT -*/ - -public final class WrongTransactionHolder implements org.omg.CORBA.portable.Streamable -{ - public org.omg.CORBA.WrongTransaction value = null; - - public WrongTransactionHolder () - { - } - - public WrongTransactionHolder (org.omg.CORBA.WrongTransaction initialValue) - { - value = initialValue; - } - - public void _read (org.omg.CORBA.portable.InputStream i) - { - value = org.omg.CORBA.WrongTransactionHelper.read (i); - } - - public void _write (org.omg.CORBA.portable.OutputStream o) - { - org.omg.CORBA.WrongTransactionHelper.write (o, value); - } - - public org.omg.CORBA.TypeCode _type () - { - return org.omg.CORBA.WrongTransactionHelper.type (); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/_IDLTypeStub.java b/src/java.corba/share/classes/org/omg/CORBA/_IDLTypeStub.java deleted file mode 100644 index 5607d70fbc0..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/_IDLTypeStub.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** -* The Stub for {@code IDLType}. For more information on -* Stub files, see -* "Generated Files: Stubs".

            -* org/omg/CORBA/_IDLTypeStub.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ir.idl. -* 03 June 1999 11:33:44 o'clock GMT+00:00 -*/ - -public class _IDLTypeStub extends org.omg.CORBA.portable.ObjectImpl implements org.omg.CORBA.IDLType -{ - /** - * Constructs a default {@code _IDLTypeStub} object. - * NOTE: If the default constructor is used, the - * object is useless until the method {@code _set_delegate} - * has been called. - */ - // NOTE: This constructor is not required according to the spec. Only JCK expects it now. - public _IDLTypeStub () - { - super (); - } - - /** - * Constructs an {@code _IDLTypeStub} object initialized - * with the given {@code Delegate} object. - * - * @param delegate a Delegate object - */ - // NOTE: This constructor is not required according to the spec. We keep it as a convenience method. - public _IDLTypeStub (org.omg.CORBA.portable.Delegate delegate) - { - super (); - _set_delegate (delegate); - } - - public org.omg.CORBA.TypeCode type () - { - org.omg.CORBA.portable.InputStream _in = null; - try { - org.omg.CORBA.portable.OutputStream _out = _request ("_get_type", true); - _in = _invoke (_out); - org.omg.CORBA.TypeCode __result = _in.read_TypeCode (); - return __result; - } catch (org.omg.CORBA.portable.ApplicationException _ex) { - _in = _ex.getInputStream (); - String _id = _ex.getId (); - throw new org.omg.CORBA.MARSHAL (_id); - } catch (org.omg.CORBA.portable.RemarshalException _rm) { - return type (); - } finally { - _releaseReply (_in); - } - } // type - - - // read interface - public org.omg.CORBA.DefinitionKind def_kind () - { - org.omg.CORBA.portable.InputStream _in = null; - try { - org.omg.CORBA.portable.OutputStream _out = _request ("_get_def_kind", true); - _in = _invoke (_out); - org.omg.CORBA.DefinitionKind __result = org.omg.CORBA.DefinitionKindHelper.read (_in); - return __result; - } catch (org.omg.CORBA.portable.ApplicationException _ex) { - _in = _ex.getInputStream (); - String _id = _ex.getId (); - throw new org.omg.CORBA.MARSHAL (_id); - } catch (org.omg.CORBA.portable.RemarshalException _rm) { - return def_kind (); - } finally { - _releaseReply (_in); - } - } // def_kind - - - // write interface - public void destroy () - { - org.omg.CORBA.portable.InputStream _in = null; - try { - org.omg.CORBA.portable.OutputStream _out = _request ("destroy", true); - _in = _invoke (_out); - } catch (org.omg.CORBA.portable.ApplicationException _ex) { - _in = _ex.getInputStream (); - String _id = _ex.getId (); - throw new org.omg.CORBA.MARSHAL (_id); - } catch (org.omg.CORBA.portable.RemarshalException _rm) { - destroy (); - } finally { - _releaseReply (_in); - } - } // destroy - - // Type-specific CORBA::Object operations - private static String[] __ids = { - "IDL:omg.org/CORBA/IDLType:1.0", - "IDL:omg.org/CORBA/IRObject:1.0"}; - - public String[] _ids () - { - return (String[])__ids.clone (); - } - - private void readObject (java.io.ObjectInputStream s) - { - try - { - String str = s.readUTF (); - org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init ().string_to_object (str); - org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate (); - _set_delegate (delegate); - } catch (java.io.IOException e) {} - } - - private void writeObject (java.io.ObjectOutputStream s) - { - try - { - String str = org.omg.CORBA.ORB.init ().object_to_string (this); - s.writeUTF (str); - } catch (java.io.IOException e) {} - } -} // class _IDLTypeStub diff --git a/src/java.corba/share/classes/org/omg/CORBA/_PolicyStub.java b/src/java.corba/share/classes/org/omg/CORBA/_PolicyStub.java deleted file mode 100644 index 4312fd753c0..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/_PolicyStub.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA; - - -/** -* The Stub for {@code Policy}. For more information on -* Stub files, see -* "Generated Files: Stubs".

            -* org/omg/CORBA/_PolicyStub.java -* Generated by the IDL-to-Java compiler (portable), version "3.0" -* from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl. -* Saturday, July 17, 1999 12:26:20 AM PDT -*/ - -public class _PolicyStub extends org.omg.CORBA.portable.ObjectImpl implements org.omg.CORBA.Policy -{ - /** Constructors - * NOTE: If the default constructor is used, the - * object is useless until _set_delegate (...) - * is called. - */ - public _PolicyStub () - { - super (); - } - - /** Constructs a {@code _PolicyStub} object initialized - * with the given {@code Delegate} object. - * - * @param delegate a Delegate Object - */ - public _PolicyStub (org.omg.CORBA.portable.Delegate delegate) - { - super (); - _set_delegate (delegate); - } - - - /** Returns the constant value that corresponds to the - * type of the policy object. The values of - * the polivy objectys are allocated by the OMG. - * New values for PolicyType should be obtained from the OMG by - * sending mail to request@omg.org. In general the constant - * values that are allocated are defined in conjunction with - * the definition of the corresponding policy object. - * @return the constant value that corresponds to the type of - * the policy object. - */ - public int policy_type () - { - org.omg.CORBA.portable.InputStream _in = null; - try { - org.omg.CORBA.portable.OutputStream _out = _request ("_get_policy_type", true); - _in = _invoke (_out); - int __result = org.omg.CORBA.PolicyTypeHelper.read (_in); - return __result; - } catch (org.omg.CORBA.portable.ApplicationException _ex) { - _in = _ex.getInputStream (); - String _id = _ex.getId (); - throw new org.omg.CORBA.MARSHAL (_id); - } catch (org.omg.CORBA.portable.RemarshalException _rm) { - return policy_type (); - } finally { - _releaseReply (_in); - } - } // policy_type - - - /** Copies the policy object. The copy does not retain any - * relationships that the policy had with any domain or object. - * @return the copy of the policy object. - */ - public org.omg.CORBA.Policy copy () - { - org.omg.CORBA.portable.InputStream _in = null; - try { - org.omg.CORBA.portable.OutputStream _out = _request ("copy", true); - _in = _invoke (_out); - org.omg.CORBA.Policy __result = org.omg.CORBA.PolicyHelper.read (_in); - return __result; - } catch (org.omg.CORBA.portable.ApplicationException _ex) { - _in = _ex.getInputStream (); - String _id = _ex.getId (); - throw new org.omg.CORBA.MARSHAL (_id); - } catch (org.omg.CORBA.portable.RemarshalException _rm) { - return copy (); - } finally { - _releaseReply (_in); - } - } // copy - - - /** Destroys the policy object. It is the responsibility of - * the policy object to determine whether it can be destroyed. - */ - public void destroy () - { - org.omg.CORBA.portable.InputStream _in = null; - try { - org.omg.CORBA.portable.OutputStream _out = _request ("destroy", true); - _in = _invoke (_out); - } catch (org.omg.CORBA.portable.ApplicationException _ex) { - _in = _ex.getInputStream (); - String _id = _ex.getId (); - throw new org.omg.CORBA.MARSHAL (_id); - } catch (org.omg.CORBA.portable.RemarshalException _rm) { - destroy (); - } finally { - _releaseReply (_in); - } - } // destroy - - // Type-specific CORBA::Object operations - private static String[] __ids = { - "IDL:omg.org/CORBA/Policy:1.0"}; - - public String[] _ids () - { - return (String[])__ids.clone (); - } - - private void readObject (java.io.ObjectInputStream s) - { - try - { - String str = s.readUTF (); - org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init ().string_to_object (str); - org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate (); - _set_delegate (delegate); - } catch (java.io.IOException e) {} - } - - private void writeObject (java.io.ObjectOutputStream s) - { - try - { - String str = org.omg.CORBA.ORB.init ().object_to_string (this); - s.writeUTF (str); - } catch (java.io.IOException e) {} - } -} // class _PolicyStub diff --git a/src/java.corba/share/classes/org/omg/CORBA/doc-files/compliance.html b/src/java.corba/share/classes/org/omg/CORBA/doc-files/compliance.html deleted file mode 100644 index bd0a50c4b24..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/doc-files/compliance.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - Official Specifications for CORBA support in Java[tm] SE 6 - - - -

            -Official Specifications for CORBA support in Java[tm] SE 6

            - -

            -Specification References

            -The specifications with which the Java[tm] Platform, Standard Edition (Java SE) v.1.6.0 - ORB complies are as follows. If these links do not take you to the referenced - specification, the OMG may have changed the URL, and you can link to www.omg.org to search for the correct specification. - -These are the only specifications referenced by this document. - - -

            -Supported Specification Details

            -Not all of the above specifications are currently implemented in the ORB -in Java[tm] SE 6. The precise list of supported sections is as follows: -
              -
            • -CORBA 2.3.1 chapters 1-3 and 6-9
            • - -
            • Revised IDL to Java language mapping, section 1.21.8.2, the orb.properties -file.
            • - -
            • -CORBA 2.3.1 chapter 4 with the following replacements from the Portable -Interceptors specification: -
                -
              • section 4.2.3.5 destroy
              • -
              • section 4.5.2 CodeFactory and PICurrent are required
              • -
              • Section 4.5.3.4 as updated for register_initial_reference
              • -
              -
            • - -
            • -CORBA 2.3.1 chapter 5 with the following update from the Portable Interceptors -specification: -
                -
              • - 5.5.2 StringSeq and WStringSeq are required. - This adds the following classes to org.omg.CORBA: -
                  -
                • StringSeqHolder
                • -
                • StringSeqHelper
                • -
                • WStringSeqHolder
                • -
                • WStringSeqHelper
                • -
                -
              • -
              -
            • - -
            • -CORBA 2.3.1 sections 10.6.1 and 10.6.2 are supported for repository IDs.
            • - -
            • -CORBA 2.3.1 section 10.7 for TypeCode APIs.
            • - -
            • -CORBA 2.3.1 chapter 11, Portable Object Adapter (POA), -with the following updates from the Portable Interceptors specification: -
                -
              • Section 11.3.7 POAs must preserve all policies
              • -
              • Section 11.3.8.2 again states that POAs must preserve all policies
              • -
              • Section 11.3.8.26 POA::id is required.
              • -
              -
            • - -
            • -CORBA 2.3.1 chapters 13 and 15 define GIOP 1.0, 1.1, and 1.2. The Java SE 6 -ORB fully supports all versions of GIOP, with the exception that the bi-directional -GIOP feature defined in sections 15.8 and 15.9 is not supported.
            • - -
            • -All of the Interoperable Naming Service is supported.
            • - -
            • -Portable Interceptors section 13.8 (the new -Coder/Decoder interfaces) -and all of chapter 21 (the interceptor specification).
            • - -
            • Section 1.21.8 of the Revised IDL to Java Language -Mapping Specification (ptc/00-11-03) -has been changed from the version in the -IDL to Java Language Mapping Specification (ptc/00-01-08).
            • -
            - -

            -Tools

            - -
              -
            • The IDL to Java compiler (idlj) complies with: -
                -
              • CORBA 2.3.1 chapter 3 (IDL definition)
              • -
              • CORBA 2.3.1 chapters 5 and 6 (semantics of Value types)
              • -
              • CORBA 2.3.1 section 10.6.5 (pragmas)
              • -
              • The IDL to Java mapping specification
              • -
              • The Revised IDL to Java language mapping specification section 1.12.1 "local interfaces"
              • -
              -
            • - -
            • The Java to IDL compiler (the IIOP backend for rmic) complies with: -
                -
              • CORBA 2.3.1 chapters 5 and 6 (value types)
              • -
              • The Java to IDL language mapping. Note that this implicitly references - section 1.21 of the IDL to Java language mapping
              • -
              • IDL generated by the -idl flag complies with CORBA 2.3.1 chapter 3.
              • -
              -
            • -
            - - - diff --git a/src/java.corba/share/classes/org/omg/CORBA/doc-files/generatedfiles.html b/src/java.corba/share/classes/org/omg/CORBA/doc-files/generatedfiles.html deleted file mode 100644 index 9ad20165829..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/doc-files/generatedfiles.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - IDL-to-Java Generated Files - - - -

            IDL-to-Java Generated Files

            - -

            The files that are generated by the IDL-to-Java compiler, in accordance with -the -IDL-to-Java Language Mapping Specification, -which is implemented in Java™ SE 6 -according the compliance document. - - -

            In general IDL names and identifiers are mapped to Java names -and identifiers with no change. Because of the nature of the Java language, -a single IDL construct may be mapped to several (differently named) Java constructs. -The additional names are constructed by appending a descriptive suffix. -For example, the IDL interface foo is mapped to the Java -interfaces foo and fooOperations, and additional -Java classes fooHelper, fooHolder, fooPOA, -and optionally fooPOATie. - - - -

            The mapping in effect reserves the use of several names for its own purposes. These are: -

              -
            • The Java class <type>Helper, -where <type> is the name of an IDL defined type. -
            • The Java class <type>Holder, -where <type> -is the name of an IDL defined type (with certain exceptions such as typedef aliases). -
            • The Java classes <basicJavaType>Holder, where <basicJavaType> -is one of the Java primitive datatypes that is used by one of the IDL basic datatypes. -
            • The Java classes <interface>Operations, <interface>POA, -and <interface>POATie, where <interface> is the name of an IDL interface type. -
            • The nested scope Java package name <interface>Package, where <interface> -is the name of an IDL interface. -
            - - -

            Helper Files

            - -

            Helper files supply several static methods needed to manipulate the type. -These include Any insert and extract operations for the type, -getting the repository id, getting the typecode, and reading -and writing the type from and to a stream. - -

            The helper class for a mapped IDL interface or abstract interface also -include narrow operation(s). The static narrow method allows an org.omg.CORBA.Object -to be narrowed to the object reference of a more specific type. -The IDL exception CORBA::BAD_PARAM is thrown if the narrow fails because -the object reference does not support the requested type. A different system exception -is raised to indicate other kinds of errors. Trying to narrow -a null will always succeed with a return value of null. - -

            Holder Files

            - -

            Support for out and inout parameter passing modes requires the use of additional holder classes. -These classes are available for all of the basic IDL datatypes in the org.omg.CORBA package -and are generated for all named user defined IDL types except those defined by typedefs. -(Note that in this context user defined includes types that are defined in OMG specifications -such as those for the Interface Repository, and other OMG services.) - -

            Each holder class has a constructor from an instance, a default constructor, and has -a public instance member, value which is the typed value. The default constructor -sets the value field to the default value for the type as defined by the Java language: -false for boolean, 0 for numeric and char types, null for strings, null for object references. - -

            To support portable stubs and skeletons, holder classes also implement -the org.omg.CORBA.portable.Streamable interface. - - -

            Operations Files

            - -

            A non abstract IDL interface is mapped to two public Java interfaces: -a signature interface and an operations interface. -The signature interface, which extends IDLEntity, has the same -name as the IDL interface name and is used -as the signature type in method declarations -when interfaces of the specified type are used in other interfaces. -The operations interface has the same name as the IDL interface -with the suffix Operations -appended to the end and is used in the server-side mapping and as a mechanism -for providing optimized calls for collocated client and servers. - -

            The Java operations interface contains the mapped operation signatures. -The Java signature interface extends the operations interface, -the (mapped) base org.omg.CORBA.Object, -as well as org.omg.portable.IDLEntity. -Methods can be invoked on the signature interface. Interface inheritance -expressed in IDL is reflected in both the Java signature -interface and operations interface hierarchies. - - -

            Stubs

            - -

            For the mapping of a non-object-oriented language, there will be -a programming interface to the stubs for each interface type. Generally, the stubs -will present access to the OMG IDL-defined operations on an object in a way that is easy -for programmers to predict once they are familiar with OMG IDL and the language mapping -for the particular programming language. The stubs make calls on the rest of the ORB -using interfaces that are private to, and presumably optimized for, the particular ORB Core. -If more than one ORB is available, there may be different stubs -corresponding to the different ORBs. In this case, it is necessary for -the ORB and language mapping to cooperate to associate -the correct stubs with the particular object reference. - -

            Object-oriented programming languages, such as Java, -C++, and Smalltalk, do not require stub interfaces. - -

            - - - diff --git a/src/java.corba/share/classes/org/omg/CORBA/ir.idl b/src/java.corba/share/classes/org/omg/CORBA/ir.idl deleted file mode 100644 index 656d163a6b3..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/ir.idl +++ /dev/null @@ -1,793 +0,0 @@ -/* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * This file contains OMG IDL from CORBA V2.0, July 1995. - * It also contains the TypeCode creation APIs in CORBA::ORB - **/ - -#pragma prefix "omg.org" -//#pragma javaPackage org.omg - -module CORBA { - typedef string Identifier; - typedef string ScopedName; - typedef string RepositoryId; - - enum DefinitionKind { - dk_none, dk_all, - dk_Attribute, dk_Constant, dk_Exception, dk_Interface, - dk_Module, dk_Operation, dk_Typedef, - dk_Alias, dk_Struct, dk_Union, dk_Enum, - dk_Primitive, dk_String, dk_Sequence, dk_Array, - dk_Repository, - dk_Wstring, dk_Fixed, - dk_Value, dk_ValueBox, dk_ValueMember, // orbos 98-01-18: Objects By Value - dk_Native - }; - - - interface IRObject - /** - An IRObject IDL interface represents the most generic interface - from which all other Interface Repository interfaces are derived, - even the Repository itself. - */ - { - // read interface - readonly attribute DefinitionKind def_kind; - - // write interface - void destroy (); - }; - - - - typedef string VersionSpec; - - interface Contained; - interface Repository; - interface Container; - - interface Contained : IRObject - /** - The Contained Interface is inherited by all Interface Repository - interfaces that are contained by other objects. - */ - { - // read/write interface - - attribute RepositoryId id; - attribute Identifier name; - attribute VersionSpec version; - - // read interface - - readonly attribute Container defined_in; - readonly attribute ScopedName absolute_name; - readonly attribute Repository containing_repository; - - struct Description { - DefinitionKind kind; - any value; - }; - - Description describe (); - - // write interface - - void move ( - in Container new_container, - in Identifier new_name, - in VersionSpec new_version - ); - }; - - - interface ModuleDef; - interface ConstantDef; - interface IDLType; - interface StructDef; - interface UnionDef; - interface EnumDef; - interface AliasDef; - interface InterfaceDef; - interface ExceptionDef; - interface ValueDef; // orbos 98-01-18: Objects By Value - interface ValueMemberDef; // orbos 98-01-18: Objects By Value - interface ValueBoxDef; // orbos 98-01-18: Objects By Value - interface NativeDef; - - - typedef sequence InterfaceDefSeq; - - - typedef sequence ContainedSeq; - - struct StructMember { - Identifier name; - TypeCode type; - IDLType type_def; - }; - typedef sequence StructMemberSeq; - - struct UnionMember { - Identifier name; - any label; - TypeCode type; - IDLType type_def; - }; - typedef sequence UnionMemberSeq; - - - typedef sequence EnumMemberSeq; - - // orbos 98-01-18: Objects By Value -- begin - typedef short Visibility; - const Visibility PRIVATE_MEMBER = 0; - const Visibility PUBLIC_MEMBER = 1; - - struct ValueMember { - Identifier name; - RepositoryId id; - RepositoryId defined_in; - VersionSpec version; - TypeCode type; - IDLType type_def; - Visibility access; - }; - typedef sequence ValueMemberSeq; - - struct Initializer { - StructMemberSeq members; - }; - typedef sequence InitializerSeq; - - typedef sequence ValueDefSeq; - - // orbos 98-01-18: Objects By Value -- end - - - interface Container : IRObject - /** - The Container interface is used to form a containment hierarchy - in the Interface Repository. A Container can contain any number - of objects derived from the Contained interface. - */ - { - // read interface - - Contained lookup ( in ScopedName search_name); - - ContainedSeq contents ( - in DefinitionKind limit_type, - in boolean exclude_inherited - ); - - ContainedSeq lookup_name ( - in Identifier search_name, - in long levels_to_search, - in DefinitionKind limit_type, - in boolean exclude_inherited - ); - - struct Description { - Contained contained_object; - DefinitionKind kind; - any value; - }; - - typedef sequence DescriptionSeq; - - DescriptionSeq describe_contents ( - in DefinitionKind limit_type, - in boolean exclude_inherited, - in long max_returned_objs - ); - - // write interface - - ModuleDef create_module ( - in RepositoryId id, - in Identifier name, - in VersionSpec version - ); - - ConstantDef create_constant ( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in IDLType type, - in any value - ); - - StructDef create_struct ( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in StructMemberSeq members - ); - - UnionDef create_union ( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in IDLType discriminator_type, - in UnionMemberSeq members - ); - - EnumDef create_enum ( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in EnumMemberSeq members - ); - - AliasDef create_alias ( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in IDLType original_type - ); - - ExceptionDef create_exception ( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in StructMemberSeq members - ); - - - InterfaceDef create_interface ( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in boolean is_abstract, - in InterfaceDefSeq base_interfaces - ); - - // orbos 98-01-18: Objects By Value - ValueDef create_value( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in boolean is_custom, - in boolean is_abstract, - in octet flags, // must be 0 - in ValueDef base_value, - in boolean has_safe_base, - in ValueDefSeq abstract_base_values, - in InterfaceDefSeq supported_interfaces, - in InitializerSeq initializers - ); - - // orbos 98-01-18: Objects By Value - ValueBoxDef create_value_box( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in IDLType original_type_def - ); - - NativeDef create_native( - in RepositoryId id, - in Identifier name, - in VersionSpec version - ); - - }; - - - - interface IDLType : IRObject - /** - The IDLType interface is an abstract interface inherited by all - IR objects that represent the OMG IDL types. It provides access - to the TypeCode describing the type, and is used in defining the - other interfaces wherever definitions of IDLType must be referenced. - */ - { - readonly attribute TypeCode type; - }; - - - - interface PrimitiveDef; - interface StringDef; - interface SequenceDef; - interface ArrayDef; - - enum PrimitiveKind { - pk_null, pk_void, pk_short, pk_long, pk_ushort, pk_ulong, - pk_float, pk_double, pk_boolean, pk_char, pk_octet, - pk_any, pk_TypeCode, pk_Principal, pk_string, pk_objref - }; - - interface Repository : Container - /** - Repository is an interface that provides global access to the - Interface Repository. Repository objects can contain constants, - typedefs, exceptions, interfaces, and modules. - */ - { - // read interface - - Contained lookup_id (in RepositoryId search_id); - - PrimitiveDef get_primitive (in PrimitiveKind kind); - - // write interface - - StringDef create_string (in unsigned long bound); - - SequenceDef create_sequence ( - in unsigned long bound, - in IDLType element_type - ); - - ArrayDef create_array ( - in unsigned long length, - in IDLType element_type - ); - }; - - - interface ModuleDef : Container, Contained - /** - A ModuleDef can contain constants, typedefs, exceptions, interfaces, - and other module objects. - */ - { - }; - - struct ModuleDescription { - Identifier name; - RepositoryId id; - RepositoryId defined_in; - VersionSpec version; - }; - - - interface ConstantDef : Contained - /** - A ConstantDef object defines a named constant. - */ - { - readonly attribute TypeCode type; - attribute IDLType type_def; - attribute any value; - }; - - struct ConstantDescription { - Identifier name; - RepositoryId id; - RepositoryId defined_in; - VersionSpec version; - TypeCode type; - any value; - }; - - - interface TypedefDef : Contained, IDLType - /** - TypedefDef is an abstract interface used as a base interface for - all named non-object types(structures, unions, enumerations, - aliases). The TypedefDef interface is not inherited by the definition - objects for the primitive or anonymous types. - */ - { - }; - - struct TypeDescription { - Identifier name; - RepositoryId id; - RepositoryId defined_in; - VersionSpec version; - TypeCode type; - }; - - - interface StructDef : TypedefDef, Container - /** - A StructDef represents an OMG IDL structure definition. - */ - { - attribute StructMemberSeq members; - }; - - - interface UnionDef : TypedefDef, Container - /** - A UnionDef represents an OMG IDL union definition. - */ - { - readonly attribute TypeCode discriminator_type; - attribute IDLType discriminator_type_def; - attribute UnionMemberSeq members; - }; - - - interface EnumDef : TypedefDef - /** - A EnumDef represents an OMG IDL enum definition. - */ - { - attribute EnumMemberSeq members; - }; - - - interface AliasDef : TypedefDef - /** - An AliasDef represents an OMG IDL typedef that aliases other - definition. - */ - { - attribute IDLType original_type_def; - }; - - - interface PrimitiveDef: IDLType - /** - A PrimitiveDef represents one of the IDL primitive types. As - primitive types are unnamed, this interface is not derived from - TypedefDef or Contained. - */ - { - readonly attribute PrimitiveKind kind; - }; - - - interface StringDef : IDLType - /** - A StringDef represents an OMG IDL string type. As string - types are anonymous, this interface is not derived from TypedefDef - or Contained. - */ - { - attribute unsigned long bound; - }; - - - interface SequenceDef : IDLType - /** - A SequenceDef represents an OMG IDL sequence type. As sequence - types are anonymous, this interface is not derived from TypedefDef - or Contained. - */ - { - attribute unsigned long bound; - readonly attribute TypeCode element_type; - attribute IDLType element_type_def; - }; - - interface ArrayDef : IDLType - /** - An ArrayDef represents an OMG IDL array type. As array - types are anonymous, this interface is not derived from TypedefDef - or Contained. - */ - { - attribute unsigned long length; - readonly attribute TypeCode element_type; - attribute IDLType element_type_def; - }; - - - interface ExceptionDef : Contained, Container - /** - An ExceptionDef represents an exception definition. - */ - { - readonly attribute TypeCode type; - attribute StructMemberSeq members; - }; - struct ExceptionDescription { - Identifier name; - RepositoryId id; - RepositoryId defined_in; - VersionSpec version; - TypeCode type; - }; - - - - enum AttributeMode {ATTR_NORMAL, ATTR_READONLY}; - - interface AttributeDef : Contained - /** - An AttributeDef represents the information that defines an - attribute of an interface. - */ - { - readonly attribute TypeCode type; - attribute IDLType type_def; - attribute AttributeMode mode; - }; - - struct AttributeDescription { - Identifier name; - RepositoryId id; - RepositoryId defined_in; - VersionSpec version; - TypeCode type; - AttributeMode mode; - }; - - - - enum OperationMode {OP_NORMAL, OP_ONEWAY}; - - enum ParameterMode {PARAM_IN, PARAM_OUT, PARAM_INOUT}; - struct ParameterDescription { - Identifier name; - TypeCode type; - IDLType type_def; - ParameterMode mode; - }; - typedef sequence ParDescriptionSeq; - - typedef Identifier ContextIdentifier; - typedef sequence ContextIdSeq; - - typedef sequence ExceptionDefSeq; - typedef sequence ExcDescriptionSeq; - - interface OperationDef : Contained - /** - An OperationDef represents the information that defines an - operation of an interface. - */ - { - readonly attribute TypeCode result; - attribute IDLType result_def; - attribute ParDescriptionSeq params; - attribute OperationMode mode; - attribute ContextIdSeq contexts; - attribute ExceptionDefSeq exceptions; - }; - - struct OperationDescription { - Identifier name; - RepositoryId id; - RepositoryId defined_in; - VersionSpec version; - TypeCode result; - OperationMode mode; - ContextIdSeq contexts; - ParDescriptionSeq parameters; - ExcDescriptionSeq exceptions; - }; - - - - typedef sequence RepositoryIdSeq; - typedef sequence OpDescriptionSeq; - typedef sequence AttrDescriptionSeq; - - interface InterfaceDef : Container, Contained, IDLType - /** - An InterfaceDef object represents an interface definition. It can - contains constants, typedefs, exceptions, operations, and - attributes. - */ - { - // read/write interface - - attribute InterfaceDefSeq base_interfaces; - attribute boolean is_abstract; - - // read interface - - boolean is_a (in RepositoryId interface_id); - - struct FullInterfaceDescription { - Identifier name; - RepositoryId id; - RepositoryId defined_in; - VersionSpec version; - boolean is_abstract; - OpDescriptionSeq operations; - AttrDescriptionSeq attributes; - RepositoryIdSeq base_interfaces; - TypeCode type; - }; - - FullInterfaceDescription describe_interface(); - - // write interface - - AttributeDef create_attribute ( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in IDLType type, - in AttributeMode mode - ); - - OperationDef create_operation ( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in IDLType result, - in OperationMode mode, - in ParDescriptionSeq params, - in ExceptionDefSeq exceptions, - in ContextIdSeq contexts - ); - }; - - struct InterfaceDescription { - Identifier name; - RepositoryId id; - RepositoryId defined_in; - VersionSpec version; - RepositoryIdSeq base_interfaces; - }; - - - // orbos 98-01-18: Objects By Value -- begin - - interface ValueMemberDef : Contained - - /** A ValueMemberDef object represents the public - and private data member definition of a Value type - */ - - { - readonly attribute TypeCode type; - attribute IDLType type_def; - attribute Visibility access; - }; - - interface ValueDef : Container, Contained, IDLType - /** - A ValueDef object represents the definition of the - Value object used to pass the object state - between hosts - */ - - { - // read/write interface - attribute InterfaceDefSeq supported_interfaces; - attribute InitializerSeq initializers; - attribute ValueDef base_value; - attribute ValueDefSeq abstract_base_values; - attribute boolean is_abstract; - attribute boolean is_custom; - attribute octet flags; // always 0 - attribute boolean has_safe_base; - - // read interface - boolean is_a(in RepositoryId value_id); - - struct FullValueDescription { - Identifier name; - RepositoryId id; - boolean is_abstract; - boolean is_custom; - octet flags; // always 0 - RepositoryId defined_in; - VersionSpec version; - OpDescriptionSeq operations; - AttrDescriptionSeq attributes; - ValueMemberSeq members; - InitializerSeq initializers; - RepositoryIdSeq supported_interfaces; - RepositoryIdSeq abstract_base_values; - boolean has_safe_base; - RepositoryId base_value; - TypeCode type; - }; - - FullValueDescription describe_value(); - - // write interface - - ValueMemberDef create_value_member( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in IDLType type_def, - in Visibility access - ); - - AttributeDef create_attribute( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in IDLType type, - in AttributeMode mode - ); - - OperationDef create_operation( - in RepositoryId id, - in Identifier name, - in VersionSpec version, - in IDLType result, - in OperationMode mode, - in ParDescriptionSeq params, - in ExceptionDefSeq exceptions, - in ContextIdSeq contexts - ); - }; - struct ValueDescription { - Identifier name; - RepositoryId id; - boolean is_abstract; - boolean is_custom; - octet flags; // always 0 - RepositoryId defined_in; - VersionSpec version; - RepositoryIdSeq supported_interfaces; - RepositoryIdSeq abstract_base_values; - boolean has_safe_base; - RepositoryId base_value; - }; - - interface ValueBoxDef : IDLType - - /** ValueBoxDef is an interface that reresents a value type with - a single data member inside its state section and no - inheritance or methods. For example, when transmitting a - string or sequence as an actual parameter on an interface - operation or as a data member of a value type that is an - actual parameter, it may be important to preserve any sharing - of the string or sequence within the object graph being - transmitted. Because current IDL data types do not preserve - referential integrity in this way, this requirement is - conveniently handled by using a value type. Value types also - support the transmission of nulls (as a distinguished value), - whereas IDL data types such as string and sequence (which are - mapped to empty strings and sequences) do not. The Java to IDL - mapping requires both preservation of referential integrity - and transmission of nulls. Because it would be cumbersome to - require the full IDL syntax for a value type for this specific - usage, this shorthand notation is introduced to cover this use - of value types for simple containment of a single data member. - */ - - { - attribute IDLType original_type_def; - }; - - // orbos 98-01-18: Objects By Value -- end - - enum TCKind { - tk_null, tk_void, - tk_short, tk_long, tk_ushort, tk_ulong, - tk_float, tk_double, tk_boolean, tk_char, - tk_octet, tk_any, tk_TypeCode, tk_Principal, tk_objref, - tk_struct, tk_union, tk_enum, tk_string, - tk_sequence, tk_array, tk_alias, tk_except, - tk_longlong, tk_ulonglong, tk_longdouble, - tk_wchar, tk_wstring, tk_fixed, - tk_value, tk_value_box, - tk_native, - tk_abstract_interface - }; - - interface NativeDef : TypedefDef { - }; -}; diff --git a/src/java.corba/share/classes/org/omg/CORBA/orb.idl b/src/java.corba/share/classes/org/omg/CORBA/orb.idl deleted file mode 100644 index bd6cb0724cc..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/orb.idl +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -// IDL not generated by rmic, do not edit -// These are all in IDL module CORBA -// The Java classes are in the package org.omg.CORBA -// See ValueType Semantics:Standard Value Box Definitions (5.3) in CORBA 2.3 spec - -#ifndef __org_omg_CORBA__ -#define __org_omg_CORBA__ - -#pragma prefix "omg.org" - -module CORBA{ - - valuetype StringValue string; - valuetype WStringValue wstring; - -}; - -#include "ir.idl" - -#pragma prefix "" - -#endif diff --git a/src/java.corba/share/classes/org/omg/CORBA/package.html b/src/java.corba/share/classes/org/omg/CORBA/package.html deleted file mode 100644 index d8eb9905953..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/package.html +++ /dev/null @@ -1,982 +0,0 @@ - - - - - - package - - - -Provides the mapping of the OMG CORBA APIs to the Java™ -programming language, including the class ORB, which is implemented -so that a programmer can use it as a fully-functional Object Request Broker -(ORB). - -

            For a precise list of supported sections of official CORBA specifications with which -the Java[TM] Platform, Standard Edition 6 complies, see Official Specifications for CORBA support in -Java[TM] SE 6. - - -

            General Information

            -The information in this section is information relevant to someone who -compiles Interface Definition Language (IDL) files and uses the -ORB to write clients and servers. - -

            The classes and interfaces described in this section can be put into -four groups: ORB classes, Exceptions, Helper classes, -and Holder classes. - -

            -The ORB Class

            - -

            An ORB handles (or brokers) method invocations between a client and -the method's implementation on a server. Because the client and server -may be anywhere on a network, and because the invocation and implementation -may be written in different programming languages, an ORB does a great -deal of work behind the scenes to accomplish this communication. - -

            Most of what an ORB does is completely transparent to the user, and a major -portion of the CORBA package consists of classes used by the ORB -behind the scenes. The result is that most programmers will use only a -small part of this package directly. In fact, most programmers will use -only a few methods from the ORB class, some exceptions, and -occasionally, -a holder class. -

            -ORB Methods

            - -

            Before an application can enter the CORBA environment, it must first: -

              -
            • Be initialized into the ORB and possibly the object adapter (POA) environments. -
            • Get references to ORB object (for use in future ORB operations) -and perhaps other objects (including the root POA or some Object Adapter objects). -
            -

            The following operations are provided to initialize applications and obtain - the appropriate object references: -

              -
            • Operations providing access to the ORB, which are discussed in this - section. -
            • Operations providing access to Object Adapters, Interface Repository, - Naming Service, and other Object Services. These operations are described - in Other Classes. -
            -

            -When an application requires a CORBA environment it needs a mechanism to -get an ORB object reference and possibly an OA object reference -(such as the root POA). This serves two purposes. First, it initializes -an application into the ORB and OA environments. Second, it returns the -ORB object reference and the OA object reference to the application -for use in future ORB and OA operations. - -

            In order to obtain an ORB object reference, applications call -the ORB.init operation. The parameters to the call can comprise an -identifier for the ORB for which the object reference is required, - and an arg_list, which is used to allow environment-specific data to be - passed into the call. - -

            These are the ORB methods - that provide access to the ORB: -

              -
            • -init() - -
            • -init(String [] args, Properties props) - -
            • -init(Applet app, Properties props) -
            - -

            Using the init() method without parameters initiates -a singleton ORB, which can only -give typecode creation anys needed in code generated -in Helper classes by idlj. - -

            Applications require a portable means by which to obtain their -initial object references. References are required for the root -POA, POA Current, Interface Repository, and various Object Services -instances. The functionality required by the application is similar - to that provided by the Naming Service. However, the OMG does not - want to mandate that the Naming Service be made available to all - applications in order that they may be portably initialized. - Consequently, the operations shown in this section provide a - simplified, local version of the Naming Service that applications - can use to obtain a small, defined set of object references which - are essential to its operation. Because only a small well-defined - set of objects are expected with this mechanism, the naming context - can be flattened to be a single-level name space. This simplification - results in only two operations being defined to achieve the functionality - required. - -

            Initial references are obtained via two operations provided in -the ORB object interface, providing facilities to list and -resolve initial object references. These are: -

              -
            • -resolve_initial_references(String name) -
            • -list_initial_services() -
            • -register_initial_reference(String id, org.omg.CORBA.Object obj) -
            - -

            An example that uses some of these methods is {@extLink idl_getting_started Getting Started with Java IDL}. - -

            -Exceptions

            -Exceptions in Java IDL are similar to those in any code written in the -Java programming language. If a method is defined to throw an exception, -then any code using that method must have a try/catch -block and handle that exception when it is thrown. - -

            The documentation on {@extLink jidlexception Java IDL exceptions } -has more information and explains the difference between -system exceptions and user-defined exceptions. - -

            The following is a list of the system exceptions (which are unchecked -exceptions inheriting through -org.omg.CORBA.SystemException from -java.lang.RuntimeException) that are defined in the package -org.omg.CORBA: -

            
            -        BAD_CONTEXT
            -        BAD_INV_ORDER
            -        BAD_OPERATION
            -        BAD_PARAM
            -        BAD_TYPECODE
            -        COMM_FAILURE
            -        DATA_CONVERSION
            -        FREE_MEM
            -        IMP_LIMIT
            -        INITIALIZE
            -        INTERNAL
            -        INTF_REPOS
            -        INVALID_TRANSACTION
            -        INV_FLAG
            -        INV_IDENT
            -        INV_OBJREF
            -        INV_POLICY
            -        MARSHAL
            -        NO_IMPLEMENT
            -        NO_MEMORY
            -        NO_PERMISSION
            -        NO_RESOURCES
            -        NO_RESPONSE
            -        OBJECT_NOT_EXIST
            -        OBJ_ADAPTER
            -        PERSIST_STORE
            -        TRANSACTION_REQUIRED
            -        TRANSACTION_ROLLEDBACK
            -        TRANSIENT
            -        UNKNOWN
            -
            -

            -The following is a list of user-defined exceptions defined in the package -org.omg.CORBA. -

            
            -        Bounds
            -        UnknownUserException
            -        WrongTransaction 
            -        PolicyError
            -
            - -

            Subpackages

            -There are some packages inside the CORBA package with -"Package" as part of their names. These packages are generally quite small -because all they do is provide exceptions or classes for use by interfaces -and classes in the CORBA package. - -

            For example, the package -org.omg.CORBA.TypeCodePackage contains -two exceptions thrown by methods in the class TypeCode. These -exceptions are: -

              -
            • -BadKind - -
            • -Bounds -
            -The package -org.omg.CORBA.ORBPackage contains two exceptions: -
              -
            • -InvalidName - -
            • -InconsistentTypeCode -
            - -

            Another package that is a subpackage of CORBA is the -portable -package. It provides a set of ORB APIs that makes it -possible for code generated by one vendor's IDL compiler to run -on another vendor's ORB. - - - - -

            -Holder classes

            - - -

            Support for out and inout parameter passing modes requires the use of -additional holder -classes. Because the Java programming language does not support out or -inout parameters, holder classes are needed as a means of passing a parameter -that can be modified. To support portable stubs and skeletons, -holder classes also implement the -org.omg.CORBA.portable.Streamable -interface. - -

            Holder classes are named by appending "Holder" to the name of the type. - The name of the type refers to its name in the Java programming language. For - example, a holder class for the interface named Account - in the Java programming - language would be named AccountHolder. - - -

            Holder classes are available for all of the basic IDL - datatypes in the org.omg.CORBA package. So, for example, - there are already-defined classes for LongHolder, ShortHolder, - FloatHolder, and so on. Classes are also generated for - all named user-defined IDL types except those defined by typedefs. - (Note that in this context user defined includes types that are - defined in OMG specifications such as those for the Interface - Repository, and other OMG services.) - - -

            Each holder class has: -

              -
            • a constructor from an instance -
            • a default constructor -
            • a public instance member, value which is the typed value. -
            • a method for reading an input stream and assigning the contents to the -type's value field -
            • a method for writing the value of the value field to an output stream -
            • a method for getting the typecode of the type -
            - -

            The default constructor sets the value field to the default value for the -type as defined by the Java language: -

              -
            • false for boolean -
            • 0 for numeric and char types -
            • null for strings and object references -
            - - - -

            -As an example, if the interface Account, defined in OMG IDL, -were mapped to the Java programming language, the following holder class -would be generated: -

            -public final class AccountHolder implements
            -    org.omg.CORBA.portable.Streamable
            -{
            -  // field that holds an Account object
            -  public Account value = null;
            -
            -  // default constructor
            -  public AccountHolder ()
            -  {
            -  }
            -  
            -  // creates a new AccountHolder from initialValue
            -  public AccountHolder (Account initialValue)
            -  {
            -    value = initialValue;
            -  }
            -  
            -  // reads the contents of i and assigns the contents to value
            -  public void _read (org.omg.CORBA.portable.InputStream i)
            -  {
            -    value = AccountHelper.read (i);
            -  }
            -
            -  // writes value to o
            -  public void _write (org.omg.CORBA.portable.OutputStream o)
            -  {
            -    AccountHelper.write (o, value);
            -  }
            - 
            -  // returns the typecode for Account
            -  public org.omg.CORBA.TypeCode _type ()
            -  {
            -    return AccountHelper.type ();
            -  }
            -
            -}
            -
            - -

            For more information on Holder classes, see Chapter 1.4, Mapping for -Basic Types in the -OMG IDL to Java Language Mapping. The Holder classes defined -in the package org.omg.CORBA are: -

            
            -     AnyHolder
            -     AnySeqHolder
            -     BooleanHolder
            -     BooleanSeqHolder
            -     ByteHolder
            -     CharHolder
            -     CharSeqHolder
            -     CurrentHolder
            -     DoubleHolder
            -     DoubleSeqHolder
            -     FixedHolder
            -     FloatHolder
            -     FloatSeqHolder
            -     IntHolder
            -     LongHolder
            -     LongLongSeqHolder
            -     LongSeqHolder
            -     ObjectHolder
            -     OctetSeqHolder
            -     ParameterModeHolder
            -     PolicyErrorHolder
            -     PolicyListHolder
            -     PrincipalHolder
            -     ServiceInformationHolder
            -     ShortHolder
            -     ShortSeqHolder
            -     StringHolder
            -     StringSeqHolder
            -     TypeCodeHolder
            -     ULongLongSeqHolder
            -     ULongSeqHolder
            -     UnknownUserExceptionHolder
            -     UShortSeqHolder
            -     ValueBaseHolder
            -     WCharSeqHolder
            -     WrongTransactionHolder
            -     WStringSeqHolder
            -
            - -

            Helper Classes

            -

            Helper files supply several static methods needed to manipulate the type. - These include: -

              -
            • Any insert and extract operations for the type -
            • getting the repository id -
            • getting the typecode -
            • reading and writing the type from and to a stream -
            • implement the ValueHelper interface (if it is a user-defined - value type) -
            - -

            The helper class for a mapped IDL interface or abstract interface -also include narrow operation(s). The static narrow method allows -an org.omg.CORBA.Object to be narrowed to the object reference -of a more specific type. The IDL exception CORBA.BAD_PARAM -is thrown if the narrow fails because the object reference does not -support the requested type. A different system exception is raised -to indicate other kinds of errors. Trying to narrow a null will always -succeed with a return value of null. -Generally, the only helper method an application programmer uses is -the narrow method. The other methods are normally used behind -the scenes and are transparent to the programmer. - -

            Helper classes -fall into two broad categories, helpers for value types and -helpers for non value types. Because all of the helper -classes in one category -provide the same methods, one generic explanation of each -category of helper classes is presented here. - -

            -When OMG IDL is mapped to the Java programming language, -a "helper" class is generated for each user-defined type. -This generated class will have the name of the user-defined type with -the suffix Helper appended. For example, if the -interface Account is defined in OMG IDL, the -idlj compiler will automatically generate a class named -AccountHelper. The AccountHelper class -will contain the static methods needed for manipulating instances of the type, -in this case, Account objects. - - - -

            The narrow Method

            -When an object is the return value for a method, it is returned in the -form of a generic object, either an org.omg.CORBA.Object object -or a java.lang.Object object. This object must be cast to its -more specific type before it can be operated on. For example, an -Account object will be returned as a generic object and must -be narrowed to an Account object so that Account -methods may be called on it. -

            -The narrow method has two forms, one that takes an -org.omg.CORBA.Object object and one that takes a -java.lang.Object object. Whether the interface is abstract or -not determines which narrow method its helper class will provide. -The helper class for an interface -that is not abstract will have a narrow method that takes a CORBA -object, whereas the narrow method for an interface that is abstract -will take an object in the Java programming language. The helper class for a -non-abstract interface that has at least one abstract base interface will provide -both versions of the narrow method. -

            The {@extLink idl_guides Hello World tutorial} -uses a narrow method that looks like this: -

            -        // create and initialize the ORB
            -        ORB orb = ORB.init(args, null);
            -
            -        // get the root naming context
            -        org.omg.CORBA.Object objRef = 
            -            orb.resolve_initial_references("NameService");
            -        // Use NamingContextExt instead of NamingContext. This is 
            -        // part of latest Inter-Operable naming Service.  
            -        NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
            - 
            -        // resolve the Object Reference in Naming
            -        String name = "Hello";
            -        helloImpl = HelloHelper.narrow(ncRef.resolve_str(name));
            -
            - - -

            Example of a Basic Helper Class

            -A basic helper class, for purposes of this explanation, is one with -the methods that are provided by every helper class, plus a narrow -method if the type defined in OMG IDL maps to an interface in the Java -programming language. Types that are not value types will have a basic -helper class generated for them. -

            -For example, assuming that the interface Account is not a -value type IDL type and is also not an abstract interface and has no -abstract base interfaces, its AccountHelper class will look -like this: -

            -abstract public class AccountHelper
            -{
            -  private static String  _id = "IDL:Account:1.0";
            -
            -  // inserts an Account object into an Any object
            -  public static void insert (org.omg.CORBA.Any a, Account that)
            -  {
            -    org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
            -    a.type (type ());
            -    write (out, that);
            -    a.read_value (out.create_input_stream (), type ());
            -  }
            -
            -  // extracts an Account object from an Any object
            -  public static Account extract (org.omg.CORBA.Any a)
            -  {
            -    return read (a.create_input_stream ());
            -  }
            -
            -  
            -  private static org.omg.CORBA.TypeCode __typeCode = null;
            -  // gets the typecode for this type
            -  synchronized public static org.omg.CORBA.TypeCode type ()
            -  {
            -    if (__typeCode == null)
            -    {
            -      __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (AccountHelper.id (), "Account");
            -    }
            -    return __typeCode;
            -  }
            -
            -  // gets the repository id for this type
            -  public static String id ()
            -  {
            -    return _id;
            -  }
            -
            -  // reads an Account object from an input stream
            -  public static Account read (org.omg.CORBA.portable.InputStream istream)
            -  {
            -    return narrow (istream.read_Object (_AccountStub.class));
            -  }
            -
            -  // writes an Account object to an outputstream
            -  public static void write (org.omg.CORBA.portable.OutputStream ostream, Account value)
            -  {
            -    ostream.write_Object ((org.omg.CORBA.Object) value);
            -  }
            -
            -  // converts (narrows) an Object to an Account object
            -  public static Account narrow (org.omg.CORBA.Object obj)
            -  {
            -    if (obj == null)
            -      return null;
            -    else if (obj instanceof Account)
            -      return (Account)obj;
            -    else if (!obj._is_a (id ()))
            -      throw new org.omg.CORBA.BAD_PARAM ();
            -    else
            -    {
            -      org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
            -      _AccountStub stub = new _AccountStub ();
            -      stub._set_delegate(delegate);
            -      return stub;
            -    }
            -  }
            -
            -}
            -
            - - -

            Value Type Helper Classes

            -A helper class for a value type includes different renderings of -the same methods generated for non-value type methods. The main difference - is that value types are types that can be -passed by value as parameters or return values of a method, which means that -they must be serializable. -

            Assuming that Address is a value type, the -AddressHelper class will look like this: -

            -abstract public class AddressHelper
            -{
            -  private static String  _id = "IDL:Address:1.0";
            -
            -  // same as for non-value type
            -  public static void insert (org.omg.CORBA.Any a, Address that)
            -  {
            -    org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
            -    a.type (type ());
            -    write (out, that);
            -    a.read_value (out.create_input_stream (), type ());
            -  }
            -
            -  // same as for non-value type
            -  public static Address extract (org.omg.CORBA.Any a)
            -  {
            -    return read (a.create_input_stream ());
            -  }
            -
            -  private static org.omg.CORBA.TypeCode __typeCode = null;
            -  private static boolean __active = false;
            -  
            -  // getting the typecode for the type
            -  synchronized public static org.omg.CORBA.TypeCode type ()
            -  {
            -    if (__typeCode == null)
            -    {
            -      synchronized (org.omg.CORBA.TypeCode.class)
            -      {
            -        if (__typeCode == null)
            -        {
            -          if (__active)
            -          {
            -            return org.omg.CORBA.ORB.init().create_recursive_tc ( _id );
            -          }
            -          __active = true;
            -          org.omg.CORBA.ValueMember[] _members0 = new org.omg.CORBA.ValueMember[0];
            -          org.omg.CORBA.TypeCode _tcOf_members0 = null;
            -          __typeCode = org.omg.CORBA.ORB.init ().create_value_tc (_id, "Address", org.omg.CORBA.VM_NONE.value, null, _members0);
            -          __active = false;
            -        }
            -      }
            -    }
            -    return __typeCode;
            -  }
            -
            -  // same as for non-value type
            -  public static String id ()
            -  {
            -    return _id;
            -  }
            -
            -  // reads a serializable instance of Address from the given input stream
            -  public static Address read (org.omg.CORBA.portable.InputStream istream)
            -  {
            -    return (Address)((org.omg.CORBA_2_3.portable.InputStream) istream).read_value (id ());
            -  }
            -
            -  // writes a serializable instance of Address to the given output stream
            -  public static void write (org.omg.CORBA.portable.OutputStream ostream, Address value)
            -  {
            -    ((org.omg.CORBA_2_3.portable.OutputStream) ostream).write_value (value, id ());
            -  }
            -
            -
            -}
            -
            - -

            The Helper classes defined in the package org.omg.CORBA are: -

            
            -     AnySeqHelper
            -     BooleanSeqHelper
            -     CharSeqHelper
            -     CompletionStatusHelper
            -     CurrentHelper
            -     DefinitionKindHelper
            -     DoubleSeqHelper
            -     FieldNameHelper
            -     FloatSeqHelper
            -     IdentifierHelper
            -     IDLTypeHelper
            -     LongLongSeqHelper
            -     LongSeqHelper
            -     NameValuePairHelper
            -     ObjectHelper
            -     OctetSeqHelper
            -     ParameterModeHelper
            -     PolicyErrorCodeHelper
            -     PolicyErrorHelper
            -     PolicyHelper
            -     PolicyListHelper
            -     PolicyTypeHelper
            -     RepositoryIdHelper
            -     ServiceDetailHelper
            -     ServiceInformationHelper
            -     SetOverrideTypeHelper
            -     ShortSeqHelper
            -     StringSeqHelper
            -     StringValueHelper
            -     StructMemberHelper
            -     ULongLongSeqHelper
            -     ULongSeqHelper
            -     UnionMemberHelper
            -     UnknownUserExceptionHelper
            -     UShortSeqHelper
            -     ValueBaseHelper
            -     ValueMemberHelper
            -     VersionSpecHelper
            -     VisibilityHelper
            -     WCharSeqHelper
            -     WrongTransactionHelper
            -     WStringSeqHelper
            -     WStringValueHelper
            -
            - -

            -Other Classes

            -The other classes and interfaces in the CORBA package, which are -used behind the scenes, can be put into four groups. Three of the groups -are used with requests in some capacity, and the fourth group, concerning -the Interface Repository, is a category by itself. -

            -Classes Created by an ORB

            -The first group contains classes that are created by an ORB and contain -information used in request operations. -
              -
            • -TCKind -- indicates the kind (datatype) for a TypeCode -object - -
            • -TypeCode -- indicates a datatype and possibly other information - -
            • -Any -- contains a value and its typecode - -
            • -NamedValue -- contains a name, an Any object, and an -argument mode flag. NamedValue objects contain information about -method arguments, method return values, or a context. - -
            • -ContextList -- a list of strings that describe the contexts that -need to be resolved and sent with an invocation - -
            • -ExceptionList -- a list of TypeCodes for exceptions that -may be thrown by a method - -
            • -Environment -- a container for the exception thrown during a method -invocation - -
            • -Context -- a list of NamedValue objects used to pass -auxiliary information from client to server - -
            • -NVList -- a list of NamedValue objects, used to pass -arguments or get results -
            - -

            -Classes That Deal with Requests

            -The second group of classes deals with requests: -
              -
            • -Object -- the base class for all CORBA object references - -
            • -Request -- the main class in the DII, which contains methods for -adding arguments to the request, for accessing information about the method -being invoked (the method name, its arguments, exceptions it throws, and -so on), and for making invocations on the request - -
            • -DynamicImplementation -- the base class for server implementations -using the DSI. It has the method invoke, which is used by an -implementation -of this class to determine the state of a ServerRequest object -and to set its result or exception - -
            • -ServerRequest -- captures the explicit state of a request for -the Dynamic Skeleton Interface -
            - -

            -Interfaces That Serve as Constants

            -The third group contains interfaces that serve as constants. The IDL-to-Java -mapping mandates that IDL enums are mapped to a Java class with the enumerated -values represented as public static final fields in that class (e.g. -DefinitionKind). -On the other hand IDL constants defined outside of an IDL interface are -mapped to a Java interface for each constant. - -

            This is why several interfaces in the org.omg.CORBA package -consist of a single field, value, which is a short. This -field is a constant used for such things as an error code or value modifier. -For example, the value field of the interface BAD_POLICY -is one of the possible reasons for the exception PolicyError to -be thrown. To specify this error code, you would use BAD_POLICY.value. - -

            The exception PolicyError uses the value field of -the following interfaces as its possible error codes. -

              -
            • -BAD_POLICY - -
            • -BAD_POLICY_TYPE - -
            • -BAD_POLICY_VALUE - -
            • -UNSUPPORTED_POLICY - -
            • -UNSUPPORTED_POLICY_VALUE -
            -The method TypeCode.type_modifier returns the value field -of one of the following interfaces. The VM in the names of these -interfaces stands for "value modifier." -
              -
            • -VM_NONE - -
            • -VM_ABSTRACT - -
            • -VM_CUSTOM - -
            • -VM_TRUNCATABLE -
            -The following constants are returned by a ValueMember object's -access method to denote the visibility of the ValueMember object. -
              -
            • -PRIVATE_MEMBER - -
            • -PUBLIC_MEMBER -
            -These flags, used in NamedValue objects or as parameters to methods, -are defined in the following interfaces: -
              -
            • -ARG_IN - -
            • -ARG_INOUT - -
            • -ARG_OUT - -
            • -CTX_RESTRICT_SCOPE -
            - -

            -Interface Repository Interfaces and Classes

            -A fourth group contains the Interface Repository interfaces and classes, -which are generated by the idlj compiler from the OMG IDL -interface ir.idl. The purpose of the Interface Repository is to -identify the interfaces stored in it so that they can be accessed by an -ORB. Each module, type, interface, attribute, operation, parameter, exception, -constant, and so on is described completely by the Interface Repository -API. - -

            An ORB does not require that there be an interface repository, and Java -IDL does not include one. Even though this release does not include an -implementation of an interface repository, the following IR classes and -interfaces have been included for the purpose of creating typecodes (see -create_value_tc, create_struct_tc, create_union_tc and create_exception_tc -methods in interface org.omg.CORBA.ORB): -
              -

              -
            • -IRObject - -
            • -IDLType - -
            • -DefinitionKind - -
            • -StructMember - -
            • -UnionMember - -
            • -ValueMember -
            - -
            -

            -Related Documentation

            -For overviews, guides, and a tutorial, please see: -
              -
            • {@extLink idl_guides Java IDL tutorial page}.
            • -
            • {@extLink rmi_iiop_guides RMI-IIOP developer's guide}.
            • -
            - - - - -

            -

            -CORBA Features Not Implemented in Java IDL

            - -

            Some of the API included in org.omg subpackages is provided for -conformance with the current OMG CORBA specification but is not implemented -in Sun's release of the JDK™. This enables -other JDK licensees to provide implementations of this API in standard -extensions and products. - -

            -

            Features That Throw NO_IMPLEMENT

            - -

            Some of the API included in org.omg subpackages throw -NO_IMPLEMENT exceptions for various reasons. Among these reasons -are: -

              -
            • In some cases, for example LocalObject, the complete - implementation according to the specification indicates that - these API should throw NO_IMPLEMENT. - -
            • In most cases, for example methods in ORB.java, - methods that throw - NO_IMPLEMENT are actually implemented in subclasses - elsewhere in the ORB code. - -
            • In some cases, for example _get_interface_def() - and _get_interface, API are really not yet implemented. -
            - - - - -

            -General Summary of Features or API Not Implemented in This Release:

            - -
              -
            • -Interface Repository. An Interface Repository is not required for normal -operation of Java IDL. - -
            • -Java IDL does not support long double. - - -
            • -Policies (org.omg.CORBA.Policy) -and methods for getting them are not implemented. - -
            • -Domain managers (org.omg.CORBA.DomainManager) and methods for -getting them are not implemented. - -
            • -Service Information org.omg.CORBA.ServiceInformation -and ORB method -public boolean get_service_information(short service_type, ServiceInformationHolder service_info) -are not implemented. - -
            • ORB methods for supporting single-threading -(perform_work, work_pending) are not implemented. - -
            • IDL contexts. -
            - -
            -

            -Specific List of Unimplemented Features in Package org.omg.CORBA

            - - -

            -Unimplemented Methods in package org.omg.CORBA:

            - -
              -
            • -ORB - -
                -
              • -public org.omg.CORBA.Policy create_policy(int type, org.omg.CORBA.Any val) - - - -
              • -public void perform_work() - -
              • -public boolean work_pending() - -
              • -public org.omg.CORBA.Current get_current() - -
              • -create_operation_list - -
              • -get_default_context - -
              • -get_service_information - -
              • -obsolete DynAnys (deprecated in favor of DynamicAny package) - - -
              - - - -
            -@since JDK1.2 -@serial exclude - - diff --git a/src/java.corba/share/classes/org/omg/CORBA/portable/ApplicationException.java b/src/java.corba/share/classes/org/omg/CORBA/portable/ApplicationException.java deleted file mode 100644 index f9cf8607dc5..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/portable/ApplicationException.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA.portable; - -/** -This class is used for reporting application level exceptions between ORBs and stubs. -*/ - -public class ApplicationException extends Exception { - /** - * Constructs an ApplicationException from the CORBA repository ID of the exception - * and an input stream from which the exception data can be read as its parameters. - * @param id the repository id of the user exception - * @param ins the stream which contains the user exception data - */ - public ApplicationException(String id, - InputStream ins) { - this.id = id; - this.ins = ins; - } - - /** - * Returns the CORBA repository ID of the exception - * without removing it from the exceptions input stream. - * @return The CORBA repository ID of this exception - */ - public String getId() { - return id; - } - - /** - * Returns the input stream from which the exception data can be read as its parameters. - * @return The stream which contains the user exception data - */ - public InputStream getInputStream() { - return ins; - } - - private String id; - private InputStream ins; -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/portable/BoxedValueHelper.java b/src/java.corba/share/classes/org/omg/CORBA/portable/BoxedValueHelper.java deleted file mode 100644 index 71ad68ea563..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/portable/BoxedValueHelper.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package org.omg.CORBA.portable; -import java.io.Serializable; - -public interface BoxedValueHelper { - Serializable read_value(InputStream is); - void write_value(OutputStream os, Serializable value); - String get_id(); -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/portable/CustomValue.java b/src/java.corba/share/classes/org/omg/CORBA/portable/CustomValue.java deleted file mode 100644 index 9e785ba4947..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/portable/CustomValue.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/** - * Defines the base interface for all custom value types - * generated from IDL. - * - * All value types implement ValueBase either directly - * or indirectly by implementing either the StreamableValue - * or CustomValue interface. - * @author OMG - */ - -package org.omg.CORBA.portable; - -import org.omg.CORBA.CustomMarshal; -/** - * An extension of ValueBase that is implemented by custom value - * types. - */ -public interface CustomValue extends ValueBase, CustomMarshal { - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/portable/Delegate.java b/src/java.corba/share/classes/org/omg/CORBA/portable/Delegate.java deleted file mode 100644 index a0375fb0f91..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/portable/Delegate.java +++ /dev/null @@ -1,408 +0,0 @@ -/* - * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA.portable; - -import org.omg.CORBA.Request; -import org.omg.CORBA.NamedValue; -import org.omg.CORBA.NVList; -import org.omg.CORBA.Context; -import org.omg.CORBA.ContextList; -import org.omg.CORBA.ExceptionList; -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.SystemException; - -/** - * Specifies a portable API for ORB-vendor-specific - * implementation of the org.omg.CORBA.Object methods. - * - * Each stub (proxy) contains a delegate - * object, to which all org.omg.CORBA.Object methods are forwarded. - * This allows a stub generated by one vendor's ORB to work with the delegate - * from another vendor's ORB. - * - * @see org.omg.CORBA.Object - * @author OMG - */ - -public abstract class Delegate { - - /** - * Return an InterfaceDef for the object reference provided. - * @param self The object reference whose InterfaceDef needs to be returned - * @return the InterfaceDef - */ - public abstract org.omg.CORBA.Object get_interface_def( - org.omg.CORBA.Object self); - - /** - * Returns a duplicate of the object reference provided. - * @param obj The object reference whose duplicate needs to be returned - * @return the duplicate object reference - */ - public abstract org.omg.CORBA.Object duplicate(org.omg.CORBA.Object obj); - - /** - * Releases resources associated with the object reference provided. - * @param obj The object reference whose resources need to be released - */ - public abstract void release(org.omg.CORBA.Object obj); - - /** - * Checks if the object reference is an instance of the given interface. - * @param obj The object reference to be checked. - * @param repository_id The repository identifier of the interface - * to check against. - * @return true if the object reference supports the interface - */ - public abstract boolean is_a(org.omg.CORBA.Object obj, String repository_id); - - /** - * Determines whether the server object for the object reference has been - * destroyed. - * @param obj The object reference which delegated to this delegate. - * @return true if the ORB knows authoritatively that the server object does - * not exist, false otherwise - */ - public abstract boolean non_existent(org.omg.CORBA.Object obj); - - /** - * Determines if the two object references are equivalent. - * @param obj The object reference which delegated to this delegate. - * @param other The object reference to check equivalence against. - * @return true if the objects are CORBA-equivalent. - */ - public abstract boolean is_equivalent(org.omg.CORBA.Object obj, - org.omg.CORBA.Object other); - - /** - * Returns an ORB-internal identifier (hashcode) for this object reference. - * @param obj The object reference which delegated to this delegate. - * @param max specifies an upper bound on the hash value returned by - * the ORB. - * @return ORB-internal hash identifier for object reference - */ - public abstract int hash(org.omg.CORBA.Object obj, int max); - - /** - * Creates a Request instance for use in the Dynamic Invocation Interface. - * @param obj The object reference which delegated to this delegate. - * @param operation The name of the operation to be invoked using the - * Request instance. - * @return the created Request instance - */ - public abstract Request request(org.omg.CORBA.Object obj, String operation); - - /** - * Creates a Request instance for use in the Dynamic Invocation Interface. - * - * @param obj The object reference which delegated to this delegate. - * @param ctx The context to be used. - * @param operation The name of the operation to be - * invoked. - * @param arg_list The arguments to the operation in the - * form of an NVList. - * @param result A container for the result as a NamedValue. - * @return The created Request object. - * - */ - public abstract Request create_request(org.omg.CORBA.Object obj, - Context ctx, - String operation, - NVList arg_list, - NamedValue result); - - /** - * Creates a Request instance for use in the Dynamic Invocation Interface. - * - * @param obj The object reference which delegated to this delegate. - * @param ctx The context to be used. - * @param operation The name of the operation to be - * invoked. - * @param arg_list The arguments to the operation in the - * form of an NVList. - * @param result A container for the result as a NamedValue. - * @param exclist A list of possible exceptions the - * operation can throw. - * @param ctxlist A list of context strings that need - * to be resolved and sent with the - * Request. - * @return The created Request object. - */ - public abstract Request create_request(org.omg.CORBA.Object obj, - Context ctx, - String operation, - NVList arg_list, - NamedValue result, - ExceptionList exclist, - ContextList ctxlist); - - /** - * Provides a reference to the orb associated with its parameter. - * - * @param obj the object reference which delegated to this delegate. - * @return the associated orb. - * @see portable - * package comments for unimplemented features - */ - public org.omg.CORBA.ORB orb(org.omg.CORBA.Object obj) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Returns the Policy object of the specified type - * which applies to this object. - * - * @param self The object reference which delegated to this delegate. - * @param policy_type The type of policy to be obtained. - * @return A Policy object of the type specified by - * the policy_type parameter. - * @exception org.omg.CORBA.BAD_PARAM raised when the value of policy type - * is not valid either because the specified type is not supported by this - * ORB or because a policy object of that type is not associated with this - * Object. - * @see portable - * package comments for unimplemented features - */ - public org.omg.CORBA.Policy get_policy(org.omg.CORBA.Object self, - int policy_type) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - - /** - * Retrieves the DomainManagers of this object. - * This allows administration services (and applications) to retrieve the - * domain managers, and hence the security and other policies applicable - * to individual objects that are members of the domain. - * - * @param self The object reference which delegated to this delegate. - * @return The list of immediately enclosing domain managers of this object. - * At least one domain manager is always returned in the list since by - * default each object is associated with at least one domain manager at - * creation. - * @see portable - * package comments for unimplemented features - */ - public org.omg.CORBA.DomainManager[] get_domain_managers( - org.omg.CORBA.Object - self) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - - /** - * Associates the policies passed in - * with a newly created object reference that it returns. Only certain - * policies that pertain to the invocation of an operation at the client - * end can be overridden using this operation. Attempts to override any - * other policy will result in the raising of the CORBA::NO_PERMISSION - * exception. - * - * @param self The object reference which delegated to this delegate. - * @param policies A sequence of references to Policy objects. - * @param set_add Indicates whether these policies should be added - * onto any otheroverrides that already exist (ADD_OVERRIDE) in - * the object reference, or they should be added to a clean - * override free object reference (SET_OVERRIDE). - * @return A new object reference with the new policies associated with it. - * - * @see portable - * package comments for unimplemented features - */ - public org.omg.CORBA.Object set_policy_override(org.omg.CORBA.Object self, - org.omg.CORBA.Policy[] policies, - org.omg.CORBA.SetOverrideType set_add) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - - /** - * Returns true if this object is implemented by a local servant. - * - * @param self The object reference which delegated to this delegate. - * @return true only if the servant incarnating this object is located in - * this Java VM. Return false if the servant is not local or the ORB - * does not support local stubs for this particular servant. The default - * behavior of is_local() is to return false. - */ - public boolean is_local(org.omg.CORBA.Object self) { - return false; - } - - /** - * Returns a Java reference to the servant which should be used for this - * request. servant_preinvoke() is invoked by a local stub. - * If a ServantObject object is returned, then its servant field - * has been set to an object of the expected type (Note: the object may - * or may not be the actual servant instance). The local stub may cast - * the servant field to the expected type, and then invoke the operation - * directly. The ServantRequest object is valid for only one invocation, - * and cannot be used for more than one invocation. - * - * @param self The object reference which delegated to this delegate. - * - * @param operation a string containing the operation name. - * The operation name corresponds to the operation name as it would be - * encoded in a GIOP request. - * - * @param expectedType a Class object representing the expected type of the servant. - * The expected type is the Class object associated with the operations - * class of the stub's interface (e.g. A stub for an interface Foo, - * would pass the Class object for the FooOperations interface). - * - * @return a ServantObject object. - * The method may return a null value if it does not wish to support - * this optimization (e.g. due to security, transactions, etc). - * The method must return null if the servant is not of the expected type. - */ - public ServantObject servant_preinvoke(org.omg.CORBA.Object self, - String operation, - Class expectedType) { - return null; - } - - /** - * servant_postinvoke() is invoked by the local stub after the operation - * has been invoked on the local servant. - * This method must be called if servant_preinvoke() returned a non-null - * value, even if an exception was thrown by the servant's method. - * For this reason, the call to servant_postinvoke() should be placed - * in a Java finally clause. - * - * @param self The object reference which delegated to this delegate. - * - * @param servant the instance of the ServantObject returned from - * the servant_preinvoke() method. - */ - public void servant_postinvoke(org.omg.CORBA.Object self, - ServantObject servant) { - } - - /** - * request is called by a stub to obtain an OutputStream for - * marshaling arguments. The stub must supply the operation name, - * and indicate if a response is expected (i.e is this a oneway - * call). - * - * @param self The object reference which delegated to this delegate. - * @param operation a string containing the operation name. - * The operation name corresponds to the operation name as it would be - * encoded in a GIOP request. - * @param responseExpected false if the operation is a one way operation, - * and true otherwise. - * @return OutputStream the OutputStream into which request arguments - * can be marshaled. - * @see portable - * package comments for unimplemented features - */ - public OutputStream request(org.omg.CORBA.Object self, - String operation, - boolean responseExpected) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * invoke is called by a stub to invoke an operation. The stub provides an - * OutputStream that was previously returned by a request() - * call. invoke returns an InputStream which contains the - * marshaled reply. If an exception occurs, invoke may throw an - * ApplicationException object which contains an InputStream from - * which the user exception state may be unmarshaled. - * - * @param self The object reference which delegated to this delegate. - * @param output the OutputStream which contains marshaled arguments - * @return input the InputStream from which reply parameters can be - * unmarshaled. - * @throws ApplicationException thrown when implementation throws - * (upon invocation) an exception defined as part of its remote method - * definition. - * @throws RemarshalException thrown when remarshalling fails. - * @see portable - * package comments for unimplemented features - */ - public InputStream invoke(org.omg.CORBA.Object self, - OutputStream output) - throws ApplicationException, RemarshalException { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * releaseReply may optionally be called by a stub to release a - * reply stream back to the ORB when the unmarshaling has - * completed. The stub passes the InputStream returned by - * invoke() or ApplicationException.getInputStream(). A null - * value may also be passed to releaseReply, in which case the - * method is a noop. - * - * @param self The object reference which delegated to this delegate. - * @param input the InputStream returned from invoke(). - * @see portable - * package comments for unimplemented features - */ - public void releaseReply(org.omg.CORBA.Object self, - InputStream input) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Provides the implementation to override the toString() method - * of the delegating CORBA object. - * - * @param self the object reference that delegated to this delegate - * @return a String object that represents the object - * reference that delegated to this Delegate - * object - */ - - public String toString(org.omg.CORBA.Object self) { - return self.getClass().getName() + ":" + this.toString(); - } - - /** - * Provides the implementation to override the hashCode() method - * of the delegating CORBA object. - * - * @param self the object reference that delegated to this delegate - * @return an int that represents the hashcode for the - * object reference that delegated to this Delegate - * object - */ - public int hashCode(org.omg.CORBA.Object self) { - return System.identityHashCode(self); - } - - /** - * Provides the implementation to override the equals(java.lang.Object obj) - * method of the delegating CORBA object. - * - * @param self the object reference that delegated to this delegate - * @param obj the Object with which to compare - * @return true if obj equals self; - * false otherwise - */ - public boolean equals(org.omg.CORBA.Object self, java.lang.Object obj) { - return (self == obj); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/portable/IDLEntity.java b/src/java.corba/share/classes/org/omg/CORBA/portable/IDLEntity.java deleted file mode 100644 index 867fdeb7671..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/portable/IDLEntity.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA.portable; - -/** - * An interface with no members whose only purpose is to serve as a marker - * indicating that an implementing class is a - * Java value type from IDL that has a corresponding Helper class. - * RMI IIOP serialization looks for such a marker to perform - * marshalling/unmarshalling. - **/ -public interface IDLEntity extends java.io.Serializable { - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/portable/IndirectionException.java b/src/java.corba/share/classes/org/omg/CORBA/portable/IndirectionException.java deleted file mode 100644 index cdf73ac9137..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/portable/IndirectionException.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package org.omg.CORBA.portable; - -import org.omg.CORBA.SystemException; -/** - * The Indirection exception is a Java specific system exception. - * It is thrown when the ORB's input stream is called to demarshal - * a value that is encoded as an indirection that is in the process - * of being demarshaled. This can occur when the ORB input stream - * calls the ValueHandler to demarshal an RMI value whose state - * contains a recursive reference to itself. Because the top-level - * ValueHandler.read_value() call has not yet returned a value, - * the ORB input stream's indirection table does not contain an entry - * for an object with the stream offset specified by the indirection - * tag. The stream offset is returned in the exception's offset field. - * @see org.omg.CORBA_2_3.portable.InputStream - * @see org.omg.CORBA_2_3.portable.OutputStream - */ -public class IndirectionException extends SystemException { - - /** - * Points to the stream's offset. - */ - public int offset; - - /** - * Creates an IndirectionException with the right offset value. - * The stream offset is returned in the exception's offset field. - * This exception is constructed and thrown during reading - * recursively defined values off of a stream. - * - * @param offset the stream offset where recursion is detected. - */ - public IndirectionException(int offset){ - super("", 0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE); - this.offset = offset; - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/portable/InputStream.java b/src/java.corba/share/classes/org/omg/CORBA/portable/InputStream.java deleted file mode 100644 index e03578e9a79..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/portable/InputStream.java +++ /dev/null @@ -1,320 +0,0 @@ -/* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA.portable; - -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.Principal; -import org.omg.CORBA.Any; - -/** - * InputStream is the Java API for reading IDL types - * from CDR marshal streams. These methods are used by the ORB to - * unmarshal IDL types as well as to extract IDL types out of Anys. - * The _array versions of the methods can be directly - * used to read sequences and arrays of IDL types. - * - * @since JDK1.2 - */ - -public abstract class InputStream extends java.io.InputStream -{ - /** - * Reads a boolean value from this input stream. - * - * @return the boolean value read from this input stream - */ - public abstract boolean read_boolean(); - /** - * Reads a char value from this input stream. - * - * @return the char value read from this input stream - */ - public abstract char read_char(); - /** - * Reads a wide char value from this input stream. - * - * @return the char value read from this input stream - */ - public abstract char read_wchar(); - /** - * Reads an octet (that is, a byte) value from this input stream. - * - * @return the byte value read from this input stream - */ - public abstract byte read_octet(); - /** - * Reads a short value from this input stream. - * - * @return the short value read from this input stream - */ - public abstract short read_short(); - /** - * Reads a unsigned short value from this input stream. - * - * @return the short value read from this input stream - */ - public abstract short read_ushort(); - /** - * Reads a CORBA long (that is, Java int) value from this input stream. - * - * @return the int value read from this input stream - */ - public abstract int read_long(); - /** - * Reads an unsigned CORBA long (that is, Java int) value from this input -stream. - * - * @return the int value read from this input stream - */ - public abstract int read_ulong(); - /** - * Reads a CORBA longlong (that is, Java long) value from this input stream. - * - * @return the long value read from this input stream - */ - public abstract long read_longlong(); - /** - * Reads a CORBA unsigned longlong (that is, Java long) value from this input -stream. - * - * @return the long value read from this input stream - */ - public abstract long read_ulonglong(); - /** - * Reads a float value from this input stream. - * - * @return the float value read from this input stream - */ - public abstract float read_float(); - /** - * Reads a double value from this input stream. - * - * @return the double value read from this input stream - */ - public abstract double read_double(); - /** - * Reads a string value from this input stream. - * - * @return the String value read from this input stream - */ - public abstract String read_string(); - /** - * Reads a wide string value from this input stream. - * - * @return the String value read from this input stream - */ - public abstract String read_wstring(); - - /** - * Reads an array of booleans from this input stream. - * @param value returned array of booleans. - * @param offset offset on the stream. - * @param length length of buffer to read. - */ - public abstract void read_boolean_array(boolean[] value, int offset, int -length); - /** - * Reads an array of chars from this input stream. - * @param value returned array of chars. - * @param offset offset on the stream. - * @param length length of buffer to read. - */ - public abstract void read_char_array(char[] value, int offset, int -length); - /** - * Reads an array of wide chars from this input stream. - * @param value returned array of wide chars. - * @param offset offset on the stream. - * @param length length of buffer to read. - */ - public abstract void read_wchar_array(char[] value, int offset, int -length); - /** - * Reads an array of octets (that is, bytes) from this input stream. - * @param value returned array of octets (that is, bytes). - * @param offset offset on the stream. - * @param length length of buffer to read. - */ - public abstract void read_octet_array(byte[] value, int offset, int -length); - /** - * Reads an array of shorts from this input stream. - * @param value returned array of shorts. - * @param offset offset on the stream. - * @param length length of buffer to read. - */ - public abstract void read_short_array(short[] value, int offset, int -length); - /** - * Reads an array of unsigned shorts from this input stream. - * @param value returned array of shorts. - * @param offset offset on the stream. - * @param length length of buffer to read. - */ - public abstract void read_ushort_array(short[] value, int offset, int -length); - /** - * Reads an array of CORBA longs (that is, Java ints) from this input stream. - * @param value returned array of CORBA longs (that is, Java ints). - * @param offset offset on the stream. - * @param length length of buffer to read. - */ - public abstract void read_long_array(int[] value, int offset, int -length); - /** - * Reads an array of unsigned CORBA longs (that is, Java ints) from this input -stream. - * @param value returned array of CORBA longs (that is, Java ints). - * @param offset offset on the stream. - * @param length length of buffer to read. - */ - public abstract void read_ulong_array(int[] value, int offset, int -length); - /** - * Reads an array of CORBA longlongs (that is, Java longs) from this input -stream. - * @param value returned array of CORBA longs (that is, Java longs). - * @param offset offset on the stream. - * @param length length of buffer to read. - */ - public abstract void read_longlong_array(long[] value, int offset, int -length); - /** - * Reads an array of unsigned CORBA longlongs (that is, Java longs) from this -input stream. - * @param value returned array of CORBA longs (that is, Java longs). - * @param offset offset on the stream. - * @param length length of buffer to read. - */ - public abstract void read_ulonglong_array(long[] value, int offset, int -length); - /** - * Reads an array of floats from this input stream. - * @param value returned array of floats. - * @param offset offset on the stream. - * @param length length of buffer to read. - */ - public abstract void read_float_array(float[] value, int offset, int -length); - /** - * Reads an array of doubles from this input stream. - * @param value returned array of doubles. - * @param offset offset on the stream. - * @param length length of buffer to read. - */ - public abstract void read_double_array(double[] value, int offset, int -length); - - /** - * Reads a CORBA object from this input stream. - * - * @return the Object instance read from this input stream. - */ - public abstract org.omg.CORBA.Object read_Object(); - /** - * Reads a TypeCode from this input stream. - * - * @return the TypeCode instance read from this input stream. - */ - public abstract TypeCode read_TypeCode(); - /** - * Reads an Any from this input stream. - * - * @return the Any instance read from this input stream. - */ - public abstract Any read_any(); - - /** - * Returns principal for invocation. - * @return Principal for invocation. - * @deprecated Deprecated by CORBA 2.2. - */ - @Deprecated - public Principal read_Principal() { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - - /** - * @see portable - * package comments for unimplemented features - */ - public int read() throws java.io.IOException { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Reads a BigDecimal number. - * @return a java.math.BigDecimal number - */ - public java.math.BigDecimal read_fixed() { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Reads a CORBA context from the stream. - * @return a CORBA context - * @see portable - * package comments for unimplemented features - */ - public org.omg.CORBA.Context read_Context() { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - /* - * The following methods were added by orbos/98-04-03: Java to IDL - * Mapping. These are used by RMI over IIOP. - */ - - /** - * Unmarshals an object and returns a CORBA Object, - * which is an instance of the class passed as its argument. - * This class is the stub class of the expected type. - * - * @param clz The Class object for the stub class which - * corresponds to the type that is statistically expected, or - * the Class object for the RMI/IDL interface type that - * is statistically expected. - * @return an Object instance of clz read from this stream - * - * @see portable - * package comments for unimplemented features - */ - public org.omg.CORBA.Object read_Object(java.lang.Class - clz) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Returns the ORB that created this InputStream. - * - * @return the ORB object that created this stream - * - * @see portable - * package comments for unimplemented features - */ - public org.omg.CORBA.ORB orb() { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/portable/InvokeHandler.java b/src/java.corba/share/classes/org/omg/CORBA/portable/InvokeHandler.java deleted file mode 100644 index b626a5cda1c..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/portable/InvokeHandler.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA.portable; - -/** -This interface provides a dispatching mechanism for an incoming call. -It is invoked by the ORB to dispatch a request to a servant. -*/ - -public interface InvokeHandler { - /** - * Invoked by the ORB to dispatch a request to the servant. - * - * ORB passes the method name, an InputStream containing the - * marshalled arguments, and a ResponseHandler which the servant - * uses to construct a proper reply. - * - * Only CORBA SystemException may be thrown by this method. - * - * The method must return an OutputStream created by the - * ResponseHandler which contains the marshalled reply. - * - * A servant must not retain a reference to the ResponseHandler - * beyond the lifetime of a method invocation. - * - * Servant behaviour is defined as follows: - *

            1. Determine correct method, and unmarshal parameters from - * InputStream. - *

            2. Invoke method implementation. - *

            3. If no user exception, create a normal reply using - * ResponseHandler. - *

            4. If user exception occurred, create exception reply using - * ResponseHandler. - *

            5. Marshal reply into OutputStream returned by - * ResponseHandler. - *

            6. Return OutputStream to ORB. - * - * @param method The method name. - * @param input The InputStream containing the marshalled arguments. - * @param handler The ResponseHandler which the servant uses - * to construct a proper reply - * @return The OutputStream created by the - * ResponseHandler which contains the marshalled reply - * @throws SystemException is thrown when invocation fails due to a CORBA system exception. - */ - - OutputStream _invoke(String method, InputStream input, - ResponseHandler handler) - throws org.omg.CORBA.SystemException; -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/portable/ObjectImpl.java b/src/java.corba/share/classes/org/omg/CORBA/portable/ObjectImpl.java deleted file mode 100644 index 3cd515d7b33..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/portable/ObjectImpl.java +++ /dev/null @@ -1,534 +0,0 @@ -/* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA.portable; - -import org.omg.CORBA.Request; -import org.omg.CORBA.NamedValue; -import org.omg.CORBA.NVList; -import org.omg.CORBA.ExceptionList; -import org.omg.CORBA.ContextList; -import org.omg.CORBA.Context; -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.BAD_OPERATION; -import org.omg.CORBA.SystemException; - - -/** - * The common base class for all stub classes; provides default implementations - * of the org.omg.CORBA.Object methods. All method implementations are - * forwarded to a Delegate object stored in the ObjectImpl - * instance. ObjectImpl allows for portable stubs because the - * Delegate can be implemented by a different vendor-specific ORB. - */ - -abstract public class ObjectImpl implements org.omg.CORBA.Object -{ - - /** - * The field that stores the Delegate instance for - * this ObjectImpl object. This Delegate - * instance can be implemented by a vendor-specific ORB. Stub classes, - * which are derived from this ObjectImpl class, can be - * portable because they delegate all of the methods called on them to this - * Delegate object. - */ - private transient Delegate __delegate; - - - /** - * Retrieves the reference to the vendor-specific Delegate - * object to which this ObjectImpl object delegates all - * methods invoked on it. - * - * @return the Delegate contained in this ObjectImpl instance - * @throws BAD_OPERATION if the delegate has not been set - * @see #_set_delegate - */ - public Delegate _get_delegate() { - if (__delegate == null) - throw new BAD_OPERATION("The delegate has not been set!"); - return __delegate; - } - - - /** - * Sets the Delegate for this ObjectImpl instance to the given - * Delegate object. All method invocations on this - * ObjectImpl object will be forwarded to this delegate. - * - * @param delegate the Delegate instance to which - * all method calls on this ObjectImpl object - * will be delegated; may be implemented by a third-party ORB - * @see #_get_delegate - */ - public void _set_delegate(Delegate delegate) { - __delegate = delegate; - } - - /** - * Retrieves a string array containing the repository identifiers - * supported by this ObjectImpl object. For example, - * for a stub, this method returns information about all the - * interfaces supported by the stub. - * - * @return the array of all repository identifiers supported by this - * ObjectImpl instance - */ - public abstract String[] _ids(); - - - /** - * Returns a duplicate of this ObjectImpl object. - * - * @return an orb.omg.CORBA.Object object that is - * a duplicate of this object - */ - public org.omg.CORBA.Object _duplicate() { - return _get_delegate().duplicate(this); - } - - /** - * Releases the resources associated with this ObjectImpl object. - */ - public void _release() { - _get_delegate().release(this); - } - - /** - * Checks whether the object identified by the given repository - * identifier is an ObjectImpl object. - * - * @param repository_id a String object with the repository - * identifier to check - * @return true if the object identified by the given - * repository id is an instance of ObjectImpl; - * false otherwise - */ - public boolean _is_a(String repository_id) { - return _get_delegate().is_a(this, repository_id); - } - - /** - * Checks whether the the given ObjectImpl object is - * equivalent to this ObjectImpl object. - * - * @param that an instance of ObjectImpl to compare with - * this ObjectImpl object - * @return true if the given object is equivalent - * to this ObjectImpl object; - * false otherwise - */ - public boolean _is_equivalent(org.omg.CORBA.Object that) { - return _get_delegate().is_equivalent(this, that); - } - - /** - * Checks whether the server object for this ObjectImpl - * object has been destroyed. - * - * @return true if the ORB knows authoritatively that the - * server object does not exist; false otherwise - */ - public boolean _non_existent() { - return _get_delegate().non_existent(this); - } - - /** - * Retrieves the hash code that serves as an ORB-internal identifier for - * this ObjectImpl object. - * - * @param maximum an int indicating the upper bound on the hash - * value returned by the ORB - * @return an int representing the hash code for this - * ObjectImpl object - */ - public int _hash(int maximum) { - return _get_delegate().hash(this, maximum); - } - - /** - * Creates a Request object containing the given method - * that can be used with the Dynamic Invocation Interface. - * - * @param operation the method to be invoked by the new Request - * object - * @return a new Request object initialized with the - * given method - */ - public Request _request(String operation) { - return _get_delegate().request(this, operation); - } - - /** - * Creates a Request object that contains the given context, - * method, argument list, and container for the result. - * - * @param ctx the Context for the request - * @param operation the method that the new Request - * object will invoke - * @param arg_list the arguments for the method; an NVList - * in which each argument is a NamedValue object - * @param result a NamedValue object to be used for - * returning the result of executing the request's method - * @return a new Request object initialized with the - * given context, method, argument list, and container for the - * return value - */ - public Request _create_request(Context ctx, - String operation, - NVList arg_list, - NamedValue result) { - return _get_delegate().create_request(this, - ctx, - operation, - arg_list, - result); - } - - /** - * Creates a Request object that contains the given context, - * method, argument list, container for the result, exceptions, and - * list of property names to be used in resolving the context strings. - * This Request object is for use in the Dynamic - * Invocation Interface. - * - * @param ctx the Context object that contains the - * context strings that must be resolved before they are - * sent along with the request - * @param operation the method that the new Request - * object will invoke - * @param arg_list the arguments for the method; an NVList - * in which each argument is a NamedValue object - * @param result a NamedValue object to be used for - * returning the result of executing the request's method - * @param exceptions a list of the exceptions that the given method - * throws - * @param contexts a list of the properties that are needed to - * resolve the contexts in ctx; the strings in - * contexts are used as arguments to the method - * Context.get_values, - * which returns the value associated with the given property - * @return a new Request object initialized with the - * given context strings to resolve, method, argument list, - * container for the result, exceptions, and list of property - * names to be used in resolving the context strings - */ - public Request _create_request(Context ctx, - String operation, - NVList arg_list, - NamedValue result, - ExceptionList exceptions, - ContextList contexts) { - return _get_delegate().create_request(this, - ctx, - operation, - arg_list, - result, - exceptions, - contexts); - } - - /** - * Retrieves the interface definition for this ObjectImpl - * object. - * - * @return the org.omg.CORBA.Object instance that is the - * interface definition for this ObjectImpl object - */ - public org.omg.CORBA.Object _get_interface_def() - { - // First try to call the delegate implementation class's - // "Object get_interface_def(..)" method (will work for JDK1.2 ORBs). - // Else call the delegate implementation class's - // "InterfaceDef get_interface(..)" method using reflection - // (will work for pre-JDK1.2 ORBs). - - org.omg.CORBA.portable.Delegate delegate = _get_delegate(); - try { - // If the ORB's delegate class does not implement - // "Object get_interface_def(..)", this will call - // get_interface_def(..) on portable.Delegate. - return delegate.get_interface_def(this); - } - catch( org.omg.CORBA.NO_IMPLEMENT ex ) { - // Call "InterfaceDef get_interface(..)" method using reflection. - try { - Class[] argc = { org.omg.CORBA.Object.class }; - java.lang.reflect.Method meth = - delegate.getClass().getMethod("get_interface", argc); - Object[] argx = { this }; - return (org.omg.CORBA.Object)meth.invoke(delegate, argx); - } - catch( java.lang.reflect.InvocationTargetException exs ) { - Throwable t = exs.getTargetException(); - if (t instanceof Error) { - throw (Error) t; - } - else if (t instanceof RuntimeException) { - throw (RuntimeException) t; - } - else { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - } catch( RuntimeException rex ) { - throw rex; - } catch( Exception exr ) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - } - } - - /** - * Returns a reference to the ORB associated with this object and - * its delegate. This is the ORB object that created - * the delegate. - * - * @return the ORB instance that created the - * Delegate object contained in this - * ObjectImpl object - */ - public org.omg.CORBA.ORB _orb() { - return _get_delegate().orb(this); - } - - - /** - * Retrieves the Policy object for this - * ObjectImpl object that has the given - * policy type. - * - * @param policy_type an int indicating the policy type - * @return the Policy object that is the specified policy type - * and that applies to this ObjectImpl object - * @see org.omg.CORBA.PolicyOperations#policy_type - */ - public org.omg.CORBA.Policy _get_policy(int policy_type) { - return _get_delegate().get_policy(this, policy_type); - } - - /** - * Retrieves a list of the domain managers for this - * ObjectImpl object. - * - * @return an array containing the DomainManager - * objects for this instance of ObjectImpl - */ - public org.omg.CORBA.DomainManager[] _get_domain_managers() { - return _get_delegate().get_domain_managers(this); - } - - /** - * Sets this ObjectImpl object's override type for - * the given policies to the given instance of - * SetOverrideType. - * - * @param policies an array of Policy objects with the - * policies that will replace the current policies or be - * added to the current policies - * @param set_add either SetOverrideType.SET_OVERRIDE, - * indicating that the given policies will replace any existing - * ones, or SetOverrideType.ADD_OVERRIDE, indicating - * that the given policies should be added to any existing ones - * @return an Object with the given policies replacing or - * added to its previous policies - */ - public org.omg.CORBA.Object - _set_policy_override(org.omg.CORBA.Policy[] policies, - org.omg.CORBA.SetOverrideType set_add) { - return _get_delegate().set_policy_override(this, policies, - set_add); - } - - /** - * Checks whether this ObjectImpl object is implemented - * by a local servant. If so, local invocation API's may be used. - * - * @return true if this object is implemented by a local - * servant; false otherwise - */ - public boolean _is_local() { - return _get_delegate().is_local(this); - } - - /** - * Returns a Java reference to the local servant that should be used for sending - * a request for the method specified. If this ObjectImpl - * object is a local stub, it will invoke the _servant_preinvoke - * method before sending a request in order to obtain the - * ServantObject instance to use. - *

            - * If a ServantObject object is returned, its servant - * field has been set to an object of the expected type (Note: the object may - * or may not be the actual servant instance). The local stub may cast - * the servant field to the expected type, and then invoke the operation - * directly. The ServantRequest object is valid for only one - * invocation and cannot be used for more than one invocation. - * - * @param operation a String containing the name of the method - * to be invoked. This name should correspond to the method name as - * it would be encoded in a GIOP request. - * - * @param expectedType a Class object representing the - * expected type of the servant that is returned. This expected - * type is the Class object associated with the - * operations class for the stub's interface. For example, a - * stub for an interface Foo would pass the - * Class object for the FooOperations - * interface. - * - * @return (1) a ServantObject object, which may or may - * not be the actual servant instance, or (2) null if - * (a) the servant is not local or (b) the servant has ceased to - * be local due to a ForwardRequest from a POA ServantManager - * @throws org.omg.CORBA.BAD_PARAM if the servant is not the expected type - */ - public ServantObject _servant_preinvoke(String operation, - Class expectedType) { - return _get_delegate().servant_preinvoke(this, operation, - expectedType); - } - - /** - * Is called by the local stub after it has invoked an operation - * on the local servant that was previously retrieved from a - * call to the method _servant_preinvoke. - * The _servant_postinvoke method must be called - * if the _servant_preinvoke - * method returned a non-null value, even if an exception was thrown - * by the method invoked by the servant. For this reason, the call - * to the method _servant_postinvoke should be placed - * in a Java finally clause. - * - * @param servant the instance of the ServantObject - * returned by the _servant_preinvoke method - */ - public void _servant_postinvoke(ServantObject servant) { - _get_delegate().servant_postinvoke(this, servant); - } - - /* - * The following methods were added by orbos/98-04-03: Java to IDL - * Mapping. These are used by RMI over IIOP. - */ - - /** - * Returns an OutputStream object to use for marshalling - * the arguments of the given method. This method is called by a stub, - * which must indicate if a response is expected, that is, whether or not - * the call is oneway. - * - * @param operation a String giving the name of the method. - * @param responseExpected a boolean -- true if the - * request is not one way, that is, a response is expected - * @return an OutputStream object for dispatching the request - */ - public OutputStream _request(String operation, - boolean responseExpected) { - return _get_delegate().request(this, operation, responseExpected); - } - - /** - * Invokes an operation and returns an InputStream - * object for reading the response. The stub provides the - * OutputStream object that was previously returned by a - * call to the _request method. The method specified - * as an argument to _request when it was - * called previously is the method that this method invokes. - *

            - * If an exception occurs, the _invoke method may throw an - * ApplicationException object that contains an InputStream from - * which the user exception state may be unmarshalled. - * - * @param output an OutputStream object for dispatching the request - * @return an InputStream object containing the marshalled - * response to the method invoked - * @throws ApplicationException if the invocation - * meets application-defined exception - * @throws RemarshalException if the invocation leads - * to a remarshalling error - * @see #_request - */ - public InputStream _invoke(OutputStream output) - throws ApplicationException, RemarshalException { - return _get_delegate().invoke(this, output); - } - - /** - * Releases the given - * reply stream back to the ORB when unmarshalling has - * completed after a call to the method _invoke. - * Calling this method is optional for the stub. - * - * @param input the InputStream object that was returned - * by the _invoke method or the - * ApplicationException.getInputStream method; - * may be null, in which case this method does - * nothing - * @see #_invoke - */ - public void _releaseReply(InputStream input) { - _get_delegate().releaseReply(this, input); - } - - /** - * Returns a String object that represents this - * ObjectImpl object. - * - * @return the String representation of this object - */ - public String toString() { - if ( __delegate != null ) - return __delegate.toString(this); - else - return getClass().getName() + ": no delegate set"; - } - - /** - * Returns the hash code for this ObjectImpl object. - * - * @return the hash code for this object - */ - public int hashCode() { - if ( __delegate != null ) - return __delegate.hashCode(this); - else - return super.hashCode(); - } - - /** - * Compares this ObjectImpl object with the given one - * for equality. - * - *@param obj the object with which to compare this object - *@return true if the two objects are equal; - * false otherwise - */ - public boolean equals(java.lang.Object obj) { - if ( __delegate != null ) - return __delegate.equals(this, obj); - else - return (this==obj); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/portable/OutputStream.java b/src/java.corba/share/classes/org/omg/CORBA/portable/OutputStream.java deleted file mode 100644 index 9dab5aea5be..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/portable/OutputStream.java +++ /dev/null @@ -1,287 +0,0 @@ -/* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA.portable; - -import org.omg.CORBA.TypeCode; -import org.omg.CORBA.Principal; -import org.omg.CORBA.Any; - -/** - * OuputStream is the Java API for writing IDL types - * to CDR marshal streams. These methods are used by the ORB to - * marshal IDL types as well as to insert IDL types into Anys. - * The _array versions of the methods can be directly - * used to write sequences and arrays of IDL types. - * - * @since JDK1.2 - */ - - -public abstract class OutputStream extends java.io.OutputStream -{ - /** - * Returns an input stream with the same buffer. - *@return an input stream with the same buffer. - */ - public abstract InputStream create_input_stream(); - - /** - * Writes a boolean value to this stream. - * @param value the value to be written. - */ - public abstract void write_boolean(boolean value); - /** - * Writes a char value to this stream. - * @param value the value to be written. - */ - public abstract void write_char(char value); - /** - * Writes a wide char value to this stream. - * @param value the value to be written. - */ - public abstract void write_wchar(char value); - /** - * Writes a CORBA octet (i.e. byte) value to this stream. - * @param value the value to be written. - */ - public abstract void write_octet(byte value); - /** - * Writes a short value to this stream. - * @param value the value to be written. - */ - public abstract void write_short(short value); - /** - * Writes an unsigned short value to this stream. - * @param value the value to be written. - */ - public abstract void write_ushort(short value); - /** - * Writes a CORBA long (i.e. Java int) value to this stream. - * @param value the value to be written. - */ - public abstract void write_long(int value); - /** - * Writes an unsigned CORBA long (i.e. Java int) value to this stream. - * @param value the value to be written. - */ - public abstract void write_ulong(int value); - /** - * Writes a CORBA longlong (i.e. Java long) value to this stream. - * @param value the value to be written. - */ - public abstract void write_longlong(long value); - /** - * Writes an unsigned CORBA longlong (i.e. Java long) value to this stream. - * @param value the value to be written. - */ - public abstract void write_ulonglong(long value); - /** - * Writes a float value to this stream. - * @param value the value to be written. - */ - public abstract void write_float(float value); - /** - * Writes a double value to this stream. - * @param value the value to be written. - */ - public abstract void write_double(double value); - /** - * Writes a string value to this stream. - * @param value the value to be written. - */ - public abstract void write_string(String value); - /** - * Writes a wide string value to this stream. - * @param value the value to be written. - */ - public abstract void write_wstring(String value); - - /** - * Writes an array of booleans on this output stream. - * @param value the array to be written. - * @param offset offset on the stream. - * @param length length of buffer to write. - */ - public abstract void write_boolean_array(boolean[] value, int offset, - int length); - /** - * Writes an array of chars on this output stream. - * @param value the array to be written. - * @param offset offset on the stream. - * @param length length of buffer to write. - */ - public abstract void write_char_array(char[] value, int offset, - int length); - /** - * Writes an array of wide chars on this output stream. - * @param value the array to be written. - * @param offset offset on the stream. - * @param length length of buffer to write. - */ - public abstract void write_wchar_array(char[] value, int offset, - int length); - /** - * Writes an array of CORBA octets (bytes) on this output stream. - * @param value the array to be written. - * @param offset offset on the stream. - * @param length length of buffer to write. - */ - public abstract void write_octet_array(byte[] value, int offset, - int length); - /** - * Writes an array of shorts on this output stream. - * @param value the array to be written. - * @param offset offset on the stream. - * @param length length of buffer to write. - */ - public abstract void write_short_array(short[] value, int offset, - int length); - /** - * Writes an array of unsigned shorts on this output stream. - * @param value the array to be written. - * @param offset offset on the stream. - * @param length length of buffer to write. - */ - public abstract void write_ushort_array(short[] value, int offset, - int length); - /** - * Writes an array of CORBA longs (i.e. Java ints) on this output stream. - * @param value the array to be written. - * @param offset offset on the stream. - * @param length length of buffer to write. - */ - public abstract void write_long_array(int[] value, int offset, - int length); - /** - * Writes an array of unsigned CORBA longs (i.e. Java ints) on this output stream. - * @param value the array to be written. - * @param offset offset on the stream. - * @param length length of buffer to write. - */ - public abstract void write_ulong_array(int[] value, int offset, - int length); - /** - * Writes an array of CORBA longlongs (i.e. Java longs) on this output stream. - * @param value the array to be written. - * @param offset offset on the stream. - * @param length length of buffer to write. - */ - public abstract void write_longlong_array(long[] value, int offset, - int length); - /** - * Writes an array of unsigned CORBA longlongs (i.e. Java ints) on this output stream. - * @param value the array to be written. - * @param offset offset on the stream. - * @param length length of buffer to write. - */ - public abstract void write_ulonglong_array(long[] value, int offset, - int length); - /** - * Writes an array of floats on this output stream. - * @param value the array to be written. - * @param offset offset on the stream. - * @param length length of buffer to write. - */ - public abstract void write_float_array(float[] value, int offset, - int length); - /** - * Writes an array of doubles on this output stream. - * @param value the array to be written. - * @param offset offset on the stream. - * @param length length of buffer to write. - */ - public abstract void write_double_array(double[] value, int offset, - int length); - /** - * Writes a CORBA Object on this output stream. - * @param value the value to be written. - */ - public abstract void write_Object(org.omg.CORBA.Object value); - /** - * Writes a TypeCode on this output stream. - * @param value the value to be written. - */ - public abstract void write_TypeCode(TypeCode value); - /** - * Writes an Any on this output stream. - * @param value the value to be written. - */ - public abstract void write_any(Any value); - - /** - * Writes a Principle on this output stream. - * @param value the value to be written. - * @deprecated Deprecated by CORBA 2.2. - */ - @Deprecated - public void write_Principal(Principal value) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Writes an integer (length of arrays) onto this stream. - * @param b the value to be written. - * @throws java.io.IOException if there is an input/output error - * @see portable - * package comments for unimplemented features - */ - public void write(int b) throws java.io.IOException { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Writes a BigDecimal number. - * @param value a BidDecimal--value to be written. - */ - public void write_fixed(java.math.BigDecimal value) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Writes a CORBA context on this stream. The - * Context is marshaled as a sequence of strings. - * Only those Context values specified in the contexts - * parameter are actually written. - * @param ctx a CORBA context - * @param contexts a ContextList object containing the list of contexts - * to be written - * @see portable - * package comments for unimplemented features - */ - public void write_Context(org.omg.CORBA.Context ctx, - org.omg.CORBA.ContextList contexts) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Returns the ORB that created this OutputStream. - * @return the ORB that created this OutputStream - * @see portable - * package comments for unimplemented features - */ - public org.omg.CORBA.ORB orb() { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/portable/RemarshalException.java b/src/java.corba/share/classes/org/omg/CORBA/portable/RemarshalException.java deleted file mode 100644 index b0a6800da54..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/portable/RemarshalException.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA.portable; - -/** -This class is used for reporting locate forward exceptions and object forward -GIOP messages back to the ORB. In this case the ORB must remarshal the request -before trying again. -Stubs which use the stream-based model shall catch the RemarshalException -which is potentially thrown from the _invoke() method of ObjectImpl. -Upon catching the exception, the stub shall immediately remarshal the request by calling -_request(), marshalling the arguments (if any), and then calling -_invoke(). The stub shall repeat this process until _invoke() -returns normally or raises some exception other than RemarshalException. -*/ - -public final class RemarshalException extends Exception { - /** - * Constructs a RemarshalException. - */ - public RemarshalException() { - super(); - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/portable/ResponseHandler.java b/src/java.corba/share/classes/org/omg/CORBA/portable/ResponseHandler.java deleted file mode 100644 index 09a73cd08fe..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/portable/ResponseHandler.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA.portable; - -/** -This interface is supplied by an ORB to a servant at invocation time and allows -the servant to later retrieve an OutputStream for returning the invocation results. -*/ - -public interface ResponseHandler { - /** - * Called by the servant during a method invocation. The servant - * should call this method to create a reply marshal buffer if no - * exception occurred. - * - * @return an OutputStream suitable for marshalling the reply. - * - * @see portable - * package comments for unimplemented features - */ - OutputStream createReply(); - - /** - * Called by the servant during a method invocation. The servant - * should call this method to create a reply marshal buffer if a - * user exception occurred. - * - * @return an OutputStream suitable for marshalling the exception - * ID and the user exception body. - */ - OutputStream createExceptionReply(); -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/portable/ServantObject.java b/src/java.corba/share/classes/org/omg/CORBA/portable/ServantObject.java deleted file mode 100644 index 2735927f789..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/portable/ServantObject.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package org.omg.CORBA.portable; - -/** - This class is part of the local stub API, the purpose of which is to provide - high performance calls for collocated clients and servers - (i.e. clients and servers residing in the same Java VM). - The local stub API is supported via three additional methods on - ObjectImpl and Delegate. - ORB vendors may subclass this class to return additional - request state that may be required by their implementations. - @see ObjectImpl - @see Delegate -*/ - -public class ServantObject -{ - /** The real servant. The local stub may cast this field to the expected type, and then - * invoke the operation directly. Note, the object may or may not be the actual servant - * instance. - */ - public java.lang.Object servant; -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/portable/Streamable.java b/src/java.corba/share/classes/org/omg/CORBA/portable/Streamable.java deleted file mode 100644 index 45f29e07f3d..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/portable/Streamable.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.CORBA.portable; - -import org.omg.CORBA.TypeCode; - -/** - * The base class for the Holder classess of all complex - * IDL types. The ORB treats all generated Holders as Streamable to invoke - * the methods for marshalling and unmarshalling. - * - * @since JDK1.2 - */ - -public interface Streamable { - /** - * Reads data from istream and initalizes the - * value field of the Holder with the unmarshalled data. - * - * @param istream the InputStream that represents the CDR data from the wire. - */ - void _read(InputStream istream); - /** - * Marshals to ostream the value in the - * value field of the Holder. - * - * @param ostream the CDR OutputStream - */ - void _write(OutputStream ostream); - - /** - * Retrieves the TypeCode object corresponding to the value - * in the value field of the Holder. - * - * @return the TypeCode object for the value held in the holder - */ - TypeCode _type(); -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/portable/StreamableValue.java b/src/java.corba/share/classes/org/omg/CORBA/portable/StreamableValue.java deleted file mode 100644 index 7155eedea26..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/portable/StreamableValue.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package org.omg.CORBA.portable; - -/** - * Defines the base type for all non-boxed IDL valuetypes - * that are not custom marshaled. - * - * All value types implement ValueBase either directly or - * indirectly by implementing either the - * StreamableValue or CustomValue interface. - * - * @author OMG - */ -public interface StreamableValue extends Streamable, ValueBase { - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/portable/UnknownException.java b/src/java.corba/share/classes/org/omg/CORBA/portable/UnknownException.java deleted file mode 100644 index 725ca7cf1d9..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/portable/UnknownException.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package org.omg.CORBA.portable; -/** - * The org.omg.CORBA.portable.UnknownException is used for reporting - * unknown exceptions between ties and ORBs and between ORBs and stubs. - * It provides a Java representation of an UNKNOWN system exception - * that has an UnknownExceptionInfo service context. - * If the CORBA system exception org.omg.CORBA.portable.UnknownException - * is thrown, then the stub does one of the following: - * (1) Translates it to org.omg.CORBA.UNKNOWN. - * (2) Translates it to the nested exception that the UnknownException contains. - * (3) Passes it on directly to the user. - */ -public class UnknownException extends org.omg.CORBA.SystemException { - /** - * A throwable--the original exception that was wrapped in a CORBA - * UnknownException. - */ - public Throwable originalEx; - /** - * Constructs an UnknownException object. - * @param ex a Throwable object--to be wrapped in this exception. - */ - public UnknownException(Throwable ex) { - super("", 0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE); - originalEx = ex; - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/portable/ValueBase.java b/src/java.corba/share/classes/org/omg/CORBA/portable/ValueBase.java deleted file mode 100644 index 926e728cb14..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/portable/ValueBase.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package org.omg.CORBA.portable; -/** - * The generated Java classes corresponding to valuetype IDL types - * implement this interface. In other words, the Java mapping of - * valuetype objects implement the ValueBase interface. The generated - * Java class for valuetype's shall provide an implementation of the - * ValueBase interface for the corresponding value type. - * For value types that are streamable (i.e. non-custom), - * the generated Java class shall also provide an implementation - * for the org.omg.CORBA.portable.Streamable interface. - * (CORBA::ValueBase is mapped to java.io.Serializable.) - */ -public interface ValueBase extends IDLEntity { - /** - * Provides truncatable repository ids. - * @return a String array--list of truncatable repository ids. - */ - String[] _truncatable_ids(); -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/portable/ValueFactory.java b/src/java.corba/share/classes/org/omg/CORBA/portable/ValueFactory.java deleted file mode 100644 index 355104b1fb6..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/portable/ValueFactory.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package org.omg.CORBA.portable; -import java.io.Serializable; - -/** - * The ValueFactory interface is the native mapping for the IDL - * type CORBA::ValueFactory. The read_value() method is called by - * the ORB runtime while in the process of unmarshaling a value type. - * A user shall implement this method as part of implementing a type - * specific value factory. In the implementation, the user shall call - * is.read_value(java.io.Serializable) with a uninitialized valuetype - * to use for unmarshaling. The value returned by the stream is - * the same value passed in, with all the data unmarshaled. - * @see org.omg.CORBA_2_3.ORB - */ - -public interface ValueFactory { - /** - * Is called by - * the ORB runtime while in the process of unmarshaling a value type. - * A user shall implement this method as part of implementing a type - * specific value factory. - * @param is an InputStream object--from which the value will be read. - * @return a Serializable object--the value read off of "is" Input stream. - */ - Serializable read_value(org.omg.CORBA_2_3.portable.InputStream is); -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/portable/ValueInputStream.java b/src/java.corba/share/classes/org/omg/CORBA/portable/ValueInputStream.java deleted file mode 100644 index 9ce5169efc1..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/portable/ValueInputStream.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA.portable; - -/** - * Java to IDL ptc 02-01-12 1.5.1.4 - * - * ValueInputStream is used for implementing RMI-IIOP - * stream format version 2. - */ -public interface ValueInputStream { - - /** - * The start_value method reads a valuetype - * header for a nested custom valuetype and - * increments the valuetype nesting depth. - */ - void start_value(); - - /** - * The end_value method reads the end tag - * for the nested custom valuetype (after - * skipping any data that precedes the end - * tag) and decrements the valuetype nesting - * depth. - */ - void end_value(); -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/portable/ValueOutputStream.java b/src/java.corba/share/classes/org/omg/CORBA/portable/ValueOutputStream.java deleted file mode 100644 index 3d6e0bd245c..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/portable/ValueOutputStream.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.CORBA.portable; - -/** - * Java to IDL ptc 02-01-12 1.5.1.3 - * - * ValueOutputStream is used for implementing RMI-IIOP - * stream format version 2. - */ -public interface ValueOutputStream { - /** - * The start_value method ends any currently open chunk, - * writes a valuetype header for a nested custom valuetype - * (with a null codebase and the specified repository ID), - * and increments the valuetype nesting depth. - */ - void start_value(java.lang.String rep_id); - - /** - * The end_value method ends any currently open chunk, - * writes the end tag for the nested custom valuetype, - * and decrements the valuetype nesting depth. - */ - void end_value(); -} diff --git a/src/java.corba/share/classes/org/omg/CORBA/portable/package.html b/src/java.corba/share/classes/org/omg/CORBA/portable/package.html deleted file mode 100644 index e0f5cbb0372..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA/portable/package.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - -Provides a portability layer, that is, a set of ORB APIs -that makes it possible for code generated -by one vendor to run on another vendor's ORB. -Stubs and other code, generated either from IDL or -interfaces written in the Java programming language, -can call into these ORB APIs. - - - -

            - -


            -

            CORBA Features Throwing NO_IMPLEMENT() Exceptions

            -
            -Some methods throw NO_IMPLEMENT() exceptions by default, but ORB vendors -can override them to provide real implementations. The ORB included in -Sun's release of the Java[tm] Platform, Standard Edition 6, includes -implementations for the following methods. - -

            List of Unimplemented Features in Package -org.omg.CORBA.portable

            - -

            Unimplemented Interfaces in package org.omg.CORBA.portable

            -
              -
            • InvokeHandler -
            • ResponseHandler -
            - -

            Unimplemented Methods in package org.omg.CORBA.portable

            -
              -
            • InputStream -
                -
              • public int read() -
              • public.math.BigDecimal read_fixed() -
              • public org.omg.CORBA.Context read_Context() -
              • public org.omg.CORBA.Object read_Object(java.lang.Class clz) -
              • public org.omg.CORBA.ORB orb() -
              -
            • OutputStream -
                -
              • public org.omg.CORBA.ORB orb() -
              • public void write_Context(org.omg.CORBA.Context ctx, - org.omg.CORBA.ContextList contexts) -
              • public void write_fixed(java.math.BigDecimal value) -
              • public void write(int b) -
              -
            • Delegate -
                -
              • public void releaseReply(org.omg.CORBA.Object self, InputStream input) -
              • public InputStream invoke(org.omgl.CORBA.Object self, OutputStream output) -
              • public OutputStream request(org.omg.CORBA.Object self, String operation, - boolean responseExpected) -
              • public org.omg.CORBA.Object set_policy_override(org.omg.CORBA.Object self, - org.omg.CORBA.Policy[] policies, - org.omg.CORBA.SetOverrideType set_add) -
              • public org.omg.CORBA.DomainManager[] get_domain_managers( - org.omg.CORBA.Objectself) -
              • public org.omg.CORBA.Policy get_policy(org.omg.CORBA.Object self, - int policy_type) -
              -
            - -@since JDK1.2 -@serial exclude - - diff --git a/src/java.corba/share/classes/org/omg/CORBA_2_3/ORB.java b/src/java.corba/share/classes/org/omg/CORBA_2_3/ORB.java deleted file mode 100644 index fc203c31f89..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA_2_3/ORB.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package org.omg.CORBA_2_3; - -/** - * A class extending org.omg.CORBA.ORB to make the ORB - * portable under the OMG CORBA version 2.3 specification. - */ -public abstract class ORB extends org.omg.CORBA.ORB { - -/** - * - */ - public org.omg.CORBA.portable.ValueFactory register_value_factory(String id, - org.omg.CORBA.portable.ValueFactory factory) - { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - -/** - * - */ - public void unregister_value_factory(String id) - { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - -/** - * - */ - public org.omg.CORBA.portable.ValueFactory lookup_value_factory(String id) - { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - -/** - * @see CORBA_2_3 package - * comments for unimplemented features - */ - // always return a ValueDef or throw BAD_PARAM if - // repid does not represent a valuetype - public org.omg.CORBA.Object get_value_def(String repid) - throws org.omg.CORBA.BAD_PARAM { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - -/** - * @see CORBA_2_3 package - * comments for unimplemented features - */ - public void set_delegate(java.lang.Object wrapper) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA_2_3/package.html b/src/java.corba/share/classes/org/omg/CORBA_2_3/package.html deleted file mode 100644 index 7a82edb9275..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA_2_3/package.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - package - - - -The CORBA_2_3 package defines additions to existing CORBA interfaces -in the Java[tm] Standard Edition 6.   These changes occurred in recent -revisions to the CORBA API defined by the OMG.  The new methods were -added to  interfaces derived from the corresponding interfaces in -the CORBA package.  This provides backward compatibility and avoids -breaking the JCK tests. - -

            Package Specification

            - -

            For a precise list of supported sections of official specifications with which -the Java[tm] Platform, Standard Edition 6, ORB complies, see Official Specifications for CORBA -support in Java[tm] SE 6. -

            - -The following methods in the abstract class -org.omg.CORBA_2_3.ORB are unimplemented: -

              -
            • public org.omg.CORBA.portable.ValueFactory - register_value_factory(String id, org.omg.CORBA.portable.ValueFactory - factory) -
            • public void unregister_value_factory(String id) -
            • public org.omg.CORBA.portable.ValueFactory - lookup_value_factory(String id) -
            • public org.omg.CORBA.Object get_value_def(String repid) -
            • public void set_delegate(java.lang.Object wrapper) -
            -@since JDK 1.3 -
            -@serial exclude - - - diff --git a/src/java.corba/share/classes/org/omg/CORBA_2_3/portable/Delegate.java b/src/java.corba/share/classes/org/omg/CORBA_2_3/portable/Delegate.java deleted file mode 100644 index a158ae9b318..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA_2_3/portable/Delegate.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package org.omg.CORBA_2_3.portable; - -/** - * Delegate class provides the ORB vendor specific implementation - * of CORBA object. It extends org.omg.CORBA.portable.Delegate and - * provides new methods that were defined by CORBA 2.3. - * - * @see org.omg.CORBA.portable.Delegate - * @author OMG - * @since JDK1.2 - */ - -public abstract class Delegate extends org.omg.CORBA.portable.Delegate { - - /** Returns the codebase for object reference provided. - * @param self the object reference whose codebase needs to be returned. - * @return the codebase as a space delimited list of url strings or - * null if none. - */ - public java.lang.String get_codebase(org.omg.CORBA.Object self) { - return null; - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA_2_3/portable/InputStream.java b/src/java.corba/share/classes/org/omg/CORBA_2_3/portable/InputStream.java deleted file mode 100644 index 191353834ad..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA_2_3/portable/InputStream.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package org.omg.CORBA_2_3.portable; - -import java.io.SerializablePermission; -import java.security.AccessController; -import java.security.PrivilegedAction; - -/** - * InputStream provides for the reading of all of the mapped IDL types - * from the stream. It extends org.omg.CORBA.portable.InputStream. This - * class defines new methods that were added for CORBA 2.3. - * - * @see org.omg.CORBA.portable.InputStream - * @author OMG - * @since JDK1.2 - */ - -public abstract class InputStream extends org.omg.CORBA.portable.InputStream { - - - private static final String ALLOW_SUBCLASS_PROP = "jdk.corba.allowInputStreamSubclass"; - - private static final boolean allowSubclass = AccessController.doPrivileged( - new PrivilegedAction() { - @Override - public Boolean run() { - String prop = System.getProperty(ALLOW_SUBCLASS_PROP); - return prop == null ? false : - (prop.equalsIgnoreCase("false") ? false : true); - } - }); - - private static Void checkPermission() { - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - if (!allowSubclass) - sm.checkPermission(new - SerializablePermission("enableSubclassImplementation")); - } - return null; - } - - private InputStream(Void ignore) { } - - /** - * Create a new instance of this class. - * - * @implNote - * Throws SecurityException if SecurityManager is installed and - * enableSubclassImplementation SerializablePermission - * is not granted or jdk.corba.allowInputStreamSubclass system - * property is either not set or is set to 'false'. - */ - public InputStream() { - this(checkPermission()); - } - - /** - * Unmarshalls a value type from the input stream. - * @return the value type unmarshalled from the input stream - */ - public java.io.Serializable read_value() { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Unmarshalls a value type from the input stream. - * @param clz is the declared type of the value to be unmarshalled - * @return the value unmarshalled from the input stream - */ - public java.io.Serializable read_value(java.lang.Class clz) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Unmarshalls a value type from the input stream. - * @param factory is the instance fo the helper to be used for - * unmarshalling the value type - * @return the value unmarshalled from the input stream - */ - public java.io.Serializable read_value(org.omg.CORBA.portable.BoxedValueHelper factory) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Unmarshalls a value type from the input stream. - * @param rep_id identifies the type of the value to be unmarshalled - * @return value type unmarshalled from the input stream - */ - public java.io.Serializable read_value(java.lang.String rep_id) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Unmarshalls a value type from the input stream. - * @param value is an uninitialized value which is added to the orb's - * indirection table before calling Streamable._read() or - * CustomMarshal.unmarshal() to unmarshal the value. - * @return value type unmarshalled from the input stream - */ - public java.io.Serializable read_value(java.io.Serializable value) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Unmarshal the value object or a suitable stub object. - * @return ORB runtime returns the value object or a suitable stub object. - */ - public java.lang.Object read_abstract_interface() { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Unmarshal the class object or the stub class corresponding to the passed type. - * @param clz is the Class object for the stub class which corresponds to - * the type that is statically expected. - * @return ORB runtime returns the value object or a suitable stub object. - */ - public java.lang.Object read_abstract_interface(java.lang.Class clz) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA_2_3/portable/ObjectImpl.java b/src/java.corba/share/classes/org/omg/CORBA_2_3/portable/ObjectImpl.java deleted file mode 100644 index 6fbfabe9b03..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA_2_3/portable/ObjectImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package org.omg.CORBA_2_3.portable; - -import org.omg.CORBA_2_3.portable.Delegate; - -/** - * ObjectImpl class is the base class for all stubs. It provides the - * basic delegation mechanism. It extends org.omg.CORBA.portable.ObjectImpl - * and provides new methods defined by CORBA 2.3. - * - * @see org.omg.CORBA.portable.ObjectImpl - * @author OMG - * @since JDK1.2 - */ - - -public abstract class ObjectImpl extends org.omg.CORBA.portable.ObjectImpl { - - /** Returns the codebase for this object reference. - * @return the codebase as a space delimited list of url strings or - * null if none. - */ - public java.lang.String _get_codebase() { - org.omg.CORBA.portable.Delegate delegate = _get_delegate(); - if (delegate instanceof Delegate) - return ((Delegate) delegate).get_codebase(this); - return null; - } -} diff --git a/src/java.corba/share/classes/org/omg/CORBA_2_3/portable/OutputStream.java b/src/java.corba/share/classes/org/omg/CORBA_2_3/portable/OutputStream.java deleted file mode 100644 index 00955b3df7b..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA_2_3/portable/OutputStream.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package org.omg.CORBA_2_3.portable; - -import java.io.SerializablePermission; -import java.security.AccessController; -import java.security.PrivilegedAction; - -/** - * OutputStream provides interface for writing of all of the mapped IDL type - * to the stream. It extends org.omg.CORBA.portable.OutputStream, and defines - * new methods defined by CORBA 2.3. - * - * @see org.omg.CORBA.portable.OutputStream - * @author OMG - * @since JDK1.2 - */ - -public abstract class OutputStream extends org.omg.CORBA.portable.OutputStream { - - private static final String ALLOW_SUBCLASS_PROP = "jdk.corba.allowOutputStreamSubclass"; - private static final boolean allowSubclass = AccessController.doPrivileged( - new PrivilegedAction() { - @Override - public Boolean run() { - String prop = System.getProperty(ALLOW_SUBCLASS_PROP); - return prop == null ? false : - (prop.equalsIgnoreCase("false") ? false : true); - } - }); - - private static Void checkPermission() { - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - if (!allowSubclass) - sm.checkPermission(new - SerializablePermission("enableSubclassImplementation")); - } - return null; - } - private OutputStream(Void ignore) { } - - /** - * Create a new instance of this class. - * - * @implNote - * Throws SecurityException if SecurityManager is installed and - * enableSubclassImplementation SerializablePermission - * is not granted or jdk.corba.allowOutputStreamSubclass system - * property is either not set or is set to 'false'. - */ - public OutputStream() { - this(checkPermission()); - } - - /** - * Marshals a value type to the output stream. - * @param value is the acutal value to write - */ - public void write_value(java.io.Serializable value) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Marshals a value type to the output stream. - * @param value is the acutal value to write - * @param clz is the declared type of the value to be marshaled - */ - public void write_value(java.io.Serializable value, java.lang.Class clz) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Marshals a value type to the output stream. - * @param value is the acutal value to write - * @param repository_id identifies the type of the value type to - * be marshaled - */ - public void write_value(java.io.Serializable value, String repository_id) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Marshals a value type to the output stream. - * @param value is the acutal value to write - * @param factory is the instance of the helper to be used for marshaling - * the boxed value - */ - public void write_value(java.io.Serializable value, org.omg.CORBA.portable.BoxedValueHelper factory) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - /** - * Marshals a value object or a stub object. - * @param obj the actual value object to marshal or the stub to be marshalled - */ - public void write_abstract_interface(java.lang.Object obj) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - -} diff --git a/src/java.corba/share/classes/org/omg/CORBA_2_3/portable/package.html b/src/java.corba/share/classes/org/omg/CORBA_2_3/portable/package.html deleted file mode 100644 index 6b3f430e3b3..00000000000 --- a/src/java.corba/share/classes/org/omg/CORBA_2_3/portable/package.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - Provides methods for the input and output of value types, and contains - other updates to the org/omg/CORBA/portable package. - -@since 1.3 -@serial exclude - - diff --git a/src/java.corba/share/classes/org/omg/CosNaming/NamingContextExtPackage/package.html b/src/java.corba/share/classes/org/omg/CosNaming/NamingContextExtPackage/package.html deleted file mode 100644 index 9636d1dc95f..00000000000 --- a/src/java.corba/share/classes/org/omg/CosNaming/NamingContextExtPackage/package.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - -

            This package contains the following classes, which are used in -org.omg.CosNaming.NamingContextExt: -

              -
            • AddressHelper -
            • StringNameHelper -
            • URLStringHelper -
            • InvalidAddress -
            - -

            Package Specification

            - -

            For a precise list of supported sections of official specifications with which -the Java[tm] Platform, Standard Edition 6 ORB complies, see Official Specifications for CORBA -support in Java[tm] SE 6. - -@since 1.4 -
            -@serial exclude - - diff --git a/src/java.corba/share/classes/org/omg/CosNaming/NamingContextPackage/package.html b/src/java.corba/share/classes/org/omg/CosNaming/NamingContextPackage/package.html deleted file mode 100644 index b97eafdad05..00000000000 --- a/src/java.corba/share/classes/org/omg/CosNaming/NamingContextPackage/package.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - -

            This package contains Exception classes for the org.omg.CosNaming - package. The list of exception classes are: -

              -
            • AlreadyBound -
            • CannotProceed -
            • InvalidName -
            • NotEmpty -
            • NotFound -
            • NotFoundReason -
            - - -

            Package Specification

            - -

            For a precise list of supported sections of official specifications with which -the Java[tm] Platform, Standard Edition 6 ORB complies, see Official Specifications for CORBA -support in Java SE 6. - -@since 1.4 -
            -@serial exclude - - diff --git a/src/java.corba/share/classes/org/omg/CosNaming/_BindingIteratorImplBase.java b/src/java.corba/share/classes/org/omg/CosNaming/_BindingIteratorImplBase.java deleted file mode 100644 index 9b43349845f..00000000000 --- a/src/java.corba/share/classes/org/omg/CosNaming/_BindingIteratorImplBase.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * File: ./org/omg/CosNaming/_BindingIteratorImplBase.java - * From: nameservice.idl - * Date: Tue Aug 11 03:12:09 1998 - * By: idltojava Java IDL 1.2 Aug 11 1998 02:00:18 - * @deprecated Deprecated in JDK 1.4. - */ - -package org.omg.CosNaming; -public abstract class _BindingIteratorImplBase extends org.omg.CORBA.DynamicImplementation implements org.omg.CosNaming.BindingIterator { - // Constructor - public _BindingIteratorImplBase() { - super(); - } - // Type strings for this class and its superclases - private static final String _type_ids[] = { - "IDL:omg.org/CosNaming/BindingIterator:1.0" - }; - - public String[] _ids() { return (String[]) _type_ids.clone(); } - - private static java.util.Dictionary _methods = new java.util.Hashtable(); - static { - _methods.put("next_one", new java.lang.Integer(0)); - _methods.put("next_n", new java.lang.Integer(1)); - _methods.put("destroy", new java.lang.Integer(2)); - } - // DSI Dispatch call - public void invoke(org.omg.CORBA.ServerRequest r) { - switch (((java.lang.Integer) _methods.get(r.op_name())).intValue()) { - case 0: // org.omg.CosNaming.BindingIterator.next_one - { - org.omg.CORBA.NVList _list = _orb().create_list(0); - org.omg.CORBA.Any _b = _orb().create_any(); - _b.type(org.omg.CosNaming.BindingHelper.type()); - _list.add_value("b", _b, org.omg.CORBA.ARG_OUT.value); - r.params(_list); - org.omg.CosNaming.BindingHolder b; - b = new org.omg.CosNaming.BindingHolder(); - boolean ___result; - ___result = this.next_one(b); - org.omg.CosNaming.BindingHelper.insert(_b, b.value); - org.omg.CORBA.Any __result = _orb().create_any(); - __result.insert_boolean(___result); - r.result(__result); - } - break; - case 1: // org.omg.CosNaming.BindingIterator.next_n - { - org.omg.CORBA.NVList _list = _orb().create_list(0); - org.omg.CORBA.Any _how_many = _orb().create_any(); - _how_many.type(org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_ulong)); - _list.add_value("how_many", _how_many, org.omg.CORBA.ARG_IN.value); - org.omg.CORBA.Any _bl = _orb().create_any(); - _bl.type(org.omg.CosNaming.BindingListHelper.type()); - _list.add_value("bl", _bl, org.omg.CORBA.ARG_OUT.value); - r.params(_list); - int how_many; - how_many = _how_many.extract_ulong(); - org.omg.CosNaming.BindingListHolder bl; - bl = new org.omg.CosNaming.BindingListHolder(); - boolean ___result; - ___result = this.next_n(how_many, bl); - org.omg.CosNaming.BindingListHelper.insert(_bl, bl.value); - org.omg.CORBA.Any __result = _orb().create_any(); - __result.insert_boolean(___result); - r.result(__result); - } - break; - case 2: // org.omg.CosNaming.BindingIterator.destroy - { - org.omg.CORBA.NVList _list = _orb().create_list(0); - r.params(_list); - this.destroy(); - org.omg.CORBA.Any __return = _orb().create_any(); - __return.type(_orb().get_primitive_tc(org.omg.CORBA.TCKind.tk_void)); - r.result(__return); - } - break; - default: - throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE); - } - } -} diff --git a/src/java.corba/share/classes/org/omg/CosNaming/_NamingContextImplBase.java b/src/java.corba/share/classes/org/omg/CosNaming/_NamingContextImplBase.java deleted file mode 100644 index ece23c2f236..00000000000 --- a/src/java.corba/share/classes/org/omg/CosNaming/_NamingContextImplBase.java +++ /dev/null @@ -1,407 +0,0 @@ -/* - * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * File: ./org/omg/CosNaming/_NamingContextImplBase.java - * From: nameservice.idl - * Date: Tue Aug 11 03:12:09 1998 - * By: idltojava Java IDL 1.2 Aug 11 1998 02:00:18 - * @deprecated Deprecated in JDK 1.4. - */ - -package org.omg.CosNaming; -public abstract class _NamingContextImplBase extends org.omg.CORBA.DynamicImplementation implements org.omg.CosNaming.NamingContext { - // Constructor - public _NamingContextImplBase() { - super(); - } - // Type strings for this class and its superclases - private static final String _type_ids[] = { - "IDL:omg.org/CosNaming/NamingContext:1.0" - }; - - public String[] _ids() { return (String[]) _type_ids.clone(); } - - private static java.util.Dictionary _methods = new java.util.Hashtable(); - static { - _methods.put("bind", new java.lang.Integer(0)); - _methods.put("bind_context", new java.lang.Integer(1)); - _methods.put("rebind", new java.lang.Integer(2)); - _methods.put("rebind_context", new java.lang.Integer(3)); - _methods.put("resolve", new java.lang.Integer(4)); - _methods.put("unbind", new java.lang.Integer(5)); - _methods.put("list", new java.lang.Integer(6)); - _methods.put("new_context", new java.lang.Integer(7)); - _methods.put("bind_new_context", new java.lang.Integer(8)); - _methods.put("destroy", new java.lang.Integer(9)); - } - // DSI Dispatch call - public void invoke(org.omg.CORBA.ServerRequest r) { - switch (((java.lang.Integer) _methods.get(r.op_name())).intValue()) { - case 0: // org.omg.CosNaming.NamingContext.bind - { - org.omg.CORBA.NVList _list = _orb().create_list(0); - org.omg.CORBA.Any _n = _orb().create_any(); - _n.type(org.omg.CosNaming.NameHelper.type()); - _list.add_value("n", _n, org.omg.CORBA.ARG_IN.value); - org.omg.CORBA.Any _obj = _orb().create_any(); - _obj.type(org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_objref)); - _list.add_value("obj", _obj, org.omg.CORBA.ARG_IN.value); - r.params(_list); - org.omg.CosNaming.NameComponent[] n; - n = org.omg.CosNaming.NameHelper.extract(_n); - org.omg.CORBA.Object obj; - obj = _obj.extract_Object(); - try { - this.bind(n, obj); - } - catch (org.omg.CosNaming.NamingContextPackage.NotFound e0) { - org.omg.CORBA.Any _except = _orb().create_any(); - org.omg.CosNaming.NamingContextPackage.NotFoundHelper.insert(_except, e0); - r.except(_except); - return; - } - catch (org.omg.CosNaming.NamingContextPackage.CannotProceed e1) { - org.omg.CORBA.Any _except = _orb().create_any(); - org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.insert(_except, e1); - r.except(_except); - return; - } - catch (org.omg.CosNaming.NamingContextPackage.InvalidName e2) { - org.omg.CORBA.Any _except = _orb().create_any(); - org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.insert(_except, e2); - r.except(_except); - return; - } - catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound e3) { - org.omg.CORBA.Any _except = _orb().create_any(); - org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper.insert(_except, e3); - r.except(_except); - return; - } - org.omg.CORBA.Any __return = _orb().create_any(); - __return.type(_orb().get_primitive_tc(org.omg.CORBA.TCKind.tk_void)); - r.result(__return); - } - break; - case 1: // org.omg.CosNaming.NamingContext.bind_context - { - org.omg.CORBA.NVList _list = _orb().create_list(0); - org.omg.CORBA.Any _n = _orb().create_any(); - _n.type(org.omg.CosNaming.NameHelper.type()); - _list.add_value("n", _n, org.omg.CORBA.ARG_IN.value); - org.omg.CORBA.Any _nc = _orb().create_any(); - _nc.type(org.omg.CosNaming.NamingContextHelper.type()); - _list.add_value("nc", _nc, org.omg.CORBA.ARG_IN.value); - r.params(_list); - org.omg.CosNaming.NameComponent[] n; - n = org.omg.CosNaming.NameHelper.extract(_n); - org.omg.CosNaming.NamingContext nc; - nc = org.omg.CosNaming.NamingContextHelper.extract(_nc); - try { - this.bind_context(n, nc); - } - catch (org.omg.CosNaming.NamingContextPackage.NotFound e0) { - org.omg.CORBA.Any _except = _orb().create_any(); - org.omg.CosNaming.NamingContextPackage.NotFoundHelper.insert(_except, e0); - r.except(_except); - return; - } - catch (org.omg.CosNaming.NamingContextPackage.CannotProceed e1) { - org.omg.CORBA.Any _except = _orb().create_any(); - org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.insert(_except, e1); - r.except(_except); - return; - } - catch (org.omg.CosNaming.NamingContextPackage.InvalidName e2) { - org.omg.CORBA.Any _except = _orb().create_any(); - org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.insert(_except, e2); - r.except(_except); - return; - } - catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound e3) { - org.omg.CORBA.Any _except = _orb().create_any(); - org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper.insert(_except, e3); - r.except(_except); - return; - } - org.omg.CORBA.Any __return = _orb().create_any(); - __return.type(_orb().get_primitive_tc(org.omg.CORBA.TCKind.tk_void)); - r.result(__return); - } - break; - case 2: // org.omg.CosNaming.NamingContext.rebind - { - org.omg.CORBA.NVList _list = _orb().create_list(0); - org.omg.CORBA.Any _n = _orb().create_any(); - _n.type(org.omg.CosNaming.NameHelper.type()); - _list.add_value("n", _n, org.omg.CORBA.ARG_IN.value); - org.omg.CORBA.Any _obj = _orb().create_any(); - _obj.type(org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_objref)); - _list.add_value("obj", _obj, org.omg.CORBA.ARG_IN.value); - r.params(_list); - org.omg.CosNaming.NameComponent[] n; - n = org.omg.CosNaming.NameHelper.extract(_n); - org.omg.CORBA.Object obj; - obj = _obj.extract_Object(); - try { - this.rebind(n, obj); - } - catch (org.omg.CosNaming.NamingContextPackage.NotFound e0) { - org.omg.CORBA.Any _except = _orb().create_any(); - org.omg.CosNaming.NamingContextPackage.NotFoundHelper.insert(_except, e0); - r.except(_except); - return; - } - catch (org.omg.CosNaming.NamingContextPackage.CannotProceed e1) { - org.omg.CORBA.Any _except = _orb().create_any(); - org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.insert(_except, e1); - r.except(_except); - return; - } - catch (org.omg.CosNaming.NamingContextPackage.InvalidName e2) { - org.omg.CORBA.Any _except = _orb().create_any(); - org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.insert(_except, e2); - r.except(_except); - return; - } - org.omg.CORBA.Any __return = _orb().create_any(); - __return.type(_orb().get_primitive_tc(org.omg.CORBA.TCKind.tk_void)); - r.result(__return); - } - break; - case 3: // org.omg.CosNaming.NamingContext.rebind_context - { - org.omg.CORBA.NVList _list = _orb().create_list(0); - org.omg.CORBA.Any _n = _orb().create_any(); - _n.type(org.omg.CosNaming.NameHelper.type()); - _list.add_value("n", _n, org.omg.CORBA.ARG_IN.value); - org.omg.CORBA.Any _nc = _orb().create_any(); - _nc.type(org.omg.CosNaming.NamingContextHelper.type()); - _list.add_value("nc", _nc, org.omg.CORBA.ARG_IN.value); - r.params(_list); - org.omg.CosNaming.NameComponent[] n; - n = org.omg.CosNaming.NameHelper.extract(_n); - org.omg.CosNaming.NamingContext nc; - nc = org.omg.CosNaming.NamingContextHelper.extract(_nc); - try { - this.rebind_context(n, nc); - } - catch (org.omg.CosNaming.NamingContextPackage.NotFound e0) { - org.omg.CORBA.Any _except = _orb().create_any(); - org.omg.CosNaming.NamingContextPackage.NotFoundHelper.insert(_except, e0); - r.except(_except); - return; - } - catch (org.omg.CosNaming.NamingContextPackage.CannotProceed e1) { - org.omg.CORBA.Any _except = _orb().create_any(); - org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.insert(_except, e1); - r.except(_except); - return; - } - catch (org.omg.CosNaming.NamingContextPackage.InvalidName e2) { - org.omg.CORBA.Any _except = _orb().create_any(); - org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.insert(_except, e2); - r.except(_except); - return; - } - org.omg.CORBA.Any __return = _orb().create_any(); - __return.type(_orb().get_primitive_tc(org.omg.CORBA.TCKind.tk_void)); - r.result(__return); - } - break; - case 4: // org.omg.CosNaming.NamingContext.resolve - { - org.omg.CORBA.NVList _list = _orb().create_list(0); - org.omg.CORBA.Any _n = _orb().create_any(); - _n.type(org.omg.CosNaming.NameHelper.type()); - _list.add_value("n", _n, org.omg.CORBA.ARG_IN.value); - r.params(_list); - org.omg.CosNaming.NameComponent[] n; - n = org.omg.CosNaming.NameHelper.extract(_n); - org.omg.CORBA.Object ___result; - try { - ___result = this.resolve(n); - } - catch (org.omg.CosNaming.NamingContextPackage.NotFound e0) { - org.omg.CORBA.Any _except = _orb().create_any(); - org.omg.CosNaming.NamingContextPackage.NotFoundHelper.insert(_except, e0); - r.except(_except); - return; - } - catch (org.omg.CosNaming.NamingContextPackage.CannotProceed e1) { - org.omg.CORBA.Any _except = _orb().create_any(); - org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.insert(_except, e1); - r.except(_except); - return; - } - catch (org.omg.CosNaming.NamingContextPackage.InvalidName e2) { - org.omg.CORBA.Any _except = _orb().create_any(); - org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.insert(_except, e2); - r.except(_except); - return; - } - org.omg.CORBA.Any __result = _orb().create_any(); - __result.insert_Object(___result); - r.result(__result); - } - break; - case 5: // org.omg.CosNaming.NamingContext.unbind - { - org.omg.CORBA.NVList _list = _orb().create_list(0); - org.omg.CORBA.Any _n = _orb().create_any(); - _n.type(org.omg.CosNaming.NameHelper.type()); - _list.add_value("n", _n, org.omg.CORBA.ARG_IN.value); - r.params(_list); - org.omg.CosNaming.NameComponent[] n; - n = org.omg.CosNaming.NameHelper.extract(_n); - try { - this.unbind(n); - } - catch (org.omg.CosNaming.NamingContextPackage.NotFound e0) { - org.omg.CORBA.Any _except = _orb().create_any(); - org.omg.CosNaming.NamingContextPackage.NotFoundHelper.insert(_except, e0); - r.except(_except); - return; - } - catch (org.omg.CosNaming.NamingContextPackage.CannotProceed e1) { - org.omg.CORBA.Any _except = _orb().create_any(); - org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.insert(_except, e1); - r.except(_except); - return; - } - catch (org.omg.CosNaming.NamingContextPackage.InvalidName e2) { - org.omg.CORBA.Any _except = _orb().create_any(); - org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.insert(_except, e2); - r.except(_except); - return; - } - org.omg.CORBA.Any __return = _orb().create_any(); - __return.type(_orb().get_primitive_tc(org.omg.CORBA.TCKind.tk_void)); - r.result(__return); - } - break; - case 6: // org.omg.CosNaming.NamingContext.list - { - org.omg.CORBA.NVList _list = _orb().create_list(0); - org.omg.CORBA.Any _how_many = _orb().create_any(); - _how_many.type(org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_ulong)); - _list.add_value("how_many", _how_many, org.omg.CORBA.ARG_IN.value); - org.omg.CORBA.Any _bl = _orb().create_any(); - _bl.type(org.omg.CosNaming.BindingListHelper.type()); - _list.add_value("bl", _bl, org.omg.CORBA.ARG_OUT.value); - org.omg.CORBA.Any _bi = _orb().create_any(); - _bi.type(org.omg.CosNaming.BindingIteratorHelper.type()); - _list.add_value("bi", _bi, org.omg.CORBA.ARG_OUT.value); - r.params(_list); - int how_many; - how_many = _how_many.extract_ulong(); - org.omg.CosNaming.BindingListHolder bl; - bl = new org.omg.CosNaming.BindingListHolder(); - org.omg.CosNaming.BindingIteratorHolder bi; - bi = new org.omg.CosNaming.BindingIteratorHolder(); - this.list(how_many, bl, bi); - org.omg.CosNaming.BindingListHelper.insert(_bl, bl.value); - org.omg.CosNaming.BindingIteratorHelper.insert(_bi, bi.value); - org.omg.CORBA.Any __return = _orb().create_any(); - __return.type(_orb().get_primitive_tc(org.omg.CORBA.TCKind.tk_void)); - r.result(__return); - } - break; - case 7: // org.omg.CosNaming.NamingContext.new_context - { - org.omg.CORBA.NVList _list = _orb().create_list(0); - r.params(_list); - org.omg.CosNaming.NamingContext ___result; - ___result = this.new_context(); - org.omg.CORBA.Any __result = _orb().create_any(); - org.omg.CosNaming.NamingContextHelper.insert(__result, ___result); - r.result(__result); - } - break; - case 8: // org.omg.CosNaming.NamingContext.bind_new_context - { - org.omg.CORBA.NVList _list = _orb().create_list(0); - org.omg.CORBA.Any _n = _orb().create_any(); - _n.type(org.omg.CosNaming.NameHelper.type()); - _list.add_value("n", _n, org.omg.CORBA.ARG_IN.value); - r.params(_list); - org.omg.CosNaming.NameComponent[] n; - n = org.omg.CosNaming.NameHelper.extract(_n); - org.omg.CosNaming.NamingContext ___result; - try { - ___result = this.bind_new_context(n); - } - catch (org.omg.CosNaming.NamingContextPackage.NotFound e0) { - org.omg.CORBA.Any _except = _orb().create_any(); - org.omg.CosNaming.NamingContextPackage.NotFoundHelper.insert(_except, e0); - r.except(_except); - return; - } - catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound e1) { - org.omg.CORBA.Any _except = _orb().create_any(); - org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper.insert(_except, e1); - r.except(_except); - return; - } - catch (org.omg.CosNaming.NamingContextPackage.CannotProceed e2) { - org.omg.CORBA.Any _except = _orb().create_any(); - org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.insert(_except, e2); - r.except(_except); - return; - } - catch (org.omg.CosNaming.NamingContextPackage.InvalidName e3) { - org.omg.CORBA.Any _except = _orb().create_any(); - org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.insert(_except, e3); - r.except(_except); - return; - } - org.omg.CORBA.Any __result = _orb().create_any(); - org.omg.CosNaming.NamingContextHelper.insert(__result, ___result); - r.result(__result); - } - break; - case 9: // org.omg.CosNaming.NamingContext.destroy - { - org.omg.CORBA.NVList _list = _orb().create_list(0); - r.params(_list); - try { - this.destroy(); - } - catch (org.omg.CosNaming.NamingContextPackage.NotEmpty e0) { - org.omg.CORBA.Any _except = _orb().create_any(); - org.omg.CosNaming.NamingContextPackage.NotEmptyHelper.insert(_except, e0); - r.except(_except); - return; - } - org.omg.CORBA.Any __return = _orb().create_any(); - __return.type(_orb().get_primitive_tc(org.omg.CORBA.TCKind.tk_void)); - r.result(__return); - } - break; - default: - throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE); - } - } -} diff --git a/src/java.corba/share/classes/org/omg/CosNaming/nameservice.idl b/src/java.corba/share/classes/org/omg/CosNaming/nameservice.idl deleted file mode 100644 index ae276b0aee1..00000000000 --- a/src/java.corba/share/classes/org/omg/CosNaming/nameservice.idl +++ /dev/null @@ -1,509 +0,0 @@ -/* - * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -// name.idl - Naming service interface -#pragma prefix "omg.org" - - -/** - * The CORBA COS Naming Service provides the ability to bind a name - * to an object relative to a naming context. A naming context is an - * object that contains a set of name bindings in which each name is unique. - * To resolve a name is to determine the object associated with the name in - * a given context.

            - * - * See http://www.omg.org/technology/documents/formal/naming_service.htm - * for the complete CORBA - * COS Naming Specification.

            - */ -module CosNaming -{ - typedef string Istring; - - /** - * Many of the operations defined on a naming context take names as - * parameters. Names have structure. A name is an ordered sequence of - * components.

            - * - * A name with a single component is called a simple name; a name with - * multiple components is called a compound name. Each component except - * the last is used to name a context; the last component denotes the - * bound object.

            - * - * A name component consists of two attributes: the identifier - * attribute and the kind attribute. Both the identifier attribute and the - * kind attribute are represented as IDL strings. The kind attribute adds - * descriptive power to names in a syntax-independent way. Examples of the - * value of the kind attribute include c_source, object_code, executable, - * postscript, or " ". - */ - struct NameComponent - { - Istring id; - Istring kind; - }; - - /** - * A name is a sequence of name components. - */ - typedef sequence Name; - - /** - * Specifies whether the given binding is for a object (that is not a - * naming context) or for a naming context. - */ - enum BindingType - { - nobject, // name is bound to an object - ncontext // name is bound to a naming context - }; - - /** - * A name-to-object association is called a Binding. - */ - struct Binding - { - Name binding_name; // name - BindingType binding_type; // whether name is bound to an object - // or a naming context - }; - - /** - * List of Bindings. - */ - typedef sequence BindingList; - - /** - * The BindingIterator interface allows a client to iterate through - * the bindings using the next_one or next_n operations. - * - * The bindings iterator is obtained by using the list - * method on the NamingContext. - * @see org.omg.CosNaming.NamingContext#list - */ - interface BindingIterator - { - /** - * This operation returns the next binding. If there are no more - * bindings, false is returned. - * - * @param b the returned binding - */ - boolean next_one(out Binding b); - - /** - * This operation returns at most the requested number of bindings. - * - * @param how_many the maximum number of bindings to return - * - * @param bl the returned bindings - */ - boolean next_n(in unsigned long how_many, - out BindingList bl); - - // Destroy binding iterator - /** - * This operation destroys the iterator. - */ - void destroy(); - }; - -/** - * A naming context is an object that contains a set of name bindings in - * which each name is unique. Different names can be bound to an object - * in the same or different contexts at the same time.

            - * - * See - * CORBA COS - * Naming Specification. - */ - interface NamingContext - { - // Declare exceptions - /** - * Indicates the reason for not able to resolve. - */ - enum NotFoundReason - { - missing_node, - not_context, - not_object - }; - -/** - * Indicates the name does not identify a binding. - */ - exception NotFound - { - NotFoundReason why; - Name rest_of_name; - }; - -/** - * Indicates that the implementation has given up for some reason. - * The client, however, may be able to continue the operation at the - * returned naming context. - */ - exception CannotProceed - { - NamingContext cxt; - Name rest_of_name; - }; - -/** - * Indicates the name is invalid. - */ - exception InvalidName - {}; - -/** - * Indicates an object is already bound to the specified name. Only - * one object can be bound to a particular name in a context. - */ - exception AlreadyBound - {}; - -/** - * Indicates that the Naming Context contains bindings. - */ - exception NotEmpty - {}; - -/** - * Creates a binding of a name and an object in the naming context. - * Naming contexts that are bound using bind do not participate in name - * resolution when compound names are passed to be resolved. - * - * @param n Name of the object. - * - * @param obj The Object to bind with the given name. - * - * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates - * the name does not identify a binding. - * - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed - * Indicates that the implementation has given up for some reason. - * The client, however, may be able to continue the operation - * at the returned naming context. - * - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName - * Indicates that the name is invalid. - * - * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound - * Indicates an object is already bound to the specified name. - */ - void bind(in Name n, - in Object obj) - raises(NotFound, - CannotProceed, - InvalidName, - AlreadyBound); - -/** - * Names an object that is a naming context. Naming contexts that - * are bound using bind_context() participate in name resolution - * when compound names are passed to be resolved. - * - * @param n Name of the object. - * - * @param nc NamingContect object to bind with the given name. - * - * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding. - * - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has - * given up for some reason. The client, however, may be able to - * continue the operation at the returned naming context. - * - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. - * - * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound Indicates an object is already - * bound to the specified name. - */ - void bind_context(in Name n, - in NamingContext nc) - raises(NotFound, - CannotProceed, - InvalidName, - AlreadyBound); - -/** - * Creates a binding of a name and an object in the naming context - * even if the name is already bound in the context. Naming contexts - * that are bound using rebind do not participate in name resolution - * when compound names are passed to be resolved. - * - * @param n Name of the object. - * - * @param obj The Object to rebind with the given name. - * - * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding. - * - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has - * given up for some reason. The client, however, may be able to - * continue the operation at the returned naming context. - * - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. - */ - void rebind(in Name n, - in Object obj) - raises(NotFound, - CannotProceed, - InvalidName); - -/** - * Creates a binding of a name and a naming context in the naming - * context even if the name is already bound in the context. Naming - * contexts that are bound using rebind_context() participate in name - * resolution when compound names are passed to be resolved. - * - * @param n Name of the object. - * - * @param nc NamingContect object to rebind with the given name. - * - * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding. - * - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has - * given up for some reason. The client, however, may be able to - * continue the operation at the returned naming context. - * - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. - */ - void rebind_context(in Name n, - in NamingContext nc) - raises(NotFound, - CannotProceed, - InvalidName); - -/** - * The resolve operation is the process of retrieving an object - * bound to a name in a given context. The given name must exactly - * match the bound name. The naming service does not return the type - * of the object. Clients are responsible for "narrowing" the object - * to the appropriate type. That is, clients typically cast the returned - * object from Object to a more specialized interface. - * - * @param n Name of the object. - * - * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding. - * - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has - * given up for some reason. The client, however, may be able to - * continue the operation at the returned naming context. - * - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. - */ - Object resolve(in Name n) - raises(NotFound, - CannotProceed, - InvalidName); - -/** - * The unbind operation removes a name binding from a context. - * - * @param n Name of the object. - * - * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding. - * - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has - * given up for some reason. The client, however, may be able to - * continue the operation at the returned naming context. - * - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. - */ - void unbind(in Name n) - raises(NotFound, - CannotProceed, - InvalidName); - -/** - * The list operation allows a client to iterate through a set of - * bindings in a naming context.

            - * - * The list operation returns at most the requested number of - * bindings in BindingList bl. - *

              - *
            • If the naming context contains additional - * bindings, the list operation returns a BindingIterator with the - * additional bindings. - *
            • If the naming context does not contain additional - * bindings, the binding iterator is a nil object reference. - *
            - * - * @param how_many the maximum number of bindings to return. - * - * @param bl the returned list of bindings. - * - * @param bi the returned binding iterator. - */ - void list(in unsigned long how_many, - out BindingList bl, - out BindingIterator bi); - -/** - * This operation returns a naming context implemented by the same - * naming server as the context on which the operation was invoked. - * The new context is not bound to any name. - */ - NamingContext new_context(); - -/** - * This operation creates a new context and binds it to the name - * supplied as an argument. The newly-created context is implemented - * by the same naming server as the context in which it was bound (that - * is, the naming server that implements the context denoted by the - * name argument excluding the last component). - * - * @param n Name of the object. - * - * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding. - * - * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound Indicates an object is already - * bound to the specified name. - * - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has - * given up for some reason. The client, however, may be able to - * continue the operation at the returned naming context. - * - * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. - */ - NamingContext bind_new_context(in Name n) - raises(NotFound, - AlreadyBound, - CannotProceed, - InvalidName); - -/** - * The destroy operation deletes a naming context. If the naming - * context contains bindings, the NotEmpty exception is raised. - * - * @exception org.omg.CosNaming.NamingContextPackage.NotEmpty Indicates that the Naming Context contains bindings. - */ - void destroy() - raises(NotEmpty); - - }; - - -/** - * NamingContextExt is the extension of NamingContext - * which - * contains a set of name bindings in which each name is unique and is - * part of Interoperable Naming Service. - * Different names can be bound to an object in the same or different - * contexts at the same time. Using NamingContextExt, you can use - * URL-based names to bind and resolve. - * - * See - * CORBA COS - * Naming Specification. - */ - interface NamingContextExt: NamingContext - { -/** - * StringName is the Stringified Name, Array of Name Components - * represented as a String. - */ - typedef string StringName; - -/** - * Address is the Host and Port information represented as a String. - */ - typedef string Address; - -/** - * URLString is the URL address (corbaloc: or corbaname:) represented as - * a String. - */ - typedef string URLString; - -/** - * This operation creates a stringified name from the array of Name - * components. - * - * @param n Name of the object. - * - * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName - * Indicates the name does not identify a binding. - * - */ - StringName to_string( in Name n ) raises (InvalidName); - -/** - * This operation converts a Stringified Name into an equivalent array - * of Name Components. - * - * @param sn Stringified Name of the object. - * - * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName - * Indicates the name does not identify a binding. - * - */ - Name to_name( in StringName sn ) raises (InvalidName); - - -/** - * Indicates the invalid Stringified name for the object, The - * reason could be invalid syntax. - */ - exception InvalidAddress - { }; - -/** - * This operation creates a URL based "iiopname://" format name - * from the Stringified Name of the object. - * - * @param addr internet based address of the host machine where Name Service is running. - * @param sn Stringified Name of the object. - * - * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName - * Indicates the name does not identify a binding. - * @exception org.omg.CosNaming.NamingContextPackage.InvalidAddress - * Indicates the internet based address of the host machine is incorrect - */ - URLString to_url( in Address addr, in StringName sn ) - raises( InvalidAddress, InvalidName ); - - -/** - * This operation resolves the Stringified name into the object - * reference. - * - * @param sn Stringified Name of the object. - * - * @exception org.omg.CosNaming.NamingContextPackage.NotFound - * Indicates there is no object reference for the given name. - * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed - * Indicates that the given compound name is incorrect. - * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName - * Indicates the name does not identify a binding. - * - */ - Object resolve_str( in StringName sn) - raises( NotFound, CannotProceed, - InvalidName); - - }; - -}; diff --git a/src/java.corba/share/classes/org/omg/CosNaming/package.html b/src/java.corba/share/classes/org/omg/CosNaming/package.html deleted file mode 100644 index 265485464f1..00000000000 --- a/src/java.corba/share/classes/org/omg/CosNaming/package.html +++ /dev/null @@ -1,351 +0,0 @@ - - - - - - - - Provides a naming service for Java IDL. The Object Request Broker Daemon - (ORBD) also includes both a transient and persistent naming service. - - -

            - The package and all its classes and interfaces - were generated by running the tool idlj on the file - nameservice.idl, which is a module written in OMG IDL. - -

            Package Specification

            - -

            For a precise list of supported sections of official specifications with which -the Java[tm] Platform, Standard Edition 6, ORB complies, see Official Specifications for CORBA -support in Java[tm] SE 6. - -

            Interfaces

            - The package org.omg.CosNaming contains two public interfaces - and several auxiliary classes. -

            - The interfaces are: -

              -
            • NamingContext -
            • BindingIterator -
            -

            - These two interfaces provide the means to bind/unbind names and object - references, to retrieve bound object references, and - to iterate through a list of bindings. The NamingContext - interface supplies the main functionality for the naming service, and - BindingIterator provides a means of iterating through a list - of name/object reference bindings. - -

            Auxiliary Classes

            - In order to map an OMG IDL interface to the Java programming language, - the idlj compiler creates Java classes that can be thought of - as auxiliary classes. - Comments for the generated auxiliary classes - used by the interfaces NamingContext and - BindingIterator are included here. - -

            Classes Used by NamingContext and - BindingIterator

            - The following are classes used by - the naming service. (Helper and holder classes, which are - generated for each of the classes listed here, are discussed below.) - -
              -
            • public final class NameComponent -- - a building block for names. (Names are bound to object references - in a naming context.) -

              A name is an array of one or more NameComponent objects. - A name with a single NameComponent is called - a simple name; a name with multiple NameComponent - objects is called a compound name. -

              - A NameComponent object consists of two fields: -

                -
              1. id -- a String used as an identifier -
              2. kind -- a String that can be used for any - descriptive purpose. Its importance is that it - can be used to describe an object without affecting syntax. - The C programming language, for example, uses the the syntactic convention - of appending the extension ".c" to a file name to indicate that it is - a source code file. In a NameComponent object, - the kind field can be used to describe the type of object - rather than a file extension or some other syntactic convention. - Examples of the value of the kind field include the strings - "c_source", "object_code", - "executable", - "postscript", and "". It is not unusual - for the kind field to be the empty string. -
              -

              - In a name, each NameComponent object except the last denotes - a NamingContext object; the last NameComponent - object denotes the bound object reference. - This is similar to a path name, in which the last name is the - file name, and all names before it are directory names. - -

            • public final class Binding -- - an object that associates a name with an object reference or a - naming context. - A Binding object has two fields: -
                -
              1. binding_name - an array of one or more - NameComponent objects that represents the bound name -
              2. binding_type - a BindingType object - indicating whether the binding is between a name and an object - reference or between a name and a naming context -
              -

              - The interface NamingContext has methods for - binding/unbinding names with object references or naming contexts, - for listing bindings, - and for resolving bindings (given a name, the method - resolve returns the object reference bound to it). - -

            • public final class BindingType -- - an object that specifies whether the given Binding - object is a binding between a name and an object reference (that is, - not a naming context) or between a name and a naming context. -

              - The classBindingType consists of two methods and - four constants. Two of these constants are - BindingType objects, and two are ints. -

              - The BindingType objects - can be passed to the constructor for the class - Binding or used as parameters or return values. These - BindingType objects are: -

                -
              • public static final BindingType nobject -- - to indicate that the binding is with an object reference -
              • public static final BindingType ncontext -- - to indicate that the binding is with a naming context -
              -

              - The int constants can be supplied to the method - from_int to create BindingType objects, - or they can be return values for the method value. - These constants are: -

                -
              • public static final int _nobject -
              • public static final int _ncontext -
              - If the method from_int is supplied with anything other - than _nobject - or _ncontext, it will throw - the exception org.omg.CORBA.BAD_PARAM. -

              Usage is as follows: -

              -       BindingType btObject = from_int(_nobject);
              -       BindingType btContext = from_int(_ncontext);
              -    
              - The variable btObject refers to a BindingType - object initialized to represent a binding with an object reference. - The variable btContext refers to a BindingType - object initialized to represent a binding with a - NamingContex object. -

              - The method value returns either - _nobject or _ncontext, so - in the following line of code, the variable bt - will contain _nobject or _ncontext: -

              -       int bt = BindingType.value();
              -    
              -
            - -

            Holder Classes

            - - OMG IDL uses OUT and INOUT parameters for returning values from operations. - The mapping to the Java programming language, which does not have OUT - and INOUT parameters, creates a special class for each type, called - a holder class. - An instance of a holder class can be passed to a - Java method as a parameter, and - a value can be assigned to its value field. This allows - it to perform the function of an OUT or INOUT parameter. -

            The following holder classes are generated for the package - org.omg.CosNaming: -

              -
            • NamingContextHolder -
            • BindingIteratorHolder -
            • BindingHolder -
            • BindingListHolder -
            • BindingTypeHolder -
            • NameComponentHolder -
            • NameHolder -
            -

            - Note that in the org.omg.CORBA package, - there is a holder class for each of the basic Java types: - IntHolder, ShortHolder, - StringHolder, and so on. -

            - Note also that there is a NameHolder class even though - there is no Name class; similarly, there is a - BindingListHolder class even though there is no - BindingList class. This is true because in the OMG IDL - interface, Name and BindingList are - typedefs. There is no mapping from an IDL - typedef to a Java construct, but holder classes - are generated if the typedef is for a sequence or - an array. As mapped to the - Java programming language, Name is an array of - NameComponent objects, and a BindingList - is an array of Binding objects. - - All holder classes have at least two constructors and one field: -

              -
            • value field -- an instance of the type being used as - an OUT or INOUT parameter. For example, the value field of a - NamingContextHolder will be a NamingContext - object. -
            • default constructor -- a constructor that creates a new holder object - initialized with the default value for the type. For example, a new - BindingHolder object created with the default constructor - will have its value field set to null because - that is the default value for an object. Other defaults are - false for boolean, - 0 for numeric and char types, and - null for object references. -
            • constructor from an instance -- a constructor that creates a new - holder object whose value field is - initialized with the instance supplied -
            -

            - A holder class for a user-defined type (a Java class) has three more - methods, but application developers do not use them directly. - -

            Helper Classes

            - Helper classes, which are generated for all user-defined types - in an OMG IDL interface, supply static methods needed to manipulate - those types. -

            - There is only one method in a helper class that an - application programmer uses: the - method narrow. Only Java interfaces mapped from IDL - interfaces will have a helper class that includes a narrow - method, so in the CosNaming package, only the classes - NamingContextHelper and BindingIteratorHelper - have a narrow method. -

              -
            • public static NamingContext - narrow(org.omg.CORBA.Object obj) -- converts the given - CORBA object to a NamingContext object -
            • public static BindingIterator - narrow(org.omg.CORBA.Object obj) -- converts the given - CORBA object to a BindingIterator object -
            -

            Package org.omg.CosNaming.NamingContextPackage

            -This package supplies Helper and Holder classes for the exceptions used -in the package org.omg.CosNaming and also for the class -NotFoundReason, which supplies a reason for the exception -NotFound. -

            -There are Helper and Holder classes for the following exceptions: -

              -
            • AlreadyBound -
            • CannotProceed -
            • InvalidName -
            • NotEmpty -
            • NotFound -
            - -

            Naming Service Compatibility

            - -Sun's implementation of the CosNaming package complies -with the OMG COSNaming specification. In other words, -the APIs in Sun's naming service are implemented according to the -guidelines for a naming service provided by OMG. Therefore, if a -third-party vendor has implemented a naming service that is OMG -compliant, it is possible to switch between Sun's implementation of -CosNaming and the third-party vendor's implementation. -However, it is important to understand that there can be minor -variations in the way different vendors implement the naming service, -such as differences in the exception strings. - -

            Instructions for Using a Third Party's Naming Service

            -Although we encourage using an ORB and ORB services that are both -from one vendor, it is possible to plug in a third party's -COSNaming implementation with Sun's RMI-IIOP ORB. -Here are the steps to follow: -
              -
            1. Create a properties file for the Bootstrap server and give it - two entries. For example, you could call this properties file - /tmp/services and put the following in it: - NameService, <Stringified IOR of the Root Naming Context>. -

              - This associates NameService with the Root Naming - Context of the CosNaming implementation that you - want to use. -

            2. Start the standalone Bootstrap server using the following command: -
              -      
              -      java -classpath $(CLASSPATH)
              -      com.sun.corba.ee.internal.CosNaming.BootstrapServer -InitialServicesFile
              -      "/tmp/services" [-ORBInitialPort port]
              -      
              -  
              -

              - Note that the square brackets at the end of the command indicate that - specifying a port number is optional. -

            -

            -Now when an application calls the method -org.omg.CORBA.ORB.resolve_initial_references, CORBA -processes will contact the Bootstrap Server to get the Root Naming -Context. - -

            Package Specification

            - - - -

            Related Documentation

            - -For an overview and examples of how to use the -CosNaming API, please see: -
              -
            • {@extLink tnameserv NamingService} -
            -

            -For an overview of Java IDL, please see: -

              -
            • {@extLink idl_guides Java IDL developer's home page} -
            - -@since JDK1.3 - - - - - - diff --git a/src/java.corba/share/classes/org/omg/Dynamic/package.html b/src/java.corba/share/classes/org/omg/Dynamic/package.html deleted file mode 100644 index 345b0a39286..00000000000 --- a/src/java.corba/share/classes/org/omg/Dynamic/package.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - -

            This package contains the Dynamic module specified in the OMG Portable -Interceptor specification, - -ptc/2000-08-06, section 21.9. Please -refer to that OMG specification for further details. - - - -

            Package Specification

            - -

            For a precise list of supported sections of official specifications with which -the Java[tm] Platform, Standard Edition 6 ORB complies, see Official Specifications for CORBA -support in Java[tm] SE 6. - -@since 1.4 -
            -@serial exclude - - diff --git a/src/java.corba/share/classes/org/omg/DynamicAny/DynAnyFactoryPackage/package.html b/src/java.corba/share/classes/org/omg/DynamicAny/DynAnyFactoryPackage/package.html deleted file mode 100644 index 50669f1e0f9..00000000000 --- a/src/java.corba/share/classes/org/omg/DynamicAny/DynAnyFactoryPackage/package.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - -

            - -This package contains classes and exceptions from the DynAnyFactory -interface of the -DynamicAny module -specified in the OMG The Common Object Request Broker: Architecture and -Specification, - -formal/99-10-07, section 9.2.2. Please -refer to that OMG specification for further details. - -

            Package Specification

            - -

            For a precise list of supported sections of official specifications with which -the Java[tm] Platform, Standard Edition 6 ORB complies, see Official Specifications for CORBA -support in Java SE 6. - -@since 1.4 -
            -@serial exclude - - diff --git a/src/java.corba/share/classes/org/omg/DynamicAny/DynAnyPackage/package.html b/src/java.corba/share/classes/org/omg/DynamicAny/DynAnyPackage/package.html deleted file mode 100644 index a00125defdc..00000000000 --- a/src/java.corba/share/classes/org/omg/DynamicAny/DynAnyPackage/package.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - -

            This package contains classes and exceptions from the DynAny - interface of the DynamicAny module -specified in the OMG The Common Object Request Broker: Architecture and -Specification, - -formal/99-10-07, section 9.2. Please -refer to that OMG specification for further details. - - - -

            Package Specification

            - -

            For a precise list of supported sections of official specifications with which -the Java[tm] Platform, Standard Edition 6 ORB complies, see Official Specifications for CORBA -support in Java[tm] SE 6. - -@since 1.4 -
            -@serial exclude - - diff --git a/src/java.corba/share/classes/org/omg/DynamicAny/DynamicAny.idl b/src/java.corba/share/classes/org/omg/DynamicAny/DynamicAny.idl deleted file mode 100644 index 63e451dfe9f..00000000000 --- a/src/java.corba/share/classes/org/omg/DynamicAny/DynamicAny.idl +++ /dev/null @@ -1,1280 +0,0 @@ -/* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -// IDL -// File: DynamicAny.idl - -#ifndef _DYNAMIC_ANY_IDL_ -#define _DYNAMIC_ANY_IDL_ - -#pragma prefix "omg.org" -#include - -/** -* An any can be passed to a program that doesn't have any static information for the -type of the any (code generated for the type by an IDL compiler has not been -compiled with the object implementation). As a result, the object receiving the any -does not have a portable method of using it. -

            DynAnys enable traversal of the data value associated with an any at -runtime and extraction of the primitive constituents of the data value. This is especially -helpful for writing powerful generic servers (bridges, event channels supporting -filtering). -

            Similarly, this facility enables the construction of an any at runtime, without having -static knowledge of its type. This is especially helpful for writing generic clients -(bridges, browsers, debuggers, user interface tools). -*/ -module DynamicAny { - /** - * Any values can be dynamically interpreted (traversed) and constructed through DynAny objects. - * A DynAny object is associated with a data value which corresponds to a copy of the value - * inserted into an any. - *

            A DynAny object may be viewed as an ordered collection of component DynAnys. - * For DynAnys representing a basic type, such as long, or a type without components, - * such as an empty exception, the ordered collection of components is empty. - * Each DynAny object maintains the notion of a current position into its collection - * of component DynAnys. The current position is identified by an index value that runs - * from 0 to n-1, where n is the number of components. - * The special index value -1 indicates a current position that points nowhere. - * For values that cannot have a current position (such as an empty exception), - * the index value is fixed at -1. - * If a DynAny is initialized with a value that has components, the index is initialized to 0. - * After creation of an uninitialized DynAny (that is, a DynAny that has no value but a TypeCode - * that permits components), the current position depends on the type of value represented by - * the DynAny. (The current position is set to 0 or -1, depending on whether the new DynAny - * gets default values for its components.) - *

            The iteration operations rewind, seek, and next can be used to change the current position - * and the current_component operation returns the component at the current position. - * The component_count operation returns the number of components of a DynAny. - * Collectively, these operations enable iteration over the components of a DynAny, for example, - * to (recursively) examine its contents. - *

            A constructed DynAny object is a DynAny object associated with a constructed type. - * There is a different interface, inheriting from the DynAny interface, associated with - * each kind of constructed type in IDL (fixed, enum, struct, sequence, union, array, - * exception, and value type). - *

            A constructed DynAny object exports operations that enable the creation of new DynAny objects, - * each of them associated with a component of the constructed data value. - * As an example, a DynStruct is associated with a struct value. This means that the DynStruct - * may be seen as owning an ordered collection of components, one for each structure member. - * The DynStruct object exports operations that enable the creation of new DynAny objects, - * each of them associated with a member of the struct. - *

            If a DynAny object has been obtained from another (constructed) DynAny object, - * such as a DynAny representing a structure member that was created from a DynStruct, - * the member DynAny is logically contained in the DynStruct. - * Calling an insert or get operation leaves the current position unchanged. - * Destroying a top-level DynAny object (one that was not obtained as a component of another DynAny) - * also destroys any component DynAny objects obtained from it. - * Destroying a non-top level DynAny object does nothing. - * Invoking operations on a destroyed top-level DynAny or any of its descendants raises OBJECT_NOT_EXIST. - * If the programmer wants to destroy a DynAny object but still wants to manipulate some component - * of the data value associated with it, then he or she should first create a DynAny for the component - * and, after that, make a copy of the created DynAny object. - *

            The behavior of DynAny objects has been defined in order to enable efficient implementations - * in terms of allocated memory space and speed of access. DynAny objects are intended to be used - * for traversing values extracted from anys or constructing values of anys at runtime. - * Their use for other purposes is not recommended. - *

            Insert and get operations are necessary to handle basic DynAny objects - * but are also helpful to handle constructed DynAny objects. - * Inserting a basic data type value into a constructed DynAny object - * implies initializing the current component of the constructed data value - * associated with the DynAny object. For example, invoking insert_boolean on a - * DynStruct implies inserting a boolean data value at the current position - * of the associated struct data value. - * A type is consistent for inserting or extracting a value if its TypeCode is equivalent to - * the TypeCode contained in the DynAny or, if the DynAny has components, is equivalent to the TypeCode - * of the DynAny at the current position. - *

            DynAny and DynAnyFactory objects are intended to be local to the process in which they are - * created and used. This means that references to DynAny and DynAnyFactory objects cannot be exported - * to other processes, or externalized with ORB.object_to_string(). - * If any attempt is made to do so, the offending operation will raise a MARSHAL system exception. - * Since their interfaces are specified in IDL, DynAny objects export operations defined in the standard - * org.omg.CORBA.Object interface. However, any attempt to invoke operations exported through the Object - * interface may raise the standard NO_IMPLEMENT exception. - * An attempt to use a DynAny object with the DII may raise the NO_IMPLEMENT exception. - */ - interface DynAny { - #pragma sun_localservant DynAny "" - exception InvalidValue {}; - exception TypeMismatch {}; - - /** - * Returns the TypeCode associated with this DynAny object. - * A DynAny object is created with a TypeCode value assigned to it. - * This TypeCode value determines the type of the value handled through the DynAny object. - * Note that the TypeCode associated with a DynAny object is initialized at the time the - * DynAny is created and cannot be changed during lifetime of the DynAny object. - * - * @return The TypeCode associated with this DynAny object - */ - CORBA::TypeCode type(); - - /** - * Initializes the value associated with a DynAny object with the value - * associated with another DynAny object. - * The current position of the target DynAny is set to zero for values that have components - * and to -1 for values that do not have components. - * - * @param dyn_any - * @exception TypeMismatch if the type of the passed DynAny is not equivalent to the type of target DynAny - */ - void assign(in DynAny dyn_any) - raises(TypeMismatch); - - /** - * Initializes the value associated with a DynAny object with the value contained in an any. - * The current position of the target DynAny is set to zero for values that have components - * and to -1 for values that do not have components. - * - * @exception TypeMismatch if the type of the passed Any is not equivalent to the type of target DynAny - * @exception InvalidValue if the passed Any does not contain a legal value (such as a null string) - */ - void from_any(in any value) - raises(TypeMismatch, InvalidValue); - - /** - * Creates an any value from a DynAny object. - * A copy of the TypeCode associated with the DynAny object is assigned to the resulting any. - * The value associated with the DynAny object is copied into the any. - * - * @return a new Any object with the same value and TypeCode - */ - any to_any(); - - /** - * Compares two DynAny values for equality. - * Two DynAny values are equal if their TypeCodes are equivalent and, recursively, all component DynAnys - * have equal values. - * The current position of the two DynAnys being compared has no effect on the result of equal. - * - * @return true of the DynAnys are equal, false otherwise - */ - boolean equal(in DynAny dyn_any); - - /** - * Destroys a DynAny object. - * This operation frees any resources used to represent the data value associated with a DynAny object. - * It must be invoked on references obtained from one of the creation operations on the ORB interface - * or on a reference returned by DynAny.copy() to avoid resource leaks. - * Invoking destroy on component DynAny objects (for example, on objects returned by the - * current_component operation) does nothing. - * Destruction of a DynAny object implies destruction of all DynAny objects obtained from it. - * That is, references to components of a destroyed DynAny become invalid. - * Invocations on such references raise OBJECT_NOT_EXIST. - * It is possible to manipulate a component of a DynAny beyond the life time of the DynAny - * from which the component was obtained by making a copy of the component with the copy operation - * before destroying the DynAny from which the component was obtained. - */ - void destroy(); - - /** - * Creates a new DynAny object whose value is a deep copy of the DynAny on which it is invoked. - * The operation is polymorphic, that is, invoking it on one of the types derived from DynAny, - * such as DynStruct, creates the derived type but returns its reference as the DynAny base type. - * - * @return a deep copy of the DynAny object - */ - DynAny copy(); - - /** - * Inserts a boolean value into the DynAny. - * - * @exception InvalidValue if this DynAny has components but has a current position of -1 - * @exception TypeMismatch if called on a DynAny whose current component itself has components - */ - void insert_boolean(in boolean value) - raises(TypeMismatch, InvalidValue); - - /** - * Inserts a byte value into the DynAny. The IDL octet data type is mapped to the Java byte data type. - * - * @exception InvalidValue if this DynAny has components but has a current position of -1 - * @exception TypeMismatch if called on a DynAny whose current component itself has components - */ - void insert_octet(in octet value) - raises(TypeMismatch, InvalidValue); - - /** - * Inserts a char value into the DynAny. - * - * @exception InvalidValue if this DynAny has components but has a current position of -1 - * @exception TypeMismatch if called on a DynAny whose current component itself has components - */ - void insert_char(in char value) - raises(TypeMismatch, InvalidValue); - - /** - * Inserts a short value into the DynAny. - * - * @exception InvalidValue if this DynAny has components but has a current position of -1 - * @exception TypeMismatch if called on a DynAny whose current component itself has components - */ - void insert_short(in short value) - raises(TypeMismatch, InvalidValue); - - /** - * Inserts a short value into the DynAny. The IDL ushort data type is mapped to the Java short data type. - * - * @exception InvalidValue if this DynAny has components but has a current position of -1 - * @exception TypeMismatch if called on a DynAny whose current component itself has components - */ - void insert_ushort(in unsigned short value) - raises(TypeMismatch, InvalidValue); - - /** - * Inserts an integer value into the DynAny. The IDL long data type is mapped to the Java int data type. - * - * @exception InvalidValue if this DynAny has components but has a current position of -1 - * @exception TypeMismatch if called on a DynAny whose current component itself has components - */ - void insert_long(in long value) - raises(TypeMismatch, InvalidValue); - - /** - * Inserts an integer value into the DynAny. The IDL ulong data type is mapped to the Java int data type. - * - * @exception InvalidValue if this DynAny has components but has a current position of -1 - * @exception TypeMismatch if called on a DynAny whose current component itself has components - */ - void insert_ulong(in unsigned long value) - raises(TypeMismatch, InvalidValue); - - /** - * Inserts a float value into the DynAny. - * - * @exception InvalidValue if this DynAny has components but has a current position of -1 - * @exception TypeMismatch if called on a DynAny whose current component itself has components - */ - void insert_float(in float value) - raises(TypeMismatch, InvalidValue); - - /** - * Inserts a double value into the DynAny. - * - * @exception InvalidValue if this DynAny has components but has a current position of -1 - * @exception TypeMismatch if called on a DynAny whose current component itself has components - */ - void insert_double(in double value) - raises(TypeMismatch, InvalidValue); - - /** - * Inserts a string value into the DynAny. - * Both bounded and unbounded strings are inserted using this method. - * - * @exception InvalidValue if this DynAny has components but has a current position of -1 - * @exception InvalidValue if the string inserted is longer than the bound of a bounded string - * @exception TypeMismatch if called on a DynAny whose current component itself has components - */ - void insert_string(in string value) - raises(TypeMismatch, InvalidValue); - - /** - * Inserts a reference to a CORBA object into the DynAny. - * - * @exception InvalidValue if this DynAny has components but has a current position of -1 - * @exception TypeMismatch if called on a DynAny whose current component itself has components - */ - void insert_reference(in Object value) - raises(TypeMismatch, InvalidValue); - - /** - * Inserts a TypeCode object into the DynAny. - * - * @exception InvalidValue if this DynAny has components but has a current position of -1 - * @exception TypeMismatch if called on a DynAny whose current component itself has components - */ - void insert_typecode(in CORBA::TypeCode value) - raises(TypeMismatch, InvalidValue); - - /** - * Inserts a long value into the DynAny. The IDL long long data type is mapped to the Java long data type. - * - * @exception InvalidValue if this DynAny has components but has a current position of -1 - * @exception TypeMismatch if called on a DynAny whose current component itself has components - */ - void insert_longlong(in long long value) - raises(TypeMismatch, InvalidValue); - - /** - * Inserts a long value into the DynAny. - * The IDL unsigned long long data type is mapped to the Java long data type. - * - * @exception InvalidValue if this DynAny has components but has a current position of -1 - * @exception TypeMismatch if called on a DynAny whose current component itself has components - */ - void insert_ulonglong(in unsigned long long value) - raises(TypeMismatch, InvalidValue); - -// void insert_longdouble(in long double value) -// raises(TypeMismatch, InvalidValue); - - /** - * Inserts a char value into the DynAny. The IDL wchar data type is mapped to the Java char data type. - * - * @exception InvalidValue if this DynAny has components but has a current position of -1 - * @exception TypeMismatch if called on a DynAny whose current component itself has components - */ - void insert_wchar(in wchar value) - raises(TypeMismatch, InvalidValue); - - /** - * Inserts a string value into the DynAny. - * Both bounded and unbounded strings are inserted using this method. - * - * @exception InvalidValue if this DynAny has components but has a current position of -1 - * @exception InvalidValue if the string inserted is longer than the bound of a bounded string - */ - void insert_wstring(in wstring value) - raises(TypeMismatch, InvalidValue); - - /** - * Inserts an Any value into the Any represented by this DynAny. - * - * @exception InvalidValue if this DynAny has components but has a current position of -1 - * @exception TypeMismatch if called on a DynAny whose current component itself has components - */ - void insert_any(in any value) - raises(TypeMismatch, InvalidValue); - - /** - * Inserts the Any value contained in the parameter DynAny into the Any represented by this DynAny. - * - * @exception InvalidValue if this DynAny has components but has a current position of -1 - * @exception TypeMismatch if called on a DynAny whose current component itself has components - */ - void insert_dyn_any(in DynAny value) - raises(TypeMismatch, InvalidValue); - - /** - * Inserts a reference to a Serializable object into this DynAny. - * The IDL ValueBase type is mapped to the Java Serializable type. - * - * @exception InvalidValue if this DynAny has components but has a current position of -1 - * @exception TypeMismatch if called on a DynAny whose current component itself has components - */ - void insert_val(in ValueBase value) - raises(TypeMismatch, InvalidValue); - - /** - * Extracts the boolean value from this DynAny. - * - * @exception TypeMismatch if the accessed component in the DynAny is of a type - * that is not equivalent to the requested type. - * @exception TypeMismatch if called on a DynAny whose current component itself has components - * @exception InvalidValue if this DynAny has components but has a current position of -1 - */ - boolean get_boolean() - raises(TypeMismatch, InvalidValue); - - /** - * Extracts the byte value from this DynAny. The IDL octet data type is mapped to the Java byte data type. - * - * @exception TypeMismatch if the accessed component in the DynAny is of a type - * that is not equivalent to the requested type. - * @exception TypeMismatch if called on a DynAny whose current component itself has components - * @exception InvalidValue if this DynAny has components but has a current position of -1 - */ - octet get_octet() - raises(TypeMismatch, InvalidValue); - - /** - * Extracts the char value from this DynAny. - * - * @exception TypeMismatch if the accessed component in the DynAny is of a type - * that is not equivalent to the requested type. - * @exception TypeMismatch if called on a DynAny whose current component itself has components - * @exception InvalidValue if this DynAny has components but has a current position of -1 - */ - char get_char() - raises(TypeMismatch, InvalidValue); - - /** - * Extracts the short value from this DynAny. - * - * @exception TypeMismatch if the accessed component in the DynAny is of a type - * that is not equivalent to the requested type. - * @exception TypeMismatch if called on a DynAny whose current component itself has components - * @exception InvalidValue if this DynAny has components but has a current position of -1 - */ - short get_short() - raises(TypeMismatch, InvalidValue); - - /** - * Extracts the short value from this DynAny. The IDL ushort data type is mapped to the Java short data type. - * - * @exception TypeMismatch if the accessed component in the DynAny is of a type - * that is not equivalent to the requested type. - * @exception TypeMismatch if called on a DynAny whose current component itself has components - * @exception InvalidValue if this DynAny has components but has a current position of -1 - */ - unsigned short get_ushort() - raises(TypeMismatch, InvalidValue); - - /** - * Extracts the integer value from this DynAny. The IDL long data type is mapped to the Java int data type. - * - * @exception TypeMismatch if the accessed component in the DynAny is of a type - * that is not equivalent to the requested type. - * @exception TypeMismatch if called on a DynAny whose current component itself has components - * @exception InvalidValue if this DynAny has components but has a current position of -1 - */ - long get_long() - raises(TypeMismatch, InvalidValue); - - /** - * Extracts the integer value from this DynAny. The IDL ulong data type is mapped to the Java int data type. - * - * @exception TypeMismatch if the accessed component in the DynAny is of a type - * that is not equivalent to the requested type. - * @exception TypeMismatch if called on a DynAny whose current component itself has components - * @exception InvalidValue if this DynAny has components but has a current position of -1 - */ - unsigned long get_ulong() - raises(TypeMismatch, InvalidValue); - - /** - * Extracts the float value from this DynAny. - * - * @exception TypeMismatch if the accessed component in the DynAny is of a type - * that is not equivalent to the requested type. - * @exception TypeMismatch if called on a DynAny whose current component itself has components - * @exception InvalidValue if this DynAny has components but has a current position of -1 - */ - float get_float() - raises(TypeMismatch, InvalidValue); - - /** - * Extracts the double value from this DynAny. - * - * @exception TypeMismatch if the accessed component in the DynAny is of a type - * that is not equivalent to the requested type. - * @exception TypeMismatch if called on a DynAny whose current component itself has components - * @exception InvalidValue if this DynAny has components but has a current position of -1 - */ - double get_double() - raises(TypeMismatch, InvalidValue); - - /** - * Extracts the string value from this DynAny. - * Both bounded and unbounded strings are extracted using this method. - * - * @exception TypeMismatch if the accessed component in the DynAny is of a type - * that is not equivalent to the requested type. - * @exception TypeMismatch if called on a DynAny whose current component itself has components - * @exception InvalidValue if this DynAny has components but has a current position of -1 - */ - string get_string() - raises(TypeMismatch, InvalidValue); - - /** - * Extracts the reference to a CORBA Object from this DynAny. - * - * @exception TypeMismatch if the accessed component in the DynAny is of a type - * that is not equivalent to the requested type. - * @exception TypeMismatch if called on a DynAny whose current component itself has components - * @exception InvalidValue if this DynAny has components but has a current position of -1 - */ - Object get_reference() - raises(TypeMismatch, InvalidValue); - - /** - * Extracts the TypeCode object from this DynAny. - * - * @exception TypeMismatch if the accessed component in the DynAny is of a type - * that is not equivalent to the requested type. - * @exception TypeMismatch if called on a DynAny whose current component itself has components - * @exception InvalidValue if this DynAny has components but has a current position of -1 - */ - CORBA::TypeCode get_typecode() - raises(TypeMismatch, InvalidValue); - - /** - * Extracts the long value from this DynAny. The IDL long long data type is mapped to the Java long data type. - * - * @exception TypeMismatch if the accessed component in the DynAny is of a type - * that is not equivalent to the requested type. - * @exception TypeMismatch if called on a DynAny whose current component itself has components - * @exception InvalidValue if this DynAny has components but has a current position of -1 - */ - long long get_longlong() - raises(TypeMismatch, InvalidValue); - - /** - * Extracts the long value from this DynAny. - * The IDL unsigned long long data type is mapped to the Java long data type. - * - * @exception TypeMismatch if the accessed component in the DynAny is of a type - * that is not equivalent to the requested type. - * @exception TypeMismatch if called on a DynAny whose current component itself has components - * @exception InvalidValue if this DynAny has components but has a current position of -1 - */ - unsigned long long get_ulonglong() - raises(TypeMismatch, InvalidValue); -// long double get_longdouble() -// raises(TypeMismatch, InvalidValue); - - /** - * Extracts the long value from this DynAny. The IDL wchar data type is mapped to the Java char data type. - * - * @exception TypeMismatch if the accessed component in the DynAny is of a type - * that is not equivalent to the requested type. - * @exception TypeMismatch if called on a DynAny whose current component itself has components - * @exception InvalidValue if this DynAny has components but has a current position of -1 - */ - wchar get_wchar() - raises(TypeMismatch, InvalidValue); - - /** - * Extracts the string value from this DynAny. - * Both bounded and unbounded strings are extracted using this method. - * - * @exception TypeMismatch if the accessed component in the DynAny is of a type - * that is not equivalent to the requested type. - * @exception TypeMismatch if called on a DynAny whose current component itself has components - */ - wstring get_wstring() - raises(TypeMismatch, InvalidValue); - - /** - * Extracts an Any value contained in the Any represented by this DynAny. - * - * @exception TypeMismatch if the accessed component in the DynAny is of a type - * that is not equivalent to the requested type. - * @exception TypeMismatch if called on a DynAny whose current component itself has components - * @exception InvalidValue if this DynAny has components but has a current position of -1 - */ - any get_any() - raises(TypeMismatch, InvalidValue); - - /** - * Extracts the Any value contained in the Any represented by this DynAny and returns it wrapped - * into a new DynAny. - * - * @exception TypeMismatch if the accessed component in the DynAny is of a type - * that is not equivalent to the requested type. - * @exception TypeMismatch if called on a DynAny whose current component itself has components - * @exception InvalidValue if this DynAny has components but has a current position of -1 - */ - DynAny get_dyn_any() - raises(TypeMismatch, InvalidValue); - - /** - * Extracts a Serializable object from this DynAny. - * The IDL ValueBase type is mapped to the Java Serializable type. - * - * @exception TypeMismatch if the accessed component in the DynAny is of a type - * that is not equivalent to the requested type. - * @exception TypeMismatch if called on a DynAny whose current component itself has components - * @exception InvalidValue if this DynAny has components but has a current position of -1 - */ - ValueBase get_val() - raises(TypeMismatch, InvalidValue); - - /** - * Sets the current position to index. The current position is indexed 0 to n-1, that is, - * index zero corresponds to the first component. The operation returns true if the resulting - * current position indicates a component of the DynAny and false if index indicates - * a position that does not correspond to a component. - * Calling seek with a negative index is legal. It sets the current position to -1 to indicate - * no component and returns false. Passing a non-negative index value for a DynAny that does not - * have a component at the corresponding position sets the current position to -1 and returns false. - */ - boolean seek(in long index); - - /** - * Is equivalent to seek(0). - */ - void rewind(); - - /** - * Advances the current position to the next component. - * The operation returns true while the resulting current position indicates a component, false otherwise. - * A false return value leaves the current position at -1. - * Invoking next on a DynAny without components leaves the current position at -1 and returns false. - */ - boolean next(); - - /** - * Returns the number of components of a DynAny. - * For a DynAny without components, it returns zero. - * The operation only counts the components at the top level. - * For example, if component_count is invoked on a DynStruct with a single member, - * the return value is 1, irrespective of the type of the member. - *

              - *
            • For sequences, the operation returns the current number of elements. - *
            • For structures, exceptions, and value types, the operation returns the number of members. - *
            • For arrays, the operation returns the number of elements. - *
            • For unions, the operation returns 2 if the discriminator indicates that a named member is active, - * otherwise, it returns 1. - *
            • For DynFixed and DynEnum, the operation returns zero. - *
            - */ - unsigned long component_count(); - - /** - * Returns the DynAny for the component at the current position. - * It does not advance the current position, so repeated calls to current_component - * without an intervening call to rewind, next, or seek return the same component. - * The returned DynAny object reference can be used to get/set the value of the current component. - * If the current component represents a complex type, the returned reference can be narrowed - * based on the TypeCode to get the interface corresponding to the to the complex type. - * Calling current_component on a DynAny that cannot have components, - * such as a DynEnum or an empty exception, raises TypeMismatch. - * Calling current_component on a DynAny whose current position is -1 returns a nil reference. - * The iteration operations, together with current_component, can be used - * to dynamically compose an any value. After creating a dynamic any, such as a DynStruct, - * current_component and next can be used to initialize all the components of the value. - * Once the dynamic value is completely initialized, to_any creates the corresponding any value. - * - * @exception TypeMismatch If called on a DynAny that cannot have components, - * such as a DynEnum or an empty exception - */ - DynAny current_component() - raises(TypeMismatch); - }; - - /** - * DynFixed objects support the manipulation of IDL fixed values. - * Because IDL does not have a generic type that can represent fixed types with arbitrary - * number of digits and arbitrary scale, the operations use the IDL string type. - */ - interface DynFixed : DynAny { - #pragma sun_localservant DynFixed "" - - /** - * Returns the value of a DynFixed. - */ - string get_value(); - - /** - * Sets the value of the DynFixed. - * The val string must contain a fixed string constant in the same format as used for IDL fixed-point literals. - * However, the trailing d or D is optional. The return value is true if val can be represented as the DynFixed - * without loss of precision. If val has more fractional digits than can be represented in the DynFixed, - * fractional digits are truncated and the return value is false. - * - * @exception TypeMismatch If val does not contain a valid fixed-point literal or contains extraneous - * characters other than leading or trailing white space - * @exception InvalidValue If val contains a value whose scale exceeds that of the DynFixed - * or is not initialized - */ - boolean set_value(in string val) - raises(TypeMismatch, InvalidValue); - }; - - /** - * DynEnum objects support the manipulation of IDL enumerated values. - * The current position of a DynEnum is always -1. - */ - interface DynEnum : DynAny { - #pragma sun_localservant DynEnum "" - - /** - * Returns the value of the DynEnum as an IDL identifier. - */ - string get_as_string(); - - /** - * Sets the value of the DynEnum to the enumerated value whose IDL identifier is passed in the value parameter. - * - * @exception InvalidValue If value contains a string that is not a valid IDL identifier - * for the corresponding enumerated type - */ - void set_as_string(in string value) - raises(InvalidValue); - - /** - * Returns the value of the DynEnum as the enumerated value's ordinal value. - * Enumerators have ordinal values 0 to n-1, as they appear from left to right - * in the corresponding IDL definition. - */ - unsigned long get_as_ulong(); - - /** - * Sets the value of the DynEnum as the enumerated value's ordinal value. - * - * @exception InvalidValue If value contains a value that is outside the range of ordinal values - * for the corresponding enumerated type - */ - void set_as_ulong(in unsigned long value) - raises(InvalidValue); - }; - - typedef string FieldName; - - /** - * NameValuePairs associate a name with an Any object. - */ - struct NameValuePair { - /** - * The name associated with the Any. - */ - FieldName id; - /** - * The Any value associated with the name. - */ - any value; - }; - typedef sequence NameValuePairSeq; - - /** - * NameDynAnyPairs associate a name with an DynAny object. - */ - struct NameDynAnyPair { - /** - * The name associated with the DynAny. - */ - FieldName id; - /** - * The DynAny value associated with the name. - */ - DynAny value; - }; - typedef sequence NameDynAnyPairSeq; - - /** - * DynStruct objects support the manipulation of IDL struct and exception values. - * Members of the exceptions are handled in the same way as members of a struct. - */ - interface DynStruct : DynAny { - #pragma sun_localservant DynStruct "" - - /** - * Returns the name of the member at the current position. - * This operation may return an empty string since the TypeCode of the value being - * manipulated may not contain the names of members. - * - * @exception TypeMismatch if the DynStruct represents an empty exception. - * @exception InvalidValue if the current position does not indicate a member - */ - FieldName current_member_name() - raises(TypeMismatch, InvalidValue); - - /** - * Returns the TCKind associated with the member at the current position. - * - * @exception TypeMismatch if the DynStruct represents an empty exception. - * @exception InvalidValue if the current position does not indicate a member - */ - CORBA::TCKind current_member_kind() - raises(TypeMismatch, InvalidValue); - - /** - * Returns a sequence of NameValuePairs describing the name and the value of each member - * in the struct associated with a DynStruct object. - * The sequence contains members in the same order as the declaration order of members - * as indicated by the DynStruct's TypeCode. The current position is not affected. - * The member names in the returned sequence will be empty strings if the DynStruct's TypeCode - * does not contain member names. - */ - NameValuePairSeq get_members(); - - /** - * Initializes the struct data value associated with a DynStruct object from a sequence of NameValuePairs. - * The operation sets the current position to zero if the passed sequences has non-zero length. Otherwise, - * if an empty sequence is passed, the current position is set to -1. - *

            Members must appear in the NameValuePairs in the order in which they appear in the IDL specification - * of the struct as indicated by the DynStruct's TypeCode or they must be empty strings. - * The operation makes no attempt to assign member values based on member names. - * - * @exception TypeMismatch if the member names supplied in the passed sequence do not match the - * corresponding member name in the DynStruct's TypeCode and they are not empty strings - * @exception InvalidValue if the passed sequence has a number of elements that disagrees - * with the number of members as indicated by the DynStruct's TypeCode - */ - void set_members(in NameValuePairSeq value) - raises(TypeMismatch, InvalidValue); - - /** - * Returns a sequence of NameDynAnyPairs describing the name and the value of each member - * in the struct associated with a DynStruct object. - * The sequence contains members in the same order as the declaration order of members - * as indicated by the DynStruct's TypeCode. The current position is not affected. - * The member names in the returned sequence will be empty strings if the DynStruct's TypeCode - * does not contain member names. - */ - NameDynAnyPairSeq get_members_as_dyn_any(); - - /** - * Initializes the struct data value associated with a DynStruct object from a sequence of NameDynAnyPairs. - * The operation sets the current position to zero if the passed sequences has non-zero length. Otherwise, - * if an empty sequence is passed, the current position is set to -1. - *

            Members must appear in the NameDynAnyPairs in the order in which they appear in the IDL specification - * of the struct as indicated by the DynStruct's TypeCode or they must be empty strings. - * The operation makes no attempt to assign member values based on member names. - * - * @exception TypeMismatch if the member names supplied in the passed sequence do not match the - * corresponding member name in the DynStruct's TypeCode and they are not empty strings - * @exception InvalidValue if the passed sequence has a number of elements that disagrees - * with the number of members as indicated by the DynStruct's TypeCode - */ - void set_members_as_dyn_any(in NameDynAnyPairSeq value) - raises(TypeMismatch, InvalidValue); - }; - - /** - * DynUnion objects support the manipulation of IDL unions. - * A union can have only two valid current positions: - *

              - *
            • zero, which denotes the discriminator - *
            • one, which denotes the active member - *
            - * The component_count value for a union depends on the current discriminator: - * it is 2 for a union whose discriminator indicates a named member, and 1 otherwise. - */ - interface DynUnion : DynAny { - #pragma sun_localservant DynUnion "" - - /** - * Returns the current discriminator value. - */ - DynAny get_discriminator(); - - /** - * Sets the discriminator of the DynUnion to the specified value. - * Setting the discriminator to a value that is consistent with the currently active union member - * does not affect the currently active member. Setting the discriminator to a value that is inconsistent - * with the currently active member deactivates the member and activates the member that is consistent - * with the new discriminator value (if there is a member for that value) by initializing the member - * to its default value. - * Setting the discriminator of a union sets the current position to 0 if the discriminator value - * indicates a non-existent union member (has_no_active_member returns true in this case). - * Otherwise, if the discriminator value indicates a named union member, the current position is set to 1 - * (has_no_active_member returns false and component_count returns 2 in this case). - * - * @exception TypeMismatch if the TypeCode of the parameter is not equivalent to the TypeCode - * of the union's discriminator - */ - void set_discriminator(in DynAny d) - raises(TypeMismatch); - - /** - * Sets the discriminator to a value that is consistent with the value of the default case of a union. - * It sets the current position to zero and causes component_count to return 2. - * - * @exception TypeMismatch if the union does not have an explicit default case - */ - void set_to_default_member() - raises(TypeMismatch); - - /** - * Sets the discriminator to a value that does not correspond to any of the unions case labels. - * It sets the current position to zero and causes component_count to return 1. - * - * @exception TypeMismatch if the union has an explicit default case or if it uses the entire range - * of discriminator values for explicit case labels - */ - void set_to_no_active_member() - raises(TypeMismatch); - - /** - * Returns true if the union has no active member, that is, the unions value consists solely - * of its discriminator because the discriminator has a value that is not listed as an explicit case label. - * Calling this operation on a union that has a default case returns false. - * Calling this operation on a union that uses the entire range of discriminator values - * for explicit case labels returns false. - */ - boolean has_no_active_member(); - - /** - * Returns the TCKind value of the discriminators TypeCode. - */ - CORBA::TCKind discriminator_kind(); - - /** - * Returns the TCKind value of the currently active members TypeCode. - * - * @exception InvalidValue if the union does not have a currently active member - */ - CORBA::TCKind member_kind() - raises(InvalidValue); - - /** - * Returns the currently active member. Note that the returned reference remains valid only - * for as long as the currently active member does not change. Using the returned reference - * beyond the life time of the currently active member raises OBJECT_NOT_EXIST. - * - * @exception InvalidValue if the union has no active member - */ - DynAny member() - raises(InvalidValue); - - /** - * Returns the name of the currently active member. If the unions TypeCode does not contain - * a member name for the currently active member, the operation returns an empty string. - * - * @exception InvalidValue if the union has no active member - */ - FieldName member_name() - raises(InvalidValue); - }; - - typedef sequence AnySeq; - typedef sequence DynAnySeq; - - /** - * DynSequence objects support the manipulation of IDL sequences. - */ - interface DynSequence : DynAny { - #pragma sun_localservant DynSequence "" - - /** - * Returns the current length of the sequence. - */ - unsigned long get_length(); - - /** - * Sets the length of the sequence. - * Increasing the length of a sequence adds new elements at the tail without affecting the values - * of already existing elements. Newly added elements are default-initialized. - * Increasing the length of a sequence sets the current position to the first newly-added element - * if the previous current position was -1. Otherwise, if the previous current position was not -1, - * the current position is not affected. - * Decreasing the length of a sequence removes elements from the tail without affecting the value - * of those elements that remain. The new current position after decreasing the length of a sequence - * is determined as follows: - *
              - *
            • If the length of the sequence is set to zero, the current position is set to -1. - *
            • If the current position is -1 before decreasing the length, it remains at -1. - *
            • If the current position indicates a valid element and that element is not removed when the length - * is decreased, the current position remains unaffected. - *
            • If the current position indicates a valid element and that element is removed, - * the current position is set to -1. - *
            - * - * @exception InvalidValue if this is a bounded sequence and len is larger than the bound - */ - void set_length(in unsigned long len) - raises(InvalidValue); - - /** - * Returns the elements of the sequence. - */ - AnySeq get_elements(); - - /** - * Sets the elements of a sequence. - * The length of the DynSequence is set to the length of value. The current position is set to zero - * if value has non-zero length and to -1 if value is a zero-length sequence. - * - * @exception TypeMismatch if value contains one or more elements whose TypeCode is not equivalent - * to the element TypeCode of the DynSequence - * @exception InvalidValue if the length of value exceeds the bound of a bounded sequence - */ - void set_elements(in AnySeq value) - raises(TypeMismatch, InvalidValue); - - /** - * Returns the DynAnys representing the elements of the sequence. - */ - DynAnySeq get_elements_as_dyn_any(); - - /** - * Sets the elements of a sequence using DynAnys. - * The length of the DynSequence is set to the length of value. The current position is set to zero - * if value has non-zero length and to -1 if value is a zero-length sequence. - * - * @exception TypeMismatch if value contains one or more elements whose TypeCode is not equivalent - * to the element TypeCode of the DynSequence - * @exception InvalidValue if the length of value exceeds the bound of a bounded sequence - */ - void set_elements_as_dyn_any(in DynAnySeq value) - raises(TypeMismatch, InvalidValue); - }; - - /** - * DynArray objects support the manipulation of IDL arrays. - * Note that the dimension of the array is contained in the TypeCode which is accessible - * through the type attribute. It can also be obtained by calling the component_count operation. - */ - interface DynArray : DynAny { - #pragma sun_localservant DynArray "" - - /** - * Returns the elements of the DynArray. - */ - AnySeq get_elements(); - - /** - * Sets the DynArray to contain the passed elements. - * - * @exception TypeMismatch if one or more elements have a type that is inconsistent with the DynArrays TypeCode - * @exception InvalidValue if the sequence does not contain the same number of elements as the array dimension - */ - void set_elements(in AnySeq value) - raises(TypeMismatch, InvalidValue); - - /** - * Returns the elements of the DynArray as DynAnys. - */ - DynAnySeq get_elements_as_dyn_any(); - - /** - * Sets the DynArray to contain the passed elements. - * - * @exception TypeMismatch if one or more elements have a type that is inconsistent with the DynArrays TypeCode - * @exception InvalidValue if the sequence does not contain the same number of elements as the array dimension - */ - void set_elements_as_dyn_any(in DynAnySeq value) - raises(TypeMismatch, InvalidValue); - }; - - /** - * DynValueCommon provides operations supported by both the DynValue and DynValueBox interfaces. - */ - interface DynValueCommon : DynAny { - /** - * Returns true if the DynValueCommon represents a null value type. - */ - boolean is_null(); - - /** - * Changes the representation of a DynValueCommon to a null value type. - */ - void set_to_null(); - - /** - * Replaces a null value type with a newly constructed value. Its components are initialized - * to default values as in DynAnyFactory.create_dyn_any_from_type_code. - * If the DynValueCommon represents a non-null value type, then this operation has no effect. - */ - void set_to_value(); - }; - - /** - * DynValue objects support the manipulation of IDL non-boxed value types. - * The DynValue interface can represent both null and non-null value types. - * For a DynValue representing a non-null value type, the DynValue's components comprise - * the public and private members of the value type, including those inherited from concrete base value types, - * in the order of definition. A DynValue representing a null value type has no components - * and a current position of -1. - *

            Warning: Indiscriminantly changing the contents of private value type members can cause the value type - * implementation to break by violating internal constraints. Access to private members is provided to support - * such activities as ORB bridging and debugging and should not be used to arbitrarily violate - * the encapsulation of the value type. - */ - interface DynValue : DynValueCommon { - #pragma sun_localservant DynValue "" - - /** - * Returns the name of the member at the current position. - * This operation may return an empty string since the TypeCode of the value being - * manipulated may not contain the names of members. - * - * @exception TypeMismatch if the DynValue represents a null value type. - * @exception InvalidValue if the current position does not indicate a member - */ - FieldName current_member_name() - raises(TypeMismatch, InvalidValue); - - /** - * Returns the TCKind associated with the member at the current position. - * - * @exception TypeMismatch if the DynValue represents a null value type. - * @exception InvalidValue if the current position does not indicate a member - */ - CORBA::TCKind current_member_kind() - raises(TypeMismatch, InvalidValue); - - /** - * Returns a sequence of NameValuePairs describing the name and the value of each member - * in the value type. - * The sequence contains members in the same order as the declaration order of members - * as indicated by the DynValue's TypeCode. The current position is not affected. - * The member names in the returned sequence will be empty strings if the DynValue's TypeCode - * does not contain member names. - * - * @exception InvalidValue if this object represents a null value type - */ - NameValuePairSeq get_members() - raises(InvalidValue); - - /** - * Initializes the value type's members from a sequence of NameValuePairs. - * The operation sets the current position to zero if the passed sequences has non-zero length. Otherwise, - * if an empty sequence is passed, the current position is set to -1. - * A null value type can be initialized to a non-null value type using this method. - *

            Members must appear in the NameValuePairs in the order in which they appear in the IDL specification - * of the value type as indicated by the DynValue's TypeCode or they must be empty strings. - * The operation makes no attempt to assign member values based on member names. - * - * @exception TypeMismatch if the member names supplied in the passed sequence do not match the - * corresponding member name in the DynValue's TypeCode and they are not empty strings - * @exception InvalidValue if the passed sequence has a number of elements that disagrees - * with the number of members as indicated by the DynValue's TypeCode - */ - void set_members(in NameValuePairSeq value) - raises(TypeMismatch, InvalidValue); - - /** - * Returns a sequence of NameDynAnyPairs describing the name and the value of each member - * in the value type. - * The sequence contains members in the same order as the declaration order of members - * as indicated by the DynValue's TypeCode. The current position is not affected. - * The member names in the returned sequence will be empty strings if the DynValue's TypeCode - * does not contain member names. - * - * @exception InvalidValue if this object represents a null value type - */ - NameDynAnyPairSeq get_members_as_dyn_any() - raises(InvalidValue); - - /** - * Initializes the value type's members from a sequence of NameDynAnyPairs. - * The operation sets the current position to zero if the passed sequences has non-zero length. Otherwise, - * if an empty sequence is passed, the current position is set to -1. - * A null value type can be initialized to a non-null value type using this method. - *

            Members must appear in the NameDynAnyPairs in the order in which they appear in the IDL specification - * of the value type as indicated by the DynValue's TypeCode or they must be empty strings. - * The operation makes no attempt to assign member values based on member names. - * - * @exception TypeMismatch if the member names supplied in the passed sequence do not match the - * corresponding member name in the DynValue's TypeCode and they are not empty strings - * @exception InvalidValue if the passed sequence has a number of elements that disagrees - * with the number of members as indicated by the DynValue's TypeCode - */ - void set_members_as_dyn_any(in NameDynAnyPairSeq value) - raises(TypeMismatch, InvalidValue); - }; - - /** - * DynValueBox objects support the manipulation of IDL boxed value types. - * The DynValueBox interface can represent both null and non-null value types. - * For a DynValueBox representing a non-null value type, the DynValueBox has a single component - * of the boxed type. A DynValueBox representing a null value type has no components - * and a current position of -1. - */ - interface DynValueBox : DynValueCommon { - - /** - * Returns the boxed value as an Any. - * - * @exception InvalidValue if this object represents a null value box type - */ - any get_boxed_value() - raises(InvalidValue); - - /** - * Replaces the boxed value with the specified value. - * If the DynBoxedValue represents a null valuetype, it is converted to a non-null value. - * - * @exception TypeMismatch if this object represents a non-null value box type and the type - * of the parameter is not matching the current boxed value type. - */ - void set_boxed_value(in any boxed) - raises(TypeMismatch); - - /** - * Returns the boxed value as a DynAny. - * - * @exception InvalidValue if this object represents a null value box type - */ - DynAny get_boxed_value_as_dyn_any() - raises(InvalidValue); - - /** - * Replaces the boxed value with the value contained in the parameter. - * If the DynBoxedValue represents a null valuetype, it is converted to a non-null value. - * - * @exception TypeMismatch if this object represents a non-null value box type and the type - * of the parameter is not matching the current boxed value type. - */ - void set_boxed_value_as_dyn_any(in DynAny boxed) - raises(TypeMismatch); - }; - - /** - * DynAny objects can be created by invoking operations on the DynAnyFactory object. - * Generally there are only two ways to create a DynAny object: - *

              - *
            • invoking an operation on an existing DynAny object - *
            • invoking an operation on a DynAnyFactory object - *
            - * A constructed DynAny object supports operations that enable the creation of new DynAny - * objects encapsulating access to the value of some constituent. - * DynAny objects also support the copy operation for creating new DynAny objects. - * A reference to the DynAnyFactory object is obtained by calling ORB.resolve_initial_references() - * with the identifier parameter set to the string constant "DynAnyFactory". - *

            Dynamic interpretation of an any usually involves creating a DynAny object using create_dyn_any() - * as the first step. Depending on the type of the any, the resulting DynAny object reference can be narrowed - * to a DynFixed, DynStruct, DynSequence, DynArray, DynUnion, DynEnum, or DynValue object reference. - *

            Dynamic creation of an any involves creating a DynAny object using create_dyn_any_from_type_code(), - * passing the TypeCode associated with the value to be created. The returned reference is narrowed to one of - * the complex types, such as DynStruct, if appropriate. Then, the value can be initialized by means of - * invoking operations on the resulting object. Finally, the to_any operation can be invoked - * to create an any value from the constructed DynAny. - */ - interface DynAnyFactory { - #pragma sun_localservant DynAnyFactory "" - exception InconsistentTypeCode {}; - - /** - * Creates a new DynAny object from an any value. - * A copy of the TypeCode associated with the any value is assigned to the resulting DynAny object. - * The value associated with the DynAny object is a copy of the value in the original any. - * The current position of the created DynAny is set to zero if the passed value has components, - * to -1 otherwise - * - * @exception InconsistentTypeCode if value has a TypeCode with a TCKind of tk_Principal, - * tk_native, or tk_abstract_interface - */ - DynAny create_dyn_any(in any value) - raises(InconsistentTypeCode); - - /** - * Creates a DynAny from a TypeCode. Depending on the TypeCode, the created object may be of type DynAny, - * or one of its derived types, such as DynStruct. The returned reference can be narrowed to the derived type. - * In all cases, a DynAny constructed from a TypeCode has an initial default value. - * The default values of basic types are: - *

              - *
            • false for boolean - *
            • zero for numeric types - *
            • zero for types octet, char, and wchar - *
            • the empty string for string and wstring - *
            • null for object references - *
            • a type code with a TCKind value of tk_null for type codes - *
            • for any values, an any containing a type code with a TCKind value of tk_null type and no value - *
            - * For complex types, creation of the corresponding DynAny assigns a default value as follows: - *
              - *
            • For DynSequence it sets the current position to -1 and creates an empty sequence. - *
            • For DynEnum it sets the current position to -1 and sets the value of the enumerator - * to the first enumerator value indicated by the TypeCode. - *
            • For DynFixed it sets the current position to -1 and sets the value zero. - *
            • For DynStruct it sets the current position to -1 for empty exceptions - * and to zero for all other TypeCodes. The members (if any) are (recursively) initialized - * to their default values. - *
            • For DynArray sets the current position to zero and (recursively) initializes elements - * to their default value. - *
            • For DynUnion sets the current position to zero. The discriminator value is set - * to a value consistent with the first named member of the union. That member is activated and (recursively) - * initialized to its default value. - *
            • For DynValue and DynValueBox it initializes to a null value. - *
            - */ - DynAny create_dyn_any_from_type_code(in CORBA::TypeCode type) - raises(InconsistentTypeCode); - }; -}; // module DynamicAny - -#endif // _DYNAMIC_ANY_IDL_ diff --git a/src/java.corba/share/classes/org/omg/DynamicAny/package.html b/src/java.corba/share/classes/org/omg/DynamicAny/package.html deleted file mode 100644 index 81c39b3295d..00000000000 --- a/src/java.corba/share/classes/org/omg/DynamicAny/package.html +++ /dev/null @@ -1,211 +0,0 @@ - - - - - - - -

            Provides classes and interfaces that enable traversal of the data value - associated with an any at -runtime, and extraction of the primitive constituents of the data value. - - -

            An any can be passed to a program that doesn't have any static information -for the type of the any (code generated for the type by an IDL compiler has not -been compiled with the object implementation). As a result, the object receiving the -any does not have a portable method of using it. - -

            DynAnys enable traversal of the data value associated with an -any at runtime, and extraction of the primitive constituents of the data value. -This is especially helpful for writing powerful generic servers (bridges, event channels -supporting filtering). Similarly, this facility enables the construction of an -any at runtime, without having static knowledge of its type. This is especially -helpful for writing generic clients (bridges, browsers, debuggers, user interface tools). - -

            Any values can be dynamically interpreted (traversed) and constructed through -DynAny objects. A DynAny object is associated with a data -value which corresponds to a copy of the value inserted into an Any. A -DynAny object may be viewed as an ordered collection of component -DynAnys. For DynAnys representing a basic type, such as long, -or a type without components, such as an empty exception, the ordered collection of -components is empty. - -

            Each DynAny object maintains the notion of a current position into its collection -of component DynAnys. The current position is identified by an index value that runs -from 0 to n-1, where n is the number of components. The special index value -1 -indicates a current position that points nowhere. - For values that cannot have a current position (such as an empty exception), - the index value is fixed at -1. - If a DynAny is initialized with a value that has components, the index is -initialized to 0. - After creation of an uninitialized DynAny (that is, a DynAny that -has no value but a TypeCode - that permits components), the current position depends on the type of value represented by - the DynAny. (The current position is set to 0 or -1, depending on whether the -new DynAny - gets default values for its components.) - - -

            The iteration operations rewind, seek, and next -can be used to change the current position - and the current_component operation returns the component at the current -position. - The component_count operation returns the number of components of a -DynAny. - Collectively, these operations enable iteration over the components of a -DynAny, for example, - to (recursively) examine its contents. - - -

            A constructed DynAny object is a DynAny object associated with -a constructed type. - There is a different interface, inheriting from the DynAny interface, -associated with - each kind of constructed type in IDL (fixed, enum, struct, sequence, union, array, - exception, and value type). A constructed DynAny object exports operations -that enable the creation of new DynAny objects, - each of them associated with a component of the constructed data value. - As an example, a DynStruct is associated with a struct value. This -means that the DynStruct - may be seen as owning an ordered collection of components, one for each structure member. - The DynStruct object exports operations that enable the creation of new -DynAny objects, - each of them associated with a member of the struct. - - -

            If a DynAny object has been obtained from another (constructed) -DynAny object, - such as a DynAny representing a structure member that was created from a -DynStruct, - the member DynAny is logically contained in the DynStruct. - Calling an insert or get operation leaves the current position -unchanged. - Destroying a top-level DynAny object (one that was not obtained as a component -of another DynAny) - also destroys any component DynAny objects obtained from it. - Destroying a non-top level DynAny object does nothing. - Invoking operations on a destroyed top-level DynAny or any of its descendants -raises OBJECT_NOT_EXIST. - If the programmer wants to destroy a DynAny object but still wants to -manipulate some component - of the data value associated with it, then he or she should first create a -DynAny for the component - and, after that, make a copy of the created DynAny object. - - -

            The behavior of DynAny objects has been defined in order to enable efficient -implementations -in terms of allocated memory space and speed of access. DynAny objects are -intended to be used -for traversing values extracted from anys or constructing values of -anys at runtime. -Their use for other purposes is not recommended. - - - -

            Handling DynAny objects

            - -

            Insert and get operations are necessary to handle basic -DynAny objects - but are also helpful to handle constructed DynAny objects. - Inserting a basic data type value into a constructed DynAny object - implies initializing the current component of the constructed data value - associated with the DynAny object. For example, invoking -insert_boolean on a - DynStruct implies inserting a boolean data value at the current -position - of the associated struct data value. - A type is consistent for inserting or extracting a value if its TypeCode is -equivalent to - the TypeCode contained in the DynAny or, if the -DynAny has components, is equivalent to the TypeCode - of the DynAny at the current position. - -

            Basic operations include: -

              -
            • insert_boolean, get_boolean -
            • insert_char, get_char -
            • insert_short, get_short -
            • insert_ushort, get_ushort -
            • insert_long, get_long -
            • insert_ulong, get_ulong -
            • insert_double, get_double -
            • insert_string, get_string -
            • insert_reference, get_reference -
            • insert_typecode, get_typecode -
            • insert_longlong, get_longlong -
            • insert_ulonglong, get_ulonglong -
            • insert_longdouble, get_longdouble -
            • insert_wchar, get_wchar -
            • insert_wstring, get_wstring -
            • insert_any, get_any -
            • insert_dyn_any, get_dyn_any -
            • insert_val, get_val -
            • insert_octet, get_octet -
            • insert_float, get_float -
            • get_value -
            • get_as_string -
            • get_as_ulong -
            • get_members -
            • get_members_as_dyn_any -
            • get_discriminator -
            • get_length -
            • get_elements -
            • get_elements_as_dyn_any -
            • get_boxed_value -
            • get_boxed_value_as_dyn_any -
            - - -

            DynAny and DynAnyFactory objects are intended to be local to -the process in which they are - created and used. This means that references to DynAny and -DynAnyFactory objects cannot be exported - to other processes, or externalized with ORB.object_to_string(). - If any attempt is made to do so, the offending operation will raise a MARSHAL system -exception. - Since their interfaces are specified in IDL, DynAny objects export operations -defined in the standard - org.omg.CORBA.Object interface. However, any attempt to invoke operations -exported through the Object - interface may raise the standard NO_IMPLEMENT exception. - An attempt to use a DynAny object with the DII may raise the NO_IMPLEMENT -exception. - -

            Package Specification

            - -

            For a precise list of supported sections of official specifications with which -the Java[tm] Platform, Standard Edition 6 ORB complies, see Official Specifications for CORBA -support in Java[tm] SE 6. - -@since 1.4 -
            -@serial exclude - - diff --git a/src/java.corba/share/classes/org/omg/IOP/CodecFactoryPackage/package.html b/src/java.corba/share/classes/org/omg/IOP/CodecFactoryPackage/package.html deleted file mode 100644 index 696233689fd..00000000000 --- a/src/java.corba/share/classes/org/omg/IOP/CodecFactoryPackage/package.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - -

            This package contains the exceptions -specified in the IOP::CodeFactory interface (as part of the Portable - Interceptors spec). - - -

            Package Specification

            - -

            For a precise list of supported sections of official specifications with which -the Java[tm] Platform, Standard Edition 6 ORB complies, see Official Specifications for CORBA -support in Java SE 6. - -@since 1.4 -
            -@serial exclude - - diff --git a/src/java.corba/share/classes/org/omg/IOP/CodecPackage/package.html b/src/java.corba/share/classes/org/omg/IOP/CodecPackage/package.html deleted file mode 100644 index d86dfb1de46..00000000000 --- a/src/java.corba/share/classes/org/omg/IOP/CodecPackage/package.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - -

            This package is generated from the IOP::Codec IDL interface -definition. It contains the Java representations of the IDL exceptions -specified in IOP::Codec (as part of the Portable Interceptors -specification). - Please -refer to that OMG specification for further details. - - -

            Package Specification

            - -

            For a precise list of supported sections of official specifications with which -the Java[tm] Platform, Standard Edition 6 ORB complies, see Official Specifications for CORBA -support in Java[tm] SE 6. - -@since 1.4 -
            -@serial exclude - - diff --git a/src/java.corba/share/classes/org/omg/IOP/package.html b/src/java.corba/share/classes/org/omg/IOP/package.html deleted file mode 100644 index dce0d267033..00000000000 --- a/src/java.corba/share/classes/org/omg/IOP/package.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - -

            This package contains the IOP module specified in the OMG document -The Common -Object Request Broker: Architecture and Specification, - -formal/99-10-07, section 13.6. Please -refer to that OMG specification for further details. - -

            Please note that we do not provide all parts of the IOP module from -the specification. We only provide those parts that are referenced as -return values or parameter types in public APIs, most notably, -Portable Interceptors. - - - - - -

            Package Specification

            - -

            For a precise list of supported sections of official specifications with which -the Java[tm] Platform, Standard Edition 6 ORB complies, see Official Specifications for CORBA -support in Java[tm] SE 6. - -@since 1.4 -
            -@serial exclude - - diff --git a/src/java.corba/share/classes/org/omg/Messaging/package.html b/src/java.corba/share/classes/org/omg/Messaging/package.html deleted file mode 100644 index 05ead25c20d..00000000000 --- a/src/java.corba/share/classes/org/omg/Messaging/package.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - -

            This package contains the Messaging module specified in the OMG CORBA -Messaging specification, - -formal/99-10-07. Please refer to that OMG -specification for further details. - -

            Please note that we do not provide all parts of the Messaging module from -the specification. We only provide those parts that are referenced as -return values or parameter types in public APIs, most notably, -Portable Interceptors. - -

            Package Specification

            - -

            For a precise list of supported sections of official specifications with which -the Java[tm] Platform, Standard Edition 6 ORB complies, see Official Specifications for CORBA -support in Java[tm] SE 6. - -@since 1.4 -
            -@serial exclude - - diff --git a/src/java.corba/share/classes/org/omg/PortableInterceptor/CORBAX.idl b/src/java.corba/share/classes/org/omg/PortableInterceptor/CORBAX.idl deleted file mode 100644 index dd12081ae7f..00000000000 --- a/src/java.corba/share/classes/org/omg/PortableInterceptor/CORBAX.idl +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#ifndef _CORBAX_IDL_ -#define _CORBAX_IDL_ - -#pragma prefix "omg.org" - -module CORBA { - /** - * Enumeration of parameter modes for Parameter. Possible vaues: - *

              - *
            • PARAM_IN - Represents an "in" parameter.
            • - *
            • PARAM_OUT - Represents an "out" parameter.
            • - *
            • PARAM_INOUT - Represents an "inout" parameter.
            • - *
            - */ - enum ParameterMode {PARAM_IN, PARAM_OUT, PARAM_INOUT}; - - /** An array of Strings */ - typedef sequence StringSeq; - - /** An array of WStrings */ - typedef sequence WStringSeq; - - /** A byte array */ - typedef sequence OctetSeq; - - /** Repository ID, represented as a String */ - typedef string RepositoryId; - - /** - * Encapsulates a reason a Policy may be invalid. - * - * @see PolicyError - */ - typedef short PolicyErrorCode; - - /** - * Thrown to indicate problems with parameter values passed to the - * ORB.create_policy operation. - */ - exception PolicyError { PolicyErrorCode reason; }; -}; - - -#endif // _CORBAX_IDL_ diff --git a/src/java.corba/share/classes/org/omg/PortableInterceptor/IOP.idl b/src/java.corba/share/classes/org/omg/PortableInterceptor/IOP.idl deleted file mode 100644 index 3dc071dc1bb..00000000000 --- a/src/java.corba/share/classes/org/omg/PortableInterceptor/IOP.idl +++ /dev/null @@ -1,617 +0,0 @@ -/* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#ifndef _IOP_IDL_ -#define _IOP_IDL_ - -#include "CORBAX.idl" - -#pragma prefix "omg.org" - -#ifndef CORBA3 -#define local -#endif - -module IOP { - // - // Standard Protocol Profile tag values - // - /** Profile ID */ - typedef unsigned long ProfileId; - - /** - * Identifies profiles that - * support the Internet Inter-ORB Protocol. The ProfileBody - * of this profile contains a CDR encapsulation of a structure - * containing addressing and object identification information used by - * IIOP. Version 1.1 of the TAG_INTERNET_IOP profile - * also includes an array of TaggedComponent objects that can - * contain additional information supporting optional IIOP features, - * ORB services such as security, and future protocol extensions. - *

            - * Protocols other than IIOP (such as ESIOPs and other GIOPs) can share - * profile information (such as object identity or security - * information) with IIOP by encoding their additional profile information - * as components in the TAG_INTERNET_IOP profile. All - * TAG_INTERNET_IOP profiles support IIOP, regardless of - * whether they also support additional protocols. Interoperable - * ORBs are not required to create or understand any other profile, - * nor are they required to create or understand any of the components - * defined for other protocols that might share the - * TAG_INTERNET_IOP profile with IIOP. - *

            - * The profile_data for the TAG_INTERNET_IOP - * profile is a CDR encapsulation of the IIOP.ProfileBody_1_1 - * type. - */ - const ProfileId TAG_INTERNET_IOP = 0; - - /** - * Indicates that the value encapsulated is of type - * MultipleComponentProfile. In this case, the profile - * consists of a list of protocol components, the use of which must - * be specified by the protocol using this profile. This profile may - * be used to carry IOR components. - *

            - * The profile_data for the - * TAG_MULTIPLE_COMPONENTS profile is a CDR encapsulation - * of the MultipleComponentProfile type shown above. - */ - const ProfileId TAG_MULTIPLE_COMPONENTS = 1; - - /** - * Object references have at least one tagged profile. Each profile - * supports one or more protocols and encapsulates all the basic - * information the protocols it supports need to identify an object. - * Any single profile holds enough information to drive a complete - * invocation using any of the protocols it supports; the content - * and structure of those profile entries are wholly specified by - * these protocols. - */ - struct TaggedProfile { - /** The tag, represented as a profile id. */ - ProfileId tag; - - /** The associated profile data. */ - sequence profile_data; - }; - - /** - * Captures information about a object references, such as whether the - * object is null, what type it is, what protocols are supported, and what - * ORB services are available. - *

            - * This data structure need not be used internally to any given ORB, - * and is not intended to be visible to application-level ORB programmers. - * It should be used only when crossing object reference domain - * boundaries, within bridges. - *

            - * This data structure is designed to be efficient in typical - * single-protocol configurations, while not penalizing multiprotocol ones. - *

            - * Object references have at least one tagged profile. Each profile - * supports one or more protocols and encapsulates all the basic - * information the protocols it supports need to identify an object. - * Any single profile holds enough information to drive a complete - * invocation using any of the protocols it supports; the content - * and structure of those profile entries are wholly specified by - * these protocols. A bridge between two domains may need to know the - * detailed content of the profile for those domains' profiles, - * depending on the technique it uses to bridge the domains. - *

            - * Each profile has a unique numeric tag, assigned by the OMG. - * Profile tags in the range 0x80000000 through 0xffffffff are reserved - * for future use, and are not currently available for assignment. - *

            - * Null object references are indicated by an empty set of profiles, - * and by a "Null" type ID (a string which contains only a single - * terminating character). A Null TypeID is the only - * mechanism that can be used to represent the type - * CORBA.Object. Type IDs may only be "Null" in any message, - * requiring the client to use existing knowledge or to consult the - * object, to determine interface types supported. The type ID - * is a Repository ID identifying the interface type, and is provided - * to allow ORBs to preserve strong typing. This identifier is agreed - * on within the bridge and, for reasons outside the scope of the - * interoperability specification, needs to have a much broader scope to - * address various problems in system evolution and maintenance. - * Type IDs support detection of type equivalence, and in conjunction - * with an Interface Repository, allow processes to reason about the - * relationship of the type of the object referred to and any other type. - *

            - * The type ID, if provided by the server, indicates the most derived - * type that the server wishes to publish, at the time the reference - * is generated. The object's actual most derived type may later change - * to a more derived type. Therefore, the type ID in the IOR can only - * be interpreted by the client as a hint that the object supports at - * least the indicated interface. The client can succeed in narrowing - * the reference to the indicated interface, or to one of its base - * interfaces, based solely on the type ID in the IOR, but must not fail - * to narrow the reference without consulting the object via the - * "_is_a" or "_get_interface" pseudo-operations. - */ - struct IOR { - /** The type id, represented as a String. */ - string type_id; - - /** - * An array of tagged profiles associated with this - * object reference. - */ - sequence profiles; - }; - - /** - * Standard way of representing multicomponent profiles. - * This would be encapsulated in a TaggedProfile. - */ - typedef unsigned long ComponentId; - - /** - * TaggedComponents contained in - * TAG_INTERNET_IOP and - * TAG_MULTIPLE_COMPONENTS profiles are identified by - * unique numeric tags using a namespace distinct form that is used for - * profile tags. Component tags are assigned by the OMG. - *

            - * Specifications of components must include the following information: - *

              - *
            • Component ID: The compound tag that is obtained - * from OMG.
            • - *
            • Structure and encoding: The syntax of the component - * data and the encoding rules. If the component value is - * encoded as a CDR encapsulation, the IDL type that is - * encapsulated and the GIOP version which is used for encoding - * the value, if different than GIOP 1.0, must be specified as - * part of the component definition.
            • - *
            • Semantics: How the component data is intended to be - * used.
            • - *
            • Protocols: The protocol for which the component is - * defined, and whether it is intended that the component be - * usable by other protocols.
            • - *
            • At most once: whether more than one instance of this - * component can be included in a profile.
            • - *
            - * Specification of protocols must describe how the components affect - * the protocol. The following should be specified in any protocol - * definition for each TaggedComponent that the protocol uses: - *
              - *
            • Mandatory presence: Whether inclusion of the component - * in profiles supporting the protocol is required (MANDATORY - * PRESENCE) or not required (OPTIONAL PRESENCE).
            • - *
            • Droppable: For optional presence component, whether - * component, if present, must be retained or may be dropped.
            • - *
            - */ - struct TaggedComponent { - /** The tag, represented as a component id. */ - ComponentId tag; - - /** The component data associated with the component id. */ - sequence component_data; - }; - - /** - * It is often useful in the real world to be able to identify the - * particular kind of ORB an object reference is coming from, to work - * around problems with that particular ORB, or exploit shared - * efficiencies. - *

            - * The TAG_ORB_TYPE component has an associated value of - * type unsigned long (Java long), encoded as a CDR encapsulation, - * designating an ORB type ID allocated by the OMG for the ORB type of the - * originating ORB. Anyone may register any ORB types by submitting - * a short (one-paragraph) description of the ORB type to the OMG, - * and will receive a new ORB type ID in return. A list of ORB type - * descriptions and values will be made available on the OMG web server. - *

            - * The TAG_ORB_TYPE component can appear at most once in - * any IOR profile. For profiles supporting IIOP 1.1 or greater, it - * is optionally present. - */ - const ComponentId TAG_ORB_TYPE = 0 ; - - /** - * The code set component of the IOR multi-component profile structure - * contains: - *

              - *
            • server's native char code set and conversion code sets, and
            • - *
            • server's native wchar code set and conversion code sets.
            • - *
            - * Both char and wchar conversion code sets are listed in order of - * preference. - */ - const ComponentId TAG_CODE_SETS = 1 ; - - /** - * A profile component containing the sequence of QoS policies exported - * with the object reference by an object adapter. - */ - const ComponentId TAG_POLICIES = 2 ; - - /** - * In cases where the same object key is used for more than one - * internet location, the following standard IOR Component is defined - * for support in IIOP version 1.2. - *

            - * The TAG_ALTERNATE_IIOP_ADDRESS component has an - * associated value of type: - *

            -     *   
            -     *     struct { 
            -     *         string HostID, 
            -     *         short Port 
            -     *     };
            -     *   
            -     * 
            - * encoded as a CDR encapsulation. - *

            - * Zero or more instances of the TAG_ALTERNATE_IIOP_ADDRESS - * component type may be included in a version 1.2 - * TAG_INTERNET_IOP Profile. Each of these alternative - * addresses may be used by the client orb, in addition to the host - * and port address expressed in the body of the Profile. In cases - * where one or more TAG_ALTERNATE_IIOP_ADDRESS components - * are present in a TAG_INTERNET_IOP Profile, no order of - * use is prescribed by Version 1.2 of IIOP. - */ - const ComponentId TAG_ALTERNATE_IIOP_ADDRESS = 3 ; - - /** - * Class downloading is supported for stubs, ties, values, and - * value helpers. The specification allows transmission of codebase - * information on the wire for stubs and ties, and enables usage of - * pre-existing ClassLoaders when relevant. - *

            - * For values and value helpers, the codebase is transmitted after the - * value tag. For stubs and ties, the codebase is transmitted as - * the TaggedComponent TAG_JAVA_CODEBASE in the IOR - * profile, where the component_data is a CDR encapsulation - * of the codebase written as an IDL string. The codebase is a - * space-separated list of one or more URLs. - */ - const ComponentId TAG_JAVA_CODEBASE = 25 ; - - /** - * RMI-IIOP has multiple stream format versions. A server - * can specify its maximum version by including the - * TAG_RMI_CUSTOM_MAX_STREAM_FORMAT tagged component or - * rely on the default of version 1 for GIOP 1.2 and less - * and version 2 for GIOP 1.3 and higher. - * - * See Java to IDL ptc/02-01-12 1.4.11. - */ - const ComponentId TAG_RMI_CUSTOM_MAX_STREAM_FORMAT = 38 ; - - /** An array of tagged components, forming a multiple component profile. */ - typedef sequence MultipleComponentProfile; - - /** A service id, represented as an int */ - typedef unsigned long ServiceId; - - /** - * Service-specific information to be passed implicitly with requests - * and replies. Service contexts are composed of service ids and - * associated data. - */ - struct ServiceContext { - /** The service context id */ - ServiceId context_id; - - /** The data associated with this service context */ - sequence context_data; - }; - - /** An array of service contexts, forming a service context list. */ - typedef sequence ServiceContextList; - - /** - * Identifies a CDR encapsulation of the - * CosTSInteroperation.PropogationContext defined in - * CORBAservices: Common Object Services Specifications. - */ - const ServiceId TransactionService = 0; - - /** - * Identifies a CDR encapsulation of the - * CONV_FRAME.CodeSetContext defined in - * Section 13.10.2.5, "GIOP Code Set Service Context," on page 13-43. - */ - const ServiceId CodeSets = 1; - - /** - * Identifies a CDR encapsulation of the RMICustomMaxStreamFormat - * service context which contains a single byte specifying - * the client's maximum RMI-IIOP stream format version. - * - * See Java to IDL ptc/02-01-12 1.4.12. - */ - const ServiceId RMICustomMaxStreamFormat = 17 ; - - /** - * DCOM-CORBA Interworking uses three service contexts as defined in - * "DCOM-CORBA Interworking" in the "Interoperability with non-CORBA - * Systems" chapter. - *

            - * ChainBypassCheck carries a CDR encapsulation of the - * struct CosBridging.ChainBypassCheck. This is carried - * only in a Request message as described in Section 20.9.1, "CORBA - * Chain Bypass," on page 20-19. - */ - const ServiceId ChainBypassCheck = 2; - - /** - * DCOM-CORBA Interworking uses three service contexts as defined in - * "DCOM-CORBA Interworking" in the "Interoperability with non-CORBA - * Systems" chapter. - *

            - * ChainBypassInfo carries a CDR encapsulation of the - * struct CosBridging.ChainBypassInfo. This is carried - * only in a Reply message as described in Section 20.9.1, "CORBA Chain - * Bypass," on page 20-19. - */ - const ServiceId ChainBypassInfo = 3; - - /** - * DCOM-CORBA Interworking uses three service contexts as defined in - * "DCOM-CORBA Interworking" in the "Interoperability with non-CORBA - * Systems" chapter. - *

            - * LogicalThreadId, carries a CDR encapsulation of - * the struct CosBridging.LogicalThreadId as described - * in Section 20.10, "Thread Identification," on page 20-21. - */ - const ServiceId LogicalThreadId = 4; - - /** - * Identifies a CDR encapsulation of the - * IIOP.BiDirIIOPServiceContext defined in Section 15.8, - * "Bi-Directional GIOP," on page 15-55. - */ - const ServiceId BI_DIR_IIOP = 5; - - /** - * Identifies a CDR encapsulation of the IOR of the - * SendingContext.RunTime object (see Section 5.6, "Access - * to the Sending Context Run Time," on page 5-15). - */ - const ServiceId SendingContextRunTime = 6; - - /** - * For information on INVOCATION_POLICIES refer to the - * Asynchronous Messaging specification - orbos/98-05-05. - */ - const ServiceId INVOCATION_POLICIES = 7; - - /** - * For information on FORWARDED_IDENTITY refer to the - * Firewall specification - orbos/98-05-04. - */ - const ServiceId FORWARDED_IDENTITY = 8; - - /** - * Identifies a CDR encapsulation of a marshaled instance of a - * java.lang.Throwable or one of its subclasses as described in Java - * to IDL Language Mapping, Section 1.4.8.1, "Mapping of - * UnknownExceptionInfo Service Context," on page 1-32. - */ - const ServiceId UnknownExceptionInfo = 9; - - /** - * CORBA formal/02-06-01: 13.7.1: - * ExceptionDetailMessage identifies a CDR encapsulation of a wstring, - * encoded using GIOP 1.2 with a TCS-W of UTF-16. This service context - * may be sent on Reply messages with a reply_status of SYSTEM_EXCEPTION - * or USER_EXCEPTION. The usage of this service context is defined - * by language mappings.

            - * - * IDL/Java: ptc/02-01-22: 1.15.2: - * When a System Exception is marshaled, its GIOP Reply message shall - * include an associated ExceptionDetailMessage service context. The - * callee's stack trace is often very valuable debugging information but - * may contain sensitive or unwanted information. The wstring within the - * service context will therefore contain additional information relating - * to the exception, for example the result of calling either - * printStackTrace(PrintWriter) or getMessage() on the exception. When - * unmarshaling a System Exception on the client side, the wstring from - * any ExceptionDetailMessage service context shall become the Java error - * message in the unmarshaled exception object. - */ - const ServiceId ExceptionDetailMessage = 14; - - - // BEGIN part which lived in Interceptors.idl. - - /** - * An array of TaggedComponent objects. - */ - typedef sequence TaggedComponentSeq; - - /** - * The formats of IOR components and service context data used by ORB - * services are often defined as CDR encapsulations encoding instances - * of IDL defined data types. The Codec provides a mechanism - * to transfer these components between their IDL data types and their CDR - * encapsulation representations. - *

            - * A Codec is obtained from the CodecFactory. - * The CodecFactory is obtained through a call to - * ORB.resolve_initial_references( "CodecFactory" ). - */ - local interface Codec { - - /** - * This exception is thrown by Codec.encode or - * Codec.encode_value when the type is invalid for the - * encoding. For example, this exception is thrown if the encoding is - * ENCODING_CDR_ENCAPS version 1.0 and a type - * that does not exist in that version, such as wstring, - * is passed to the operation. - */ - exception InvalidTypeForEncoding {}; - - /** - * This exception is thrown by Codec.decode or - * Codec.decode_value when the data in the byte array - * cannot be decoded into an Any. - */ - exception FormatMismatch {}; - - /** - * This exception is thrown by decode_value when the given - * TypeCode does not match the given byte array. - */ - exception TypeMismatch {}; - - /** - * Converts the given any into a byte array based on the encoding - * format effective for this Codec. - * - * @param data The data, in the form of an any, to be encoded into - * a byte array. - * @return A byte array containing the encoded Any. This byte array - * contains both the TypeCode and the data of the type. - * @exception InvalidTypeForEncoding thrown if the type is not valid for - * the encoding format effective for this Codec. - */ - CORBA::OctetSeq encode (in any data) - raises (InvalidTypeForEncoding); - - /** - * Decodes the given byte array into an Any based on the encoding - * format effective for this Codec. - * - * @param data The data, in the form of a byte array, to be decoded into - * an Any. - * @return An Any containing the data from the decoded byte array. - * @exception FormatMismatch is thrown if the byte array cannot be - * decoded into an Any. - */ - any decode (in CORBA::OctetSeq data) raises (FormatMismatch); - - /** - * Converts the given any into a byte array based on the encoding - * format effective for this Codec. Only the data from the Any is - * encoded, not the TypeCode. - * - * @param data The data, in the form of an Any, to be encoded into - * a byte array. - * @return A byte array containing the data from the encoded any. - * @exception InvalidTypeForEncoding thrown if the type is not valid for - * the encoding format effective for this Codec. - */ - CORBA::OctetSeq encode_value (in any data) - raises (InvalidTypeForEncoding); - - /** - * Decodes the given byte array into an Any based on the given - * TypeCode and the encoding format effective for - * this Codec. - * - * @param data The data, in the form of a byte array, to be decoded - * into an Any. - * @param tc The TypeCode to be used to decode the data. - * @return An Any containing the data from the decoded byte array. - * @exception FormatMismatch thrown if the byte array cannot be - * decoded into an Any. - */ - any decode_value (in CORBA::OctetSeq data, in CORBA::TypeCode tc) - raises (FormatMismatch, TypeMismatch); - }; - - /** - * Defines an encoding format of a Codec, such as - * CDR Encapsulation (ENCODING_CDR_ENCAPS). - */ - typedef short EncodingFormat; - - /** - * The CDR Encapsulation encoding. - * @see CodecFactory - */ - const EncodingFormat ENCODING_CDR_ENCAPS = 0; - - /** - * Defines the encoding format of a Codec. This class - * details the encoding format, such as CDR Encapsulation encoding, and - * the major and minor versions of that format. - *

            - * The encodings currently supported are: - *

              - *
            • ENCODING_CDR_ENCAPS, version 1.0;
            • - *
            • ENCODING_CDR_ENCAPS, version 1.1;
            • - *
            • ENCODING_CDR_ENCAPS, version 1.2;
            • - *
            • ENCODING_CDR_ENCAPS for all future versions of GIOP as - * they arise.
            • - *
            - * Vendors are free to support additional encodings. - * - * @see ENCODING_CDR_ENCAPS - */ - struct Encoding { - /** - * The encoding format. - */ - EncodingFormat format; - - /** - * The major version of this Encoding format. - */ - octet major_version; - - /** - * The minor version of this Encoding format. - */ - octet minor_version; - }; - - /** - * Codecs are obtained from the CodecFactory. - * The CodecFactory is obtained through a call to - * ORB.resolve_initial_references( "CodecFactory" ). - */ - local interface CodecFactory { - /** - * This exception is thrown by CodecFactory.create_codec when - * the factory cannot create a Codec for a given encoding. - */ - exception UnknownEncoding {}; - - /** - * Create a Codec of the given encoding. - * - * @param enc The encoding for which to create a Codec. - * @return A Codec obtained with the given encoding. - * @exception UnknownEncoding thrown if this factory cannot create a - * Codec of the given encoding. - */ - Codec create_codec (in Encoding enc) raises (UnknownEncoding); - }; - - // END part which lived in Interceptors.idl. - -}; - -#endif // _IOP_IDL_ diff --git a/src/java.corba/share/classes/org/omg/PortableInterceptor/Interceptors.idl b/src/java.corba/share/classes/org/omg/PortableInterceptor/Interceptors.idl deleted file mode 100644 index 13cf409837a..00000000000 --- a/src/java.corba/share/classes/org/omg/PortableInterceptor/Interceptors.idl +++ /dev/null @@ -1,2231 +0,0 @@ -/* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Differences from original: - * - * - do not include orb.idl - * - include IOP.idl, Messaging.idl and CORBAX.idl - * - renamed component parameter names to tagged_component (so that they - * do not conflict with the CORBA 3.0 "component" keyword). - * - javadocs added (synchronized with orbos/00-08-06) - * - * NOTE: After compilation of this IDL file, all Helper and Holder classes - * that are not needed are removed. - */ -#include "IOP.idl" -#include "Messaging.idl" -#include "CORBAX.idl" -#include "corba.idl" - -#pragma prefix "omg.org" - -#ifndef CORBA3 -#define local -#endif - -module Dynamic { - - /** - * NVList PIDL represented by ParameterList IDL. - * This exists in order to keep the Portable Interceptor IDL from becoming - * PIDL. - */ - struct Parameter { - any argument; - CORBA::ParameterMode mode; - }; - - /** - * NVList PIDL represented by ParameterList IDL. - * This exists in order to keep the Portable Interceptor IDL from becoming - * PIDL. - */ - typedef sequence ParameterList; - - /** - * ContextList PIDL represented by ContextList - * IDL. This exists in order to keep the Portable Interceptor IDL from - * becoming PIDL. - */ - typedef CORBA::StringSeq ContextList; - - /** - * ExceptionList PIDL represented by ExceptionList - * IDL. This exists in order to keep the Portable Interceptor IDL from - * becoming PIDL. - */ - typedef sequence ExceptionList; - - /** - * Context PIDL represented by RequestContext - * IDL. This exists in order to keep the Portable Interceptor IDL from o - * becoming PIDL. - *

            - * Context objects are encoded as String[]. The - * Strings occur in pairs. The first String in - * each pair is the context property name and the second String - * in each pair is the associated value. - */ - typedef CORBA::StringSeq RequestContext; -}; - -module PortableInterceptor { - /** - * All Portable Interceptors implement Interceptor. - */ - local interface Interceptor { - /** - * Returns the name of the interceptor. - *

            - * Each Interceptor may have a name that may be used administratively - * to order the lists of Interceptors. Only one Interceptor of a given - * name can be registered with the ORB for each Interceptor type. An - * Interceptor may be anonymous, i.e., have an empty string as the name - * attribute. Any number of anonymous Interceptors may be registered with - * the ORB. - * - * @return the name of the interceptor. - */ - readonly attribute string name; - - // Added in ptc/00-08-06 - /** - * Provides an opportunity to destroy this interceptor. - * The destroy method is called during ORB.destroy. When an - * application calls ORB.destroy, the ORB: - *

              - *
            1. waits for all requests in progress to complete
            2. - *
            3. calls the Interceptor.destroy operation for each - * interceptor
            4. - *
            5. completes destruction of the ORB
            6. - *
            - * Method invocations from within Interceptor.destroy on - * object references for objects implemented on the ORB being destroyed - * result in undefined behavior. However, method invocations on objects - * implemented on an ORB other than the one being destroyed are - * permitted. (This means that the ORB being destroyed is still capable - * of acting as a client, but not as a server.) - */ - void destroy(); - }; - - - /** - * The ForwardRequest exception is the means by which an - * Interceptor can indicate to the ORB that a retry of the request should - * occur with the new object given in the exception. This behavior of - * causing a retry only occurs if the ORB receives a ForwardRequest from - * an interceptor. If ForwardRequest is thrown anywhere else - * it is passed through the ORB as is normal for a user exception. - *

            - * If an Interceptor throws a ForwardRequest exception in - * response to a call of an interceptor, no other Interceptors are called - * for that interception point. The remaining Interceptors in the Flow Stack - * shall have their appropriate ending interception point called: - * receive_other on the client, or send_other on - * the server. The reply_status in the - * receive_other or send_other would be - * LOCATION_FORWARD. - */ - exception ForwardRequest { - /** - * The new object to forward the request to. - */ - Object forward; -// Change in ptc/00-08-06 -// boolean permanent; - }; - - /** Reply status, represented as an int */ - typedef short ReplyStatus; - - // Valid reply_status values: - - /** - * Indicates a successful Reply Status. One possible value for - * RequestInfo.reply_status. - * @see RequestInfo#reply_status - * @see SYSTEM_EXCEPTION - * @see USER_EXCEPTION - * @see LOCATION_FORWARD - * @see TRANSPORT_RETRY - */ - const ReplyStatus SUCCESSFUL = 0; - - /** - * Indicates a SystemException reply status. One possible value for - * RequestInfo.reply_status. - * @see RequestInfo#reply_status - * @see SUCCESSFUL - * @see USER_EXCEPTION - * @see LOCATION_FORWARD - * @see TRANSPORT_RETRY - */ - const ReplyStatus SYSTEM_EXCEPTION = 1; - - /** - * Indicates a UserException reply status. One possible value for - * RequestInfo.reply_status. - * @see RequestInfo#reply_status - * @see SUCCESSFUL - * @see SYSTEM_EXCEPTION - * @see LOCATION_FORWARD - * @see TRANSPORT_RETRY - */ - const ReplyStatus USER_EXCEPTION = 2; - - /** - * Indicates a LocationForward reply status. One possible value for - * RequestInfo.reply_status. - * @see RequestInfo#reply_status - * @see SUCCESSFUL - * @see SYSTEM_EXCEPTION - * @see USER_EXCEPTION - * @see TRANSPORT_RETRY - */ - const ReplyStatus LOCATION_FORWARD = 3; - -// Changes in ptc/00-08-06 -// const ReplyStatus LOCATION_FORWARD_PERMANENT = 4; - - /** - * Indicates a Transport Retry reply status. One possible value for - * RequestInfo.reply_status. - * @see RequestInfo#reply_status - * @see SUCCESSFUL - * @see SYSTEM_EXCEPTION - * @see USER_EXCEPTION - * @see LOCATION_FORWARD - */ - const ReplyStatus TRANSPORT_RETRY = 4; - - /** - * XXX - */ - const ReplyStatus UNKNOWN = 5; - - /** Slot id, represented as an int */ - typedef unsigned long SlotId; - - /** - * This exception is thrown when get_slot or - * set_slot is called on a slot that has not been allocated. - */ - exception InvalidSlot {}; - - /** - * Portable Interceptors Current (also known as PICurrent) - * is merely a slot table, the slots of which are used by each service to - * transfer their context data between their context and the request's or - * reply's service context. Each service which wishes to use PICurrent - * reserves a slot or slots at initialization time and uses those slots - * during the processing of requests and replies. - *

            - * Before an invocation is made, PICurrent is obtained via a call to - * ORB.resolve_initial_references( "PICurrent" ). From within - * the interception points, the data on PICurrent that has moved from the - * thread scope to the request scope is available via the - * get_slot operation on the RequestInfo object. - * A PICurrent can still be obtained via - * resolve_initial_references, but that is the Interceptor's - * thread scope PICurrent. - */ - local interface Current : CORBA::Current { - - /** - * Retrieves the slot data the application set in PICurrent via - * get_slot. The data is in the form of an Any. - *

            - * If the given slot has not been set, an Any containing a type code - * with a TCKind value of tk_null and no value - * is returned. - * - * @param id The SlotId of the slot from which the data will - * be returned. - * @return The data, in the form of an Any, of the given slot identifier. - * @exception InvalidSlot thrown if get_slot is called on a slot that - * has not been allocated. - * @exception BAD_INV_ORDER thrown if get_slot is called - * from within an ORB initializer - */ - any get_slot (in SlotId id) raises (InvalidSlot); - - /** - * Sets data in a slot. The data is in the form of an Any. If data - * already exists in that slot, it is overridden. - * - * @param id The SlotId of the slot to which the data will - * be set. - * @param data The data, in the form of an Any, which will be set - * to the identified slot. - * @exception InvalidSlot thrown if set_slot is called on - * a slot that has not been allocated. - * @exception BAD_INV_ORDER thrown if set_slot is called - * from within an ORB initializer. - */ - void set_slot (in SlotId id, in any data) raises (InvalidSlot); - }; - - /** - * Request Information, accessible to Interceptors. - *

            - * Each interception point is given an object through which the - * Interceptor can access request information. Client-side and server-side - * interception points are concerned with different information, so there - * are two information objects: ClientRequestInfo is passed - * to the client-side interception points and ServerRequestInfo - * is passed to the server-side interception points. But there is - * information that is common to both, so they both inherit from a common - * interface: RequestInfo. - * - * @see ClientRequestInfo - * @see ServerRequestInfo - */ - local interface RequestInfo { - /** - * Returns an id that uniquely identifies an active request/reply - * sequence. Once a request/reply sequence is concluded this ID may be - * reused. Note that this id is not the same as the GIOP - * request_id. If GIOP is the transport mechanism used, - * then these IDs may very well be the same, but this is not guaranteed - * nor required. - */ - readonly attribute unsigned long request_id; - - /** - * Returns the name of the operation being invoked. - */ - readonly attribute string operation; - - /** - * Returns an array of Parameter objects, containing the - * arguments on the operation being invoked. If there are no arguments, - * this attribute will be a zero length array. - *

            - * Not all environments provide access to the arguments. With the Java - * portable bindings, for example, the arguments are not available. - * In these environments, when this attribute is accessed, - * NO_RESOURCES will be thrown with a standard minor code - * of 1. - *

            - * Note: Arguments are available for DSI/DII calls. - * - * @exception NO_RESOURCES thrown if arguments are not available. - * @see - * PortableInterceptor package comments for - * limitations / unimplemented features - */ - readonly attribute Dynamic::ParameterList arguments; - - /** - * Returns an array of TypeCode objects describing the - * TypeCodes of the user exceptions that this operation - * invocation may throw. If there are no user exceptions, this - * will return a zero length array. - *

            - * Not all environments provide access to the exception list. With - * the Java portable bindings, for example, the exception list is - * not available. In these environments, when this attribute is - * accessed, NO_RESOURCES will be thrown with a - * standard minor code of 1. - *

            - * Note: Exceptions are available for DSI/DII calls. - * - * @exception NO_RESOURCES thrown if exceptions are not available. - * @see - * PortableInterceptor package comments for - * limitations / unimplemented features - */ - readonly attribute Dynamic::ExceptionList exceptions; - - /** - * Returns an array of String objects describing the - * contexts that may be passed on this operation invocation. If there - * are no contexts, this will return a zero length array. - *

            - * Not all environments provide access to the context list. With the - * Java portable bindings, for example, the context list is not - * available. In these environments, when this attribute is accessed, - * NO_RESOURCES will be thrown with a standard minor code - * of 1. - *

            - * Note: Contexts are available for DSI/DII calls. - * - * @exception NO_RESOURCES thrown if contexts are not available. - * @see - * PortableInterceptor package comments for - * limitations / unimplemented features - */ - readonly attribute Dynamic::ContextList contexts; - - /** - * Returns an array of String objects containing the - * contexts being sent on the request. - *

            - * Not all environments provide access to the context. With the Java - * portable bindings, for example, the context is not available. In - * these environments, when this attribute is accessed, NO_RESOURCES will - * be thrown with standard minor code of 1. - *

            - * Note: operation_context is available for - * DSI/DII calls. - * - * @exception NO_RESOURCES thrown if operation context is not available. - * @see - * PortableInterceptor package comments for - * limitations / unimplemented features - */ - readonly attribute Dynamic::RequestContext operation_context; - - /** - * Returns an any containing the result of the operation invocation. - * If the operation return type is void, this attribute will be an any - * containing a type code with a TCKind value of - * tk_void and no value. - *

            - * Not all environments provide access to the result. With the Java - * portable bindings, for example, the result is not available. In - * these environments, when this attribute is accessed, - * NO_RESOURCES will be thrown with a standard minor code of - * 1. - *

            - * Note: Result is available for DSI/DII calls. - * - * @exception NO_RESOURCES thrown if result is not available. - * @see - * PortableInterceptor package comments for - * limitations / unimplemented features - */ - readonly attribute any result; - - /** - * Indicates whether a response is expected. - *

            - * On the client, a reply is not returned when - * response_expected is false, so receive_reply - * cannot be called. receive_other is called unless an - * exception occurs, in which case receive_exception is - * called. - *

            - * On the client, within send_poll, this attribute is true. - */ - readonly attribute boolean response_expected; - - /** - * Defines how far the request shall progress before control is returned - * to the client. This is defined in the Messaging specification, and - * is pertinent only when response_expected is false. If - * response_expected is true, the value of - * sync_scope is undefined. This attribute may have one of - * the following values: - *

              - *
            • Messaging.SYNC_NONE
            • - *
            • Messaging.SYNC_WITH_TRANSPORT
            • - *
            • Messaging.SYNC_WITH_SERVER
            • - *
            • Messaging.SYNC_WITH_TARGET
            • - *
            - * On the server, for all scopes, a reply will be created from the - * return of the target operation call, but the reply will not return - * to the client. Although it does not return to the client, it does - * occur, so the normal server-side interception points are - * followed (i.e., receive_request_service_contexts, - * receive_request, send_reply or - * send_exception). - *

            - * For SYNC_WITH_SERVER and SYNC_WITH_TARGET, - * the server does send an empty reply back to the client before the - * target is invoked. This reply is not intercepted by server-side - * Interceptors. - * - * @see - * PortableInterceptor package comments for - * limitations / unimplemented features - */ - readonly attribute Messaging::SyncScope sync_scope; - - /** - * Describes the state of the result of the operation invocation. The - * return value can be one of the following: - *

              - *
            • PortableInterceptor.SUCCESSFUL
            • - *
            • PortableInterceptor.SYSTEM_EXCEPTION
            • - *
            • PortableInterceptor.USER_EXCEPTION
            • - *
            • PortableInterceptor.LOCATION_FORWARD
            • - *
            • PortableInterceptor.TRANSPORT_RETRY
            • - *
            - * On the client: - *
              - *
            • Within the receive_reply interception point, this - * will only return SUCCESSFUL.
            • - *
            • Within the receive_exception interception point, - * this will be either SYSTEM_EXCEPTION or - * USER_EXCEPTION.
            • - *
            • Within the receive_other interception point, this - * will be any of: SUCCESSFUL, - * LOCATION_FORWARD, or TRANSPORT_RETRY. - * SUCCESSFUL means an asynchronous request returned - * successfully. LOCATION_FORWARD means that a reply - * came back with LOCATION_FORWARD as its status. - * TRANSPORT_RETRY means that the transport - * mechanism indicated a retry - a GIOP reply with a status of - * NEEDS_ADDRESSING_MODE, for instance.
            • - *
            - * On the server: - *
              - *
            • Within the send_reply interception point, this - * will only be SUCCESSFUL.
            • - *
            • Within the send_exception interception point, - * this will be either SYSTEM_EXCEPTION or - * USER_EXCEPTION.
            • - *
            • Within the send_other interception point, this - * attribute will be any of: SUCCESSFUL, or - * LOCATION_FORWARD. SUCCESSFUL means - * an asynchronous request returned successfully. - * LOCATION_FORWARD means that a reply came back - * with LOCATION_FORWARD as its status.
            • - *
            - * - * @see SUCCESSFUL - * @see SYSTEM_EXCEPTION - * @see USER_EXCEPTION - * @see LOCATION_FORWARD - * @see TRANSPORT_RETRY - */ - readonly attribute ReplyStatus reply_status; - - /** - * Contains the object to which the request will be forwarded, if the - * reply_status attribute is LOCATION_FORWARD. - * It is indeterminate whether a forwarded request will actually occur. - */ - readonly attribute Object forward_reference; - - /** - * Returns the data from the given slot of the - * PortableInterceptor.Current that is in the scope of - * the request. - *

            - * If the given slot has not been set, then an any containing a - * type code with a TCKind value of tk_null is - * returned. - * - * @param id The SlotId of the slot which is to be - * returned. - * @return The slot data, in the form of an any, obtained with the - * given identifier. - * @exception InvalidSlot thrown if the ID does not define an - * allocated slot. - * @see Current - */ - any get_slot (in SlotId id) raises (InvalidSlot); - - /** - * Returns a copy of the service context with the given ID that - * is associated with the request. - * - * @param id The IOP.ServiceId of the service context - * which is to be returned. - * @return The IOP.ServiceContext obtained with the - * given identifier. - * @exception BAD_PARAM thrown with a standard minor code of 26, if the - * request's service context does not contain an entry for that ID. - */ - IOP::ServiceContext get_request_service_context - (in IOP::ServiceId id); - - /** - * Returns a copy of the service context with the given ID that - * is associated with the reply. - * - * @param id The IOP.ServiceId of the service context - * which is to be returned. - * @return The IOP.ServiceContext obtained with the given - * identifier. - * @exception BAD_PARAM thrown with a standard minor code of 26 if the - * request's service context does not contain an entry for that ID. - */ - IOP::ServiceContext get_reply_service_context - (in IOP::ServiceId id); - }; - - /** - * Request Information, accessible to client-side request interceptors. - *

            - * Some attributes and operations on ClientRequestInfo are - * not valid at all interception points. The following table shows the - * validity of each attribute or operation. If it is not valid, attempting - * to access it will result in a BAD_INV_ORDER being thrown - * with a standard minor code of 14. - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
            Shows the validity of each attribute or operation
            send_requestsend_pollreceive_replyreceive_exceptionreceive_other
            Inherited from RequestInfo:
            request_idyesyesyesyesyes
            operationyesyesyesyesyes
            argumentsyes1no yesno no
            exceptionsyesno yesyesyes
            contextsyesno yesyesyes
            operation_contextyesno yesyesyes
            resultno no yesno no
            response_expectedyesyesyesyesyes
            sync_scopeyesno yesyesyes
            reply_statusno no yesyesyes
            forward_referenceno no no no yes2
            get_slotyesyesyesyesyes
            get_request_service_contextyesno yesyesyes
            get_reply_service_contextno no yesyesyes
            ClientRequestInfo-specific:
            targetyesyesyesyesyes
            effective_targetyesyesyesyesyes
            effective_profileyesyesyesyesyes
            received_exceptionno no no yesno
            received_exception_idno no no yesno
            get_effective_componentyesno yesyesyes
            get_effective_componentsyesno yesyesyes
            get_request_policyyesno yesyesyes
            add_request_service_contextyesno no no no
            - * - *

              - *
            1. When ClientRequestInfo is passed to - * send_request, there is an entry in the list for every - * argument, whether in, inout, or out. But only the in and inout - * arguments will be available.
            2. - *
            3. If the reply_status atribute is not - * LOCATION_FORWARD, accessing this attribute will - * throw BAD_INV_ORDER with a standard minor code of - * 14.
            4. - *
            - * - * @see ClientRequestInterceptor - */ - local interface ClientRequestInfo : RequestInfo { - - /** - * Returns the object which the client called to perform the - * operation. - * - * @see #effective_target - */ - readonly attribute Object target; - - /** - * Returns the actual object on which the operation will be invoked. - * If the reply_status is LOCATION_FORWARD, - * then on subsequent requests, effective_target will - * contain the forwarded IOR while target will remain unchanged. - * - * @see #target - */ - readonly attribute Object effective_target; - - /** - * Returns the profile that will be used to send the request. If a - * location forward has occurred for this operation's object and - * that object's profile changed accordingly, then this profile will - * be that located profile. - */ - readonly attribute IOP::TaggedProfile effective_profile; - - /** - * Returns an any which contains the exception to be returned to - * the client. - *

            - * If the exception is a user exception which cannot be inserted - * into an any (e.g., it is unknown or the bindings don t provide - * the TypeCode), then this attribute will be an any - * containing the system exception UNKNOWN with a - * standard minor code of 1. However, the repository id of - * the exception is available in the received_exception_id - * attribute. - * - * @see #received_exception_id - */ - readonly attribute any received_exception; - - /** - * Returns the repository id of the exception to be returned to - * the client. - * - * @see #received_exception - * @see - * PortableInterceptor package comments for - * limitations / unimplemented features - */ - readonly attribute CORBA::RepositoryId received_exception_id; - - /** - * Returns the IOP.TaggedComponent with the given ID from - * the profile selected for this request. - *

            - * If there is more than one component for a given component ID, it - * is undefined which component this operation returns. If there is - * more than one component for a given component ID, - * get_effective_components should be called instead. - * - * @param id The component id of the component which - * is to be returned. - * @return The IOP.TaggedComponent obtained with the - * given identifier. - * @exception BAD_PARAM thrown, with a standard minor code of 28, if - * no component exists for the given component ID. - * @see #get_effective_components - */ - IOP::TaggedComponent get_effective_component - (in IOP::ComponentId id); - - /** - * Returns an array of all tagged components with the given ID from the - * profile selected for this request. - * - * @param id The component id of the components which are to be returned. - * @return An array of TaggedComponent objects, each of - * which contains the given identifier. - * @exception BAD_PARAM thrown, with a standard minor code of 28, if - * no component exists for the given component ID. - * @see #get_effective_component - */ - IOP::TaggedComponentSeq get_effective_components - (in IOP::ComponentId id); - - /** - * Returns the given policy in effect for this operation. - * - * @exception INV_POLICY thrown, with a standard minor code of 1, if the - * policy type is not valid either because the specified type is - * not supported by this ORB or because a policy object of that type - * is not associated with this Object - * @param type The policy type which specifies the policy to be - * returned. - * @return The CORBA.Policy obtained with the given type. - * @see - * PortableInterceptor package comments for - * limitations / unimplemented features - */ - CORBA::Policy get_request_policy - (in CORBA::PolicyType type); - - /** - * Allows Interceptors to add service contexts to the request. - *

            - * There is no declaration of the order of the service contexts. - * They may or may not appear in the order that they are added. - * - * @param service_context The IOP.ServiceContext to be - * added to the request. - * @param replace Indicates the behavior of this operation when a - * service context already exists with the given ID. If false, - * then BAD_INV_ORDER with a standard minor code of 15 - * is thrown. If true, then the existing service context is - * replaced by the new one. - */ - void add_request_service_context ( - in IOP::ServiceContext service_context, - in boolean replace); - }; - - // Should be type string - typedef string ServerId ; - - // This should actually be the CORBA::ORBid type once that is available - typedef string ORBId ; - - /** The name of an object adapter. This is unique only within - * the scope of the ORB that created the object adapter. - */ - typedef org::omg::CORBA::StringSeq AdapterName ; - - /** Type of an object id. This provides the identity of a particular - * object that was created by an object adapter. - */ - typedef org::omg::CORBA::OctetSeq ObjectId ; - - /** - * Request Information, accessible to server-side request interceptors. - *

            - * Some attributes and operations on ServerRequestInfo are not - * valid at all interception points. The following table shows the validity - * of each attribute or operation. If it is not valid, attempting to access - * it will result in a BAD_INV_ORDER being thrown with a - * standard minor code of 14. - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
            Shows the validity of each attribute or operation
            receive_request_
            service_contexts
            receive_requestsend_replysend_exceptionsend_other
            Inherited from RequestInfo:
            request_idyesyesyesyesyes
            operationyesyesyesyesyes
            argumentsno yes1yesno2no2 - *
            exceptionsno yesyesyesyes
            contextsno yesyesyesyes
            operation_contextno yesyesno no
            resultno no yesno no
            response_expectedyesyesyesyesyes
            sync_scopeyesyesyesyesyes
            reply_statusno no yesyesyes
            forward_referenceno no no no yes2
            get_slotyesyesyesyesyes
            get_request_service_contextyesno yesyesyes
            get_reply_service_contextno no yesyesyes
            ServerRequestInfo-specific:
            sending_exceptionno no no yesno
            object_idno yesyesyes3yes3
            adapter_idno yesyesyes3yes3
            server_idno yesyesyesyes
            orb_idno yesyesyesyes
            adapter_nameno yesyesyesyes
            target_most_derived_interfaceno yesno4no4no4
            get_server_policyyesyesyesyesyes
            set_slotyesyesyesyesyes
            target_is_ano yesno4no4no4
            add_reply_service_contextyesyesyesyesyes
            - * - *

              - *
            1. When ServerRequestInfo is passed to - * receive_request, there is an entry in the list for - * every argument, whether in, inout, or out. But only the in and - * inout arguments will be available.
            2. - *
            3. If the reply_status attribute is not - * LOCATION_FORWARD, accessing this attribute will throw - * BAD_INV_ORDER with a standard minor code of 14.
            4. - *
            5. If the servant locator caused a location forward, or thrown an - * exception, this attribute/operation may not be available in this - * interception point. NO_RESOURCES with a standard minor - * code of 1 will be thrown if it is not available.
            6. - *
            7. The operation is not available in this interception point because - * the necessary information requires access to the target object's - * servant, which may no longer be available to the ORB. For example, - * if the object's adapter is a POA that uses a - * ServantLocator, then the ORB invokes the interception - * point after it calls ServantLocator.postinvoke().
            8. - *
            - * - * @see ServerRequestInterceptor - */ - local interface ServerRequestInfo : RequestInfo { - - /** - * Returns an any which contains the exception to be returned to - * the client. - *

            - * If the exception is a user exception which cannot be inserted into - * an any (e.g., it is unknown or the bindings don't provide the - * TypeCode), then this attribute will be an any - * containing the system exception UNKNOWN with a - * standard minor code of 1. - * - * @see - * PortableInterceptor package comments for - * limitations / unimplemented features - */ - readonly attribute any sending_exception; - - /** - * Returns the opaque object_id describing the target of - * the operation invocation. - */ - readonly attribute ObjectId object_id; - - /** - * Returns the opaque identifier for the object adapter. - */ - readonly attribute CORBA::OctetSeq adapter_id; - - /** - * Returns the server ID that was specified on ORB::init using the -ORBServerId - * argument. - */ - readonly attribute ServerId server_id ; - - /** - * Returns the ID that was used to create the ORB. - */ - readonly attribute ORBId orb_id ; - - /** - * Returns the sequence of strings that identifies the object - * adapter instance that is handling this request. - */ - readonly attribute AdapterName adapter_name ; - - /** - * Returns the repository id for the most derived interface of the - * servant. - */ - readonly attribute CORBA::RepositoryId - target_most_derived_interface; - - /** - * Returns the policy in effect for this operation for the given - * policy type. The returned CORBA.Policy object shall - * only be a policy whose type was registered via - * register_policy_factory. - * - * @param type The CORBA.PolicyType which specifies the - * policy to be returned. - * @return The CORBA.Policy obtained with the given - * policy type. - * @exception INV_POLICY thrown, with a standard minor code of 2, if - * a policy for the given type was not registered via - * register_policy_factory. - * @see ORBInitInfo#register_policy_factory - */ - CORBA::Policy get_server_policy - (in CORBA::PolicyType type); - - /** - * Allows an Interceptor to set a slot in the - * PortableInterceptor.Current that is in the scope of - * the request. If data already exists in that slot, it will be - * overwritten. - * - * @param id The id of the slot. - * @param data The data, in the form of an any, to store in that slot. - * @exception InvalidSlot thrown if the ID does not define an allocated - * slot. - * @see Current - */ - void set_slot (in SlotId id, in any data) raises (InvalidSlot); - - /** - * Returns true if the servant is the given repository id, - * false if it is not. - * - * @param id The caller wants to know if the servant is this - * repository id. - * @return Is the servant the given RepositoryId? - */ - boolean target_is_a (in CORBA::RepositoryId id); - - /** - * Allows Interceptors to add service contexts to the request. - *

            - * There is no declaration of the order of the service contexts. - * They may or may not appear in the order that they are added. - * - * @param service_context The IOP.ServiceContext to add to - * the reply. - * @param replace Indicates the behavior of this operation when a - * service context already exists with the given ID. If false, - * then BAD_INV_ORDER with a standard minor code of 15 - * is thrown. If true, then the existing service context is - * replaced by the new one. - * @exception BAD_INV_ORDER thrown, with a standard minor code of 15, if - * replace is false and a service context already exists with the - * given ID. - */ - void add_reply_service_context ( - in IOP::ServiceContext service_context, - in boolean replace); - }; - - /** - * Client-side request interceptor. - *

            - * A request Interceptor is designed to intercept the flow of a - * request/reply sequence through the ORB at specific points so that - * services can query the request information and manipulate the service - * contexts which are propagated between clients and servers. The primary - * use of request Interceptors is to enable ORB services to transfer - * context information between clients and servers. There are two types - * of request Interceptors: client-side and server-side. - *

            - * To write a client-side Interceptor, implement the - * ClientRequestInterceptor interface. - * - * @see ClientRequestInfo - */ - local interface ClientRequestInterceptor : Interceptor { - /** - * Allows an Interceptor to query request information and modify the - * service context before the request is sent to the server. - *

            - * This interception point may throw a system exception. If it does, - * no other Interceptors' send_request operations are called. - * Those Interceptors on the Flow Stack are popped and their - * receive_exception interception points are called. This - * interception point may also throw a ForwardRequest - * exception. If an Interceptor throws this exception, no other - * Interceptors' send_request operations are - * called. Those Interceptors on the Flow Stack are popped and their - * receive_other interception points are called. - *

            - * Compliant Interceptors shall properly follow completion_status - * semantics if they throw a system exception from this interception - * point. The completion_status shall be - * COMPLETED_NO. - * - * @param ri Information about the current request being intercepted. - * @exception ForwardRequest If thrown, indicates to the ORB that a - * retry of the request should occur with the new object given in - * the exception. - */ - void send_request (in ClientRequestInfo ri) raises (ForwardRequest); - - /** - * Allows an Interceptor to query information during a Time-Independent - * Invocation (TII) polling get reply sequence. - *

            - * With TII, an application may poll for a response to a request sent - * previously by the polling client or some other client. This poll is - * reported to Interceptors through the send_poll - * interception point and the response is returned through the - * receive_reply or receive_exception - * interception points. If the response is not available before the - * poll time-out expires, the system exception TIMEOUT is - * thrown and receive_exception is called with this - * exception. - *

            - * This interception point may throw a system exception. If it does, - * no other Interceptors' send_poll operations are - * called. Those Interceptors on the Flow Stack are popped and their - * receive_exception interception points are called. - *

            - * Compliant Interceptors shall properly follow - * completion_status semantics if they throw a system - * exception from this interception point. The completion_status shall be - * COMPLETED_NO. - * - * @param ri Information about the current request being intercepted. - * @exception TIMEOUT thrown if the response is not available before - * the poll time-out expires - */ - void send_poll (in ClientRequestInfo ri); - - /** - * Allows an Interceptor to query the information on a reply after it - * is returned from the server and before control is returned to the - * client. - *

            - * This interception point may throw a system exception. If it does, - * no other Interceptors' receive_reply operations are - * called. The remaining Interceptors in the Flow Stack shall have - * their receive_exception interception point called. - *

            - * Compliant Interceptors shall properly follow - * completion_status semantics if they throw a system - * exception from this interception point. The - * completion_status shall be COMPLETED_YES. - * - * @param ri Information about the current request being intercepted. - */ - void receive_reply (in ClientRequestInfo ri); - - /** - * Indicates to the interceptor that an exception occurred. Allows - * an Interceptor to query the exception's information before it is - * thrown to the client. - *

            - * This interception point may throw a system exception. This has the - * effect of changing the exception which successive Interceptors - * popped from the Flow Stack receive on their calls to - * receive_exception. The exception thrown to the client - * will be the last exception thrown by an Interceptor, or the original - * exception if no Interceptor changes the exception. - *

            - * This interception point may also throw a ForwardRequest - * exception. If an Interceptor throws this exception, no other - * Interceptors' receive_exception operations are called. - * The remaining Interceptors in the Flow Stack are popped and have their - * receive_other interception point called. - *

            - * If the completion_status of the exception is not - * COMPLETED_NO, then it is inappropriate for this - * interception point to throw a ForwardRequest exception. - * The request s at-most-once semantics would be lost. - *

            - * Compliant Interceptors shall properly follow - * completion_status semantics if they throw a system - * exception from this interception point. If the original exception is - * a system exception, the completion_status of the new - * exception shall be the same as on the original. If the original - * exception is a user exception, then the completion_status - * of the new exception shall be COMPLETED_YES. - *

            - * Under some conditions, depending on what policies are in effect, an - * exception (such as COMM_FAILURE) may result in a retry - * of the request. While this retry is a new request with respect to - * Interceptors, there is one point of correlation between the original - * request and the retry: because control has not returned to the - * client, the PortableInterceptor.Current for both the - * original request and the retrying request is the same. - * - * @param ri Information about the current request being intercepted. - * @exception ForwardRequest If thrown, indicates to the ORB that a - * retry of the request should occur with the new object given in - * the exception. - */ - void receive_exception (in ClientRequestInfo ri) raises (ForwardRequest); - - /** - * Allows an Interceptor to query the information available when a - * request results in something other than a normal reply or an - * exception. For example, a request could result in a retry - * (e.g., a GIOP Reply with a LOCATION_FORWARD status was - * received); or on asynchronous calls, the reply does not immediately - * follow the request, but control shall return to the client and an - * ending interception point shall be called. - *

            - * For retries, depending on the policies in effect, a new request may or - * may not follow when a retry has been indicated. If a new request does - * follow, while this request is a new request, with respect to - * Interceptors, there is one point of correlation between the original - * request and the retry: because control has not returned to the client, - * the request scoped PortableInterceptor.Current for both - * the original request and the retrying request is the same. - *

            - * This interception point may throw a system exception. If it does, no - * other Interceptors' receive_other operations are called. - * The remaining Interceptors in the Flow Stack are popped and have - * their receive_exception interception point called. - *

            - * This interception point may also throw a ForwardRequest - * exception. If an Interceptor throws this exception, successive - * Interceptors' receive_other operations are called with - * the new information provided by the ForwardRequest - * exception. - *

            - * Compliant Interceptors shall properly follow - * completion_status semantics if they throw a system - * exception from this interception point. The - * completion_status shall be COMPLETED_NO. - * If the target invocation had completed, this interception point - * would not be called. - * - * @param ri Information about the current request being intercepted. - * @exception ForwardRequest If thrown, indicates to the ORB that a - * retry of the request should occur with the new object given in - * the exception. - */ - void receive_other (in ClientRequestInfo ri) raises (ForwardRequest); - }; - - /** - * Server-side request interceptor. - *

            - * A request Interceptor is designed to intercept the flow of a - * request/reply sequence through the ORB at specific points so that - * services can query the request information and manipulate the service - * contexts which are propagated between clients and servers. The primary - * use of request Interceptors is to enable ORB services to transfer - * context information between clients and servers. There are two types - * of request Interceptors: client-side and server-side. - *

            - * To write a server-side Interceptor, implement the - * ServerRequestInterceptor interface. - * - * @see ServerRequestInfo - */ - local interface ServerRequestInterceptor : Interceptor { - /** - * Allows the interceptor to process service context information. - *

            - * At this interception point, Interceptors must get their service - * context information from the incoming request transfer it to - * PortableInterceptor.Current's slots. - *

            - * This interception point is called before the servant manager is called. - * Operation parameters are not yet available at this point. This - * interception point may or may not execute in the same thread as - * the target invocation. - *

            - * This interception point may throw a system exception. If it does, - * no other Interceptors' receive_request_service_contexts - * operations are called. Those Interceptors on the Flow Stack are - * popped and their send_exception interception points are - * called. - *

            - * This interception point may also throw a ForwardRequest - * exception. If an Interceptor throws this exception, no other - * Interceptors' receive_request_service_contexts operations - * are called. Those Interceptors on the Flow Stack are popped and - * their send_other interception points are called. - *

            - * Compliant Interceptors shall properly follow - * completion_status semantics if they throw a system - * exception from this interception point. The - * completion_status shall be COMPLETED_NO. - * - * @param ri Information about the current request being intercepted. - * @exception ForwardRequest If thrown, indicates to the ORB that a - * retry of the request should occur with the new object given in - * the exception. - */ - void receive_request_service_contexts (in ServerRequestInfo ri) - raises (ForwardRequest); - - /** - * Allows an Interceptor to query request information after all the - * information, including operation parameters, are available. This - * interception point shall execute in the same thread as the target - * invocation. - *

            - * In the DSI model, since the parameters are first available when - * the user code calls arguments, receive_request - * is called from within arguments. It is possible that - * arguments is not called in the DSI model. The target - * may call set_exception before calling - * arguments. The ORB shall guarantee that - * receive_request is called once, either through - * arguments or through set_exception. If it - * is called through set_exception, requesting the - * arguments will result in NO_RESOURCES being thrown with - * a standard minor code of 1. - *

            - * This interception point may throw a system exception. If it does, no - * other Interceptors' receive_request operations are - * called. Those Interceptors on the Flow Stack are popped and their - * send_exception interception points are called. - *

            - * This interception point may also throw a ForwardRequest - * exception. If an Interceptor throws this exception, no other - * Interceptors' receive_request operations are called. - * Those Interceptors on the Flow Stack are popped and their - * send_other interception points are called. - *

            - * Compliant Interceptors shall properly follow - * completion_status semantics if they throw a system - * exception from this interception point. The - * completion_status shall be COMPLETED_NO. - * - * @param ri Information about the current request being intercepted. - * @exception ForwardRequest If thrown, indicates to the ORB that a - * retry of the request should occur with the new object given in - * the exception. - */ - void receive_request (in ServerRequestInfo ri) raises (ForwardRequest); - - /** - * Allows an Interceptor to query reply information and modify the - * reply service context after the target operation has been invoked - * and before the reply is returned to the client. This interception - * point shall execute in the same thread as the target invocation. - *

            - * This interception point may throw a system exception. If it does, - * no other Interceptors' send_reply operations are called. - * The remaining Interceptors in the Flow Stack shall have their - * send_exception interception point called. - *

            - * Compliant Interceptors shall properly follow - * completion_status semantics if they throw a - * system exception from this interception point. The - * completion_status shall be COMPLETED_YES. - * - * @param ri Information about the current request being intercepted. - */ - void send_reply (in ServerRequestInfo ri); - - /** - * Allows an Interceptor to query the exception information and modify - * the reply service context before the exception is thrown to the client. - * When an exception occurs, this interception point is called. This - * interception point shall execute in the same thread as the target - * invocation. - *

            - * This interception point may throw a system exception. This has the - * effect of changing the exception which successive Interceptors - * popped from the Flow Stack receive on their calls to - * send_exception. The exception thrown to the client will - * be the last exception thrown by an Interceptor, or the original - * exception if no Interceptor changes the exception. - *

            - * This interception point may also throw a ForwardRequest - * exception. If an Interceptor throws this exception, no other - * Interceptors' send_exception operations are called. The - * remaining Interceptors in the Flow Stack shall have their - * send_other interception points called. - *

            - * If the completion_status of the exception is not - * COMPLETED_NO, then it is inappropriate for this - * interception point to throw a ForwardRequest exception. - * The request's at-most-once semantics would be lost. - *

            - * Compliant Interceptors shall properly follow - * completion_status semantics if they throw a system - * exception from this interception point. If the original exception - * is a system exception, the completion_status of the new - * exception shall be the same as on the original. If the original - * exception is a user exception, then the completion_status - * of the new exception shall be COMPLETED_YES. - * - * @param ri Information about the current request being intercepted. - * @exception ForwardRequest If thrown, indicates to the ORB that a - * retry of the request should occur with the new object given in - * the exception. - */ - void send_exception (in ServerRequestInfo ri) raises (ForwardRequest); - - /** - * Allows an Interceptor to query the information available when a - * request results in something other than a normal reply or an - * exception. For example, a request could result in a retry - * (e.g., a GIOP Reply with a LOCATION_FORWARD status was - * received). This interception point shall execute in the same thread - * as the target invocation. - *

            - * This interception point may throw a system exception. If it does, - * no other Interceptors' send_other operations are called. - * The remaining Interceptors in the Flow Stack shall have their - * send_exception interception points called. - *

            - * This interception point may also throw a ForwardRequest - * exception. If an Interceptor throws this exception, successive - * Interceptors' send_other operations are called with - * the new information provided by the ForwardRequest - * exception. - *

            - * Compliant Interceptors shall properly follow - * completion_status semantics if they throw a system - * exception from this interception point. The - * completion_status shall be COMPLETED_NO. - * - * @param ri Information about the current request being intercepted. - * @exception ForwardRequest If thrown, indicates to the ORB that a - * retry of the request should occur with the new object given in - * the exception. - */ - void send_other (in ServerRequestInfo ri) raises (ForwardRequest); - }; - - /** The object reference factory. This provides the capability of - * creating an object reference. - */ - abstract valuetype ObjectReferenceFactory { - /** make_object creates a CORBA object reference according - * to the data in this template, with the given repository ID and - * object ID. - */ - Object make_object( in string repositoryId, in ObjectId object_id ) ; - } ; - - /** The object reference template. An instance of this must - * exist for each object adapter created in an ORB. The server_id, - * orb_id, and adapter_name attributes uniquely identify this template - * within the scope of an IMR. Note that adapter_id is similarly unique - * within the same scope, but it is opaque, and less useful in many - * cases. - */ - abstract valuetype ObjectReferenceTemplate : ObjectReferenceFactory { - - readonly attribute ServerId server_id ; - - readonly attribute ORBId orb_id ; - - readonly attribute AdapterName adapter_name ; - } ; - - /** Sequence of object reference templates is used for reporting state - * changes that do not occur on the adapter manager. - */ - typedef sequence ObjectReferenceTemplateSeq ; - - /** Adapter manager identifier. Every object adapter has an adapter manager, - * indicated in this API only through the ID. A group of object adapter - * instances may share the same adapter manager, in which case state transitions - * reported for the adapter manager are observed by all object adapters with the - * same adapter manager ID. - */ - typedef long AdapterManagerId ; - - /** Type of object adapter state. State changes are reported either to - * the object adapter or to the adapter manager. - */ - typedef short AdapterState ; - - /** Object adapter state that holds requests temporarily until the - * state is changed. - */ - const AdapterState HOLDING = 0 ; - - /** Object adapter state that indicates normal request processing. - */ - const AdapterState ACTIVE = 1 ; - - /** Object adapter state that causes all requests to be discarded. - */ - const AdapterState DISCARDING = 2 ; - - /** Object adapter state that causes all requests to be discarded. - * This state indicates that the adapter is shutting down. - */ - const AdapterState INACTIVE = 3 ; - - /** Object adapter state indicating that the adapter has been destroyed. - */ - const AdapterState NON_EXISTENT = 4 ; - - /** - * Provides the server-side ORB service with access to the applicable - * policies during IOR construction and the ability to add components. - * The ORB passes an instance of its implementation of this interface as - * a parameter to IORInterceptor.establish_components. - * - * @see IORInterceptor - */ - local interface IORInfo { - - /** - * Allows an ORB service implementation to determine what server side - * policy of a particular type is in effect for an IOR being - * constructed. When the IOR being constructed is for an object - * implemented using a POA, all Policy objects passed to the - * PortableServer.POA.create_POA call that created that - * POA are accessable via get_effective_policy. - *

            - * If a policy for the given type is not known to the ORB, then this - * operation will throw INV_POLICY with a standard minor - * code of 2. - * - * @param type an int specifying the type of policy to return. - * @return The effective CORBA.Policy object of the - * requested type. If the given policy type is known, but no policy - * of that type is in effect, then this operation will return a - * nil object reference. - */ - CORBA::Policy get_effective_policy - (in CORBA::PolicyType type); - - /** - * A portable ORB service implementation calls - * add_ior_component from its implementation of - * establish_components to add a tagged component to the - * set which will be included when constructing IORs. The components in - * this set will be included in all profiles. - *

            - * Any number of components may exist with the same component ID. - * - * @param tagged_component The IOP.TaggedComponent to add. - */ - void add_ior_component - (in IOP::TaggedComponent tagged_component); - - /** - * A portable ORB service implementation calls - * add_ior_component_to_profile from its implementation of - * establish_components to add a tagged component to the - * set which will be included when constructing IORs. The components in - * this set will be included in the specified profile. - *

            - * Any number of components may exist with the same component ID. - * - * @param tagged_component The IOP.TaggedComponent to add. - * @param profile_id The profile id of the profile to - * which this component will be added. - * @exception BAD_PARAM thrown, with a standard minor code of 29, if the - * given profile ID does not define a known profile or it is - * impossible to add components to that profile. - */ - void add_ior_component_to_profile ( - in IOP::TaggedComponent tagged_component, - in IOP::ProfileId profile_id); - - /** Return the adapter manager id of the object adapter - * that was just created and is running IOR interceptors. - */ - readonly attribute AdapterManagerId manager_id ; - - /** Return the adapter state of the object adapter - * that was just created and is running IOR interceptors. - */ - readonly attribute AdapterState state ; - - /** Return the object reference template of the object adapter - * that was just created and is running IOR interceptors. - */ - readonly attribute ObjectReferenceTemplate adapter_template ; - - /** On read, returns the current factory that will be used to create - * object references for the object adapter that was just created - * and is running IOR interceptors. By default, this factory is the same - * as the value of the adapter_template attribute. The current_factory - * may also be set to another object reference template inside an - * IORInterceptor_3_0. - */ - attribute ObjectReferenceFactory current_factory ; - }; - - /** - * Interceptor used to establish tagged components in the profiles within - * an IOR. - *

            - * In some cases, a portable ORB service implementation may need to add - * information describing the server's or object's ORB service related - * capabilities to object references in order to enable the ORB service - * implementation in the client to function properly. - *

            - * This is supported through the IORInterceptor and - * IORInfo interfaces. - * - * @see IORInfo - */ - local interface IORInterceptor : Interceptor { - /** - * A server side ORB calls the establish_components - * operation on all registered IORInterceptor instances - * when it is assembling the list of components that will be included - * in the profile or profiles of an object reference. This operation - * is not necessarily called for each individual object reference. - * In the case of the POA, this operation is called each time POA::create_POA - * is called. In any case, establish_components is - * guaranteed to be called at least once for each distinct set of - * server policies. - *

            - * An implementation of establish_components must not - * throw exceptions. If it does, the ORB shall ignore the exception - * and proceed to call the next IOR Interceptor's - * establish_components operation. - * - * @param info The IORInfo instance used by the ORB - * service to query applicable policies and add components to be - * included in the generated IORs. - */ - void establish_components (in IORInfo info); - }; - - local interface IORInterceptor_3_0 : IORInterceptor { - /** The components_established method is invoked on all registered - * IORInterceptor_3_0 instances after establish_components - * has been invoked on all registered IORInterceptor instances. - * The adapter_template is available in info during this call. - * The current_factory may be get or set in info during this call. - *

            - * Any exception thrown from this method is handled by the Object - * Adapter that called this interceptor. In the case of the POA, - * an exception results in a OBJ_ADAPTER exception with an OMG - * standard minor code of 6. - * @param info The IORInfo for the object adapter being created. - */ - void components_established( in IORInfo info ) ; - - /** Called whenever the state of an adapter manager changes. - * For the POA, that is the POAManager. If the state change - * is reported through adapter_manager_state_changed, - * it is not reported through adapter_state_changed. - * @param id the adapter manager id of the adapter manager that - * changed state - * @param state the new state of the adapter manager - */ - void adapter_manager_state_changed( in AdapterManagerId id, - in AdapterState state ) ; - - /** Called whenever the state of an object adapter changes, and - * the state change is not caused by an adapter manager. Such - * changes are reported to all registered IORInterceptor_3_0 - * instances. - * @param templates the sequence of ObjectReferenceTemplate instances - * on which this state change occurred. - * @param state the new AdapterState shared by all of the templates. - */ - void adapter_state_changed( in ObjectReferenceTemplateSeq templates, - in AdapterState state ) ; - }; - - /** - * Enables policy types to be constructed using - * CORBA.ORB.create_policy. - *

            - * A portable ORB service implementation registers an instance of the - * PolicyFactory interface during ORB initialization in order - * to enable its policy types to be constructed using - * CORBA.ORB.create_policy. The POA is required to preserve - * any policy which is registered with ORBInitInfo in this - * manner. - * - * @see ORBInitInfo#register_policy_factory - */ - local interface PolicyFactory - { - /** - * Returns an instance of the appropriate interface derived from - * CORBA.Policy whose value corresponds to the - * specified any. - *

            - * The ORB calls create_policy on a registered - * PolicyFactory instance when - * CORBA.ORB.create_policy is called for the - * PolicyType under which the PolicyFactory has - * been registered. The create_policy operation then - * returns an instance of the appropriate interface derived from - * CORBA.Policy whose value corresponds to the specified - * any. If it cannot, it shall throw an exception as described for - * CORBA.ORB.create_policy. - * - * @param type An int specifying the type of policy being created. - * @param value An any containing data with which to construct the - * CORBA.Policy. - * @return A CORBA.Policy object of the specified type and - * value. - */ - CORBA::Policy create_policy - (in CORBA::PolicyType type, in any value) - raises (CORBA::PolicyError); - }; - - /** - * Passed to each ORBInitializer, allowing it to - * to register interceptors and perform other duties while the ORB is - * initializing. - *

            - * The ORBInitInfo object is only valid during - * ORB.init. If a service keeps a reference to its - * ORBInitInfo object and tries to use it after - * ORB.init returns, the object no longer exists and an - * OBJECT_NOT_EXIST exception shall be thrown. - * - * @see ORBInitializer - */ - local interface ORBInitInfo { - - /** Object id, represented as a String */ - typedef string ObjectId; - - /** - * Only one Interceptor of a given name can be registered with the - * ORB for each Interceptor type. If an attempt is made to register a - * second Interceptor with the same name, DuplicateName is thrown. - *

            - * An Interceptor may be anonymous, i.e., have an empty string as the - * name attribute. Any number of anonymous Interceptors may be - * registered with the ORB so, if the Interceptor being registered - * is anonymous, the registration operation will not throw - * DuplicateName. - */ - exception DuplicateName { - /** - * The name for which there was already an interceptor registered. - */ - string name; - }; - - /** - * This exception is thrown by - * register_initial_reference and - * resolve_initial_references. - * register_initial_reference throws InvalidName - * if: - *

              - *
            • this operation is called with an empty string id; or
            • - *
            • this operation is called with an id that is already registered, - * including the default names defined by OMG.
            • - *
            - * resolve_initial_references throws - * InvalidName if the name to be resolved is invalid. - */ - exception InvalidName {}; - - /** - * Returns the arguments passed to ORB.init. They may or - * may not contain the ORB's arguments. - */ - readonly attribute CORBA::StringSeq arguments; - - /** - * Returns the ID of the ORB being initialized. - */ - readonly attribute string orb_id; - - /** - * Returns the IOP.CodecFactory. The - * CodecFactory is normally obtained via a call to - * ORB.resolve_initial_references( "CodecFactory" ), but - * since the ORB is not yet available and Interceptors, particularly when - * processing service contexts, will require a Codec, a - * means of obtaining a Codec is necessary during ORB - * initialization. - */ - readonly attribute IOP::CodecFactory codec_factory; - - /** - * Identical to ORB.register_initial_reference. This same - * functionality exists here because the ORB, not yet fully initialized, - * is not yet available but initial references may need to be - * registered as part of Interceptor registration. The only difference - * is that the version of this operation on the ORB uses PIDL - * (CORBA.ORB.ObjectId) and - * (CORBA.ORB.InvalidName) whereas the version in this - * interface uses IDL defined in this interface; the semantics are - * identical. - */ - void register_initial_reference (in ObjectId id, in Object obj) - raises (InvalidName); - - // This was incorrectly returning void in orbos/99-12-02, correction - // from errata in orbos/00-01-01 - /** - * Identical to ORB.resolve_initial_references. This same - * functionality exists here because the ORB, not yet fully initialized, - * is not yet available but initial references may be required from the - * ORB as part of Interceptor registration. The only difference is that - * the version of this operation on the ORB uses PIDL - * (CORBA::ORB::ObjectId and - * CORBA::ORB::InvalidName) whereas the version in this - * interface uses IDL defined in this interface; the semantics - * are identical. - *

            - * This operation is only valid during post_init. - */ - Object resolve_initial_references (in ObjectId id) raises (InvalidName); - - /** - * Used to add a client-side request Interceptor to the list of - * client-side request Interceptors. - * - * @param interceptor The ClientRequestInterceptor to be - * added. - * @exception DuplicateName thrown if a client-side request Interceptor - * has already been registered with this Interceptor's name. - */ - void add_client_request_interceptor - (in ClientRequestInterceptor interceptor) - raises (DuplicateName); - - /** - * Used to add a server-side request Interceptor to the list of - * server-side request Interceptors. - * - * @param interceptor The ServerRequestInterceptor to be added. - * @exception DuplicateName thrown if a server-side request Interceptor - * has already been registered with this Interceptor's name - */ - void add_server_request_interceptor ( - in ServerRequestInterceptor interceptor) - raises (DuplicateName); - - /** - * Used to add an IOR Interceptor to the list of IOR Interceptors. - * - * @param interceptor The IORInterceptor to be added. - * @exception DuplicateName thrown if an IOR Interceptor has already - * been registered with this Interceptor's name. - */ - void add_ior_interceptor (in IORInterceptor interceptor) - raises (DuplicateName); - - /** - * Called to allocate a slot on PortableInterceptor.Current. - *

            - * Note that while slot id's can be allocated within an ORB initializer, - * the slots themselves cannot be initialized. - * - * @return The index to the slot which has been allocated. - * @exception BAD_INV_ORDER thrown, with a standard minor code of 14, if - * set_slot or get_slot is called on the - * PICurrent within an ORB initializer. - * @see Current - */ - SlotId allocate_slot_id (); - - /** - * Registers a PolicyFactory for the given - * PolicyType. - * - * @param type The policy type that the given PolicyFactory - * serves. - * @param policy_factory The factory for the given policy type. - * @exception BAD_INV_ORDER thrown, with a standard minor code of 16, if - * a PolicyFactory already exists for the given - * PolicyType. - */ - void register_policy_factory ( - in CORBA::PolicyType type, - in PolicyFactory policy_factory); - }; - - /** - * Facilitates interceptor registration and ORB initialization. - *

            - * Interceptors are intended to be a means by which ORB services gain - * access to ORB processing, effectively becoming part of the ORB. - * Since Interceptors are part of the ORB, when ORB.init - * returns an ORB, the Interceptors shall have been registered. - * Interceptors cannot be registered on an ORB after it has been - * returned by a call to ORB.init. - *

            - * An Interceptor is registered by registering an associated - * ORBInitializer object which implements the - * ORBInitializer interface. When an ORB is initializing, - * it shall call each registered ORBInitializer, passing it - * an ORBInitInfo object which is used to register its - * Interceptor. - *

            - * Registering ORB Initializers in Java - *

            - * ORBInitializers are registered via Java ORB properties. - *

            - * The property names are of the form: - *

            - * org.omg.PortableInterceptor.ORBInitializerClass.<Service> - *
            - * where <Service> is the string name of a class - * which implements - *
            - * org.omg.PortableInterceptor.ORBInitializer - *
            - * To avoid name collisions, the reverse DNS name convention should be - * used. For example, if company X has three initializers, it could define - * the following properties: - *
              - *
            • - * org.omg.PortableInterceptor.ORBInitializerClass.com.x.Init1 - *
            • - *
            • - * org.omg.PortableInterceptor.ORBInitializerClass.com.x.Init2 - *
            • - *
            • - * org.omg.PortableInterceptor.ORBInitializerClass.com.x.Init3 - *
            • - *
            - * During ORB.init, these ORB properties which begin with - * org.omg.PortableInterceptor.ORBInitializerClass shall be - * collected, the <Service> portion of each property - * shall be extracted, an object shall be instantiated with the - * <Service> string as its class name, and the - * pre_init and post_init methods shall be - * called on that object. If there are any exceptions, the ORB shall - * ignore them and proceed. - *

            - * Example - *

            - * A client-side logging service written by company X, for example, may - * have the following ORBInitializer implementation: - *

            
            -   * package com.x.logging;
            -   * 
            -   * import org.omg.PortableInterceptor.Interceptor; 
            -   * import org.omg.PortableInterceptor.ORBInitializer; 
            -   * import org.omg.PortableInterceptor.ORBInitInfo; 
            -   * 
            -   * public class LoggingService implements ORBInitializer { 
            -   *     void pre_init( ORBInitInfo info ) { 
            -   *         // Instantiate the Logging Service s Interceptor. 
            -   *         Interceptor interceptor = new LoggingInterceptor(); 
            -   *
            -   *         // Register the Logging Service s Interceptor. 
            -   *         info.add_client_request_interceptor( interceptor ); 
            -   *     } 
            -   * 
            -   *     void post_init( ORBInitInfo info ) { 
            -   *         // This service does not need two init points. 
            -   *     } 
            -   * } 
            -   * 
            - * To run a program called MyApp using this logging - * service, the user could type: - *
            - * java - *-Dorg.omg.PortableInterceptor.ORBInitializerClass.com.x.Logging.LoggingService - * MyApp - *
            - *

            - * Notes about Registering Interceptors - *

            - * Request Interceptors are registered on a per-ORB basis. - *

            - * To achieve virtual per-object Interceptors, query the policies on the - * target from within the interception points to determine whether they - * should do any work. - *

            - * To achieve virtual per-POA Interceptors, instantiate each POA with a - * different ORB. While Interceptors may be ordered administratively, - * there is no concept of order with respect to the registration of - * Interceptors. Request Interceptors are concerned with service contexts. - * Service contexts have no order, so there is no purpose for request - * Interceptors to have an order. IOR Interceptors are concerned with - * tagged components. Tagged components also have no order, so there - * is no purpose for IOR Interceptors to have an order. - *

            - * Registration code should avoid using the ORB (i.e., calling - * ORB.init with the provided orb_id). Since - * registration occurs during ORB initialization, results of invocations - * on this ORB while it is in this state are undefined. - * - * @see ORBInitInfo - */ - local interface ORBInitializer { - - /** - * Called during ORB initialization. If it is expected that initial - * services registered by an interceptor will be used by other - * interceptors, then those initial services shall be registered at - * this point via calls to - * ORBInitInfo.register_initial_reference. - * - * @param info provides initialization attributes and operations by - * which Interceptors can be registered. - */ - void pre_init (in ORBInitInfo info); - - /** - * Called during ORB initialization. If a service must resolve initial - * references as part of its initialization, it can assume that all - * initial references will be available at this point. - *

            - * Calling the post_init operations is not the final - * task of ORB initialization. The final task, following the - * post_init calls, is attaching the lists of registered - * interceptors to the ORB. Therefore, the ORB does not contain the - * interceptors during calls to post_init. If an - * ORB-mediated call is made from within post_init, no - * request interceptors will be invoked on that call. - * Likewise, if an operation is performed which causes an IOR to be - * created, no IOR interceptors will be invoked. - * - * @param info provides initialization attributes and - * operations by which Interceptors can be registered. - */ - void post_init (in ORBInitInfo info); - }; -}; diff --git a/src/java.corba/share/classes/org/omg/PortableInterceptor/Messaging.idl b/src/java.corba/share/classes/org/omg/PortableInterceptor/Messaging.idl deleted file mode 100644 index 32690f54fd3..00000000000 --- a/src/java.corba/share/classes/org/omg/PortableInterceptor/Messaging.idl +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#ifndef _MESSAGING_IDL_ -#define _MESSAGING_IDL_ - -#pragma prefix "omg.org" - -module Messaging { - - /** Synchronization scope */ - typedef short SyncScope; - - /** - * Constant, defined in the Messaging spec, to define how far the - * request shall progress before control is returned to the client. - */ - const SyncScope SYNC_WITH_TRANSPORT = 1; -}; - -#endif // _MESSAGING_IDL_ - diff --git a/src/java.corba/share/classes/org/omg/PortableInterceptor/ORBInitInfoPackage/package.html b/src/java.corba/share/classes/org/omg/PortableInterceptor/ORBInitInfoPackage/package.html deleted file mode 100644 index 9c4034ed013..00000000000 --- a/src/java.corba/share/classes/org/omg/PortableInterceptor/ORBInitInfoPackage/package.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - -

            This package contains the exceptions and typedefs from the ORBInitInfo -local interface of the PortableInterceptor module specified in the OMG -Portable Interceptor specification, - -ptc/2000-08-06, section 21.7.2. Please -refer to that OMG specification for further details. - - -

            Package Specification

            - -

            For a precise list of supported sections of official specifications with which -the Java[tm] Platform, Standard Edition 6 ORB complies, see Official Specifications for CORBA -support in Java SE 6. - -@since 1.4 -
            -@serial exclude - - diff --git a/src/java.corba/share/classes/org/omg/PortableInterceptor/package.html b/src/java.corba/share/classes/org/omg/PortableInterceptor/package.html deleted file mode 100644 index f35c5347b3f..00000000000 --- a/src/java.corba/share/classes/org/omg/PortableInterceptor/package.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - -Provides a mechanism to register ORB hooks through which ORB services -can intercept the normal flow of execution of the ORB. - -

            Interceptor Types

            -There are currently three types of interceptors that can be registered: -
              -
            • {@link org.omg.PortableInterceptor.IORInterceptor IORInterceptor} - - Used to establish tagged components in the profiles within an IOR.
            • -
            • {@link org.omg.PortableInterceptor.ClientRequestInterceptor -ClientRequestInterceptor} - - Intercepts the flow of a request/reply sequence through the ORB on - the client side.
            • -
            • {@link org.omg.PortableInterceptor.ServerRequestInterceptor -ServerRequestInterceptor} - - Intercepts the flow of a request/reply sequence through the ORB on - the server side.
            • -
            -See the javadocs for class -{@link org.omg.PortableInterceptor.ORBInitializer ORBInitializer} -for how to go about registering interceptors. - - -

            Known limitations / unimplemented methods in package -org.omg.PortableInterceptor

            - -
              -
            • - RequestInfo -
                -
              • sync_scope(): Always returns SYNC_WITH_TRANSPORT
              • -
              • arguments(): Only supported for DII/DSI calls
              • -
              • exceptions(): Only supported for DII calls on client side. - Not supported on server-side.
              • -
              • contexts(): Only supported for DII calls on client side. - Not supported on server-side since our ORB does not send contexts. -
              • -
              • operation_context(): Only supported for DII calls - on client side. Not supported on server-side since ORB - does not send contexts.
              • -
              • result(): Only supported for DII/DSI calls
              • -
              -
            • -
            • - ClientRequestInfo -
                -
              • received_exception_id(): Always returns null in the - DII case
              • -
              • get_request_policy(int type): Not implemented.
              • -
              -
            • -
            • - ServerRequestInfo -
                -
              • sending_exception(): Does not support user exceptions on - the server side in non-DSI case.
              • -
              -
            • -
            - -

            Package Specification

            -

            For a precise list of supported sections of official OMG specifications with which -the Java[tm] Platform, Standard Edition 6 complies, see Official Specifications for CORBA -support in Java SE 6. - -@since 1.4 -
            -@serial exclude - - diff --git a/src/java.corba/share/classes/org/omg/PortableServer/CurrentHelper.java b/src/java.corba/share/classes/org/omg/PortableServer/CurrentHelper.java deleted file mode 100644 index 82ec7788fcb..00000000000 --- a/src/java.corba/share/classes/org/omg/PortableServer/CurrentHelper.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.PortableServer; - - -/** -* org/omg/PortableServer/CurrentHelper.java . -* Generated by the IDL-to-Java compiler (portable), version "3.1" -* from ../../../../src/share/classes/org/omg/PortableServer/poa.idl -* Tuesday, October 23, 2001 1:17:01 PM PDT -*/ - - -/** - * The PortableServer::Current interface, derived from - * CORBA::Current, provides method implementations with - * access to the identity of the object on which the - * method was invoked. The Current interface is provided - * to support servants that implement multiple objects, - * but can be used within the context of POA-dispatched - * method invocations on any servant. To provide location - * transparency, ORBs are required to support use of - * Current in the context of both locally and remotely - * invoked operations. An instance of Current can be - * obtained by the application by issuing the - * CORBA::ORB::resolve_initial_references("POACurrent") - * operation. Thereafter, it can be used within the - * context of a method dispatched by the POA to obtain - * the POA and ObjectId that identify the object on - * which that operation was invoked. - */ -abstract public class CurrentHelper -{ - private static String _id = "IDL:omg.org/PortableServer/Current:2.3"; - - public static void insert (org.omg.CORBA.Any a, - org.omg.PortableServer.Current that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static org.omg.PortableServer.Current extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc ( - org.omg.PortableServer.CurrentHelper.id (), "Current"); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static org.omg.PortableServer.Current read ( - org.omg.CORBA.portable.InputStream istream) - { - throw new org.omg.CORBA.MARSHAL (); - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, - org.omg.PortableServer.Current value) - { - throw new org.omg.CORBA.MARSHAL (); - } - - public static org.omg.PortableServer.Current narrow ( - org.omg.CORBA.Object obj) - { - if (obj == null) - return null; - else if (obj instanceof org.omg.PortableServer.Current) - return (org.omg.PortableServer.Current)obj; - else if (!obj._is_a (id ())) - throw new org.omg.CORBA.BAD_PARAM (); - return null; - } - -} diff --git a/src/java.corba/share/classes/org/omg/PortableServer/CurrentPackage/package.html b/src/java.corba/share/classes/org/omg/PortableServer/CurrentPackage/package.html deleted file mode 100644 index cb3380286f7..00000000000 --- a/src/java.corba/share/classes/org/omg/PortableServer/CurrentPackage/package.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - -

            Provides method implementations with - access to the identity of the object on which the - method was invoked. The Current package - supports servants that implement multiple objects, - but can be used within the context of POA-dispatched - method invocations on any servant. To provide location - transparency, ORBs are required to support use of - Current in the context of both locally and remotely - invoked operations. An instance of Current can be - obtained by the application by issuing the - CORBA::ORB::resolve_initial_references("POACurrent") - operation. Thereafter, it can be used within the - context of a method dispatched by the POA to obtain - the POA and ObjectId that identify the object on - which that operation was invoked. - -

            Package Specification

            - -

            For a precise list of supported sections of official specifications with which -the Java[tm] Platform, Standard Edition 6 ORB complies, see Official Specifications for CORBA -support in Java[tm] SE 6. - -@since 1.4 -
            -@serial exclude - - diff --git a/src/java.corba/share/classes/org/omg/PortableServer/DynamicImplementation.java b/src/java.corba/share/classes/org/omg/PortableServer/DynamicImplementation.java deleted file mode 100644 index aaac51ea6be..00000000000 --- a/src/java.corba/share/classes/org/omg/PortableServer/DynamicImplementation.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.PortableServer; - -/** - * Allows dynamic handling of object invocations. POA-based DSI - * servants inherit from the - * standard DynamicImplementation class, this class inherits - * from the Servant class. Based on IDL to Java spec. - * CORBA V 2.3.1 ptc/00-01-08.pdf. - */ -abstract public class DynamicImplementation extends Servant { - -/** - * Receives requests issued to any CORBA object - * incarnated by the DSI servant and performs the processing - * necessary to execute the request. - * @param request the request issued to the CORBA object. - */ - abstract public void invoke(org.omg.CORBA.ServerRequest request); -} diff --git a/src/java.corba/share/classes/org/omg/PortableServer/POAHelper.java b/src/java.corba/share/classes/org/omg/PortableServer/POAHelper.java deleted file mode 100644 index 7a376894879..00000000000 --- a/src/java.corba/share/classes/org/omg/PortableServer/POAHelper.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.PortableServer; - -/** -* org/omg/PortableServer/POAHelper.java . -* Generated by the IDL-to-Java compiler (portable), version "3.1" -* from ../../../../src/share/classes/org/omg/PortableServer/poa.idl -* Tuesday, October 23, 2001 1:16:58 PM PDT -*/ - - -/** - * A POA object manages the implementation of a - * collection of objects. The POA supports a name space - * for the objects, which are identified by Object Ids. - * A POA also provides a name space for POAs. A POA is - * created as a child of an existing POA, which forms a - * hierarchy starting with the root POA. A POA object - * must not be exported to other processes, or - * externalized with ORB::object_to_string. - */ -abstract public class POAHelper -{ - private static String _id = "IDL:omg.org/PortableServer/POA:2.3"; - - public static void insert (org.omg.CORBA.Any a, - org.omg.PortableServer.POA that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static org.omg.PortableServer.POA extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (org.omg.PortableServer.POAHelper.id (), "POA"); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static org.omg.PortableServer.POA read ( - org.omg.CORBA.portable.InputStream istream) - { - throw new org.omg.CORBA.MARSHAL (); - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, - org.omg.PortableServer.POA value) - { - throw new org.omg.CORBA.MARSHAL (); - } - - public static org.omg.PortableServer.POA narrow (org.omg.CORBA.Object obj) - { - if (obj == null) - return null; - else if (obj instanceof org.omg.PortableServer.POA) - return (org.omg.PortableServer.POA)obj; - else if (!obj._is_a (id ())) - throw new org.omg.CORBA.BAD_PARAM (); - return null; - } -} diff --git a/src/java.corba/share/classes/org/omg/PortableServer/POAManagerPackage/package.html b/src/java.corba/share/classes/org/omg/PortableServer/POAManagerPackage/package.html deleted file mode 100644 index 7bdbaec5455..00000000000 --- a/src/java.corba/share/classes/org/omg/PortableServer/POAManagerPackage/package.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - -

            -Encapsulates the processing - state of the POAs it is associated with. Each POA object has an associated POAManager object. A POA manager may be associated with one or more - POA objects. - - -

            Package Specification

            - -

            For a precise list of supported sections of official specifications with which -the Java[tm] Platform, Standard Edition 6 ORB complies, see Official Specifications for CORBA -support in Java[tm] SE 6. - -@since 1.4 -
            -@serial exclude - - diff --git a/src/java.corba/share/classes/org/omg/PortableServer/POAPackage/package.html b/src/java.corba/share/classes/org/omg/PortableServer/POAPackage/package.html deleted file mode 100644 index 3cda2fb0fb0..00000000000 --- a/src/java.corba/share/classes/org/omg/PortableServer/POAPackage/package.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - -

            Allows programmers to construct object implementations that are portable -between different ORB products. - -

            The Portable Object Adaptor (POA) is designed to meet the following goals: -

              -
            • Allow programmers to construct object implementations that are portable between different ORB products. -
            • Provide support for objects with persistent identities. -
            • Provide support for transparent activation of objects. -
            • Allow a single servant to support multiple object identities simultaneously. -
            - - - -

            Given an interface My defined in My.idl, the file MyPOA.java -is generated by the idlj compiler. You must provide -the implementation for My and it must inherit from MyPOA. - -

            MyPOA.java is a stream-based skeleton that extends -org.omg.PortableServer.Servant and implements the InvokeHandler -interface and the operations interface associated with the IDL interface the skeleton implements. - -

            The PortableServer module for the Portable Object Adapter (POA) -defines the native Servant type. In the Java programming language, -the Servant type is mapped to the Java org.omg.PortableServer.Servant class. -It serves as the base class for all POA servant implementations -and provides a number of methods that may be invoked by the application programmer, -as well as methods which are invoked by the POA itself -and may be overridden by the user to control aspects of servant behavior. - - - -

            All Mapping corresponds to the Chapter 11 of - CORBA V2.3.1 specified by OMG document formal/99-10-07.pdf. - The exception to this is the id attribute, which is added in ptc/00-08-06, - section 11.3.8.26. - -

            Package Specification

            - -

            For a precise list of supported sections of official specifications with which -the Java[tm] Platform, Standard Edition 6, ORB complies, see Official Specifications for CORBA -support in Java[tm] SE 6. - -@since 1.4 -
            -@serial exclude - - diff --git a/src/java.corba/share/classes/org/omg/PortableServer/Servant.java b/src/java.corba/share/classes/org/omg/PortableServer/Servant.java deleted file mode 100644 index de960bbee66..00000000000 --- a/src/java.corba/share/classes/org/omg/PortableServer/Servant.java +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.PortableServer; - -import org.omg.CORBA.ORB; -import org.omg.PortableServer.portable.Delegate; - -/** - * Defines the native Servant type. In Java, the - * Servant type is mapped to the Java - * org.omg.PortableServer.Servant class. - * It serves as the base class for all POA servant - * implementations and provides a number of methods that may - * be invoked by the application programmer, as well as methods - * which are invoked by the POA itself and may be overridden by - * the user to control aspects of servant behavior. - * Based on IDL to Java spec. (CORBA V2.3.1) ptc/00-01-08.pdf. - */ - -abstract public class Servant { - - private transient Delegate _delegate = null; - /** - * Gets the ORB vendor-specific implementation of - * PortableServer::Servant. - * @return _delegate the ORB vendor-specific - * implementation of PortableServer::Servant. - */ - final public Delegate _get_delegate() { - if (_delegate == null) { - throw - new - org.omg.CORBA.BAD_INV_ORDER - ("The Servant has not been associated with an ORB instance"); - } - return _delegate; - } - - /** - * Supports the Java ORB portability - * interfaces by providing a method for classes that support - * ORB portability through delegation to set their delegate. - * @param delegate ORB vendor-specific implementation of - * the PortableServer::Servant. - */ - final public void _set_delegate(Delegate delegate) { - _delegate = delegate; - } - - /** - * Allows the servant to obtain the object reference for - * the target CORBA object it is incarnating for that request. - * @return this_object Object reference - * associated with the request. - */ - final public org.omg.CORBA.Object _this_object() { - return _get_delegate().this_object(this); - } - - /** - * Allows the servant to obtain the object reference for - * the target CORBA Object it is incarnating for that request. - * @param orb ORB with which the servant is associated. - * @return _this_object reference associated with the request. - */ - final public org.omg.CORBA.Object _this_object(ORB orb) { - try { - ((org.omg.CORBA_2_3.ORB)orb).set_delegate(this); - } - catch(ClassCastException e) { - throw - new - org.omg.CORBA.BAD_PARAM - ("POA Servant requires an instance of org.omg.CORBA_2_3.ORB"); - } - return _this_object(); - } - - /** - * Returns the instance of the ORB - * currently associated with the Servant (convenience method). - * @return orb the instance of the ORB currently - * associated with the Servant. - */ - final public ORB _orb() { - return _get_delegate().orb(this); - } - - /** - * Allows easy execution of common methods, equivalent to - * PortableServer::Current:get_POA. - * @return poa POA associated with the servant. - */ - final public POA _poa() { - return _get_delegate().poa(this); - } - - /** - * Allows easy execution of - * common methods, equivalent - * to calling PortableServer::Current::get_object_id. - * @return object_id the Object ID associated - * with this servant. - */ - final public byte[] _object_id() { - return _get_delegate().object_id(this); - } - - /** - * Returns the - * root POA from the ORB instance associated with the servant. - * Subclasses may override this method to return a different POA. - * @return default_POA the POA associated with the - * Servant. - */ - public POA _default_POA() { - return _get_delegate().default_POA(this); - } - - /** - * Checks to see if the specified repository_id is present - * on the list returned by _all_interfaces() or is the - * repository_id for the generic CORBA Object. - * @param repository_id the repository_id - * to be checked in the repository list or against the id - * of generic CORBA objects. - * @return is_a boolean indicating whether the specified - * repository_id is - * in the repository list or is same as a generic CORBA - * object. - */ - public boolean _is_a(String repository_id) { - return _get_delegate().is_a(this, repository_id); - } - - /** - * Checks for the existence of an - * Object. - * The Servant provides a default implementation of - * _non_existent() that can be overridden by derived servants. - * @return non_existent true if that object does - * not exist, false otherwise. - */ - public boolean _non_existent() { - return _get_delegate().non_existent(this); - } - - // Ken and Simon will ask about editorial changes - // needed in IDL to Java mapping to the following - // signature. - /** - * Returns an object in the Interface Repository - * which provides type information that may be useful to a program. - * Servant provides a default implementation of - * _get_interface() - * that can be overridden by derived servants if the default - * behavior is not adequate. - * @return get_interface type information that corresponds to this servant. - */ - /* - public org.omg.CORBA.Object _get_interface() { - return _get_delegate().get_interface(this); - } - */ - - // _get_interface_def() replaces the _get_interface() method - - /** - * Returns an InterfaceDef object as a - * CORBA::Object that defines the runtime type of the - * CORBA::Object implemented by the Servant. - * The invoker of _get_interface_def - * must narrow the result to an InterfaceDef in order - * to use it. - *

            This default implementation of _get_interface_def() - * can be overridden - * by derived servants if the default behavior is not adequate. - * As defined in the CORBA 2.3.1 specification, section 11.3.1, the - * default behavior of _get_interface_def() is to use - * the most derived - * interface of a static servant or the most derived interface retrieved - * from a dynamic servant to obtain the InterfaceDef. - * This behavior must - * be supported by the Delegate that implements the - * Servant. - * @return get_interface_def an InterfaceDef - * object as a - * CORBA::Object that defines the runtime type of the - * CORBA::Object implemented by the Servant. - */ - public org.omg.CORBA.Object _get_interface_def() - { - // First try to call the delegate implementation class's - // "Object get_interface_def(..)" method (will work for ORBs - // whose delegates implement this method). - // Else call the delegate implementation class's - // "InterfaceDef get_interface(..)" method using reflection - // (will work for ORBs that were built using an older version - // of the Delegate interface with a get_interface method - // but not a get_interface_def method). - - org.omg.PortableServer.portable.Delegate delegate = _get_delegate(); - try { - // If the ORB's delegate class does not implement - // "Object get_interface_def(..)", this will throw - // an AbstractMethodError. - return delegate.get_interface_def(this); - } catch( AbstractMethodError aex ) { - // Call "InterfaceDef get_interface(..)" method using reflection. - try { - Class[] argc = { org.omg.PortableServer.Servant.class }; - java.lang.reflect.Method meth = - delegate.getClass().getMethod("get_interface", argc); - Object[] argx = { this }; - return (org.omg.CORBA.Object)meth.invoke(delegate, argx); - } catch( java.lang.reflect.InvocationTargetException exs ) { - Throwable t = exs.getTargetException(); - if (t instanceof Error) { - throw (Error) t; - } else if (t instanceof RuntimeException) { - throw (RuntimeException) t; - } else { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - } catch( RuntimeException rex ) { - throw rex; - } catch( Exception exr ) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - } - } - - // methods for which the user must provide an - // implementation - /** - * Used by the ORB to obtain complete type - * information from the servant. - * @param poa POA with which the servant is associated. - * @param objectId is the id corresponding to the object - * associated with this servant. - * @return list of type information for the object. - */ - abstract public String[] _all_interfaces( POA poa, byte[] objectId); -} diff --git a/src/java.corba/share/classes/org/omg/PortableServer/ServantLocatorPackage/CookieHolder.java b/src/java.corba/share/classes/org/omg/PortableServer/ServantLocatorPackage/CookieHolder.java deleted file mode 100644 index 76c8030f649..00000000000 --- a/src/java.corba/share/classes/org/omg/PortableServer/ServantLocatorPackage/CookieHolder.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package org.omg.PortableServer.ServantLocatorPackage; - -/** - * The native type PortableServer::ServantLocator::Cookie is mapped - * to java.lang.Object. A CookieHolder class is provided for passing - * the Cookie type as an out parameter. The CookieHolder class - * follows exactly the same pattern as the other holder classes - * for basic types. - */ - -final public class CookieHolder implements org.omg.CORBA.portable.Streamable -{ - public java.lang.Object value; - - public CookieHolder() { } - - public CookieHolder(java.lang.Object initial) { - value = initial; - } - - public void _read( org.omg.CORBA.portable.InputStream is) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - public void _write( org.omg.CORBA.portable.OutputStream os) { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } - - public org.omg.CORBA.TypeCode _type() { - throw new org.omg.CORBA.NO_IMPLEMENT(); - } -} diff --git a/src/java.corba/share/classes/org/omg/PortableServer/ServantLocatorPackage/package.html b/src/java.corba/share/classes/org/omg/PortableServer/ServantLocatorPackage/package.html deleted file mode 100644 index a409400e59d..00000000000 --- a/src/java.corba/share/classes/org/omg/PortableServer/ServantLocatorPackage/package.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - -Provides classes and interfaces for locating the servant. - -

            This package supplies a CookieHolder class for passing -the Cookie type as an out parameter. The CookieHolder class -follows exactly the same pattern as the other holder classes for basic types. - -

            Package Specification

            - -

            For a precise list of supported sections of official OMG specifications with which -the Java[tm] Platform, Standard Edition 6 complies, see Official Specifications for CORBA -support in Java[tm] SE 6. - -@since 1.4 -
            -@serial exclude - - diff --git a/src/java.corba/share/classes/org/omg/PortableServer/corba.idl b/src/java.corba/share/classes/org/omg/PortableServer/corba.idl deleted file mode 100644 index 6d0a028fb65..00000000000 --- a/src/java.corba/share/classes/org/omg/PortableServer/corba.idl +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -// minimal definitions to keep idltojava happy while compiling poa.idl -#pragma prefix "omg.org" - -module CORBA { - - typedef string Identifier; - typedef string RepositoryId; - - // basic Policy definition - typedef unsigned long PolicyType ; - - /** The Policy interface provides a mechanism for ORBs and Object - * Services to allow access to certain choices that affect their - * operation. This information is accessed in a structured manner - * using interfaces derived from the org.omg.CORBA.Policy interface. - */ - interface Policy { - /** Return the constant value that corresponds to the - * type of the policy object. The values of - * the polivy objectys are allocated by the OMG. - * New values for PolicyType should be obtained from the OMG by - * sending mail to request@omg.org. In general the constant - * values that are allocated are defined in conjunction with - * the definition of the corresponding policy object. - * @return the constant value that corresponds to the type of - * the policy object. - */ - readonly attribute PolicyType policy_type; - - /** Copies the policy object. The copy does not retain any - * relationships that the policy had with any domain or object. - * @return the copy of the policy object. - */ - Policy copy( ); - - /** Destroys the policy object. It is the responsibility of - * the policy object to determine whether it can be destroyed. - */ - void destroy( ); - }; - - typedef sequence PolicyList; - - /** - * An interface that makes it possible to access information - * associated with a particular thread of execution, such as - * security information or a transaction identifier. - *

            - * An ORB or CORBA service that needs its own thread-specific - * state extends the CORBA package's Current. - * Users of the service can obtain an instance of the appropriate - * Current interface by invoking - * ORB.resolve_initial_references. - * For example, the Security service obtains the Current - * relevant to it by invoking - *

            -	 *    ORB.resolve_initial_references("SecurityCurrent");
            -	 * 
            - *

            - * A CORBA service does not have to use this method of keeping context - * but may choose to do so. - *

            - * Methods on classes that implement from Current access state - * associated with the thread in which they are invoked, not state associated - * with the thread from which the Current was obtained. - * Current objects must not be exported to other processes, or externalized - * with ORB.object_to_string. If any attempt is made to do so, the offending - * operation will raise a MARSHAL system exception. - * @see portable - * package comments for unimplemented features - */ - interface Current { }; -}; - - diff --git a/src/java.corba/share/classes/org/omg/PortableServer/package.html b/src/java.corba/share/classes/org/omg/PortableServer/package.html deleted file mode 100644 index ab441f9cee8..00000000000 --- a/src/java.corba/share/classes/org/omg/PortableServer/package.html +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - -Provides classes and interfaces for making the server side of your applications -portable across multivendor ORBs. - -

            In Java, Portable Object Adaptor (POA)-based Dynamic Skeleton Interface (DSI) -servants inherit from the standard DynamicImplementation class, which -inherits from the Servant class. The native Servant type is -defined by the PortableServer module for the POA. In Java, the - Servant type is mapped to the Java - org.omg.PortableServer.Servant class. - It serves as the base class for all POA servant - implementations and provides a number of methods that may - be invoked by the application programmer, as well as methods - which are invoked by the POA itself and may be overridden by - the user to control aspects of servant behavior. - -

            Package Specification

            - -

            For a precise list of supported sections of official OMG specifications with which -the Java[tm] Platform, Standard Edition 6 complies, see Official Specifications for CORBA -support in Java[tm] SE 6. - -

            POA-related Interfaces

            - -

            The PortableServer module defines the following POA-related interfaces: -

              -
            • POA -
            • POAManager -
            • ServantManager -
            • ServantActivator -
            • ServantLocator -
            • AdapterActivator -
            • ThreadPolicy -
            • LifespanPolicy -
            • IdUniquenessPolicy -
            • IdAssignmentPolicy -
            • ImplicitActivationPolicy -
            • ServantRetentionPolicy -
            • RequestProcessingPolicy -
            • Current -
            - -

            In addition, the POA defines the Servant native type. - -

            Operations classes

            - -

            Each of the interfaces listed above has an associated Operations interface. -The Operations interface is generated by the idlj compiler and -contains the method signatures for methods defined in its associated interface. -The Operations interface can be accessed by both the client and the server, -while its associated interface can only be called by the client. - -

            Value Classes

            - -Classes ending in the suffix PolicyValue provide the values used -for the create_POA call, which sets the policy for the POA. See -the sample code below for a demonstration. -PolicyValue files include the following: -
              -
            • IdAssignmentPolicyValue -
            • IdUniquenessPolicyValue -
            • ImplicitActivationPolicyValue -
            • LifespanPolicyValue -
            • RequestProcessingPolicyValue -
            • ServantRetentionPolicyValue -
            • ThreadPolicyValue -
            - -

            Helper Classes

            - -

            Helper classes, which are generated for all user-defined types in an OMG IDL -interface, supply static methods needed to manipulate those types. -There is only one method in a helper class that an application programmer uses: -the narrow method. Only Java interfaces mapped from IDL interfaces -will have a helper class that includes a narrow method, so in -the PortableServer package, only the following classes have a narrow method: -

              -
            • ForwardRequestHelper -
            • ServantActivatorHelper -
            • ServantLocatorHelper -
            - -

            POA Classes

            - -

            POA classes are used to implement the ServantActivator or ServantLocator. - -

            Exceptions

            - -

            The ForwardRequest exception indicates to the ORB -that it is responsible for delivering the current request and -subsequent ForwardRequest requests to the object denoted in the -forward_reference member of the exception. - -

            Interfaces Implemented by the Application Programmer

            - -

            Most of what PortableServer does is transparent to the user. -The result is that programmers will use only a few of the interfaces mentioned above. -The remaining interfaces will be provided by the ORB implementation. -The interfaces of interest to application programmers are the following: -

              -
            • AdapterActivator -

              Adapter activators are associated with POAs. - An adapter activator supplies a POA with the ability to create child POAs on demand, - as a side-effect of receiving a request that names the child POA (or one of its children), - or when find_POA is called with an activate parameter value of TRUE. - An application server that creates all its needed POAs at the beginning of execution - does not need to use or provide an adapter activator; it is necessary - only for the case in which POAs need to be created during request processing. -

            • ServantLocator -

              When the POA has the NON_RETAIN policy, - it uses servant managers that are ServantLocators. -

            • ServantActivator -

              When the POA has the RETAIN policy, - it uses servant managers that are ServantActivators. -

            - - -

            Package org.omg.PortableServer.ServantLocatorPackage

            - -

            This package supplies a CookieHolder class for passing -the Cookie type as an out parameter. The CookieHolder class -follows exactly the same pattern as the other holder classes for basic types. - -

            Related Documentation

            - -

            For an overview of Java IDL, please see: -{@extLink idl_guides Java IDL home page}. - -

            Example Code

            - -

            Example Server Code

            -
            -import javax.naming.InitialContext;
            -import javax.naming.Context;
            -import javax.rmi.PortableRemoteObject ;
            -import com.sun.corba.se.impl.poa.POAORB;
            -import org.omg.PortableServer.*;
            -import java.util.*;
            -import org.omg.CORBA.*;
            -import javax.rmi.CORBA.Stub;
            -import javax.rmi.CORBA.Util;
            -
            -
            -
            -public class HelloServer {
            -    public HelloServer(String[] args) {
            -        try {
            -            Properties p = System.getProperties();
            -         //   p.put("org.omg.CORBA.ORBClass", "com.sun.corba.ee.internal.POA.POAORB");
            -            ORB orb = ORB.init( args, p );
            -
            -            POA rootPOA = (POA)orb.resolve_initial_references("RootPOA");
            -
            -            Policy[] tpolicy = new Policy[3];
            -            tpolicy[0] = rootPOA.create_lifespan_policy(
            -                LifespanPolicyValue.TRANSIENT );
            -            tpolicy[1] = rootPOA.create_request_processing_policy(
            -                RequestProcessingPolicyValue.USE_ACTIVE_OBJECT_MAP_ONLY );
            -            tpolicy[2] = rootPOA.create_servant_retention_policy(
            -                ServantRetentionPolicyValue.RETAIN);
            -            POA tpoa = rootPOA.create_POA("MyTransientPOA", null, tpolicy);
            -
            -
            -            String  ObjectId = "MyObjectId";
            -            byte[] oid = ObjectId.getBytes();
            -
            -            org.omg.CORBA.Object obj = tpoa.create_reference_with_id(oid,
            -                new _HelloImpl_Tie()._all_interfaces(tpoa, oid)[0]);
            -            HelloInterface helloRef = (HelloInterface)PortableRemoteObject.narrow(
            -                obj, HelloInterface.class );
            -
            -            Context initialNamingContext = new InitialContext();
            -            initialNamingContext.rebind("HelloService", helloRef);
            -            System.out.println("Hello Server: Ready...");
            -            orb.run();
            -         } catch (Exception e) {
            -            System.out.println("Trouble: " + e);
            -            e.printStackTrace();
            -         } 
            -     }
            -
            -
            -     public static void main(String args[]) {
            -         new HelloServer( args );
            -     }
            -}
            -
            -
            -
            - - - -@since 1.4 -
            -@serial exclude - - diff --git a/src/java.corba/share/classes/org/omg/PortableServer/poa.idl b/src/java.corba/share/classes/org/omg/PortableServer/poa.idl deleted file mode 100644 index aecf5702b4b..00000000000 --- a/src/java.corba/share/classes/org/omg/PortableServer/poa.idl +++ /dev/null @@ -1,1191 +0,0 @@ -/* - * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#include "corba.idl" -#include "CORBAX.idl" - -#pragma prefix "omg.org" -/** - * All Mapping corresponds to the Chapter 11 of - * CORBA V2.3.1 specified by OMG document formal/99-10-07.pdf. - * The exception to this is the id attribute, which is added in ptc/00-08-06, - * section 11.3.8.26. - */ -module PortableServer { - - #pragma version PortableServer 2.3 - - // forward reference - interface POA; - - /** - * List of POAs - */ - typedef sequence POAList; - - /** - * Values of type Servant support a language specific - * programming interface that can be used by the ORB to - * obtain a default POA for that servant. - * Some language mappings may allow Servant values to - * be implicitly converted to object references under - * appropriate conditions. - */ - native Servant; - - /** - * ObjectId value associated with the object reference. - */ - typedef sequence ObjectId; - - /** - * ForwardRequest to indicate to the ORB - * that it is responsible for delivering - * the current request and subsequent - * requests to the object denoted in the - * forward_reference member of the exception. - */ - exception ForwardRequest { Object forward_reference; }; - - // ********************************************** - // - // Policy interfaces - // - // ********************************************** - - /** - * The value representing THREAD_POLICY_ID. - */ - const CORBA::PolicyType THREAD_POLICY_ID = 16; - /** - * The value representing LIFESPAN_POLICY_ID. - */ - const CORBA::PolicyType LIFESPAN_POLICY_ID = 17; - /** - * The value representing ID_UNIQUENESS_POLICY_ID. - */ - const CORBA::PolicyType ID_UNIQUENESS_POLICY_ID = 18; - /** - * The value representing ID_ASSIGNMENT_POLICY_ID. - */ - const CORBA::PolicyType ID_ASSIGNMENT_POLICY_ID = 19; - /** - * The value representing IMPLICIT_ACTIVATION_POLICY_ID. - */ - const CORBA::PolicyType IMPLICIT_ACTIVATION_POLICY_ID = 20; - /** - * The value representing SERVANT_RETENTION_POLICY_ID. - */ - const CORBA::PolicyType SERVANT_RETENTION_POLICY_ID = 21; - /** - * The value representing REQUEST_PROCESSING_POLICY_ID. - */ - const CORBA::PolicyType REQUEST_PROCESSING_POLICY_ID = 22; - - /** - * The ThreadPolicyValue can have the following values. - * ORB_CTRL_MODEL - The ORB is responsible for assigning - * requests for an ORB- controlled POA to threads. - * SINGLE_THREAD_MODEL - Requests for a single-threaded - * POA are processed sequentially. - */ - enum ThreadPolicyValue { ORB_CTRL_MODEL, SINGLE_THREAD_MODEL }; - - /** - * The ThreadPolicy specifies the threading model - * used with the created POA. The default is - * ORB_CTRL_MODEL. - */ - interface ThreadPolicy : CORBA::Policy { - #pragma sun_local ThreadPolicy "" - /** - * specifies the policy value - */ - readonly attribute ThreadPolicyValue value; - }; - - /** - * The LifespanPolicyValue can have the following values. - * TRANSIENT - The objects implemented in the POA - * cannot outlive the POA instance in which they are - * first created. - * PERSISTENT - The objects implemented in the POA can - * outlive the process in which they are first created. - */ - enum LifespanPolicyValue { TRANSIENT, PERSISTENT }; - - /** - * The LifespanPolicy specifies the lifespan of the - * objects implemented in the created POA. The default - * is TRANSIENT. - */ - interface LifespanPolicy : CORBA::Policy { - #pragma sun_local LifespanPolicy "" - /** - * specifies the policy value - */ - readonly attribute LifespanPolicyValue value; - }; - - /** - * IdUniquenessPolicyValue can have the following values. - * UNIQUE_ID - Servants activated with that POA support - * exactly one Object Id. MULTIPLE_ID - a servant - * activated with that POA may support one or more - * Object Ids. - */ - enum IdUniquenessPolicyValue { UNIQUE_ID, MULTIPLE_ID }; - - /** - * The IdUniquenessPolicy specifies whether the servants - * activated in the created POA must have unique object i - * identities. The default is UNIQUE_ID. - */ - interface IdUniquenessPolicy : CORBA::Policy { - #pragma sun_local IdUniquenessPolicy "" - /** - * specifies the policy value - */ - readonly attribute IdUniquenessPolicyValue value; - }; - - /** - * The IdAssignmentPolicyValue can have the following - * values. USER_ID - Objects created with that POA are - * assigned Object Ids only by the application. - * SYSTEM_ID - Objects created with that POA are - * assigned Object Ids only by the POA. If the POA also - * has the PERSISTENT policy, assigned Object Ids must - * be unique across all instantiations of the same POA. - */ - enum IdAssignmentPolicyValue { USER_ID, SYSTEM_ID }; - - /** - * IdAssignmentPolicy specifies whether Object Ids in - * the created POA are generated by the application or - * by the ORB. The default is SYSTEM_ID. - */ - interface IdAssignmentPolicy : CORBA::Policy { - #pragma sun_local IdAssignmentPolicy "" - /** - * specifies the policy value - */ - readonly attribute IdAssignmentPolicyValue value; - }; - - /** - * ImplicitActivationPolicyValue has the following - * semantics. - * IMPLICIT_ACTIVATION to indicate implicit activation - * of servants. This requires SYSTEM_ID and RETAIN - * policies to be set. - * NO_IMPLICIT_ACTIVATION to indicate no implicit - * servant activation. - */ - enum ImplicitActivationPolicyValue { - IMPLICIT_ACTIVATION, NO_IMPLICIT_ACTIVATION - }; - - /** - * This policy specifies whether implicit activation - * of servants is supported in the created POA. - */ - interface ImplicitActivationPolicy : CORBA::Policy { - #pragma sun_local ImplicitActivationPolicy "" - /** - * specifies the policy value - */ - readonly attribute ImplicitActivationPolicyValue value; - }; - - /** - * ServantRetentionPolicyValue can have the following - * values. RETAIN - to indicate that the POA will retain - * active servants in its Active Object Map. - * NON_RETAIN - to indicate Servants are not retained by - * the POA. If no ServantRetentionPolicy is specified at - * POA creation, the default is RETAIN. - */ - enum ServantRetentionPolicyValue { RETAIN, NON_RETAIN }; - - /** - * This policy specifies whether the created POA retains - * active servants in an Active Object Map. - */ - interface ServantRetentionPolicy : CORBA::Policy { - #pragma sun_local ServantRetentionPolicy "" - /** - * specifies the policy value - */ - readonly attribute ServantRetentionPolicyValue value; - }; - - /** - * The RequestProcessingPolicyValue can have the following - * values. USE_ACTIVE_OBJECT_MAP_ONLY - If the Object Id - * is not found in the Active Object Map, - * an OBJECT_NOT_EXIST exception is returned to the - * client. The RETAIN policy is also required. - * USE_DEFAULT_SERVANT - If the Object Id is not found in - * the Active Object Map or the NON_RETAIN policy is - * present, and a default servant has been registered - * with the POA using the set_servant operation, - * the request is dispatched to the default servant. - * USE_SERVANT_MANAGER - If the Object Id is not found - * in the Active Object Map or the NON_RETAIN policy - * is present, and a servant manager has been registered - * with the POA using the set_servant_manager operation, - * the servant manager is given the opportunity to - * locate a servant or raise an exception. - */ - enum RequestProcessingPolicyValue { - USE_ACTIVE_OBJECT_MAP_ONLY, USE_DEFAULT_SERVANT, USE_SERVANT_MANAGER - }; - - /** - * This policy specifies how requests are processed by - * the created POA. The default is - * USE_ACTIVE_OBJECT_MAP_ONLY. - */ - interface RequestProcessingPolicy : CORBA::Policy { - #pragma sun_local RequestProcessingPolicy "" - /** - * specifies the policy value - */ - readonly attribute RequestProcessingPolicyValue value; - }; - - - // ************************************************** - // - // POAManager interface - // - // ********************************** - /** - * Each POA object has an associated POAManager object. - * A POA manager may be associated with one or more - * POA objects. A POA manager encapsulates the processing - * state of the POAs it is associated with. - */ - interface POAManager { - #pragma sun_local POAManager "" - exception AdapterInactive{ }; - /** - * Specifies the states for the POAManager - */ - enum State {HOLDING, ACTIVE, DISCARDING, INACTIVE}; - - /** - * This operation changes the state of the POA manager - * to active, causing associated POAs to start processing - * requests. - * @exception AdapterInactive is raised if the operation is - * invoked on the POAManager in inactive state. - */ - void activate() - raises(AdapterInactive); - /** - * This operation changes the state of the POA manager - * to holding, causing associated POAs to queue incoming - * requests. - * @param wait_for_completion if FALSE, the operation - * returns immediately after changing state. - * If TRUE, it waits for all active requests - * to complete. - * @exception AdapterInactive is raised if the operation is - * invoked on the POAManager in inactive state. - */ - void hold_requests(in boolean wait_for_completion) - raises(AdapterInactive); - /** - * This operation changes the state of the POA manager - * to discarding. This causes associated POAs to discard - * incoming requests. - * @param wait_for_completion if FALSE, the operation - * returns immediately after changing state. - * If TRUE, it waits for all active requests - * to complete. - * @exception AdapterInactive is raised if the operation is - * invoked on the POAManager in inactive state. - */ - void discard_requests(in boolean wait_for_completion) - raises(AdapterInactive); - - /** - * This operation changes the state of the POA manager - * to inactive, causing associated POAs to reject the - * requests that have not begun executing as well as - * as any new requests. - * @param etherealize_objects a flag to indicate whether - * to invoke the etherealize operation of the - * associated servant manager for all active - * objects. - * @param wait_for_completion if FALSE, the operation - * returns immediately after changing state. - * If TRUE, it waits for all active requests - * to complete. - * @exception AdapterInactive is raised if the operation is - * invoked on the POAManager in inactive state. - */ - void deactivate(in boolean etherealize_objects, - in boolean wait_for_completion) - raises(AdapterInactive); - /** - * This operation returns the state of the POA manager. - */ - State get_state(); - }; - - - // ************************************************** - // - // AdapterActivator interface - // - // **************************** - - /** - * An adapter activator supplies a POA with the ability - * to create child POAs on demand, as a side-effect of - * receiving a request that names the child POA - * (or one of its children), or when find_POA is called - * with an activate parameter value of TRUE. - */ - - interface AdapterActivator { - #pragma sun_local AdapterActivator "" - #pragma version AdapterActivator 2.3 - /** - * This operation is invoked when the ORB receives - * a request for an object reference that identifies - * a target POA that does not exist. The ORB invokes - * this operation once for each POA that must be - * created in order for the target POA to exist. - * @param parent indicates the parent POA for the POA - * that needs to be created. - * @param name identifies the name of the POA relative to - * the parent. - * @return returns TRUE if the POA was created or FALSE - * otherwise. - */ - boolean unknown_adapter(in POA parent, in string name); - }; - - - // ************************************************** - // - // ServantManager interface - // - // ****************************** - - /** - * A servant manager supplies a POA with the ability - * to activate objects on demand when the POA receives - * a request targeted at an inactive object. A servant - * manager is registered with a POA as a callback object, - * to be invoked by the POA when necessary. - * ServantManagers can either be ServantActivators or - * ServantLocators. A ServantManager object must be - * local to the process containing the POA objects - * it is registered with. - */ - - interface ServantManager - { #pragma sun_local ServantManager "" }; - - - /** - * When the POA has the RETAIN policy it uses servant - * managers that are ServantActivators. - */ - interface ServantActivator : ServantManager { - #pragma version ServantActivator 2.3 - #pragma sun_localservant ServantActivator "" - /** - * This operation is invoked by the POA whenever the - * POA receives a request for an object that is not - * currently active, assuming the POA has the - * USE_SERVANT_MANAGER and RETAIN policies. - * @param oid object Id associated with the object on - * the request was made. - * @param adapter object reference for the POA in which - * the object is being activated. - * @return Servant corresponding to oid is created or - * located by the user supplied servant manager. - * @exception ForwardRequest to indicate to the ORB - * that it is responsible for delivering - * the current request and subsequent - * requests to the object denoted in the - * forward_reference member of the exception. - */ - Servant incarnate ( in ObjectId oid, in POA adapter ) - raises (ForwardRequest); - /** - * This operation is invoked whenever a servant for - * an object is deactivated, assuming the POA has - * the USE_SERVANT_MANAGER and RETAIN policies. - * @param oid object Id associated with the object - * being deactivated. - * @param adapter object reference for the POA in which - * the object was active. - * @param serv contains reference to the servant - * associated with the object being deactivated. - * @param cleanup_in_progress if TRUE indicates that - * destroy or deactivate is called with - * etherealize_objects param of TRUE. FALSE - * indicates that etherealize was called due to - * other reasons. - * @param remaining_activations indicates whether the - * Servant Manager can destroy a servant. If - * set to TRUE, the Servant Manager should wait - * until all invocations in progress have - * completed. - */ - void etherealize ( in ObjectId oid, - in POA adapter, - in Servant serv, - in boolean cleanup_in_progress, - in boolean remaining_activations); - }; - - - /** - * When the POA has the NON_RETAIN policy it uses servant - * managers that are ServantLocators. Because the POA - * knows that the servant returned by this servant - * manager will be used only for a single request, - * it can supply extra information to the servant - * manager's operations and the servant manager's pair - * of operations may be able to cooperate to do - * something different than a ServantActivator. - * When the POA uses the ServantLocator interface, - * immediately after performing the operation invocation - * on the servant returned by preinvoke, the POA will - * invoke postinvoke on the servant manager, passing the - * ObjectId value and the Servant value as parameters - * (among others). This feature may be used to force - * every request for objects associated with a POA to - * be mediated by the servant manager. - */ - interface ServantLocator : ServantManager { - #pragma sun_localservant ServantLocator "" - /** - * Opaque data used to pass the information from - * preinvoke to postinvoke hooks. This specific - * by the language mapping, that is why it is - * specified as native. - */ - native Cookie; - /** - * This operations is used to get a servant that will be - * used to process the request that caused preinvoke to - * be called. - * @param oid the object id associated with object on - * which the request was made. - * @param adapter the reference for POA in which the - * object is being activated. - * @param operation the operation name. - * @param the_cookie an opaque value that can be set - * by the servant manager to be used - * during postinvoke. - * @return Servant used to process incoming request. - * @exception ForwardRequest to indicate to the ORB - * that it is responsible for delivering - * the current request and subsequent - * requests to the object denoted in the - * forward_reference member of the exception. - */ - Servant preinvoke( in ObjectId oid, in POA adapter, - in CORBA::Identifier operation, - out Cookie the_cookie ) - raises (ForwardRequest); - /** - * This operation is invoked whenener a servant completes - * a request. - * @param oid the object id ssociated with object on which - * the request was made. - * @param adapter the reference for POA in which the - * object was active. - * @param the_cookie an opaque value that contains - * the data set by preinvoke. - * @param the_servant reference to the servant that is - * associated with the object. - */ - void postinvoke( in ObjectId oid, in POA adapter, - in CORBA::Identifier operation, - in Cookie the_cookie, - in Servant the_servant); - }; - - - // ************************************************** - // - // POA interface - // - // ***************************************** - - /** - * A POA object manages the implementation of a - * collection of objects. The POA supports a name space - * for the objects, which are identified by Object Ids. - * A POA also provides a name space for POAs. A POA is - * created as a child of an existing POA, which forms a - * hierarchy starting with the root POA. A POA object - * must not be exported to other processes, or - * externalized with ORB::object_to_string. - */ - interface POA { - #pragma sun_local POA "" - #pragma version POA 2.3 - /** - * specifies that an child POA with the specified - * name already exists. - */ - exception AdapterAlreadyExists { }; - - /** - * This is raised if the POA with a specified Name cannot - * be found. - */ - exception AdapterNonExistent { }; - - /** - * This is raised if any of the policy objects are - * not valid for the ORB - */ - exception InvalidPolicy { - unsigned short index; - }; - - /** - * This is raised if no default servant is associated - * with the POA. - */ - exception NoServant { }; - - /** - * specifies that an object is already active or - * exists in the Active Object Map. - */ - exception ObjectAlreadyActive { }; - /** - * specifies that the object is not active or its - * mapping does not exist in the Active Object Map. - */ - - exception ObjectNotActive { }; - - /** - * This is raised when an attempt is made to activate - * a servant that is already active or has a mapping in - * the Active Object Map. - */ - exception ServantAlreadyActive { }; - - /** - * This is raised when an attempt is made to access a - * servant that is not active or is not registered in - * the Active Object Map. - */ - exception ServantNotActive { }; - - /** - * This is raised if the reference was not created by - * the POA - * specified in the reference. - */ - exception WrongAdapter { }; - - /** - * WrongPolicy is specified when the POA does not - * specify the policy appropriate for its operations. - */ - exception WrongPolicy { }; - - - //---------------------------------------- - // - // POA creation and destruction - // - //------------------------------- - - /** - * This operation creates a new POA as a child of the - * target POA. - * @param adapter_name identifies the new POA with - * respect to other POAs with the same parent POA. - * @param a_POAManager specifies the POA Manager to be - * associated with the new POA. - * @param policies specifies policy objects to be - * associated with the POA to control its behavior. - * @exception AdapterAlreadyExists specifies that the - * target POA already has a child POA with - * the specified name. - * @exception InvalidPolicy is raised if any of the - * policy objects are not valid for the ORB, - * or are in conflict, or require an - * administrative action that has not been - * performed. - */ - POA create_POA(in string adapter_name, - in POAManager a_POAManager, - in CORBA::PolicyList policies) - raises (AdapterAlreadyExists, InvalidPolicy); - - /** - * If the target POA is the parent of a child POA with - * the specified name (relative to the target POA), that - * child POA is returned. - * @param adapter_name POA name to be found. - * @param activate_it if a POA with the specified - * name does not exist and the value of - * the activate_it parameter is TRUE, the target - * POA's AdapterActivator, if one exists, - * is invoked. - * @return POA if one exists or is activated by the - * AdapterActivator. - * @return AdapterNonExistent is raised if POA with - * a specified name cannot be found or - * activated using AdapaterActivator. - */ - POA find_POA(in string adapter_name, - in boolean activate_it) - raises (AdapterNonExistent); - - /** - * This operation destroys the POA and all descendant - * POAs. All descendant POAs are destroyed (recursively) - * before the destruction of the containing POA. The POA - * so destroyed (that is, the POA with its name) may be - * re-created later in the same process. - * @param etherealize_objects flag to indicate whether - * etherealize operation on servant manager needs - * to be called. - * @param wait_for_completion flag to indicate whether - * POA and its children need to wait for active - * requests and the etherealization to complete. - * - */ - void destroy( in boolean etherealize_objects, - in boolean wait_for_completion); - - // ************************************************** - // - // Factories for Policy objects - // - // ************ - /** - * These operations each return a reference to a policy - * object with the specified value. - * @param value policy type - * @return ThreadPolcy Object - */ - ThreadPolicy create_thread_policy( - in ThreadPolicyValue value); - /** - * These operations each return a reference to a policy - * object with the specified value. - * @param value policy type - * @return LifespanPolicy Object. - */ - LifespanPolicy create_lifespan_policy( - in LifespanPolicyValue value); - /** - * These operations each return a reference to a policy - * object with the specified value. - * @param value policy type - * @return IdUniquenessPolicy Object. - */ - IdUniquenessPolicy create_id_uniqueness_policy( - in IdUniquenessPolicyValue value); - /** - * These operations each return a reference to a policy - * object with the specified value. - * @param value policy type - * @return IdAssignmentPolicy Object. - */ - IdAssignmentPolicy create_id_assignment_policy( - in IdAssignmentPolicyValue value); - /** - * These operations each return a reference to a policy - * object with the specified value. - * @param value policy type - * @return ImplicitActivationPolicy Object. - */ - ImplicitActivationPolicy create_implicit_activation_policy( - in ImplicitActivationPolicyValue value); - /** - * These operations each return a reference to a policy - * object with the specified value. - * @param value policy type - * @return ServantRetentionPolicy Object. - */ - ServantRetentionPolicy create_servant_retention_policy( - in ServantRetentionPolicyValue value); - /** - * These operations each return a reference to a policy - * object with the specified value. - * @param value policy type - * @return RequestProcessingPolicy Object. - */ - - RequestProcessingPolicy create_request_processing_policy( - in RequestProcessingPolicyValue value); - - //-------------------------------------------------- - // - // POA attributes - // - //----------------------------------- - /** - * This attribute identifies the POA relative to its - * parent. This name is assigned when the POA is created. - */ - readonly attribute string the_name; - /** - * This attribute identifies the parent of the POA. - * The parent of the root POA is null. - */ - readonly attribute POA the_parent; - /** - * This attribute identifies the current set of all - * child POAs of the POA. The set of child POAs - * includes only the POA's immediate children, and - * not their descendants. - */ - readonly attribute POAList the_children; - /** - * This attribute identifies the POA manager - * associated with the POA. - */ - readonly attribute POAManager the_POAManager; - - /** - * This attribute identifies the adapter activator - * associated with the POA. - */ - attribute AdapterActivator the_activator; - - //-------------------------------------------------- - // - // Servant Manager registration: - // - //-------------------------------------------------- - /** - * - * If the ServantRetentionPolicy of the POA is RETAIN, - * then the ServantManager argument (imgr) shall support - * the ServantActivator interface. For a NON_RETAIN policy, - * the ServantManager shall support the ServantLocator - * interface. If the argument is nil, or does not support - * the required interface, then the OBJ_ADAPTER - * exception is raised. - * @return ServantManager associated with a POA or null if - * none exists. - * @exception WrongPolicy raised if the - * USE_SERVANT_MANAGER policy is not specified. - */ - ServantManager get_servant_manager() - raises (WrongPolicy); - /** - * - * This operation sets the default servant manager - * associated with the POA. This operation may only be - * invoked once after a POA has been created. Attempting - * to set the servant manager after one has already - * been set will result in the BAD_INV_ORDER exception - * being raised. - * @param imgr servant manager to be used as a default. - * @exception WrongPolicy raised if the - * USE_SERVANT_MANAGER policy is not specified. - */ - void set_servant_manager( in ServantManager imgr) - raises (WrongPolicy); - - //-------------------------------------------------- - // - // operations for the USE_DEFAULT_SERVANT policy - // - //---------- - /** - * This operation returns the default servant associated - * with the POA. - * @return p_servant default servant associated with a POA. - * @exception NoServant raised if no default servant is - * associated with the POA. - * @exception WrongPolicy raised if the - * USE_DEFAULT_SERVANT policy is not specified. - */ - Servant get_servant() - raises (NoServant, WrongPolicy); - - /** - * - * This operation registers the specified servant with - * the POA as the default servant. This servant will - * be used for all requests for which no servant is - * found in the Active Object Map. - * @param p_servant servant to be used as a default. - * @exception WrongPolicy raised if the - * USE_DEFAULT_SERVANT policy is not specified. - */ - void set_servant(in Servant p_servant) - raises (WrongPolicy); - - // ************************************************** - // - // object activation and deactivation - // - // ************ - - /** - * - * This operation generates an Object Id and enters - * the Object Id and the specified servant in the - * Active Object Map. - * @param p_servant servant to be associated with an - * object to be activated. - * @return POA generated object id. - * @exception ServantAlreadyActive is raised if the - * POA has UNIQUE_ID policy and servant is - * is already in the Active Object Map. - * @exception WrongPolicy raised if the SYSTEM_ID and - * RETAIN policies are not specified. - */ - ObjectId activate_object( in Servant p_servant ) - raises (ServantAlreadyActive, WrongPolicy); - /** - * This operation enters an association between the - * specified Object Id and the specified servant in the - * Active Object Map. - * @param id object id for the object to be activated. - * @param p_servant servant to be associated with the - * object. - * @exception ServantAlreadyActive raised if the POA - * has the UNIQUE_ID policy and the servant - * is already in the Active Object Map. - * @exception ObjectAlreadyActive raised if the object is - * already active in the POA. - * @exception WrongPolicy raised if the RETAIN policy is - * is not specified. - */ - - void activate_object_with_id( in ObjectId id, - in Servant p_servant) - raises ( ServantAlreadyActive, ObjectAlreadyActive, - WrongPolicy); - /** - * - * This operation causes the ObjectId specified in the - * oid parameter to be deactivated. An ObjectId which - * has been deactivated continues to process requests - * until there are no active requests for that ObjectId. - * A deactivated ObjectId is removed from the Active - * Object Map when all requests executing for that - * ObjectId have completed. - * @param oid Object Id for the object to be deactivated. - * @exception ObjectNotActive if the object with the - * specified oid is not in the Active Object - * Map. - * @exception WrongPolicy raised if the RETAIN policy is - * is not specified. - */ - void deactivate_object(in ObjectId oid) - raises (ObjectNotActive, WrongPolicy); - - // ************************************************** - // - // reference creation operations - // - // ***************** - /** - * This operation creates an object reference that - * encapsulates a POA-generated Object Id value and - * the specified interface repository id. - * - * @param intf rep id for creating an object reference. - * @return object reference created using intf. - * @exception WrongPolicy if SYSTEM_ID policy is not - * specified. - */ - Object create_reference ( in CORBA::RepositoryId intf ) - raises (WrongPolicy); - - /** - * This operation creates an object reference that - * encapsulates the specified Object Id and interface - * repository Id values. It does not cause an activation - * to take place. The resulting reference may be passed - * to clients, so that subsequent requests on those - * references will cause the object to be activated - * if necessary, or the default servant used, depending - * on the applicable policies. - * @param oid object id for creating an objref - * @param intf rep id for creating an objref - * @return object reference created using oid and intf - * @exception BAD_PARAM is raised if the POA has the - * SYSTEM_ID policy and it detects that the - * Object Id value was not generated by the - * system or for this POA. - */ - Object create_reference_with_id ( in ObjectId oid, - in CORBA::RepositoryId intf ); - // not specified in 11.3.8.19 raises (WrongPolicy); - - //-------------------------------------------------- - // - // Identity mapping operations: - // - //-------------------------------------------------- - /** - * This operation has four possible behaviors. - * 1. If the POA has the UNIQUE_ID policy and the - * specified servant is active, the Object Id associated - * with that servant is returned. - * 2. If the POA has the IMPLICIT_ACTIVATION policy and - * either the POA has the MULTIPLE_ID policy or the - * specified servant is not active, the servant is - * activated using a POA-generated Object Id and the - * Interface Id associated with the servant, and that - * Object Id is returned. - * 3. If the POA has the USE_DEFAULT_SERVANT policy, - * the servant specified is the default servant, and the - * operation is being invoked in the context of executing - * a request on the default servant, then the ObjectId - * associated with the current invocation is returned. - * 4. Otherwise, the ServantNotActive exception is raised. - * - * @param p_servant servant for which the object disi returned. - * @return object id associated with the servant. - * @exception ServantNotActive if the above rules and - * policy combination is not met. - * @exception WrongPolicy if the USE_DEFAULT_SERVANT policy - * or a combination of the RETAIN policy and - * either the UNIQUE_ID or IMPLICIT_ACTIVATION - * policies are not present. - */ - ObjectId servant_to_id(in Servant p_servant) - raises (ServantNotActive, WrongPolicy); - - /** - * This operation requires the RETAIN policy and either - * the UNIQUE_ID or IMPLICIT_ACTIVATION policies if - * invoked outside the context of an operation dispatched - * by this POA. It has four possible behaviors. - * 1. If the POA has both the RETAIN and the - * UNIQUE_ID policy and the specified servant is active, - * an object reference encapsulating the information used - * to activate the servant is returned. - * 2. If the POA has both the RETAIN and the - * IMPLICIT_ACTIVATION policy and either the POA has the - * MULTIPLE_ID policy or the specified servant is not - * active, the servant is activated using a POA-generated - * Object Id and the Interface Id associated with the - * servant, and a corresponding object reference is - * returned. - * 3. If the operation was invoked in the context of - * executing a request on the specified servant, the - * reference associated with the current invocation - * is returned. - * 4. Otherwise, the ServantNotActive exception is raised. - * - * @param p_servant servant for which the object reference - * needs to be obtained. - * @return object reference associated with the servant. - * @exception WrongPolicy if the operation is not invoked - * in the context of executing a request on - * the specified servant and the required - * policies are not present. - * @exception ServantNotActive if the above specified - * policies and rules are not met. - */ - Object servant_to_reference(in Servant p_servant) - raises (ServantNotActive, WrongPolicy); - - /** - * If the POA has the RETAIN policy and the specified - * object is present in the Active Object Map, this - * operation returns the servant associated with that - * object in the Active Object Map. Otherwise, if the - * POA has the USE_DEFAULT_SERVANT policy and a default - * servant has been registered with the POA, this - * operation returns the default servant. If the object - * reference was not created by this POA, - * the WrongAdapter exception is raised. (OMG Issue - * on inconsistency with the POA.IDL. - * - * @param reference object reference for which the - * servant is returned. - * @return servant associated with the reference. - * @exception WrongPolicy if neither the RETAIN policy or - * the USE_DEFAULT_SERVANT policy is present. - * @exception ObjectNotActive if the servant is not - * present in the Active Object Map (for RETAIN) - * or no default servant is registered (for - * USE_DEFAULT_POLICY). - * @exception WrongAdapter if reference was not created by - * this POA instance. - */ - Servant reference_to_servant(in Object reference) - raises (ObjectNotActive, WrongPolicy, WrongAdapter); - - /** - * This operation returns the Object Id value - * encapsulated by the specified reference. This - * operation is valid only if the reference was created - * by the POA on which the operation is being performed. - * The object denoted by the reference does not have - * to be active for this operation to succeed. - * - * @param reference the object reference from which the - * object id needs to be returned. - * @return object id encapsulated in the reference. - * @exception WrongAdapter if the reference was not - * created by the POA specified in the - * reference. - * @exception WrongPolicy declared to allow future - * extensions. - * - */ - ObjectId reference_to_id(in Object reference) - raises (WrongAdapter, WrongPolicy); - - /** - * If the POA has the RETAIN policy and the specified - * ObjectId is in the Active Object Map, this operation - * returns the servant associated with that object in - * the Active Object Map. Otherwise, if the POA has - * the USE_DEFAULT_SERVANT policy and a default servant - * has been registered with the POA, this operation - * returns the default servant. - * - * @param oid object id for the which the servant is - * returned. - * @return servant associated with oid. - * @exception ObjectNotActive is raised if ObjectId is - * is not in the Active Object Map (for RETAIN - * policy), or no default servant is registered - * (for USE_DEFAULT_SERVANT policy). - * - * @exception WrongPolicy is raised if the RETAIN policy - * or the USE_DEFAULT_SERVANT - * policy is not present. - */ - Servant id_to_servant(in ObjectId oid) - raises (ObjectNotActive, WrongPolicy); - - /** - * If an object with the specified Object Id value is - * currently active, a reference encapsulating the - * information used to activate the object is returned. - * - * @param oid id of the object for which the - * reference is returned. - * @return the object reference - * - * @exception ObjectNotActive if the Object Id value - * is not active in the POA. - * @exception WrongPolicy if the RETAIN policy is not - * present. - */ - Object id_to_reference(in ObjectId oid) - raises (ObjectNotActive, WrongPolicy); - - /** - * This returns the unique id of the POA in the process in which it - * is created. It is for use by portable interceptors. - *

            - * This id is guaranteed unique for the life span of the POA in the - * process. For persistent POAs, this means that if a POA is created - * in the same path with the same name as another POA, these POAs - * are identical and, therefore, have the same id. For transient - * POAs, each POA is unique. - */ - readonly attribute ::org::omg::CORBA::OctetSeq id; - - }; - - // ***************************************************** - // - // Current interface: - // - // ***************************************************** - - /** - * The PortableServer::Current interface, derived from - * CORBA::Current, provides method implementations with - * access to the identity of the object on which the - * method was invoked. The Current interface is provided - * to support servants that implement multiple objects, - * but can be used within the context of POA-dispatched - * method invocations on any servant. To provide location - * transparency, ORBs are required to support use of - * Current in the context of both locally and remotely - * invoked operations. An instance of Current can be - * obtained by the application by issuing the - * CORBA::ORB::resolve_initial_references("POACurrent") - * operation. Thereafter, it can be used within the - * context of a method dispatched by the POA to obtain - * the POA and ObjectId that identify the object on - * which that operation was invoked. - */ - interface Current : CORBA::Current { - #pragma sun_local Current "" - #pragma version Current 2.3 - /** - * The exception that is used to indicate that the - * operation is invoked outside the context of the - * POA-dispatched operation. - */ - - exception NoContext { }; - - /** - * Returns reference to the POA implementing the - * object in whose context it is called. - * - * @return The poa implementing the object - * - * @exception NoContext is raised when the operation is - * outside the context of a POA-dispatched - * operation - */ - POA get_POA() - raises (NoContext); - - /** - * Returns the ObjectId identifying the object in - * whose context it is called. - * - * @return the ObjectId of the object - * - * @exception NoContext is raised when the operation - * is called outside the context of a POA-dispatched - * operation. - */ - - ObjectId get_object_id() - raises (NoContext); - }; -}; diff --git a/src/java.corba/share/classes/org/omg/PortableServer/portable/Delegate.java b/src/java.corba/share/classes/org/omg/PortableServer/portable/Delegate.java deleted file mode 100644 index 56d9a4b6fef..00000000000 --- a/src/java.corba/share/classes/org/omg/PortableServer/portable/Delegate.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.omg.PortableServer.portable; - -import org.omg.PortableServer.Servant; -import org.omg.PortableServer.POA; - -/** - * The portability package contains interfaces and classes - * that are designed for and intended to be used by ORB - * implementor. It exposes the publicly defined APIs that - * are used to connect stubs and skeletons to the ORB. - * The Delegate interface provides the ORB vendor specific - * implementation of PortableServer::Servant. - * Conformant to spec CORBA V2.3.1, ptc/00-01-08.pdf - */ -public interface Delegate { -/** - * Convenience method that returns the instance of the ORB - * currently associated with the Servant. - * @param Self the servant. - * @return ORB associated with the Servant. - */ - org.omg.CORBA.ORB orb(Servant Self); - -/** - * This allows the servant to obtain the object reference for - * the target CORBA Object it is incarnating for that request. - * @param Self the servant. - * @return Object reference associated with the request. - */ - org.omg.CORBA.Object this_object(Servant Self); - -/** - * The method _poa() is equivalent to - * calling PortableServer::Current:get_POA. - * @param Self the servant. - * @return POA associated with the servant. - */ - POA poa(Servant Self); - -/** - * The method _object_id() is equivalent - * to calling PortableServer::Current::get_object_id. - * @param Self the servant. - * @return ObjectId associated with this servant. - */ - byte[] object_id(Servant Self); - -/** - * The default behavior of this function is to return the - * root POA from the ORB instance associated with the servant. - * @param Self the servant. - * @return POA associated with the servant class. - */ - POA default_POA(Servant Self); - -/** - * This method checks to see if the specified repid is present - * on the list returned by _all_interfaces() or is the - * repository id for the generic CORBA Object. - * @param Self the servant. - * @param Repository_Id the repository_id to be checked in the - * repository list or against the id of generic CORBA - * object. - * @return boolean indicating whether the specified repid is - * in the list or is same as that got generic CORBA - * object. - */ - boolean is_a(Servant Self, String Repository_Id); - -/** - * This operation is used to check for the existence of the - * Object. - * @param Self the servant. - * @return boolean true to indicate that object does not exist, - * and false otherwise. - */ - boolean non_existent(Servant Self); - //Simon And Ken Will Ask About Editorial Changes - //In Idl To Java For The Following Signature. - -/** - * This operation returns an object in the Interface Repository - * which provides type information that may be useful to a program. - * @param self the servant. - * @return type information corresponding to the object. - */ - // The get_interface() method has been replaced by get_interface_def() - //org.omg.CORBA.Object get_interface(Servant Self); - - org.omg.CORBA.Object get_interface_def(Servant self); -} diff --git a/src/java.corba/share/classes/org/omg/PortableServer/portable/package.html b/src/java.corba/share/classes/org/omg/PortableServer/portable/package.html deleted file mode 100644 index 9969bb6dd1d..00000000000 --- a/src/java.corba/share/classes/org/omg/PortableServer/portable/package.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - -Provides classes and interfaces for making the server side of your applications -portable across multivendor ORBs. - -

            The portable package contains interfaces and classes - that are designed for and intended to be used by an ORB -implementor. It exposes the publicly defined APIs that - are used to connect stubs and skeletons to the ORB. - The Delegate interface provides the ORB-vendor-specific - implementation of PortableServer::Servant. - This package conforms CORBA Specification V2.3.1, ptc/00-01-08. - -@since 1.4 -
            -@serial exclude - - diff --git a/src/java.corba/share/classes/org/omg/SendingContext/RunTime.java b/src/java.corba/share/classes/org/omg/SendingContext/RunTime.java deleted file mode 100644 index b5eb36a3979..00000000000 --- a/src/java.corba/share/classes/org/omg/SendingContext/RunTime.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package org.omg.SendingContext; - -/** Defines the base class that represents the Sending Context of a -* request. The sending context provides access to information about -* the runtime environment of the originator of a GIOP message. For example, -* when a value type is marshalled on a GIOP Request message, the receiver -* of the value type may need to ask the sender about the CodeBase for the -* implementation of the value type. -*/ -public interface RunTime extends RunTimeOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity -{ -} diff --git a/src/java.corba/share/classes/org/omg/SendingContext/RunTimeOperations.java b/src/java.corba/share/classes/org/omg/SendingContext/RunTimeOperations.java deleted file mode 100644 index 7205ce8c670..00000000000 --- a/src/java.corba/share/classes/org/omg/SendingContext/RunTimeOperations.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -package org.omg.SendingContext; - -/** Defines operations on the base class that represents the Sending Context of a -* request. The sending context provides access to information about -* the runtime environment of the originator of a GIOP message. For example, -* when a value type is marshalled on a GIOP Request message, the receiver -* of the value type may need to ask the sender about the CodeBase for the -* implementation of the value type. -*/ -public interface RunTimeOperations -{ -} diff --git a/src/java.corba/share/classes/org/omg/SendingContext/package.html b/src/java.corba/share/classes/org/omg/SendingContext/package.html deleted file mode 100644 index a76f241b24d..00000000000 --- a/src/java.corba/share/classes/org/omg/SendingContext/package.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - Provides support for the marshalling of value types. Value type - marshalling may require access to an implementation of the value type or - to meta information about the value type. This information is passed - between the sending context and the receiving context using a particular - service context containing an instance of the - SendingContext.RunTime interface. -

            - A sending context may be either the client side or the server side of - an invocation, depending on which contains a value type. - The sending context is the client side of an - invocation if the request contains a value type. It is the server side - if the reply contains a value type. The other party in the communication - is the receiving context. -

            - The service context marshalled for SendingContext - consists of an encapsulated IOR for the SendingContext.RunTime - interface. RunTime is just a marker - interface defined to allow extensibility in the future. There is - currently only one subinterface of RunTime defined: - the SendingContext.CodeBase interface. - The interface CodeBase defines operations to obtain code URLs - and meta-information about a value type received from the sending - context. -

            - Note that these classes are currently defined in the - com.sun.org.omg.SendingContext - package rather than in the package org.omg.SendingContext. - This has been done to avoid including large parts of the interface - repository in the JDK core, since the interface repository is still - evolving in response to the needs of the CORBA Components work. - -

            Package Specification

            - -

            For a precise list of supported sections of official specifications with which -the Java[tm] Platform, Standard Edition 6 ORB complies, see Official Specifications for CORBA -support in Java[tm] SE 6. - -@since 1.3 -
            -@serial exclude - - diff --git a/src/java.corba/share/classes/org/omg/stub/java/rmi/_Remote_Stub.java b/src/java.corba/share/classes/org/omg/stub/java/rmi/_Remote_Stub.java deleted file mode 100644 index d1cb4cd8337..00000000000 --- a/src/java.corba/share/classes/org/omg/stub/java/rmi/_Remote_Stub.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * Licensed Materials - Property of IBM - * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved - * - */ - -// Stub class generated by rmic, do not edit. -// Contents subject to change without notice. - -package org.omg.stub.java.rmi; - -import java.rmi.Remote; -import javax.rmi.CORBA.Stub; - -/** - * This class provides the Stub for the Remote Type. The class is generated - * by the rmic compiler, and is still under works at OMG. It's contents are - * subject to change without notice as the specification evolves. - */ -public final class _Remote_Stub extends Stub implements Remote { - - private static final String _type_ids[] = { - "" - }; - - /** - * Returns an array of repository ids that an object implements. - * The string at index zero represents the most derived interface. The last id, - * for the generic CORBA object is (i.e., IDL:omg.org/CORBA/Object:1.0") is - * implied and not present. - * @return an array of repository ids that an object implements. - */ - public String[] _ids() { - return (String[]) _type_ids.clone(); - } -} diff --git a/src/java.corba/share/classes/org/omg/stub/java/rmi/package.html b/src/java.corba/share/classes/org/omg/stub/java/rmi/package.html deleted file mode 100644 index 6ac9fece953..00000000000 --- a/src/java.corba/share/classes/org/omg/stub/java/rmi/package.html +++ /dev/null @@ -1,40 +0,0 @@ - - -org.omg.stub.java.rmi package - - - - Contains RMI-IIOP Stubs for the Remote types that occur in the - java.rmi package. - -@since 1.3 -
            -@serial exclude - - diff --git a/src/java.corba/share/classes/sun/corba/Bridge.java b/src/java.corba/share/classes/sun/corba/Bridge.java deleted file mode 100644 index 38fb8da656c..00000000000 --- a/src/java.corba/share/classes/sun/corba/Bridge.java +++ /dev/null @@ -1,411 +0,0 @@ -/* - * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.corba ; - -import java.io.OptionalDataException; -import java.lang.invoke.MethodHandle; -import java.lang.reflect.Field; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.lang.StackWalker; -import java.lang.StackWalker.StackFrame; -import java.util.Optional; -import java.util.stream.Stream; - -import java.security.AccessController; -import java.security.Permission; -import java.security.PrivilegedAction; -import java.security.ProtectionDomain; - -import sun.misc.Unsafe; -import sun.reflect.ReflectionFactory; - -/** This class provides the methods for fundamental JVM operations - * needed in the ORB that are not part of the public Java API. This includes: - *

              - *
            • throwException, which can throw undeclared checked exceptions. - * This is needed to handle throwing arbitrary exceptions across a standardized - * OMG interface that (incorrectly) does not specify appropriate exceptions.
            • - *
            • putXXX/getXXX methods that allow unchecked access to fields of objects. - * This is used for setting uninitialzed non-static final fields (which is - * impossible with reflection) and for speed.
            • - *
            • objectFieldOffset to obtain the field offsets for use in the putXXX/getXXX methods
            • - *
            • newConstructorForSerialization to get the special constructor required for a - * Serializable class
            • - *
            • latestUserDefinedLoader to get the latest user defined class loader from - * the call stack as required by the RMI-IIOP specification (really from the - * JDK 1.1 days)
            • - *
            - * The code that calls Bridge.get() must have the following Permissions: - *
              - *
            • BridgePermission "getBridge"
            • - *
            • ReflectPermission "suppressAccessChecks"
            • - *
            • RuntimePermission "getStackWalkerWithClassReference"
            • - *
            • RuntimePermission "reflectionFactoryAccess"
            • - *
            - *

            - * All of these permissions are required to obtain and correctly initialize - * the instance of Bridge. No security checks are performed on calls - * made to Bridge instance methods, so access to the Bridge instance - * must be protected. - *

            - * This class is a singleton (per ClassLoader of course). Access to the - * instance is obtained through the Bridge.get() method. - */ -public final class Bridge -{ - private static final Permission getBridgePermission = - new BridgePermission("getBridge"); - private static Bridge bridge = null ; - - /** Access to Unsafe to read/write fields. */ - private static final Unsafe unsafe = AccessController.doPrivileged( - (PrivilegedAction)() -> { - try { - Field field = Unsafe.class.getDeclaredField("theUnsafe"); - field.setAccessible(true); - return (Unsafe)field.get(null); - - } catch (NoSuchFieldException |IllegalAccessException ex) { - throw new InternalError("Unsafe.theUnsafe field not available", ex); - } - } - ) ; - - private final ReflectionFactory reflectionFactory ; - private final StackWalker stackWalker; - - private Bridge() { - reflectionFactory = ReflectionFactory.getReflectionFactory(); - stackWalker = StackWalker.getInstance( - StackWalker.Option.RETAIN_CLASS_REFERENCE); - } - - /** Fetch the Bridge singleton. This requires the following - * permissions: - *

              - *
            • BridgePermission "getBridge"
            • - *
            • ReflectPermission "suppressAccessChecks"
            • - *
            • RuntimePermission "getStackWalkerWithClassReference"
            • - *
            • RuntimePermission "reflectionFactoryAccess"
            • - *
            - * @return The singleton instance of the Bridge class - * @throws SecurityException if the caller does not have the - * required permissions and the caller has a non-null security manager. - */ - public static final synchronized Bridge get() - { - SecurityManager sman = System.getSecurityManager() ; - if (sman != null) - sman.checkPermission( getBridgePermission ) ; - - if (bridge == null) { - bridge = new Bridge() ; - } - - return bridge ; - } - - /** Returns true if the loader that loaded the frame's declaring class - * is a user loader (if it is not the platform class loader or one of - * its ancestor). - */ - private boolean isUserLoader(StackFrame sf) { - ClassLoader cl = sf.getDeclaringClass().getClassLoader(); - if (cl == null) return false; - ClassLoader p = ClassLoader.getPlatformClassLoader(); - while (cl != p && p != null) p = p.getParent(); - return cl != p; - } - - private Optional getLatestUserDefinedLoaderFrame(Stream stream) { - return stream.filter(this::isUserLoader).findFirst(); - } - - - /** Obtain the latest user defined ClassLoader from the call stack. - * This is required by the RMI-IIOP specification. - */ - public final ClassLoader getLatestUserDefinedLoader() { - // requires getClassLoader permission => needs doPrivileged. - PrivilegedAction pa = () -> - stackWalker.walk(this::getLatestUserDefinedLoaderFrame) - .map(sf -> sf.getDeclaringClass().getClassLoader()) - .orElseGet(() -> ClassLoader.getPlatformClassLoader()); - return AccessController.doPrivileged(pa); - } - - /** - * Fetches a field element within the given - * object o at the given offset. - * The result is undefined unless the offset was obtained from - * {@link #objectFieldOffset} on the {@link java.lang.reflect.Field} - * of some Java field and the object referred to by o - * is of a class compatible with that field's class. - * @param o Java heap object in which the field from which the offset - * was obtained resides - * @param offset indication of where the field resides in a Java heap - * object - * @return the value fetched from the indicated Java field - * @throws RuntimeException No defined exceptions are thrown, not even - * {@link NullPointerException} - */ - public final int getInt(Object o, long offset) - { - return unsafe.getInt( o, offset ) ; - } - - /** - * Stores a value into a given Java field. - *

            - * The first two parameters are interpreted exactly as with - * {@link #getInt(Object, long)} to refer to a specific - * Java field. The given value is stored into that field. - *

            - * The field must be of the same type as the method - * parameter x. - * - * @param o Java heap object in which the field resides, if any, else - * null - * @param offset indication of where the field resides in a Java heap - * object. - * @param x the value to store into the indicated Java field - * @throws RuntimeException No defined exceptions are thrown, not even - * {@link NullPointerException} - */ - public final void putInt(Object o, long offset, int x) - { - unsafe.putInt( o, offset, x ) ; - } - - /** - * @see #getInt(Object, long) - */ - public final Object getObject(Object o, long offset) - { - return unsafe.getObject( o, offset ) ; - } - - /** - * @see #putInt(Object, long, int) - */ - public final void putObject(Object o, long offset, Object x) - { - unsafe.putObject( o, offset, x ) ; - } - - /** @see #getInt(Object, long) */ - public final boolean getBoolean(Object o, long offset) - { - return unsafe.getBoolean( o, offset ) ; - } - /** @see #putInt(Object, long, int) */ - public final void putBoolean(Object o, long offset, boolean x) - { - unsafe.putBoolean( o, offset, x ) ; - } - /** @see #getInt(Object, long) */ - public final byte getByte(Object o, long offset) - { - return unsafe.getByte( o, offset ) ; - } - /** @see #putInt(Object, long, int) */ - public final void putByte(Object o, long offset, byte x) - { - unsafe.putByte( o, offset, x ) ; - } - /** @see #getInt(Object, long) */ - public final short getShort(Object o, long offset) - { - return unsafe.getShort( o, offset ) ; - } - /** @see #putInt(Object, long, int) */ - public final void putShort(Object o, long offset, short x) - { - unsafe.putShort( o, offset, x ) ; - } - /** @see #getInt(Object, long) */ - public final char getChar(Object o, long offset) - { - return unsafe.getChar( o, offset ) ; - } - /** @see #putInt(Object, long, int) */ - public final void putChar(Object o, long offset, char x) - { - unsafe.putChar( o, offset, x ) ; - } - /** @see #getInt(Object, long) */ - public final long getLong(Object o, long offset) - { - return unsafe.getLong( o, offset ) ; - } - /** @see #putInt(Object, long, int) */ - public final void putLong(Object o, long offset, long x) - { - unsafe.putLong( o, offset, x ) ; - } - /** @see #getInt(Object, long) */ - public final float getFloat(Object o, long offset) - { - return unsafe.getFloat( o, offset ) ; - } - /** @see #putInt(Object, long, int) */ - public final void putFloat(Object o, long offset, float x) - { - unsafe.putFloat( o, offset, x ) ; - } - /** @see #getInt(Object, long) */ - public final double getDouble(Object o, long offset) - { - return unsafe.getDouble( o, offset ) ; - } - /** @see #putInt(Object, long, int) */ - public final void putDouble(Object o, long offset, double x) - { - unsafe.putDouble( o, offset, x ) ; - } - - /** - * This constant differs from all results that will ever be returned from - * {@link #objectFieldOffset}. - */ - public static final long INVALID_FIELD_OFFSET = -1; - - /** - * Returns the offset of a non-static field. - */ - public final long objectFieldOffset(Field f) - { - return unsafe.objectFieldOffset( f ) ; - } - - /** - * Returns the offset of a static field. - */ - public final long staticFieldOffset(Field f) - { - return unsafe.staticFieldOffset( f ) ; - } - - /** - * Ensure that the class has been initalized. - * @param cl the class to ensure is initialized - */ - public final void ensureClassInitialized(Class cl) { - unsafe.ensureClassInitialized(cl); - } - - - /** Throw the exception. - * The exception may be an undeclared checked exception. - */ - public final void throwException(Throwable ee) - { - unsafe.throwException( ee ) ; - } - - /** - * Obtain a constructor for Class cl. - * This is used to create a constructor for Serializable classes that - * construct an instance of the Serializable class using the - * no args constructor of the first non-Serializable superclass - * of the Serializable class. - */ - public final Constructor newConstructorForSerialization( Class cl ) { - return reflectionFactory.newConstructorForSerialization( cl ) ; - } - - public final Constructor newConstructorForExternalization(Class cl) { - return reflectionFactory.newConstructorForExternalization( cl ) ; - } - - /** - * Invokes the supplied constructor, adding the provided protection domains - * to the invocation stack before invoking {@code Constructor::newInstance}. - * - * This is equivalent to calling - * {@code ReflectionFactory.newInstanceForSerialization(cons,domains)}. - * - * @param cons A constructor obtained from {@code - * newConstructorForSerialization} or {@code - * newConstructorForExternalization}. - * - * @param domains An array of protection domains that limit the privileges - * with which the constructor is invoked. Can be {@code null} - * or empty, in which case privileges are only limited by the - * {@linkplain AccessController#getContext() current context}. - * - * @return A new object built from the provided constructor. - * - * @throws NullPointerException if {@code cons} is {@code null}. - * @throws InstantiationException if thrown by {@code cons.newInstance()}. - * @throws InvocationTargetException if thrown by {@code cons.newInstance()}. - * @throws IllegalAccessException if thrown by {@code cons.newInstance()}. - */ - public final Object newInstanceForSerialization(Constructor cons, - ProtectionDomain[] domains) - throws InstantiationException, InvocationTargetException, IllegalAccessException - { - return reflectionFactory.newInstanceForSerialization(cons, domains); - } - - /** - * Returns true if the given class defines a static initializer method, - * false otherwise. - */ - public final boolean hasStaticInitializerForSerialization(Class cl) { - return reflectionFactory.hasStaticInitializerForSerialization(cl); - } - - public final MethodHandle writeObjectForSerialization(Class cl) { - return reflectionFactory.writeObjectForSerialization(cl); - } - - public final MethodHandle readObjectForSerialization(Class cl) { - return reflectionFactory.readObjectForSerialization(cl); - } - - public final MethodHandle readObjectNoDataForSerialization(Class cl) { - return reflectionFactory.readObjectNoDataForSerialization(cl); - } - - public final MethodHandle readResolveForSerialization(Class cl) { - return reflectionFactory.readResolveForSerialization(cl); - } - - public final MethodHandle writeReplaceForSerialization(Class cl) { - return reflectionFactory.writeReplaceForSerialization(cl); - } - - /** - * Return a new OptionalDataException instance. - * @return a new OptionalDataException instance - */ - public final OptionalDataException newOptionalDataExceptionForSerialization(boolean bool) { - return reflectionFactory.newOptionalDataExceptionForSerialization(bool); - } - -} diff --git a/src/java.corba/share/classes/sun/corba/BridgePermission.java b/src/java.corba/share/classes/sun/corba/BridgePermission.java deleted file mode 100644 index a8428142549..00000000000 --- a/src/java.corba/share/classes/sun/corba/BridgePermission.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.corba ; - -import java.security.BasicPermission ; - -/** Permission class used to protect access to the sun.corba.Bridge - * object. The only name valid here is "getBridge". The - * BridgePermission("getBridge") permission must be held by the - * caller of sun.corba.Bridge.get(). - */ -public final class BridgePermission extends BasicPermission -{ - /** - * Creates a new BridgePermission with the specified name. - * The name is the symbolic name of the BridgePermission. - * The only valid name here is "getBridge". - * - * @param name the name of the BridgePermission. - */ - public BridgePermission(String name) - { - super(name); - } - - /** - * Creates a new BridgePermission object with the specified name. - * The name is the symbolic name of the BridgePermission, and the - * actions String is currently unused and should be null. - * The only valid name here is "getBridge". - * - * @param name the name of the BridgePermission. - * @param actions should be null. - */ - - public BridgePermission(String name, String actions) - { - super(name, actions); - } -} diff --git a/src/java.corba/share/classes/sun/corba/EncapsInputStreamFactory.java b/src/java.corba/share/classes/sun/corba/EncapsInputStreamFactory.java deleted file mode 100644 index 236a680cada..00000000000 --- a/src/java.corba/share/classes/sun/corba/EncapsInputStreamFactory.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package sun.corba; - -import java.nio.ByteBuffer; -import java.security.AccessController; -import java.security.PrivilegedAction; - - -import com.sun.corba.se.impl.encoding.EncapsInputStream; -import com.sun.corba.se.impl.encoding.TypeCodeInputStream; -import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; -import com.sun.corba.se.pept.protocol.MessageMediator; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.orb.ORB; -import com.sun.org.omg.SendingContext.CodeBase; - -public class EncapsInputStreamFactory { - - public static EncapsInputStream newEncapsInputStream( - final org.omg.CORBA.ORB orb, final byte[] buf, final int size, - final boolean littleEndian, final GIOPVersion version) { - return AccessController - .doPrivileged(new PrivilegedAction() { - @Override - public EncapsInputStream run() { - return new EncapsInputStream(orb, buf, size, - littleEndian, version); - } - }); - } - - public static EncapsInputStream newEncapsInputStream( - final org.omg.CORBA.ORB orb, final ByteBuffer byteBuffer, - final int size, final boolean littleEndian, - final GIOPVersion version) { - return AccessController - .doPrivileged(new PrivilegedAction() { - @Override - public EncapsInputStream run() { - return new EncapsInputStream(orb, byteBuffer, size, - littleEndian, version); - } - }); - } - - public static EncapsInputStream newEncapsInputStream( - final org.omg.CORBA.ORB orb, final byte[] data, final int size) { - return AccessController - .doPrivileged(new PrivilegedAction() { - @Override - public EncapsInputStream run() { - return new EncapsInputStream(orb, data, size); - } - }); - } - - public static EncapsInputStream newEncapsInputStream( - final EncapsInputStream eis) { - return AccessController - .doPrivileged(new PrivilegedAction() { - @Override - public EncapsInputStream run() { - return new EncapsInputStream(eis); - } - }); - } - - public static EncapsInputStream newEncapsInputStream( - final org.omg.CORBA.ORB orb, final byte[] data, final int size, - final GIOPVersion version) { - return AccessController - .doPrivileged(new PrivilegedAction() { - @Override - public EncapsInputStream run() { - return new EncapsInputStream(orb, data, size, version); - } - }); - } - - public static EncapsInputStream newEncapsInputStream( - final org.omg.CORBA.ORB orb, final byte[] data, final int size, - final GIOPVersion version, final CodeBase codeBase) { - return AccessController - .doPrivileged(new PrivilegedAction() { - @Override - public EncapsInputStream run() { - return new EncapsInputStream(orb, data, size, version, - codeBase); - } - }); - } - - public static TypeCodeInputStream newTypeCodeInputStream( - final org.omg.CORBA.ORB orb, final byte[] buf, final int size, - final boolean littleEndian, final GIOPVersion version) { - return AccessController - .doPrivileged(new PrivilegedAction() { - @Override - public TypeCodeInputStream run() { - return new TypeCodeInputStream(orb, buf, size, - littleEndian, version); - } - }); - } - - public static TypeCodeInputStream newTypeCodeInputStream( - final org.omg.CORBA.ORB orb, final ByteBuffer byteBuffer, - final int size, final boolean littleEndian, - final GIOPVersion version) { - return AccessController - .doPrivileged(new PrivilegedAction() { - @Override - public TypeCodeInputStream run() { - return new TypeCodeInputStream(orb, byteBuffer, size, - littleEndian, version); - } - }); - } - - public static TypeCodeInputStream newTypeCodeInputStream( - final org.omg.CORBA.ORB orb, final byte[] data, final int size) { - return AccessController - .doPrivileged(new PrivilegedAction() { - @Override - public TypeCodeInputStream run() { - return new TypeCodeInputStream(orb, data, size); - } - }); - } -} diff --git a/src/java.corba/share/classes/sun/corba/JavaCorbaAccess.java b/src/java.corba/share/classes/sun/corba/JavaCorbaAccess.java deleted file mode 100644 index 0d21551ef3e..00000000000 --- a/src/java.corba/share/classes/sun/corba/JavaCorbaAccess.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.corba; - -import com.sun.corba.se.impl.io.ValueHandlerImpl; - -public interface JavaCorbaAccess { - public ValueHandlerImpl newValueHandlerImpl(); - public Class loadClass(String className) throws ClassNotFoundException; -} diff --git a/src/java.corba/share/classes/sun/corba/OutputStreamFactory.java b/src/java.corba/share/classes/sun/corba/OutputStreamFactory.java deleted file mode 100644 index d723e22c004..00000000000 --- a/src/java.corba/share/classes/sun/corba/OutputStreamFactory.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.corba; - -import com.sun.corba.se.impl.corba.AnyImpl; -import com.sun.corba.se.impl.encoding.BufferManagerWrite; -import com.sun.corba.se.impl.encoding.CDROutputObject; -import com.sun.corba.se.impl.encoding.EncapsOutputStream; -import com.sun.corba.se.impl.encoding.TypeCodeOutputStream; -import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; - -import com.sun.corba.se.pept.protocol.MessageMediator; - -import com.sun.corba.se.spi.orb.ORB; -import com.sun.corba.se.spi.transport.CorbaConnection; -import com.sun.corba.se.spi.ior.iiop.GIOPVersion; -import com.sun.corba.se.spi.protocol.CorbaMessageMediator; - -import java.security.AccessController; -import java.security.PrivilegedAction; - -public final class OutputStreamFactory { - - private OutputStreamFactory() { - } - - public static TypeCodeOutputStream newTypeCodeOutputStream( - final ORB orb) { - return AccessController.doPrivileged( - new PrivilegedAction() { - @Override - public TypeCodeOutputStream run() { - return new TypeCodeOutputStream(orb); - } - }); - } - - public static TypeCodeOutputStream newTypeCodeOutputStream( - final ORB orb, final boolean littleEndian) { - return AccessController.doPrivileged( - new PrivilegedAction() { - @Override - public TypeCodeOutputStream run() { - return new TypeCodeOutputStream(orb, littleEndian); - } - }); - } - - public static EncapsOutputStream newEncapsOutputStream( - final ORB orb) { - return AccessController.doPrivileged( - new PrivilegedAction() { - @Override - public EncapsOutputStream run() { - return new EncapsOutputStream( - (com.sun.corba.se.spi.orb.ORB)orb); - } - }); - } - - public static EncapsOutputStream newEncapsOutputStream( - final ORB orb, final GIOPVersion giopVersion) { - return AccessController.doPrivileged( - new PrivilegedAction() { - @Override - public EncapsOutputStream run() { - return new EncapsOutputStream( - (com.sun.corba.se.spi.orb.ORB)orb, giopVersion); - } - }); - } - - public static EncapsOutputStream newEncapsOutputStream( - final ORB orb, final boolean isLittleEndian) { - return AccessController.doPrivileged( - new PrivilegedAction() { - @Override - public EncapsOutputStream run() { - return new EncapsOutputStream( - (com.sun.corba.se.spi.orb.ORB)orb, isLittleEndian); - } - }); - } - - public static CDROutputObject newCDROutputObject( - final ORB orb, final MessageMediator messageMediator, - final Message header, final byte streamFormatVersion) { - return AccessController.doPrivileged( - new PrivilegedAction() { - @Override - public CDROutputObject run() { - return new CDROutputObject(orb, messageMediator, - header, streamFormatVersion); - } - }); - } - - public static CDROutputObject newCDROutputObject( - final ORB orb, final MessageMediator messageMediator, - final Message header, final byte streamFormatVersion, - final int strategy) { - return AccessController.doPrivileged( - new PrivilegedAction() { - @Override - public CDROutputObject run() { - return new CDROutputObject(orb, messageMediator, - header, streamFormatVersion, strategy); - } - }); - } - - public static CDROutputObject newCDROutputObject( - final ORB orb, final CorbaMessageMediator mediator, - final GIOPVersion giopVersion, final CorbaConnection connection, - final Message header, final byte streamFormatVersion) { - return AccessController.doPrivileged( - new PrivilegedAction() { - @Override - public CDROutputObject run() { - return new CDROutputObject(orb, mediator, - giopVersion, connection, header, streamFormatVersion); - } - }); - } - -} diff --git a/src/java.corba/share/classes/sun/corba/SharedSecrets.java b/src/java.corba/share/classes/sun/corba/SharedSecrets.java deleted file mode 100644 index cd9078e1814..00000000000 --- a/src/java.corba/share/classes/sun/corba/SharedSecrets.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.corba; - -import java.lang.reflect.Field; -import java.security.AccessController; -import java.security.PrivilegedAction; - -import com.sun.corba.se.impl.io.ValueUtility; -import sun.misc.Unsafe; - -/** A repository of "shared secrets", which are a mechanism for - calling implementation-private methods in another package without - using reflection. A package-private class implements a public - interface and provides the ability to call package-private methods - within that package; the object implementing that interface is - provided through a third package to which access is restricted. - This framework avoids the primary disadvantage of using reflection - for this purpose, namely the loss of compile-time checking. */ - -// SharedSecrets cloned in corba repo to avoid build issues -public class SharedSecrets { - - /** Access to Unsafe to read/write fields. */ - private static final Unsafe unsafe = AccessController.doPrivileged( - (PrivilegedAction)() -> { - try { - Field field = Unsafe.class.getDeclaredField("theUnsafe"); - field.setAccessible(true); - return (Unsafe)field.get(null); - - } catch (NoSuchFieldException |IllegalAccessException ex) { - throw new InternalError("Unsafe.theUnsafe field not available", ex); - } - } - ); - - private static JavaCorbaAccess javaCorbaAccess; - - public static JavaCorbaAccess getJavaCorbaAccess() { - if (javaCorbaAccess == null) { - // Ensure ValueUtility is initialized; we know that that class - // provides the shared secret - unsafe.ensureClassInitialized(ValueUtility.class); - } - return javaCorbaAccess; - } - - public static void setJavaCorbaAccess(JavaCorbaAccess access) { - javaCorbaAccess = access; - } - -} diff --git a/src/java.corba/share/classes/sun/corba/package.html b/src/java.corba/share/classes/sun/corba/package.html deleted file mode 100644 index c3c228e7c80..00000000000 --- a/src/java.corba/share/classes/sun/corba/package.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - package - - - -Provides an internal API that the Sun ORB implementation uses to -access JVM functions that have no standard APIs. - - diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaMenuBarBorder.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaMenuBarBorder.java index bd5ab2b6a8a..b3276c9c0d7 100644 --- a/src/java.desktop/macosx/classes/com/apple/laf/AquaMenuBarBorder.java +++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaMenuBarBorder.java @@ -31,13 +31,14 @@ import java.awt.Graphics; import java.awt.Insets; import javax.swing.border.Border; +import javax.swing.plaf.UIResource; import sun.swing.SwingUtilities2; /** * The class represents the border of a {@code JMenuBar}. */ -public class AquaMenuBarBorder implements Border { +public class AquaMenuBarBorder implements Border, UIResource { @Override public void paintBorder(final Component c, final Graphics g, final int x, diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m index 03829b3dc1a..ba0c44c8167 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m @@ -954,11 +954,6 @@ AWT_ASSERT_APPKIT_THREAD; return lastKeyWindow; } -- (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame { - return !NSEqualSizes(self.nsWindow.frame.size, newFrame.size); -} - - @end // AWTWindow diff --git a/src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.m b/src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.m index 49b26a4eb52..0c3fded4bea 100644 --- a/src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.m +++ b/src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.m @@ -342,9 +342,7 @@ AWT_ASSERT_APPKIT_THREAD; #define DRAGMASK (NSMouseMovedMask | NSLeftMouseDraggedMask | NSRightMouseDownMask | NSRightMouseDraggedMask | NSLeftMouseUpMask | NSRightMouseUpMask | NSFlagsChangedMask | NSKeyDownMask) -#if defined(MAC_OS_X_VERSION_10_12) && \ - MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12 && \ - __LP64__ +#if defined(MAC_OS_X_VERSION_10_12) && __LP64__ // 10.12 changed `mask` to NSEventMask (unsigned long long) for x86_64 builds. - (NSEvent *)nextEventMatchingMask:(NSEventMask)mask #else diff --git a/src/java.desktop/macosx/native/libsplashscreen/libpng/zlib.h b/src/java.desktop/macosx/native/libsplashscreen/libpng/zlib.h new file mode 100644 index 00000000000..2343fac0171 --- /dev/null +++ b/src/java.desktop/macosx/native/libsplashscreen/libpng/zlib.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * This header file is used to hijack the include of "zlib.h" from libpng on + * Macos. We do that to be able to build on macos 10.13 or later, but still + * keep binary compatibility with older versions (as specified to configure). + * + * The problem is that in 10.13, Macos shipped with a newer version of zlib, + * which exports the function inflateValidate. There is a call to this + * function in pngrutil.c, guarded by a preprocessor check of ZLIB_VERNUM being + * high enough. If we compile this call in and link to the newer version of + * zlib, we will get link errors if the code is executed on an older Mac with + * an older version of zlib. + * + * The zlib.h header in Macos has been annotated with Macos specific macros that + * guard these kinds of version specific APIs, but libpng is not using those + * checks in its conditionals, just ZLIB_VERNUM. To fix this, we check for the + * MAC_OS_X_VERSION_MIN_REQUIRED macro here and adjust the ZLIB_VERNUM to the + # known version bundled with that release. This solution is certainly a hack, + * but it seems the affected versions of zlib.h are compatible enough for this + * to work. + */ + +#include +#include + +#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12 +# undef ZLIB_VERNUM +# define ZLIB_VERNUM 0x1250 +#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_13 +# undef ZLIB_VERNUM +# define ZLIB_VERNUM 0x1280 +#endif diff --git a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java index e744095d2f7..a04926083cf 100644 --- a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java +++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -374,7 +374,10 @@ public class JPEGImageReader extends ImageReader { // And set current image since we've read it now currentImage = 0; } - if (seekForwardOnly) { + // If the image positions list is empty as in the case of a tables-only + // stream, then attempting to access the element at index + // imagePositions.size() - 1 will cause an IndexOutOfBoundsException. + if (seekForwardOnly && !imagePositions.isEmpty()) { Long pos = imagePositions.get(imagePositions.size()-1); iis.flushBefore(pos.longValue()); } @@ -492,6 +495,11 @@ public class JPEGImageReader extends ImageReader { if (!tablesOnlyChecked) { checkTablesOnly(); } + // If the image positions list is empty as in the case of a tables-only + // stream, then no image data can be read. + if (imagePositions.isEmpty()) { + throw new IIOException("No image data present to read"); + } if (imageIndex < imagePositions.size()) { iis.seek(imagePositions.get(imageIndex).longValue()); } else { diff --git a/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java b/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java index 7a43480a23c..efd7dba0c59 100644 --- a/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java +++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -428,12 +428,16 @@ public class PNGImageReader extends ImageReader { private void parse_iCCP_chunk(int chunkLength) throws IOException { String keyword = readNullTerminatedString("ISO-8859-1", 80); + int compressedProfileLength = chunkLength - keyword.length() - 2; + if (compressedProfileLength <= 0) { + throw new IIOException("iCCP chunk length is not proper"); + } metadata.iCCP_profileName = keyword; metadata.iCCP_compressionMethod = stream.readUnsignedByte(); byte[] compressedProfile = - new byte[chunkLength - keyword.length() - 2]; + new byte[compressedProfileLength]; stream.readFully(compressedProfile); metadata.iCCP_compressedProfile = compressedProfile; @@ -463,7 +467,11 @@ public class PNGImageReader extends ImageReader { String text; pos = stream.getStreamPosition(); - byte[] b = new byte[(int)(chunkStart + chunkLength - pos)]; + int textLength = (int)(chunkStart + chunkLength - pos); + if (textLength <= 0) { + throw new IIOException("iTXt chunk length is not proper"); + } + byte[] b = new byte[textLength]; stream.readFully(b); if (compressionFlag == 1) { // Decompress the text @@ -515,12 +523,16 @@ public class PNGImageReader extends ImageReader { private void parse_sPLT_chunk(int chunkLength) throws IOException, IIOException { metadata.sPLT_paletteName = readNullTerminatedString("ISO-8859-1", 80); - chunkLength -= metadata.sPLT_paletteName.length() + 1; + int remainingChunkLength = chunkLength - + (metadata.sPLT_paletteName.length() + 1); + if (remainingChunkLength <= 0) { + throw new IIOException("sPLT chunk length is not proper"); + } int sampleDepth = stream.readUnsignedByte(); metadata.sPLT_sampleDepth = sampleDepth; - int numEntries = chunkLength/(4*(sampleDepth/8) + 2); + int numEntries = remainingChunkLength/(4*(sampleDepth/8) + 2); metadata.sPLT_red = new int[numEntries]; metadata.sPLT_green = new int[numEntries]; metadata.sPLT_blue = new int[numEntries]; @@ -558,9 +570,13 @@ public class PNGImageReader extends ImageReader { private void parse_tEXt_chunk(int chunkLength) throws IOException { String keyword = readNullTerminatedString("ISO-8859-1", 80); + int textLength = chunkLength - keyword.length() - 1; + if (textLength <= 0) { + throw new IIOException("tEXt chunk length is not proper"); + } metadata.tEXt_keyword.add(keyword); - byte[] b = new byte[chunkLength - keyword.length() - 1]; + byte[] b = new byte[textLength]; stream.readFully(b); metadata.tEXt_text.add(new String(b, "ISO-8859-1")); @@ -596,7 +612,7 @@ public class PNGImageReader extends ImageReader { // Alpha table may have fewer entries than RGB palette int maxEntries = metadata.PLTE_red.length; int numEntries = chunkLength; - if (numEntries > maxEntries) { + if (numEntries > maxEntries && maxEntries > 0) { processWarningOccurred( "tRNS chunk has more entries than prior PLTE chunk, ignoring extras."); numEntries = maxEntries; @@ -652,12 +668,16 @@ public class PNGImageReader extends ImageReader { private void parse_zTXt_chunk(int chunkLength) throws IOException { String keyword = readNullTerminatedString("ISO-8859-1", 80); + int textLength = chunkLength - keyword.length() - 2; + if (textLength <= 0) { + throw new IIOException("zTXt chunk length is not proper"); + } metadata.zTXt_keyword.add(keyword); int method = stream.readUnsignedByte(); metadata.zTXt_compressionMethod.add(method); - byte[] b = new byte[chunkLength - keyword.length() - 2]; + byte[] b = new byte[textLength]; stream.readFully(b); metadata.zTXt_text.add(new String(inflate(b), "ISO-8859-1")); @@ -738,6 +758,17 @@ public class PNGImageReader extends ImageReader { case IDAT_TYPE: // If chunk type is 'IDAT', we've reached the image data. if (imageStartPosition == -1L) { + /* + * The PNG specification mandates that if colorType is + * PNG_COLOR_PALETTE then the PLTE chunk should appear + * before the first IDAT chunk. + */ + if (colorType == PNG_COLOR_PALETTE && + !(metadata.PLTE_present)) + { + throw new IIOException("Required PLTE chunk" + + " missing"); + } /* * PNGs may contain multiple IDAT chunks containing * a portion of image data. We store the position of @@ -986,7 +1017,9 @@ public class PNGImageReader extends ImageReader { } int inputBands = inputBandsForColorType[metadata.IHDR_colorType]; - int bytesPerRow = (inputBands*passWidth*metadata.IHDR_bitDepth + 7)/8; + int bitsPerRow = Math. + multiplyExact((inputBands * metadata.IHDR_bitDepth), passWidth); + int bytesPerRow = (bitsPerRow + 7) / 8; // Read the image row-by-row for (int srcY = 0; srcY < passHeight; srcY++) { @@ -1037,7 +1070,8 @@ public class PNGImageReader extends ImageReader { int bytesPerPixel = (bitDepth == 16) ? 2 : 1; bytesPerPixel *= inputBands; - int bytesPerRow = (inputBands*passWidth*bitDepth + 7)/8; + int bitsPerRow = Math.multiplyExact((inputBands * bitDepth), passWidth); + int bytesPerRow = (bitsPerRow + 7) / 8; int eltsPerRow = (bitDepth == 16) ? bytesPerRow/2 : bytesPerRow; // If no pixels need updating, just skip the input data diff --git a/src/java.desktop/share/classes/java/awt/Component.java b/src/java.desktop/share/classes/java/awt/Component.java index 50aa9757beb..e16f631948b 100644 --- a/src/java.desktop/share/classes/java/awt/Component.java +++ b/src/java.desktop/share/classes/java/awt/Component.java @@ -9310,7 +9310,9 @@ public abstract class Component implements ImageObserver, MenuContainer, * when shown/hidden.. * @since 1.3 */ - protected class AccessibleAWTComponentHandler implements ComponentListener { + protected class AccessibleAWTComponentHandler implements ComponentListener, Serializable { + private static final long serialVersionUID = -1009684107426231869L; + public void componentHidden(ComponentEvent e) { if (accessibleContext != null) { accessibleContext.firePropertyChange( @@ -9340,7 +9342,9 @@ public abstract class Component implements ImageObserver, MenuContainer, * when focus events happen * @since 1.3 */ - protected class AccessibleAWTFocusHandler implements FocusListener { + protected class AccessibleAWTFocusHandler implements FocusListener, Serializable { + private static final long serialVersionUID = 3150908257351582233L; + public void focusGained(FocusEvent event) { if (accessibleContext != null) { accessibleContext.firePropertyChange( diff --git a/src/java.desktop/share/classes/java/awt/Container.java b/src/java.desktop/share/classes/java/awt/Container.java index c8e2943f74b..5b3d404ff4f 100644 --- a/src/java.desktop/share/classes/java/awt/Container.java +++ b/src/java.desktop/share/classes/java/awt/Container.java @@ -40,6 +40,7 @@ import java.io.ObjectOutputStream; import java.io.ObjectStreamField; import java.io.PrintStream; import java.io.PrintWriter; +import java.io.Serializable; import java.lang.ref.WeakReference; import java.security.AccessController; @@ -3849,7 +3850,9 @@ public class Container extends Component { * @since 1.3 */ protected class AccessibleContainerHandler - implements ContainerListener { + implements ContainerListener, Serializable { + private static final long serialVersionUID = -480855353991814677L; + public void componentAdded(ContainerEvent e) { Component c = e.getChild(); if (c != null && c instanceof Accessible) { diff --git a/src/java.desktop/share/classes/java/awt/Toolkit.java b/src/java.desktop/share/classes/java/awt/Toolkit.java index 8a36c2977b1..7a4372ace66 100644 --- a/src/java.desktop/share/classes/java/awt/Toolkit.java +++ b/src/java.desktop/share/classes/java/awt/Toolkit.java @@ -678,6 +678,11 @@ public abstract class Toolkit { * If the connection to the specified URL requires * either {@code URLPermission} or {@code SocketPermission}, * then {@code URLPermission} is used for security checks. + * For compatibility with pre-1.2 security managers, if the access + * is denied with {@code FilePermission} or {@code SocketPermission}, + * the method throws the {@code SecurityException} + * if the corresponding 1.1-style SecurityManager.checkXXX method + * also denies permission. * @param url the URL to use in fetching the pixel data. * @return an image which gets its pixel data from * the specified URL. @@ -719,6 +724,11 @@ public abstract class Toolkit { * If the connection to the specified URL requires * either {@code URLPermission} or {@code SocketPermission}, * then {@code URLPermission} is used for security checks. + * For compatibility with pre-1.2 security managers, if the access + * is denied with {@code FilePermission} or {@code SocketPermission}, + * the method throws {@code SecurityException} + * if the corresponding 1.1-style SecurityManager.checkXXX method + * also denies permission. * @param url the URL to use in fetching the pixel data. * @return an image which gets its pixel data from * the specified URL. diff --git a/src/java.desktop/share/classes/java/awt/image/BandedSampleModel.java b/src/java.desktop/share/classes/java/awt/image/BandedSampleModel.java index b09b0c0a3ee..26654bdbe92 100644 --- a/src/java.desktop/share/classes/java/awt/image/BandedSampleModel.java +++ b/src/java.desktop/share/classes/java/awt/image/BandedSampleModel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -185,7 +185,33 @@ public final class BandedSampleModel extends ComponentSampleModel public DataBuffer createDataBuffer() { DataBuffer dataBuffer = null; + // The minimum size required to store samples of one band int size = scanlineStride * height; + + if (numBanks == 1) { + /* + * The sample model contains a single bank of data buffer. Hence + * we need to compute the size required to store samples of all + * bands including the respective offsets. + */ + int sizePerBand = size; + size += bandOffsets[0]; + for (int index = 1; index < bandOffsets.length; index++) { + size += (bandOffsets[index] - size) + sizePerBand; + } + } else { + /* + * The sample model contains multiple banks of data buffer where + * each bank would correspond to a particular band. Hence we need + * to compute only the additional space required for band offsets. + */ + int maxBandOffset = bandOffsets[0]; + for (int index = 1; index < bandOffsets.length; index++) { + maxBandOffset = Math.max(maxBandOffset, bandOffsets[index]); + } + size += maxBandOffset; + } + switch (dataType) { case DataBuffer.TYPE_BYTE: dataBuffer = new DataBufferByte(size, numBanks); diff --git a/src/java.desktop/share/classes/javax/swing/DefaultRowSorter.java b/src/java.desktop/share/classes/javax/swing/DefaultRowSorter.java index 542e1cb3c16..8a82e50647b 100644 --- a/src/java.desktop/share/classes/javax/swing/DefaultRowSorter.java +++ b/src/java.desktop/share/classes/javax/swing/DefaultRowSorter.java @@ -1033,8 +1033,10 @@ public abstract class DefaultRowSorter extends RowSorter { // Not transformed, nothing to do. return false; } - if (!sorted || (lastRow - firstRow) > viewToModel.length / 10) { - // We either weren't sorted, or to much changed, sort it all + if (!sorted || viewToModel.length == 0 || + (lastRow - firstRow) > viewToModel.length / 10) { + // We either weren't sorted, or to much changed, sort it all or + // this is the first row added and we have to update diffeent caches sort(); return false; } diff --git a/src/java.desktop/share/classes/javax/swing/tree/VariableHeightLayoutCache.java b/src/java.desktop/share/classes/javax/swing/tree/VariableHeightLayoutCache.java index fea3a16131d..b2adcc6f0d4 100644 --- a/src/java.desktop/share/classes/javax/swing/tree/VariableHeightLayoutCache.java +++ b/src/java.desktop/share/classes/javax/swing/tree/VariableHeightLayoutCache.java @@ -409,11 +409,10 @@ public class VariableHeightLayoutCache extends AbstractLayoutCache { */ public void treeNodesChanged(TreeModelEvent e) { if(e != null) { - int changedIndexs[]; - TreeStateNode changedNode; + int changedIndexs[] = e.getChildIndices(); + TreeStateNode changedNode = getNodeForPath( + SwingUtilities2.getTreePath(e, getModel()), false, false); - changedIndexs = e.getChildIndices(); - changedNode = getNodeForPath(SwingUtilities2.getTreePath(e, getModel()), false, false); if(changedNode != null) { Object changedValue = changedNode.getValue(); @@ -421,17 +420,12 @@ public class VariableHeightLayoutCache extends AbstractLayoutCache { child indexs that are passed in. */ changedNode.updatePreferredSize(); if(changedNode.hasBeenExpanded() && changedIndexs != null) { - int counter; - TreeStateNode changedChildNode; - - for(counter = 0; counter < changedIndexs.length; - counter++) { - changedChildNode = (TreeStateNode)changedNode - .getChildAt(changedIndexs[counter]); + for(int index : changedIndexs) { + TreeStateNode changedChildNode = (TreeStateNode)changedNode + .getChildAt(index); /* Reset the user object. */ changedChildNode.setUserObject - (treeModel.getChild(changedValue, - changedIndexs[counter])); + (treeModel.getChild(changedValue, index)); changedChildNode.updatePreferredSize(); } } @@ -462,34 +456,26 @@ public class VariableHeightLayoutCache extends AbstractLayoutCache { */ public void treeNodesInserted(TreeModelEvent e) { if(e != null) { - int changedIndexs[]; - TreeStateNode changedParentNode; - - changedIndexs = e.getChildIndices(); - changedParentNode = getNodeForPath(SwingUtilities2.getTreePath(e, getModel()), false, false); + int changedIndexs[] = e.getChildIndices(); + TreeStateNode changedParentNode = getNodeForPath( + SwingUtilities2.getTreePath(e, getModel()), false, false); /* Only need to update the children if the node has been expanded once. */ // PENDING(scott): make sure childIndexs is sorted! if(changedParentNode != null && changedIndexs != null && changedIndexs.length > 0) { if(changedParentNode.hasBeenExpanded()) { - boolean makeVisible; - int counter; - Object changedParent; - TreeStateNode newNode; - int oldChildCount = changedParentNode. - getChildCount(); + boolean makeVisible =((changedParentNode == root && + !rootVisible) || + (changedParentNode.getRow() != -1 && + changedParentNode.isExpanded())); + int oldChildCount = changedParentNode.getChildCount(); - changedParent = changedParentNode.getValue(); - makeVisible = ((changedParentNode == root && - !rootVisible) || - (changedParentNode.getRow() != -1 && - changedParentNode.isExpanded())); - for(counter = 0;counter < changedIndexs.length;counter++) + for(int index : changedIndexs) { - newNode = this.createNodeAt(changedParentNode, - changedIndexs[counter]); + this.createNodeAt(changedParentNode, index); } + if(oldChildCount == 0) { // Update the size of the parent. changedParentNode.updatePreferredSize(); @@ -643,7 +629,7 @@ public class VariableHeightLayoutCache extends AbstractLayoutCache { rebuild(true); } else if(changedNode != null) { - int nodeIndex, oldRow; + int nodeIndex; TreeStateNode newNode, parent; boolean wasExpanded, wasVisible; int newIndex; @@ -925,24 +911,22 @@ public class VariableHeightLayoutCache extends AbstractLayoutCache { * row index, the last row index is returned. */ private int getRowContainingYLocation(int location) { + final int rows = getRowCount(); + + if(rows <= 0) + return -1; if(isFixedRowHeight()) { - if(getRowCount() == 0) - return -1; - return Math.max(0, Math.min(getRowCount() - 1, + return Math.max(0, Math.min(rows - 1, location / getRowHeight())); } - int max, maxY, mid, min, minY; - TreeStateNode node; + int max = rows, min = 0, mid = 0; - if((max = getRowCount()) <= 0) - return -1; - mid = min = 0; while(min < max) { mid = (max - min) / 2 + min; - node = (TreeStateNode)visibleNodes.elementAt(mid); - minY = node.getYOrigin(); - maxY = minY + node.getPreferredHeight(); + TreeStateNode node = (TreeStateNode)visibleNodes.elementAt(mid); + int minY = node.getYOrigin(); + int maxY = minY + node.getPreferredHeight(); if(location < minY) { max = mid - 1; } @@ -954,8 +938,8 @@ public class VariableHeightLayoutCache extends AbstractLayoutCache { } if(min == max) { mid = min; - if(mid >= getRowCount()) - mid = getRowCount() - 1; + if(mid >= rows) + mid = rows - 1; } return mid; } @@ -1008,9 +992,9 @@ public class VariableHeightLayoutCache extends AbstractLayoutCache { if(nodeWidth > maxWidth) maxWidth = nodeWidth; } + return maxWidth; } - /** * Responsible for creating a TreeStateNode that will be used * to track display information about value. @@ -1362,17 +1346,11 @@ public class VariableHeightLayoutCache extends AbstractLayoutCache { isExpanded(), boundsBuffer); - if(bounds == null) { + if(bounds == null || bounds.height == 0) { xOrigin = 0; preferredWidth = preferredHeight = 0; updateNodeSizes = true; - } - else if(bounds.height == 0) { - xOrigin = 0; - preferredWidth = preferredHeight = 0; - updateNodeSizes = true; - } - else { + } else { xOrigin = bounds.x; preferredWidth = bounds.width; if(isFixedRowHeight()) @@ -1477,24 +1455,14 @@ public class VariableHeightLayoutCache extends AbstractLayoutCache { Object realNode = getValue(); TreeModel treeModel = getModel(); int count = treeModel.getChildCount(realNode); - + int offset = originalRow == -1 ? -1 : originalRow + 1; hasBeenExpanded = true; - if(originalRow == -1) { - for (int i = 0; i < count; i++) { - newNode = createNodeForValue(treeModel.getChild - (realNode, i)); - this.add(newNode); - newNode.updatePreferredSize(-1); - } - } - else { - int offset = originalRow + 1; - for (int i = 0; i < count; i++) { - newNode = createNodeForValue(treeModel.getChild - (realNode, i)); - this.add(newNode); - newNode.updatePreferredSize(offset); - } + + for (int i = 0; i < count; i++) { + newNode = createNodeForValue(treeModel.getChild + (realNode, i)); + this.add(newNode); + newNode.updatePreferredSize(offset); } } @@ -1502,14 +1470,9 @@ public class VariableHeightLayoutCache extends AbstractLayoutCache { Enumeration cursor = preorderEnumeration(); cursor.nextElement(); // don't add me, I'm already in - int newYOrigin; + int newYOrigin = isFixed || (this == root && !isRootVisible()) ? + 0 : getYOrigin() + this.getPreferredHeight(); - if(isFixed) - newYOrigin = 0; - else if(this == root && !isRootVisible()) - newYOrigin = 0; - else - newYOrigin = getYOrigin() + this.getPreferredHeight(); TreeStateNode aNode; if(!isFixed) { while (cursor.hasMoreElements()) { @@ -1744,14 +1707,10 @@ public class VariableHeightLayoutCache extends AbstractLayoutCache { protected boolean updateNextIndex() { // nextIndex == -1 identifies receiver, make sure is expanded // before descend. - if(nextIndex == -1 && !parent.isExpanded()) - return false; - - // Check that it can have kids - if(childCount == 0) - return false; - // Make sure next index not beyond child count. - else if(++nextIndex >= childCount) + if((nextIndex == -1 && !parent.isExpanded()) || + childCount == 0 || // Check that it can have kids + ++nextIndex >= childCount) // Make sure next index not beyond + // child count. return false; TreeStateNode child = (TreeStateNode)parent. diff --git a/src/java.desktop/unix/classes/sun/java2d/xr/XRSolidSrcPict.java b/src/java.desktop/unix/classes/sun/java2d/xr/XRSolidSrcPict.java index 03e3bdb18ec..9a7372639ba 100644 --- a/src/java.desktop/unix/classes/sun/java2d/xr/XRSolidSrcPict.java +++ b/src/java.desktop/unix/classes/sun/java2d/xr/XRSolidSrcPict.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,7 +47,7 @@ public class XRSolidSrcPict { public XRSurfaceData prepareSrcPict(int pixelVal) { if(pixelVal != curPixVal) { - xrCol.setColorValues(pixelVal, false); + xrCol.setColorValues(pixelVal, true); con.renderRectangle(srcPict.picture, XRUtils.PictOpSrc, xrCol, 0, 0, 1, 1); this.curPixVal = pixelVal; } diff --git a/src/java.logging/share/classes/java/util/logging/LogManager.java b/src/java.logging/share/classes/java/util/logging/LogManager.java index e864f5ebabf..736f07694f0 100644 --- a/src/java.logging/share/classes/java/util/logging/LogManager.java +++ b/src/java.logging/share/classes/java/util/logging/LogManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -396,12 +396,6 @@ public class LogManager { // Create and retain Logger for the root of the namespace. owner.addLogger(root); - // For backward compatibility: add any handlers configured using - // ".handlers" - owner.createLoggerHandlers("", ".handlers") - .stream() - .forEach(root::addHandler); - // Initialize level if not yet initialized if (!root.isLevelInitialized()) { root.setLevel(defaultLevel); @@ -995,7 +989,8 @@ public class LogManager { } } - private List createLoggerHandlers(final String name, final String handlersPropertyName) + private List createLoggerHandlers(final String name, + final String handlersPropertyName) { String names[] = parseClassNames(handlersPropertyName); List handlers = new ArrayList<>(names.length); @@ -1198,7 +1193,7 @@ public class LogManager { } drainLoggerRefQueueBounded(); LoggerContext cx = getUserContext(); - if (cx.addLocalLogger(logger)) { + if (cx.addLocalLogger(logger) || forceLoadHandlers(logger)) { // Do we have a per logger handler too? // Note: this will add a 200ms penalty loadLoggerHandlers(logger, name, name + ".handlers"); @@ -1208,6 +1203,26 @@ public class LogManager { } } + + // Checks whether the given logger is a special logger + // that still requires handler initialization. + // This method will only return true for the root and + // global loggers and only if called by the thread that + // performs initialization of the LogManager, during that + // initialization. Must only be called by addLogger. + @SuppressWarnings("deprecation") + private boolean forceLoadHandlers(Logger logger) { + // Called just after reading the primordial configuration, in + // the same thread that reads it. + // The root and global logger would already be present in the context + // by this point, but we would not have called loadLoggerHandlers + // yet. + return (logger == rootLogger || logger == Logger.global) + && !initializationDone + && initializedCalled + && configurationLock.isHeldByCurrentThread(); + } + // Private method to set a level on a logger. // If necessary, we raise privilege before doing the call. private static void doSetLevel(final Logger logger, final Level level) { diff --git a/src/java.rmi/share/classes/sun/rmi/server/resources/rmid.properties b/src/java.rmi/share/classes/sun/rmi/server/resources/rmid.properties index e4543689d29..8d76a2a3726 100644 --- a/src/java.rmi/share/classes/sun/rmi/server/resources/rmid.properties +++ b/src/java.rmi/share/classes/sun/rmi/server/resources/rmid.properties @@ -1,6 +1,6 @@ # # -# Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,7 @@ rmid.syntax.log.required=\ # {0} = the (string) illegal argument in question rmid.syntax.illegal.option=\ - illegal option: {0} + invalid option: {0} # {0} = the (string) reason text that came with a thrown exception # "Activation.main" should not be translated, because it's a codepoint diff --git a/src/java.scripting/share/classes/com/sun/tools/script/shell/Main.java b/src/java.scripting/share/classes/com/sun/tools/script/shell/Main.java index cc8127d2cb4..646aab4cffd 100644 --- a/src/java.scripting/share/classes/com/sun/tools/script/shell/Main.java +++ b/src/java.scripting/share/classes/com/sun/tools/script/shell/Main.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -122,7 +122,11 @@ public class Main { } } continue; - } else if (arg.equals("-?") || arg.equals("-help")) { + } else if (arg.equals("-?") || + arg.equals("-h") || + arg.equals("--help") || + // -help: legacy. + arg.equals("-help")) { usage(EXIT_SUCCESS); } else if (arg.equals("-e")) { seenScript = true; diff --git a/src/java.scripting/share/classes/com/sun/tools/script/shell/messages.properties b/src/java.scripting/share/classes/com/sun/tools/script/shell/messages.properties index 4838fb098b4..2e17668b260 100644 --- a/src/java.scripting/share/classes/com/sun/tools/script/shell/messages.properties +++ b/src/java.scripting/share/classes/com/sun/tools/script/shell/messages.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -55,8 +55,7 @@ where [options] include:\n\ \ \-f